• English
  • Desktop application

    Soma Desktop packages the existing Web workspace with its Rust server. Electron owns the window, application menu, server lifetime, and update checks. Agent execution and provider configuration stay in the Rust runtime.

    Development

    Install the workspace dependencies, then start the desktop app:

    pnpm install --frozen-lockfile
    pnpm dev:desktop

    For an offline workspace in a chosen directory, pass server options after --:

    pnpm dev:desktop -- --provider echo --cwd /absolute/project/path

    The default working directory is the user's home; other projects can be opened from the sidebar. The desktop host chooses its own available loopback port. It closes the server's stdin before quitting. The soma web --exit-on-stdin-close option also lets the server clean up if the desktop process crashes.

    Development builds disable production update requests. After rebuilding, use pnpm --filter soma-desktop start -- --provider echo to launch without another build. SOMA_DESKTOP_USER_DATA selects a separate Electron profile in development.

    Update behavior

    Installed apps check at startup and every six hours. Open Settings → Soma Desktop or the application's Check for Updates… menu item for a manual check. Concurrent checks share one request. Checking never downloads a package.

    Download update explicitly starts the transfer and displays progress. Install and restart… asks for confirmation before stopping the runtime. Downloads are verified by electron-updater; failed checks or downloads show an error and can be retried. Updates never downgrade or select prereleases. Quitting normally does not install a downloaded update.

    Conversations and provider settings are saved under SOMA_HOME. Restarting, including for an update, stops running tasks and retains conversation history. Continue an interrupted conversation with a new prompt; see Sessions. Desktop language and theme preferences are saved in Electron's application profile, so they survive a new server port on the next launch.

    Like dsh Desktop, updates use electron-updater's generic HTTPS provider. Set SOMA_DESKTOP_UPDATE_BASE_URL when packaging. The builder appends a target directory such as mac-arm64/, mac-x64/, win-x64/, or linux-x64/, and embeds that URL in the app. The origin can be backed by COS, R2, S3, or ordinary static hosting. Clients need read access to the HTTPS files and no publishing credentials. An app built without a feed explicitly disables update checks. Packaged apps ignore runtime feed overrides; changing the environment after installation does not redirect their updater.

    Packaging and releases

    pnpm package:desktop
    pnpm package:desktop -- --dir

    For an update-enabled build, set the actual deployment address before packaging:

    SOMA_DESKTOP_UPDATE_BASE_URL=https://downloads.example.com/soma pnpm package:desktop

    The example domain is a placeholder; no Soma update hosting is provisioned by this repository. Use separate base URLs for test and production installations.

    These commands build a release-mode Rust executable for the host architecture and bundle it with the Web assets. Output is in packages/desktop/release/. Build on each target OS: macOS produces DMG and ZIP, Windows produces an NSIS installer, and Linux produces an AppImage. The app does not require Node.js, pnpm, or Rust on the end user's machine. Linux updates require launching the AppImage; an unpacked directory does not support installation.

    The Release workflow in .github/workflows/release.yml builds each host platform on a v* tag or manual dispatch and saves downloadable Actions artifacts. Regular CI runs desktop checks without packaging installers. For a tag, packages/desktop/package.json and the workspace Cargo version must both match it. Configure the repository variable SOMA_DESKTOP_UPDATE_BASE_URL for the deployment. Tag builds require it; manual builds without it disable updates. The workflow does not upload artifacts to a public service. Desktop e2e and packaged-app smoke tests are temporarily disabled in CI and Release. Set DESKTOP_TESTS_ENABLED to "true" in both workflows to restore them. Downloads include SHA256SUMS. Each platform saves one soma-desktop-<OS> artifact containing its installers, update files, configured update manifests, and checksums. On macOS, use the DMG for manual installation; the updater uses the ZIP. The update manifest references only the ZIP.

    For signed macOS releases, configure MAC_CSC_LINK, MAC_CSC_KEY_PASSWORD, APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD, and APPLE_TEAM_ID repository secrets. macOS update installation requires a signed app; tag builds fail without these credentials. Windows signing uses WIN_CSC_LINK and WIN_CSC_KEY_PASSWORD. Local unsigned packages are suitable for development, not qualification of macOS update installation.

    Upload generated installers, ZIP files, and blockmaps to the matching target directory first. Verify they are readable over HTTPS, then upload latest*.yml last so clients cannot discover an incomplete release. Keep the filenames from the manifests unchanged. macOS needs both the installation DMG and update ZIP. Storage upload credentials belong only in the publishing environment. Do not embed them in electron-builder.config.mjs or the app. Qualify a test feed before promoting a release to the production base URL.

    The app icon is a 1024 × 1024 rasterization of the existing packages/web/public/logo.svg, stored in packages/desktop/build/icon.png.

    Validation

    pnpm --filter soma-desktop run format:check
    pnpm --filter soma-desktop run typecheck
    pnpm build
    pnpm --filter soma-desktop exec playwright install ffmpeg
    pnpm --filter soma-desktop run test:e2e

    The Electron suite launches the real Rust server and browser window with the echo provider and disposable profiles. A real local HTTP feed exercises automatic and manual checks, request coalescing, version matching, downgrade rejection, checksum failures, prepared downloads, retry, reload, and light/dark/responsive settings views. It verifies preference persistence, graceful quit, and Unix host-crash cleanup. Videos and screenshots are written to packages/desktop/test-results/ for interaction review.

    SOMA_DESKTOP_UPDATE_URL=http://127.0.0.1:<port> enables a local updater fixture only in development; packaged apps ignore it. Real signed installation and restart must also be qualified with two release versions on each target OS.

    See ADR 0043 for process and IPC ownership, and the electron-builder update guide for platform distribution requirements.