@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/keybindings.md
CHANGED
|
@@ -1,34 +1,57 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Keybindings"
|
|
3
|
-
|
|
3
|
+
sidebarTitle: "Keybindings"
|
|
4
|
+
description: "Default keyboard shortcuts and custom ~/.atomic/agent/keybindings.json configuration rules."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
Customize keyboard shortcuts in `~/.atomic/agent/keybindings.json` (relocated by `ATOMIC_CODING_AGENT_DIR`; see [Environment variables](/environment-variables)). Run `/reload` after editing the file to apply changes without restarting. Add `"$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/schemas/keybindings.schema.json"` for editor completion and validation (Atomic ignores `$schema` at load time). See [Interactive mode](/usage) for editor and queue workflows, and [tmux setup](/tmux) if `Shift+Enter` or `Escape` behaves unexpectedly inside tmux.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
## Key format
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Write keys as `modifier+key` using any combination of `ctrl`, `shift`, `alt`, and `super`:
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
- **Letters:** `a` to `z`
|
|
14
|
+
- **Digits:** `0` to `9`
|
|
15
|
+
- **Special:** `escape`, `esc`, `enter`, `return`, `tab`, `space`, `backspace`, `delete`, `insert`, `clear`, `home`, `end`, `pageUp`, `pageDown`, `up`, `down`, `left`, `right`
|
|
16
|
+
- **Function:** `f1` to `f12`
|
|
17
|
+
- **Symbols:** `` ` ``, `-`, `=`, `[`, `]`, `\`, `;`, `'`, `,`, `.`, `/`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `|`, `~`, `{`, `}`, `:`, `<`, `>`, `?`
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
Examples: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+super+x`, `ctrl+1`, `ctrl++`. Support for `super` depends on your terminal.
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
**Key syntax rules:**
|
|
17
22
|
|
|
18
|
-
- **
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- **Symbols.** `` ` ``, `-`, `=`, `[`, `]`, `\`, `;`, `'`, `,`, `.`, `/`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `|`, `~`, `{`, `}`, `:`, `<`, `>`, `?`
|
|
23
|
+
- Key names and modifiers are **case-insensitive** (`pageUp` and `pageup`, `CTRL+P` and `ctrl+p` are equivalent).
|
|
24
|
+
- Modifier order does not matter (`ctrl+shift+p` and `shift+ctrl+p` are equivalent), but duplicate modifiers (such as `ctrl+ctrl+x`) are invalid and never match.
|
|
25
|
+
- **`escape` and `esc` never match with any modifier.** Bind plain `escape` or `esc` only.
|
|
26
|
+
- Binding `+` with modifiers works (`ctrl++`, `alt++`).
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
## Custom configuration
|
|
29
|
+
|
|
30
|
+
Create `~/.atomic/agent/keybindings.json`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/schemas/keybindings.schema.json",
|
|
35
|
+
"tui.editor.historyPrevious": "ctrl+p",
|
|
36
|
+
"tui.editor.historyNext": "ctrl+n",
|
|
37
|
+
"tui.editor.deleteWordBackward": ["ctrl+w", "alt+backspace"],
|
|
38
|
+
"app.model.cycleForward": []
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Configuration rules:**
|
|
43
|
+
|
|
44
|
+
- **Replacement semantics:** Setting an action in `keybindings.json` **completely replaces** its default keys rather than appending to them. Pass an array to keep defaults alongside a new key, or pass `[]` to unbind the action.
|
|
45
|
+
- **Invalid config fallback:** Malformed JSON or a non-object top-level value is silently ignored and all defaults apply with no warning. Unknown action IDs, entries whose value is not a string or string array, and unrecognized key strings are also silently ignored.
|
|
46
|
+
- **Legacy migration:** If your file contains older pre-namespaced action names (such as `cursorUp`, `expandTools`, `app.tasks.inspect`, or `app.tasks.cancel`), Atomic migrates them automatically on startup and **rewrites `~/.atomic/agent/keybindings.json` in place** (sorting known keys and dropping any legacy key whose current namespaced equivalent is already present).
|
|
47
|
+
- **Windows and WSL defaults:** WSL defaults apply on Linux whenever `WSL_DISTRO_NAME` or `WSL_INTEROP` is set. On native Windows, `app.suspend` defaults to `alt+z` and opens an interactive PowerShell subshell (leaving `ctrl+z` for editor undo; type `exit` to return while background tasks keep running). On WSL, standard Linux `ctrl+z`/`fg` suspension applies and `tui.editor.undo` defaults to `alt+z`. See [Windows](/windows).
|
|
25
48
|
|
|
26
49
|
## All actions
|
|
27
50
|
|
|
28
51
|
### TUI editor cursor movement
|
|
29
52
|
|
|
30
53
|
| Keybinding id | Default | Description |
|
|
31
|
-
|
|
54
|
+
| --- | --- | --- |
|
|
32
55
|
| `tui.editor.cursorUp` | `up` | Move cursor up |
|
|
33
56
|
| `tui.editor.cursorDown` | `down` | Move cursor down |
|
|
34
57
|
| `tui.editor.cursorLeft` | `left`, `ctrl+b` | Move cursor left |
|
|
@@ -49,7 +72,7 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
|
|
|
49
72
|
### TUI editor deletion
|
|
50
73
|
|
|
51
74
|
| Keybinding id | Default | Description |
|
|
52
|
-
|
|
75
|
+
| --- | --- | --- |
|
|
53
76
|
| `tui.editor.deleteCharBackward` | `backspace` | Delete character backward |
|
|
54
77
|
| `tui.editor.deleteCharForward` | `delete`, `ctrl+d` | Delete character forward |
|
|
55
78
|
| `tui.editor.deleteWordBackward` | `ctrl+w`, `alt+backspace` | Delete word backward |
|
|
@@ -60,7 +83,7 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
|
|
|
60
83
|
### TUI input
|
|
61
84
|
|
|
62
85
|
| Keybinding id | Default | Description |
|
|
63
|
-
|
|
86
|
+
| --- | --- | --- |
|
|
64
87
|
| `tui.input.newLine` | `shift+enter`, `ctrl+j` | Insert new line |
|
|
65
88
|
| `tui.input.submit` | `enter` | Submit input |
|
|
66
89
|
| `tui.input.tab` | `tab` | Tab / autocomplete |
|
|
@@ -68,7 +91,7 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
|
|
|
68
91
|
### TUI kill ring
|
|
69
92
|
|
|
70
93
|
| Keybinding id | Default | Description |
|
|
71
|
-
|
|
94
|
+
| --- | --- | --- |
|
|
72
95
|
| `tui.editor.yank` | `ctrl+y` | Paste most recently deleted text |
|
|
73
96
|
| `tui.editor.yankPop` | `alt+y` | Cycle through deleted text after yank |
|
|
74
97
|
| `tui.editor.undo` | `ctrl+-` (`ctrl+z` on native Windows, `alt+z` on WSL) | Undo last edit |
|
|
@@ -76,7 +99,7 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
|
|
|
76
99
|
### TUI clipboard and selection
|
|
77
100
|
|
|
78
101
|
| Keybinding id | Default | Description |
|
|
79
|
-
|
|
102
|
+
| --- | --- | --- |
|
|
80
103
|
| `tui.input.copy` | `ctrl+c` | Copy selection |
|
|
81
104
|
| `tui.select.up` | `up` | Move selection up |
|
|
82
105
|
| `tui.select.down` | `down` | Move selection down |
|
|
@@ -87,9 +110,11 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
|
|
|
87
110
|
|
|
88
111
|
Local copy requires a working clipboard utility (`wl-clipboard` on Wayland, `xclip` or `xsel` on X11, or Termux:API on Termux). Atomic forwards copies through OSC 52 over SSH, Mosh, and Rex and as a headless Linux fallback; set `ATOMIC_CLIPBOARD_OSC52=1` (legacy `PI_CLIPBOARD_OSC52=1`) to force OSC 52 after local copy. See [Terminal setup](/terminal-setup) for terminal clipboard and mouse configuration.
|
|
89
112
|
|
|
90
|
-
|
|
113
|
+
<div id="tui-fullscreen-viewport" />
|
|
91
114
|
|
|
92
|
-
|
|
115
|
+
### Transcript scrolling and mouse
|
|
116
|
+
|
|
117
|
+
Interactive sessions run in fullscreen with a scrollable transcript above the docked input box. `app.tools.expand` (`Ctrl+O` by default) expands or collapses all tool and summary blocks in the displayed transcript.
|
|
93
118
|
|
|
94
119
|
**Clicking blocks:**
|
|
95
120
|
|
|
@@ -109,10 +134,10 @@ Interactive sessions run in fullscreen with a scrollable transcript above the do
|
|
|
109
134
|
- When scrolled up, a centered `↓ jump to bottom · ctrl+end` pill appears above the editor (counting new messages as they arrive) and the current turn's opening prompt stays pinned at the top. Viewed subagent transcripts and `/tasks` shell views scroll independently without moving `main`.
|
|
110
135
|
- Drag to select characters, double-click for a word or path, and triple-click for a line. Selection copies automatically unless `fullscreenCopyOnSelect` is `false`. On Windows, pressing the secondary mouse button pastes clipboard text into the focused component. See [Terminal setup](/terminal-setup) for mouse and trackpad behavior.
|
|
111
136
|
|
|
112
|
-
While the main editor has focus, `home` and `end` stay with the editor, `ctrl+home` and `ctrl+end` jump to the transcript top and bottom, `pageUp` and `pageDown` scroll the transcript, and `ctrl+pageUp` and `ctrl+pageDown` scroll the editor. Focused overlays and scrollable lists (autocomplete, `/settings`, `/model`) capture scrolling actions first.
|
|
137
|
+
**Editor vs. transcript scrolling:** While the main editor has focus, `home` and `end` stay with the editor, `ctrl+home` and `ctrl+end` jump to the transcript top and bottom, `pageUp` and `pageDown` scroll the transcript, and `ctrl+pageUp` and `ctrl+pageDown` scroll the editor. Focused overlays and scrollable lists (autocomplete, `/settings`, `/model`) capture scrolling actions first.
|
|
113
138
|
|
|
114
139
|
| Key | Editor action | Fullscreen action |
|
|
115
|
-
|
|
140
|
+
| --- | --- | --- |
|
|
116
141
|
| `home`, `end` | Editor | Editor |
|
|
117
142
|
| `ctrl+home`, `ctrl+end` | *(none)* | Transcript |
|
|
118
143
|
| `pageUp`, `pageDown` | Editor | Transcript |
|
|
@@ -120,10 +145,10 @@ While the main editor has focus, `home` and `end` stay with the editor, `ctrl+ho
|
|
|
120
145
|
|
|
121
146
|
Rebind these like any other action: for example `"tui.altScreen.pageUp": "ctrl+pageUp"` keeps `pageUp` in the editor and moves transcript paging to `ctrl+pageUp`, and `[]` unbinds a shortcut. Focused custom components may consume viewport keys first; see the [input handling contract](/extensions/ui#custom-components).
|
|
122
147
|
|
|
123
|
-
Transcript scroll keys also work while the bottom-pinned `ask_user_question` dialog or Notes is open. Inside `ask_user_question`, use `↑`/`↓` to move between options, `Enter` to pick (`Enter` or `Space` to toggle multi-select boxes), type on **Type something.** for a custom answer, `n` to add a note, `Tab` or `←`/`→` to switch questions, and `Esc` to cancel.
|
|
148
|
+
**[`ask_user_question`](/tools) controls:** Transcript scroll keys also work while the bottom-pinned `ask_user_question` dialog or Notes is open. Inside `ask_user_question`, use `↑`/`↓` to move between options, `Enter` to pick (`Enter` or `Space` to toggle multi-select boxes), type on **Type something.** for a custom answer, `n` to add a note, `Tab` or `←`/`→` to switch questions, and `Esc` to cancel.
|
|
124
149
|
|
|
125
150
|
| Keybinding id | Default | Description |
|
|
126
|
-
|
|
151
|
+
| --- | --- | --- |
|
|
127
152
|
| `tui.altScreen.pageUp` | `pageUp` | Scroll the transcript up by one page |
|
|
128
153
|
| `tui.altScreen.pageDown` | `pageDown` | Scroll the transcript down by one page |
|
|
129
154
|
| `tui.altScreen.halfPageUp` | *(none)* | Scroll the transcript up by half a page |
|
|
@@ -140,12 +165,12 @@ Atomic does not ship a find-in-transcript shortcut. The four `tui.altScreen.sear
|
|
|
140
165
|
### Application
|
|
141
166
|
|
|
142
167
|
| Keybinding id | Default | Description |
|
|
143
|
-
|
|
168
|
+
| --- | --- | --- |
|
|
144
169
|
| `app.interrupt` | `escape` | Abort active or queued work and restore queued messages to the editor (pauses a viewed subagent without switching to `main`) |
|
|
145
|
-
| `app.clear` | `ctrl+c` | Clear editor text, interrupt work, recover an unresponsive
|
|
170
|
+
| `app.clear` | `ctrl+c` | Clear editor text, interrupt work, recover an unresponsive session, or press twice within 0.8 s on an empty idle prompt to exit (while viewing a subagent, pauses it instead of exiting) |
|
|
146
171
|
| `app.exit` | `ctrl+d` | Exit when the editor is empty |
|
|
147
172
|
| `app.suspend` | `ctrl+z` (`alt+z` on native Windows) | Suspend to background on POSIX and WSL; open a PowerShell subshell on native Windows |
|
|
148
|
-
| `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, or `$EDITOR`) |
|
|
173
|
+
| `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, or `$EDITOR`, falling back to `notepad` on Windows or `nano` on macOS and Linux) |
|
|
149
174
|
| `app.history.search` | `ctrl+r` | Search the viewed agent's past prompts and place the chosen one in the editor without sending |
|
|
150
175
|
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v`, `ctrl+v` on Windows and WSL) | Paste files on macOS, images, or text from clipboard |
|
|
151
176
|
|
|
@@ -156,13 +181,14 @@ Atomic does not ship a find-in-transcript shortcut. The four `tui.altScreen.sear
|
|
|
156
181
|
|
|
157
182
|
**`Ctrl+C`, `Esc`, and `Ctrl+X` routing:**
|
|
158
183
|
|
|
159
|
-
- `Ctrl+X` does not copy text; paired with `Ctrl+K` it stops all background work ([Navigation](#navigation)), on OAuth sign-in screens it copies the sign-in URL (`app.auth.copyUrl`), and in `/scoped-models` it clears selections. Use `/copy` to copy the viewed agent's last assistant message.
|
|
160
|
-
- Physical `Esc` always requests cooperative cancellation without
|
|
184
|
+
- `Ctrl+X` does not copy text; paired with `Ctrl+K` it stops all background work ([Navigation](#navigation)), on [OAuth sign-in screens](/providers) it copies the sign-in URL (`app.auth.copyUrl`), and in `/scoped-models` it clears selections. Use `/copy` to copy the viewed agent's last assistant message.
|
|
185
|
+
- Physical `Esc` always requests cooperative cancellation without restarting the session. Pressing `Escape` twice within 500 ms on an empty, idle editor triggers `doubleEscapeAction`: `/tree` (`"tree"`, default), `/fork` (`"fork"`), or nothing (`"none"`). Configure it in [Interface and display settings](/settings#interface-and-display).
|
|
186
|
+
- Physical `Ctrl+C` closes stuck custom dialogs (dialogs that handle `Ctrl+C` receive the first press and close on the second) and restarts an unresponsive background session process, even if you remap `app.clear`. See [Message queue](/usage#message-queue) for full interrupt and recovery rules.
|
|
161
187
|
|
|
162
188
|
### Sessions
|
|
163
189
|
|
|
164
190
|
| Keybinding id | Default | Description |
|
|
165
|
-
|
|
191
|
+
| --- | --- | --- |
|
|
166
192
|
| `app.session.new` | *(none)* | Start a new session (`/new`) |
|
|
167
193
|
| `app.session.tree` | *(none)* | Open session tree navigator (`/tree`) |
|
|
168
194
|
| `app.session.fork` | *(none)* | Fork current session (`/fork`) |
|
|
@@ -179,7 +205,7 @@ While viewing a subagent, `app.session.new`, `app.session.tree`, and `app.sessio
|
|
|
179
205
|
### Models and thinking
|
|
180
206
|
|
|
181
207
|
| Keybinding id | Default | Description |
|
|
182
|
-
|
|
208
|
+
| --- | --- | --- |
|
|
183
209
|
| `app.model.select` | `ctrl+l` | Open model selector |
|
|
184
210
|
| `app.model.cycleForward` | `ctrl+p` | Cycle to next model |
|
|
185
211
|
| `app.model.cycleBackward` | `shift+ctrl+p` (`alt+p` on Windows and WSL) | Cycle to previous model |
|
|
@@ -191,7 +217,7 @@ Interactive model and thinking choices save automatically as startup defaults; t
|
|
|
191
217
|
### Display and message queue
|
|
192
218
|
|
|
193
219
|
| Keybinding id | Default | Description |
|
|
194
|
-
|
|
220
|
+
| --- | --- | --- |
|
|
195
221
|
| `app.tools.expand` | `ctrl+o` | Collapse or expand tool detail in the viewed transcript (main chat or subagent) |
|
|
196
222
|
| `app.auth.copyUrl` | `ctrl+x` | Copy the URL on an OAuth sign-in screen |
|
|
197
223
|
| `app.message.followUp` | `alt+enter` (`ctrl+q` on Windows and WSL) | Queue follow-up message |
|
|
@@ -204,7 +230,7 @@ Message queue shortcuts work identically on `main` and while viewing a subagent.
|
|
|
204
230
|
Atomic shares one chat screen across `main` and its subagents, with the [agent panel](/background-tasks#the-agent-panel) below the prompt and `/tasks` for full task inspection. Press `↓` on an empty prompt to focus the agent panel, `←` on an empty prompt while viewing a subagent to return to `main`, `Ctrl+X` then `Ctrl+K` (twice within 3 seconds) to stop all background work, and `?` on an empty prompt or list to show active keys. See [Background tasks](/background-tasks) for full navigation and stop workflows.
|
|
205
231
|
|
|
206
232
|
| Keybinding id | Default | Description |
|
|
207
|
-
|
|
233
|
+
| --- | --- | --- |
|
|
208
234
|
| `app.nav.back` | `left` | Go back one level in `/tasks`, shell output, or the focused panel, and from a viewed subagent's empty prompt to `main`. `Esc` and `Ctrl+C` never act as this key |
|
|
209
235
|
| `app.list.open` | `enter`, `right` | Switch to the selected subagent (or `main`), or open the selected shell output |
|
|
210
236
|
| `app.list.stop` | `x` | Stop the selected item (press again to confirm); dismiss a finished one |
|
|
@@ -214,18 +240,18 @@ Atomic shares one chat screen across `main` and its subagents, with the [agent p
|
|
|
214
240
|
| `app.agents.focus` | `down` | Focus the agent panel from an empty prompt |
|
|
215
241
|
| `app.agents.chord` | `ctrl+x` | Start a background-work chord in the main chat |
|
|
216
242
|
| `app.agents.stopAll` | `ctrl+k` | After the chord key: stop all background subagents and shells (press twice to confirm) |
|
|
217
|
-
| `app.tasks.open` |
|
|
218
|
-
| `app.tasks.input` |
|
|
243
|
+
| `app.tasks.open` | *(none)* | Command-only `/tasks` route |
|
|
244
|
+
| `app.tasks.input` | *(none)* | Focus stdin only when the selected task has writable input |
|
|
219
245
|
| `app.tasks.openWaited` | `alt+w` | Open the output of the shell a waiting subagent waits on, while viewing that subagent or from its `/tasks` row |
|
|
220
246
|
|
|
221
247
|
On macOS, `Alt+W` requires your terminal to send Option as Meta (enable **Use Option as Meta key** in Terminal.app, set Option to **Esc+** in iTerm2, set `macos-option-as-alt` in Ghostty, or set `macos_option_as_alt both` in kitty). Otherwise remap `app.tasks.openWaited`. Avoid binding `alt+w` to another editor action because `app.tasks.openWaited` takes priority while viewing a waiting subagent or its `/tasks` row.
|
|
222
248
|
|
|
223
|
-
|
|
249
|
+
Open question prompts and the main input box keep keyboard priority; `Esc` leaves stdin or task detail before leaving task focus, and unbound actions show no key hint.
|
|
224
250
|
|
|
225
251
|
### Tree navigation
|
|
226
252
|
|
|
227
253
|
| Keybinding id | Default | Description |
|
|
228
|
-
|
|
254
|
+
| --- | --- | --- |
|
|
229
255
|
| `app.tree.foldOrUp` | `ctrl+left`, `alt+left` | Fold current branch segment, or jump to the previous segment start |
|
|
230
256
|
| `app.tree.unfoldOrDown` | `ctrl+right`, `alt+right` | Unfold current branch segment, or jump to the next segment start or branch end |
|
|
231
257
|
| `app.tree.editLabel` | `shift+l` | Edit the label on the selected tree node |
|
|
@@ -243,26 +269,26 @@ Older configs using `app.tasks.inspect` and `app.tasks.cancel` migrate automatic
|
|
|
243
269
|
Used inside `/scoped-models`. `Enter` toggles the selected model, typing filters by model or provider name, and `Esc` or `Ctrl+C` clears the search before closing. Changes save automatically.
|
|
244
270
|
|
|
245
271
|
| Keybinding id | Default | Description |
|
|
246
|
-
|
|
272
|
+
| --- | --- | --- |
|
|
247
273
|
| `app.models.enableAll` | `ctrl+a` | Enable all models (or all matching the current search) |
|
|
248
274
|
| `app.models.clearAll` | `ctrl+x` | Clear all models (or all matching the current search) |
|
|
249
275
|
| `app.models.toggleProvider` | `ctrl+p` | Toggle all models for the current provider |
|
|
250
276
|
| `app.models.reorderUp` | `alt+up` (`alt+q` on Windows and WSL) | Move the selected model up in the cycle order |
|
|
251
277
|
| `app.models.reorderDown` | `alt+down` | Move the selected model down in the cycle order |
|
|
252
278
|
|
|
253
|
-
|
|
279
|
+
### Non-configurable and bundled extension shortcuts
|
|
254
280
|
|
|
255
|
-
|
|
281
|
+
These shortcuts are not configured through `keybindings.json`:
|
|
256
282
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
283
|
+
| Shortcut | Scope | Action |
|
|
284
|
+
| --- | --- | --- |
|
|
285
|
+
| `Shift+Ctrl+D` | Global (non-configurable) | Append a TUI render and unredacted session-message snapshot to `~/.atomic/agent/atomic-debug.log` ([Diagnostics and debugging](/development#debugging)) |
|
|
286
|
+
| `Cmd+V` (macOS) | Global (non-configurable) | Paste clipboard images in terminals that forward empty bracketed paste or Kitty `super+v` |
|
|
287
|
+
| `Alt+M` | Bundled [Intercom](/intercom) extension | Open the Intercom session list overlay |
|
|
288
|
+
| `Ctrl+Shift+S` | Bundled [Web access](/web-access#slash-commands-and-shortcuts) extension | Open the browser search curator while a search runs (configure via `shortcuts.curate` in `~/.atomic/web-search.json`) |
|
|
289
|
+
| `Ctrl+Shift+W` | Bundled [Web access](/web-access#slash-commands-and-shortcuts) extension | Toggle the live web-search activity monitor (configure via `shortcuts.activity` in `~/.atomic/web-search.json`) |
|
|
264
290
|
|
|
265
|
-
|
|
291
|
+
## Preset examples
|
|
266
292
|
|
|
267
293
|
### Emacs example
|
|
268
294
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "@bastani/atomic-agent-core"
|
|
3
|
-
sidebarTitle: "
|
|
4
|
-
description: "Stateful agent loop with tool execution, event streaming, steering and follow-up messages."
|
|
3
|
+
sidebarTitle: "@bastani/atomic-agent-core"
|
|
4
|
+
description: "Stateful agent loop with tool execution, event streaming, steering, and follow-up messages."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Stateful agent with tool execution and event streaming, built on [`@bastani/atomic-ai`](/libraries/ai). Atomic's sessions run on this agent loop, and you can use it directly to build your own agent. Atomic's [SDK](/sdk) wraps it with sessions, tools, extensions, and compaction, so prefer the SDK when you want Atomic's built-in behavior.
|
|
7
|
+
Stateful agent with tool execution and event streaming, built on [`@bastani/atomic-ai`](/libraries/ai) (requires Node.js 22.19+). Atomic's sessions run on this agent loop, and you can use it directly to build your own agent. Atomic's [TypeScript SDK](/sdk) wraps it with sessions, tools, extensions, and compaction, so prefer the SDK when you want Atomic's built-in behavior. See [Standalone libraries](/libraries) for all standalone packages.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install @bastani/atomic-agent-core
|
|
12
|
+
npm install @bastani/atomic-agent-core @bastani/atomic-ai
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
|
17
|
+
Export `ANTHROPIC_API_KEY` before running this example:
|
|
18
|
+
|
|
17
19
|
```typescript
|
|
18
20
|
import { Agent } from "@bastani/atomic-agent-core";
|
|
19
21
|
import { createModels } from "@bastani/atomic-ai";
|
|
@@ -71,7 +73,7 @@ The agent emits events as turns run so your interface can update incrementally.
|
|
|
71
73
|
|
|
72
74
|
When you call `prompt("Hello")`:
|
|
73
75
|
|
|
74
|
-
```
|
|
76
|
+
```text
|
|
75
77
|
prompt("Hello")
|
|
76
78
|
├─ agent_start
|
|
77
79
|
├─ turn_start
|
|
@@ -122,6 +124,8 @@ Set the mode globally through `toolExecution` in `AgentOptions`, or per tool thr
|
|
|
122
124
|
|
|
123
125
|
`beforeToolCall` runs after `tool_execution_start` and argument validation. It can block execution and attach `terminate: true` to the blocked result. `afterToolCall` runs after tool execution finishes and before `tool_execution_end` and the final tool result message events are emitted.
|
|
124
126
|
|
|
127
|
+
**`afterToolCall` merge rules:** Overrides merge field-by-field (`content`, `details`, `structuredContent`, `isError`, `usage`, `terminate`) with no deep merge. Importantly, returning `content` **without** `structuredContent` drops the original `structuredContent` so the two cannot go out of sync; pass `structuredContent` alongside `content` if you want to keep it.
|
|
128
|
+
|
|
125
129
|
Tools, blocked `beforeToolCall` results, and `afterToolCall` overrides can return `terminate: true` to skip the automatic follow-up LLM call. The loop stops early only when every finalized tool result in that batch sets `terminate: true`. Mixed batches continue normally.
|
|
126
130
|
|
|
127
131
|
With the `Agent` class, assistant `message_end` processing finishes before tool preflight begins. That guarantees `beforeToolCall` sees agent state that already includes the assistant message requesting the tool call.
|
|
@@ -204,7 +208,7 @@ await agent.continue(); // Uses the queued message only because the tail is assi
|
|
|
204
208
|
| `tool_execution_update` | Tool streams progress |
|
|
205
209
|
| `tool_execution_end` | Tool completes |
|
|
206
210
|
|
|
207
|
-
`Agent.subscribe()` listeners are awaited in registration order. `agent_end` means no more loop events will be emitted,
|
|
211
|
+
`Agent.subscribe()` listeners receive `(event, signal)` and are awaited in registration order. If a listener throws or rejects, the error propagates to the caller awaiting `prompt()` or `continue()`. `agent_end` means no more loop events will be emitted, and `await agent.waitForIdle()` and `await agent.prompt(...)` settle only after awaited `agent_end` listeners finish.
|
|
208
212
|
|
|
209
213
|
## Agent options
|
|
210
214
|
|
|
@@ -220,7 +224,7 @@ const agent = new Agent({
|
|
|
220
224
|
messages: AgentMessage[],
|
|
221
225
|
},
|
|
222
226
|
|
|
223
|
-
// Convert AgentMessage[] to LLM Message[] (required for custom message types)
|
|
227
|
+
// Convert AgentMessage[] to LLM Message[] (required for custom message types; must not throw or reject)
|
|
224
228
|
convertToLlm: (messages) => messages.filter(...),
|
|
225
229
|
|
|
226
230
|
// Transform context before convertToLlm (for pruning, compaction)
|
|
@@ -247,9 +251,19 @@ const agent = new Agent({
|
|
|
247
251
|
// Dynamic API key resolution (for expiring OAuth tokens)
|
|
248
252
|
getApiKey: async (provider) => refreshToken(),
|
|
249
253
|
|
|
254
|
+
// Optional provider transport, retry cap, and request/response inspection hooks
|
|
255
|
+
transport: "sse",
|
|
256
|
+
maxRetryDelayMs: 60_000,
|
|
257
|
+
onPayload: (payload, model) => payload,
|
|
258
|
+
onResponse: (response) => {},
|
|
259
|
+
onProviderStreamEvent: (event) => {},
|
|
260
|
+
|
|
250
261
|
// Tool execution mode: "parallel" (default) or "sequential"
|
|
251
262
|
toolExecution: "parallel",
|
|
252
263
|
|
|
264
|
+
// Custom error text when the model calls an unregistered tool name
|
|
265
|
+
unknownToolMessage: (toolName) => `Tool "${toolName}" is not available.`,
|
|
266
|
+
|
|
253
267
|
// Preflight each tool call after args are validated. Can block execution.
|
|
254
268
|
beforeToolCall: async ({ toolCall, args, context }) => {
|
|
255
269
|
if (toolCall.name === "bash") {
|
|
@@ -272,6 +286,10 @@ const agent = new Agent({
|
|
|
272
286
|
return { context: { ...context, messages: await loadCanonicalMessages(signal) } };
|
|
273
287
|
},
|
|
274
288
|
|
|
289
|
+
// Optional turn-boundary hooks that update model, tools, or system messages between turns.
|
|
290
|
+
prepareNextTurn: async (signal) => undefined,
|
|
291
|
+
prepareNextTurnWithContext: async (context, signal) => undefined,
|
|
292
|
+
|
|
275
293
|
// Finalize a completed turn before turn_end is emitted.
|
|
276
294
|
// `continue` ensures one next request; existing tool/queue scheduling can satisfy it.
|
|
277
295
|
// `end` ends this run after turn_end without polling queues.
|
|
@@ -289,6 +307,12 @@ const agent = new Agent({
|
|
|
289
307
|
});
|
|
290
308
|
```
|
|
291
309
|
|
|
310
|
+
### `StreamFn`, `setDefaultStreamFn()`, and `convertToLlm` contracts
|
|
311
|
+
|
|
312
|
+
- **`StreamFn` must never throw or reject** for request, model, or runtime failures. Always return an `AssistantMessageEventStream` and encode failures via stream `error` events and a final `AssistantMessage` with `stopReason: "error"` or `"aborted"` and `errorMessage`.
|
|
313
|
+
- **`convertToLlm` must never throw or reject**; filter or normalize custom messages deterministically.
|
|
314
|
+
- **`setDefaultStreamFn(streamFn | undefined)`:** Sets a process-wide fallback `StreamFn` used when `Agent` or `agentLoop()` callers do not supply an explicit `streamFn`.
|
|
315
|
+
|
|
292
316
|
## Agent state
|
|
293
317
|
|
|
294
318
|
```typescript
|
|
@@ -479,6 +503,8 @@ const readFileTool: AgentTool<typeof readFileParameters> = {
|
|
|
479
503
|
label: "Read File", // For UI display
|
|
480
504
|
description: "Read a file's contents",
|
|
481
505
|
parameters: readFileParameters,
|
|
506
|
+
// Optional JSON Schema describing structuredContent returned to programmatic/codemode callers
|
|
507
|
+
outputSchema: obj({ path: str(), content: str() }),
|
|
482
508
|
// Override execution mode for this tool (optional).
|
|
483
509
|
// "sequential" forces the entire batch to run one at a time.
|
|
484
510
|
// "parallel" allows concurrent execution with other tool calls.
|
|
@@ -494,6 +520,7 @@ const readFileTool: AgentTool<typeof readFileParameters> = {
|
|
|
494
520
|
// when every finalized tool result in the batch does the same.
|
|
495
521
|
return {
|
|
496
522
|
content: [{ type: "text", text: content }],
|
|
523
|
+
structuredContent: { path: params.path, content },
|
|
497
524
|
details: { path: params.path, size: content.length },
|
|
498
525
|
};
|
|
499
526
|
},
|
|
@@ -520,9 +547,25 @@ The agent catches thrown errors and reports them to the LLM as tool errors with
|
|
|
520
547
|
|
|
521
548
|
Return `terminate: true` from `execute()`, a blocked `beforeToolCall`, or `afterToolCall` to skip the follow-up LLM call after the current tool batch. This takes effect only when every finalized tool result in the batch sets `terminate: true`. The hint is runtime-only, so emitted `toolResult` transcript messages remain standard LLM tool results.
|
|
522
549
|
|
|
523
|
-
### MCP and
|
|
550
|
+
### MCP, Codemode, and `runToolCall()`
|
|
551
|
+
|
|
552
|
+
[`@bastani/atomic-codemode`](/libraries/codemode) runs model-written JavaScript that calls tools. Wrap it as an `AgentTool` named `codemode` whose scripts invoke the agent's tools through `runToolCall(toolCall, options)` so argument validation, `beforeToolCall`, and `afterToolCall` apply to nested calls too.
|
|
553
|
+
|
|
554
|
+
```typescript
|
|
555
|
+
import { type AgentToolCall, type AgentToolCallOutcome, type RunToolCallOptions, runToolCall } from "@bastani/atomic-agent-core";
|
|
556
|
+
|
|
557
|
+
const outcome: AgentToolCallOutcome = await runToolCall(toolCall, {
|
|
558
|
+
tools,
|
|
559
|
+
assistantMessage,
|
|
560
|
+
context,
|
|
561
|
+
beforeToolCall: agent.beforeToolCall,
|
|
562
|
+
afterToolCall: agent.afterToolCall,
|
|
563
|
+
signal,
|
|
564
|
+
});
|
|
565
|
+
// outcome: { result: AgentToolResult<unknown>, isError: boolean, durationMs?: number }
|
|
566
|
+
```
|
|
524
567
|
|
|
525
|
-
|
|
568
|
+
`runToolCall()` returns `{ result, isError, durationMs? }` (returning tool failures as `isError: true` rather than throwing). See [Using with agent-core](/libraries/codemode#using-with-agent-core). Tools that wrap an MCP server's tools work the same way. Atomic's own MCP support lives in the [MCP servers](/mcp-servers) extension.
|
|
526
569
|
|
|
527
570
|
## Proxy usage
|
|
528
571
|
|