Skip to content

Latest commit

 

History

History

desktop

README.md

Atomic-Server Desktop (powered by Tauri)

For the packaged macOS account and Cloud Vault acceptance setup, see ACCOUNT_ACCEPTANCE.md.

The packaged WebView uses styled-components at runtime. Tauri's asset CSP rewriting adds a style-src nonce that blocks those new style tags in WebKit, leaving the app unstyled (and CSSOM injection can raise styled-components error 17). tauri.conf.json therefore leaves only style-src under the explicit 'self' 'unsafe-inline' policy already configured there. Tauri still rewrites the script directive. Check the visible packaged window after changing this. The native WebView can also hold entry animations at their initial opacity while backgrounded, so onboarding and its app wrapper skip those fades in Tauri.

Desktop release for Atomic-Server. [Tauri] takes care of native installers, app icons, system tray icons, menu items, self-update (issue) and more.

# install tauri
cargo install tauri-cli
# from this directory: run the dev server
cargo tauri dev
# build an installer for your OS
cargo tauri build

Self-update

Release builds update themselves. A few seconds after launch, and then every few hours, the app (src/updates.rs) reads latest.json from the latest GitHub release. When it names a newer version the page shows an "Update available" toast; clicking it downloads, verifies and installs the update and restarts. Nothing installs without that click.

This is the Tauri updater, so it is the same on macOS, Windows and Linux. It is off in development and in plain cargo tauri build runs: the updater cargo feature and tauri.updater.conf.json (which holds the public key and the latest.json URL) are only added by tauri-release.yml.

One-time setup, by whoever owns releases:

cargo tauri signer generate -w ~/.tauri/atomic-updater.key
  1. Put the printed public key in tauri.updater.conf.json, replacing the placeholder.
  2. Add the private key as the repository secret TAURI_SIGNING_PRIVATE_KEY (and its password as TAURI_SIGNING_PRIVATE_KEY_PASSWORD).

Keep a copy of the private key somewhere safe: installed apps only accept updates signed with it, so losing it means every user has to reinstall by hand. Until the secret exists the workflow builds as before and ships no updater.

latest.json is written by scripts/make-latest-json.mjs in the attach job. GitHub's releases/latest skips pre-releases, so betas do not update existing installs; a stable vX.Y.Z release does.

MCP: the assistant's own servers, and other agents

  • Local MCP servers for the AI chat. Settings, AI, MCP can add a server of the kind "Command on this computer" (command, args, env, like Claude Desktop's mcpServers), and "Import from other apps" lists the ones found in Claude Desktop, Claude Code, Cursor and Codex configs (src/mcp_import.rs, parsers have unit tests). A command server is arbitrary code execution, so no script in the webview may start one:
    • The list lives in Rust, in mcp_servers.json in the app data dir (mode 0600, it holds env values; src/mcp_store.rs). It is not in the page's atomic.ai.mcpServers storage, and the page only sees id, name, command, args and env names.
    • mcp_stdio_add / mcp_stdio_add_many (editing is an add with an existing id) show a native dialog from Rust with the exact command lines, and store nothing on Cancel.
    • Import never passes secrets through the page: mcp_import_candidates returns an opaque id, command, args and env names only, and mcp_import(candidate_ids) re-reads the other apps' configs in Rust and stores the chosen ones through the same confirmation (one dialog for the batch). Servers that are only a URL carry no env and are imported by the page. The capability file grants the webview no dialog:* permission, so the page cannot draw or answer it.
    • mcp_stdio_start(id, run) only starts an entry already in the list; it takes no command, arguments or environment (run just labels the process).
    • src/mcp_stdio.rs then only moves lines (mcp_stdio_send/stop, events mcp-stdio-line and mcp-stdio-exit), with the login shell's PATH so npx and uvx are found. Children die on stop, on removal of their entry and when the app exits; stderr goes to the app log as [mcp:<id>]. The browser build does not offer any of this.
  • Other agents using Atomic. The embedded node serves POST /mcp (OAuth 2.1, see planning/mcp-endpoint.md) on http://localhost:9883. Settings, AI shows copy buttons for Codex, Claude Code and an mcpServers snippet using @tomic/mcp (browser/mcp/README.md). Use localhost, not 127.0.0.1: the approval page only trusts the origin the app itself uses. The browser a client opens on the same machine has no identity, so /app/authorize-mcp there offers "Open in Atomic", which hands the request to the app through the atomic://authorize-mcp deep link.

Running in development

cargo tauri dev starts the front-end for you — beforeDevCommand in tauri.conf.json runs pnpm -C browser/data-browser dev:tauri, and the app points at localhost:6747 (devUrl). If you only want to work on the server side of things, you can remove devUrl in tauri.conf.json.

cargo tauri build likewise runs beforeBuildCommand to produce browser/data-browser/dist-tauri before bundling.

The web inspector (devtools) is available in cargo tauri dev builds. Release builds leave it out; to get one with the inspector, build with cargo tauri build --features devtools (the devtools cargo feature in Cargo.toml).

Driving the app from an agent (MCP bridge)

Debug builds register tauri-plugin-mcp-bridge on 127.0.0.1:9223, which lets an MCP client open documents, type, and read the DOM — enough to test things like collaborative editing end to end without a person at the keyboard.

The bridge also needs withGlobalTauri, which is static config rather than something debug_assertions can gate. Rather than ship it, it lives in a separate file you opt into:

cargo tauri dev --config tauri.dev.conf.json

Without that flag the plugin still starts, but the webview has no window.__TAURI__ for it to talk through. Keep withGlobalTauri out of tauri.conf.json: this app runs with csp: null and renders data from drives the user may not control, so exposing the Tauri API to page content in shipped builds widens a surface that is already wide.

The channel is unauthenticated — anything that can reach the port can execute JS in the webview — which is why it binds to loopback rather than the plugin's default 0.0.0.0.

Environment overrides are baked in at build time

beforeBuildCommand is a normal vite production build, so it reads .env and .env.local — but not .env.development*. Put local control-plane URLs (VITE_MANAGED_PORTAL_URL, VITE_MANAGED_API_BASE) in browser/data-browser/.env.development.local. In .env.local they end up compiled into the shipped app, pointing it at a dev machine's ports.

macOS: repeated "wants to use your confidential information" prompts

The app stores the agent's keypair as a non-extractable CryptoKey in IndexedDB (helpers/agentStorage.ts). WebKit implements that by wrapping the key under a master key it keeps in the login keychain — the item named "Atomic Server WebCrypto Master Key". Reading it requires a keychain ACL match against the app's code signature.

An ad-hoc, linker-signed binary has no stable identity for that ACL to trust — its code identity is a hash of the binary itself, so macOS re-asks and "Always Allow" is void as soon as you relink. Hence signingIdentity in tauri.conf.json: bundles are signed with the Developer ID certificate, whose requirement (identifier plus team Q9WPWRTU7G) survives rebuilds, version bumps and reinstalls. One "Always Allow" then holds forever, for users on every update as much as for us.

Without that certificate in your keychain, cargo tauri build fails with no identity found. Override with codesign's ad-hoc identity:

APPLE_SIGNING_IDENTITY=- cargo tauri build

APPLE_SIGNING_IDENTITY takes precedence over the config value, which is also how tauri-release.yml feeds in the certificate from repository secrets, and how its secret-less runs fall back to ad-hoc.

cargo tauri dev needs the same identity and tauri never signs it, so desktop/.cargo/config.toml points cargo's target runner at scripts/sign-dev-binary.sh, which signs the binary between the link and the launch (cargo tauri dev shells out to cargo run, so a runner is the only hook available). Dev builds get no hardened runtime and keep get-task-allow, so lldb still attaches. Without the certificate the runner is a no-op and the app runs ad-hoc, as before. It costs ~2s per launch on the 168MB debug binary.

Note what does not work: setting the keychain item to "Allow all applications". Access is gated twice, on the item's ACL and on its partition list of code identities, and the Keychain Access UI only edits the first. An ad-hoc binary contributes cdhash:<hash of this exact build> to that list — so each "Always Allow" pinned the build being replaced, and the item accumulated 55 dead cdhashes. A Developer ID signature contributes teamid:Q9WPWRTU7G, which every later build shares.

Limitations

  • No way to pass flags to atomic-sever using the Tauri executable (although you can set ENV variables)
  • No HTTPS support

Error reporting in official packages

The release workflow enables Sentry for the embedded WebView on every platform. Tag builds use production; manual workflow builds use staging. Reports carry the app version and source commit. JavaScript/React errors and sidebar feedback are covered; native process crashes are not covered by this browser SDK. Local builds can opt in with VITE_SENTRY_DSN and VITE_SENTRY_ENVIRONMENT. See the SaaS SENTRY.md runbook for receipt verification.

Automatic Cloud Vault backup

With a linked, eligible account, the open local drive is enrolled and backed up without a setup click. Tauri's embedded-node drives count as local data; unrelated remote drives are excluded unless already enrolled with this account. The personal drive is retried after startup too, so late account linking does not require a restart. Explicit backup opt-outs and account eligibility checks remain authoritative.

The browser and Tauri watcher uses incremental packs: 5 seconds after editing stops, or at most 30 seconds during sustained editing. Switching drives preserves queued work. Foregrounding/reconnecting retries immediately; a 60-second check also catches native-node changes and late account availability. Unchanged drives upload no object. These timers run only while the app runtime can execute; they are not an OS background service. Manual backup remains a retry option.