diff --git a/.github/workflows/_build.yml b/.github/workflows/_build.yml index 7641c51..6bfd491 100644 --- a/.github/workflows/_build.yml +++ b/.github/workflows/_build.yml @@ -1,14 +1,10 @@ name: Build run-name: Build ${{ inputs.tag || github.sha }} -# Reusable workflow that produces the CLI binaries and Tauri desktop bundles. +# Reusable workflow that produces the CLI binaries. # Called by: # - ci.yml (post-merge verification on dev/main; uploads workflow artifacts only) -# - publish.yml (release publish; uploads artifacts AND attaches them to the published GitHub release) -# -# When inputs.release and inputs.tag are empty strings, tauri-action skips -# release attachment and only produces workflow artifacts. See: -# https://github.com/tauri-apps/tauri-action#workflow-inputs +# - publish.yml (release publish; uploads CLI archives to the published GitHub release) on: workflow_call: @@ -26,10 +22,10 @@ on: type: string default: "@thesolaceproject/emberharmony" -# Permissions are inherited from the caller: ci.yml grants read (artifacts only), -# publish.yml grants write so a release build can upload assets — CLI archives via -# `gh release upload` and desktop bundles via tauri-action. A reusable workflow -# cannot exceed its caller's grant, so jobs do not declare permissions here. +# Permissions are inherited from the caller: ci.yml grants read, and +# publish.yml grants write so the CLI build can upload release assets via +# `gh release upload`. A reusable workflow cannot exceed its caller's grant, +# so jobs do not declare permissions here. jobs: build-cli: @@ -59,171 +55,3 @@ jobs: with: name: emberharmony-cli path: packages/emberharmony/dist - - build-tauri: - needs: build-cli - timeout-minutes: 90 - strategy: - fail-fast: false - matrix: - settings: - - host: macos-latest - target: x86_64-apple-darwin - - host: macos-latest - target: aarch64-apple-darwin - - host: windows-latest - target: x86_64-pc-windows-msvc - - host: ubuntu-24.04 - target: x86_64-unknown-linux-gnu - - host: ubuntu-24.04-arm - target: aarch64-unknown-linux-gnu - runs-on: ${{ matrix.settings.host }} - env: - APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} - APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} - APPLE_API_KEY_PATH: ${{ secrets.APPLE_API_KEY_PATH }} - APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-tags: true - - - name: Import code-signing certificate - if: ${{ runner.os == 'macOS' && env.APPLE_CERTIFICATE != '' && env.APPLE_CERTIFICATE_PASSWORD != '' }} - uses: apple-actions/import-codesign-certs@v7 - with: - keychain: build - p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }} - p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} - - - name: Verify Certificate - if: ${{ runner.os == 'macOS' && env.APPLE_CERTIFICATE != '' && env.APPLE_CERTIFICATE_PASSWORD != '' }} - run: | - set -euo pipefail - - if [ -n "${APPLE_SIGNING_IDENTITY:-}" ]; then - echo "CERT_ID=$APPLE_SIGNING_IDENTITY" >> "$GITHUB_ENV" - - TEAM_ID=$(echo "$APPLE_SIGNING_IDENTITY" | sed -n 's/.*(\([A-Z0-9]\{10\}\)).*/\1/p') - if [ -n "${TEAM_ID:-}" ]; then - echo "APPLE_TEAM_ID=$TEAM_ID" >> "$GITHUB_ENV" - echo "Using APPLE_TEAM_ID from signing identity: $TEAM_ID" - fi - - echo "Using APPLE_SIGNING_IDENTITY override." - security find-identity -v -p codesigning build.keychain | cat - exit 0 - fi - - CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID Application" | head -n 1 || true) - if [ -z "$CERT_INFO" ]; then - echo "No 'Developer ID Application' identity found in build.keychain" >&2 - security find-identity -v -p codesigning build.keychain | cat - exit 1 - fi - - CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}') - echo "CERT_ID=$CERT_ID" >> "$GITHUB_ENV" - echo "Certificate imported: $CERT_ID" - - TEAM_ID=$(echo "$CERT_ID" | sed -n 's/.*(\([A-Z0-9]\{10\}\)).*/\1/p') - if [ -n "${TEAM_ID:-}" ]; then - echo "APPLE_TEAM_ID=$TEAM_ID" >> "$GITHUB_ENV" - echo "Detected APPLE_TEAM_ID from certificate: $TEAM_ID" - fi - - - name: Setup Apple API Key - if: ${{ runner.os == 'macOS' && env.APPLE_API_KEY_PATH != '' }} - run: | - printf '%s' "${{ secrets.APPLE_API_KEY_PATH }}" > "$RUNNER_TEMP/apple-api-key.p8" - - - name: Setup Bun - uses: ./.github/actions/setup-bun - - - name: Cache apt packages - if: contains(matrix.settings.host, 'ubuntu') - uses: actions/cache@v5 - with: - path: /var/cache/apt/archives/*.deb - key: ${{ runner.os }}-${{ matrix.settings.target }}-apt-${{ hashFiles('.github/workflows/_build.yml') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.settings.target }}-apt- - - - name: Install Linux build dependencies - if: contains(matrix.settings.host, 'ubuntu') - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@v1 - with: - toolchain: stable - targets: ${{ matrix.settings.target }} - - - name: Restore Cargo cache - uses: Swatinem/rust-cache@v2 - with: - workspaces: packages/desktop/src-tauri - shared-key: ${{ matrix.settings.target }} - - - name: Prepare - run: | - cd packages/desktop - bun ./scripts/prepare.ts - env: - GITHUB_TOKEN: ${{ github.token }} - RUST_TARGET: ${{ matrix.settings.target }} - GH_TOKEN: ${{ github.token }} - GITHUB_RUN_ID: ${{ github.run_id }} - - # Fixes AppImage build issues, can be removed when https://github.com/tauri-apps/tauri/pull/12491 is released - - name: Install tauri-cli from portable appimage branch - if: contains(matrix.settings.host, 'ubuntu') - run: | - cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch feat/truly-portable-appimage --force - echo "Installed tauri-cli version:" - cargo tauri --version - - - name: Export Apple ID notarization credentials - if: ${{ runner.os == 'macOS' }} - run: | - APPLE_ID="${{ secrets.APPLE_ID }}" - APPLE_PASSWORD="${{ secrets.APPLE_PASSWORD }}" - - if [ -z "${APPLE_ID:-}" ] || [ -z "${APPLE_PASSWORD:-}" ]; then - echo "Apple ID notarization not configured; using App Store Connect API key." - exit 0 - fi - - echo "APPLE_ID=$APPLE_ID" >> "$GITHUB_ENV" - echo "APPLE_PASSWORD=$APPLE_PASSWORD" >> "$GITHUB_ENV" - - - name: Build and upload artifacts - uses: tauri-apps/tauri-action@v0.6 - timeout-minutes: 60 - if: ${{ runner.os != 'macOS' || (env.APPLE_CERTIFICATE != '' && env.APPLE_CERTIFICATE_PASSWORD != '') }} - with: - projectPath: packages/desktop - uploadWorkflowArtifacts: true - tauriScript: ${{ (contains(matrix.settings.host, 'ubuntu') && 'cargo tauri') || '' }} - args: --target ${{ matrix.settings.target }} --config ./src-tauri/tauri.prod.conf.json --verbose - updaterJsonPreferNsis: true - # Release attachment: when both releaseId and tagName are empty (CI mode), - # tauri-action skips the release upload and only emits workflow artifacts. - releaseId: ${{ inputs.release }} - tagName: ${{ inputs.tag }} - releaseAssetNamePattern: emberharmony-desktop-[platform]-[arch][ext] - env: - GITHUB_TOKEN: ${{ github.token }} - TAURI_BUNDLER_NEW_APPIMAGE_FORMAT: true - TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} - TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} - APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} - APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }} - APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} - APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} - APPLE_API_KEY_PATH: ${{ runner.temp }}/apple-api-key.p8 - APPLE_TEAM_ID: ${{ env.APPLE_TEAM_ID }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d511975..48bc7bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name: CI run-name: CI ${{ github.ref_name }} @ ${{ github.sha }} -# Verification builds. Runs the full 5-target CLI + Tauri matrix on every push -# to an integration branch (i.e. after a PR merges). Does NOT run on pull_request -# — that keeps the expensive matrix off PR review and away from fork secrets. +# Verification builds. Runs the CLI build on every push to an integration branch +# (i.e. after a PR merges). Does NOT run on pull_request — that keeps the +# expensive release build off PR review. on: push: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 72c4511..aacdac1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,7 +27,7 @@ jobs: # javascript-typescript covers the whole TS/JS codebase (CLI, web, console, ui, etc). # actions scans .github/workflows/** for secret-handling and injection bugs — # relevant given this repo's prior fork-PR-secret incident (see commit 5569e76). - # rust covers the Tauri desktop surface (packages/desktop/src-tauri). + # rust covers the desktop source surface (packages/desktop/src-tauri). # build-mode none = buildless extraction; no cargo build or system libs required. include: - language: javascript-typescript diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 97c8529..c76678e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,9 +12,7 @@ on: concurrency: ${{ github.workflow }}-${{ github.ref }} permissions: - id-token: write contents: write - packages: write actions: read jobs: @@ -26,9 +24,9 @@ jobs: publish-name: "@thesolaceproject/emberharmony" secrets: inherit - # npm publish runs for STABLE releases only. A pre-release (the portal's - # "Set as a pre-release" checkbox) still builds and attaches desktop assets to the - # GitHub release via the build job above, but never touches npm. + # npm publish runs for STABLE releases only. A pre-release still builds and + # uploads CLI assets to the GitHub release via the build job above, but never + # touches npm. publish: if: ${{ github.repository == 'SolaceHarmony/emberharmony' && !github.event.release.prerelease }} needs: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef6dbb4..053c988 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ Replace `` with your platform (e.g., `darwin-arm64`, `linux-x64`). - Core pieces: - `packages/emberharmony`: EmberHarmony core business logic & server. - - `packages/emberharmony/src/cli/cmd/tui/`: The TUI code, written in SolidJS with [opentui](https://github.com/sst/opentui) + - `packages/emberharmony/src/cli/cmd/tui/`: The TUI code, written in SolidJS with opentui - `packages/app`: The shared web UI components, written in SolidJS - `packages/desktop`: The native desktop app, built with Tauri (wraps `packages/app`) - `packages/plugin`: Source for `@thesolaceproject/emberharmony-plugin` diff --git a/README.ar.md b/README.ar.md index d5e6bc9..2cddcda 100644 --- a/README.ar.md +++ b/README.ar.md @@ -146,7 +146,7 @@ emberharmony ### شكر وتقدير -EmberHarmony هو نسخة معدّلة (fork) من [opencode](https://github.com/anomalyco/opencode) بواسطة فريق [SST](https://sst.dev). نحن ممتنون للغاية لعملهم التأسيسي في بناء وكيل برمجة بالذكاء الاصطناعي مفتوح المصدر استثنائي. يبني هذا المشروع على رؤيتهم وهندستهم. +EmberHarmony هو نسخة معدّلة (fork) من [opencode](https://github.com/anomalyco/opencode) بواسطة فريق opencode upstream. نحن ممتنون للغاية لعملهم التأسيسي في بناء وكيل برمجة بالذكاء الاصطناعي مفتوح المصدر استثنائي. يبني هذا المشروع على رؤيتهم وهندستهم. ### المشرف diff --git a/README.br.md b/README.br.md index 07de157..5cc8435 100644 --- a/README.br.md +++ b/README.br.md @@ -146,7 +146,7 @@ Se você estiver trabalhando em um projeto relacionado ao EmberHarmony que use " ### Agradecimentos -O EmberHarmony é um fork do [opencode](https://github.com/anomalyco/opencode) criado pela equipe [SST](https://sst.dev). Somos profundamente gratos pelo trabalho fundamental deles na construção de um agente de programação com IA de código aberto excepcional. Este projeto se baseia na visão e na engenharia deles. +O EmberHarmony é um fork do [opencode](https://github.com/anomalyco/opencode) criado pela equipe opencode upstream. Somos profundamente gratos pelo trabalho fundamental deles na construção de um agente de programação com IA de código aberto excepcional. Este projeto se baseia na visão e na engenharia deles. ### Mantenedora diff --git a/README.da.md b/README.da.md index eb071a4..7668fb0 100644 --- a/README.da.md +++ b/README.da.md @@ -146,7 +146,7 @@ Hvis du arbejder på et projekt relateret til EmberHarmony, der bruger "emberhar ### Anerkendelser -EmberHarmony er en fork af [opencode](https://github.com/anomalyco/opencode) af [SST](https://sst.dev)-teamet. Vi er dybt taknemmelige for deres grundlæggende arbejde med at bygge en enestående open source AI-kodningsagent. Dette projekt bygger videre på deres vision og ingeniørarbejde. +EmberHarmony er en fork af [opencode](https://github.com/anomalyco/opencode) af opencode upstream-teamet. Vi er dybt taknemmelige for deres grundlæggende arbejde med at bygge en enestående open source AI-kodningsagent. Dette projekt bygger videre på deres vision og ingeniørarbejde. ### Vedligeholder diff --git a/README.de.md b/README.de.md index 4b061dc..9e9296c 100644 --- a/README.de.md +++ b/README.de.md @@ -146,7 +146,7 @@ Wenn du an einem Projekt im Zusammenhang mit EmberHarmony arbeitest, das „embe ### Danksagungen -EmberHarmony ist ein Fork von [opencode](https://github.com/anomalyco/opencode) des [SST](https://sst.dev)-Teams. Wir sind zutiefst dankbar für ihre grundlegende Arbeit beim Aufbau eines herausragenden quelloffenen KI-Coding-Agenten. Dieses Projekt baut auf ihrer Vision und ihrer Ingenieursarbeit auf. +EmberHarmony ist ein Fork von [opencode](https://github.com/anomalyco/opencode) des opencode upstream-Teams. Wir sind zutiefst dankbar für ihre grundlegende Arbeit beim Aufbau eines herausragenden quelloffenen KI-Coding-Agenten. Dieses Projekt baut auf ihrer Vision und ihrer Ingenieursarbeit auf. ### Maintainer diff --git a/README.es.md b/README.es.md index 6418ddd..d72f993 100644 --- a/README.es.md +++ b/README.es.md @@ -146,7 +146,7 @@ Si estás trabajando en un proyecto relacionado con EmberHarmony que usa "emberh ### Agradecimientos -EmberHarmony es un fork de [opencode](https://github.com/anomalyco/opencode) del equipo de [SST](https://sst.dev). Estamos profundamente agradecidos por su trabajo fundacional al construir un agente de codificación con IA de código abierto excepcional. Este proyecto se basa en su visión y su ingeniería. +EmberHarmony es un fork de [opencode](https://github.com/anomalyco/opencode) del equipo de opencode upstream. Estamos profundamente agradecidos por su trabajo fundacional al construir un agente de codificación con IA de código abierto excepcional. Este proyecto se basa en su visión y su ingeniería. ### Responsable del mantenimiento diff --git a/README.fr.md b/README.fr.md index 65cb085..2331508 100644 --- a/README.fr.md +++ b/README.fr.md @@ -146,7 +146,7 @@ Si vous travaillez sur un projet lié à EmberHarmony qui utilise « emberharmon ### Remerciements -EmberHarmony est un fork d'[opencode](https://github.com/anomalyco/opencode) par l'équipe [SST](https://sst.dev). Nous sommes profondément reconnaissants pour leur travail fondateur dans la construction d'un agent de codage IA open source exceptionnel. Ce projet s'appuie sur leur vision et leur ingénierie. +EmberHarmony est un fork d'[opencode](https://github.com/anomalyco/opencode) par l'équipe opencode upstream. Nous sommes profondément reconnaissants pour leur travail fondateur dans la construction d'un agent de codage IA open source exceptionnel. Ce projet s'appuie sur leur vision et leur ingénierie. ### Mainteneuse diff --git a/README.it.md b/README.it.md index e2d6288..580fc7b 100644 --- a/README.it.md +++ b/README.it.md @@ -146,7 +146,7 @@ Se stai lavorando a un progetto legato a EmberHarmony che usa "emberharmony" nel ### Ringraziamenti -EmberHarmony è un fork di [opencode](https://github.com/anomalyco/opencode) realizzato dal team [SST](https://sst.dev). Siamo profondamente grati per il loro lavoro fondamentale nella creazione di un eccezionale agente di coding AI open source. Questo progetto si basa sulla loro visione e sulla loro ingegneria. +EmberHarmony è un fork di [opencode](https://github.com/anomalyco/opencode) realizzato dal team opencode upstream. Siamo profondamente grati per il loro lavoro fondamentale nella creazione di un eccezionale agente di coding AI open source. Questo progetto si basa sulla loro visione e sulla loro ingegneria. ### Manutentore diff --git a/README.ja.md b/README.ja.md index 2d260e0..aea6412 100644 --- a/README.ja.md +++ b/README.ja.md @@ -146,7 +146,7 @@ EmberHarmony に関連するプロジェクトで、その名前に「emberharmo ### 謝辞 -EmberHarmony は、[SST](https://sst.dev) チームによる [opencode](https://github.com/anomalyco/opencode) のフォークです。優れたオープンソース AI コーディングエージェントを構築するという彼らの基礎的な仕事に、私たちは深く感謝しています。本プロジェクトは、彼らのビジョンとエンジニアリングの上に築かれています。 +EmberHarmony は、opencode upstream チームによる [opencode](https://github.com/anomalyco/opencode) のフォークです。優れたオープンソース AI コーディングエージェントを構築するという彼らの基礎的な仕事に、私たちは深く感謝しています。本プロジェクトは、彼らのビジョンとエンジニアリングの上に築かれています。 ### メンテナー diff --git a/README.ko.md b/README.ko.md index 548a13d..7999ada 100644 --- a/README.ko.md +++ b/README.ko.md @@ -146,7 +146,7 @@ EmberHarmony에 기여하는 데 관심이 있다면, 풀 리퀘스트를 제출 ### 감사의 말 -EmberHarmony는 [SST](https://sst.dev) 팀의 [opencode](https://github.com/anomalyco/opencode)에서 포크한 프로젝트입니다. 뛰어난 오픈 소스 AI 코딩 에이전트를 구축한 그들의 기초 작업에 깊이 감사드립니다. 이 프로젝트는 그들의 비전과 엔지니어링 위에 세워졌습니다. +EmberHarmony는 opencode upstream 팀의 [opencode](https://github.com/anomalyco/opencode)에서 포크한 프로젝트입니다. 뛰어난 오픈 소스 AI 코딩 에이전트를 구축한 그들의 기초 작업에 깊이 감사드립니다. 이 프로젝트는 그들의 비전과 엔지니어링 위에 세워졌습니다. ### 메인테이너 diff --git a/README.md b/README.md index 68426ea..84bf6ce 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ If you are working on a project related to EmberHarmony that uses "emberharmony" ### Acknowledgments -EmberHarmony is a fork of [opencode](https://github.com/anomalyco/opencode) by the [SST](https://sst.dev) team. We are deeply grateful for their foundational work in building an exceptional open source AI coding agent. This project builds on their vision and engineering. +EmberHarmony is a fork of [opencode](https://github.com/anomalyco/opencode) by the opencode upstream team. We are deeply grateful for their foundational work in building an exceptional open source AI coding agent. This project builds on their vision and engineering. ### Maintainer diff --git a/README.no.md b/README.no.md index a313a7a..7c3edac 100644 --- a/README.no.md +++ b/README.no.md @@ -146,7 +146,7 @@ Hvis du jobber med et prosjekt relatert til EmberHarmony som bruker "emberharmon ### Anerkjennelser -EmberHarmony er en fork av [opencode](https://github.com/anomalyco/opencode) av [SST](https://sst.dev)-teamet. Vi er dypt takknemlige for deres grunnleggende arbeid med å bygge en eksepsjonell åpen kildekode-basert AI-kodeagent. Dette prosjektet bygger videre på deres visjon og ingeniørarbeid. +EmberHarmony er en fork av [opencode](https://github.com/anomalyco/opencode) av opencode upstream-teamet. Vi er dypt takknemlige for deres grunnleggende arbeid med å bygge en eksepsjonell åpen kildekode-basert AI-kodeagent. Dette prosjektet bygger videre på deres visjon og ingeniørarbeid. ### Vedlikeholder diff --git a/README.pl.md b/README.pl.md index 3ed2436..ccbf4cc 100644 --- a/README.pl.md +++ b/README.pl.md @@ -146,7 +146,7 @@ Jeśli pracujesz nad projektem związanym z EmberHarmony, który używa nazwy ### Podziękowania -EmberHarmony to fork [opencode](https://github.com/anomalyco/opencode) autorstwa zespołu [SST](https://sst.dev). Jesteśmy głęboko wdzięczni za ich fundamentalną pracę przy budowie wyjątkowego otwartoźródłowego agenta AI do kodowania. Ten projekt opiera się na ich wizji i inżynierii. +EmberHarmony to fork [opencode](https://github.com/anomalyco/opencode) autorstwa zespołu opencode upstream. Jesteśmy głęboko wdzięczni za ich fundamentalną pracę przy budowie wyjątkowego otwartoźródłowego agenta AI do kodowania. Ten projekt opiera się na ich wizji i inżynierii. ### Opiekun diff --git a/README.ru.md b/README.ru.md index 1b0c072..baf9946 100644 --- a/README.ru.md +++ b/README.ru.md @@ -146,7 +146,7 @@ emberharmony ### Благодарности -EmberHarmony является форком [opencode](https://github.com/anomalyco/opencode) от команды [SST](https://sst.dev). Мы глубоко благодарны за их основополагающую работу по созданию исключительного открытого ИИ-агента для написания кода. Этот проект развивает их видение и инженерные решения. +EmberHarmony является форком [opencode](https://github.com/anomalyco/opencode) от команды opencode upstream. Мы глубоко благодарны за их основополагающую работу по созданию исключительного открытого ИИ-агента для написания кода. Этот проект развивает их видение и инженерные решения. ### Сопровождающий diff --git a/README.th.md b/README.th.md index dd5dcd3..32e529f 100644 --- a/README.th.md +++ b/README.th.md @@ -146,7 +146,7 @@ emberharmony ### กิตติกรรมประกาศ -EmberHarmony เป็น fork ของ [opencode](https://github.com/anomalyco/opencode) โดยทีม [SST](https://sst.dev) เรารู้สึกซาบซึ้งอย่างยิ่งต่องานรากฐานของพวกเขาในการสร้างเอเจนต์ AI สำหรับเขียนโค้ดแบบโอเพนซอร์สที่ยอดเยี่ยม โปรเจกต์นี้ต่อยอดจากวิสัยทัศน์และงานวิศวกรรมของพวกเขา +EmberHarmony เป็น fork ของ [opencode](https://github.com/anomalyco/opencode) โดยทีม opencode upstream เรารู้สึกซาบซึ้งอย่างยิ่งต่องานรากฐานของพวกเขาในการสร้างเอเจนต์ AI สำหรับเขียนโค้ดแบบโอเพนซอร์สที่ยอดเยี่ยม โปรเจกต์นี้ต่อยอดจากวิสัยทัศน์และงานวิศวกรรมของพวกเขา ### ผู้ดูแล diff --git a/README.zh.md b/README.zh.md index 360a983..689a3a1 100644 --- a/README.zh.md +++ b/README.zh.md @@ -146,7 +146,7 @@ emberharmony ### 致谢 -EmberHarmony 是 [SST](https://sst.dev) 团队的 [opencode](https://github.com/anomalyco/opencode) 的一个分支。我们对他们在构建一款卓越的开源 AI 编程代理方面所打下的基础工作深表感激。本项目正是建立在他们的愿景与工程之上。 +EmberHarmony 是 opencode upstream 团队的 [opencode](https://github.com/anomalyco/opencode) 的一个分支。我们对他们在构建一款卓越的开源 AI 编程代理方面所打下的基础工作深表感激。本项目正是建立在他们的愿景与工程之上。 ### 维护者 diff --git a/README.zht.md b/README.zht.md index fcd33d6..8397416 100644 --- a/README.zht.md +++ b/README.zht.md @@ -146,7 +146,7 @@ emberharmony ### 致謝 -EmberHarmony 是 [SST](https://sst.dev) 團隊所開發的 [opencode](https://github.com/anomalyco/opencode) 的一個分支(fork)。我們由衷感謝他們在打造一個卓越的開源 AI 程式設計代理上所奠定的基礎工作。本專案正是建立在他們的願景與工程之上。 +EmberHarmony 是 opencode upstream 團隊所開發的 [opencode](https://github.com/anomalyco/opencode) 的一個分支(fork)。我們由衷感謝他們在打造一個卓越的開源 AI 程式設計代理上所奠定的基礎工作。本專案正是建立在他們的願景與工程之上。 ### 維護者 diff --git a/bun.lock b/bun.lock index 3eb4f58..770dc6b 100644 --- a/bun.lock +++ b/bun.lock @@ -17,7 +17,6 @@ "@tsconfig/bun": "catalog:", "prettier": "3.6.2", "semver": "^7.6.0", - "sst": "3.17.38", "turbo": "2.9.16", }, }, @@ -348,10 +347,7 @@ "name": "@thesolaceproject/emberharmony-function", "version": "1.3.0", "dependencies": { - "@octokit/auth-app": "8.0.1", - "@octokit/rest": "catalog:", "hono": "catalog:", - "jose": "6.0.11", }, "devDependencies": { "@cloudflare/workers-types": "catalog:", @@ -1176,8 +1172,6 @@ "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], - "@octokit/auth-app": ["@octokit/auth-app@8.0.1", "", { "dependencies": { "@octokit/auth-oauth-app": "^9.0.1", "@octokit/auth-oauth-user": "^6.0.0", "@octokit/request": "^10.0.2", "@octokit/request-error": "^7.0.0", "@octokit/types": "^14.0.0", "toad-cache": "^3.7.0", "universal-github-app-jwt": "^2.2.0", "universal-user-agent": "^7.0.0" } }, "sha512-P2J5pB3pjiGwtJX4WqJVYCtNkcZ+j5T2Wm14aJAEIC3WJOrv12jvBley3G1U/XI8q9o1A7QMG54LiFED2BiFlg=="], - "@octokit/auth-oauth-app": ["@octokit/auth-oauth-app@9.0.3", "", { "dependencies": { "@octokit/auth-oauth-device": "^8.0.3", "@octokit/auth-oauth-user": "^6.0.2", "@octokit/request": "^10.0.6", "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-+yoFQquaF8OxJSxTb7rnytBIC2ZLbLqA/yb71I4ZXT9+Slw4TziV9j/kyGhUFRRTF2+7WlnIWsePZCWHs+OGjg=="], "@octokit/auth-oauth-device": ["@octokit/auth-oauth-device@8.0.3", "", { "dependencies": { "@octokit/oauth-methods": "^6.0.2", "@octokit/request": "^10.0.6", "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-zh2W0mKKMh/VWZhSqlaCzY7qFyrgd9oTWmTmHaXnHNeQRCZr/CXy2jCgHo4e4dJVTiuxP5dLa0YM5p5QVhJHbw=="], @@ -2824,8 +2818,6 @@ "jmespath": ["jmespath@0.16.0", "", {}, "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw=="], - "jose": ["jose@6.0.11", "", {}, "sha512-QxG7EaliDARm1O1S8BGakqncGT9s25bKL1WSf6/oa17Tkqwi8D2ZNglqCF+DsYF88/rV66Q/Q2mFAy697E1DUg=="], - "jpeg-js": ["jpeg-js@0.4.4", "", {}, "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg=="], "js-base64": ["js-base64@3.7.7", "", {}, "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw=="], @@ -3584,24 +3576,6 @@ "srvx": ["srvx@0.9.8", "", { "bin": { "srvx": "bin/srvx.mjs" } }, "sha512-RZaxTKJEE/14HYn8COLuUOJAt0U55N9l1Xf6jj+T0GoA01EUH1Xz5JtSUOI+EHn+AEgPCVn7gk6jHJffrr06fQ=="], - "sst": ["sst@3.17.38", "", { "dependencies": { "aws-sdk": "2.1692.0", "aws4fetch": "1.0.18", "jose": "5.2.3", "opencontrol": "0.0.6", "openid-client": "5.6.4" }, "optionalDependencies": { "sst-darwin-arm64": "3.17.38", "sst-darwin-x64": "3.17.38", "sst-linux-arm64": "3.17.38", "sst-linux-x64": "3.17.38", "sst-linux-x86": "3.17.38", "sst-win32-arm64": "3.17.38", "sst-win32-x64": "3.17.38", "sst-win32-x86": "3.17.38" }, "bin": { "sst": "bin/sst.mjs" } }, "sha512-AshCCzogYVVTgLV7SBQ2hkmctAI0QV4pJmHwsyrX1ruSCvH18ccGgX/kux6/AFfaKrT7GmuVuQ2Zsz25GPXEiA=="], - - "sst-darwin-arm64": ["sst-darwin-arm64@3.17.38", "", { "os": "darwin", "cpu": "arm64" }, "sha512-2qEu/jRRBGQbMzkJKy4cypX+LdjInKtn1VrPHeggHD0/DsXLUBVdj/WyYb9ZxbsZEUcA9xZDR2+FBZ7lQzaDcw=="], - - "sst-darwin-x64": ["sst-darwin-x64@3.17.38", "", { "os": "darwin", "cpu": "x64" }, "sha512-um13cWbRK5rfsYuLxS97gaSkFVd6jCzI+k6wlpJaOcJ5IZiH5UdFIz+ZE/7iCfNTEiwDT+RMw2nGL9a+07Vtww=="], - - "sst-linux-arm64": ["sst-linux-arm64@3.17.38", "", { "os": "linux", "cpu": "arm64" }, "sha512-gMxYJmpytntqZOf9SZfMnj+v6E0vZ8dAT5XnaKQhETSwuN6WH/OWHgx4bnp7bMQfdvm1uYNB+p7GRopIRRPePQ=="], - - "sst-linux-x64": ["sst-linux-x64@3.17.38", "", { "os": "linux", "cpu": "x64" }, "sha512-vwzfHhCugRTWevoA2qcl339yQhc8+vVdAqA11Qcats7LvaM6KxN9SqY00SfHPZxmm2odnefDg8z4b3Qvdo2NAw=="], - - "sst-linux-x86": ["sst-linux-x86@3.17.38", "", { "os": "linux", "cpu": "none" }, "sha512-rxG2YsN2XnykCvJ1ZquZIXbEOWIdLdcJ1ir9hcqb31cLrH0z2EN5F/IsioH9mLRVJnbmY3JewNk+C9mMB2a8zA=="], - - "sst-win32-arm64": ["sst-win32-arm64@3.17.38", "", { "os": "win32", "cpu": "arm64" }, "sha512-aPTaLqJ4bEEfQwaxnteFXHAePw4Po1Be0tsdTuNUPDhhyv1CV5xSl4nppb4q/Qn1dGxaU6L4zCzZkshWskGIOg=="], - - "sst-win32-x64": ["sst-win32-x64@3.17.38", "", { "os": "win32", "cpu": "x64" }, "sha512-X2kx6MOK1tZ0JhMqDisB60fJCOSxot5q7NPFMna5hj7cgJaQfj0NAgQqGJkLEB8iVWyxi6e5o1oJLg+vH452HQ=="], - - "sst-win32-x86": ["sst-win32-x86@3.17.38", "", { "os": "win32", "cpu": "none" }, "sha512-W5PxA4uhpXMzWNT0/sMrmU27fn1DCaReGwVwJGEZapu9GKTix41uaP+pyd9fwjiAHVILIdxqe7+BkZfH+mvzbg=="], - "stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="], "stackframe": ["stackframe@1.3.4", "", {}, "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw=="], @@ -4388,10 +4362,6 @@ "source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], - "sst/aws4fetch": ["aws4fetch@1.0.18", "", {}, "sha512-3Cf+YaUl07p24MoQ46rFwulAmiyCwH2+1zw1ZyPAX5OtJ34Hh185DwB8y/qRLb6cYYYtSFJ9pthyLc0MD4e8sQ=="], - - "sst/jose": ["jose@5.2.3", "", {}, "sha512-KUXdbctm1uHVL8BYhnyHkgp3zDX5KW8ZhAKVFEfUbU2P8Alpzjb+48hHvjOdQIyPshoblhzsuqOwEEAbtHVirA=="], - "string-width-cjs/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], "string-width-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], diff --git a/dep-audit.csv b/dep-audit.csv index 45cb6b6..bfdf3c9 100644 --- a/dep-audit.csv +++ b/dep-audit.csv @@ -39,7 +39,6 @@ shiki,423,2646,3892 semver,48,2557,264 esbuild,2,2533,148 @aws-sdk/client-sts,43,2415,708 -sst,30,1560,268 ulid,5,1513,152 ignore,2,1465,76 hono-openapi,2,1019,76 diff --git a/package.json b/package.json index 6273c9f..a1f23e0 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,6 @@ "@tsconfig/bun": "catalog:", "prettier": "3.6.2", "semver": "^7.6.0", - "sst": "3.17.38", "turbo": "2.9.16" }, "dependencies": { diff --git a/packages/app/src/sst-env.d.ts b/packages/app/src/sst-env.d.ts deleted file mode 100644 index 47a8fbe..0000000 --- a/packages/app/src/sst-env.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/// -interface ImportMetaEnv { - -} -interface ImportMeta { - readonly env: ImportMetaEnv -} \ No newline at end of file diff --git a/packages/app/sst-env.d.ts b/packages/app/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/app/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/app/tsconfig.json b/packages/app/tsconfig.json index e2a27dd..51f4922 100644 --- a/packages/app/tsconfig.json +++ b/packages/app/tsconfig.json @@ -13,6 +13,7 @@ "allowJs": true, "resolveJsonModule": true, "strict": true, + "types": ["bun", "node", "vite/client"], "noEmit": false, "emitDeclarationOnly": true, "outDir": "node_modules/.ts-dist", diff --git a/packages/console/app/package.json b/packages/console/app/package.json index 90cdec8..cfa28c4 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -6,7 +6,6 @@ "scripts": { "typecheck": "tsgo --noEmit", "dev": "vite dev --host 0.0.0.0", - "dev:remote": "VITE_AUTH_URL=https://auth.dev.solace.ofharmony.ai VITE_STRIPE_PUBLISHABLE_KEY=pk_test_... bun sst shell --stage=dev bun dev", "build": "./script/generate-sitemap.ts && vite build && ../../emberharmony/script/schema.ts ./.output/public/config.json", "start": "vite start" }, diff --git a/packages/console/app/sst-env.d.ts b/packages/console/app/sst-env.d.ts deleted file mode 100644 index 9b9de73..0000000 --- a/packages/console/app/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/console/core/drizzle.config.ts b/packages/console/core/drizzle.config.ts index 0b7c441..ccddfb8 100644 --- a/packages/console/core/drizzle.config.ts +++ b/packages/console/core/drizzle.config.ts @@ -1,6 +1,13 @@ -import { Resource } from "sst" import { defineConfig } from "drizzle-kit" +const env = (...names: string[]) => names.map((name) => process.env[name]).find((value) => value !== undefined) + +const required = (...names: string[]) => { + const value = env(...names) + if (value !== undefined) return value + throw new Error(`${names.join(" or ")} is required`) +} + export default defineConfig({ out: "./migrations/", strict: true, @@ -8,11 +15,11 @@ export default defineConfig({ verbose: true, dialect: "mysql", dbCredentials: { - database: Resource.Database.database, - host: Resource.Database.host, - user: Resource.Database.username, - password: Resource.Database.password, - port: Resource.Database.port, + database: required("DATABASE_NAME", "DATABASE_DATABASE"), + host: required("DATABASE_HOST"), + user: required("DATABASE_USERNAME", "DATABASE_USER"), + password: required("DATABASE_PASSWORD"), + port: Number(env("DATABASE_PORT") || "3306"), ssl: { rejectUnauthorized: false, }, diff --git a/packages/console/core/package.json b/packages/console/core/package.json index f864889..682d56e 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -22,20 +22,7 @@ "./*": "./src/*" }, "scripts": { - "db": "sst shell drizzle-kit", - "db-dev": "sst shell --stage dev -- drizzle-kit", - "db-prod": "sst shell --stage production -- drizzle-kit", - "shell": "sst shell -- bun", - "shell-dev": "sst shell --stage dev -- bun", - "shell-prod": "sst shell --stage production -- bun", - "update-models": "script/update-models.ts", - "promote-models-to-dev": "script/promote-models.ts dev", - "promote-models-to-prod": "script/promote-models.ts production", - "pull-models-from-dev": "script/pull-models.ts dev", - "pull-models-from-prod": "script/pull-models.ts production", - "update-black": "script/update-black.ts", - "promote-black-to-dev": "script/promote-black.ts dev", - "promote-black-to-prod": "script/promote-black.ts production", + "db": "drizzle-kit", "typecheck": "tsgo --noEmit" }, "devDependencies": { diff --git a/packages/console/core/script/promote-black.ts b/packages/console/core/script/promote-black.ts deleted file mode 100755 index 4338d0e..0000000 --- a/packages/console/core/script/promote-black.ts +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bun - -import { $ } from "bun" -import path from "path" -import { BlackData } from "../src/black" - -const stage = process.argv[2] -if (!stage) throw new Error("Stage is required") - -const root = path.resolve(process.cwd(), "..", "..", "..") - -// read the secret -const ret = await $`bun sst secret list`.cwd(root).text() -const lines = ret.split("\n") -const value = lines.find((line) => line.startsWith("ZEN_BLACK_LIMITS"))?.split("=")[1] -if (!value) throw new Error("ZEN_BLACK_LIMITS not found") - -// validate value -BlackData.validate(JSON.parse(value)) - -// update the secret -await $`bun sst secret set ZEN_BLACK_LIMITS ${value} --stage ${stage}` diff --git a/packages/console/core/script/promote-models.ts b/packages/console/core/script/promote-models.ts deleted file mode 100755 index 9a9b2dc..0000000 --- a/packages/console/core/script/promote-models.ts +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bun - -import { $ } from "bun" -import path from "path" -import os from "os" -import { ZenData } from "../src/model" - -const stage = process.argv[2] -if (!stage) throw new Error("Stage is required") - -const root = path.resolve(process.cwd(), "..", "..", "..") -const PARTS = 10 - -// read the secret -const ret = await $`bun sst secret list`.cwd(root).text() -const lines = ret.split("\n") -const values = Array.from({ length: PARTS }, (_, i) => { - const value = lines - .find((line) => line.startsWith(`ZEN_MODELS${i + 1}=`)) - ?.split("=") - .slice(1) - .join("=") - if (!value) throw new Error(`ZEN_MODELS${i + 1} not found`) - return value -}) - -// validate value -ZenData.validate(JSON.parse(values.join(""))) - -// update the secret -const envFile = Bun.file(path.join(os.tmpdir(), `models-${Date.now()}.env`)) -await envFile.write(values.map((v, i) => `ZEN_MODELS${i + 1}=${v}`).join("\n")) -await $`bun sst secret load ${envFile.name} --stage ${stage}`.cwd(root) diff --git a/packages/console/core/script/pull-models.ts b/packages/console/core/script/pull-models.ts deleted file mode 100755 index 6e89f60..0000000 --- a/packages/console/core/script/pull-models.ts +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bun - -import { $ } from "bun" -import path from "path" -import os from "os" -import { ZenData } from "../src/model" - -const stage = process.argv[2] -if (!stage) throw new Error("Stage is required") - -const root = path.resolve(process.cwd(), "..", "..", "..") -const PARTS = 10 - -// read the secret -const ret = await $`bun sst secret list --stage ${stage}`.cwd(root).text() -const lines = ret.split("\n") -const values = Array.from({ length: PARTS }, (_, i) => { - const value = lines - .find((line) => line.startsWith(`ZEN_MODELS${i + 1}=`)) - ?.split("=") - .slice(1) - .join("=") - if (!value) throw new Error(`ZEN_MODELS${i + 1} not found`) - return value -}) - -// validate value -ZenData.validate(JSON.parse(values.join(""))) - -// update the secret -const envFile = Bun.file(path.join(os.tmpdir(), `models-${Date.now()}.env`)) -await envFile.write(values.map((v, i) => `ZEN_MODELS${i + 1}=${v}`).join("\n")) -await $`bun sst secret load ${envFile.name}`.cwd(root) diff --git a/packages/console/core/script/update-black.ts b/packages/console/core/script/update-black.ts deleted file mode 100755 index 695a5d3..0000000 --- a/packages/console/core/script/update-black.ts +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bun - -import { $ } from "bun" -import path from "path" -import os from "os" -import { BlackData } from "../src/black" - -const root = path.resolve(process.cwd(), "..", "..", "..") -const secrets = await $`bun sst secret list`.cwd(root).text() - -// read value -const lines = secrets.split("\n") -const oldValue = lines.find((line) => line.startsWith("ZEN_BLACK_LIMITS"))?.split("=")[1] ?? "{}" -if (!oldValue) throw new Error("ZEN_BLACK_LIMITS not found") - -// store the prettified json to a temp file -const filename = `black-${Date.now()}.json` -const tempFile = Bun.file(path.join(os.tmpdir(), filename)) -await tempFile.write(JSON.stringify(JSON.parse(oldValue), null, 2)) -console.log("tempFile", tempFile.name) - -// open temp file in vim and read the file on close -await $`vim ${tempFile.name}` -const newValue = JSON.stringify(JSON.parse(await tempFile.text())) -BlackData.validate(JSON.parse(newValue)) - -// update the secret -await $`bun sst secret set ZEN_BLACK_LIMITS ${newValue}` diff --git a/packages/console/core/script/update-models.ts b/packages/console/core/script/update-models.ts deleted file mode 100755 index d37c6a9..0000000 --- a/packages/console/core/script/update-models.ts +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bun - -import { $ } from "bun" -import path from "path" -import os from "os" -import { ZenData } from "../src/model" - -const root = path.resolve(process.cwd(), "..", "..", "..") -const models = await $`bun sst secret list`.cwd(root).text() -const PARTS = 10 - -// read the line starting with "ZEN_MODELS" -const lines = models.split("\n") -const oldValues = Array.from({ length: PARTS }, (_, i) => { - const value = lines - .find((line) => line.startsWith(`ZEN_MODELS${i + 1}=`)) - ?.split("=") - .slice(1) - .join("=") - // TODO - //if (!value) throw new Error(`ZEN_MODELS${i + 1} not found`) - //return value - return value ?? "" -}) - -// store the prettified json to a temp file -const filename = `models-${Date.now()}.json` -const tempFile = Bun.file(path.join(os.tmpdir(), filename)) -await tempFile.write(JSON.stringify(JSON.parse(oldValues.join("")), null, 2)) -console.log("tempFile", tempFile.name) - -// open temp file in vim and read the file on close -await $`vim ${tempFile.name}` -const newValue = JSON.stringify(JSON.parse(await tempFile.text())) -ZenData.validate(JSON.parse(newValue)) - -// update the secret -const chunk = Math.ceil(newValue.length / PARTS) -const newValues = Array.from({ length: PARTS }, (_, i) => - newValue.slice(chunk * i, i === PARTS - 1 ? undefined : chunk * (i + 1)), -) - -const envFile = Bun.file(path.join(os.tmpdir(), `models-${Date.now()}.env`)) -await envFile.write(newValues.map((v, i) => `ZEN_MODELS${i + 1}=${v}`).join("\n")) -await $`bun sst secret load ${envFile.name}`.cwd(root) diff --git a/packages/console/core/sst-env.d.ts b/packages/console/core/sst-env.d.ts deleted file mode 100644 index 0769c76..0000000 --- a/packages/console/core/sst-env.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -import "sst" -declare module "sst" { - export interface Resource { - "ADMIN_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "AUTH_API_URL": { - "type": "sst.sst.Linkable" - "value": string - } - "AWS_SES_ACCESS_KEY_ID": { - "type": "sst.sst.Secret" - "value": string - } - "AWS_SES_SECRET_ACCESS_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_API_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_DEFAULT_ACCOUNT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Console": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "DISCORD_SUPPORT_BOT_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "DISCORD_SUPPORT_CHANNEL_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Database": { - "database": string - "host": string - "password": string - "port": number - "type": "sst.sst.Linkable" - "username": string - } - "EMAILOCTOPUS_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_PRIVATE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_ID_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_SECRET_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GOOGLE_CLIENT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "HONEYCOMB_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "R2AccessKey": { - "type": "sst.sst.Secret" - "value": string - } - "R2SecretKey": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_PUBLISHABLE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_SECRET_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_WEBHOOK_SECRET": { - "type": "sst.sst.Linkable" - "value": string - } - "Teams": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "Web": { - "type": "sst.cloudflare.Astro" - "url": string - } - "WebApp": { - "type": "sst.cloudflare.StaticSite" - "url": string - } - "ZEN_BLACK_LIMITS": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_BLACK_PRICE": { - "plan100": string - "plan20": string - "plan200": string - "product": string - "type": "sst.sst.Linkable" - } - "ZEN_MODELS1": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS10": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS2": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS3": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS4": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS5": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS6": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS7": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS8": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS9": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_SESSION_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - } -} -// cloudflare -import * as cloudflare from "@cloudflare/workers-types"; -declare module "sst" { - export interface Resource { - "Api": cloudflare.Service - "AuthApi": cloudflare.Service - "AuthStorage": cloudflare.KVNamespace - "Bucket": cloudflare.R2Bucket - "EnterpriseStorage": cloudflare.R2Bucket - "GatewayKv": cloudflare.KVNamespace - "LogProcessor": cloudflare.Service - "ZenData": cloudflare.R2Bucket - "ZenDataNew": cloudflare.R2Bucket - } -} - -import "sst" -export {} \ No newline at end of file diff --git a/packages/console/core/tsconfig.json b/packages/console/core/tsconfig.json index 3218dd7..cf99b89 100644 --- a/packages/console/core/tsconfig.json +++ b/packages/console/core/tsconfig.json @@ -6,6 +6,6 @@ "moduleResolution": "bundler", "jsx": "preserve", "jsxImportSource": "react", - "types": ["@cloudflare/workers-types", "node"] + "types": ["@cloudflare/workers-types", "bun", "node"] } } diff --git a/packages/console/function/src/auth.ts b/packages/console/function/src/auth.ts index c88ad79..7f39526 100644 --- a/packages/console/function/src/auth.ts +++ b/packages/console/function/src/auth.ts @@ -75,7 +75,7 @@ export default { // Destination: { // ToAddresses: [email], // }, - // FromEmailAddress: `SST `, + // FromEmailAddress: `EmberHarmony `, // Content: { // Simple: { // Body: { @@ -87,7 +87,7 @@ export default { // }, // }, // Subject: { - // Data: "SST Console Pin Code: " + code, + // Data: "EmberHarmony Console Pin Code: " + code, // }, // }, // }, diff --git a/packages/console/function/sst-env.d.ts b/packages/console/function/sst-env.d.ts deleted file mode 100644 index 0769c76..0000000 --- a/packages/console/function/sst-env.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -import "sst" -declare module "sst" { - export interface Resource { - "ADMIN_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "AUTH_API_URL": { - "type": "sst.sst.Linkable" - "value": string - } - "AWS_SES_ACCESS_KEY_ID": { - "type": "sst.sst.Secret" - "value": string - } - "AWS_SES_SECRET_ACCESS_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_API_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_DEFAULT_ACCOUNT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Console": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "DISCORD_SUPPORT_BOT_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "DISCORD_SUPPORT_CHANNEL_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Database": { - "database": string - "host": string - "password": string - "port": number - "type": "sst.sst.Linkable" - "username": string - } - "EMAILOCTOPUS_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_PRIVATE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_ID_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_SECRET_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GOOGLE_CLIENT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "HONEYCOMB_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "R2AccessKey": { - "type": "sst.sst.Secret" - "value": string - } - "R2SecretKey": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_PUBLISHABLE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_SECRET_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_WEBHOOK_SECRET": { - "type": "sst.sst.Linkable" - "value": string - } - "Teams": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "Web": { - "type": "sst.cloudflare.Astro" - "url": string - } - "WebApp": { - "type": "sst.cloudflare.StaticSite" - "url": string - } - "ZEN_BLACK_LIMITS": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_BLACK_PRICE": { - "plan100": string - "plan20": string - "plan200": string - "product": string - "type": "sst.sst.Linkable" - } - "ZEN_MODELS1": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS10": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS2": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS3": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS4": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS5": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS6": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS7": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS8": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS9": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_SESSION_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - } -} -// cloudflare -import * as cloudflare from "@cloudflare/workers-types"; -declare module "sst" { - export interface Resource { - "Api": cloudflare.Service - "AuthApi": cloudflare.Service - "AuthStorage": cloudflare.KVNamespace - "Bucket": cloudflare.R2Bucket - "EnterpriseStorage": cloudflare.R2Bucket - "GatewayKv": cloudflare.KVNamespace - "LogProcessor": cloudflare.Service - "ZenData": cloudflare.R2Bucket - "ZenDataNew": cloudflare.R2Bucket - } -} - -import "sst" -export {} \ No newline at end of file diff --git a/packages/console/mail/sst-env.d.ts b/packages/console/mail/sst-env.d.ts deleted file mode 100644 index 9b9de73..0000000 --- a/packages/console/mail/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/console/resource/resource.node.ts b/packages/console/resource/resource.node.ts index 71b6501..e241b1f 100644 --- a/packages/console/resource/resource.node.ts +++ b/packages/console/resource/resource.node.ts @@ -1,7 +1,81 @@ -import { Resource as ResourceBase } from "sst" - export const waitUntil = async (promise: Promise) => { await promise } -export const Resource = ResourceBase as Record +const env = (...names: string[]) => names.map((name) => process.env[name]).find((value) => value !== undefined) + +const required = (...names: string[]) => { + const value = env(...names) + if (value !== undefined) return value + throw new Error(`${names.join(" or ")} is required`) +} + +const secret = (name: string) => ({ + get value() { + return required(name) + }, +}) + +export const Resource = { + App: { + get stage() { + return env("APP_STAGE", "STAGE", "NODE_ENV") ?? "dev" + }, + }, + Database: { + get database() { + return required("DATABASE_NAME", "DATABASE_DATABASE") + }, + get host() { + return required("DATABASE_HOST") + }, + get username() { + return required("DATABASE_USERNAME", "DATABASE_USER") + }, + get password() { + return required("DATABASE_PASSWORD") + }, + get port() { + return Number(env("DATABASE_PORT") || "3306") + }, + }, + AWS_SES_ACCESS_KEY_ID: secret("AWS_SES_ACCESS_KEY_ID"), + AWS_SES_SECRET_ACCESS_KEY: secret("AWS_SES_SECRET_ACCESS_KEY"), + EMAILOCTOPUS_API_KEY: secret("EMAILOCTOPUS_API_KEY"), + GITHUB_CLIENT_ID_CONSOLE: secret("GITHUB_CLIENT_ID_CONSOLE"), + GITHUB_CLIENT_SECRET_CONSOLE: secret("GITHUB_CLIENT_SECRET_CONSOLE"), + GOOGLE_CLIENT_ID: secret("GOOGLE_CLIENT_ID"), + HONEYCOMB_API_KEY: secret("HONEYCOMB_API_KEY"), + STRIPE_SECRET_KEY: secret("STRIPE_SECRET_KEY"), + STRIPE_WEBHOOK_SECRET: secret("STRIPE_WEBHOOK_SECRET"), + ZEN_BLACK_LIMITS: secret("ZEN_BLACK_LIMITS"), + ZEN_BLACK_PRICE: { + get plan20() { + return required("ZEN_BLACK_PRICE_PLAN20") + }, + get plan100() { + return required("ZEN_BLACK_PRICE_PLAN100") + }, + get plan200() { + return required("ZEN_BLACK_PRICE_PLAN200") + }, + }, + ZEN_MODELS1: secret("ZEN_MODELS1"), + ZEN_MODELS2: secret("ZEN_MODELS2"), + ZEN_MODELS3: secret("ZEN_MODELS3"), + ZEN_MODELS4: secret("ZEN_MODELS4"), + ZEN_MODELS5: secret("ZEN_MODELS5"), + ZEN_MODELS6: secret("ZEN_MODELS6"), + ZEN_MODELS7: secret("ZEN_MODELS7"), + ZEN_MODELS8: secret("ZEN_MODELS8"), + ZEN_MODELS9: secret("ZEN_MODELS9"), + ZEN_MODELS10: secret("ZEN_MODELS10"), + ZEN_SESSION_SECRET: secret("ZEN_SESSION_SECRET"), + GatewayKv: { + get: async (_key: string) => undefined as string | undefined, + put: async (_key: string, _value: string, _options?: { expirationTtl?: number }) => {}, + }, + ZenDataNew: { + put: async (_key: string, _value: string) => {}, + }, +} as const diff --git a/packages/console/resource/sst-env.d.ts b/packages/console/resource/sst-env.d.ts deleted file mode 100644 index 0769c76..0000000 --- a/packages/console/resource/sst-env.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -import "sst" -declare module "sst" { - export interface Resource { - "ADMIN_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "AUTH_API_URL": { - "type": "sst.sst.Linkable" - "value": string - } - "AWS_SES_ACCESS_KEY_ID": { - "type": "sst.sst.Secret" - "value": string - } - "AWS_SES_SECRET_ACCESS_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_API_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_DEFAULT_ACCOUNT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Console": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "DISCORD_SUPPORT_BOT_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "DISCORD_SUPPORT_CHANNEL_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Database": { - "database": string - "host": string - "password": string - "port": number - "type": "sst.sst.Linkable" - "username": string - } - "EMAILOCTOPUS_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_PRIVATE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_ID_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_SECRET_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GOOGLE_CLIENT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "HONEYCOMB_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "R2AccessKey": { - "type": "sst.sst.Secret" - "value": string - } - "R2SecretKey": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_PUBLISHABLE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_SECRET_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_WEBHOOK_SECRET": { - "type": "sst.sst.Linkable" - "value": string - } - "Teams": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "Web": { - "type": "sst.cloudflare.Astro" - "url": string - } - "WebApp": { - "type": "sst.cloudflare.StaticSite" - "url": string - } - "ZEN_BLACK_LIMITS": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_BLACK_PRICE": { - "plan100": string - "plan20": string - "plan200": string - "product": string - "type": "sst.sst.Linkable" - } - "ZEN_MODELS1": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS10": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS2": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS3": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS4": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS5": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS6": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS7": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS8": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS9": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_SESSION_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - } -} -// cloudflare -import * as cloudflare from "@cloudflare/workers-types"; -declare module "sst" { - export interface Resource { - "Api": cloudflare.Service - "AuthApi": cloudflare.Service - "AuthStorage": cloudflare.KVNamespace - "Bucket": cloudflare.R2Bucket - "EnterpriseStorage": cloudflare.R2Bucket - "GatewayKv": cloudflare.KVNamespace - "LogProcessor": cloudflare.Service - "ZenData": cloudflare.R2Bucket - "ZenDataNew": cloudflare.R2Bucket - } -} - -import "sst" -export {} \ No newline at end of file diff --git a/packages/containers/README.md b/packages/containers/README.md deleted file mode 100644 index b66d62b..0000000 --- a/packages/containers/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# CI containers - -Prebuilt images intended to speed up GitHub Actions jobs by baking in -large, slow-to-install dependencies. These are designed for Linux jobs -that can use `job.container` in workflows. - -Images - -- `base`: Ubuntu 24.04 with common build tools and utilities -- `bun-node`: `base` plus Bun and Node.js 24 -- `rust`: `bun-node` plus Rust (stable, minimal profile) -- `tauri-linux`: `rust` plus Tauri Linux build dependencies -- `publish`: `bun-node` plus Docker CLI and AUR tooling - -Build - -``` -REGISTRY=ghcr.io/solaceharmony TAG=24.04 bun ./packages/containers/script/build.ts -REGISTRY=ghcr.io/solaceharmony TAG=24.04 bun ./packages/containers/script/build.ts --push -``` - -Workflow usage - -``` -jobs: - build-cli: - runs-on: ubuntu-latest - container: - image: ghcr.io/solaceharmony/build/bun-node:24.04 -``` - -Notes - -- These images only help Linux jobs. macOS and Windows jobs cannot run - inside Linux containers. -- `--push` publishes multi-arch (amd64 + arm64) images using Buildx. -- If a job uses Docker Buildx, the container needs access to the host - Docker daemon (or `docker-in-docker` with privileged mode). diff --git a/packages/containers/base/Dockerfile b/packages/containers/base/Dockerfile deleted file mode 100644 index a81f4ba..0000000 --- a/packages/containers/base/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:24.04 - -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - build-essential \ - ca-certificates \ - curl \ - git \ - jq \ - openssh-client \ - pkg-config \ - python3 \ - unzip \ - xz-utils \ - zip \ - && rm -rf /var/lib/apt/lists/* diff --git a/packages/containers/bun-node/Dockerfile b/packages/containers/bun-node/Dockerfile deleted file mode 100644 index d5cdb5c..0000000 --- a/packages/containers/bun-node/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -ARG REGISTRY=ghcr.io/solaceharmony -FROM ${REGISTRY}/build/base:24.04 - -SHELL ["/bin/bash", "-lc"] - -ARG NODE_VERSION=24.4.0 -ARG BUN_VERSION=1.3.5 - -ENV BUN_INSTALL=/opt/bun -ENV PATH=/opt/bun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - -RUN set -euo pipefail; \ - arch=$(uname -m); \ - node_arch=x64; \ - if [ "$arch" = "aarch64" ]; then node_arch=arm64; fi; \ - curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${node_arch}.tar.xz" \ - | tar -xJf - -C /usr/local --strip-components=1; \ - corepack enable - -RUN set -euo pipefail; \ - curl -fsSL https://bun.sh/install | bash -s -- "bun-v${BUN_VERSION}"; \ - bun --version; \ - node --version; \ - npm --version diff --git a/packages/containers/publish/Dockerfile b/packages/containers/publish/Dockerfile deleted file mode 100644 index bf688ee..0000000 --- a/packages/containers/publish/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -ARG REGISTRY=ghcr.io/solaceharmony -FROM ${REGISTRY}/build/bun-node:24.04 - -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - docker.io \ - pacman-package-manager \ - && rm -rf /var/lib/apt/lists/* diff --git a/packages/containers/rust/Dockerfile b/packages/containers/rust/Dockerfile deleted file mode 100644 index 7f77eb2..0000000 --- a/packages/containers/rust/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -ARG REGISTRY=ghcr.io/solaceharmony -FROM ${REGISTRY}/build/bun-node:24.04 - -ARG RUST_TOOLCHAIN=stable - -ENV CARGO_HOME=/opt/cargo -ENV RUSTUP_HOME=/opt/rustup -ENV PATH=/opt/cargo/bin:/opt/bun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - -RUN set -euo pipefail; \ - curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain "${RUST_TOOLCHAIN}"; \ - rustc --version; \ - cargo --version diff --git a/packages/containers/script/build.ts b/packages/containers/script/build.ts deleted file mode 100644 index b67bba1..0000000 --- a/packages/containers/script/build.ts +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env bun - -import { $ } from "bun" -import path from "path" -import { fileURLToPath } from "url" - -const rootDir = fileURLToPath(new URL("../../..", import.meta.url)) -process.chdir(rootDir) - -const reg = process.env.REGISTRY ?? "ghcr.io/solaceharmony" -const tag = process.env.TAG ?? "24.04" -const push = process.argv.includes("--push") || process.env.PUSH === "1" - -const root = path.join(rootDir, "package.json") -const pkg = await Bun.file(root).json() -const manager = pkg.packageManager ?? "" -const bun = manager.startsWith("bun@") ? manager.slice(4) : "" -if (!bun) throw new Error("packageManager must be bun@") - -const images = ["base", "bun-node", "rust", "tauri-linux", "publish"] - -const setup = async () => { - if (!push) return - const list = await $`docker buildx ls`.text() - if (list.includes("emberharmony")) { - await $`docker buildx use emberharmony` - return - } - await $`docker buildx create --name emberharmony --use` -} - -await setup() - -const platform = "linux/amd64,linux/arm64" - -for (const name of images) { - const image = `${reg}/build/${name}:${tag}` - const file = `packages/containers/${name}/Dockerfile` - if (name === "base") { - if (push) { - console.log(`docker buildx build --platform ${platform} -f ${file} -t ${image} --push .`) - await $`docker buildx build --platform ${platform} -f ${file} -t ${image} --push .` - } - if (!push) { - console.log(`docker build -f ${file} -t ${image} .`) - await $`docker build -f ${file} -t ${image} .` - } - } - if (name === "bun-node") { - if (push) { - console.log( - `docker buildx build --platform ${platform} -f ${file} -t ${image} --build-arg REGISTRY=${reg} --build-arg BUN_VERSION=${bun} --push .`, - ) - await $`docker buildx build --platform ${platform} -f ${file} -t ${image} --build-arg REGISTRY=${reg} --build-arg BUN_VERSION=${bun} --push .` - } - if (!push) { - console.log(`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} --build-arg BUN_VERSION=${bun} .`) - await $`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} --build-arg BUN_VERSION=${bun} .` - } - } - if (name !== "base" && name !== "bun-node") { - if (push) { - console.log( - `docker buildx build --platform ${platform} -f ${file} -t ${image} --build-arg REGISTRY=${reg} --push .`, - ) - await $`docker buildx build --platform ${platform} -f ${file} -t ${image} --build-arg REGISTRY=${reg} --push .` - } - if (!push) { - console.log(`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} .`) - await $`docker build -f ${file} -t ${image} --build-arg REGISTRY=${reg} .` - } - } - - if (push) { - console.log(`pushed ${image}`) - } -} diff --git a/packages/containers/tauri-linux/Dockerfile b/packages/containers/tauri-linux/Dockerfile deleted file mode 100644 index ffd42a9..0000000 --- a/packages/containers/tauri-linux/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -ARG REGISTRY=ghcr.io/solaceharmony -FROM ${REGISTRY}/build/rust:24.04 - -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - libappindicator3-dev \ - libwebkit2gtk-4.1-dev \ - librsvg2-dev \ - patchelf \ - && rm -rf /var/lib/apt/lists/* diff --git a/packages/containers/tsconfig.json b/packages/containers/tsconfig.json deleted file mode 100644 index 00ef125..0000000 --- a/packages/containers/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@tsconfig/bun/tsconfig.json", - "compilerOptions": { - "lib": ["ESNext", "DOM", "DOM.Iterable"], - "noUncheckedIndexedAccess": false - } -} diff --git a/packages/desktop/scripts/build-local.ts b/packages/desktop/scripts/build-local.ts index 7219db3..c394e22 100644 --- a/packages/desktop/scripts/build-local.ts +++ b/packages/desktop/scripts/build-local.ts @@ -11,8 +11,6 @@ * Flags: * --no-dmg Skip DMG creation (macOS only) * --no-bundle Skip all bundling, just build the binary - * --release Signed release build (requires Apple signing env vars) - * * Environment: * EMBERHARMONY_SKIP_CLI=1 Reuse an existing CLI binary in ../emberharmony/dist * @@ -31,8 +29,7 @@ const desktopDir = path.resolve(__dirname, "..") const emberharmonyDir = path.resolve(desktopDir, "../emberharmony") const repoRoot = path.resolve(desktopDir, "../..") -// Load .env from repo root so Apple signing/notarization credentials are available -// to `cargo tauri build`. Bun only auto-loads .env from cwd. +// Load .env from repo root. Bun only auto-loads .env from cwd. const rootEnv = path.join(repoRoot, ".env") if (existsSync(rootEnv)) { const envText = await Bun.file(rootEnv).text() @@ -59,7 +56,6 @@ process.chdir(desktopDir) const noDmg = process.argv.includes("--no-dmg") const noBundle = process.argv.includes("--no-bundle") -const isRelease = process.argv.includes("--release") const skipCli = process.env.EMBERHARMONY_SKIP_CLI === "1" // Resolve the Rust target triple for the current host. @@ -109,8 +105,6 @@ if (noBundle) { // fails. We create the DMG manually afterwards if the host is macOS. const tauriArgs = ["build"] // Note: `cargo tauri build` is release mode by default; `--debug` is the only toggle. -// Apple signing env vars (if set) are picked up automatically by Tauri. -void isRelease // Build only the .app on macOS (skip dmg in Tauri's own bundler) if (process.platform === "darwin") { @@ -154,13 +148,6 @@ if (process.platform === "darwin" && !noDmg) { await $`hdiutil create -volname "EmberHarmony Dev" -srcfolder ${stagingDir} -ov -format UDZO ${dmgPath}` await $`rm -rf ${stagingDir}` - // Sign the DMG itself so Gatekeeper trusts the container too. - const signingIdentity = process.env.APPLE_SIGNING_IDENTITY - if (signingIdentity) { - console.log(`[build-local] signing DMG with: ${signingIdentity}`) - await $`codesign --force --sign ${signingIdentity} ${dmgPath}` - } - console.log(`[build-local] DMG created: ${dmgPath}`) } diff --git a/packages/desktop/scripts/prepare.ts b/packages/desktop/scripts/prepare.ts index f37275b..d50e416 100755 --- a/packages/desktop/scripts/prepare.ts +++ b/packages/desktop/scripts/prepare.ts @@ -1,40 +1,14 @@ #!/usr/bin/env bun import { $ } from "bun" -import { Script } from "@thesolaceproject/emberharmony-script" import { copyBinaryToSidecarFolder, getCurrentSidecar, windowsify } from "./utils" - -async function tauri() { - const path = "./src-tauri/tauri.prod.conf.json" - const data = await Bun.file(path).json() - const pub = (Bun.env.TAURI_UPDATER_PUBKEY ?? "").trim() - const key = (Bun.env.TAURI_SIGNING_PRIVATE_KEY ?? "").trim() - const on = pub.length > 0 && key.length > 0 - - if (!data.bundle) data.bundle = {} - data.bundle.createUpdaterArtifacts = on - - if (!on) { - if (data.plugins && data.plugins.updater) delete data.plugins.updater - await Bun.write(path, JSON.stringify(data, null, 2) + "\n") - console.log("Updater disabled (missing TAURI_SIGNING_PRIVATE_KEY or TAURI_UPDATER_PUBKEY)") - return - } - - if (!data.plugins) data.plugins = {} - if (!data.plugins.updater) data.plugins.updater = {} - data.plugins.updater.pubkey = pub - await Bun.write(path, JSON.stringify(data, null, 2) + "\n") - console.log("Updater enabled (pubkey injected from TAURI_UPDATER_PUBKEY)") -} +import { Script } from "@thesolaceproject/emberharmony-script" const pkg = await Bun.file("./package.json").json() pkg.version = Script.version await Bun.write("./package.json", JSON.stringify(pkg, null, 2) + "\n") console.log(`Updated package.json version to ${Script.version}`) -await tauri() - const sidecar = getCurrentSidecar() const dir = "src-tauri/target/emberharmony-binaries" diff --git a/packages/desktop/src-tauri/src/lib.rs b/packages/desktop/src-tauri/src/lib.rs index 6d9c0ec..38ffc8c 100644 --- a/packages/desktop/src-tauri/src/lib.rs +++ b/packages/desktop/src-tauri/src/lib.rs @@ -250,8 +250,6 @@ async fn check_server_health(url: &str, password: Option<&str>) -> bool { #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { - let updater_enabled = option_env!("TAURI_SIGNING_PRIVATE_KEY").is_some_and(|key| !key.is_empty()); - #[cfg(all(target_os = "macos", not(debug_assertions)))] let _ = std::process::Command::new("killall") .arg("emberharmony-cli") @@ -324,7 +322,7 @@ pub fn run() { .initialization_script(format!( r#" window.__EMBERHARMONY__ ??= {{}}; - window.__EMBERHARMONY__.updaterEnabled = {updater_enabled}; + window.__EMBERHARMONY__.updaterEnabled = false; "# )); @@ -410,10 +408,6 @@ pub fn run() { Ok(()) }); - if updater_enabled { - builder = builder.plugin(tauri_plugin_updater::Builder::new().build()); - } - builder .build(tauri::generate_context!()) .expect("error while running tauri application") diff --git a/packages/desktop/src-tauri/tauri.prod.conf.json b/packages/desktop/src-tauri/tauri.prod.conf.json index a9d706b..642a548 100644 --- a/packages/desktop/src-tauri/tauri.prod.conf.json +++ b/packages/desktop/src-tauri/tauri.prod.conf.json @@ -3,7 +3,6 @@ "productName": "EmberHarmony", "identifier": "ai.ofharmony.code", "bundle": { - "createUpdaterArtifacts": true, "icon": [ "icons/prod/32x32.png", "icons/prod/128x128.png", @@ -23,11 +22,5 @@ } } } - }, - "plugins": { - "updater": { - "pubkey": "__SET_TAURI_UPDATER_PUBKEY_AT_BUILD_TIME__", - "endpoints": ["https://github.com/SolaceHarmony/emberharmony/releases/latest/download/latest.json"] - } } } diff --git a/packages/desktop/sst-env.d.ts b/packages/desktop/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/desktop/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/desktop/tsconfig.json b/packages/desktop/tsconfig.json index 62cbe4e..5995efb 100644 --- a/packages/desktop/tsconfig.json +++ b/packages/desktop/tsconfig.json @@ -11,6 +11,7 @@ "allowJs": true, "resolveJsonModule": true, "strict": true, + "types": ["bun", "node", "vite/client"], "isolatedModules": true, "noEmit": true, "emitDeclarationOnly": false, diff --git a/packages/docs/LICENSE b/packages/docs/LICENSE deleted file mode 100644 index 5411374..0000000 --- a/packages/docs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Mintlify - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/packages/docs/README.md b/packages/docs/README.md deleted file mode 100644 index 17956df..0000000 --- a/packages/docs/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Mintlify Starter Kit - -Use the starter kit to get your docs deployed and ready to customize. - -Click the green **Use this template** button at the top of this repo to copy the Mintlify starter kit. The starter kit contains examples with - -- Guide pages -- Navigation -- Customizations -- API reference pages -- Use of popular components - -**[Follow the full quickstart guide](https://starter.mintlify.com/quickstart)** - -## Development - -Install the [Mintlify CLI](https://www.npmjs.com/package/mint) to preview your documentation changes locally. To install, use the following command: - -``` -npm i -g mint -``` - -Run the following command at the root of your documentation, where your `docs.json` is located: - -``` -mint dev -``` - -View your local preview at `http://localhost:3000`. - -## Publishing changes - -Install our GitHub app from your [dashboard](https://dashboard.mintlify.com/settings/organization/github-app) to propagate changes from your repo to your deployment. Changes are deployed to production automatically after pushing to the default branch. - -## Need help? - -### Troubleshooting - -- If your dev environment isn't running: Run `mint update` to ensure you have the most recent version of the CLI. -- If a page loads as a 404: Make sure you are running in a folder with a valid `docs.json`. - -### Resources - -- [Mintlify documentation](https://mintlify.com/docs) diff --git a/packages/docs/ai-tools/claude-code.mdx b/packages/docs/ai-tools/claude-code.mdx deleted file mode 100644 index 4039c6e..0000000 --- a/packages/docs/ai-tools/claude-code.mdx +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: "Claude Code setup" -description: "Configure Claude Code for your documentation workflow" -icon: "asterisk" ---- - -Claude Code is Anthropic's official CLI tool. This guide will help you set up Claude Code to help you write and maintain your documentation. - -## Prerequisites - -- Active Claude subscription (Pro, Max, or API access) - -## Setup - -1. Install Claude Code globally: - -```bash -npm install -g @anthropic-ai/claude-code -``` - -2. Navigate to your docs directory. -3. (Optional) Add the `CLAUDE.md` file below to your project. -4. Run `claude` to start. - -## Create `CLAUDE.md` - -Create a `CLAUDE.md` file at the root of your documentation repository to train Claude Code on your specific documentation standards: - -```markdown -# Mintlify documentation - -## Working relationship - -- You can push back on ideas-this can lead to better documentation. Cite sources and explain your reasoning when you do so -- ALWAYS ask for clarification rather than making assumptions -- NEVER lie, guess, or make up information - -## Project context - -- Format: MDX files with YAML frontmatter -- Config: docs.json for navigation, theme, settings -- Components: Mintlify components - -## Content strategy - -- Document just enough for user success - not too much, not too little -- Prioritize accuracy and usability of information -- Make content evergreen when possible -- Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason -- Check existing patterns for consistency -- Start by making the smallest reasonable changes - -## Frontmatter requirements for pages - -- title: Clear, descriptive page title -- description: Concise summary for SEO/navigation - -## Writing standards - -- Second-person voice ("you") -- Prerequisites at start of procedural content -- Test all code examples before publishing -- Match style and formatting of existing pages -- Include both basic and advanced use cases -- Language tags on all code blocks -- Alt text on all images -- Relative paths for internal links - -## Git workflow - -- NEVER use --no-verify when committing -- Ask how to handle uncommitted changes before starting -- Create a new branch when no clear branch exists for changes -- Commit frequently throughout development -- NEVER skip or disable pre-commit hooks - -## Do not - -- Skip frontmatter on any MDX file -- Use absolute URLs for internal links -- Include untested code examples -- Make assumptions - always ask for clarification -``` diff --git a/packages/docs/ai-tools/cursor.mdx b/packages/docs/ai-tools/cursor.mdx deleted file mode 100644 index 8cf4dd6..0000000 --- a/packages/docs/ai-tools/cursor.mdx +++ /dev/null @@ -1,423 +0,0 @@ ---- -title: "Cursor setup" -description: "Configure Cursor for your documentation workflow" -icon: "arrow-pointer" ---- - -Use Cursor to help write and maintain your documentation. This guide shows how to configure Cursor for better results on technical writing tasks and using Mintlify components. - -## Prerequisites - -- Cursor editor installed -- Access to your documentation repository - -## Project rules - -Create project rules that all team members can use. In your documentation repository root: - -```bash -mkdir -p .cursor -``` - -Create `.cursor/rules.md`: - -````markdown -# Mintlify technical writing rule - -You are an AI writing assistant specialized in creating exceptional technical documentation using Mintlify components and following industry-leading technical writing practices. - -## Core writing principles - -### Language and style requirements - -- Use clear, direct language appropriate for technical audiences -- Write in second person ("you") for instructions and procedures -- Use active voice over passive voice -- Employ present tense for current states, future tense for outcomes -- Avoid jargon unless necessary and define terms when first used -- Maintain consistent terminology throughout all documentation -- Keep sentences concise while providing necessary context -- Use parallel structure in lists, headings, and procedures - -### Content organization standards - -- Lead with the most important information (inverted pyramid structure) -- Use progressive disclosure: basic concepts before advanced ones -- Break complex procedures into numbered steps -- Include prerequisites and context before instructions -- Provide expected outcomes for each major step -- Use descriptive, keyword-rich headings for navigation and SEO -- Group related information logically with clear section breaks - -### User-centered approach - -- Focus on user goals and outcomes rather than system features -- Anticipate common questions and address them proactively -- Include troubleshooting for likely failure points -- Write for scannability with clear headings, lists, and white space -- Include verification steps to confirm success - -## Mintlify component reference - -### Callout components - -#### Note - Additional helpful information - - -Supplementary information that supports the main content without interrupting flow - - -#### Tip - Best practices and pro tips - - -Expert advice, shortcuts, or best practices that enhance user success - - -#### Warning - Important cautions - - -Critical information about potential issues, breaking changes, or destructive actions - - -#### Info - Neutral contextual information - - -Background information, context, or neutral announcements - - -#### Check - Success confirmations - - -Positive confirmations, successful completions, or achievement indicators - - -### Code components - -#### Single code block - -Example of a single code block: - -```javascript config.js -const apiConfig = { - baseURL: "https://api.example.com", - timeout: 5000, - headers: { - Authorization: `Bearer ${process.env.API_TOKEN}`, - }, -} -``` - -#### Code group with multiple languages - -Example of a code group: - - -```javascript Node.js -const response = await fetch('/api/endpoint', { - headers: { Authorization: `Bearer ${apiKey}` } -}); -``` - -```python Python -import requests -response = requests.get('/api/endpoint', - headers={'Authorization': f'Bearer {api_key}'}) -``` - -```curl cURL -curl -X GET '/api/endpoint' \ - -H 'Authorization: Bearer YOUR_API_KEY' -``` - - - -#### Request/response examples - -Example of request/response documentation: - - -```bash cURL -curl -X POST 'https://api.example.com/users' \ - -H 'Content-Type: application/json' \ - -d '{"name": "John Doe", "email": "john@example.com"}' -``` - - - -```json Success -{ - "id": "user_123", - "name": "John Doe", - "email": "john@example.com", - "created_at": "2024-01-15T10:30:00Z" -} -``` - - -### Structural components - -#### Steps for procedures - -Example of step-by-step instructions: - - - - Run `npm install` to install required packages. - - - Verify installation by running `npm list`. - - - - - Create a `.env` file with your API credentials. - - ```bash - API_KEY=your_api_key_here - ``` - - - Never commit API keys to version control. - - - - -#### Tabs for alternative content - -Example of tabbed content: - - - - ```bash - mise use -g node@lts - npm install -g package-name - ``` - - - - ```powershell - choco install nodejs - npm install -g package-name - ``` - - - - ```bash - sudo apt install nodejs npm - npm install -g package-name - ``` - - - -#### Accordions for collapsible content - -Example of accordion groups: - - - - - **Firewall blocking**: Ensure ports 80 and 443 are open - - **Proxy configuration**: Set HTTP_PROXY environment variable - - **DNS resolution**: Try using 8.8.8.8 as DNS server - - - - ```javascript - const config = { - performance: { cache: true, timeout: 30000 }, - security: { encryption: 'AES-256' } - }; - ``` - - - -### Cards and columns for emphasizing information - -Example of cards and card groups: - - -Complete walkthrough from installation to your first API call in under 10 minutes. - - - - - Learn how to authenticate requests using API keys or JWT tokens. - - - - Understand rate limits and best practices for high-volume usage. - - - -### API documentation components - -#### Parameter fields - -Example of parameter documentation: - - -Unique identifier for the user. Must be a valid UUID v4 format. - - - -User's email address. Must be valid and unique within the system. - - - -Maximum number of results to return. Range: 1-100. - - - -Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` - - -#### Response fields - -Example of response field documentation: - - -Unique identifier assigned to the newly created user. - - - -ISO 8601 formatted timestamp of when the user was created. - - - -List of permission strings assigned to this user. - - -#### Expandable nested fields - -Example of nested field documentation: - - -Complete user object with all associated data. - - - - User profile information including personal details. - - - - User's first name as entered during registration. - - - - URL to user's profile picture. Returns null if no avatar is set. - - - - - - -### Media and advanced components - -#### Frames for images - -Wrap all images in frames: - - -Main dashboard showing analytics overview - - - -Analytics dashboard with charts - - -#### Videos - -Use the HTML video element for self-hosted video content: - - - -Embed YouTube videos using iframe elements: - - - -#### Tooltips - -Example of tooltip usage: - - -API - - -#### Updates - -Use updates for changelogs: - - -## New features -- Added bulk user import functionality -- Improved error messages with actionable suggestions - -## Bug fixes - -- Fixed pagination issue with large datasets -- Resolved authentication timeout problems - - -## Required page structure - -Every documentation page must begin with YAML frontmatter: - -```yaml ---- -title: "Clear, specific, keyword-rich title" -description: "Concise description explaining page purpose and value" ---- -``` - -## Content quality standards - -### Code examples requirements - -- Always include complete, runnable examples that users can copy and execute -- Show proper error handling and edge case management -- Use realistic data instead of placeholder values -- Include expected outputs and results for verification -- Test all code examples thoroughly before publishing -- Specify language and include filename when relevant -- Add explanatory comments for complex logic -- Never include real API keys or secrets in code examples - -### API documentation requirements - -- Document all parameters including optional ones with clear descriptions -- Show both success and error response examples with realistic data -- Include rate limiting information with specific limits -- Provide authentication examples showing proper format -- Explain all HTTP status codes and error handling -- Cover complete request/response cycles - -### Accessibility requirements - -- Include descriptive alt text for all images and diagrams -- Use specific, actionable link text instead of "click here" -- Ensure proper heading hierarchy starting with H2 -- Provide keyboard navigation considerations -- Use sufficient color contrast in examples and visuals -- Structure content for easy scanning with headers and lists - -## Component selection logic - -- Use **Steps** for procedures and sequential instructions -- Use **Tabs** for platform-specific content or alternative approaches -- Use **CodeGroup** when showing the same concept in multiple programming languages -- Use **Accordions** for progressive disclosure of information -- Use **RequestExample/ResponseExample** specifically for API endpoint documentation -- Use **ParamField** for API parameters, **ResponseField** for API responses -- Use **Expandable** for nested object properties or hierarchical information -```` diff --git a/packages/docs/ai-tools/windsurf.mdx b/packages/docs/ai-tools/windsurf.mdx deleted file mode 100644 index 310c81d..0000000 --- a/packages/docs/ai-tools/windsurf.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: "Windsurf setup" -description: "Configure Windsurf for your documentation workflow" -icon: "water" ---- - -Configure Windsurf's Cascade AI assistant to help you write and maintain documentation. This guide shows how to set up Windsurf specifically for your Mintlify documentation workflow. - -## Prerequisites - -- Windsurf editor installed -- Access to your documentation repository - -## Workspace rules - -Create workspace rules that provide Windsurf with context about your documentation project and standards. - -Create `.windsurf/rules.md` in your project root: - -````markdown -# Mintlify technical writing rule - -## Project context - -- This is a documentation project on the Mintlify platform -- We use MDX files with YAML frontmatter -- Navigation is configured in `docs.json` -- We follow technical writing best practices - -## Writing standards - -- Use second person ("you") for instructions -- Write in active voice and present tense -- Start procedures with prerequisites -- Include expected outcomes for major steps -- Use descriptive, keyword-rich headings -- Keep sentences concise but informative - -## Required page structure - -Every page must start with frontmatter: - -```yaml ---- -title: "Clear, specific title" -description: "Concise description for SEO and navigation" ---- -``` - -## Mintlify components - -### Callouts - -- `` for helpful supplementary information -- `` for important cautions and breaking changes -- `` for best practices and expert advice -- `` for neutral contextual information -- `` for success confirmations - -### Code examples - -- When appropriate, include complete, runnable examples -- Use `` for multiple language examples -- Specify language tags on all code blocks -- Include realistic data, not placeholders -- Use `` and `` for API docs - -### Procedures - -- Use `` component for sequential instructions -- Include verification steps with `` components when relevant -- Break complex procedures into smaller steps - -### Content organization - -- Use `` for platform-specific content -- Use `` for progressive disclosure -- Use `` and `` for highlighting content -- Wrap images in `` components with descriptive alt text - -## API documentation requirements - -- Document all parameters with `` -- Show response structure with `` -- Include both success and error examples -- Use `` for nested object properties -- Always include authentication examples - -## Quality standards - -- Test all code examples before publishing -- Use relative paths for internal links -- Include alt text for all images -- Ensure proper heading hierarchy (start with h2) -- Check existing patterns for consistency -```` diff --git a/packages/docs/development.mdx b/packages/docs/development.mdx deleted file mode 100644 index 432ef80..0000000 --- a/packages/docs/development.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: "Development" -description: "Preview changes locally to update your docs" ---- - -**Prerequisites**: - Node.js version 19 or higher - A docs repository with a `docs.json` file - -Follow these steps to install and run Mintlify on your operating system. - - - - -```bash -npm i -g mint -``` - - - - - -Navigate to your docs directory where your `docs.json` file is located, and run the following command: - -```bash -mint dev -``` - -A local preview of your documentation will be available at `http://localhost:3000`. - - - - -## Custom ports - -By default, Mintlify uses port 3000. You can customize the port Mintlify runs on by using the `--port` flag. For example, to run Mintlify on port 3333, use this command: - -```bash -mint dev --port 3333 -``` - -If you attempt to run Mintlify on a port that's already in use, it will use the next available port: - -```md -Port 3000 is already in use. Trying 3001 instead. -``` - -## Mintlify versions - -Please note that each CLI release is associated with a specific version of Mintlify. If your local preview does not align with the production version, please update the CLI: - -```bash -npm mint update -``` - -## Validating links - -The CLI can assist with validating links in your documentation. To identify any broken links, use the following command: - -```bash -mint broken-links -``` - -## Deployment - -If the deployment is successful, you should see the following: - - - Screenshot of a deployment confirmation message that says All checks have passed. - - -## Code formatting - -We suggest using extensions on your IDE to recognize and format MDX. If you're a VSCode user, consider the [MDX VSCode extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) for syntax highlighting, and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting. - -## Troubleshooting - - - - - This may be due to an outdated version of node. Try the following: - 1. Remove the currently-installed version of the CLI: `npm remove -g mint` - 2. Upgrade to Node v19 or higher. - 3. Reinstall the CLI: `npm i -g mint` - - - - - - Solution: Go to the root of your device and delete the `~/.mintlify` folder. Then run `mint dev` again. - - - -Curious about what changed in the latest CLI version? Check out the [CLI changelog](https://www.npmjs.com/package/mintlify?activeTab=versions). diff --git a/packages/docs/docs.json b/packages/docs/docs.json deleted file mode 100644 index 68219e9..0000000 --- a/packages/docs/docs.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "https://mintlify.com/docs.json", - "theme": "mint", - "name": "@thesolaceproject/emberharmony-docs", - "colors": { - "primary": "#16A34A", - "light": "#07C983", - "dark": "#15803D" - }, - "favicon": "/favicon-v3.svg", - "navigation": { - "tabs": [ - { - "tab": "SDK", - "groups": [ - { - "group": "Getting started", - "pages": ["index", "quickstart", "development"], - "openapi": "https://solace.ofharmony.ai/openapi.json" - } - ] - } - ], - "global": {} - }, - "logo": { - "light": "/logo/light.svg", - "dark": "/logo/dark.svg" - }, - "navbar": { - "links": [ - { - "label": "Support", - "href": "mailto:hi@mintlify.com" - } - ], - "primary": { - "type": "button", - "label": "Dashboard", - "href": "https://dashboard.mintlify.com" - } - }, - "contextual": { - "options": ["copy", "view", "chatgpt", "claude", "perplexity", "mcp", "cursor", "vscode"] - }, - "footer": { - "socials": { - "x": "https://x.com/mintlify", - "github": "https://github.com/mintlify", - "linkedin": "https://linkedin.com/company/mintlify" - } - } -} diff --git a/packages/docs/essentials/code.mdx b/packages/docs/essentials/code.mdx deleted file mode 100644 index 7a04654..0000000 --- a/packages/docs/essentials/code.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: "Code blocks" -description: "Display inline code and code blocks" -icon: "code" ---- - -## Inline code - -To denote a `word` or `phrase` as code, enclose it in backticks (`). - -``` -To denote a `word` or `phrase` as code, enclose it in backticks (`). -``` - -## Code blocks - -Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language. - -```java HelloWorld.java -class HelloWorld { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -} -``` - -````md -```java HelloWorld.java -class HelloWorld { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -} -``` -```` diff --git a/packages/docs/essentials/images.mdx b/packages/docs/essentials/images.mdx deleted file mode 100644 index f2a10d2..0000000 --- a/packages/docs/essentials/images.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: "Images and embeds" -description: "Add image, video, and other HTML elements" -icon: "image" ---- - - - -## Image - -### Using Markdown - -The [markdown syntax](https://www.markdownguide.org/basic-syntax/#images) lets you add images using the following code - -```md -![title](/path/image.jpg) -``` - -Note that the image file size must be less than 5MB. Otherwise, we recommend hosting on a service like [Cloudinary](https://cloudinary.com/) or [S3](https://aws.amazon.com/s3/). You can then use that URL and embed. - -### Using embeds - -To get more customizability with images, you can also use [embeds](/writing-content/embed) to add images - -```html - -``` - -## Embeds and HTML elements - - - -
- - - -Mintlify supports [HTML tags in Markdown](https://www.markdownguide.org/basic-syntax/#html). This is helpful if you prefer HTML tags to Markdown syntax, and lets you create documentation with infinite flexibility. - - - -### iFrames - -Loads another HTML page within the document. Most commonly used for embedding videos. - -```html - -``` diff --git a/packages/docs/essentials/markdown.mdx b/packages/docs/essentials/markdown.mdx deleted file mode 100644 index 0ca5b82..0000000 --- a/packages/docs/essentials/markdown.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: "Markdown syntax" -description: "Text, title, and styling in standard markdown" -icon: "text-size" ---- - -## Titles - -Best used for section headers. - -```md -## Titles -``` - -### Subtitles - -Best used for subsection headers. - -```md -### Subtitles -``` - - - -Each **title** and **subtitle** creates an anchor and also shows up on the table of contents on the right. - - - -## Text formatting - -We support most markdown formatting. Simply add `**`, `_`, or `~` around text to format it. - -| Style | How to write it | Result | -| ------------- | ----------------- | --------------- | -| Bold | `**bold**` | **bold** | -| Italic | `_italic_` | _italic_ | -| Strikethrough | `~strikethrough~` | ~strikethrough~ | - -You can combine these. For example, write `**_bold and italic_**` to get **_bold and italic_** text. - -You need to use HTML to write superscript and subscript text. That is, add `` or `` around your text. - -| Text Size | How to write it | Result | -| ----------- | ------------------------ | ---------------------- | -| Superscript | `superscript` | superscript | -| Subscript | `subscript` | subscript | - -## Linking to pages - -You can add a link by wrapping text in `[]()`. You would write `[link to google](https://google.com)` to [link to google](https://google.com). - -Links to pages in your docs need to be root-relative. Basically, you should include the entire folder path. For example, `[link to text](/writing-content/text)` links to the page "Text" in our components section. - -Relative links like `[link to text](../text)` will open slower because we cannot optimize them as easily. - -## Blockquotes - -### Singleline - -To create a blockquote, add a `>` in front of a paragraph. - -> Dorothy followed her through many of the beautiful rooms in her castle. - -```md -> Dorothy followed her through many of the beautiful rooms in her castle. -``` - -### Multiline - -> Dorothy followed her through many of the beautiful rooms in her castle. -> -> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood. - -```md -> Dorothy followed her through many of the beautiful rooms in her castle. -> -> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood. -``` - -### LaTeX - -Mintlify supports [LaTeX](https://www.latex-project.org) through the Latex component. - -8 x (vk x H1 - H2) = (0,1) - -```md -8 x (vk x H1 - H2) = (0,1) -``` diff --git a/packages/docs/essentials/navigation.mdx b/packages/docs/essentials/navigation.mdx deleted file mode 100644 index a6a3090..0000000 --- a/packages/docs/essentials/navigation.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: "Navigation" -description: "The navigation field in docs.json defines the pages that go in the navigation menu" -icon: "map" ---- - -The navigation menu is the list of links on every website. - -You will likely update `docs.json` every time you add a new page. Pages do not show up automatically. - -## Navigation syntax - -Our navigation syntax is recursive which means you can make nested navigation groups. You don't need to include `.mdx` in page names. - - - -```json Regular Navigation -"navigation": { - "tabs": [ - { - "tab": "Docs", - "groups": [ - { - "group": "Getting Started", - "pages": ["quickstart"] - } - ] - } - ] -} -``` - -```json Nested Navigation -"navigation": { - "tabs": [ - { - "tab": "Docs", - "groups": [ - { - "group": "Getting Started", - "pages": [ - "quickstart", - { - "group": "Nested Reference Pages", - "pages": ["nested-reference-page"] - } - ] - } - ] - } - ] -} -``` - - - -## Folders - -Simply put your MDX files in folders and update the paths in `docs.json`. - -For example, to have a page at `https://yoursite.com/your-folder/your-page` you would make a folder called `your-folder` containing an MDX file called `your-page.mdx`. - - - -You cannot use `api` for the name of a folder unless you nest it inside another folder. Mintlify uses Next.js which reserves the top-level `api` folder for internal server calls. A folder name such as `api-reference` would be accepted. - - - -```json Navigation With Folder -"navigation": { - "tabs": [ - { - "tab": "Docs", - "groups": [ - { - "group": "Group Name", - "pages": ["your-folder/your-page"] - } - ] - } - ] -} -``` - -## Hidden pages - -MDX files not included in `docs.json` will not show up in the sidebar but are accessible through the search bar and by linking directly to them. diff --git a/packages/docs/essentials/reusable-snippets.mdx b/packages/docs/essentials/reusable-snippets.mdx deleted file mode 100644 index a26ab89..0000000 --- a/packages/docs/essentials/reusable-snippets.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: "Reusable snippets" -description: "Reusable, custom snippets to keep content in sync" -icon: "recycle" ---- - -import SnippetIntro from "/snippets/snippet-intro.mdx" - - - -## Creating a custom snippet - -**Pre-condition**: You must create your snippet file in the `snippets` directory. - - - Any page in the `snippets` directory will be treated as a snippet and will not be rendered into a standalone page. If - you want to create a standalone page from the snippet, import the snippet into another file and call it as a - component. - - -### Default export - -1. Add content to your snippet file that you want to re-use across multiple - locations. Optionally, you can add variables that can be filled in via props - when you import the snippet. - -```mdx snippets/my-snippet.mdx -Hello world! This is my content I want to reuse across pages. My keyword of the -day is {word}. -``` - - - The content that you want to reuse must be inside the `snippets` directory in order for the import to work. - - -2. Import the snippet into your destination file. - -```mdx destination-file.mdx ---- -title: My title -description: My Description ---- - -import MySnippet from "/snippets/path/to/my-snippet.mdx" - -## Header - -Lorem impsum dolor sit amet. - - -``` - -### Reusable variables - -1. Export a variable from your snippet file: - -```mdx snippets/path/to/custom-variables.mdx -export const myName = "my name" - -export const myObject = { fruit: "strawberries" } - -; -``` - -2. Import the snippet from your destination file and use the variable: - -```mdx destination-file.mdx ---- -title: My title -description: My Description ---- - -import { myName, myObject } from "/snippets/path/to/custom-variables.mdx" - -Hello, my name is {myName} and I like {myObject.fruit}. -``` - -### Reusable components - -1. Inside your snippet file, create a component that takes in props by exporting - your component in the form of an arrow function. - -```mdx snippets/custom-component.mdx -export const MyComponent = ({ title }) => ( -
-

{title}

-

... snippet content ...

-
-) - -; -``` - - - MDX does not compile inside the body of an arrow function. Stick to HTML syntax when you can or use a default export - if you need to use MDX. - - -2. Import the snippet into your destination file and pass in the props - -```mdx destination-file.mdx ---- -title: My title -description: My Description ---- - -import { MyComponent } from "/snippets/custom-component.mdx" - -Lorem ipsum dolor sit amet. - - -``` diff --git a/packages/docs/essentials/settings.mdx b/packages/docs/essentials/settings.mdx deleted file mode 100644 index 2cc202e..0000000 --- a/packages/docs/essentials/settings.mdx +++ /dev/null @@ -1,316 +0,0 @@ ---- -title: "Global Settings" -description: "Mintlify gives you complete control over the look and feel of your documentation using the docs.json file" -icon: "gear" ---- - -Every Mintlify site needs a `docs.json` file with the core configuration settings. Learn more about the [properties](#properties) below. - -## Properties - - -Name of your project. Used for the global title. - -Example: `mintlify` - - - - - An array of groups with all the pages within that group - - - The name of the group. - - Example: `Settings` - - - - The relative paths to the markdown files that will serve as pages. - - Example: `["customization", "page"]` - - - - - - - - Path to logo image or object with path to "light" and "dark" mode logo images - - - Path to the logo in light mode - - - Path to the logo in dark mode - - - Where clicking on the logo links you to - - - - - - Path to the favicon image - - - - Hex color codes for your global theme - - - The primary color. Used most often for highlighted content, section headers, accents, in light mode - - - The primary color for dark mode. Used most often for highlighted content, section headers, accents, in dark mode - - - The primary color for important buttons - - - The color of the background in both light and dark mode - - - The hex color code of the background in light mode - - - The hex color code of the background in dark mode - - - - - - - - Array of `name`s and `url`s of links you want to include in the topbar - - - The name of the button. - - Example: `Contact us` - - - The url once you click on the button. Example: `https://mintlify.com/docs` - - - - - - - - - Link shows a button. GitHub shows the repo information at the url provided including the number of GitHub stars. - - - If `link`: What the button links to. - - If `github`: Link to the repository to load GitHub information from. - - - Text inside the button. Only required if `type` is a `link`. - - - - - - - Array of version names. Only use this if you want to show different versions of docs with a dropdown in the navigation - bar. - - - - An array of the anchors, includes the `icon`, `color`, and `url`. - - - The [Font Awesome](https://fontawesome.com/search?q=heart) icon used to feature the anchor. - - Example: `comments` - - - The name of the anchor label. - - Example: `Community` - - - The start of the URL that marks what pages go in the anchor. Generally, this is the name of the folder you put your pages in. - - - The hex color of the anchor icon background. Can also be a gradient if you pass an object with the properties `from` and `to` that are each a hex color. - - - Used if you want to hide an anchor until the correct docs version is selected. - - - Pass `true` if you want to hide the anchor until you directly link someone to docs inside it. - - - One of: "brands", "duotone", "light", "sharp-solid", "solid", or "thin" - - - - - - - Override the default configurations for the top-most anchor. - - - The name of the top-most anchor - - - Font Awesome icon. - - - One of: "brands", "duotone", "light", "sharp-solid", "solid", or "thin" - - - - - - An array of navigational tabs. - - - The name of the tab label. - - - The start of the URL that marks what pages go in the tab. Generally, this is the name of the folder you put your - pages in. - - - - - - Configuration for API settings. Learn more about API pages at [API Components](/api-playground/demo). - - - The base url for all API endpoints. If `baseUrl` is an array, it will enable for multiple base url - options that the user can toggle. - - - - - - The authentication strategy used for all API endpoints. - - - The name of the authentication parameter used in the API playground. - - If method is `basic`, the format should be `[usernameName]:[passwordName]` - - - The default value that's designed to be a prefix for the authentication input field. - - E.g. If an `inputPrefix` of `AuthKey` would inherit the default input result of the authentication field as `AuthKey`. - - - - - - Configurations for the API playground - - - - Whether the playground is showing, hidden, or only displaying the endpoint with no added user interactivity `simple` - - Learn more at the [playground guides](/api-playground/demo) - - - - - - Enabling this flag ensures that key ordering in OpenAPI pages matches the key ordering defined in the OpenAPI file. - - This behavior will soon be enabled by default, at which point this field will be deprecated. - - - - - - - A string or an array of strings of URL(s) or relative path(s) pointing to your - OpenAPI file. - - Examples: - - ```json Absolute - "openapi": "https://example.com/openapi.json" - ``` - ```json Relative - "openapi": "/openapi.json" - ``` - ```json Multiple - "openapi": ["https://example.com/openapi1.json", "/openapi2.json", "/openapi3.json"] - ``` - - - - - - An object of social media accounts where the key:property pair represents the social media platform and the account url. - - Example: - ```json - { - "x": "https://x.com/mintlify", - "website": "https://mintlify.com" - } - ``` - - - One of the following values `website`, `facebook`, `x`, `discord`, `slack`, `github`, `linkedin`, `instagram`, `hacker-news` - - Example: `x` - - - The URL to the social platform. - - Example: `https://x.com/mintlify` - - - - - - Configurations to enable feedback buttons - - - - Enables a button to allow users to suggest edits via pull requests - - - Enables a button to allow users to raise an issue about the documentation - - - - - - Customize the dark mode toggle. - - - Set if you always want to show light or dark mode for new users. When not - set, we default to the same mode as the user's operating system. - - - Set to true to hide the dark/light mode toggle. You can combine `isHidden` with `default` to force your docs to only use light or dark mode. For example: - - - ```json Only Dark Mode - "modeToggle": { - "default": "dark", - "isHidden": true - } - ``` - - ```json Only Light Mode - "modeToggle": { - "default": "light", - "isHidden": true - } - ``` - - - - - - - - - A background image to be displayed behind every page. See example with [Infisical](https://infisical.com/docs) and - [FRPC](https://frpc.io). - diff --git a/packages/docs/favicon-v3.svg b/packages/docs/favicon-v3.svg deleted file mode 100644 index 9bdf731..0000000 --- a/packages/docs/favicon-v3.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/docs/favicon.svg b/packages/docs/favicon.svg deleted file mode 100644 index 9bdf731..0000000 --- a/packages/docs/favicon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/docs/images/checks-passed.png b/packages/docs/images/checks-passed.png deleted file mode 100644 index 3303c77..0000000 Binary files a/packages/docs/images/checks-passed.png and /dev/null differ diff --git a/packages/docs/images/hero-dark.png b/packages/docs/images/hero-dark.png deleted file mode 100644 index a61cbb1..0000000 Binary files a/packages/docs/images/hero-dark.png and /dev/null differ diff --git a/packages/docs/images/hero-light.png b/packages/docs/images/hero-light.png deleted file mode 100644 index 68c712d..0000000 Binary files a/packages/docs/images/hero-light.png and /dev/null differ diff --git a/packages/docs/index.mdx b/packages/docs/index.mdx deleted file mode 100644 index 19a09f8..0000000 --- a/packages/docs/index.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: "Introduction" -description: "Welcome to the new home for your documentation" ---- - -## Setting up - -Get your documentation site up and running in minutes. - - - Follow our three step quickstart guide. - - -## Make it yours - -Design a docs site that looks great and empowers your users. - - - - Edit your docs locally and preview them in real time. - - - Customize the design and colors of your site to match your brand. - - - Organize your docs to help users find what they need and succeed with your product. - - - Auto-generate API documentation from OpenAPI specifications. - - - -## Create beautiful pages - -Everything you need to create world-class documentation. - - - - Use MDX to style your docs pages. - - - Add sample code to demonstrate how to use your product. - - - Display images and other media. - - - Write once and reuse across your docs. - - - -## Need inspiration? - - - Browse our showcase of exceptional documentation sites. - diff --git a/packages/docs/logo/dark.svg b/packages/docs/logo/dark.svg deleted file mode 100644 index 4d02de7..0000000 --- a/packages/docs/logo/dark.svg +++ /dev/null @@ -1,31 +0,0 @@ - - EmberHarmony - - - - - - - - - - - - - - - - - - - - - - - - - - - Ember - Harmony - diff --git a/packages/docs/logo/light.svg b/packages/docs/logo/light.svg deleted file mode 100644 index 6364d1e..0000000 --- a/packages/docs/logo/light.svg +++ /dev/null @@ -1,31 +0,0 @@ - - EmberHarmony - - - - - - - - - - - - - - - - - - - - - - - - - - - Ember - Harmony - diff --git a/packages/docs/openapi.json b/packages/docs/openapi.json deleted file mode 120000 index 854dd8b..0000000 --- a/packages/docs/openapi.json +++ /dev/null @@ -1 +0,0 @@ -../sdk/openapi.json \ No newline at end of file diff --git a/packages/docs/quickstart.mdx b/packages/docs/quickstart.mdx deleted file mode 100644 index 52243fb..0000000 --- a/packages/docs/quickstart.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: "Quickstart" -description: "Start building awesome documentation in minutes" ---- - -## Get started in three steps - -Get your documentation site running locally and make your first customization. - -### Step 1: Set up your local environment - - - - During the onboarding process, you created a GitHub repository with your docs content if you didn't already have - one. You can find a link to this repository in your [dashboard](https://dashboard.mintlify.com). To clone the - repository locally so that you can make and preview changes to your docs, follow the [Cloning a - repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) guide - in the GitHub docs. - - - 1. Install the Mintlify CLI: `npm i -g mint` 2. Navigate to your docs directory and run: `mint dev` 3. Open - `http://localhost:3000` to see your docs live! - Your preview updates automatically as you edit files. - - - -### Step 2: Deploy your changes - - - - Install the Mintlify GitHub app from your [dashboard](https://dashboard.mintlify.com/settings/organization/github-app). - - Our GitHub app automatically deploys your changes to your docs site, so you don't need to manage deployments yourself. - - - For a first change, let's update the name and colors of your docs site. - - 1. Open `docs.json` in your editor. - 2. Change the `"name"` field to your project name. - 3. Update the `"colors"` to match your brand. - 4. Save and see your changes instantly at `http://localhost:3000`. - - Try changing the primary color to see an immediate difference! - - - - -### Step 3: Go live - - - 1. Commit and push your changes. 2. Your docs will update and be live in moments! - - -## Next steps - -Now that you have your docs running, explore these key features: - - - - - Learn MDX syntax and start writing your documentation. - - - - Make your docs match your brand perfectly. - - - - Include syntax-highlighted code blocks. - - - - Auto-generate API docs from OpenAPI specs. - - - - - - **Need help?** See our [full documentation](https://mintlify.com/docs) or join our - [community](https://mintlify.com/community). - diff --git a/packages/docs/snippets/snippet-intro.mdx b/packages/docs/snippets/snippet-intro.mdx deleted file mode 100644 index e20fbb6..0000000 --- a/packages/docs/snippets/snippet-intro.mdx +++ /dev/null @@ -1,4 +0,0 @@ -One of the core principles of software development is DRY (Don't Repeat -Yourself). This is a principle that applies to documentation as -well. If you find yourself repeating the same content in multiple places, you -should consider creating a custom snippet to keep your content in sync. diff --git a/packages/emberharmony/Dockerfile b/packages/emberharmony/Dockerfile deleted file mode 100644 index c7af1c0..0000000 --- a/packages/emberharmony/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM alpine AS base - -# Disable the runtime transpiler cache by default inside Docker containers. -# On ephemeral containers, the cache is not useful -ARG BUN_RUNTIME_TRANSPILER_CACHE_PATH=0 -ENV BUN_RUNTIME_TRANSPILER_CACHE_PATH=${BUN_RUNTIME_TRANSPILER_CACHE_PATH} -RUN apk add libgcc libstdc++ ripgrep - -FROM base AS build-amd64 -COPY dist@thesolaceproject/emberharmony-linux-x64-baseline-musl/bin/emberharmony /usr/local/bin/emberharmony - -FROM base AS build-arm64 -COPY dist@thesolaceproject/emberharmony-linux-arm64-musl/bin/emberharmony /usr/local/bin/emberharmony - -ARG TARGETARCH -FROM build-${TARGETARCH} -RUN emberharmony --version -ENTRYPOINT ["emberharmony"] diff --git a/packages/emberharmony/package.json b/packages/emberharmony/package.json index 719e441..b593c65 100644 --- a/packages/emberharmony/package.json +++ b/packages/emberharmony/package.json @@ -18,8 +18,7 @@ "clean": "echo 'Cleaning up...' && rm -rf node_modules dist", "lint": "echo 'Running lint checks...' && bun test --coverage", "format": "echo 'Formatting code...' && bun run --prettier --write src/**/*.ts", - "docs": "echo 'Generating documentation...' && find src -name '*.ts' -exec echo 'Processing: {}' \\;", - "deploy": "echo 'Deploying application...' && bun run build && echo 'Deployment completed successfully'" + "docs": "echo 'Generating documentation...' && find src -name '*.ts' -exec echo 'Processing: {}' \\;" }, "bin": { "emberharmony": "bin/emberharmony" diff --git a/packages/emberharmony/script/publish.ts b/packages/emberharmony/script/publish.ts index f2658c4..071abc2 100755 --- a/packages/emberharmony/script/publish.ts +++ b/packages/emberharmony/script/publish.ts @@ -31,18 +31,26 @@ await $`cp ./script/postinstall.mjs ./dist/${pkg.name}/postinstall.mjs` const meta = await Bun.file(path.join(root, "package.json")) .json() - .catch(() => ({} as unknown)) + .catch(() => ({}) as unknown) const description = - typeof meta === "object" && meta && "description" in meta && typeof meta.description === "string" ? meta.description : undefined + typeof meta === "object" && meta && "description" in meta && typeof meta.description === "string" + ? meta.description + : undefined const homepage = - typeof meta === "object" && meta && "homepage" in meta && typeof meta.homepage === "string" ? meta.homepage : undefined + typeof meta === "object" && meta && "homepage" in meta && typeof meta.homepage === "string" + ? meta.homepage + : undefined -const license = typeof meta === "object" && meta && "license" in meta && typeof meta.license === "string" ? meta.license : "MIT" +const license = + typeof meta === "object" && meta && "license" in meta && typeof meta.license === "string" ? meta.license : "MIT" const repository = - typeof meta === "object" && meta && "repository" in meta && (typeof meta.repository === "object" || typeof meta.repository === "string") + typeof meta === "object" && + meta && + "repository" in meta && + (typeof meta.repository === "object" || typeof meta.repository === "string") ? meta.repository : undefined @@ -146,132 +154,3 @@ if (publishPlatforms) { } } await publish(`./dist/${pkg.name}`) - -// registries -if (!Script.preview) { - // Calculate SHA values - const arm64Sha = await $`sha256sum ./dist/${cliName}-linux-arm64.tar.gz | cut -d' ' -f1`.text().then((x) => x.trim()) - const x64Sha = await $`sha256sum ./dist/${cliName}-linux-x64.tar.gz | cut -d' ' -f1`.text().then((x) => x.trim()) - const macX64Sha = await $`sha256sum ./dist/${cliName}-darwin-x64.zip | cut -d' ' -f1`.text().then((x) => x.trim()) - const macArm64Sha = await $`sha256sum ./dist/${cliName}-darwin-arm64.zip | cut -d' ' -f1`.text().then((x) => x.trim()) - - const [pkgver, _subver = ""] = Script.version.split(/(-.*)/, 2) - - /* - // arch - const binaryPkgbuild = [ - "# Maintainer: dax", - "# Maintainer: adam", - "", - "pkgname='emberharmony-bin'", - `pkgver=${pkgver}`, - `_subver=${_subver}`, - "options=('!debug' '!strip')", - "pkgrel=1", - "pkgdesc='The AI coding agent built for the terminal.'", - "url='https://github.com/SolaceHarmony/emberharmony'", - "arch=('aarch64' 'x86_64')", - "license=('MIT')", - "provides=('emberharmony')", - "conflicts=('emberharmony')", - "depends=('ripgrep')", - "", - `source_aarch64=("\${pkgname}_\${pkgver}_aarch64.tar.gz::https://github.com/SolaceHarmony/emberharmony/releases/download/v\${pkgver}\${_subver}/${cliName}-linux-arm64.tar.gz")`, - `sha256sums_aarch64=('${arm64Sha}')`, - - `source_x86_64=("\${pkgname}_\${pkgver}_x86_64.tar.gz::https://github.com/SolaceHarmony/emberharmony/releases/download/v\${pkgver}\${_subver}/${cliName}-linux-x64.tar.gz")`, - `sha256sums_x86_64=('${x64Sha}')`, - "", - "package() {", - ` install -Dm755 ./${cliName} "${pkgdir}/usr/bin/${cliName}"`, - "}", - "", - ].join("\n") - - // Source-based PKGBUILD for emberharmony - const sourcePkgbuild = [ - "# Maintainer: dax", - "# Maintainer: adam", - "", - "pkgname='emberharmony'", - `pkgver=${pkgver}`, - `_subver=${_subver}`, - "options=('!debug' '!strip')", - "pkgrel=1", - "pkgdesc='The AI coding agent built for the terminal.'", - "url='https://github.com/SolaceHarmony/emberharmony'", - "arch=('aarch64' 'x86_64')", - "license=('MIT')", - "provides=('emberharmony')", - "conflicts=('emberharmony-bin')", - "depends=('ripgrep')", - "makedepends=('git' 'bun' 'go')", - "", - `source=("emberharmony-\${pkgver}.tar.gz::https://github.com/SolaceHarmony/emberharmony/archive/v\${pkgver}\${_subver}.tar.gz")`, - `sha256sums=('SKIP')`, - "", - "build() {", - ` cd "emberharmony-\${pkgver}"`, - ` bun install`, - " cd ./packages/emberharmony", - ` EMBERHARMONY_CHANNEL=latest EMBERHARMONY_VERSION=${pkgver} bun run ./script/build.ts --single`, - "}", - "", - "package() {", - ` cd "emberharmony-\${pkgver}/packages/emberharmony"`, - ' mkdir -p "${pkgdir}/usr/bin"', - ' target_arch="x64"', - ' case "$CARCH" in', - ' x86_64) target_arch="x64" ;;', - ' aarch64) target_arch="arm64" ;;', - ' *) printf "unsupported architecture: %s\\n" "$CARCH" >&2 ; return 1 ;;', - " esac", - ' libc=""', - " if command -v ldd >/dev/null 2>&1; then", - " if ldd --version 2>&1 | grep -qi musl; then", - ' libc="-musl"', - " fi", - " fi", - ' if [ -z "$libc" ] && ls /lib/ld-musl-* >/dev/null 2>&1; then', - ' libc="-musl"', - " fi", - ' base=""', - ' if [ "$target_arch" = "x64" ]; then', - " if ! grep -qi avx2 /proc/cpuinfo 2>/dev/null; then", - ' base="-baseline"', - " fi", - " fi", - ` bin="dist/emberharmony-linux-\${target_arch}\${base}\${libc}/bin/${cliName}"`, - ' if [ ! -f "$bin" ]; then', - ' printf "unable to find binary for %s%s%s\\n" "$target_arch" "$base" "$libc" >&2', - " return 1", - " fi", - ` install -Dm755 "$bin" "${pkgdir}/usr/bin/${cliName}"`, - "}", - "", - ].join("\n") - - for (const [pkg, pkgbuild] of [ - ["emberharmony-bin", binaryPkgbuild], - ["emberharmony", sourcePkgbuild], - ]) { - for (let i = 0; i < 30; i++) { - try { - await $`rm -rf ./dist/aur-${pkg}` - await $`git clone ssh://aur@aur.archlinux.org/${pkg}.git ./dist/aur-${pkg}` - await $`cd ./dist/aur-${pkg} && git checkout master` - await Bun.file(`./dist/aur-${pkg}/PKGBUILD`).write(pkgbuild) - await $`cd ./dist/aur-${pkg} && makepkg --printsrcinfo > .SRCINFO` - await $`cd ./dist/aur-${pkg} && git add PKGBUILD .SRCINFO` - await $`cd ./dist/aur-${pkg} && git commit -m "Update to v${Script.version}"` - await $`cd ./dist/aur-${pkg} && git push` - break - } catch (e) { - continue - } - } - } - */ - - // Tap updates disabled for now. -} diff --git a/packages/emberharmony/src/cli/cmd/github.ts b/packages/emberharmony/src/cli/cmd/github.ts index 1058d99..583ca38 100644 --- a/packages/emberharmony/src/cli/cmd/github.ts +++ b/packages/emberharmony/src/cli/cmd/github.ts @@ -1,5 +1,4 @@ import path from "path" -import { exec } from "child_process" import * as prompts from "@clack/prompts" import { map, pipe, sortBy, values } from "remeda" import { Octokit } from "@octokit/rest" @@ -131,7 +130,7 @@ type IssueQueryResponse = { } } -const AGENT_USERNAME = "emberharmony-agent[bot]" +const AGENT_USERNAME = "github-actions[bot]" const AGENT_REACTION = "eyes" const WORKFLOW_FILE = ".github/workflows/emberharmony.yml" @@ -199,7 +198,6 @@ export const GithubInstallCommand = cmd({ UI.empty() prompts.intro("Install GitHub agent") const app = await getAppInfo() - await installGitHubApp() const providers = await ModelsDev.get().then((p) => { // TODO: add guide for copilot, for now just hide it @@ -260,7 +258,7 @@ export const GithubInstallCommand = cmd({ async function promptProvider() { const priority: Record = { - "emberharmony": 0, + emberharmony: 0, anthropic: 1, openai: 2, google: 3, @@ -309,64 +307,14 @@ export const GithubInstallCommand = cmd({ return model } - async function installGitHubApp() { - const s = prompts.spinner() - s.start("Installing GitHub app") - - // Get installation - const installation = await getInstallation() - if (installation) return s.stop("GitHub app already installed") - - // Open browser - const url = "https://github.com/apps/emberharmony-agent" - const command = - process.platform === "darwin" - ? `open "${url}"` - : process.platform === "win32" - ? `start "" "${url}"` - : `xdg-open "${url}"` - - exec(command, (error) => { - if (error) { - prompts.log.warn(`Could not open browser. Please visit: ${url}`) - } - }) - - // Wait for installation - s.message("Waiting for GitHub app to be installed") - const MAX_RETRIES = 120 - let retries = 0 - do { - const installation = await getInstallation() - if (installation) break - - if (retries > MAX_RETRIES) { - s.stop( - `Failed to detect GitHub app installation. Make sure to install the app for the \`${app.owner}/${app.repo}\` repository.`, - ) - throw new UI.CancelledError() - } - - retries++ - await Bun.sleep(1000) - } while (true) - - s.stop("Installed GitHub app") - - async function getInstallation() { - return await fetch( - `https://api.solace.ofharmony.ai/get_github_app_installation?owner=${app.owner}&repo=${app.repo}`, - ) - .then((res) => res.json()) - .then((data) => data.installation) - } - } - async function addWorkflowFiles() { - const envStr = - provider === "amazon-bedrock" - ? "" - : `\n env:${providers[provider].env.map((e) => `\n ${e}: \${{ secrets.${e} }}`).join("")}` + const env = [ + "GITHUB_TOKEN: ${{ github.token }}", + ...(provider === "amazon-bedrock" + ? [] + : providers[provider].env.map((e) => `${e}: \${{ secrets.${e} }}`)), + ] + const envStr = `\n env:${env.map((e) => `\n ${e}`).join("")}` await Bun.write( path.join(app.root, WORKFLOW_FILE), @@ -387,10 +335,9 @@ jobs: startsWith(github.event.comment.body, '/emberharmony') runs-on: ubuntu-latest permissions: - id-token: write - contents: read - pull-requests: read - issues: read + contents: write + pull-requests: write + issues: write steps: - name: Checkout repository uses: actions/checkout@v6 @@ -415,18 +362,13 @@ export const GithubRunCommand = cmd({ command: "run", describe: "run the GitHub agent", builder: (yargs) => - yargs - .option("event", { - type: "string", - describe: "GitHub mock event to run the agent for", - }) - .option("token", { - type: "string", - describe: "GitHub personal access token (github_pat_********)", - }), + yargs.option("event", { + type: "string", + describe: "GitHub mock event to run the agent for", + }), async handler(args) { await bootstrap(process.cwd(), async () => { - const isMock = args.token || args.event + const isMock = !!args.event const context = isMock ? (JSON.parse(args.event!) as Context) : github.context if (!SUPPORTED_EVENTS.includes(context.eventName as (typeof SUPPORTED_EVENTS)[number])) { @@ -447,7 +389,6 @@ export const GithubRunCommand = cmd({ const { providerID, modelID } = normalizeModel() const runId = normalizeRunId() const share = normalizeShare() - const oidcBaseUrl = normalizeOidcBaseUrl() const { owner, repo } = context.repo // For repo events (schedule, workflow_dispatch), payload has no issue/comment data const payload = context.payload as @@ -469,7 +410,6 @@ export const GithubRunCommand = cmd({ const runUrl = `/${owner}/${repo}/actions/runs/${runId}` const shareBaseUrl = isMock ? "https://dev.solace.ofharmony.ai" : "https://solace.ofharmony.ai" - let appToken: string let octoRest: Octokit let octoGraph: typeof graphql let gitConfig: string @@ -480,35 +420,22 @@ export const GithubRunCommand = cmd({ const triggerCommentId = isCommentEvent ? (payload as IssueCommentEvent | PullRequestReviewCommentEvent).comment.id : undefined - const useGithubToken = normalizeUseGithubToken() const commentType = isCommentEvent ? context.eventName === "pull_request_review_comment" ? "pr_review" : "issue" : undefined + const auth = process.env["GITHUB_TOKEN"] + if (!auth) throw new Error("GITHUB_TOKEN environment variable is not set.") try { - if (useGithubToken) { - const githubToken = process.env["GITHUB_TOKEN"] - if (!githubToken) { - throw new Error( - "GITHUB_TOKEN environment variable is not set. When using use_github_token, you must provide GITHUB_TOKEN.", - ) - } - appToken = githubToken - } else { - const actionToken = isMock ? args.token! : await getOidcToken() - appToken = await exchangeForAppToken(actionToken) - } - octoRest = new Octokit({ auth: appToken }) + octoRest = new Octokit({ auth }) octoGraph = graphql.defaults({ - headers: { authorization: `token ${appToken}` }, + headers: { authorization: `token ${auth}` }, }) const { userPrompt, promptFiles } = await getUserPrompt() - if (!useGithubToken) { - await configureGit(appToken) - } + await configureGit(auth) // Skip permission check and reactions for repo events (no actor to check, no issue to react to) if (isUserEvent) { await assertPermissions() @@ -641,10 +568,7 @@ export const GithubRunCommand = cmd({ // Also output the clean error message for the action to capture //core.setOutput("prepare_error", e.message); } finally { - if (!useGithubToken) { - await restoreGitConfig() - await revokeAppToken() - } + await restoreGitConfig() } process.exit(exitCode) @@ -673,20 +597,6 @@ export const GithubRunCommand = cmd({ throw new Error(`Invalid share value: ${value}. Share must be a boolean.`) } - function normalizeUseGithubToken() { - const value = process.env["USE_GITHUB_TOKEN"] - if (!value) return false - if (value === "true") return true - if (value === "false") return false - throw new Error(`Invalid use_github_token value: ${value}. Must be a boolean.`) - } - - function normalizeOidcBaseUrl(): string { - const value = process.env["OIDC_BASE_URL"] - if (!value) return "https://api.solace.ofharmony.ai" - return value.replace(/\/+$/, "") - } - function isIssueCommentEvent( event: | IssueCommentEvent @@ -804,7 +714,7 @@ export const GithubRunCommand = cmd({ // Download image const res = await fetch(safeUrl, { headers: { - Authorization: `Bearer ${appToken}`, + Authorization: `Bearer ${auth}`, Accept: "application/vnd.github.v3+json", }, }) @@ -978,45 +888,7 @@ export const GithubRunCommand = cmd({ return summaryText } - async function getOidcToken() { - try { - return await core.getIDToken("emberharmony-github-action") - } catch (error) { - console.error("Failed to get OIDC token:", error instanceof Error ? error.message : error) - throw new Error( - "Could not fetch an OIDC token. Make sure to add `id-token: write` to your workflow permissions.", - ) - } - } - - async function exchangeForAppToken(token: string) { - const response = token.startsWith("github_pat_") - ? await fetch(`${oidcBaseUrl}/exchange_github_app_token_with_pat`, { - method: "POST", - headers: { - Authorization: `Bearer ${token}`, - }, - body: JSON.stringify({ owner, repo }), - }) - : await fetch(`${oidcBaseUrl}/exchange_github_app_token`, { - method: "POST", - headers: { - Authorization: `Bearer ${token}`, - }, - }) - - if (!response.ok) { - const responseJson = (await response.json()) as { error?: string } - throw new Error( - `App token exchange failed: ${response.status} ${response.statusText} - ${responseJson.error}`, - ) - } - - const responseJson = (await response.json()) as { token: string } - return responseJson.token - } - - async function configureGit(appToken: string) { + async function configureGit(auth: string) { // Do not change git config when running locally if (isMock) return @@ -1030,7 +902,7 @@ export const GithubRunCommand = cmd({ await $`git config --local --unset-all ${config}` } - const newCredentials = Buffer.from(`x-access-token:${appToken}`, "utf8").toString("base64") + const newCredentials = Buffer.from(`x-access-token:${auth}`, "utf8").toString("base64") await $`git config --local ${config} "AUTHORIZATION: basic ${newCredentials}"` await $`git config --global user.name "${AGENT_USERNAME}"` @@ -1548,19 +1420,6 @@ query($owner: String!, $repo: String!, $number: Int!) { "", ].join("\n") } - - async function revokeAppToken() { - if (!appToken) return - - await fetch("https://api.github.com/installation/token", { - method: "DELETE", - headers: { - Authorization: `Bearer ${appToken}`, - Accept: "application/vnd.github+json", - "X-GitHub-Api-Version": "2022-11-28", - }, - }) - } }) }, }) diff --git a/packages/emberharmony/src/cli/cmd/tui/component/tips.tsx b/packages/emberharmony/src/cli/cmd/tui/component/tips.tsx index c78b82c..fcd4212 100644 --- a/packages/emberharmony/src/cli/cmd/tui/component/tips.tsx +++ b/packages/emberharmony/src/cli/cmd/tui/component/tips.tsx @@ -142,7 +142,6 @@ const TIPS = [ "Press {highlight}Ctrl+X S{/highlight} or {highlight}/status{/highlight} to see system status info", "Enable {highlight}tui.scroll_acceleration{/highlight} for smooth macOS-style scrolling", "Toggle username display in chat via command palette ({highlight}Ctrl+P{/highlight})", - "Run {highlight}docker run -it --rm ghcr.io/sydneyrenee/emberharmony{/highlight} for containerized use", "Use {highlight}/connect{/highlight} with EmberHarmony Zen for curated, tested models", "Commit your project's {highlight}AGENTS.md{/highlight} file to Git for team sharing", "Use {highlight}/review{/highlight} to review uncommitted changes, branches, or PRs", diff --git a/packages/emberharmony/src/cli/cmd/uninstall.ts b/packages/emberharmony/src/cli/cmd/uninstall.ts index e8e3e0c..dcafef1 100644 --- a/packages/emberharmony/src/cli/cmd/uninstall.ts +++ b/packages/emberharmony/src/cli/cmd/uninstall.ts @@ -132,8 +132,6 @@ async function showRemovalSummary(targets: RemovalTargets, method: Installation. pnpm: "pnpm uninstall -g emberharmony", bun: "bun remove -g emberharmony", yarn: "yarn global remove emberharmony", - choco: "choco uninstall emberharmony", - scoop: "scoop uninstall emberharmony", } prompts.log.info(` ✓ Package: ${cmds[method] || method}`) } @@ -182,27 +180,15 @@ async function executeUninstall(method: Installation.Method, targets: RemovalTar pnpm: ["pnpm", "uninstall", "-g", "emberharmony"], bun: ["bun", "remove", "-g", "emberharmony"], yarn: ["yarn", "global", "remove", "emberharmony"], - choco: ["choco", "uninstall", "emberharmony"], - scoop: ["scoop", "uninstall", "emberharmony"], } const cmd = cmds[method] if (cmd) { spinner.start(`Running ${cmd.join(" ")}...`) - const result = - method === "choco" - ? await $`echo Y | choco uninstall emberharmony -y -r`.quiet().nothrow() - : await $`${cmd}`.quiet().nothrow() + const result = await $`${cmd}`.quiet().nothrow() if (result.exitCode !== 0) { spinner.stop(`Package manager uninstall failed: exit code ${result.exitCode}`, 1) - if ( - method === "choco" && - result.stdout.toString("utf8").includes("not running from an elevated command shell") - ) { - prompts.log.warn(`You may need to run '${cmd.join(" ")}' from an elevated command shell`) - } else { - prompts.log.warn(`You may need to run manually: ${cmd.join(" ")}`) - } + prompts.log.warn(`You may need to run manually: ${cmd.join(" ")}`) } else { spinner.stop("Package removed") } diff --git a/packages/emberharmony/src/cli/cmd/upgrade.ts b/packages/emberharmony/src/cli/cmd/upgrade.ts index 5d6961f..88cfa44 100644 --- a/packages/emberharmony/src/cli/cmd/upgrade.ts +++ b/packages/emberharmony/src/cli/cmd/upgrade.ts @@ -16,7 +16,7 @@ export const UpgradeCommand = { alias: "m", describe: "installation method to use", type: "string", - choices: ["curl", "npm", "pnpm", "bun", "choco", "scoop"], + choices: ["curl", "npm", "pnpm", "bun"], }) }, handler: async (args: { target?: string; method?: string }) => { @@ -56,14 +56,8 @@ export const UpgradeCommand = { const err = await Installation.upgrade(method, target).catch((err) => err) if (err) { spinner.stop("Upgrade failed", 1) - if (err instanceof Installation.UpgradeFailedError) { - // necessary because choco only allows install/upgrade in elevated terminals - if (method === "choco" && err.data.stderr.includes("not running from an elevated command shell")) { - prompts.log.error("Please run the terminal as Administrator and try again") - } else { - prompts.log.error(err.data.stderr) - } - } else if (err instanceof Error) prompts.log.error(err.message) + if (err instanceof Installation.UpgradeFailedError) prompts.log.error(err.data.stderr) + else if (err instanceof Error) prompts.log.error(err.message) prompts.outro("Done") return } diff --git a/packages/emberharmony/src/file/ignore.ts b/packages/emberharmony/src/file/ignore.ts index 7230f67..535aeb9 100644 --- a/packages/emberharmony/src/file/ignore.ts +++ b/packages/emberharmony/src/file/ignore.ts @@ -22,7 +22,6 @@ export namespace FileIgnore { ".turbo", ".output", "desktop", - ".sst", ".cache", ".webkit-cache", "__pycache__", diff --git a/packages/emberharmony/src/installation/index.ts b/packages/emberharmony/src/installation/index.ts index 9fe816e..a1fdd32 100644 --- a/packages/emberharmony/src/installation/index.ts +++ b/packages/emberharmony/src/installation/index.ts @@ -81,14 +81,6 @@ export namespace Installation { name: "bun" as const, command: () => $`bun pm ls -g`.throws(false).quiet().text(), }, - { - name: "scoop" as const, - command: () => $`scoop list emberharmony`.throws(false).quiet().text(), - }, - { - name: "choco" as const, - command: () => $`choco list --limit-output emberharmony`.throws(false).quiet().text(), - }, ] checks.sort((a, b) => { @@ -136,20 +128,13 @@ export namespace Installation { case "bun": cmd = $`bun install -g ${npmName}@${target}` break - case "choco": - cmd = $`echo Y | choco upgrade emberharmony --version=${target}` - break - case "scoop": - cmd = $`scoop install emberharmony@${target}` - break default: throw new Error(`Unknown method: ${method}`) } const result = await cmd.quiet().throws(false) if (result.exitCode !== 0) { - const stderr = method === "choco" ? "not running from an elevated command shell" : result.stderr.toString("utf8") throw new UpgradeFailedError({ - stderr: stderr, + stderr: result.stderr.toString("utf8"), }) } log.info("upgraded", { @@ -184,29 +169,6 @@ export namespace Installation { .then((data: any) => data.version) } - if (detectedMethod === "choco") { - return fetch( - "https://community.chocolatey.org/api/v2/Packages?$filter=Id%20eq%20%27emberharmony%27%20and%20IsLatestVersion&$select=Version", - { headers: { Accept: "application/json;odata=verbose" } }, - ) - .then((res) => { - if (!res.ok) throw new Error(res.statusText) - return res.json() - }) - .then((data: any) => data.d.results[0].Version) - } - - if (detectedMethod === "scoop") { - return fetch("https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/emberharmony.json", { - headers: { Accept: "application/json" }, - }) - .then((res) => { - if (!res.ok) throw new Error(res.statusText) - return res.json() - }) - .then((data: any) => data.version) - } - return fetch("https://api.github.com/repos/SolaceHarmony/emberharmony/releases/latest") .then((res) => { if (!res.ok) throw new Error(res.statusText) diff --git a/packages/emberharmony/src/permission/arity.ts b/packages/emberharmony/src/permission/arity.ts index ae2cf23..f8a0ae5 100644 --- a/packages/emberharmony/src/permission/arity.ts +++ b/packages/emberharmony/src/permission/arity.ts @@ -141,7 +141,6 @@ This dictionary is used to identify the "human-understandable command" from an i sfdx: 3, // sfdx force:org:list skaffold: 2, // skaffold dev sls: 2, // sls deploy - sst: 2, // sst deploy swift: 2, // swift build systemctl: 2, // systemctl restart nginx terraform: 2, // terraform apply diff --git a/packages/emberharmony/sst-env.d.ts b/packages/emberharmony/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/emberharmony/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/emberharmony/test/cli/github-remote.test.ts b/packages/emberharmony/test/cli/github-remote.test.ts index ea12ff8..c5a1a4e 100644 --- a/packages/emberharmony/test/cli/github-remote.test.ts +++ b/packages/emberharmony/test/cli/github-remote.test.ts @@ -2,27 +2,45 @@ import { test, expect } from "bun:test" import { parseGitHubRemote } from "../../src/cli/cmd/github" test("parses https URL with .git suffix", () => { - expect(parseGitHubRemote("https://github.com/sst/emberharmony.git")).toEqual({ owner: "sst", repo: "emberharmony" }) + expect(parseGitHubRemote("https://github.com/SolaceHarmony/emberharmony.git")).toEqual({ + owner: "SolaceHarmony", + repo: "emberharmony", + }) }) test("parses https URL without .git suffix", () => { - expect(parseGitHubRemote("https://github.com/sst/emberharmony")).toEqual({ owner: "sst", repo: "emberharmony" }) + expect(parseGitHubRemote("https://github.com/SolaceHarmony/emberharmony")).toEqual({ + owner: "SolaceHarmony", + repo: "emberharmony", + }) }) test("parses git@ URL with .git suffix", () => { - expect(parseGitHubRemote("git@github.com:sst/emberharmony.git")).toEqual({ owner: "sst", repo: "emberharmony" }) + expect(parseGitHubRemote("git@github.com:SolaceHarmony/emberharmony.git")).toEqual({ + owner: "SolaceHarmony", + repo: "emberharmony", + }) }) test("parses git@ URL without .git suffix", () => { - expect(parseGitHubRemote("git@github.com:sst/emberharmony")).toEqual({ owner: "sst", repo: "emberharmony" }) + expect(parseGitHubRemote("git@github.com:SolaceHarmony/emberharmony")).toEqual({ + owner: "SolaceHarmony", + repo: "emberharmony", + }) }) test("parses ssh:// URL with .git suffix", () => { - expect(parseGitHubRemote("ssh://git@github.com/sst/emberharmony.git")).toEqual({ owner: "sst", repo: "emberharmony" }) + expect(parseGitHubRemote("ssh://git@github.com/SolaceHarmony/emberharmony.git")).toEqual({ + owner: "SolaceHarmony", + repo: "emberharmony", + }) }) test("parses ssh:// URL without .git suffix", () => { - expect(parseGitHubRemote("ssh://git@github.com/sst/emberharmony")).toEqual({ owner: "sst", repo: "emberharmony" }) + expect(parseGitHubRemote("ssh://git@github.com/SolaceHarmony/emberharmony")).toEqual({ + owner: "SolaceHarmony", + repo: "emberharmony", + }) }) test("parses http URL", () => { diff --git a/packages/enterprise/package.json b/packages/enterprise/package.json index ac37686..874ef86 100644 --- a/packages/enterprise/package.json +++ b/packages/enterprise/package.json @@ -9,8 +9,7 @@ "dev": "vite dev", "build": "vite build", "build:cloudflare": "EMBERHARMONY_DEPLOYMENT_TARGET=cloudflare vite build", - "start": "vite start", - "shell-prod": "sst shell --target Teams --stage production" + "start": "vite start" }, "dependencies": { "@thesolaceproject/emberharmony-util": "workspace:*", diff --git a/packages/enterprise/src/routes/share/[shareID].tsx b/packages/enterprise/src/routes/share/[shareID].tsx index f73c159..f78c41c 100644 --- a/packages/enterprise/src/routes/share/[shareID].tsx +++ b/packages/enterprise/src/routes/share/[shareID].tsx @@ -218,7 +218,7 @@ export default function () { modelParam = "unknown" } const version = `v${info().version}` - return `https://social-cards.sst.dev/emberharmony-share/${encodedTitle}.png?model=${modelParam}&version=${version}&id=${data().shareID}` + return `https://solace.ofharmony.ai/social-cards/emberharmony-share/${encodedTitle}.png?model=${modelParam}&version=${version}&id=${data().shareID}` }) return ( diff --git a/packages/enterprise/sst-env.d.ts b/packages/enterprise/sst-env.d.ts deleted file mode 100644 index 0769c76..0000000 --- a/packages/enterprise/sst-env.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -import "sst" -declare module "sst" { - export interface Resource { - "ADMIN_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "AUTH_API_URL": { - "type": "sst.sst.Linkable" - "value": string - } - "AWS_SES_ACCESS_KEY_ID": { - "type": "sst.sst.Secret" - "value": string - } - "AWS_SES_SECRET_ACCESS_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_API_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_DEFAULT_ACCOUNT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Console": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "DISCORD_SUPPORT_BOT_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "DISCORD_SUPPORT_CHANNEL_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Database": { - "database": string - "host": string - "password": string - "port": number - "type": "sst.sst.Linkable" - "username": string - } - "EMAILOCTOPUS_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_PRIVATE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_ID_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_SECRET_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GOOGLE_CLIENT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "HONEYCOMB_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "R2AccessKey": { - "type": "sst.sst.Secret" - "value": string - } - "R2SecretKey": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_PUBLISHABLE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_SECRET_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_WEBHOOK_SECRET": { - "type": "sst.sst.Linkable" - "value": string - } - "Teams": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "Web": { - "type": "sst.cloudflare.Astro" - "url": string - } - "WebApp": { - "type": "sst.cloudflare.StaticSite" - "url": string - } - "ZEN_BLACK_LIMITS": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_BLACK_PRICE": { - "plan100": string - "plan20": string - "plan200": string - "product": string - "type": "sst.sst.Linkable" - } - "ZEN_MODELS1": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS10": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS2": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS3": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS4": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS5": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS6": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS7": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS8": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS9": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_SESSION_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - } -} -// cloudflare -import * as cloudflare from "@cloudflare/workers-types"; -declare module "sst" { - export interface Resource { - "Api": cloudflare.Service - "AuthApi": cloudflare.Service - "AuthStorage": cloudflare.KVNamespace - "Bucket": cloudflare.R2Bucket - "EnterpriseStorage": cloudflare.R2Bucket - "GatewayKv": cloudflare.KVNamespace - "LogProcessor": cloudflare.Service - "ZenData": cloudflare.R2Bucket - "ZenDataNew": cloudflare.R2Bucket - } -} - -import "sst" -export {} \ No newline at end of file diff --git a/packages/function/package.json b/packages/function/package.json index 79ae85b..a1fb592 100644 --- a/packages/function/package.json +++ b/packages/function/package.json @@ -12,9 +12,6 @@ "typescript": "catalog:" }, "dependencies": { - "@octokit/auth-app": "8.0.1", - "@octokit/rest": "catalog:", - "hono": "catalog:", - "jose": "6.0.11" + "hono": "catalog:" } } diff --git a/packages/function/src/api.ts b/packages/function/src/api.ts index aa097b2..55398b9 100644 --- a/packages/function/src/api.ts +++ b/packages/function/src/api.ts @@ -1,10 +1,6 @@ import { Hono } from "hono" import { DurableObject } from "cloudflare:workers" import { randomUUID } from "node:crypto" -import { jwtVerify, createRemoteJWKSet } from "jose" -import { createAppAuth } from "@octokit/auth-app" -import { Octokit } from "@octokit/rest" -import { Resource } from "sst" type Env = { SYNC_SERVER: DurableObjectNamespace @@ -12,20 +8,6 @@ type Env = { WEB_DOMAIN: string } -async function getFeishuTenantToken(): Promise { - const response = await fetch("https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - app_id: Resource.FEISHU_APP_ID.value, - app_secret: Resource.FEISHU_APP_SECRET.value, - }), - }) - const data = (await response.json()) as { tenant_access_token?: string } - if (!data.tenant_access_token) throw new Error("Failed to get Feishu tenant token") - return data.tenant_access_token -} - export class SyncServer extends DurableObject { constructor(ctx: DurableObjectState, env: Env) { super(ctx, env) @@ -150,16 +132,6 @@ export default new Hono<{ Bindings: Env }>() await stub.clear() return c.json({}) }) - .post("/share_delete_admin", async (c) => { - const body = await c.req.json<{ sessionShortName: string; adminSecret: string }>() - const sessionShortName = body.sessionShortName - const adminSecret = body.adminSecret - if (adminSecret !== Resource.ADMIN_SECRET.value) throw new Error("Invalid admin secret") - const id = c.env.SYNC_SERVER.idFromName(sessionShortName) - const stub = c.env.SYNC_SERVER.get(id) - await stub.clear() - return c.json({}) - }) .post("/share_sync", async (c) => { const body = await c.req.json<{ sessionID: string @@ -214,188 +186,4 @@ export default new Hono<{ Bindings: Env }>() return c.json({ info, messages }) }) - .post("/feishu", async (c) => { - const body = (await c.req.json()) as { - challenge?: string - event?: { - message?: { - message_id?: string - root_id?: string - parent_id?: string - chat_id?: string - content?: string - } - } - } - console.log(JSON.stringify(body, null, 2)) - const challenge = body.challenge - if (challenge) return c.json({ challenge }) - - const content = body.event?.message?.content - const parsed = - typeof content === "string" && content.trim().startsWith("{") - ? (JSON.parse(content) as { - text?: string - }) - : undefined - const text = typeof parsed?.text === "string" ? parsed.text : typeof content === "string" ? content : "" - - let message = text.trim().replace(/^@_user_\d+\s*/, "") - message = message.replace(/^aiden,?\s*/i, "<@759257817772851260> ") - if (!message) return c.json({ ok: true }) - - const threadId = body.event?.message?.root_id || body.event?.message?.message_id - if (threadId) message = `${message} [${threadId}]` - - const response = await fetch( - `https://discord.com/api/v10/channels/${Resource.DISCORD_SUPPORT_CHANNEL_ID.value}/messages`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Authorization: `Bot ${Resource.DISCORD_SUPPORT_BOT_TOKEN.value}`, - }, - body: JSON.stringify({ - content: `${message}`, - }), - }, - ) - - if (!response.ok) { - console.error(await response.text()) - return c.json({ error: "Discord bot message failed" }, { status: 502 }) - } - - return c.json({ ok: true }) - }) - /** - * Used by the GitHub action to get GitHub installation access token given the OIDC token - */ - .post("/exchange_github_app_token", async (c) => { - const EXPECTED_AUDIENCE = "emberharmony-github-action" - const GITHUB_ISSUER = "https://token.actions.githubusercontent.com" - const JWKS_URL = `${GITHUB_ISSUER}/.well-known/jwks` - - // get Authorization header - const token = c.req.header("Authorization")?.replace(/^Bearer /, "") - if (!token) return c.json({ error: "Authorization header is required" }, { status: 401 }) - - // verify token - const JWKS = createRemoteJWKSet(new URL(JWKS_URL)) - let owner, repo - try { - const { payload } = await jwtVerify(token, JWKS, { - issuer: GITHUB_ISSUER, - audience: EXPECTED_AUDIENCE, - }) - const sub = payload.sub // e.g. 'repo:my-org/my-repo:ref:refs/heads/main' - const parts = sub.split(":")[1].split("/") - owner = parts[0] - repo = parts[1] - } catch (err) { - console.error("Token verification failed:", err) - return c.json({ error: "Invalid or expired token" }, { status: 403 }) - } - - // Create app JWT token - const auth = createAppAuth({ - appId: Resource.GITHUB_APP_ID.value, - privateKey: Resource.GITHUB_APP_PRIVATE_KEY.value, - }) - const appAuth = await auth({ type: "app" }) - - // Lookup installation - const octokit = new Octokit({ auth: appAuth.token }) - const { data: installation } = await octokit.apps.getRepoInstallation({ - owner, - repo, - }) - - // Get installation token - const installationAuth = await auth({ - type: "installation", - installationId: installation.id, - }) - - return c.json({ token: installationAuth.token }) - }) - /** - * Used by the GitHub action to get GitHub installation access token given user PAT token (used when testing `emberharmony github run` locally) - */ - .post("/exchange_github_app_token_with_pat", async (c) => { - const body = await c.req.json<{ owner: string; repo: string }>() - const owner = body.owner - const repo = body.repo - - try { - // get Authorization header - const authHeader = c.req.header("Authorization") - const token = authHeader?.replace(/^Bearer /, "") - if (!token) throw new Error("Authorization header is required") - - // Verify permissions - const userClient = new Octokit({ auth: token }) - const { data: repoData } = await userClient.repos.get({ owner, repo }) - if (!repoData.permissions.admin && !repoData.permissions.push && !repoData.permissions.maintain) - throw new Error("User does not have write permissions") - - // Get installation token - const auth = createAppAuth({ - appId: Resource.GITHUB_APP_ID.value, - privateKey: Resource.GITHUB_APP_PRIVATE_KEY.value, - }) - const appAuth = await auth({ type: "app" }) - - // Lookup installation - const appClient = new Octokit({ auth: appAuth.token }) - const { data: installation } = await appClient.apps.getRepoInstallation({ - owner, - repo, - }) - - // Get installation token - const installationAuth = await auth({ - type: "installation", - installationId: installation.id, - }) - - return c.json({ token: installationAuth.token }) - } catch (e: any) { - let error = e - if (e instanceof Error) { - error = e.message - } - - return c.json({ error }, { status: 401 }) - } - }) - /** - * Used by the EmberHarmony CLI to check if the GitHub app is installed - */ - .get("/get_github_app_installation", async (c) => { - const owner = c.req.query("owner") - const repo = c.req.query("repo") - - const auth = createAppAuth({ - appId: Resource.GITHUB_APP_ID.value, - privateKey: Resource.GITHUB_APP_PRIVATE_KEY.value, - }) - const appAuth = await auth({ type: "app" }) - - // Lookup installation - const octokit = new Octokit({ auth: appAuth.token }) - let installation - try { - const ret = await octokit.apps.getRepoInstallation({ owner, repo }) - installation = ret.data - } catch (err) { - if (err instanceof Error && err.message.includes("Not Found")) { - // not installed - } else { - throw err - } - } - - return c.json({ installation }) - }) .all("*", (c) => c.text("Not Found")) diff --git a/packages/function/sst-env.d.ts b/packages/function/sst-env.d.ts deleted file mode 100644 index 0769c76..0000000 --- a/packages/function/sst-env.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -import "sst" -declare module "sst" { - export interface Resource { - "ADMIN_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "AUTH_API_URL": { - "type": "sst.sst.Linkable" - "value": string - } - "AWS_SES_ACCESS_KEY_ID": { - "type": "sst.sst.Secret" - "value": string - } - "AWS_SES_SECRET_ACCESS_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_API_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "CLOUDFLARE_DEFAULT_ACCOUNT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Console": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "DISCORD_SUPPORT_BOT_TOKEN": { - "type": "sst.sst.Secret" - "value": string - } - "DISCORD_SUPPORT_CHANNEL_ID": { - "type": "sst.sst.Secret" - "value": string - } - "Database": { - "database": string - "host": string - "password": string - "port": number - "type": "sst.sst.Linkable" - "username": string - } - "EMAILOCTOPUS_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "FEISHU_APP_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_ID": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_APP_PRIVATE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_ID_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GITHUB_CLIENT_SECRET_CONSOLE": { - "type": "sst.sst.Secret" - "value": string - } - "GOOGLE_CLIENT_ID": { - "type": "sst.sst.Secret" - "value": string - } - "HONEYCOMB_API_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "R2AccessKey": { - "type": "sst.sst.Secret" - "value": string - } - "R2SecretKey": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_PUBLISHABLE_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_SECRET_KEY": { - "type": "sst.sst.Secret" - "value": string - } - "STRIPE_WEBHOOK_SECRET": { - "type": "sst.sst.Linkable" - "value": string - } - "Teams": { - "type": "sst.cloudflare.SolidStart" - "url": string - } - "Web": { - "type": "sst.cloudflare.Astro" - "url": string - } - "WebApp": { - "type": "sst.cloudflare.StaticSite" - "url": string - } - "ZEN_BLACK_LIMITS": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_BLACK_PRICE": { - "plan100": string - "plan20": string - "plan200": string - "product": string - "type": "sst.sst.Linkable" - } - "ZEN_MODELS1": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS10": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS2": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS3": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS4": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS5": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS6": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS7": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS8": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_MODELS9": { - "type": "sst.sst.Secret" - "value": string - } - "ZEN_SESSION_SECRET": { - "type": "sst.sst.Secret" - "value": string - } - } -} -// cloudflare -import * as cloudflare from "@cloudflare/workers-types"; -declare module "sst" { - export interface Resource { - "Api": cloudflare.Service - "AuthApi": cloudflare.Service - "AuthStorage": cloudflare.KVNamespace - "Bucket": cloudflare.R2Bucket - "EnterpriseStorage": cloudflare.R2Bucket - "GatewayKv": cloudflare.KVNamespace - "LogProcessor": cloudflare.Service - "ZenData": cloudflare.R2Bucket - "ZenDataNew": cloudflare.R2Bucket - } -} - -import "sst" -export {} \ No newline at end of file diff --git a/packages/plugin/sst-env.d.ts b/packages/plugin/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/plugin/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/script/sst-env.d.ts b/packages/script/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/script/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/sdk/js/sst-env.d.ts b/packages/sdk/js/sst-env.d.ts deleted file mode 100644 index 9b9de73..0000000 --- a/packages/sdk/js/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/slack/sst-env.d.ts b/packages/slack/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/slack/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/ui/sst-env.d.ts b/packages/ui/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/ui/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/util/sst-env.d.ts b/packages/util/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/util/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/web/config.mjs b/packages/web/config.mjs index 590c6ad..5873bb4 100644 --- a/packages/web/config.mjs +++ b/packages/web/config.mjs @@ -1,10 +1,10 @@ -const stage = process.env.SST_STAGE || "dev" +const stage = process.env.APP_STAGE || process.env.STAGE || "dev" export default { url: stage === "production" ? "https://solace.ofharmony.ai" : `https://${stage}.solace.ofharmony.ai`, console: stage === "production" ? "https://solace.ofharmony.ai/auth" : `https://${stage}.solace.ofharmony.ai/auth`, email: "sydney@solace.ofharmony.ai", - socialCard: "https://social-cards.sst.dev", + socialCard: "https://solace.ofharmony.ai/social-cards", github: "https://github.com/sydneyrenee/emberharmony", discord: "https://discord.gg/EdF8f7JR", headerLinks: [ diff --git a/packages/web/src/content/docs/cli.mdx b/packages/web/src/content/docs/cli.mdx index 111935a..6c2b10e 100644 --- a/packages/web/src/content/docs/cli.mdx +++ b/packages/web/src/content/docs/cli.mdx @@ -189,7 +189,6 @@ emberharmony github run | Flag | Description | | --------- | -------------------------------------- | | `--event` | GitHub mock event to run the agent for | -| `--token` | GitHub personal access token | --- @@ -551,8 +550,8 @@ The emberharmony CLI takes the following global flags. EmberHarmony can be configured using environment variables. -| Variable | Type | Description | -| ------------------------------------- | ------- | ----------------------------------------------------- | +| Variable | Type | Description | +| ----------------------------------------- | ------- | ----------------------------------------------------- | | `EMBERHARMONY_AUTO_SHARE` | boolean | Automatically share sessions | | `EMBERHARMONY_GIT_BASH_PATH` | string | Path to Git Bash executable on Windows | | `EMBERHARMONY_CONFIG` | string | Path to config file | @@ -580,8 +579,8 @@ EmberHarmony can be configured using environment variables. These environment variables enable experimental features that may change or be removed. -| Variable | Type | Description | -| ----------------------------------------------- | ------- | --------------------------------------- | +| Variable | Type | Description | +| --------------------------------------------------- | ------- | --------------------------------------- | | `EMBERHARMONY_EXPERIMENTAL` | boolean | Enable all experimental features | | `EMBERHARMONY_EXPERIMENTAL_ICON_DISCOVERY` | boolean | Enable icon discovery | | `EMBERHARMONY_EXPERIMENTAL_DISABLE_COPY_ON_SELECT` | boolean | Disable copy on select in TUI | diff --git a/packages/web/src/content/docs/github.mdx b/packages/web/src/content/docs/github.mdx index 39c2570..95ef45b 100644 --- a/packages/web/src/content/docs/github.mdx +++ b/packages/web/src/content/docs/github.mdx @@ -23,7 +23,7 @@ Run the following command in a project that is in a GitHub repo: emberharmony github install ``` -This will walk you through installing the GitHub app, creating the workflow, and setting up secrets. +This will walk you through creating the workflow and setting up secrets. --- @@ -31,15 +31,11 @@ This will walk you through installing the GitHub app, creating the workflow, and Or you can set it up manually. -1. **Install the GitHub app** - - Head over to [**github.com/apps/emberharmony-agent**](https://github.com/apps/emberharmony-agent). Make sure it's installed on the target repository. - -2. **Add the workflow** +1. **Add the workflow** Add the following workflow file to `.github/workflows/emberharmony.yml` in your repo. Make sure to set the appropriate `model` and required API keys in `env`. - ```yml title=".github/workflows/emberharmony.yml" {24,26} + ```yml title=".github/workflows/emberharmony.yml" {24,27} name: emberharmony on: @@ -55,25 +51,27 @@ Or you can set it up manually. contains(github.event.comment.body, '/emberharmony') runs-on: ubuntu-latest permissions: - id-token: write + contents: write + pull-requests: write + issues: write steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - fetch-depth: 1 - persist-credentials: false + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 1 + persist-credentials: false - - name: Run EmberHarmony + - name: Run EmberHarmony uses: sydneyrenee/emberharmony/github@latest env: + GITHUB_TOKEN: ${{ github.token }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} with: model: anthropic/claude-sonnet-4-20250514 # share: true - # github_token: xxxx ``` -3. **Store the API keys in secrets** +2. **Store the API keys in secrets** In your organization or project **settings**, expand **Secrets and variables** on the left and select **Actions**. And add the required API keys. @@ -85,19 +83,15 @@ Or you can set it up manually. - `agent`: The agent to use. Must be a primary agent. Falls back to `default_agent` from config or `"build"` if not found. - `share`: Whether to share the EmberHarmony session. Defaults to **true** for public repositories. - `prompt`: Optional custom prompt to override the default behavior. Use this to customize how EmberHarmony processes requests. -- `token`: Optional GitHub access token for performing operations such as creating comments, committing changes, and opening pull requests. By default, EmberHarmony uses the installation access token from the EmberHarmony GitHub App, so commits, comments, and pull requests appear as coming from the app. - Alternatively, you can use the GitHub Action runner's [built-in `GITHUB_TOKEN`](https://docs.github.com/en/actions/tutorials/authenticate-with-github_token) without installing the EmberHarmony GitHub App. Just make sure to grant the required permissions in your workflow: - - ```yaml - permissions: - id-token: write - contents: write - pull-requests: write - issues: write - ``` +EmberHarmony uses the GitHub Actions runner's built-in `GITHUB_TOKEN`. Do not configure external GitHub credentials for the action. Make sure to grant the required permissions in your workflow: - You can also use a [personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)(PAT) if preferred. +```yaml +permissions: + contents: write + pull-requests: write + issues: write +``` --- @@ -105,8 +99,8 @@ Or you can set it up manually. EmberHarmony can be triggered by the following GitHub events: -| Event Type | Triggered By | Details | -| ----------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | +| Event Type | Triggered By | Details | +| ----------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | `issue_comment` | Comment on an issue or PR | Mention `/emberharmony` or `/oc` in your comment. EmberHarmony reads context and can create branches, open PRs, or reply. | | `pull_request_review_comment` | Comment on specific code lines in a PR | Mention `/emberharmony` or `/oc` while reviewing code. EmberHarmony receives file path, line numbers, and diff context. | | `issues` | Issue opened or edited | Automatically trigger EmberHarmony when issues are created or modified. Requires `prompt` input. | @@ -129,7 +123,6 @@ jobs: emberharmony: runs-on: ubuntu-latest permissions: - id-token: write contents: write pull-requests: write issues: write @@ -142,6 +135,7 @@ jobs: - name: Run EmberHarmony uses: sydneyrenee/emberharmony/github@latest env: + GITHUB_TOKEN: ${{ github.token }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} with: model: anthropic/claude-sonnet-4-20250514 @@ -169,21 +163,19 @@ jobs: review: runs-on: ubuntu-latest permissions: - id-token: write - contents: read - pull-requests: read - issues: read + contents: write + pull-requests: write + issues: write steps: - uses: actions/checkout@v6 with: persist-credentials: false - uses: sydneyrenee/emberharmony/github@latest env: + GITHUB_TOKEN: ${{ github.token }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: model: anthropic/claude-sonnet-4-20250514 - use_github_token: true prompt: | Review this pull request: - Check for code quality issues @@ -210,7 +202,6 @@ jobs: triage: runs-on: ubuntu-latest permissions: - id-token: write contents: write pull-requests: write issues: write @@ -236,6 +227,7 @@ jobs: - uses: sydneyrenee/emberharmony/github@latest if: steps.check.outputs.result == 'true' env: + GITHUB_TOKEN: ${{ github.token }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} with: model: anthropic/claude-sonnet-4-20250514 diff --git a/packages/web/src/content/docs/index.mdx b/packages/web/src/content/docs/index.mdx index 04cdf27..1f209a3 100644 --- a/packages/web/src/content/docs/index.mdx +++ b/packages/web/src/content/docs/index.mdx @@ -73,44 +73,14 @@ You can also install it with the following commands:
-- **Using Paru on Arch Linux** - - ```bash - paru -S emberharmony-bin - ``` - #### Windows -- **Using Chocolatey** - - ```bash - choco install emberharmony - ``` - -- **Using Scoop** - - ```bash - scoop install emberharmony - ``` - - **Using NPM** ```bash npm install -g emberharmony ``` -- **Using Mise** - - ```bash - mise use -g emberharmony - ``` - -- **Using Docker** - - ```bash - docker run -it --rm ghcr.io/sydneyrenee/emberharmony - ``` - Support for installing EmberHarmony on Windows using Bun is currently in progress. You can also grab the binary from the [Releases](https://github.com/sydneyrenee/emberharmony/releases). diff --git a/packages/web/src/content/docs/mcp-servers.mdx b/packages/web/src/content/docs/mcp-servers.mdx index 6b623b9..103a5ce 100644 --- a/packages/web/src/content/docs/mcp-servers.mdx +++ b/packages/web/src/content/docs/mcp-servers.mdx @@ -501,7 +501,7 @@ Add the [Grep by Vercel](https://grep.app) MCP server to search through code sni Since we named our MCP server `gh_grep`, you can add `use the gh_grep tool` to your prompts to get the agent to use it. ```txt "use the gh_grep tool" -What's the right way to set a custom domain in an SST Astro component? use the gh_grep tool +What's the right way to set a custom domain in an Astro component? use the gh_grep tool ``` Alternatively, you can add something like this to your [AGENTS.md](/docs/rules/). diff --git a/packages/web/src/content/docs/rules.mdx b/packages/web/src/content/docs/rules.mdx index 171bcd5..9f5f88a 100644 --- a/packages/web/src/content/docs/rules.mdx +++ b/packages/web/src/content/docs/rules.mdx @@ -26,15 +26,15 @@ If you have an existing `AGENTS.md` file, this will try to add to it. You can also just create this file manually. Here's an example of some things you can put into an `AGENTS.md` file. ```markdown title="AGENTS.md" -# SST v3 Monorepo Project +# TypeScript Monorepo Project -This is an SST v3 monorepo with TypeScript. The project uses bun workspaces for package management. +This is a TypeScript monorepo that uses bun workspaces for package management. ## Project Structure - `packages/` - Contains all workspace packages (functions, core, web, etc.) -- `infra/` - Infrastructure definitions split by service (storage.ts, api.ts, web.ts) -- `sst.config.ts` - Main SST configuration with dynamic imports +- `infra/` - Infrastructure definitions split by service +- `packages/app/` - Application entrypoints and routes ## Code Standards diff --git a/packages/web/sst-env.d.ts b/packages/web/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/packages/web/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/sdks/vscode/sst-env.d.ts b/sdks/vscode/sst-env.d.ts deleted file mode 100644 index b6a7e90..0000000 --- a/sdks/vscode/sst-env.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ - -/// - -import "sst" -export {} \ No newline at end of file