@bastani/atomic 0.10.10-alpha.1 → 0.10.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +85 -0
- package/README.md +22 -15
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +2 -2
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +2 -2
- package/dist/_shared/mode-shared-2QJSCUM6.js +2 -2
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/sdk-RRLVN7ER.js +2 -2
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/startup-0-0-4VG2G44V.js +2 -2
- package/dist/_shared/startup-0-1-XTIL65D4.js +2 -2
- package/dist/_shared/startup-0-2-27OWFHV6.js +7 -6
- package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -1
- package/dist/_shared/startup-0-3-T4DVFYWX.js +2 -2
- package/dist/_shared/startup-0-4-ZMJV547D.js +2 -2
- package/dist/_shared/startup-0-5-FD2P735I.js +2 -2
- package/dist/_shared/startup-10-0-TDQNBDDL.js +2 -2
- package/dist/_shared/startup-15-1-4S7FLMNG.js +2 -2
- package/dist/_shared/startup-8-0-34CBHPZH.js +2 -2
- package/dist/_shared/startup-8-1-4KANEHRA.js +2 -2
- package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/README.md +4 -4
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/README.md +28 -4
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +8 -0
- package/dist/builtin/subagents/README.md +3 -3
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/CHANGELOG.md +9 -0
- package/dist/builtin/web-access/README.md +2 -2
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +2 -2
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +2 -2
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +2 -2
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +2 -2
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +2 -2
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +2 -2
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +2 -2
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +2 -2
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/package-manager-cli.code.js +2 -2
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/startup-files.json +1 -1
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks.md +8 -5
- package/docs/build.md +11 -6
- package/docs/changelog.mdx +1 -1
- package/docs/codemode.md +10 -2
- package/docs/compaction/reference.md +6 -4
- package/docs/compaction.md +3 -3
- package/docs/containerization.md +13 -5
- package/docs/custom-provider/api-reference.md +8 -6
- package/docs/custom-provider/oauth.md +4 -4
- package/docs/custom-provider/registration.md +3 -3
- package/docs/custom-provider.md +8 -8
- package/docs/development.md +40 -5
- package/docs/docs.json +21 -5
- package/docs/environment-variables.md +20 -18
- package/docs/extensions/api-reference.md +8 -6
- package/docs/extensions/authoring.md +4 -4
- package/docs/extensions.md +43 -6
- package/docs/guides/configuration.md +21 -1
- package/docs/guides/intercom.md +4 -0
- package/docs/guides/non-interactive.md +4 -2
- package/docs/guides/orchestration.md +4 -2
- package/docs/guides/resume-on-any-machine.md +12 -6
- package/docs/guides/subagents.md +4 -0
- package/docs/guides/team-setup.md +13 -2
- package/docs/guides.md +10 -4
- package/docs/herdr.md +4 -4
- package/docs/index.md +12 -4
- package/docs/intercom/operations.md +26 -4
- package/docs/intercom/reference.md +25 -3
- package/docs/intercom.md +13 -5
- package/docs/json.md +2 -0
- package/docs/keybindings.md +17 -4
- package/docs/libraries/agent-core.md +4 -2
- package/docs/libraries/ai.md +71 -53
- package/docs/libraries/codemode.md +3 -2
- package/docs/libraries/schema.md +5 -2
- package/docs/libraries/storage-libsql.md +92 -0
- package/docs/libraries/storage-postgres.md +119 -0
- package/docs/libraries/telemetry.md +35 -2
- package/docs/libraries.md +23 -6
- package/docs/llama-cpp.md +2 -2
- package/docs/mcp-servers.md +50 -4
- package/docs/models/reference.md +13 -9
- package/docs/models-configuration.md +7 -7
- package/docs/models.md +18 -8
- package/docs/orchestration/migrating-workflows.md +2 -2
- package/docs/orchestration/patterns.md +8 -8
- package/docs/orchestration.md +5 -3
- package/docs/packages/authoring.md +3 -1
- package/docs/packages/reference.md +3 -1
- package/docs/packages.md +5 -3
- package/docs/programmatic.md +14 -8
- package/docs/prompt-templates.md +5 -3
- package/docs/providers/reference.md +7 -7
- package/docs/providers.md +22 -10
- package/docs/quickstart.md +13 -11
- package/docs/reference/cli.md +10 -5
- package/docs/reference.md +8 -4
- package/docs/rpc/examples.md +47 -0
- package/docs/rpc/extension-ui.md +7 -1
- package/docs/rpc/protocol.md +3 -2
- package/docs/rpc.md +3 -1
- package/docs/sdk/reference.md +144 -38
- package/docs/sdk/storage.md +614 -0
- package/docs/sdk/structured-decisions.md +77 -4
- package/docs/sdk/web-server.md +3 -2
- package/docs/sdk.md +26 -115
- package/docs/security.md +17 -7
- package/docs/session-format.md +38 -24
- package/docs/sessions.md +21 -15
- package/docs/settings.md +17 -14
- package/docs/skills.md +47 -3
- package/docs/storage.md +38 -24
- package/docs/subagents/authoring.md +3 -1
- package/docs/subagents/reference.md +8 -2
- package/docs/subagents.md +35 -6
- package/docs/terminal-setup.md +1 -1
- package/docs/themes.md +5 -3
- package/docs/tmux.md +4 -4
- package/docs/tools.md +11 -0
- package/docs/usage.md +25 -15
- package/docs/web-access.md +35 -0
- package/docs/windows.md +9 -6
- package/docs/worktree-snapshots.md +22 -11
- package/examples/sdk/11-sessions.ts +4 -4
- package/package.json +8 -8
- package/schemas/models.schema.json +7 -7
|
@@ -8,13 +8,17 @@ When several machines share one storage database, you can start a session on one
|
|
|
8
8
|
|
|
9
9
|
## Join each machine
|
|
10
10
|
|
|
11
|
-
Every machine must use the same shared database, either PostgreSQL or Turso / libSQL.
|
|
11
|
+
Every machine must use the same shared database, either PostgreSQL or Turso / libSQL. Do not embed passwords or auth tokens in the database URL; pass credentials through `--password-file`, `--token-file`, or `--auth` (`credential-in-url`).
|
|
12
12
|
|
|
13
|
-
**PostgreSQL:**
|
|
13
|
+
**PostgreSQL (PostgreSQL 16 or newer for sessions):**
|
|
14
|
+
|
|
15
|
+
In two-role deployments, run `atomic storage migrate --db 'postgresql://atomic_owner@db.example.com:5432/atomic' --password-file ~/atomic-owner-password` once as the owner role (and after Atomic upgrades), then grant the runtime role its privileges before joining machines as `atomic_runtime`. See [Set up the database](/storage#set-up-the-database).
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
18
|
atomic install npm:@bastani/atomic-storage-postgres
|
|
17
19
|
atomic storage join 'postgresql://atomic_runtime@db.example.com:5432/atomic' --password-file ~/atomic-db-password
|
|
20
|
+
atomic intercom restart
|
|
21
|
+
atomic storage status
|
|
18
22
|
```
|
|
19
23
|
|
|
20
24
|
See [PostgreSQL](/storage#postgresql) for database roles, TLS, and cloud identities.
|
|
@@ -24,9 +28,11 @@ See [PostgreSQL](/storage#postgresql) for database roles, TLS, and cloud identit
|
|
|
24
28
|
```bash
|
|
25
29
|
atomic install npm:@bastani/atomic-storage-libsql
|
|
26
30
|
atomic storage join libsql://<db>.turso.io --token-file ~/turso-token
|
|
31
|
+
atomic intercom restart
|
|
32
|
+
atomic storage status
|
|
27
33
|
```
|
|
28
34
|
|
|
29
|
-
`atomic storage join` stores sessions in the shared database so they resume on any joined machine. By contrast, `atomic team join` shares Intercom while keeping personal sessions local. To share sessions on a machine joined with `atomic team join`, run `atomic team leave` and then `atomic storage join`. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts) for prefixes, tokens, and `atomic storage status`.
|
|
35
|
+
`atomic storage join` stores sessions in the shared database so they resume on any joined machine. By contrast, `atomic team join` ([Set up teams and CI](/guides/team-setup)) shares Intercom while keeping personal sessions local. To share sessions on a machine joined with `atomic team join`, run `atomic team leave` and then `atomic storage join`. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts) for prefixes, tokens, and `atomic storage status`.
|
|
30
36
|
|
|
31
37
|
Keep worktree snapshots enabled (`snapshots.enabled`, on by default). At the end of each turn that modifies files, Atomic saves uncommitted edits, untracked files, and unpushed commits in the shared database. If `snapshots.enabled` is set to `false`, no snapshots are captured, cross-machine resume cannot restore repository files, and `atomic blueprint prebuild` fails with `snapshots are disabled`.
|
|
32
38
|
|
|
@@ -34,7 +40,7 @@ Work inside submodules and untracked nested repositories is not recorded, and re
|
|
|
34
40
|
|
|
35
41
|
## Resume a session
|
|
36
42
|
|
|
37
|
-
Resume as usual with `atomic --session <id>`, `atomic --resume`, or `/resume
|
|
43
|
+
Resume as usual with `atomic --session <id>`, `atomic --resume`, or `/resume` (see [Resuming and deleting sessions](/sessions#resuming-and-deleting-sessions)).
|
|
38
44
|
|
|
39
45
|
- **Matching local checkout.** If you start Atomic inside a checkout of the same repository whose files match the snapshot (or where the recorded edits were committed), the session continues there directly.
|
|
40
46
|
- **Restored worktree.** Otherwise, Atomic restores the recorded state into a worktree under `~/.atomic/agent/worktree-snapshots` without modifying your local checkouts, and prints the restored path. Atomic reuses a clean idle worktree of the same repository when available so existing dependencies and build output stay intact. See [Restored worktrees](/worktree-snapshots#restored-worktrees).
|
|
@@ -45,7 +51,7 @@ Resume as usual with `atomic --session <id>`, `atomic --resume`, or `/resume`.
|
|
|
45
51
|
|
|
46
52
|
Absolute paths from the earlier machine keep working in built-in file tools because Atomic maps paths under the old checkout to the restored worktree. Shell commands run as written, so commands containing old absolute paths need the new worktree path.
|
|
47
53
|
|
|
48
|
-
Passing `--session <id>` for a session whose recorded directory does not exist on this machine opens directly instead of offering to fork the session. SDK callers using `createAgentSession({ sessionManager })` get the same restore behavior unless they pass `cwd` or `workspace`, even when the recorded path exists on this machine with different files (such as runners built from the same container image).
|
|
54
|
+
Passing `--session <id>` for a session whose recorded directory does not exist on this machine opens directly instead of offering to fork the session. SDK callers using `createAgentSession({ sessionManager })` get the same restore behavior unless they pass `cwd` or `workspace`, even when the recorded path exists on this machine with different files (such as runners built from the same container image). See [Worktree snapshots in the SDK](/sdk#worktree-snapshots) and [SDK session storage](/sdk/storage).
|
|
49
55
|
|
|
50
56
|
If shared storage does not answer, `atomic --session`, `--resume`, `--continue`, and `/resume` stop after 15 seconds with a retryable `ResumeCatalogTimeoutError`. Nothing is modified; resume again once `atomic storage status` connects.
|
|
51
57
|
|
|
@@ -277,7 +283,7 @@ For session resumes, missing Git never blocks opening the session. Instead, the
|
|
|
277
283
|
| Windows worktree path exceeds Git for Windows limits | Set `ATOMIC_CODING_AGENT_DIR` to a shorter path ([Long paths on Windows](#long-paths-on-windows)). Nothing is written. | `WorkspaceRestoreError` (`path-too-long`) |
|
|
278
284
|
| Snapshot fails security validation (credentials in remote URL, `ext::` remote helper, or malformed hashes) | Resume only sessions from trusted storage, or re-export from the source machine. Nothing is fetched or run. | `WorkspaceRestoreError` (`invalid-snapshot`) |
|
|
279
285
|
|
|
280
|
-
Secret values never appear in error messages; errors name only the file or environment variable. SDK error classes, codes, and `isResume*Error` guards are exported from `@bastani/atomic
|
|
286
|
+
Secret values never appear in error messages; errors name only the file or environment variable. SDK error classes, codes, and `isResume*Error` guards are exported from `@bastani/atomic`; see [Resuming on another machine](/sdk/reference#resuming-on-another-machine).
|
|
281
287
|
|
|
282
288
|
## Windows
|
|
283
289
|
|
package/docs/guides/subagents.md
CHANGED
|
@@ -6,6 +6,8 @@ description: "Learn what subagents do, when to delegate tasks, and how backgroun
|
|
|
6
6
|
|
|
7
7
|
A subagent is a separate agent session that your main session launches for a focused task. It runs in its own context window, so a long code search or debugging trace does not crowd out your main conversation.
|
|
8
8
|
|
|
9
|
+
This page introduces subagents at a high level. For day-to-day usage, worktrees, and run control, see [Run subagents](/subagents). For custom agent files, see [Create custom subagents](/subagents/authoring). For exact parameters, fallback rules, and `config.json`, see [Subagent reference](/subagents/reference). For programmatic child configuration, see [Subagent children in the SDK](/sdk#subagent-children).
|
|
10
|
+
|
|
9
11
|
Ask Atomic to delegate in plain language:
|
|
10
12
|
|
|
11
13
|
```text
|
|
@@ -29,5 +31,7 @@ Delegate bounded, independent work. Good fits include searching an unfamiliar ar
|
|
|
29
31
|
|
|
30
32
|
- [Run subagents](/subagents) covers bundled agents, worktrees, run control, and coordination.
|
|
31
33
|
- [Create custom subagents](/subagents/authoring) explains how to write Markdown agent definitions and override built-in agents.
|
|
34
|
+
- [Subagent reference](/subagents/reference) covers discovery precedence, fallback models, `config.json`, tool parameters, and SDK error codes.
|
|
35
|
+
- [Subagent children in the SDK](/sdk#subagent-children) covers child inheritance and programmatic configuration from `@bastani/atomic`.
|
|
32
36
|
- [Manage background tasks](/background-tasks) covers the agent panel, `/tasks`, steering, and stopping running work.
|
|
33
37
|
- [Orchestrate with codemode and subagents](/orchestration) shows how to combine codemode scripts with subagents for multi-step work.
|
|
@@ -206,6 +206,10 @@ When the agent job resumes a session, Atomic fetches only the commits missing fr
|
|
|
206
206
|
|
|
207
207
|
`@bastani/atomic/storage` exports async helpers `joinTeam()`, `leaveTeam()`, and `getTeamProfile()`, plus `teamProfileSelection()` (libSQL and Turso only).
|
|
208
208
|
|
|
209
|
+
`teamProfileSelection()` returns an adapter selection for `@bastani/atomic-storage-libsql`. Because adapter selections resolve from user-scope packages, host extension directories, or the agent directory rather than an application's `node_modules`, install the adapter with `atomic install npm:@bastani/atomic-storage-libsql` (without `-l`), or register a local package directory with `DefaultResourceLoader({ additionalExtensionPaths })`.
|
|
210
|
+
|
|
211
|
+
If you prefer managing `@bastani/atomic-storage-libsql` as an ordinary project dependency with `npm install`, call `openLibsqlDatabase()` directly and pass `sessionStore: { kind: "database", database, prefix? }` to `createAgentSession()`, closing `database` in a `finally` block. See [SDK session storage](/sdk/storage) for complete recipes and ownership rules.
|
|
212
|
+
|
|
209
213
|
Use `teamProfileSelection({ profile: "ci", url, token })` to pass a storage selection to `createAgentSession({ storage })` without modifying settings:
|
|
210
214
|
|
|
211
215
|
- `token` stays in memory, serializes as `[redacted]`, and cannot be reopened by child processes.
|
|
@@ -222,10 +226,15 @@ import { teamProfileSelection } from "@bastani/atomic/storage";
|
|
|
222
226
|
const url = process.env.TEAM_DATABASE_URL!;
|
|
223
227
|
const token = process.env.TEAM_DATABASE_TOKEN!;
|
|
224
228
|
|
|
225
|
-
// Embedded SDK agent: sessions use the team database
|
|
229
|
+
// Embedded SDK agent: sessions use the team database (requires `atomic install npm:@bastani/atomic-storage-libsql`
|
|
230
|
+
// or `DefaultResourceLoader({ additionalExtensionPaths })`).
|
|
226
231
|
const storage = teamProfileSelection({ profile: "ci", url, token });
|
|
227
232
|
const { session } = await createAgentSession({ storage });
|
|
228
|
-
|
|
233
|
+
try {
|
|
234
|
+
await session.prompt("Summarize the failing tests");
|
|
235
|
+
} finally {
|
|
236
|
+
await session.dispose();
|
|
237
|
+
}
|
|
229
238
|
|
|
230
239
|
// Spawned agent process: sessions and Intercom both use the team database.
|
|
231
240
|
const child = spawn("atomic", ["-p", "Fix the failing test"], {
|
|
@@ -247,5 +256,7 @@ Anyone with read access to the team database can read everything stored in it, i
|
|
|
247
256
|
## Related
|
|
248
257
|
|
|
249
258
|
- [Storage backends](/storage) for storage setup, selections, precedence, and error reference.
|
|
259
|
+
- [SDK session storage](/sdk/storage) for Node.js and TypeScript storage recipes, `openLibsqlDatabase()`, and store ownership rules.
|
|
260
|
+
- [Resume sessions on any machine](/guides/resume-on-any-machine) for cross-machine worktree snapshots and environment blueprints.
|
|
250
261
|
- [Running Intercom across machines](/intercom/operations#running-intercom-across-machines) for multi-node broker details.
|
|
251
262
|
- [Intercom groups](/intercom/reference#groups) for how groups isolate sessions.
|
package/docs/guides.md
CHANGED
|
@@ -13,16 +13,19 @@ New to Atomic? Follow the [Quickstart](/quickstart) to install, authenticate, ru
|
|
|
13
13
|
- **[Configure Atomic](/guides/configuration).** Create a global settings file and override settings per project.
|
|
14
14
|
- **[Sessions](/sessions).** Save, resume, name, search, and branch sessions.
|
|
15
15
|
- **[Worktree snapshots](/worktree-snapshots).** Capture and restore repository state alongside your session history.
|
|
16
|
-
- **[Resume on any machine](/guides/resume-on-any-machine).** Continue a session on another machine that shares your storage.
|
|
17
|
-
- **[
|
|
16
|
+
- **[Resume on any machine and blueprints](/guides/resume-on-any-machine).** Continue a session on another machine that shares your storage, and automate dependency rebuilds with [`.atomic/blueprint.yaml` blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint).
|
|
17
|
+
- **[Storage backends](/storage).** Choose local SQLite, PostgreSQL, or Turso/libSQL, run migrations, and export or import sessions. For programmatic apps, see [SDK storage backends](/sdk/storage).
|
|
18
|
+
- **[Context and compaction](/compaction).** Keep long sessions inside the model's context window, or plug in a [custom remote compactor](/compaction#customize-morph-or-add-a-remote-compactor).
|
|
19
|
+
- **[MCP servers](/mcp-servers).** Connect external tools and data sources over Model Context Protocol.
|
|
18
20
|
|
|
19
21
|
## Delegate and automate
|
|
20
22
|
|
|
21
23
|
- **[Plan a task with subagents](/guides/orchestration).** Distribute multi-step work across subagents and verify the results.
|
|
22
|
-
- **[Subagents](/guides/subagents).** Delegate independent tasks to fresh or forked subagents in the background.
|
|
24
|
+
- **[Subagents](/guides/subagents).** Delegate independent tasks to fresh or forked subagents in the background (see the full [Subagents guide](/subagents)).
|
|
23
25
|
- **[Background tasks](/background-tasks).** Launch, inspect, steer, and stop background subagents and shells.
|
|
24
|
-
- **[Intercom](/guides/intercom).** Coordinate live sessions and subagents on one machine or across a shared database.
|
|
26
|
+
- **[Intercom](/guides/intercom).** Coordinate live sessions and subagents on one machine or across a shared database (see the full [Intercom guide](/intercom)).
|
|
25
27
|
- **[Team and CI setup](/guides/team-setup).** Share Intercom with a team through one database while sessions stay private, and configure CI runners from environment variables.
|
|
28
|
+
- **[Structured decisions](/sdk/structured-decisions).** Make typed classifier or chat decisions with `decide()` and `generateStructuredOutput()`.
|
|
26
29
|
- **[Computer use](/computer-use).** Automate desktop apps, browsers, and terminals across macOS, Linux, and Windows.
|
|
27
30
|
- **[Verification](/verification).** Reproduce bugs and collect verifiable evidence across terminal, browser, and desktop environments.
|
|
28
31
|
|
|
@@ -38,7 +41,10 @@ New to Atomic? Follow the [Quickstart](/quickstart) to install, authenticate, ru
|
|
|
38
41
|
|
|
39
42
|
## Quick references
|
|
40
43
|
|
|
44
|
+
- **[CLI reference](/reference/cli).** Look up commands, flags, subcommands, and exit codes.
|
|
45
|
+
- **[Built-in tools](/tools)**, **[Codemode](/codemode)**, and **[Web access](/web-access).** Review default tools, sandbox scripting, and search/fetch controls.
|
|
41
46
|
- **[Herdr](/herdr).** Configure status indicators and session restore inside Herdr panes.
|
|
42
47
|
- **[Settings](/settings).** Browse the full `settings.json` reference.
|
|
43
48
|
- **[Environment variables](/environment-variables).** Look up Atomic variables, legacy aliases, color controls, and provider credentials.
|
|
44
49
|
- **[Keybindings](/keybindings).** Look up default shortcuts and custom bindings.
|
|
50
|
+
- **[Diagnostics and debugging](/development).** Capture debug snapshots, trace UI stalls, and report bugs.
|
package/docs/herdr.md
CHANGED
|
@@ -6,7 +6,7 @@ description: "Use Atomic's built-in Herdr status indicators, session restore, tr
|
|
|
6
6
|
|
|
7
7
|
Atomic reports its status to [Herdr](https://herdr.dev) automatically when you start it inside a Herdr pane. No extra extension is needed, and the pane identifies the agent as `atomic`.
|
|
8
8
|
|
|
9
|
-
For interactive terminal automation, pane isolation, and fallbacks, see [Computer use](/computer-use#terminal-automation-with-herdr). This page covers Atomic's built-in status and session-restore integration.
|
|
9
|
+
For interactive terminal automation, pane isolation, and fallbacks, see [Computer use](/computer-use#terminal-automation-with-herdr). To let Atomic inspect or control Herdr panes, tabs, workspaces, worktrees, and commands from inside a Herdr pane (`HERDR_ENV=1`), invoke the bundled `/skill:herdr` skill ([Bundled skills](/skills#bundled-skills)). This page covers Atomic's built-in status and session-restore integration.
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
@@ -26,13 +26,13 @@ Use Herdr 0.8.2 or newer and launch Atomic inside a Herdr pane. Herdr sets the p
|
|
|
26
26
|
|
|
27
27
|
Quiet periods such as provider waits, retries, and tool execution still count as Working. Active background work keeps the pane Working after Atomic finishes its response.
|
|
28
28
|
|
|
29
|
-
All Blocked states report the fixed message `"Waiting for approval"`, even for non-approval questions or prompts. Unlike [OSC 7501 program status](/terminal-setup#program-status), Herdr also reports project trust prompts (`/trust` or resumed-folder trust) as Blocked when no background tasks are running.
|
|
29
|
+
All Blocked states report the fixed message `"Waiting for approval"`, even for non-approval questions or prompts. Unlike [OSC 7501 program status](/terminal-setup#program-status), Herdr also reports [project trust](/security) prompts (`/trust` or resumed-folder trust) as Blocked when no background tasks are running.
|
|
30
30
|
|
|
31
|
-
Opening `/tasks` or `/agents` does not mark the pane Blocked, and neither does a subagent asking its supervisor for guidance. Check `/tasks` for pass or fail outcomes; the pane status shows activity, not a verdict.
|
|
31
|
+
Opening [`/tasks`](/background-tasks) or [`/agents`](/subagents) does not mark the pane Blocked, and neither does a [subagent](/subagents) asking its supervisor for guidance. Check `/tasks` for pass or fail outcomes; the pane status shows activity, not a verdict.
|
|
32
32
|
|
|
33
33
|
## Restore after a Herdr restart
|
|
34
34
|
|
|
35
|
-
With Herdr 0.9.2 or newer, Atomic also reports a resume command so Herdr can reopen the same conversation in the pane after a Herdr server restart. Atomic does not restart panes itself. To disable automatic agent restore in Herdr, set `[session] resume_agents_on_restore = false` in Herdr's config.
|
|
35
|
+
With Herdr 0.9.2 or newer, Atomic also reports a resume command so Herdr can reopen the same conversation in the pane after a Herdr server restart ([Sessions](/sessions), [Storage](/storage)). Atomic does not restart panes itself. To disable automatic agent restore in Herdr, set `[session] resume_agents_on_restore = false` in Herdr's config.
|
|
36
36
|
|
|
37
37
|
- **Local SQLite sessions (default):** Atomic reports `atomic --session-store <path> --session <id>` (plus `--session-prefix <prefix>` when a table prefix is configured).
|
|
38
38
|
- **JSONL directory sessions:** Atomic reports `atomic --session-dir <dir> --session <id>`. Session IDs ending in `.jsonl` still use `--session <id>`.
|
package/docs/index.md
CHANGED
|
@@ -8,7 +8,7 @@ Atomic is a terminal coding agent with built-in file, shell, search, codemode, s
|
|
|
8
8
|
|
|
9
9
|
## Quick start
|
|
10
10
|
|
|
11
|
-
Install with a package manager (requires Node.js 22.19+, or Bun 1.4.
|
|
11
|
+
Install with a package manager (requires Node.js 22.19+, or Bun 1.4.5+ for Bun installs):
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npm install -g @bastani/atomic
|
|
@@ -49,8 +49,16 @@ Authenticate with `/login`, run `atomic auth login <provider>` in your shell, or
|
|
|
49
49
|
5. [Use interactive mode](/usage).
|
|
50
50
|
6. [Manage sessions](/sessions) and [compaction](/compaction).
|
|
51
51
|
|
|
52
|
+
## Explore by capability
|
|
53
|
+
|
|
54
|
+
- **Sessions, snapshots, and resume:** Save and branch in [Sessions](/sessions), capture repository state with [Worktree snapshots](/worktree-snapshots), resume across machines with [Environment blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint), and share state over PostgreSQL or Turso/libSQL in [Storage backends](/storage).
|
|
55
|
+
- **Multi-agent work:** Delegate focused tasks with [Subagents](/subagents), coordinate live sessions with [Intercom](/intercom), and script multi-step checks with [Orchestration](/orchestration).
|
|
56
|
+
- **Tools and context:** Connect external tools through [MCP servers](/mcp-servers), keep long runs within budget with [Compaction and custom compactors](/compaction#customize-morph-or-add-a-remote-compactor), and inspect terminal integrations like [Herdr](/herdr).
|
|
57
|
+
- **Embed and extend:** Drive Atomic from Node.js with the [TypeScript SDK](/sdk), [SDK storage backends](/sdk/storage), [Structured decisions (`decide()`)](/sdk/structured-decisions), [RPC mode](/rpc), and [Standalone libraries](/libraries).
|
|
58
|
+
- **Troubleshoot:** Capture logs, stalls, and snapshots with [Diagnostics and debugging](/development).
|
|
59
|
+
|
|
52
60
|
## Documentation paths
|
|
53
61
|
|
|
54
|
-
- **[Learn](/guides).** Install Atomic, run interactive and non-interactive sessions, manage context and snapshots, delegate work with subagents and Intercom, connect providers, and review security and containerization.
|
|
55
|
-
- **[Build](/build).** Customize Atomic with skills, prompt templates, themes, extensions, and packages, orchestrate agents, define custom providers, or embed Atomic through the [SDK, RPC, or JSON mode](/programmatic).
|
|
56
|
-
- **[Reference](/reference).** Look up CLI commands and flags, settings, environment variables, keybindings, tools, storage, customization schemas, API protocols,
|
|
62
|
+
- **[Learn](/guides).** Install Atomic, run interactive and non-interactive sessions, manage context and [worktree snapshots](/worktree-snapshots), delegate work with [subagents](/subagents) and [Intercom](/intercom), connect providers, and review security and containerization.
|
|
63
|
+
- **[Build](/build).** Customize Atomic with skills, prompt templates, themes, extensions, [MCP servers](/mcp-servers), and packages, orchestrate agents, define custom providers and compactors, or embed Atomic through the [SDK, RPC, or JSON mode](/programmatic).
|
|
64
|
+
- **[Reference](/reference).** Look up CLI commands and flags, settings, environment variables, keybindings, tools, [storage](/storage), customization schemas, API protocols, [platform setup](/herdr), and [diagnostics](/development).
|
|
@@ -6,6 +6,14 @@ description: "Configure Intercom connections, multi-machine routing, broker upgr
|
|
|
6
6
|
|
|
7
7
|
This guide explains how Atomic sessions connect to the local Intercom broker, how delivery and multi-machine routing work, and how to diagnose connection or upgrade issues.
|
|
8
8
|
|
|
9
|
+
Looking for another Intercom page? See [Intercom overview](/guides/intercom) for concepts, [Coordinate sessions with Intercom](/intercom) for quick-start patterns and `contact_supervisor`, [Intercom reference](/intercom/reference) for tool parameters and settings, or [Storage and Intercom CLI commands](/reference/cli#storage-and-intercom-commands) for broker subcommands.
|
|
10
|
+
|
|
11
|
+
Common operational tasks on this page:
|
|
12
|
+
|
|
13
|
+
- [Running Intercom across machines](#running-intercom-across-machines) for shared-database setup, project groups, and multi-node troubleshooting.
|
|
14
|
+
- [Upgrading Atomic with sessions running](#upgrading-atomic-with-sessions-running) for broker handover, `atomic intercom upgrade`, and `atomic intercom restart`.
|
|
15
|
+
- [Connection states and recovery](#connection-states-and-recovery) for diagnosing disconnects, holds, and queued deliveries.
|
|
16
|
+
|
|
9
17
|
## How connection works
|
|
10
18
|
|
|
11
19
|
An interactive session connects to Intercom in the background 3 seconds after startup, including new, resumed, or forked terminal sessions. Neither the initial render nor your first prompt waits for this connection. Once connected, other sessions in its group can list and message it immediately.
|
|
@@ -114,7 +122,21 @@ By default, each machine's broker serves only sessions on that machine. With mul
|
|
|
114
122
|
|
|
115
123
|
For a team, run `atomic team join <url> --token-file <path>` to configure the team database for Intercom while keeping session transcripts local and restarting the broker. CI runners use `ATOMIC_PROFILE=ci` instead. See [Team and CI setup](/guides/team-setup).
|
|
116
124
|
|
|
117
|
-
To configure multi-node routing
|
|
125
|
+
To configure multi-node routing with a shared database for both sessions and Intercom, install either `@bastani/atomic-storage-libsql` ([Turso and libSQL](/storage#turso-and-libsql), [libSQL adapter library](/libraries/storage-libsql)) or `@bastani/atomic-storage-postgres` ([PostgreSQL](/storage#postgresql), [PostgreSQL adapter library](/libraries/storage-postgres)) on every machine and run `atomic storage join`. See [Sharing storage across hosts](/storage#sharing-storage-across-hosts) and [Storage and Intercom CLI commands](/reference/cli#storage-and-intercom-commands) for all flags and options.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Turso / libSQL
|
|
129
|
+
atomic install npm:@bastani/atomic-storage-libsql
|
|
130
|
+
atomic storage join libsql://<db>.turso.io --token-file ~/turso-token --prefix team_
|
|
131
|
+
atomic intercom restart
|
|
132
|
+
|
|
133
|
+
# PostgreSQL
|
|
134
|
+
atomic install npm:@bastani/atomic-storage-postgres
|
|
135
|
+
atomic storage join postgres://atomic@db.example.com:5432/atomic?sslmode=verify-full --password-file ~/pg-password --prefix team_
|
|
136
|
+
atomic intercom restart
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
You can also give every machine the same top-level `storage` selection and `prefix` manually, using any database-backed [storage adapter](/storage#selecting-an-adapter) installed as an [Atomic package](/storage#adapters-from-atomic-packages). Both npm installations and standalone binaries support multi-node routing.
|
|
118
140
|
|
|
119
141
|
The broker reads its storage selection from:
|
|
120
142
|
|
|
@@ -124,9 +146,9 @@ The broker reads its storage selection from:
|
|
|
124
146
|
```json
|
|
125
147
|
{
|
|
126
148
|
"storage": {
|
|
127
|
-
"adapter": "@
|
|
128
|
-
"options": { "url": "libsql
|
|
129
|
-
"secrets": { "authToken": { "env": "
|
|
149
|
+
"adapter": "@bastani/atomic-storage-libsql",
|
|
150
|
+
"options": { "url": "libsql://<db>.turso.io" },
|
|
151
|
+
"secrets": { "authToken": { "env": "TURSO_TOKEN" } },
|
|
130
152
|
"prefix": "team_"
|
|
131
153
|
}
|
|
132
154
|
}
|
|
@@ -4,6 +4,8 @@ sidebarTitle: "Intercom"
|
|
|
4
4
|
description: "Complete specification of the intercom tool, targeting rules, groups, delivery limits, SDK errors, and config.json."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
This page is the exact reference for the `intercom` tool, group rules, `config.json`, wake queues, and SDK error classes. For concepts, see [Intercom overview](/guides/intercom). For quick-start patterns and `contact_supervisor`, see [Coordinate sessions with Intercom](/intercom). For multi-machine setup, broker upgrades, and troubleshooting, see [Operate Intercom](/intercom/operations). For programmatic setup, see [Intercom group and reach in the SDK](/sdk#intercom-group-and-reach).
|
|
8
|
+
|
|
7
9
|
## The `intercom` tool {#the-intercom-tool}
|
|
8
10
|
|
|
9
11
|
| Parameter | Type | Description |
|
|
@@ -59,7 +61,7 @@ Ambiguous prefixes list only authorized candidates and require the full UUID. Is
|
|
|
59
61
|
|
|
60
62
|
Reopened sessions and restored background subagents reclaim their previous Intercom session ID so peers can keep using the ID printed by `intercom list`. The session persists this ID as an `intercom_session_identity` entry. While a live session holds an ID, another registration receives a fresh ID instead; once released, only that same Atomic session can reclaim it while the broker remembers its previous holder.
|
|
61
63
|
|
|
62
|
-
With [multi-node routing](/intercom/operations#running-intercom-across-machines), session ID reclaim works across machines once the shared database has the current schema (on PostgreSQL, run `atomic storage migrate` as the schema owner role):
|
|
64
|
+
With [multi-node routing](/intercom/operations#running-intercom-across-machines), session ID reclaim works across machines once the shared database has the current schema (on [PostgreSQL storage](/storage#postgresql), run `atomic storage migrate` as the schema owner role):
|
|
63
65
|
|
|
64
66
|
- A session that disconnects cleanly reclaims its ID immediately on any machine.
|
|
65
67
|
- A session whose broker crashed reclaims its ID immediately on the same machine, or on another machine after the crashed broker's 30-second lease expires (until then it receives a fresh ID and automatically rebinds once the lease lapses).
|
|
@@ -270,7 +272,7 @@ Messages for paused subagents have no wait limit while the launching session sta
|
|
|
270
272
|
|
|
271
273
|
#### Across restarts
|
|
272
274
|
|
|
273
|
-
Queued messages for finished or paused subagents are persisted before the broker reports `queued`: locally in `ended-child-queue.sqlite` (owner-only, inside the Intercom directory), or in the shared database under the configured `prefix` when [multi-node routing](/intercom/operations#running-intercom-across-machines) is on.
|
|
275
|
+
Queued messages for finished or paused subagents are persisted before the broker reports `queued`: locally in `ended-child-queue.sqlite` (owner-only, inside the Intercom directory), or in the [shared database](/storage#sharing-storage-across-hosts) under the configured `prefix` when [multi-node routing](/intercom/operations#running-intercom-across-machines) is on.
|
|
274
276
|
|
|
275
277
|
After a broker restart, crash, or reboot, the next broker restores queued messages in order:
|
|
276
278
|
|
|
@@ -317,7 +319,27 @@ return Promise.all(
|
|
|
317
319
|
|
|
318
320
|
### Reach policies
|
|
319
321
|
|
|
320
|
-
An SDK host can assign a reach policy via [`createAgentSession({ intercom: { group, reachable } })`](/sdk#intercom-group-and-reach) and update `reachable` dynamically with `session.intercom.setReachable(groups)`:
|
|
322
|
+
An SDK host can assign a reach policy via [`createAgentSession({ intercom: { group, reachable } })`](/sdk#intercom-group-and-reach) and update `reachable` dynamically with `session.intercom.setReachable(groups)`. To disable Intercom completely in an SDK session, pass `builtins: { intercom: false }` ([SDK tools](/sdk/reference#tools)). Invalid group names or calling `setReachable()` on a session created without an `intercom` policy throw `IntercomPolicyError` from `@bastani/atomic`:
|
|
323
|
+
|
|
324
|
+
```typescript
|
|
325
|
+
import { createAgentSession, IntercomPolicyError } from "@bastani/atomic";
|
|
326
|
+
|
|
327
|
+
try {
|
|
328
|
+
const { session } = await createAgentSession({
|
|
329
|
+
intercom: { group: "team-api", reachable: ["team-shared"] },
|
|
330
|
+
});
|
|
331
|
+
await session.intercom.setReachable(["team-shared", "team-qa"]);
|
|
332
|
+
} catch (error) {
|
|
333
|
+
if (error instanceof IntercomPolicyError) {
|
|
334
|
+
console.error("Invalid Intercom policy:", error.message);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Disable the bundled Intercom package entirely for this session
|
|
339
|
+
const isolated = await createAgentSession({
|
|
340
|
+
builtins: { intercom: false },
|
|
341
|
+
});
|
|
342
|
+
```
|
|
321
343
|
|
|
322
344
|
- The session can list, send to, and ask only sessions in its home group, its `reachable` groups, or subgroups under its home group (`<group>/...`, where its subagents run). Out-of-policy targets fail with `Target session is outside this session's Intercom reach (...)` (or `Session not found` for unseen names) and are never queued or held.
|
|
323
345
|
- Reach is one-way: reaching group B does not let group B initiate messages back unless B's own memberships or policy allow it. Replies to asks received by B are always allowed.
|
package/docs/intercom.md
CHANGED
|
@@ -4,7 +4,9 @@ sidebarTitle: "Intercom guide"
|
|
|
4
4
|
description: "Send messages, ask non-blocking questions, and escalate subagent decisions between Atomic sessions."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Intercom provides direct and broadcast messaging between Atomic sessions on the same machine, or across multiple machines that share a storage database. You can send context, findings, or requests yourself, or let agents coordinate directly. No separate install is required.
|
|
7
|
+
Intercom provides direct and broadcast messaging between Atomic sessions on the same machine, or across multiple machines that share a [storage database](/storage#sharing-storage-across-hosts). You can send context, findings, or requests yourself, or let agents coordinate directly. No separate install is required.
|
|
8
|
+
|
|
9
|
+
New to Intercom? Start with [Intercom overview](/guides/intercom). For multi-machine setup, broker upgrades, and recovery, see [Operate Intercom](/intercom/operations). For the tool schema, settings, and SDK errors, see [Intercom reference](/intercom/reference). For programmatic group and reach control, see [Intercom group and reach in the SDK](/sdk#intercom-group-and-reach).
|
|
8
10
|
|
|
9
11
|
The `/intercom` command, `Alt+M` shortcut, and `intercom` tool are available as soon as Atomic starts. An interactive session joins Intercom automatically in the background 3 seconds after startup, so other sessions in its group can list and message it before it uses Intercom itself. Startup never waits for this connection.
|
|
10
12
|
|
|
@@ -20,7 +22,7 @@ Print (`-p`), JSON, RPC, and SDK sessions connect on first Intercom use or when
|
|
|
20
22
|
- **Subagent escalation.** Subagents receive `contact_supervisor` for decisions, structured interviews, and progress updates.
|
|
21
23
|
- **Run notifications.** Subagents deliver run results and activity notices to their launching session over Intercom.
|
|
22
24
|
- **Bundled skill.** Run `/skill:intercom` for planner-worker, group, broadcast, and escalation patterns.
|
|
23
|
-
- **Programmatic reach policies.** Embedded SDK hosts can constrain a session's reachable groups via [Reach policies](/intercom/reference#reach-policies).
|
|
25
|
+
- **Programmatic reach policies.** Embedded SDK hosts can constrain a session's reachable groups via [Intercom group and reach](/sdk#intercom-group-and-reach) and [Reach policies](/intercom/reference#reach-policies).
|
|
24
26
|
|
|
25
27
|
**Common use cases:**
|
|
26
28
|
|
|
@@ -35,8 +37,9 @@ Print (`-p`), JSON, RPC, and SDK sessions connect on first Intercom use or when
|
|
|
35
37
|
Read this page for the quick start, coordination patterns, and supervisor escalation. Then continue to:
|
|
36
38
|
|
|
37
39
|
- [Operate Intercom](/intercom/operations) for connection lifecycles, delivery recovery, broker upgrades, and troubleshooting.
|
|
38
|
-
- [Running Intercom across machines](/intercom/operations#running-intercom-across-machines) for multi-machine messaging through shared storage.
|
|
40
|
+
- [Running Intercom across machines](/intercom/operations#running-intercom-across-machines), [Sharing storage across hosts](/storage#sharing-storage-across-hosts), and [Set up teams and CI](/guides/team-setup) for multi-machine messaging through shared storage.
|
|
39
41
|
- [Intercom reference](/intercom/reference) for the `intercom` tool contract, targeting rules, error classes, and every Intercom setting.
|
|
42
|
+
- [Intercom group and reach in the SDK](/sdk#intercom-group-and-reach) and [SDK tools](/sdk/reference#tools) for programmatic reach policies and `builtins.intercom`.
|
|
40
43
|
|
|
41
44
|
## Quick start
|
|
42
45
|
|
|
@@ -142,7 +145,7 @@ Queued messages survive broker restarts and deliver once in order. If delivery b
|
|
|
142
145
|
|
|
143
146
|
A busy non-interactive recipient other than a running subagent can refuse a message without interrupting its work. A `delivered` receipt means the recipient saved the message, not that its model accepted it. Refusals keep the reply thread: an `ask` receives a failed-ask message (or an inline error while waiting), and a `send` delivers an **Intercom delivery failed** notice with a `Sent:` timestamp without triggering a standalone turn.
|
|
144
147
|
|
|
145
|
-
Atomic enables `intercom` by default, subject to tool allowlists, exclusions, and `noTools: "all"`. Include `"intercom"` in an explicit allowlist when you need it. An interactive session whose tool selection omits `intercom` does not join at startup. Print, JSON, RPC, and SDK sessions with `builtins: { intercom: false }` disable Intercom completely, and `/reload` does not restore it. `contact_supervisor` remains subagent-only.
|
|
148
|
+
Atomic enables `intercom` by default, subject to tool allowlists, exclusions, and `noTools: "all"`. Include `"intercom"` in an explicit allowlist when you need it. An interactive session whose tool selection omits `intercom` does not join at startup. Print, JSON, RPC, and SDK sessions with `builtins: { intercom: false }` disable Intercom completely, and `/reload` does not restore it. See [SDK tools](/sdk/reference#tools) and [Reach policies](/intercom/reference#reach-policies) for programmatic setup, `session.intercom.setReachable()`, and `IntercomPolicyError`. `contact_supervisor` remains subagent-only.
|
|
146
149
|
|
|
147
150
|
## Coordination patterns
|
|
148
151
|
|
|
@@ -208,7 +211,7 @@ Coordinate with other local Atomic sessions on related codebases. Use `/skill:in
|
|
|
208
211
|
|
|
209
212
|
## Escalate subagent decisions with `contact_supervisor`
|
|
210
213
|
|
|
211
|
-
By default (`intercomBridge.mode: "always"` in `~/.atomic/agent/extensions/subagent/config.json
|
|
214
|
+
By default (`intercomBridge.mode: "always"` in `~/.atomic/agent/extensions/subagent/config.json`, documented in [Subagent config.json reference](/subagents/reference#subagent-config-json-reference)), every subagent launched by a session with Intercom active receives the subagent-only `contact_supervisor` tool alongside `intercom`. Atomic wires up the supervisor target automatically with no manual configuration. Normal sessions never see `contact_supervisor`.
|
|
212
215
|
|
|
213
216
|
Setting `intercomBridge.mode` to `"off"` (or `"fork-only"` for fresh subagents) limits `contact_supervisor` to agents that explicitly include it in their frontmatter tools list.
|
|
214
217
|
|
|
@@ -318,6 +321,11 @@ Use Intercom for coordinating your own sessions and for peer-to-peer agent swarm
|
|
|
318
321
|
|
|
319
322
|
## Related docs
|
|
320
323
|
|
|
324
|
+
- [Operate Intercom](/intercom/operations) for broker lifecycles, upgrades, recovery, and multi-machine routing.
|
|
325
|
+
- [Intercom reference](/intercom/reference) for tool parameters, targeting rules, reach policies, and error classes.
|
|
326
|
+
- [Sharing storage across hosts](/storage#sharing-storage-across-hosts) and [Set up teams and CI](/guides/team-setup) for shared PostgreSQL and libSQL databases.
|
|
327
|
+
- [Intercom group and reach in the SDK](/sdk#intercom-group-and-reach) and [SDK tools](/sdk/reference#tools) for programmatic Intercom policies and `builtins.intercom`.
|
|
328
|
+
- [Storage and Intercom CLI commands](/reference/cli#storage-and-intercom-commands) for `atomic intercom` and `atomic storage` subcommands.
|
|
321
329
|
- [Run subagents](/subagents) for delegated subagent runs, supervisor coordination, and result delivery.
|
|
322
330
|
- [Orchestrate with codemode and subagents](/orchestration) for multi-step tasks and completion notices.
|
|
323
331
|
- [Skills](/skills) for reusable instructions like `/skill:intercom`.
|
package/docs/json.md
CHANGED
|
@@ -14,6 +14,8 @@ Need to send follow-up commands to a live process or embed Atomic directly in No
|
|
|
14
14
|
|
|
15
15
|
If a saved default `provider/model` names a provider that stays unsupported after startup, JSON mode writes a configuration diagnostic to stderr and exits with code `1` before sending any prompt. Stdout stays empty so downstream parsers never receive non-JSON text. Supported providers with an unknown model or missing credentials still fall back through normal model selection.
|
|
16
16
|
|
|
17
|
+
To isolate session storage in scripts or CI runs without changing saved settings, pass `--storage '<json>'`, `--storage-file <path>`, or `--session-store <path>` (with optional `--session-prefix <prefix>`), or set `ATOMIC_STORAGE` or `ATOMIC_SESSIONS_STORAGE` in the environment. Invalid storage selections fail at startup with `StorageConfigError`. Atomic writes the error to stderr, leaves stdout empty, and exits with code `1`. See [Selecting storage per process](/storage#selecting-storage-per-process).
|
|
18
|
+
|
|
17
19
|
## Output format
|
|
18
20
|
|
|
19
21
|
Each line on stdout is a single JSON object terminated by `\n`. The first line is always the session header (including when `--no-session` is passed, which emits the in-memory session header):
|
package/docs/keybindings.md
CHANGED
|
@@ -4,7 +4,7 @@ sidebarTitle: "Keybindings"
|
|
|
4
4
|
description: "Default keyboard shortcuts and custom ~/.atomic/agent/keybindings.json configuration rules."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Customize keyboard shortcuts in `~/.atomic/agent/keybindings.json
|
|
7
|
+
Customize keyboard shortcuts in `~/.atomic/agent/keybindings.json` (relocated by `ATOMIC_CODING_AGENT_DIR`; see [Environment variables](/environment-variables)). Run `/reload` after editing the file to apply changes without restarting. Add `"$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/schemas/keybindings.schema.json"` for editor completion and validation (Atomic ignores `$schema` at load time). See [Interactive mode](/usage) for editor and queue workflows, and [tmux setup](/tmux) if `Shift+Enter` or `Escape` behaves unexpectedly inside tmux.
|
|
8
8
|
|
|
9
9
|
## Key format
|
|
10
10
|
|
|
@@ -145,7 +145,7 @@ Interactive sessions run in fullscreen with a scrollable transcript above the do
|
|
|
145
145
|
|
|
146
146
|
Rebind these like any other action: for example `"tui.altScreen.pageUp": "ctrl+pageUp"` keeps `pageUp` in the editor and moves transcript paging to `ctrl+pageUp`, and `[]` unbinds a shortcut. Focused custom components may consume viewport keys first; see the [input handling contract](/extensions/ui#custom-components).
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
**[`ask_user_question`](/tools) controls:** Transcript scroll keys also work while the bottom-pinned `ask_user_question` dialog or Notes is open. Inside `ask_user_question`, use `↑`/`↓` to move between options, `Enter` to pick (`Enter` or `Space` to toggle multi-select boxes), type on **Type something.** for a custom answer, `n` to add a note, `Tab` or `←`/`→` to switch questions, and `Esc` to cancel.
|
|
149
149
|
|
|
150
150
|
| Keybinding id | Default | Description |
|
|
151
151
|
| --- | --- | --- |
|
|
@@ -181,8 +181,9 @@ Atomic does not ship a find-in-transcript shortcut. The four `tui.altScreen.sear
|
|
|
181
181
|
|
|
182
182
|
**`Ctrl+C`, `Esc`, and `Ctrl+X` routing:**
|
|
183
183
|
|
|
184
|
-
- `Ctrl+X` does not copy text; paired with `Ctrl+K` it stops all background work ([Navigation](#navigation)), on OAuth sign-in screens it copies the sign-in URL (`app.auth.copyUrl`), and in `/scoped-models` it clears selections. Use `/copy` to copy the viewed agent's last assistant message.
|
|
185
|
-
- Physical `Esc` always requests cooperative cancellation without restarting the session.
|
|
184
|
+
- `Ctrl+X` does not copy text; paired with `Ctrl+K` it stops all background work ([Navigation](#navigation)), on [OAuth sign-in screens](/providers) it copies the sign-in URL (`app.auth.copyUrl`), and in `/scoped-models` it clears selections. Use `/copy` to copy the viewed agent's last assistant message.
|
|
185
|
+
- Physical `Esc` always requests cooperative cancellation without restarting the session. Pressing `Escape` twice within 500 ms on an empty, idle editor triggers `doubleEscapeAction`: `/tree` (`"tree"`, default), `/fork` (`"fork"`), or nothing (`"none"`). Configure it in [Interface and display settings](/settings#interface-and-display).
|
|
186
|
+
- Physical `Ctrl+C` closes stuck custom dialogs (dialogs that handle `Ctrl+C` receive the first press and close on the second) and restarts an unresponsive background session process, even if you remap `app.clear`. See [Message queue](/usage#message-queue) for full interrupt and recovery rules.
|
|
186
187
|
|
|
187
188
|
### Sessions
|
|
188
189
|
|
|
@@ -275,6 +276,18 @@ Used inside `/scoped-models`. `Enter` toggles the selected model, typing filters
|
|
|
275
276
|
| `app.models.reorderUp` | `alt+up` (`alt+q` on Windows and WSL) | Move the selected model up in the cycle order |
|
|
276
277
|
| `app.models.reorderDown` | `alt+down` | Move the selected model down in the cycle order |
|
|
277
278
|
|
|
279
|
+
### Non-configurable and bundled extension shortcuts
|
|
280
|
+
|
|
281
|
+
These shortcuts are not configured through `keybindings.json`:
|
|
282
|
+
|
|
283
|
+
| Shortcut | Scope | Action |
|
|
284
|
+
| --- | --- | --- |
|
|
285
|
+
| `Shift+Ctrl+D` | Global (non-configurable) | Append a TUI render and unredacted session-message snapshot to `~/.atomic/agent/atomic-debug.log` ([Diagnostics and debugging](/development#debugging)) |
|
|
286
|
+
| `Cmd+V` (macOS) | Global (non-configurable) | Paste clipboard images in terminals that forward empty bracketed paste or Kitty `super+v` |
|
|
287
|
+
| `Alt+M` | Bundled [Intercom](/intercom) extension | Open the Intercom session list overlay |
|
|
288
|
+
| `Ctrl+Shift+S` | Bundled [Web access](/web-access#slash-commands-and-shortcuts) extension | Open the browser search curator while a search runs (configure via `shortcuts.curate` in `~/.atomic/web-search.json`) |
|
|
289
|
+
| `Ctrl+Shift+W` | Bundled [Web access](/web-access#slash-commands-and-shortcuts) extension | Toggle the live web-search activity monitor (configure via `shortcuts.activity` in `~/.atomic/web-search.json`) |
|
|
290
|
+
|
|
278
291
|
## Preset examples
|
|
279
292
|
|
|
280
293
|
### Emacs example
|
|
@@ -4,16 +4,18 @@ sidebarTitle: "@bastani/atomic-agent-core"
|
|
|
4
4
|
description: "Stateful agent loop with tool execution, event streaming, steering, and follow-up messages."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Stateful agent with tool execution and event streaming, built on [`@bastani/atomic-ai`](/libraries/ai) (requires Node.js 22.19+). Atomic's sessions run on this agent loop, and you can use it directly to build your own agent. Atomic's [TypeScript SDK](/sdk) wraps it with sessions, tools, extensions, and compaction, so prefer the SDK when you want Atomic's built-in behavior.
|
|
7
|
+
Stateful agent with tool execution and event streaming, built on [`@bastani/atomic-ai`](/libraries/ai) (requires Node.js 22.19+). Atomic's sessions run on this agent loop, and you can use it directly to build your own agent. Atomic's [TypeScript SDK](/sdk) wraps it with sessions, tools, extensions, and compaction, so prefer the SDK when you want Atomic's built-in behavior. See [Standalone libraries](/libraries) for all standalone packages.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install @bastani/atomic-agent-core
|
|
12
|
+
npm install @bastani/atomic-agent-core @bastani/atomic-ai
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
|
17
|
+
Export `ANTHROPIC_API_KEY` before running this example:
|
|
18
|
+
|
|
17
19
|
```typescript
|
|
18
20
|
import { Agent } from "@bastani/atomic-agent-core";
|
|
19
21
|
import { createModels } from "@bastani/atomic-ai";
|