@bastani/atomic 0.10.9 → 0.10.10-alpha.1
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 +57 -0
- package/README.md +211 -155
- 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} +145 -58
- 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 +85 -114
- 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 +37 -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 +71 -138
- 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 +60 -87
- 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 +235 -243
- package/docs/build.md +12 -11
- package/docs/codemode.md +60 -51
- package/docs/compaction/reference.md +61 -24
- package/docs/compaction.md +117 -65
- package/docs/computer-use.md +179 -146
- package/docs/containerization.md +79 -33
- package/docs/custom-provider/api-reference.md +148 -11
- package/docs/custom-provider/oauth.md +44 -27
- package/docs/custom-provider/override.md +14 -7
- package/docs/custom-provider/registration.md +75 -65
- package/docs/custom-provider/streaming.md +42 -19
- package/docs/custom-provider.md +25 -61
- package/docs/development.md +47 -43
- package/docs/docs.json +33 -33
- package/docs/environment-variables.md +83 -57
- package/docs/extensions/api-reference.md +323 -734
- 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 +152 -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 +42 -20
- package/docs/guides/intercom.md +17 -13
- package/docs/guides/non-interactive.md +29 -16
- package/docs/guides/orchestration.md +16 -10
- package/docs/guides/resume-on-any-machine.md +54 -49
- package/docs/guides/subagents.md +22 -14
- package/docs/guides/team-setup.md +37 -26
- package/docs/guides.md +22 -21
- package/docs/herdr.md +21 -16
- package/docs/index.md +16 -17
- package/docs/intercom/operations.md +68 -66
- package/docs/intercom/reference.md +196 -191
- package/docs/intercom.md +103 -92
- package/docs/json.md +71 -71
- package/docs/keybindings.md +63 -50
- package/docs/libraries/agent-core.md +49 -8
- package/docs/libraries/ai.md +21 -12
- package/docs/libraries/codemode.md +28 -6
- package/docs/libraries/schema.md +7 -7
- package/docs/libraries/telemetry.md +7 -7
- package/docs/libraries/tui.md +74 -94
- package/docs/libraries.md +5 -5
- package/docs/llama-cpp.md +38 -33
- package/docs/mcp-servers.md +96 -90
- package/docs/models/reference.md +46 -33
- package/docs/models-configuration.md +12 -6
- package/docs/models.md +93 -88
- package/docs/orchestration/migrating-workflows.md +21 -19
- package/docs/orchestration/patterns.md +35 -20
- package/docs/orchestration.md +22 -21
- package/docs/packages/authoring.md +28 -19
- package/docs/packages/reference.md +75 -16
- package/docs/packages.md +31 -33
- package/docs/programmatic.md +22 -21
- package/docs/prompt-templates.md +63 -41
- package/docs/providers/reference.md +35 -19
- package/docs/providers.md +61 -71
- package/docs/quickstart.md +32 -46
- package/docs/reference/cli.md +249 -252
- package/docs/reference.md +23 -20
- package/docs/rpc/examples.md +74 -17
- package/docs/rpc/extension-ui.md +79 -62
- package/docs/rpc/protocol.md +816 -358
- package/docs/rpc.md +75 -151
- package/docs/sdk/reference.md +175 -45
- package/docs/sdk/structured-decisions.md +92 -62
- package/docs/sdk/web-server.md +79 -46
- package/docs/sdk.md +237 -195
- package/docs/security.md +106 -43
- package/docs/session-format.md +96 -59
- package/docs/sessions.md +149 -113
- package/docs/settings.md +289 -204
- 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 +104 -97
- package/docs/storage.md +140 -242
- package/docs/subagents/authoring.md +147 -16
- package/docs/subagents/reference.md +100 -30
- package/docs/subagents.md +220 -252
- package/docs/terminal-setup.md +97 -69
- package/docs/termux.md +51 -85
- package/docs/themes/reference.md +51 -37
- package/docs/themes.md +49 -54
- package/docs/tmux.md +38 -21
- package/docs/tools.md +198 -147
- package/docs/tui/reference.md +64 -32
- package/docs/tui.md +38 -66
- package/docs/usage.md +76 -78
- package/docs/verification.md +25 -25
- package/docs/web-access.md +72 -55
- package/docs/windows.md +53 -58
- package/docs/worktree-snapshots.md +62 -65
- package/package.json +8 -8
- package/schemas/models.schema.json +51 -0
- 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,32 @@
|
|
|
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. You can send context, findings, or requests yourself, or let agents coordinate directly. No separate install is required.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
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.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Print (`-p`), JSON, RPC, and SDK sessions join when you or the model first use Intercom, or when they launch a subagent with Intercom. Interactive sessions do the same when startup join is off, either because `ATOMIC_INTERCOM_JOIN_AT_STARTUP=0` is set or because `joinAtStartup` is `false` in Intercom's [configuration](/intercom/reference#configuration) without `ATOMIC_INTERCOM_JOIN_AT_STARTUP=1`. A subagent launched with Intercom joins as soon as its session starts and inherits the launching session's group unless the launch sets `group`.
|
|
11
|
+
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
12
|
|
|
14
13
|
**Key capabilities:**
|
|
15
14
|
|
|
16
15
|
- **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.
|
|
16
|
+
- **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.
|
|
17
|
+
- **Session and group discovery.** List connected sessions or every active group with session counts and membership markers.
|
|
18
|
+
- **Keyboard overlay.** Press `Alt+M` or run `/intercom` to pick a session and compose a message.
|
|
21
19
|
- **Attachments.** Share `file`, `snippet`, and `context` payloads between sessions.
|
|
22
|
-
- **Subagent escalation.**
|
|
23
|
-
- **Run notifications.** Subagents deliver run results and
|
|
20
|
+
- **Subagent escalation.** Subagents receive `contact_supervisor` for decisions, structured interviews, and progress updates.
|
|
21
|
+
- **Run notifications.** Subagents deliver run results and activity notices to their launching session over Intercom.
|
|
24
22
|
- **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
24
|
|
|
26
|
-
**
|
|
25
|
+
**Common use cases:**
|
|
27
26
|
|
|
28
27
|
- Planner and worker splits across two terminals.
|
|
29
|
-
- Research
|
|
30
|
-
- Supervisor decisions and structured interviews for
|
|
28
|
+
- Research-to-implementation context handoffs.
|
|
29
|
+
- Supervisor decisions and structured interviews for subagents.
|
|
31
30
|
- Peer-to-peer coordination across parallel subagents.
|
|
32
31
|
- Pair debugging between sessions.
|
|
33
32
|
|
|
@@ -35,19 +34,19 @@ Print (`-p`), JSON, RPC, and SDK sessions join when you or the model first use I
|
|
|
35
34
|
|
|
36
35
|
Read this page for the quick start, coordination patterns, and supervisor escalation. Then continue to:
|
|
37
36
|
|
|
38
|
-
- [Intercom
|
|
37
|
+
- [Operate Intercom](/intercom/operations) for connection lifecycles, delivery recovery, broker upgrades, and troubleshooting.
|
|
39
38
|
- [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
|
+
- [Intercom reference](/intercom/reference) for the `intercom` tool contract, targeting rules, error classes, and every Intercom setting.
|
|
41
40
|
|
|
42
41
|
## Quick start
|
|
43
42
|
|
|
44
43
|
### From the keyboard
|
|
45
44
|
|
|
46
|
-
Press
|
|
45
|
+
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
46
|
|
|
48
47
|
1. **Select a session.** Use arrow keys to choose a target session.
|
|
49
48
|
2. **Compose a message.** Type your message in the compose overlay.
|
|
50
|
-
3. **Send.** Press Enter to send or
|
|
49
|
+
3. **Send.** Press `Enter` to send or `Esc` to cancel.
|
|
51
50
|
|
|
52
51
|
Sent messages are recorded in session history and confirmed with a notification.
|
|
53
52
|
|
|
@@ -119,31 +118,31 @@ Found the issue: UserService.validate() does not check for null input.
|
|
|
119
118
|
See auth.ts:142-156.
|
|
120
119
|
```
|
|
121
120
|
|
|
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
|
|
121
|
+
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
122
|
|
|
124
123
|
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
124
|
|
|
126
|
-
Messages from a sender that is gone are recorded once in full without starting a turn. Messages whose sender cannot be checked yet
|
|
125
|
+
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
126
|
|
|
128
|
-
Working subagents
|
|
127
|
+
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
128
|
|
|
130
|
-
| `delivery` | When a
|
|
129
|
+
| `delivery` | When a working subagent receives it | Use it for |
|
|
131
130
|
| --- | --- | --- |
|
|
132
131
|
| `"steer"` (default) | After its current tool calls finish. Current work is not cancelled. | Ordinary coordination, findings, and updates |
|
|
133
|
-
| `"followUp"` | After the
|
|
132
|
+
| `"followUp"` | After the subagent finishes and stops. | Low-priority notes or follow-up tasks |
|
|
134
133
|
| `"interrupt"` | Immediately. Current model call or cancellable tool call is cancelled, then the message runs next. | Urgent corrections or stop orders |
|
|
135
134
|
|
|
136
|
-
Any sender can set `delivery` per
|
|
135
|
+
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
136
|
|
|
138
|
-
Messages from one sender always reach the recipient in arrival order, whether
|
|
137
|
+
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
138
|
|
|
140
139
|
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
140
|
|
|
142
141
|
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
142
|
|
|
144
|
-
A busy non-interactive recipient
|
|
143
|
+
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
144
|
|
|
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.
|
|
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.
|
|
147
146
|
|
|
148
147
|
## Coordination patterns
|
|
149
148
|
|
|
@@ -179,7 +178,7 @@ intercom({
|
|
|
179
178
|
| Pattern | Action | Why |
|
|
180
179
|
| --- | --- | --- |
|
|
181
180
|
| **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
|
|
181
|
+
| **Clarification request** | Worker uses `ask` | Worker needs an answer to proceed and keeps working on unblocked tasks until the reply arrives. |
|
|
183
182
|
| **Discovery escalation** | Worker uses `ask` | Worker requests approval before changing direction. |
|
|
184
183
|
| **Completion report** | Worker uses `ask` | Planner may have follow-up instructions or the next task. |
|
|
185
184
|
| **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 +206,27 @@ Coordinate with other local Atomic sessions on related codebases. Use `/skill:in
|
|
|
207
206
|
</intercom>
|
|
208
207
|
```
|
|
209
208
|
|
|
210
|
-
##
|
|
211
|
-
|
|
212
|
-
When Atomic's [subagent runtime](/subagents) launches a delegated child with supervisor coordination enabled, that child receives the subagent-only `contact_supervisor` tool alongside `intercom`. Normal sessions never see `contact_supervisor`.
|
|
209
|
+
## Escalate subagent decisions with `contact_supervisor`
|
|
213
210
|
|
|
214
|
-
|
|
211
|
+
By default (`intercomBridge.mode: "always"` in `~/.atomic/agent/extensions/subagent/config.json`), 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`.
|
|
215
212
|
|
|
216
|
-
`
|
|
213
|
+
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.
|
|
217
214
|
|
|
218
|
-
|
|
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.
|
|
215
|
+
### Parameters and reasons
|
|
221
216
|
|
|
222
217
|
| Parameter | Type | Description |
|
|
223
218
|
| --- | --- | --- |
|
|
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
|
|
219
|
+
| `reason` | string | `"need_decision"` (blocking), `"interview_request"` (blocking structured questions), or `"progress_update"` (fire-and-forget). |
|
|
220
|
+
| `message` | string | Required for `progress_update`; strongly recommended for `need_decision` (an omitted `message` sends an empty question); optional note for `interview_request`. |
|
|
221
|
+
| `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }`. |
|
|
229
222
|
|
|
230
223
|
| Reason | Behavior | Use when |
|
|
231
224
|
| --- | --- | --- |
|
|
232
|
-
| `need_decision` |
|
|
233
|
-
| `interview_request` |
|
|
234
|
-
| `progress_update` | Fire-and-forget update to the supervisor.
|
|
225
|
+
| `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. |
|
|
226
|
+
| `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. |
|
|
227
|
+
| `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
228
|
|
|
236
|
-
Do not use `contact_supervisor` for routine completion handoffs; return the final subagent result normally.
|
|
229
|
+
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
230
|
|
|
238
231
|
```typescript
|
|
239
232
|
// Blocked subagent asks for guidance
|
|
@@ -241,8 +234,6 @@ contact_supervisor({
|
|
|
241
234
|
reason: "need_decision",
|
|
242
235
|
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
236
|
})
|
|
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
237
|
|
|
247
238
|
// Fire-and-forget progress update
|
|
248
239
|
contact_supervisor({
|
|
@@ -252,28 +243,18 @@ contact_supervisor({
|
|
|
252
243
|
// Output: Progress update sent to supervisor planner
|
|
253
244
|
```
|
|
254
245
|
|
|
255
|
-
###
|
|
246
|
+
### Answering a subagent as the supervisor
|
|
256
247
|
|
|
257
|
-
|
|
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?
|
|
266
|
-
|
|
267
|
-
Start a fresh subagent with a new run identity, replacing <SUPERVISOR_ANSWER> with your answer:
|
|
268
|
-
subagent({
|
|
269
|
-
"agent": "worker",
|
|
270
|
-
"task": "[TASK_CONTEXT] ... Continue with this supervisor answer: <SUPERVISOR_ANSWER>"
|
|
271
|
-
})
|
|
272
|
-
```
|
|
248
|
+
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
249
|
|
|
274
250
|
### Structured interview replies
|
|
275
251
|
|
|
276
|
-
`interview_request` questions use
|
|
252
|
+
`interview_request` questions use `{ id, type, question, options?, context? }`:
|
|
253
|
+
|
|
254
|
+
- `questions` must be a non-empty array with unique, non-empty `id` strings.
|
|
255
|
+
- `type` must be `"single"`, `"multi"`, `"text"`, `"image"`, or `"info"` (`info` items provide context only and need no answer).
|
|
256
|
+
- `options` is **required** (non-empty array of strings or `{ label: string }` objects) for `single` and `multi`, and **rejected** for `text`, `image`, and `info`.
|
|
257
|
+
- `message` is optional.
|
|
277
258
|
|
|
278
259
|
```typescript
|
|
279
260
|
contact_supervisor({
|
|
@@ -289,7 +270,7 @@ contact_supervisor({
|
|
|
289
270
|
})
|
|
290
271
|
```
|
|
291
272
|
|
|
292
|
-
|
|
273
|
+
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
274
|
|
|
294
275
|
```json
|
|
295
276
|
{
|
|
@@ -300,13 +281,30 @@ In normal task-host runs, questions arrive without reordering or rewriting. The
|
|
|
300
281
|
}
|
|
301
282
|
```
|
|
302
283
|
|
|
303
|
-
The
|
|
284
|
+
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.
|
|
285
|
+
|
|
286
|
+
### Embedded SDK sessions without background task management
|
|
287
|
+
|
|
288
|
+
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:
|
|
289
|
+
|
|
290
|
+
```text
|
|
291
|
+
Subagent yielded for parent input (worker, child 1).
|
|
292
|
+
Previous run (terminal): 78f659a3
|
|
293
|
+
Question:
|
|
294
|
+
Which API should I use?
|
|
295
|
+
|
|
296
|
+
Start a fresh subagent with a new run identity, replacing <SUPERVISOR_ANSWER> with your answer:
|
|
297
|
+
subagent({
|
|
298
|
+
"agent": "worker",
|
|
299
|
+
"task": "[TASK_CONTEXT] ... Continue with this supervisor answer: <SUPERVISOR_ANSWER>"
|
|
300
|
+
})
|
|
301
|
+
```
|
|
304
302
|
|
|
305
303
|
## Mixed versions
|
|
306
304
|
|
|
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)
|
|
305
|
+
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
306
|
|
|
309
|
-
## Intercom vs shared-room messengers
|
|
307
|
+
## Intercom vs. shared-room messengers
|
|
310
308
|
|
|
311
309
|
| Aspect | Intercom | Shared-room messengers |
|
|
312
310
|
| --- | --- | --- |
|
|
@@ -320,31 +318,44 @@ Use Intercom for coordinating your own sessions and for peer-to-peer agent swarm
|
|
|
320
318
|
|
|
321
319
|
## Related docs
|
|
322
320
|
|
|
323
|
-
- [
|
|
324
|
-
- [
|
|
321
|
+
- [Run subagents](/subagents) for delegated subagent runs, supervisor coordination, and result delivery.
|
|
322
|
+
- [Orchestrate with codemode and subagents](/orchestration) for multi-step tasks and completion notices.
|
|
325
323
|
- [Skills](/skills) for reusable instructions like `/skill:intercom`.
|
|
326
324
|
- [Environment variables](/environment-variables) for Intercom environment variables.
|
|
327
|
-
- [Interactive use](/usage) for interactive commands and
|
|
325
|
+
- [Interactive use](/usage) for interactive commands and bundled extensions.
|
|
328
326
|
|
|
329
327
|
## Moved sections
|
|
330
328
|
|
|
331
|
-
<
|
|
332
|
-
|
|
333
|
-
<
|
|
334
|
-
|
|
335
|
-
<
|
|
336
|
-
|
|
337
|
-
<
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
<
|
|
344
|
-
|
|
345
|
-
<
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
329
|
+
<div id="how-connection-works" />
|
|
330
|
+
|
|
331
|
+
<div id="troubleshooting-initialization" />
|
|
332
|
+
|
|
333
|
+
<div id="subagent-notifications" />
|
|
334
|
+
|
|
335
|
+
<div id="subagent-control-notices" />
|
|
336
|
+
|
|
337
|
+
<div id="delivery-ordering" />
|
|
338
|
+
|
|
339
|
+
<div id="keyboard-shortcuts" />
|
|
340
|
+
|
|
341
|
+
<div id="how-it-works" />
|
|
342
|
+
|
|
343
|
+
<div id="limitations" />
|
|
344
|
+
|
|
345
|
+
- **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).
|
|
346
|
+
|
|
347
|
+
<div id="the-intercom-tool" />
|
|
348
|
+
|
|
349
|
+
<div id="actions" />
|
|
350
|
+
|
|
351
|
+
<div id="targeting-sessions" />
|
|
352
|
+
|
|
353
|
+
<div id="groups" />
|
|
354
|
+
|
|
355
|
+
<div id="send-vs-ask-vs-reply" />
|
|
356
|
+
|
|
357
|
+
<div id="attachments" />
|
|
358
|
+
|
|
359
|
+
<div id="configuration" />
|
|
349
360
|
|
|
350
361
|
- **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,56 @@
|
|
|
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
|
+
## Output format
|
|
18
|
+
|
|
19
|
+
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):
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
```json
|
|
22
|
+
{"type":"session","version":4,"id":"uuid","createdAt":"2026-01-01T00:00:00.000Z","cwd":"/path"}
|
|
23
|
+
```
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
Session events follow as they occur:
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
```json
|
|
28
|
+
{"type":"agent_start"}
|
|
29
|
+
{"type":"turn_start"}
|
|
30
|
+
{"type":"message_start","message":{"role":"assistant","content":[]}}
|
|
31
|
+
{"type":"message_update","usage":{},"assistantMessageEvent":{"type":"text_delta","contentIndex":0,"delta":"Hello"}}
|
|
32
|
+
{"type":"message_end","message":{"role":"assistant","content":[{"type":"text","text":"Hello"}]}}
|
|
33
|
+
{"type":"turn_end","message":{"role":"assistant","content":[{"type":"text","text":"Hello"}]},"toolResults":[]}
|
|
34
|
+
{"type":"agent_end","messages":[]}
|
|
35
|
+
```
|
|
19
36
|
|
|
20
|
-
|
|
21
|
-
| --- | --- | --- |
|
|
22
|
-
| One prompt, structured output, then exit | **JSON event stream mode** (this page) | One process, one prompt, newline-delimited events on stdout. Nothing to keep alive. |
|
|
23
|
-
| A long-lived process you send more input to | [RPC mode](/rpc) | Send further prompts, interrupt, switch models, and answer extension UI dialogs and OAuth prompts on a live process. |
|
|
24
|
-
| Atomic embedded inside a Node.js application | [SDK](/sdk) | The same engine as a library, with programmatic control over extensions, skills, tools, and session storage. |
|
|
37
|
+
Unlike RPC mode, JSON mode does not add `entryId` or `seq` fields to `message_end`.
|
|
25
38
|
|
|
26
|
-
|
|
39
|
+
### Streaming `message_update` wire format
|
|
40
|
+
|
|
41
|
+
On the wire, `message_update` omits large cumulative snapshots to keep streaming lines compact:
|
|
42
|
+
|
|
43
|
+
- 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`.
|
|
44
|
+
- `assistantMessageEvent.partial` is **stripped**.
|
|
45
|
+
- When `assistantMessageEvent.type` is `"toolcall_start"`, Atomic injects `id` and `toolName` directly on `assistantMessageEvent`.
|
|
46
|
+
- 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).
|
|
47
|
+
- 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`).
|
|
48
|
+
|
|
49
|
+
A non-assistant message on `message_update` is treated as a protocol violation; Atomic throws an error instead of emitting fabricated usage.
|
|
27
50
|
|
|
28
51
|
## Event types
|
|
29
52
|
|
|
30
|
-
Events follow the `AgentSessionEvent`
|
|
53
|
+
Events follow the `AgentSessionEvent` union exported from `@bastani/atomic`, with the wire adjustments on `message_update` described above:
|
|
31
54
|
|
|
32
55
|
```typescript
|
|
33
56
|
type AgentSessionEvent =
|
|
@@ -61,93 +84,70 @@ type AgentSessionEvent =
|
|
|
61
84
|
| { type: "worktree_snapshot_unavailable"; reason: SerializedWorkspaceError };
|
|
62
85
|
```
|
|
63
86
|
|
|
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):
|
|
87
|
+
Base events come from `AgentEvent` in `@bastani/atomic-agent-core`:
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
90
|
type AgentEvent =
|
|
91
|
-
// Agent lifecycle
|
|
92
91
|
| { type: "agent_start" }
|
|
93
92
|
| { type: "agent_end"; messages: AgentMessage[] }
|
|
94
|
-
// Turn lifecycle
|
|
95
93
|
| { type: "turn_start" }
|
|
96
94
|
| { type: "turn_end"; message: AgentMessage; toolResults: ToolResultMessage[] }
|
|
97
|
-
// Message lifecycle
|
|
98
95
|
| { type: "message_start"; message: AgentMessage }
|
|
99
96
|
| { type: "message_update"; message: AgentMessage; assistantMessageEvent: AssistantMessageEvent }
|
|
100
97
|
| { 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 };
|
|
98
|
+
| { type: "tool_execution_start"; toolCallId: string; toolName: string; args: unknown }
|
|
99
|
+
| { type: "tool_execution_update"; toolCallId: string; toolName: string; args: unknown; partialResult: unknown }
|
|
100
|
+
| { type: "tool_execution_end"; toolCallId: string; toolName: string; result: unknown; isError: boolean; durationMs?: number };
|
|
105
101
|
```
|
|
106
102
|
|
|
107
|
-
Final assistant and tool
|
|
103
|
+
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.
|
|
108
104
|
|
|
109
|
-
|
|
105
|
+
### Key session events
|
|
110
106
|
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
- `
|
|
107
|
+
- `queue_update`: reports the full pending steering and follow-up queues whenever they change.
|
|
108
|
+
- `session_info_changed`, `model_changed`, and `thinking_level_changed`: report session metadata updates.
|
|
109
|
+
- `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.
|
|
110
|
+
- `compaction_usage`: reports compactor model token usage when the request returns, even if the run later fails. Clearing context makes no model call.
|
|
111
|
+
- `child_session_usage`: reports one model call made by a child session (such as a subagent or nested subagent).
|
|
112
|
+
- `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.
|
|
113
|
+
- `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)).
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
```json
|
|
116
|
+
{"type":"blueprint_build_waiting","root":"...","message":"Waiting for ..."}
|
|
117
|
+
{"type":"blueprint_build_finished","sessionId":"...","roots":["/home/u/.atomic/agent/worktree-snapshots/worktrees/..."],"notices":[{"type":"warning","message":"Partial build: ..."}]}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`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: ...`).
|
|
121
|
+
|
|
122
|
+
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.
|
|
123
|
+
|
|
124
|
+
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
125
|
|
|
117
126
|
## Message types
|
|
118
127
|
|
|
119
|
-
Base messages come from `@bastani/atomic-ai
|
|
128
|
+
Base messages come from `@bastani/atomic-ai`:
|
|
129
|
+
|
|
120
130
|
- `UserMessage`
|
|
121
131
|
- `AssistantMessage`
|
|
122
132
|
- `ToolResultMessage`
|
|
123
133
|
|
|
124
|
-
Importing `@bastani/atomic` augments `AgentMessage`
|
|
134
|
+
Importing `@bastani/atomic` augments `AgentMessage` with Atomic's extended roles (documented in [RPC protocol types](/rpc/protocol#types)):
|
|
135
|
+
|
|
125
136
|
- `BashExecutionMessage`
|
|
126
137
|
- `CustomMessage`
|
|
127
138
|
- `BranchSummaryMessage`
|
|
128
139
|
|
|
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
|
-
```
|
|
140
|
+
## Exit codes and signals
|
|
136
141
|
|
|
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
|
-
```
|
|
142
|
+
- **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.
|
|
143
|
+
- **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.
|
|
144
|
+
- **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.
|
|
145
|
+
- **Background worktree builds**: JSON mode waits for in-progress blueprint builds to settle before exiting.
|
|
148
146
|
|
|
149
147
|
## Example
|
|
150
148
|
|
|
149
|
+
Filter completed messages with `jq`:
|
|
150
|
+
|
|
151
151
|
```bash
|
|
152
152
|
atomic --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
|
|
153
153
|
```
|