@bastani/atomic 0.10.9 → 0.10.10-alpha.2
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 +83 -0
- package/README.md +226 -163
- 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 +27 -12
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
- package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
- package/dist/_shared/sdk-RRLVN7ER.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js +4 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
- package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
- package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
- package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
- package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
- package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +150 -62
- package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
- package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
- package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
- package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
- package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
- package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
- package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
- package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
- package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
- package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
- package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
- package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
- package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
- 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 +87 -116
- package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
- package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
- package/dist/builtin/intercom/group.ts +7 -3
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/README.md +61 -27
- 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 +74 -141
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
- package/dist/builtin/web-access/CHANGELOG.md +9 -0
- package/dist/builtin/web-access/README.md +61 -88
- package/dist/builtin/web-access/index.bundle.mjs +387 -351
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +4 -4
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +2 -2
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.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.code.js +2 -2
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +2 -2
- 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.code.js +2 -2
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +2 -2
- 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/agent-session-methods.d.ts +4 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/compaction/compactor.d.ts +20 -14
- package/dist/core/compaction/errors.d.ts +120 -0
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/model-resolver.d.ts +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.code.js +1 -1
- 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/api-types.d.ts +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- 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.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/provider-types.d.ts +18 -6
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-context.js +1 -1
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- 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 +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/model-config.d.ts +40 -0
- package/dist/core/model-registry.js +1 -1
- package/dist/core/model-resolver-scope.d.ts +4 -4
- package/dist/core/model-runtime.d.ts +1 -1
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/provider-composer-internal.d.ts +11 -2
- package/dist/core/sdk.code.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 +5 -5
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +1 -1
- 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/settings-manager-basic-accessors.d.ts +6 -2
- 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 +3 -3
- 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.code.js +2 -2
- 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 +3 -3
- 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 +3 -3
- 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.code.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 +3 -3
- 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.code.js +1 -1
- 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.code.js +1 -1
- 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 +3 -3
- 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 +4 -4
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.code.js +1 -1
- 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.code.js +2 -2
- 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.code.js +3 -3
- 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.code.js +1 -1
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +2 -2
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +2 -2
- 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.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +7 -7
- package/dist/main-first-time-setup.code.js +2 -2
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -0
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- 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/modes/interactive/theme/color-utils.d.ts +5 -5
- package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
- package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
- package/dist/modes/rpc/rpc-types.d.ts +29 -2
- package/dist/package-manager-cli.code.js +5 -5
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/5.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +1 -2
- package/dist/startup-stages/9.js +2 -1
- package/dist/utils/native-module.d.ts +44 -0
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks.md +238 -243
- package/docs/build.md +21 -15
- package/docs/changelog.mdx +1 -1
- package/docs/codemode.md +68 -51
- package/docs/compaction/reference.md +65 -26
- package/docs/compaction.md +118 -66
- package/docs/computer-use.md +179 -146
- package/docs/containerization.md +87 -33
- package/docs/custom-provider/api-reference.md +152 -13
- package/docs/custom-provider/oauth.md +45 -28
- package/docs/custom-provider/override.md +14 -7
- package/docs/custom-provider/registration.md +77 -67
- package/docs/custom-provider/streaming.md +42 -19
- package/docs/custom-provider.md +26 -62
- package/docs/development.md +81 -42
- package/docs/docs.json +54 -38
- package/docs/environment-variables.md +92 -64
- package/docs/extensions/api-reference.md +326 -735
- package/docs/extensions/authoring.md +186 -269
- package/docs/extensions/events.md +308 -375
- package/docs/extensions/examples.md +122 -74
- package/docs/extensions/ui.md +217 -197
- package/docs/extensions.md +189 -259
- package/docs/getting-started/authentication.md +27 -14
- package/docs/getting-started/first-session.md +25 -26
- package/docs/getting-started/installation.md +62 -84
- package/docs/getting-started/project-instructions.md +39 -14
- package/docs/guides/configuration.md +62 -20
- package/docs/guides/intercom.md +20 -12
- package/docs/guides/non-interactive.md +31 -16
- package/docs/guides/orchestration.md +17 -9
- package/docs/guides/resume-on-any-machine.md +63 -52
- package/docs/guides/subagents.md +26 -14
- package/docs/guides/team-setup.md +49 -27
- package/docs/guides.md +30 -23
- package/docs/herdr.md +22 -17
- package/docs/index.md +24 -17
- package/docs/intercom/operations.md +90 -66
- package/docs/intercom/reference.md +219 -192
- package/docs/intercom.md +111 -92
- package/docs/json.md +73 -71
- package/docs/keybindings.md +74 -48
- package/docs/libraries/agent-core.md +52 -9
- package/docs/libraries/ai.md +90 -63
- package/docs/libraries/codemode.md +31 -8
- package/docs/libraries/schema.md +12 -9
- package/docs/libraries/storage-libsql.md +92 -0
- package/docs/libraries/storage-postgres.md +119 -0
- package/docs/libraries/telemetry.md +42 -9
- package/docs/libraries/tui.md +74 -94
- package/docs/libraries.md +25 -8
- package/docs/llama-cpp.md +38 -33
- package/docs/mcp-servers.md +140 -88
- package/docs/models/reference.md +53 -36
- package/docs/models-configuration.md +19 -13
- package/docs/models.md +102 -87
- package/docs/orchestration/migrating-workflows.md +22 -20
- package/docs/orchestration/patterns.md +36 -21
- package/docs/orchestration.md +24 -21
- package/docs/packages/authoring.md +29 -18
- package/docs/packages/reference.md +77 -16
- package/docs/packages.md +34 -34
- package/docs/programmatic.md +28 -21
- package/docs/prompt-templates.md +65 -41
- package/docs/providers/reference.md +36 -20
- package/docs/providers.md +78 -76
- package/docs/quickstart.md +42 -54
- package/docs/reference/cli.md +256 -254
- package/docs/reference.md +30 -23
- package/docs/rpc/examples.md +121 -17
- package/docs/rpc/extension-ui.md +86 -63
- package/docs/rpc/protocol.md +817 -358
- package/docs/rpc.md +78 -152
- package/docs/sdk/reference.md +309 -73
- package/docs/sdk/storage.md +614 -0
- package/docs/sdk/structured-decisions.md +168 -65
- package/docs/sdk/web-server.md +80 -46
- package/docs/sdk.md +168 -215
- package/docs/security.md +117 -44
- package/docs/session-format.md +127 -76
- package/docs/sessions.md +155 -113
- package/docs/settings.md +293 -205
- package/docs/shell-aliases.md +15 -6
- package/docs/skills/authoring.md +17 -9
- package/docs/skills/reference.md +23 -21
- package/docs/skills.md +148 -97
- package/docs/storage.md +172 -260
- package/docs/subagents/authoring.md +148 -15
- package/docs/subagents/reference.md +105 -29
- package/docs/subagents.md +247 -250
- package/docs/terminal-setup.md +97 -69
- package/docs/termux.md +51 -85
- package/docs/themes/reference.md +51 -37
- package/docs/themes.md +52 -55
- package/docs/tmux.md +38 -21
- package/docs/tools.md +209 -147
- package/docs/tui/reference.md +64 -32
- package/docs/tui.md +38 -66
- package/docs/usage.md +94 -86
- package/docs/verification.md +25 -25
- package/docs/web-access.md +106 -54
- package/docs/windows.md +55 -57
- package/docs/worktree-snapshots.md +82 -74
- package/examples/sdk/11-sessions.ts +4 -4
- package/package.json +8 -8
- package/schemas/models.schema.json +58 -7
- package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
- package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
- package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
- package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
package/docs/intercom.md
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Intercom"
|
|
3
|
-
|
|
2
|
+
title: "Coordinate sessions with Intercom"
|
|
3
|
+
sidebarTitle: "Intercom guide"
|
|
4
|
+
description: "Send messages, ask non-blocking questions, and escalate subagent decisions between Atomic sessions."
|
|
4
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](/storage#sharing-storage-across-hosts). You can send context, findings, or requests yourself, or let agents coordinate directly. No separate install is required.
|
|
7
8
|
|
|
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).
|
|
9
10
|
|
|
10
|
-
The
|
|
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.
|
|
11
12
|
|
|
12
|
-
Print (`-p`), JSON, RPC, and SDK sessions
|
|
13
|
+
Print (`-p`), JSON, RPC, and SDK sessions connect on first Intercom use or when they launch a subagent with Intercom. Interactive sessions do the same when startup join is disabled (`ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` or `false`, legacy alias `PI_INTERCOM_JOIN_AT_STARTUP`, or `joinAtStartup: false` in [Intercom configuration](/intercom/reference#configuration) without `ATOMIC_INTERCOM_JOIN_AT_STARTUP=1` or `true`; unrecognized environment values are ignored). A subagent launched with Intercom connects as soon as its session starts and inherits the launching session's group unless the launch sets `group`.
|
|
13
14
|
|
|
14
15
|
**Key capabilities:**
|
|
15
16
|
|
|
16
17
|
- **Session messaging.** Call `send`, `ask`, `reply`, `pending`, `cancel`, `list`, `groups`, and `status` through the `intercom` tool. Calls to `ask` never block; late replies arrive as messages.
|
|
17
|
-
- **Runtime groups.** Add or remove named memberships without restarting. Joined sessions keep their
|
|
18
|
-
- **Session and group discovery.** List connected sessions or every
|
|
19
|
-
- **
|
|
20
|
-
- **Keyboard overlay.** Press ALT+M or run `/intercom` to pick a session and compose a message.
|
|
18
|
+
- **Runtime groups.** Add or remove named memberships without restarting. Joined sessions keep their Intercom session IDs, and later subagents inherit the most recently joined membership.
|
|
19
|
+
- **Session and group discovery.** List connected sessions or every active group with session counts and membership markers.
|
|
20
|
+
- **Keyboard overlay.** Press `Alt+M` or run `/intercom` to pick a session and compose a message.
|
|
21
21
|
- **Attachments.** Share `file`, `snippet`, and `context` payloads between sessions.
|
|
22
|
-
- **Subagent escalation.**
|
|
23
|
-
- **Run notifications.** Subagents deliver run results and
|
|
22
|
+
- **Subagent escalation.** Subagents receive `contact_supervisor` for decisions, structured interviews, and progress updates.
|
|
23
|
+
- **Run notifications.** Subagents deliver run results and activity notices to their launching session over Intercom.
|
|
24
24
|
- **Bundled skill.** Run `/skill:intercom` for planner-worker, group, broadcast, and escalation patterns.
|
|
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).
|
|
25
26
|
|
|
26
|
-
**
|
|
27
|
+
**Common use cases:**
|
|
27
28
|
|
|
28
29
|
- Planner and worker splits across two terminals.
|
|
29
|
-
- Research
|
|
30
|
-
- Supervisor decisions and structured interviews for
|
|
30
|
+
- Research-to-implementation context handoffs.
|
|
31
|
+
- Supervisor decisions and structured interviews for subagents.
|
|
31
32
|
- Peer-to-peer coordination across parallel subagents.
|
|
32
33
|
- Pair debugging between sessions.
|
|
33
34
|
|
|
@@ -35,19 +36,20 @@ Print (`-p`), JSON, RPC, and SDK sessions join when you or the model first use I
|
|
|
35
36
|
|
|
36
37
|
Read this page for the quick start, coordination patterns, and supervisor escalation. Then continue to:
|
|
37
38
|
|
|
38
|
-
- [Intercom
|
|
39
|
-
- [Running Intercom across machines](/intercom/operations#running-intercom-across-machines) for multi-machine messaging through shared storage.
|
|
40
|
-
- [Intercom reference](/intercom/reference) for the `intercom` tool contract, error classes, and every Intercom setting.
|
|
39
|
+
- [Operate Intercom](/intercom/operations) for connection lifecycles, delivery recovery, broker upgrades, and troubleshooting.
|
|
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.
|
|
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`.
|
|
41
43
|
|
|
42
44
|
## Quick start
|
|
43
45
|
|
|
44
46
|
### From the keyboard
|
|
45
47
|
|
|
46
|
-
Press
|
|
48
|
+
Press **`Alt+M`** or run `/intercom` to open the session list overlay (`Alt+M` is bound by the Intercom extension rather than `keybindings.json`; `/intercom` always works as a fallback):
|
|
47
49
|
|
|
48
50
|
1. **Select a session.** Use arrow keys to choose a target session.
|
|
49
51
|
2. **Compose a message.** Type your message in the compose overlay.
|
|
50
|
-
3. **Send.** Press Enter to send or
|
|
52
|
+
3. **Send.** Press `Enter` to send or `Esc` to cancel.
|
|
51
53
|
|
|
52
54
|
Sent messages are recorded in session history and confirmed with a notification.
|
|
53
55
|
|
|
@@ -119,31 +121,31 @@ Found the issue: UserService.validate() does not check for null input.
|
|
|
119
121
|
See auth.ts:142-156.
|
|
120
122
|
```
|
|
121
123
|
|
|
122
|
-
The reply hint is enabled by default and points to `intercom({ action: "reply", ... })`, so recipients rarely need raw sender or `replyTo` IDs. Idle recipients start a new turn immediately; busy interactive
|
|
124
|
+
The reply hint is enabled by default and points to `intercom({ action: "reply", ... })`, so recipients rarely need raw sender or `replyTo` IDs. Idle recipients start a new turn immediately; busy interactive main sessions receive incoming messages when they become idle. Attachment content is included in the model-visible body, and messages are stored in Atomic session history.
|
|
123
125
|
|
|
124
126
|
The recipient saves each message to its session as soon as it arrives, and the sender sees `delivered` only after that save succeeds. If the recipient closes or crashes before showing a saved message, resuming it with `atomic --session <id>` or `/resume` replays unread messages once in arrival order when the sender is still connected.
|
|
125
127
|
|
|
126
|
-
Messages from a sender that is gone are recorded once in full without starting a turn. Messages whose sender cannot be checked yet
|
|
128
|
+
Messages from a sender that is gone are recorded once in full without starting a turn. Messages whose sender cannot be checked yet (such as when Intercom is unreachable or a relaunched subagent has not reconnected) are deferred until the next reopen. Sessions started with `--no-session` are not saved, so their unread messages cannot be recovered.
|
|
127
129
|
|
|
128
|
-
Working subagents
|
|
130
|
+
Working subagents act on incoming `send` and `ask` messages in the same task and session according to the sender's case-sensitive `delivery` option (busy interactive main sessions wait until idle regardless of `delivery`):
|
|
129
131
|
|
|
130
|
-
| `delivery` | When a
|
|
132
|
+
| `delivery` | When a working subagent receives it | Use it for |
|
|
131
133
|
| --- | --- | --- |
|
|
132
134
|
| `"steer"` (default) | After its current tool calls finish. Current work is not cancelled. | Ordinary coordination, findings, and updates |
|
|
133
|
-
| `"followUp"` | After the
|
|
135
|
+
| `"followUp"` | After the subagent finishes and stops. | Low-priority notes or follow-up tasks |
|
|
134
136
|
| `"interrupt"` | Immediately. Current model call or cancellable tool call is cancelled, then the message runs next. | Urgent corrections or stop orders |
|
|
135
137
|
|
|
136
|
-
Any sender can set `delivery` per
|
|
138
|
+
Any sender can set `delivery` per `send` or `ask` call, including peers, the supervisor, and you. An idle recipient starts a turn for any mode. For example, `intercom({ action: "send", to: "worker", message: "Stop; the spec changed", delivery: "interrupt" })` cancels the worker's current tool call. Tools that ignore cancellation finish first, and completed side effects are not undone.
|
|
137
139
|
|
|
138
|
-
Messages from one sender always reach the recipient in arrival order, whether
|
|
140
|
+
Messages from one sender always reach the recipient in arrival order, whether delivered immediately, queued for idle, or replayed on resume. Startup messages join the original subagent task, and asks keep their reply threads. Subagent `pause` and `quit`, session cancellation, host stop, and permanently cancelled subagents take precedence over later messages.
|
|
139
141
|
|
|
140
142
|
Sending or asking a subagent that completed or failed resumes it automatically. The call returns at once with the message queued, the launching session resumes the subagent, and the subagent receives the message first. A paused or quit subagent is not resumed automatically; its messages wait with no time limit until the launching session continues it.
|
|
141
143
|
|
|
142
144
|
Queued messages survive broker restarts and deliver once in order. If delivery becomes impossible because the subagent was cancelled, the launching session ended, or the launching session stayed away for 7 days in a row, the sender gets one delivery failure. See [Messages that resume a finished subagent](/intercom/reference#messages-that-resume-a-finished-subagent).
|
|
143
145
|
|
|
144
|
-
A busy non-interactive recipient
|
|
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.
|
|
145
147
|
|
|
146
|
-
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.
|
|
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.
|
|
147
149
|
|
|
148
150
|
## Coordination patterns
|
|
149
151
|
|
|
@@ -179,7 +181,7 @@ intercom({
|
|
|
179
181
|
| Pattern | Action | Why |
|
|
180
182
|
| --- | --- | --- |
|
|
181
183
|
| **Task delegation** | Planner uses `send` | Fire-and-forget. Planner does not need to wait for an answer. |
|
|
182
|
-
| **Clarification request** | Worker uses `ask` | Worker needs an answer to proceed
|
|
184
|
+
| **Clarification request** | Worker uses `ask` | Worker needs an answer to proceed and keeps working on unblocked tasks until the reply arrives. |
|
|
183
185
|
| **Discovery escalation** | Worker uses `ask` | Worker requests approval before changing direction. |
|
|
184
186
|
| **Completion report** | Worker uses `ask` | Planner may have follow-up instructions or the next task. |
|
|
185
187
|
| **Peer handoff** | Sibling uses `send` | A researcher or debugger passes file paths, evidence, or a reproduction straight to the sibling that needs it. |
|
|
@@ -207,33 +209,27 @@ Coordinate with other local Atomic sessions on related codebases. Use `/skill:in
|
|
|
207
209
|
</intercom>
|
|
208
210
|
```
|
|
209
211
|
|
|
210
|
-
##
|
|
212
|
+
## Escalate subagent decisions with `contact_supervisor`
|
|
211
213
|
|
|
212
|
-
|
|
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`.
|
|
213
215
|
|
|
214
|
-
|
|
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.
|
|
215
217
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
In normal task-host runs, both single-child and parallel launches run in the background. A `contact_supervisor` request waits in the requesting child and continues in that same child when the supervisor replies, while an `intercom` `ask` returns at delivery and delivers its reply later as a message.
|
|
219
|
-
|
|
220
|
-
A parent's `subagent({ action: "wait" })` call may yield so the parent can reply without cancelling active or queued siblings. Sends and progress updates never block. Only a direct single-child launch in an SDK session without a task host ends with a `[TASK_CONTEXT]` fresh-child handoff when its blocking parent request is claimed.
|
|
218
|
+
### Parameters and reasons
|
|
221
219
|
|
|
222
220
|
| Parameter | Type | Description |
|
|
223
221
|
| --- | --- | --- |
|
|
224
|
-
| `reason` | string | `"need_decision"` (blocking), `"interview_request"` (blocking structured questions), or `"progress_update"` (fire-and-forget) |
|
|
225
|
-
| `message` | string |
|
|
226
|
-
| `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }
|
|
227
|
-
|
|
228
|
-
### The three reasons
|
|
222
|
+
| `reason` | string | `"need_decision"` (blocking), `"interview_request"` (blocking structured questions), or `"progress_update"` (fire-and-forget). |
|
|
223
|
+
| `message` | string | Required for `progress_update`; strongly recommended for `need_decision` (an omitted `message` sends an empty question); optional note for `interview_request`. |
|
|
224
|
+
| `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }`. |
|
|
229
225
|
|
|
230
226
|
| Reason | Behavior | Use when |
|
|
231
227
|
| --- | --- | --- |
|
|
232
|
-
| `need_decision` |
|
|
233
|
-
| `interview_request` |
|
|
234
|
-
| `progress_update` | Fire-and-forget update to the supervisor.
|
|
228
|
+
| `need_decision` | Waits inside the requesting subagent (up to 10 minutes) for the supervisor's correlated reply, then continues in that same subagent. | The subagent is blocked, uncertain, needs approval, or faces a product, API, or scope decision. |
|
|
229
|
+
| `interview_request` | Waits inside the requesting subagent (up to 10 minutes) for structured answers from the supervisor, then continues in that same subagent. | The subagent needs multiple machine-readable answers in one exchange. |
|
|
230
|
+
| `progress_update` | Fire-and-forget update to the supervisor. Returns immediately without waiting or disrupting siblings. | Meaningful progress or unexpected discoveries change the plan. |
|
|
235
231
|
|
|
236
|
-
Do not use `contact_supervisor` for routine completion handoffs; return the final subagent result normally.
|
|
232
|
+
Do not use `contact_supervisor` for routine completion handoffs; return the final subagent result normally. A parent's `subagent({ action: "wait" })` call yields so the supervisor can reply without cancelling active or queued siblings.
|
|
237
233
|
|
|
238
234
|
```typescript
|
|
239
235
|
// Blocked subagent asks for guidance
|
|
@@ -241,8 +237,6 @@ contact_supervisor({
|
|
|
241
237
|
reason: "need_decision",
|
|
242
238
|
message: "The auth service returns 403 instead of 401 for expired tokens. Should I treat 403 as a re-auth trigger or a hard failure?"
|
|
243
239
|
})
|
|
244
|
-
// Normal task-host run (single or parallel): the supervisor replies through Intercom and this child continues.
|
|
245
|
-
// Direct single-child SDK launch without a task host: parent receives [TASK_CONTEXT] for a fresh child.
|
|
246
240
|
|
|
247
241
|
// Fire-and-forget progress update
|
|
248
242
|
contact_supervisor({
|
|
@@ -252,28 +246,18 @@ contact_supervisor({
|
|
|
252
246
|
// Output: Progress update sent to supervisor planner
|
|
253
247
|
```
|
|
254
248
|
|
|
255
|
-
###
|
|
256
|
-
|
|
257
|
-
In normal task-host runs, both single and parallel, the supervisor receives the question with child and run identity plus a reply hint. Answer through `intercom({ action: "reply", message: "..." })`. If several questions are pending, run `intercom({ action: "pending" })` and pass the exact `replyTo`. The answer returns as the child's tool result; do not launch a replacement child to answer it.
|
|
258
|
-
|
|
259
|
-
In an SDK session without a task host, a claimed direct single-child handoff instead delivers terminal run metadata, ordered attachments, the original delegated task, and a fresh-start `[TASK_CONTEXT]` call:
|
|
260
|
-
|
|
261
|
-
```text
|
|
262
|
-
Subagent yielded for parent input (worker, child 1).
|
|
263
|
-
Previous run (terminal): 78f659a3
|
|
264
|
-
Question:
|
|
265
|
-
Which API should I use?
|
|
249
|
+
### Answering a subagent as the supervisor
|
|
266
250
|
|
|
267
|
-
|
|
268
|
-
subagent({
|
|
269
|
-
"agent": "worker",
|
|
270
|
-
"task": "[TASK_CONTEXT] ... Continue with this supervisor answer: <SUPERVISOR_ANSWER>"
|
|
271
|
-
})
|
|
272
|
-
```
|
|
251
|
+
The supervisor receives the question with child and run identity plus a reply hint. Answer through `intercom({ action: "reply", message: "..." })`. If several questions are pending, run `intercom({ action: "pending" })` and pass the exact `replyTo`. Your answer returns as the subagent's tool result; never launch a replacement subagent just to answer it.
|
|
273
252
|
|
|
274
253
|
### Structured interview replies
|
|
275
254
|
|
|
276
|
-
`interview_request` questions use
|
|
255
|
+
`interview_request` questions use `{ id, type, question, options?, context? }`:
|
|
256
|
+
|
|
257
|
+
- `questions` must be a non-empty array with unique, non-empty `id` strings.
|
|
258
|
+
- `type` must be `"single"`, `"multi"`, `"text"`, `"image"`, or `"info"` (`info` items provide context only and need no answer).
|
|
259
|
+
- `options` is **required** (non-empty array of strings or `{ label: string }` objects) for `single` and `multi`, and **rejected** for `text`, `image`, and `info`.
|
|
260
|
+
- `message` is optional.
|
|
277
261
|
|
|
278
262
|
```typescript
|
|
279
263
|
contact_supervisor({
|
|
@@ -289,7 +273,7 @@ contact_supervisor({
|
|
|
289
273
|
})
|
|
290
274
|
```
|
|
291
275
|
|
|
292
|
-
|
|
276
|
+
Questions arrive without reordering or rewriting. Reply with plain JSON or a fenced code block (if a reply contains multiple fenced blocks, only the first is parsed):
|
|
293
277
|
|
|
294
278
|
```json
|
|
295
279
|
{
|
|
@@ -300,13 +284,30 @@ In normal task-host runs, questions arrive without reordering or rewriting. The
|
|
|
300
284
|
}
|
|
301
285
|
```
|
|
302
286
|
|
|
303
|
-
The
|
|
287
|
+
The subagent's tool result preserves the raw reply text and populates `details.structuredReply` when the JSON matches the expected question IDs and options. If JSON parsing or option validation fails, `details.structuredReply` is omitted and `details.structuredReplyParseError` describes the error while keeping the raw reply text.
|
|
288
|
+
|
|
289
|
+
### Embedded SDK sessions without background task management
|
|
290
|
+
|
|
291
|
+
When an embedded SDK session launches a single subagent directly without background task management, a blocking `need_decision` or `interview_request` ends that subagent instead of waiting in place. The caller receives terminal run metadata, ordered attachments, the original delegated task (including any structured interview questions), and a fresh-start `[TASK_CONTEXT]` call:
|
|
292
|
+
|
|
293
|
+
```text
|
|
294
|
+
Subagent yielded for parent input (worker, child 1).
|
|
295
|
+
Previous run (terminal): 78f659a3
|
|
296
|
+
Question:
|
|
297
|
+
Which API should I use?
|
|
298
|
+
|
|
299
|
+
Start a fresh subagent with a new run identity, replacing <SUPERVISOR_ANSWER> with your answer:
|
|
300
|
+
subagent({
|
|
301
|
+
"agent": "worker",
|
|
302
|
+
"task": "[TASK_CONTEXT] ... Continue with this supervisor answer: <SUPERVISOR_ANSWER>"
|
|
303
|
+
})
|
|
304
|
+
```
|
|
304
305
|
|
|
305
306
|
## Mixed versions
|
|
306
307
|
|
|
307
|
-
Atomic 0.10.0 removed workflows and `workflow:<rootRunId>/...` stage targets, which now return `Session not found`. Sessions of 0.9.x and 0.10.0+ still exchange ordinary sends, asks, and replies through whichever broker is running. See [Mixed versions and workflows](/intercom/operations#mixed-versions-and-workflows)
|
|
308
|
+
Atomic 0.10.0 removed workflows and `workflow:<rootRunId>/...` stage targets, which now return `Session not found`. Sessions of 0.9.x and 0.10.0+ still exchange ordinary sends, asks, and replies through whichever broker is running. See [Mixed versions and workflows](/intercom/operations#mixed-versions-and-workflows).
|
|
308
309
|
|
|
309
|
-
## Intercom vs shared-room messengers
|
|
310
|
+
## Intercom vs. shared-room messengers
|
|
310
311
|
|
|
311
312
|
| Aspect | Intercom | Shared-room messengers |
|
|
312
313
|
| --- | --- | --- |
|
|
@@ -320,31 +321,49 @@ Use Intercom for coordinating your own sessions and for peer-to-peer agent swarm
|
|
|
320
321
|
|
|
321
322
|
## Related docs
|
|
322
323
|
|
|
323
|
-
- [
|
|
324
|
-
- [
|
|
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.
|
|
329
|
+
- [Run subagents](/subagents) for delegated subagent runs, supervisor coordination, and result delivery.
|
|
330
|
+
- [Orchestrate with codemode and subagents](/orchestration) for multi-step tasks and completion notices.
|
|
325
331
|
- [Skills](/skills) for reusable instructions like `/skill:intercom`.
|
|
326
332
|
- [Environment variables](/environment-variables) for Intercom environment variables.
|
|
327
|
-
- [Interactive use](/usage) for interactive commands and
|
|
333
|
+
- [Interactive use](/usage) for interactive commands and bundled extensions.
|
|
328
334
|
|
|
329
335
|
## Moved sections
|
|
330
336
|
|
|
331
|
-
<
|
|
332
|
-
|
|
333
|
-
<
|
|
334
|
-
|
|
335
|
-
<
|
|
336
|
-
|
|
337
|
-
<
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
<
|
|
344
|
-
|
|
345
|
-
<
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
337
|
+
<div id="how-connection-works" />
|
|
338
|
+
|
|
339
|
+
<div id="troubleshooting-initialization" />
|
|
340
|
+
|
|
341
|
+
<div id="subagent-notifications" />
|
|
342
|
+
|
|
343
|
+
<div id="subagent-control-notices" />
|
|
344
|
+
|
|
345
|
+
<div id="delivery-ordering" />
|
|
346
|
+
|
|
347
|
+
<div id="keyboard-shortcuts" />
|
|
348
|
+
|
|
349
|
+
<div id="how-it-works" />
|
|
350
|
+
|
|
351
|
+
<div id="limitations" />
|
|
352
|
+
|
|
353
|
+
- **Intercom operations:** [How connection works](/intercom/operations#how-connection-works), [Troubleshooting initialization](/intercom/operations#troubleshooting-initialization), [Subagent notifications](/intercom/operations#subagent-notifications), [Subagent control notices](/intercom/operations#subagent-control-notices), [Delivery ordering](/intercom/operations#delivery-ordering), [Keyboard shortcuts](/intercom/operations#keyboard-shortcuts), [How it works](/intercom/operations#how-it-works), [Limitations](/intercom/operations#limitations).
|
|
354
|
+
|
|
355
|
+
<div id="the-intercom-tool" />
|
|
356
|
+
|
|
357
|
+
<div id="actions" />
|
|
358
|
+
|
|
359
|
+
<div id="targeting-sessions" />
|
|
360
|
+
|
|
361
|
+
<div id="groups" />
|
|
362
|
+
|
|
363
|
+
<div id="send-vs-ask-vs-reply" />
|
|
364
|
+
|
|
365
|
+
<div id="attachments" />
|
|
366
|
+
|
|
367
|
+
<div id="configuration" />
|
|
349
368
|
|
|
350
369
|
- **Intercom reference:** [The intercom tool](/intercom/reference#the-intercom-tool), [Actions](/intercom/reference#actions), [Targeting sessions](/intercom/reference#targeting-sessions), [Groups](/intercom/reference#groups), [send vs ask vs reply](/intercom/reference#send-vs-ask-vs-reply), [Attachments](/intercom/reference#attachments), [Configuration](/intercom/reference#configuration).
|
package/docs/json.md
CHANGED
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "JSON event stream"
|
|
3
|
-
|
|
3
|
+
sidebarTitle: "JSON event stream"
|
|
4
|
+
description: "Run one or more prompts and parse Atomic session output as newline-delimited JSON events."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# JSON event stream mode
|
|
7
|
-
|
|
8
7
|
```bash
|
|
9
8
|
atomic --mode json "Your prompt"
|
|
10
9
|
```
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
JSON mode runs one or more positional prompts in sequence (`atomic --mode json "First prompt" "Second prompt"`), writes every session event as a JSON line to stdout, and exits. Use it for scripts, CI pipelines, and batch processors that do not need interactive follow-up commands.
|
|
12
|
+
|
|
13
|
+
Need to send follow-up commands to a live process or embed Atomic directly in Node.js? Compare JSON mode, [RPC mode](/rpc), and the [TypeScript SDK](/sdk) on [Programmatic integration](/programmatic).
|
|
14
|
+
|
|
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
|
+
|
|
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
|
+
|
|
19
|
+
## Output format
|
|
13
20
|
|
|
14
|
-
|
|
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):
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
```json
|
|
24
|
+
{"type":"session","version":4,"id":"uuid","createdAt":"2026-01-01T00:00:00.000Z","cwd":"/path"}
|
|
25
|
+
```
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
Session events follow as they occur:
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
```json
|
|
30
|
+
{"type":"agent_start"}
|
|
31
|
+
{"type":"turn_start"}
|
|
32
|
+
{"type":"message_start","message":{"role":"assistant","content":[]}}
|
|
33
|
+
{"type":"message_update","usage":{},"assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
|
|
34
|
+
{"type":"message_end","message":{"role":"assistant","content":[{"type":"text","text":"Hello"}]}}
|
|
35
|
+
{"type":"turn_end","message":{"role":"assistant","content":[{"type":"text","text":"Hello"}]},"toolResults":[]}
|
|
36
|
+
{"type":"agent_end","messages":[]}
|
|
37
|
+
```
|
|
25
38
|
|
|
26
|
-
|
|
39
|
+
Unlike RPC mode, JSON mode does not add `entryId` or `seq` fields to `message_end`.
|
|
40
|
+
|
|
41
|
+
### Streaming `message_update` wire format
|
|
42
|
+
|
|
43
|
+
On the wire, `message_update` omits large cumulative snapshots to keep streaming lines compact:
|
|
44
|
+
|
|
45
|
+
- The top-level `message` property is **stripped** on the wire (unlike the in-memory `AgentSessionEvent` delivered to SDK subscribers). Read final message content from `message_end`.
|
|
46
|
+
- `assistantMessageEvent.partial` is **stripped**.
|
|
47
|
+
- When `assistantMessageEvent.type` is `"toolcall_start"`, Atomic injects `id` and `toolName` directly on `assistantMessageEvent`.
|
|
48
|
+
- Top-level `usage` carries the latest cumulative provider-reported token usage (which may stay zero until completion if the provider reports usage only at the end).
|
|
49
|
+
- Top-level `endTurn` is included only when the provider reported an explicit end-of-turn signal (`AssistantMessage.endTurn` from `@bastani/atomic-ai`, such as OpenAI Codex `end_turn`).
|
|
50
|
+
|
|
51
|
+
A non-assistant message on `message_update` is treated as a protocol violation; Atomic throws an error instead of emitting fabricated usage.
|
|
27
52
|
|
|
28
53
|
## Event types
|
|
29
54
|
|
|
30
|
-
Events follow the `AgentSessionEvent`
|
|
55
|
+
Events follow the `AgentSessionEvent` union exported from `@bastani/atomic`, with the wire adjustments on `message_update` described above:
|
|
31
56
|
|
|
32
57
|
```typescript
|
|
33
58
|
type AgentSessionEvent =
|
|
@@ -61,93 +86,70 @@ type AgentSessionEvent =
|
|
|
61
86
|
| { type: "worktree_snapshot_unavailable"; reason: SerializedWorkspaceError };
|
|
62
87
|
```
|
|
63
88
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```json
|
|
67
|
-
{"type": "blueprint_build_finished", "sessionId": "...", "roots": ["/home/u/.atomic/agent/worktree-snapshots/worktrees/..."], "notices": [{"type": "warning", "message": "Partial build: ..."}]}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
While a resume waits for another Atomic process's build of the same worktree, Atomic emits `{"type": "blueprint_build_waiting", "root": "...", "message": "Waiting for ..."}` once. This line can arrive before the session header. `notices` holds the warnings that a waiting resume prints, and is empty when the build finished cleanly. In text mode (`-p`), the same warnings go to stderr as `Warning: ...` lines.
|
|
71
|
-
|
|
72
|
-
### Key session events
|
|
73
|
-
|
|
74
|
-
- `queue_update`: emits the full pending steering and follow-up queues whenever they change.
|
|
75
|
-
- `session_info_changed`, `model_changed`, and `thinking_level_changed`: report session metadata changes.
|
|
76
|
-
- `compaction_start` and `compaction_end`: cover manual and automatic compaction. `compaction_end.result.form` is `cleared` when the context window was cleared and `compacted` when a compactor model or an extension replaced it.
|
|
77
|
-
- `compaction_usage`: reports the usage of the compactor model's request when it returns, including for a run that later fails. A clear makes no model call.
|
|
78
|
-
- `child_session_usage`: reports one model call of a child session created by this session, such as a subagent, or of that child's own children.
|
|
79
|
-
- `agent_end` and `agent_settled`: `agent_end` closes one low-level agent run while retries, compaction recovery, or queued work may still continue. `agent_settled` means no automatic work remains for the session-level run, and `aborted` is `true` when the run was cancelled.
|
|
80
|
-
|
|
81
|
-
For automatic compaction, `compaction_end.willRetry === true` means the interrupted turn will retry, and `AgentSession.prompt()` waits for that continuation. This includes overflow and retry-worthy threshold recovery, such as output-token truncation or OpenAI Responses output-budget underflow. Generic `invalid_request_body` failures use `willRetry: false` when threshold compaction is warranted.
|
|
82
|
-
|
|
83
|
-
If the compact-and-retry attempt for an overflow is exhausted, `unresolvedOverflow: true` and `errorMessage` let integrations choose another model instead of treating the prompt as successful. Check `result` and `errorMessage` independently: both can be present when the boundary was saved but the follow-up request exceeded the provider's hard input limit.
|
|
84
|
-
|
|
85
|
-
Branch summaries reuse the configured retry policy for transient provider failures. Their `summarization_retry_*` events report scheduling, each restarted request, and retry-loop completion to JSON, RPC, SDK, and interactive consumers. Compaction does not retry its compactor request; a failure clears the context instead.
|
|
86
|
-
|
|
87
|
-
Base events come from `AgentEvent` in `@bastani/atomic-agent-core` (installed as an Atomic dependency):
|
|
89
|
+
Base events come from `AgentEvent` in `@bastani/atomic-agent-core`:
|
|
88
90
|
|
|
89
91
|
```typescript
|
|
90
92
|
type AgentEvent =
|
|
91
|
-
// Agent lifecycle
|
|
92
93
|
| { type: "agent_start" }
|
|
93
94
|
| { type: "agent_end"; messages: AgentMessage[] }
|
|
94
|
-
// Turn lifecycle
|
|
95
95
|
| { type: "turn_start" }
|
|
96
96
|
| { type: "turn_end"; message: AgentMessage; toolResults: ToolResultMessage[] }
|
|
97
|
-
// Message lifecycle
|
|
98
97
|
| { type: "message_start"; message: AgentMessage }
|
|
99
98
|
| { type: "message_update"; message: AgentMessage; assistantMessageEvent: AssistantMessageEvent }
|
|
100
99
|
| { type: "message_end"; message: AgentMessage }
|
|
101
|
-
|
|
102
|
-
| { type: "
|
|
103
|
-
| { type: "
|
|
104
|
-
| { type: "tool_execution_end"; toolCallId: string; toolName: string; result: any; isError: boolean; durationMs?: number };
|
|
100
|
+
| { type: "tool_execution_start"; toolCallId: string; toolName: string; args: unknown }
|
|
101
|
+
| { type: "tool_execution_update"; toolCallId: string; toolName: string; args: unknown; partialResult: unknown }
|
|
102
|
+
| { type: "tool_execution_end"; toolCallId: string; toolName: string; result: unknown; isError: boolean; durationMs?: number };
|
|
105
103
|
```
|
|
106
104
|
|
|
107
|
-
Final assistant and tool
|
|
105
|
+
Final assistant messages and tool results include optional `durationMs` timing. On `tool_execution_end`, `durationMs` records how long the tool's `execute()` ran using a monotonic clock and is omitted when the tool did not execute.
|
|
106
|
+
|
|
107
|
+
### Key session events
|
|
108
|
+
|
|
109
|
+
- `queue_update`: reports the full pending steering and follow-up queues whenever they change.
|
|
110
|
+
- `session_info_changed`, `model_changed`, and `thinking_level_changed`: report session metadata updates.
|
|
111
|
+
- `compaction_start` and `compaction_end`: bracket manual and automatic compaction. `compaction_end.result.form` is `"cleared"` when the context window was cleared and `"compacted"` when a compactor model or extension replaced it.
|
|
112
|
+
- `compaction_usage`: reports compactor model token usage when the request returns, even if the run later fails. Clearing context makes no model call.
|
|
113
|
+
- `child_session_usage`: reports one model call made by a child session (such as a subagent or nested subagent).
|
|
114
|
+
- `agent_end` and `agent_settled`: `agent_end` finishes one low-level agent loop while retries, compaction recovery, or queued messages may still continue. `agent_settled` fires once no automatic work remains, with `aborted: true` if cancelled.
|
|
115
|
+
- `blueprint_build_waiting` and `blueprint_build_finished`: emitted when resuming a session whose worktree blueprint build is running in the background (see [Start the first turn while the build runs](/guides/resume-on-any-machine#start-the-first-turn-while-the-build-runs)).
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{"type":"blueprint_build_waiting","root":"...","message":"Waiting for ..."}
|
|
119
|
+
{"type":"blueprint_build_finished","sessionId":"...","roots":["/home/u/.atomic/agent/worktree-snapshots/worktrees/..."],"notices":[{"type":"warning","message":"Partial build: ..."}]}
|
|
120
|
+
```
|
|
108
121
|
|
|
109
|
-
|
|
122
|
+
`blueprint_build_waiting` can arrive before the session header when waiting on another process's build of the same worktree. `notices` is empty when the build completes cleanly (in `-p` text mode, those warnings go to stderr as `Warning: ...`).
|
|
110
123
|
|
|
111
|
-
-
|
|
112
|
-
- The latest cumulative provider-reported `usage`. This may remain zero until completion if the provider reports usage only at the end.
|
|
113
|
-
- `endTurn`, only when the provider reported it. This is the provider's explicit end-of-turn signal (`AssistantMessage.endTurn` from `@bastani/atomic-ai`), for example OpenAI Codex `end_turn`.
|
|
124
|
+
For automatic compaction, `compaction_end.willRetry: true` indicates Atomic will automatically retry the interrupted turn (such as after context overflow or recoverable output truncation). When a non-retryable request error triggers threshold compaction, `willRetry` is `false`. If overflow recovery is exhausted, `unresolvedOverflow: true` and `errorMessage` are set; check `result` and `errorMessage` independently because both can be present when a compaction boundary was saved before the follow-up request still exceeded the provider's input limit.
|
|
114
125
|
|
|
115
|
-
|
|
126
|
+
Branch summaries use the configured retry policy for transient provider errors and emit `summarization_retry_*` events. Compaction does not retry its compactor call and clears context instead if it fails.
|
|
116
127
|
|
|
117
128
|
## Message types
|
|
118
129
|
|
|
119
|
-
Base messages come from `@bastani/atomic-ai
|
|
130
|
+
Base messages come from `@bastani/atomic-ai`:
|
|
131
|
+
|
|
120
132
|
- `UserMessage`
|
|
121
133
|
- `AssistantMessage`
|
|
122
134
|
- `ToolResultMessage`
|
|
123
135
|
|
|
124
|
-
Importing `@bastani/atomic` augments `AgentMessage`
|
|
136
|
+
Importing `@bastani/atomic` augments `AgentMessage` with Atomic's extended roles (documented in [RPC protocol types](/rpc/protocol#types)):
|
|
137
|
+
|
|
125
138
|
- `BashExecutionMessage`
|
|
126
139
|
- `CustomMessage`
|
|
127
140
|
- `BranchSummaryMessage`
|
|
128
141
|
|
|
129
|
-
##
|
|
130
|
-
|
|
131
|
-
Each line is a JSON object. The first line is the session header:
|
|
132
|
-
|
|
133
|
-
```json
|
|
134
|
-
{"type":"session","version":4,"id":"uuid","timestamp":"...","cwd":"/path"}
|
|
135
|
-
```
|
|
142
|
+
## Exit codes and signals
|
|
136
143
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{"type":"turn_start"}
|
|
142
|
-
{"type":"message_start","message":{"role":"assistant","content":[],...}}
|
|
143
|
-
{"type":"message_update","usage":{...},"assistantMessageEvent":{"type":"text_delta","delta":"Hello",...}}
|
|
144
|
-
{"type":"message_end","message":{...}}
|
|
145
|
-
{"type":"turn_end","message":{...},"toolResults":[]}
|
|
146
|
-
{"type":"agent_end","messages":[...]}
|
|
147
|
-
```
|
|
144
|
+
- **Exit `0`**: all prompts finished without fatal errors. Unlike `-p` text mode, an assistant response ending with `stopReason: "length"` still exits `0` in JSON mode.
|
|
145
|
+
- **Exit `1`**: configuration diagnostic for an unsupported provider, extension command failure, session persistence or claim conflict, final assistant `stopReason` of `"error"` or `"aborted"`, or an uncaught error.
|
|
146
|
+
- **Signals**: `SIGINT` exits with `130`, `SIGTERM` exits with `143`, and `SIGHUP` exits with `129` (skipped on Windows and when started with `SIGHUP` ignored, such as under `nohup`). A second signal forces immediate exit.
|
|
147
|
+
- **Background worktree builds**: JSON mode waits for in-progress blueprint builds to settle before exiting.
|
|
148
148
|
|
|
149
149
|
## Example
|
|
150
150
|
|
|
151
|
+
Filter completed messages with `jq`:
|
|
152
|
+
|
|
151
153
|
```bash
|
|
152
154
|
atomic --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
|
|
153
155
|
```
|