@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/sdk/reference.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: SDK API reference
|
|
2
|
+
title: "SDK API reference"
|
|
3
3
|
sidebarTitle: "SDK API"
|
|
4
|
-
description: SDK options,
|
|
4
|
+
description: "Complete API reference for Atomic SDK session options, model scoping, session stores, resource loaders, run modes, task supervision, and exports."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# SDK API reference
|
|
8
|
-
|
|
9
7
|
## Options reference
|
|
10
8
|
|
|
11
9
|
### Directories
|
|
@@ -118,15 +116,37 @@ if (auto) {
|
|
|
118
116
|
}
|
|
119
117
|
```
|
|
120
118
|
|
|
119
|
+
#### Resolving scoped models
|
|
120
|
+
|
|
121
|
+
`resolveModelScopeFromModels(patterns, models)` and `resolveModelScopeWithDiagnostics(patterns, modelRuntime)` expand `--models` / `enabledModels` pattern arrays into `{ scopedModels, diagnostics }`. Each pattern resolves in three stages:
|
|
122
|
+
|
|
123
|
+
1. Exact literal reference without a thinking suffix (matches `provider/id` or `id`).
|
|
124
|
+
2. If the pattern contains `*`, `?`, or `[`: strips a valid trailing `:<thinking>` suffix, retries an exact literal match first (so bracketed model IDs like `model[1m]` stay literal), then runs case-insensitive `minimatch` against both `provider/id` and `id`.
|
|
125
|
+
3. Fuzzy substring matching with lenient `:<thinking>` suffix parsing.
|
|
126
|
+
|
|
127
|
+
Matches are deduplicated in order (first match wins). `diagnostics` lists warnings with `code: "no-match" | "invalid-thinking-level"`.
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import { resolveModelScopeWithDiagnostics } from "@bastani/atomic";
|
|
131
|
+
|
|
132
|
+
const { scopedModels, diagnostics } = await resolveModelScopeWithDiagnostics(
|
|
133
|
+
["anthropic/*sonnet*:high", "openai/o3"],
|
|
134
|
+
modelRuntime,
|
|
135
|
+
);
|
|
136
|
+
```
|
|
137
|
+
|
|
121
138
|
#### Model catalog persistence and refresh
|
|
122
139
|
|
|
123
|
-
`ModelRuntime.create()` restores cached catalogs from local persistence and does not download the models.dev catalog unless you opt in. Pass `catalogBaseUrl` (or set `ATOMIC_MODEL_CATALOG_URL`) to read `<url>/api.json` from your own models.dev mirror instead of https://models.dev
|
|
140
|
+
`ModelRuntime.create()` restores cached catalogs from local persistence and does not download the models.dev catalog unless you opt in. Pass `catalogBaseUrl` (or set `ATOMIC_MODEL_CATALOG_URL`) to read `<url>/api.json` from your own models.dev mirror instead of `https://models.dev`.
|
|
124
141
|
|
|
125
|
-
- `allowModelNetwork` (
|
|
126
|
-
-
|
|
142
|
+
- `allowModelNetwork` (tri-state):
|
|
143
|
+
- **Omitted (`undefined`):** skips create-time network refresh, but still allows a first-prompt GitHub Copilot lookup when no cached Copilot catalog or fallback model exists.
|
|
144
|
+
- **`false`:** disables **both** create-time network refresh and first-prompt GitHub Copilot lookup.
|
|
145
|
+
- **`true`:** enables create-time network refresh (bounded by `modelRefreshTimeoutMs`).
|
|
146
|
+
- `modelRefreshTimeoutMs` (default `15_000`): bounds how long the create-time refresh may run before aborting.
|
|
127
147
|
- `refreshOnCreate: false`: skips the initial catalog and availability refresh entirely; built-in models remain available.
|
|
128
148
|
|
|
129
|
-
`createAgentSession()` does not fetch an account model list at startup. If
|
|
149
|
+
`createAgentSession()` does not fetch an account model list at startup. If cache restore found no GitHub Copilot catalog and the first prompt has no usable model or fallback, the session can look up the exact saved Copilot model unless `allowModelNetwork: false` was passed to `ModelRuntime.create()`. A supplied `model`, a working preset or fallback, and a cached catalog need no lookup. Only that session uses the result; `models-store.json`, credentials, and model listings do not change.
|
|
130
150
|
|
|
131
151
|
The `modelFallbackMessage` returned by `createAgentSession()` describes startup. If the account confirms the model is absent, the first prompt's error says so; a refused, offline, or cancelled lookup keeps the usual error. Pass `signal` to `createAgentSession()` to cancel the lookup, or pass `allowModelNetwork: false` to `ModelRuntime.create()` to disable it. Custom asynchronous-only credential stores keep normal local selection; discovery never waits on their read queue.
|
|
132
152
|
|
|
@@ -220,11 +240,12 @@ Specify which tools to expose by name:
|
|
|
220
240
|
- `find` discovers filesystem paths by glob; `search` searches file contents with regex patterns across files, directories, globs, and internal URLs.
|
|
221
241
|
- `builtins` selects shipped packages independently of tools: keys are `subagents`, `mcp`, `web-access`, and `intercom`. Omitted, `{}`, and omitted keys enable packages. A `false` value removes that package's extensions and resources, including on reload; `true` enables it.
|
|
222
242
|
- The `subagents` builtin ships all 21 bundled subagent skills: `agent-browser`, `agent-desktop`, `bro`, `create-spec`, `feedback`, `herdr`, `how`, `impeccable`, `liteparse`, `prompt-engineer`, `qlty`, `research-codebase`, `show-me`, `skill-creator`, `subagent`, `tdd`, `teach`, `tmux`, `unslop`, `why`, and `workflow-files`. If you want these skills without the delegation tool, keep `subagents` enabled and pass `excludedTools: ["subagent"]`. If you disable the package, install independent copies of the skills you need in your [skills directory](/skills#locations).
|
|
223
|
-
- `tools` accepts an allowlist of coding, extension, and custom tool names or `*` patterns. `tools: []` exposes no tools, including Intercom. A list containing only `+name`/`-name` entries modifies resolved defaults (for example `tools: ["+codemode", "-write"]`). Modifiers require exact names, cannot mix with plain entries, and apply across reloads. Invalid lists throw.
|
|
224
|
-
- `
|
|
243
|
+
- `tools` accepts an allowlist of coding, extension, and custom tool names or `*` patterns. Pattern matching is **case-sensitive** and treats only `*` as a wildcard (matching any characters); `?`, `[]`, and `{}` are matched literally. `tools: []` exposes no tools, including Intercom. A list containing only `+name`/`-name` entries modifies resolved defaults (for example `tools: ["+codemode", "-write"]`). Modifiers require exact names (no `*`), cannot mix with plain entries, and apply across reloads. Invalid lists throw.
|
|
244
|
+
- **MCP retention with allowlists:** When `tools` is a non-empty allowlist with no `mcp__*` entry, MCP tools remain registered for `codemode` and `tool_search`. Adding any `mcp__*` entry switches MCP tools to explicit allowlisting too.
|
|
245
|
+
- `excludedTools` removes matching names (using the same case-sensitive `*`-only matching) from the registry and active selection. Exclusions win over `tools`; unknown names are ignored.
|
|
225
246
|
- `noTools: "all"` exposes no tools, even with a nonempty `tools` list. It does not remove package resources or authorize services.
|
|
226
247
|
- `noTools: "builtin"` suppresses the built-in selection, including `codemode`, when `tools` is omitted. Other extension and custom tools keep their default activation unless excluded. An explicit `tools` list wins over this mode.
|
|
227
|
-
- Configured `defaultTools`
|
|
248
|
+
- Configured `defaultTools` narrows only the initial built-in coding selection when `tools` and `noTools` are omitted (it never disables extension or custom tools). Plain names replace defaults; modifier-only lists such as `["-bash", "+ls"]` modify defaults, and project modifier-only lists layer over global settings. See [defaultTools](/settings#tools).
|
|
228
249
|
|
|
229
250
|
Subagent children inherit these restrictions. Child allowlists intersect with parent selections, including during model fallback, and a child cannot restore a parent-disabled package or excluded tool. See [child configuration](/sdk#subagent-children) for model, auth, host callback, and working-directory inheritance.
|
|
230
251
|
|
|
@@ -383,7 +404,7 @@ Do not mix wait arguments with launch fields. Unknown IDs, foreign IDs, and unbo
|
|
|
383
404
|
|
|
384
405
|
PowerShell tools and local operations accept a trusted `taskOwner` binding and the same `wait` observation policy as `bash`. Owned native Windows runs auto-yield after the owner's command budget (normally 10000 ms); explicit per-call budgets override it, while execution timeout stays separate. Without a supported owner, explicit background requests reject and foreground execution waits for completion.
|
|
385
406
|
|
|
386
|
-
On native Windows,
|
|
407
|
+
On native Windows, a `bash` or `powershell` tool call without a `taskOwner` binding runs in its own job object so a timeout or abort terminates child processes even after the shell exits. Processes that break away (`CREATE_BREAKAWAY_FROM_JOB`), including commands started by Git Bash, are terminated on timeout or abort only while still under the running shell; detached children left behind by a finished command continue running.
|
|
387
408
|
|
|
388
409
|
```typescript
|
|
389
410
|
import { createPowerShellTool } from "@bastani/atomic";
|
|
@@ -446,7 +467,7 @@ Use `defineTool()` for standalone definitions and arrays like `customTools: [myT
|
|
|
446
467
|
|
|
447
468
|
Custom tools passed via `customTools` combine with extension-registered tools. When you pass a plain-name `tools` allowlist, include each custom or extension tool you want active (for example `tools: ["read", "bash", "my_tool"]`). Modifier-only lists keep default activation and can enable inactive tools with `+name`. `excludedTools` removes any matching tool from the active set.
|
|
448
469
|
|
|
449
|
-
`ToolDefinition.constrainedSampling` survives `defineTool()`, `customTools`, tool wrappers, inspection, and
|
|
470
|
+
`ToolDefinition.constrainedSampling` survives `defineTool()`, `customTools`, tool wrappers, inspection, and interactive terminal execution:
|
|
450
471
|
|
|
451
472
|
- `{ type: "json_schema", strict: "prefer" | "require" }`: `prefer` may fall back; `require` fails if the active model cannot enforce strict JSON Schema.
|
|
452
473
|
- `{ type: "grammar", variants: { openai_lark?: string, openai_regex?: string } }`: requires one required string parameter and capable model metadata.
|
|
@@ -454,7 +475,7 @@ Custom tools passed via `customTools` combine with extension-registered tools. W
|
|
|
454
475
|
|
|
455
476
|
Inspection preserves optional-property identity (`undefined` stays present when explicitly set). See `ConstrainedSamplingConfig`, [Constrained sampling](/extensions/authoring#constrained-sampling), and `ModelInfo.compat` in [RPC](/rpc/protocol#get_available_models).
|
|
456
477
|
|
|
457
|
-
Factory-created `createBashTool()` instances receive the same execution-time `ATOMIC_SESSION_*` and `PI_SESSION_*` snapshot as the built-in `bash` tool unless you pass `exposeSessionEnvironment: false`. `MessageRenderOptions.outputPad` is
|
|
478
|
+
Factory-created `createBashTool()` instances receive the same execution-time `ATOMIC_SESSION_*` and `PI_SESSION_*` snapshot as the built-in `bash` tool unless you pass `exposeSessionEnvironment: false`. `MessageRenderOptions.outputPad` is forwarded to all custom message renderers.
|
|
458
479
|
|
|
459
480
|
Normal sessions expose `kill({ id: taskId })` for owned `bash` and `powershell` background tasks. Include `kill` in any explicit `tools` allowlist if the agent should be able to stop tasks. `createKillTool` and `createKillToolDefinition` accept `KillToolOptions.taskOwner` (the same trusted binding used by shell launches) and reject without one. Result details carry the supervisor's `CancelReceipt`. See [Stop a shell task from a tool call](/background-tasks#stop-a-shell-task-from-a-tool-call).
|
|
460
481
|
|
|
@@ -477,12 +498,12 @@ const waitForCi = defineTool({
|
|
|
477
498
|
|
|
478
499
|
A detachable call follows its message's `concurrency` ordering before starting. If a tool must save a durable handoff first, set `detachmentRequiresReady: true`: check `toolCallNeedsDetachmentHandoff(signal)` while running, then call `markToolCallReadyForDetachment(signal)` once saved. The call detaches only after both that signal and the host's delay (or returns inline if it finishes sooner).
|
|
479
500
|
|
|
480
|
-
Without a detachment policy, detachable calls run inline. A host using persistent storage enables detachment with `session.setToolDetachment({ afterMs })`, where `afterMs` is `0` to `MAX_TOOL_DETACHMENT_AFTER_MS` (`2,147,483,647`):
|
|
501
|
+
Without a detachment policy, detachable calls run inline. A host using persistent storage enables detachment with `session.setToolDetachment({ afterMs })`, where `afterMs` is any finite number from `0` to `MAX_TOOL_DETACHMENT_AFTER_MS` (`2,147,483,647`):
|
|
481
502
|
|
|
482
503
|
- **Inline vs. detached:** Calls finishing within `afterMs` complete inline. Calls still running detach: the turn's other results save, the detached call remains pending, and `prompt()` resolves so the host can release or dispose of the session.
|
|
483
504
|
- **Interrupts:** Once a turn is interrupted, inline calls no longer detach (even if marked ready in the same tick). They keep their result if they stop within `ATOMIC_TOOL_ABORT_GRACE_MS` (default 10 s); otherwise they record `Operation aborted` and later outcomes are discarded. Queued calls fail immediately with `Operation aborted`. Calls that detached before the interrupt are unaffected and remain available from `takeDetachedToolCalls()`.
|
|
484
505
|
- **`session.takeDetachedToolCalls()`:** Returns each detached call once as a `DetachedToolCall` (`toolCallId`, `toolName`, non-rejecting `result` promise, `abort(reason)`). Calls whose turn the transcript has moved past are cancelled, dropped, and logged as `stale-detached-call`. Thrown errors become `isError` results; errors with a string `code` populate `details.error` via `toJSON()` (or a fallback object with `serialization: "fallback"` if `toJSON()` throws). Unrecordable payloads record a call error instead, while session-store failures still reject resume.
|
|
485
|
-
- **`session.resumeDetachedTurn(results)`:** On a reopened session, records each result after its call and continues the turn
|
|
506
|
+
- **`session.resumeDetachedTurn(results, onRecorded?)`:** On a reopened session, records each result after its call (invoking optional `onRecorded(toolCallIds)` once recorded) and continues the turn without a new user message once every detachable call of that turn has a result. You can supply results across multiple calls; until the last arrives, `hasPendingDetachedTurn()` stays `true`. Duplicate, already-answered, or stale results are ignored (stale ones log `stale-detached-call`), while results for nonexistent calls throw `unknown-tool-call`. Calling with no new results continues a turn whose calls already have results.
|
|
486
507
|
- **`session.isWaitingOnDetachedResults()`:** Reports whether the transcript still awaits a detached result. While waiting under a detachment policy, nothing starts a turn on the idle session (including subagent notices, steering, follow-ups, and post-compaction continuations); held custom messages are persisted and replayed after `resumeDetachedTurn()` continues the turn. Do not call `prompt()` while waiting on results.
|
|
487
508
|
- **`session.hasPendingDetachedTurn()` and `session.redispatchDetachedToolCalls()`:** `hasPendingDetachedTurn()` reports whether a reopened transcript ends on a detached turn; continue it with `redispatchDetachedToolCalls()` and `resumeDetachedTurn()` instead of prompting again. `redispatchDetachedToolCalls()` restarts unanswered detachable calls with their original IDs and arguments and emits `tool_execution_start` before returning.
|
|
488
509
|
|
|
@@ -541,12 +562,17 @@ The tool infers the answer through the session's model registry rather than capt
|
|
|
541
562
|
|
|
542
563
|
Each call shares one wall-clock deadline covering repairs, retries, and fallbacks. It defaults to the session's [`httpIdleTimeoutMs`](/settings#http) setting; pass `timeoutMs` (a positive integer in milliseconds) to `createStructuredOutputTool()` to override it. See [Structured decisions](/sdk/structured-decisions#cancellation-and-failures).
|
|
543
564
|
|
|
544
|
-
To register under a custom name
|
|
565
|
+
To register under a custom name or capture the validated value in memory or to a private file (`0600`), pass `name`, `capture`, or `output`:
|
|
545
566
|
|
|
546
567
|
```typescript
|
|
568
|
+
import { createStructuredOutputCapture, createStructuredOutputTool } from "@bastani/atomic";
|
|
569
|
+
|
|
570
|
+
const capture = createStructuredOutputCapture<{ category: "question" | "statement" }>();
|
|
547
571
|
const finalDecision = createStructuredOutputTool({
|
|
548
572
|
name: "final_decision",
|
|
549
573
|
schema: DecisionSchema,
|
|
574
|
+
capture, // sets capture.value and capture.called = true on success
|
|
575
|
+
output: { outputPath: "/tmp/decision.json" }, // writes JSON with mode 0600
|
|
550
576
|
});
|
|
551
577
|
|
|
552
578
|
await createAgentSession({
|
|
@@ -583,9 +609,26 @@ const { session } = await createAgentSession({ resourceLoader: loader });
|
|
|
583
609
|
|
|
584
610
|
- **Synthetic builtin factories:** Named `extensionFactories` descriptors may set `builtin: true` to expose a `builtin:<name>` resource and `replaceable: true` to yield if another extension registers the same tool, command, or flag. Pass `additionalExtensionPaths: ["builtin:codemode"]` for explicit loading even with `noExtensions: true`. See [built-in extension resources](/extensions#built-in-extension-resources).
|
|
585
611
|
- **Inline built-in extensions:** `DefaultResourceLoader` includes `codemode`, `tool-search`, and `llama.cpp` as `builtin:<name>` paths. `codemode` is active by default (opt out with `tools: ["-codemode"]`), while `tool_search` is opt-in. Turn off an inline builtin with `noExtensions: true`, `disabledBuiltinExtensions: ["codemode"]`, or `extensions: ["-builtin:codemode"]`.
|
|
586
|
-
- **Bindings and startup:** Pass `extensionBindings` to `createAgentSession()` to install `
|
|
612
|
+
- **Bindings and startup (`ExtensionBindings`):** Pass `extensionBindings` to `createAgentSession()` to install bindings before `session_start` runs: `humanInput`, `onDiagnostic`, `onUIPrompt`, `uiContext`, `onStatus` (receives extension `setStatus` writes when no `uiContext` is bound), `isPresentationOnly`, `mode`, `commandContextActions`, `shutdownHandler`, `onError`, and `reportStartupErrors` (when `true`, forwards `session_start` and `resources_discover` errors to `onError` and keeps the session open instead of rolling back). Later `bindExtensions()` calls update bindings without replaying `session_start`.
|
|
587
613
|
- **Strict reloads:** `failOnExtensionErrors: true` requires transactional `prepareReload()` support (`DefaultResourceLoader` implements it). Custom loaders without `prepareReload()` work for ordinary reloads, while strict reload fails before calling their mutating `reload()`.
|
|
588
614
|
|
|
615
|
+
#### Reload lifecycle and resource ownership
|
|
616
|
+
|
|
617
|
+
- **Transactional vs. ordinary reload:** Failed transactional reloads keep the previous extension generation active; failed ordinary reloads do not. Both clean up newly acquired resources and report cleanup failures through an `AggregateError` tagged with `code: "ShutdownFailed"`.
|
|
618
|
+
- **Lifecycle effects:** Acquire shared resources in `session_start` (or register `session_shutdown` immediately if acquired earlier). Use `publishExtensionContextEffect(ctx, effect)` (default `"start"` phase after retirement, or synchronous `"commit"` phase before revocation) to publish shared state only on commit, and `registerExtensionContextRetirementEffect(ctx, dispose)` for synchronous pre-revocation cleanup. Never cache `ctx.ui` across reloads.
|
|
619
|
+
|
|
620
|
+
```typescript
|
|
621
|
+
import { publishExtensionContextEffect, type ExtensionFactory } from "@bastani/atomic";
|
|
622
|
+
|
|
623
|
+
const extension: ExtensionFactory = (atomic) => {
|
|
624
|
+
atomic.on("session_start", (_event, ctx) =>
|
|
625
|
+
publishExtensionContextEffect(ctx, () => {
|
|
626
|
+
atomic.events.emit("example:session-ready", { sessionId: ctx.sessionManager.getSessionId() });
|
|
627
|
+
}),
|
|
628
|
+
);
|
|
629
|
+
};
|
|
630
|
+
```
|
|
631
|
+
|
|
589
632
|
#### Session disposal and lifecycle
|
|
590
633
|
|
|
591
634
|
Always `await session.dispose()`. Disposal seals new admission immediately and waits for active work, extension shutdown handlers, pending settings writes, pending notice-line saves, lease release, and up to 5 seconds for in-flight extension transpile-cache writes started by that session.
|
|
@@ -593,13 +636,13 @@ Always `await session.dispose()`. Disposal seals new admission immediately and w
|
|
|
593
636
|
Once `dispose()` resolves, nothing the session started is still writing to its session store or extension transpile cache, so deleting `agentDir` or a caller-owned store directory right afterward will not race. (Transpile-cache writes still unfinished after 5 seconds are logged to debug output and left to finish asynchronously.)
|
|
594
637
|
|
|
595
638
|
- Concurrent `dispose()` calls share one promise.
|
|
596
|
-
-
|
|
639
|
+
- Disposal failures reject with an `AggregateError` tagged with `code: "ShutdownFailed"` (not an exported class); inspect `error.errors` for individual component failures. A failed close still leaves the session closed.
|
|
597
640
|
- Settings persistence failures can reject disposal; repair storage and repeat the write before closing (`dispose()` does not drain `SettingsManager.drainErrors()`).
|
|
598
641
|
- Caller-supplied settings, storage, and model runtimes remain caller-owned. Do not add manual MCP or Intercom teardown.
|
|
599
642
|
- `AgentSessionRuntime` uses the same awaited close during session replacement and transfers bindings before the replacement starts. Reload invalidates stale input requests and subscriptions so late replies cannot authorize new work.
|
|
600
643
|
- Duplicate `executeBash()` IDs act as correlation IDs: `abortBash(id)` cancels every active call with that ID.
|
|
601
644
|
|
|
602
|
-
For reload, replacement, and resource ownership patterns, see [
|
|
645
|
+
For reload, replacement, and resource ownership patterns, see [Draining work on reload and shutdown](/sdk#finishing-admitted-work).
|
|
603
646
|
|
|
604
647
|
#### Prompting options
|
|
605
648
|
|
|
@@ -608,7 +651,7 @@ For reload, replacement, and resource ownership patterns, see [Finishing admitte
|
|
|
608
651
|
- `expandPromptTemplates` (default `true`): expands file-based prompt templates, skill commands, and extension commands.
|
|
609
652
|
- `images`: optional `ImageContent[]` attachments.
|
|
610
653
|
- `streamingBehavior`: `"steer"` or `"followUp"` when sending while a turn is active; omitting it while streaming rejects with `AgentSessionBusyError`.
|
|
611
|
-
- `startTurnOnly`: when `true`, starts a turn only if the session is idle and queued messages are not paused. When a turn is already running or queued input is paused, nothing is sent or queued and `prompt()` resolves
|
|
654
|
+
- `startTurnOnly`: when `true`, starts a turn only if the session is idle and queued messages are not paused. When a turn is already running or queued input is paused, nothing is sent or queued, `preflightResult` is called with `(true, "handled")`, and `prompt()` resolves with `undefined`.
|
|
612
655
|
- `source`: `InputSource` metadata for `input` hooks.
|
|
613
656
|
- `preflightResult`: callback `(success, disposition?)` invoked once preflight accepts (`"handled"`, `"queued"`, or `"started"`) or rejects the prompt.
|
|
614
657
|
|
|
@@ -729,10 +772,12 @@ const { session } = await createAgentSession({
|
|
|
729
772
|
sessionManager: SessionManager.inMemory(),
|
|
730
773
|
});
|
|
731
774
|
|
|
732
|
-
// New persistent session
|
|
775
|
+
// New persistent session (default resolved store, or pass an explicit SessionStore)
|
|
733
776
|
const { session: persisted } = await createAgentSession({
|
|
734
777
|
sessionManager: await SessionManager.create(process.cwd()),
|
|
735
778
|
});
|
|
779
|
+
// Or with a caller-owned store:
|
|
780
|
+
// await SessionManager.create(store, process.cwd())
|
|
736
781
|
|
|
737
782
|
// Continue most recent
|
|
738
783
|
const { session: continued, modelFallbackMessage } = await createAgentSession({
|
|
@@ -784,7 +829,7 @@ await runtime.fork("entry-id");
|
|
|
784
829
|
await runtime.fork("entry-id", { position: "at" });
|
|
785
830
|
```
|
|
786
831
|
|
|
787
|
-
`runtime.switchSession(id, options?)` and `runtime.rehydrate(id, options?)` resume at the current context window, so `getEntries()` and `getTree()` return only the
|
|
832
|
+
`runtime.switchSession(id, options?)` and `runtime.rehydrate(id, options?)` resume at the current context window, so `getEntries()` and `getTree()` return only the loaded context window.
|
|
788
833
|
|
|
789
834
|
To visit older entries without loading them into memory, iterate `for await (const page of sessionManager.readHistory({ fromSeq, toSeq, signal }))`:
|
|
790
835
|
|
|
@@ -807,7 +852,28 @@ for await (const page of sessionManager.readHistory()) {
|
|
|
807
852
|
const entry = await sessionManager.readEntry("entry-id");
|
|
808
853
|
```
|
|
809
854
|
|
|
810
|
-
`sessionManager.loadFullHistory()` and `{ history: "full" }` on `SessionManager.open()`, `openSessionById()`, `continueRecent()`, `switchSession()`, and `rehydrate()` load every stored entry across every branch into memory so `getEntries()` and `getTree()` cover the whole session. Use them only when you need all entries
|
|
855
|
+
`sessionManager.loadFullHistory()` and `{ history: "full" }` on `SessionManager.open()`, `openSessionById()`, `continueRecent()`, `switchSession()`, and `rehydrate()` load every stored entry across every branch into memory so `getEntries()` and `getTree()` cover the whole session. Use them only when you need all entries loaded in memory at once.
|
|
856
|
+
|
|
857
|
+
#### Session stores and claims
|
|
858
|
+
|
|
859
|
+
Construct or open concrete `SessionStore` implementations directly when you manage store lifetimes yourself:
|
|
860
|
+
|
|
861
|
+
- **`SqlSessionStore.open(database, { prefix?, cwdMatcher? })`:** Opens a SQL-backed session store on a caller-owned `SqliteDatabase` or storage adapter handle.
|
|
862
|
+
- **`JsonlSessionStore.open(directory, { exactDirectory?, scanExisting?, lockFs?, createDirectory? })`:** Opens a JSONL session directory store (creates `directory` unless `createDirectory: false`).
|
|
863
|
+
- **`new MemorySessionStore(cwdMatcher?, historyFiles?)`:** Creates a caller-owned in-memory store that preserves history across `session.release()` and `runtime.rehydrate()`.
|
|
864
|
+
|
|
865
|
+
Coordinate single-writer session ownership across processes with session claims (stored at `<agentDir>/session-claims/<sessionId>.json`, refreshed on a 15-second heartbeat, with a 60-second staleness window for remote hosts and automatic dead-claim takeover):
|
|
866
|
+
|
|
867
|
+
- **`await prepareSessionClaim(sessionId, { agentDir })`:** Awaits any in-flight asynchronous claim release in this process and prepares stale-claim takeover locking. Always await `prepareSessionClaim()` before `claimSession()` when re-claiming a session right after closing or releasing it.
|
|
868
|
+
- **`claimSession(sessionId, { agentDir })`:** Synchronously acquires the claim and returns a `release()` function (throws `SessionAlreadyOpenError` if another live process holds the session or if a prior release in this process is still pending).
|
|
869
|
+
- **`attachSessionClaim(sessionId)`:** Transfers an active claim to the opened session's lifetime marker, returning a `() => Promise<void>` disposer (after attaching, the earlier `release()` callback becomes a no-op).
|
|
870
|
+
|
|
871
|
+
#### Session services (`createAgentSessionServices` and `createAgentSessionFromServices`)
|
|
872
|
+
|
|
873
|
+
When managing multiple sessions that share a working directory (or inside `createAgentSessionRuntime()`), split directory-scoped service initialization from session creation:
|
|
874
|
+
|
|
875
|
+
- **`createAgentSessionServices({ cwd, agentDir?, settingsManager?, modelRuntime?, ... })`:** Builds shared `AgentSessionServices` (`cwd`, `agentDir`, `modelRuntime`, `settingsManager`, `resourceLoader`, `diagnostics`).
|
|
876
|
+
- **`createAgentSessionFromServices({ services, sessionManager, sessionStartEvent?, ... })`:** Creates an `AgentSession` backed by those shared services without re-discovering extensions, skills, or models.
|
|
811
877
|
|
|
812
878
|
`SessionManager.create()`, `open()`, `continueRecent()`, `forkFrom()`, and all mutations are asynchronous. `SessionManager.inMemory()` with no entries is synchronous; when supplying entries, await `SessionManager.inMemory(cwd, options, entries)` and keep the input array stable until it resolves. A resolved write is committed (there is no `flush()` method), and a failed write rejects with the store's typed error without publishing the entry. Reads remain synchronous.
|
|
813
879
|
|
|
@@ -978,7 +1044,7 @@ const loader = new DefaultResourceLoader({
|
|
|
978
1044
|
});
|
|
979
1045
|
```
|
|
980
1046
|
|
|
981
|
-
During interactive startup,
|
|
1047
|
+
During interactive startup, Atomic can run resource discovery twice (before and after optional extensions finish loading). Both calls run, and if the same registration reports the same error, the terminal shows it once. A later `/reload` reports the failure again.
|
|
982
1048
|
|
|
983
1049
|
Creating `(...args) => handler(...args)` on every load registers a new callback each time, so you can see two startup errors. Keep separate callbacks when your override changes the handler, adds a step that can fail, or forwards on behalf of separate installations. Don't cache a previous load's handler or share a forwarder by extension name.
|
|
984
1050
|
|
|
@@ -990,13 +1056,16 @@ Creating `(...args) => handler(...args)` on every load registers a new callback
|
|
|
990
1056
|
interface CreateAgentSessionResult {
|
|
991
1057
|
// The session
|
|
992
1058
|
session: AgentSession;
|
|
993
|
-
|
|
1059
|
+
|
|
994
1060
|
// Extensions result (for runner setup)
|
|
995
1061
|
extensionsResult: LoadExtensionsResult;
|
|
996
|
-
|
|
1062
|
+
|
|
997
1063
|
// Warning if session model couldn't be restored
|
|
998
1064
|
modelFallbackMessage?: string;
|
|
999
1065
|
|
|
1066
|
+
// Machine-readable fallback reason when startup fell back from a requested or saved model
|
|
1067
|
+
modelFallbackReason?: ModelFallbackReason;
|
|
1068
|
+
|
|
1000
1069
|
// The resolved binding when the session was created with `workspace`
|
|
1001
1070
|
workspace?: BoundWorkspace;
|
|
1002
1071
|
}
|
|
@@ -1052,13 +1121,13 @@ const mode = new InteractiveMode(runtime, {
|
|
|
1052
1121
|
await mode.run();
|
|
1053
1122
|
```
|
|
1054
1123
|
|
|
1055
|
-
If you quit the host or call `session.dispose()` during the initial interactive extension bind, `await mode.init()` or `await mode.run()` returns normally. The disposed session does not enter the input loop. This also applies when an incoming event or a pending provider retry started the UI. Track your own shutdown request instead of
|
|
1124
|
+
If you quit the host or call `session.dispose()` during the initial interactive extension bind, `await mode.init()` or `await mode.run()` returns normally. The disposed session does not enter the input loop. This also applies when an incoming event or a pending provider retry started the UI. Track your own shutdown request instead of checking for `code: "SessionClosed"` errors to detect it.
|
|
1056
1125
|
|
|
1057
|
-
Replacing the session during the initial bind is not a quit: the interrupted startup still rejects. If you dispose only the session and then create a replacement with `await runtime.newSession()`, call `mode.run()` again to accept input for the replacement. Direct `session.bindExtensions()` and `mode.handleEvent(event)` calls still reject on close, so custom handlers can catch startup failures and report errors from their recovery work.
|
|
1126
|
+
Replacing the session during the initial bind is not a quit: the interrupted startup still rejects. If you dispose only the session and then create a replacement with `await runtime.newSession()`, call `mode.run()` again to accept input for the replacement. Direct `session.bindExtensions()` and `mode.handleEvent(event)` calls still reject on close (with an `Error` tagged `code: "SessionClosed"`), so custom handlers can catch startup failures and report errors from their recovery work.
|
|
1058
1127
|
|
|
1059
1128
|
### runPrintMode
|
|
1060
1129
|
|
|
1061
|
-
Single-shot mode: send prompts, output
|
|
1130
|
+
Single-shot mode: send prompts, output text or JSONL events, and return the exit code (`Promise<number>`, `0` on success or `1` on fatal error):
|
|
1062
1131
|
|
|
1063
1132
|
```typescript
|
|
1064
1133
|
import {
|
|
@@ -1085,7 +1154,7 @@ const runtime = await createAgentSessionRuntime(createRuntime, {
|
|
|
1085
1154
|
sessionManager: await SessionManager.create(process.cwd()),
|
|
1086
1155
|
});
|
|
1087
1156
|
|
|
1088
|
-
await runPrintMode(runtime, {
|
|
1157
|
+
const exitCode = await runPrintMode(runtime, {
|
|
1089
1158
|
mode: "text",
|
|
1090
1159
|
initialMessage: "Hello",
|
|
1091
1160
|
initialImages: [],
|
|
@@ -1176,7 +1245,7 @@ try {
|
|
|
1176
1245
|
|
|
1177
1246
|
## Session start errors
|
|
1178
1247
|
|
|
1179
|
-
|
|
1248
|
+
A subagent that does not start within its start budget fails with a `SessionStartTimeoutError`; see [Subagent start timeouts](/subagents#subagent-start-timeouts) for the budget and how to change it. The child's result carries it serialized as `startError`, and its `error` text is the error's `message`. Every error in this family extends `SessionStartError`. Branch on the class, a guard, or `code`, never on the message:
|
|
1180
1249
|
|
|
1181
1250
|
| Class | `code` | When | Fields | What to do |
|
|
1182
1251
|
| --- | --- | --- | --- | --- |
|
|
@@ -1201,9 +1270,9 @@ if (startError && isRetryableSessionStartError(startError)) {
|
|
|
1201
1270
|
These helpers let extensions and SDK code follow [debug mode](/development#debugging):
|
|
1202
1271
|
|
|
1203
1272
|
- `isDebugEnabled(area?, env?)` returns whether debug mode is on. The same setting applies to every area. `env` defaults to `process.env`.
|
|
1204
|
-
- `reportDebug(area, event, fields,
|
|
1205
|
-
- `appendDebugRecord(path, record)` appends one redacted JSON line to another debug file, such as a trace file.
|
|
1206
|
-
- `appendDebugRecordAsync(path, record)` and `reportDebugAsync(area, event, fields,
|
|
1273
|
+
- `reportDebug(area, event, fields, env?)` records one event. In debug mode it appends a JSON line to the debug log, with credentials redacted and long text cut to 2,000 characters. `fields` holds strings, numbers, booleans, `null`, or lists of strings and numbers, never objects.
|
|
1274
|
+
- `appendDebugRecord(path, record)` appends one redacted JSON line to another debug file, such as a trace file. Both `appendDebugRecord()` and `reportDebug()` write synchronously and report failures immediately.
|
|
1275
|
+
- `appendDebugRecordAsync(path, record)` and `reportDebugAsync(area, event, fields, env?)` provide the same redaction and reporting without blocking the host. Await their promises to observe the completed write, or call `flushDebugLog()` to wait for all queued debug records.
|
|
1207
1276
|
- `DEBUG_AREA_VARIABLES` lists `decision`, `storage` and `engine`. All have value `undefined`: there are no separate environment switches for these areas.
|
|
1208
1277
|
- `getDebugLogFailure()` returns the first `DebugLogUnwritableError` of this process, if writing a debug log ever failed.
|
|
1209
1278
|
- `setDebugSetting(enabled)` turns debug mode on or off for this process and for child processes it starts afterwards. It does not save the `debug` setting.
|
|
@@ -1218,7 +1287,11 @@ These helpers let extensions and SDK code follow [debug mode](/development#debug
|
|
|
1218
1287
|
|
|
1219
1288
|
Both extend `DebugError`, whose `code` is a `DebugErrorCode` and whose `fields()` returns the fields above. Branch on the class or `code`, not the message. `isDebugError`, `isDebugLogUnwritableError` and `isDebugConfigError` recognize them, including an error that crossed a process boundary as a plain object with the same `name` and `code`.
|
|
1220
1289
|
|
|
1221
|
-
To pass one between processes, `serializeDebugError(error)` turns it into a `SerializedDebugError` (`name`, `code`, `message`, `hint`, `retryable`, `fields`, and a cause chain of at most eight errors), and `rehydrateDebugError(serialized)` rebuilds the same class with the same fields. An unknown `name` comes back as a `DebugError` that keeps its `name`, `code`, `fields` and `retryable`. The RPC client does this for you: when
|
|
1290
|
+
To pass one between processes, `serializeDebugError(error)` turns it into a `SerializedDebugError` (`name`, `code`, `message`, `hint`, `retryable`, `fields`, and a cause chain of at most eight errors), and `rehydrateDebugError(serialized)` rebuilds the same class with the same fields. An unknown `name` comes back as a `DebugError` that keeps its `name`, `code`, `fields` and `retryable`. The RPC client does this for you: when Atomic refuses `set_debug`, `setDebug()` rejects with the `DebugConfigError`.
|
|
1291
|
+
|
|
1292
|
+
### Compaction errors
|
|
1293
|
+
|
|
1294
|
+
Compaction settings, session compaction calls, and direct `requestCompactorOutput()` calls throw subclasses of `CompactionError` (`CompactionConfigError`, `CompactionCancelledError`, `CompactionStateError`, and `CompactorFailure`). Branch on the class or `code`, not the message. Every `CompactionError` exposes `code`, `hint`, `retryable`, and `fields()`, and comes with cross-realm guards (`isCompactionError`, `isCompactionConfigError`, `isCompactionCancelledError`, `isCompactionStateError`, `isCompactorFailure`, `findCompactionError`, `isRetryableCompactionError`) plus `serializeCompactionError()`, `parseSerializedCompactionError()`, and `rehydrateCompactionError()`. The RPC client automatically rehydrates `compaction_error` responses (for example when `set_compaction_model` or `compact` rejects). See [Compaction errors](/compaction/reference#compaction-errors).
|
|
1222
1295
|
|
|
1223
1296
|
## Nonblocking helpers
|
|
1224
1297
|
|
|
@@ -1258,20 +1331,49 @@ On Windows, the native module reads directory ownership and access lists directl
|
|
|
1258
1331
|
The main entry point exports:
|
|
1259
1332
|
|
|
1260
1333
|
```typescript
|
|
1261
|
-
//
|
|
1334
|
+
// Session factories and runtime
|
|
1262
1335
|
createAgentSession
|
|
1336
|
+
createAgentSessionServices
|
|
1337
|
+
createAgentSessionFromServices
|
|
1263
1338
|
createAgentSessionRuntime
|
|
1339
|
+
AgentSession
|
|
1264
1340
|
AgentSessionRuntime
|
|
1341
|
+
AgentSessionBusyError, isAgentSessionBusyError
|
|
1342
|
+
NativeModuleUnavailableError
|
|
1265
1343
|
|
|
1266
1344
|
// Auth and Models
|
|
1345
|
+
ModelRuntime
|
|
1346
|
+
type CreateModelRuntimeOptions
|
|
1347
|
+
type ModelRuntimeAuthOverrides
|
|
1348
|
+
CredentialSynchronizationError
|
|
1267
1349
|
AuthStorage
|
|
1350
|
+
readStoredCredential
|
|
1268
1351
|
ModelRegistry
|
|
1269
1352
|
resolveAutoModel
|
|
1353
|
+
resolveRestoredModelReference
|
|
1270
1354
|
resolveModelScopeFromModels
|
|
1271
1355
|
resolveModelScopeWithDiagnostics
|
|
1272
1356
|
type ResolveModelScopeResult
|
|
1273
1357
|
type ModelScopeDiagnostic
|
|
1274
1358
|
OAuthLoginTransactionError
|
|
1359
|
+
GitHubCopilotError, GitHubCopilotAuthenticationError, GitHubCopilotContentFilterError
|
|
1360
|
+
GitHubCopilotEmptyResponseError, GitHubCopilotInvalidRequestError, GitHubCopilotModelUnavailableError
|
|
1361
|
+
GitHubCopilotPromptTooLargeError, GitHubCopilotQuotaExhaustedError, GitHubCopilotRateLimitError
|
|
1362
|
+
GitHubCopilotServiceUnavailableError, GitHubCopilotStreamEndedEarlyError, GitHubCopilotUnrecognizedResponseError
|
|
1363
|
+
LlamaServerError, LlamaServerRequestError, LlamaServerUnreachableError
|
|
1364
|
+
|
|
1365
|
+
// Workspaces and Intercom policy
|
|
1366
|
+
workspace
|
|
1367
|
+
bindSessionWorkspace
|
|
1368
|
+
resolveWorkspace
|
|
1369
|
+
restoreWorkspace
|
|
1370
|
+
workspaceChangeSet
|
|
1371
|
+
publishPullRequest
|
|
1372
|
+
WorkspaceError, WorkspaceConfigError, WorkspaceBindingError, WorkspaceGitError
|
|
1373
|
+
WorkspaceSnapshotError, WorkspaceRestoreError, WorkspaceDriftError, WorkspacePublicationError
|
|
1374
|
+
isWorkspaceError, findWorkspaceError, isRetryableWorkspaceError, serializeWorkspaceError, rehydrateWorkspaceError
|
|
1375
|
+
IntercomPolicyError
|
|
1376
|
+
MAX_INTERCOM_REACHABLE_GROUPS
|
|
1275
1377
|
|
|
1276
1378
|
// Resource loading
|
|
1277
1379
|
DefaultResourceLoader
|
|
@@ -1332,7 +1434,7 @@ type Transcript
|
|
|
1332
1434
|
type TranscriptOptions
|
|
1333
1435
|
type TranscriptPart
|
|
1334
1436
|
|
|
1335
|
-
// Session management
|
|
1437
|
+
// Session management and resume
|
|
1336
1438
|
SessionManager
|
|
1337
1439
|
SettingsManager
|
|
1338
1440
|
JsonlSessionStore
|
|
@@ -1363,6 +1465,10 @@ SettingsFileChangedError
|
|
|
1363
1465
|
JsonlStoragePoisonedError
|
|
1364
1466
|
StorageTransferError
|
|
1365
1467
|
StorageImportIncompleteError
|
|
1468
|
+
ResumeError, ResumeNotFoundError, ResumePreconditionError, ResumeCatalogUnavailableError, ResumeCatalogTimeoutError
|
|
1469
|
+
isResumeError, findResumeError, isRetryableResumeError, serializeResumeError, rehydrateResumeError
|
|
1470
|
+
BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, BlueprintBuildFailedError
|
|
1471
|
+
isBlueprintError, findBlueprintError, serializeBlueprintError, rehydrateBlueprintError
|
|
1366
1472
|
type SessionJsonValue
|
|
1367
1473
|
type SessionTextField
|
|
1368
1474
|
type SessionTimestampField
|
|
@@ -1380,7 +1486,7 @@ DecisionTimeoutError, DecisionOutputError, DecisionProviderError
|
|
|
1380
1486
|
type DecisionErrorCode, DecisionConfigErrorCode, DecisionRequestErrorReason, DecisionModelUnavailableReason
|
|
1381
1487
|
isDecisionError, isDecisionConfigError, isDecisionRequestError, isDecisionModelUnavailableError
|
|
1382
1488
|
isDecisionTimeoutError, isDecisionOutputError, isDecisionProviderError
|
|
1383
|
-
findDecisionError, isRetryableDecisionError, serializeDecisionError, rehydrateDecisionError
|
|
1489
|
+
findDecisionError, isRetryableDecisionError, serializeDecisionError, parseSerializedDecisionError, rehydrateDecisionError
|
|
1384
1490
|
|
|
1385
1491
|
// Session start errors
|
|
1386
1492
|
SessionStartError
|
|
@@ -1405,19 +1511,27 @@ type SessionStartConfigSource
|
|
|
1405
1511
|
type SessionStartConfigReason
|
|
1406
1512
|
type SerializedSessionStartError
|
|
1407
1513
|
type SerializedSessionStartCause
|
|
1514
|
+
|
|
1408
1515
|
// Finished task retention (see "Owner-bound task supervisor")
|
|
1409
1516
|
FINISHED_TASK_RETENTION
|
|
1410
1517
|
TaskEvictedError, isTaskEvictedError, findTaskEvictedError, rehydrateTaskEvictedError
|
|
1411
1518
|
type TaskEvictedErrorCode, type TaskEvictedErrorFields
|
|
1412
1519
|
TaskToolError, isTaskToolError, rehydrateTaskToolError
|
|
1413
1520
|
type TaskToolFailureCode, type TaskToolErrorFields, type SerializedTaskToolError
|
|
1521
|
+
|
|
1414
1522
|
// Messages typed into a task's transcript (see "Task transcript references")
|
|
1415
1523
|
TaskMessageError, TaskMessageTimeoutError, isTaskMessageError, isTaskMessageTimeoutError
|
|
1416
1524
|
findTaskMessageError, isRetryableTaskMessageError, rehydrateTaskMessageError
|
|
1417
1525
|
type TaskMessageErrorCode, type TaskMessageErrorFields, type TaskMessageTimeoutErrorFields
|
|
1418
1526
|
type TaskMessageTimeoutPhase, type SerializedTaskMessageError
|
|
1419
|
-
|
|
1527
|
+
|
|
1528
|
+
// Detachable tool calls (see "Detachable tool calls")
|
|
1529
|
+
ToolDetachmentError, isToolDetachmentError, findToolDetachmentError, deserializeToolDetachmentError
|
|
1530
|
+
MAX_TOOL_DETACHMENT_AFTER_MS
|
|
1531
|
+
markToolCallReadyForDetachment, toolCallNeedsDetachmentHandoff
|
|
1532
|
+
type ToolDetachmentErrorCode, type ToolDetachmentErrorFields, type SerializedToolDetachmentError
|
|
1420
1533
|
type DetachedCallFailure, type DetachedCallFailureCause
|
|
1534
|
+
|
|
1421
1535
|
// Git resolution (see "Resolving git")
|
|
1422
1536
|
resolveGit, resolveGitSync, resolveInstalledGit, getGitStatus, getGitStatusAsync, GIT_MINIMUM_VERSION
|
|
1423
1537
|
GitProvisionError, GitUnavailableError, GitProvisionTimeoutError, GitProvisionConfigError
|
|
@@ -1436,7 +1550,10 @@ type ManagedToolName, type ManagedToolRequestPhase, type ManagedToolErrorCode, t
|
|
|
1436
1550
|
// Debug output
|
|
1437
1551
|
isDebugEnabled
|
|
1438
1552
|
reportDebug
|
|
1553
|
+
reportDebugAsync
|
|
1439
1554
|
appendDebugRecord
|
|
1555
|
+
appendDebugRecordAsync
|
|
1556
|
+
flushDebugLog
|
|
1440
1557
|
DEBUG_AREA_VARIABLES
|
|
1441
1558
|
getDebugLogFailure
|
|
1442
1559
|
setDebugSetting
|
|
@@ -1489,17 +1606,32 @@ isSubscriptionSetupError, isSubscriptionSubscriberUnavailableError, isSubscripti
|
|
|
1489
1606
|
isRetryableSubscriptionError, serializeSubscriptionError, deserializeSubscriptionError
|
|
1490
1607
|
type SubscriptionErrorCode, type SubscriptionConfigReason, type SubscriptionSetupMissing, type SubscriberUnavailableReason, type SubscriptionRecordKind, type SubscriptionTimeoutPhase, type WebhookRequestFailures
|
|
1491
1608
|
|
|
1492
|
-
// Tool factories
|
|
1609
|
+
// Tool factories and shell/file tool errors
|
|
1493
1610
|
createCodingTools
|
|
1494
1611
|
createReadOnlyTools
|
|
1495
1612
|
createReadTool, createBashTool, createPowerShellTool, createKillTool
|
|
1496
1613
|
createEditTool, createWriteTool, createSearchTool, createFindTool, createLsTool
|
|
1497
|
-
|
|
1498
|
-
// Edit and write errors (see Built-in tools: Edit and write errors)
|
|
1614
|
+
ShellToolError, ShellTimeoutError, isShellToolError, isShellTimeoutError, rehydrateShellToolError
|
|
1499
1615
|
EditToolError, EditInputError, EditMatchError, EditTargetError, WriteSelectorError, FileToolAbortedError
|
|
1500
1616
|
isEditToolError, isEditInputError, isEditMatchError, isEditTargetError, isWriteSelectorError, isFileToolAbortedError
|
|
1501
1617
|
serializeFileToolError, rehydrateEditToolError, rehydrateWriteSelectorError
|
|
1502
1618
|
|
|
1619
|
+
// Compaction, errors, and custom compactor models
|
|
1620
|
+
type CompactorModel, type CompactorApi
|
|
1621
|
+
type ProviderCompactorModelConfig, type ProviderChatModelConfig, type ProviderClassifierModelConfig, type ProviderImageModelConfig
|
|
1622
|
+
type CompactorRequest, type CompactorMessage, type CompactionModelSelection, type CompactionModelKind
|
|
1623
|
+
CompactionError, CompactionConfigError, CompactionCancelledError, CompactionStateError, CompactorFailure
|
|
1624
|
+
type CompactionErrorCode, type CompactionConfigErrorCode, type CompactionStateErrorCode, type CompactorFailureCode
|
|
1625
|
+
type CompactionConfigSource, type CompactionSettingsScope, type CompactionCancelReason, type CompactionErrorFieldValue
|
|
1626
|
+
type CompactionConfigErrorFields, type CompactionCancelledErrorFields, type CompactionStateErrorFields, type CompactorFailureOptions
|
|
1627
|
+
type SerializedCompactionError
|
|
1628
|
+
isCompactionError, isCompactionConfigError, isCompactionCancelledError, isCompactionStateError, isCompactorFailure
|
|
1629
|
+
findCompactionError, isRetryableCompactionError, serializeCompactionError, parseSerializedCompactionError, rehydrateCompactionError
|
|
1630
|
+
requestCompactorOutput, buildCompactorMessages, compactedOutputTokenCap, classifyCompactionModel, resolveCompactionModel
|
|
1631
|
+
estimateTextTokens, wrapLongLines
|
|
1632
|
+
COMPACTOR_REQUEST_TIMEOUT_MS, COMPACTOR_LINE_WIDTH
|
|
1633
|
+
COMPACTED_OUTPUT_MAX_TOKENS, COMPACTED_OUTPUT_MAX_TRIGGER_SHARE
|
|
1634
|
+
|
|
1503
1635
|
// Types
|
|
1504
1636
|
type CreateAgentSessionOptions
|
|
1505
1637
|
type CreateAgentSessionResult
|
|
@@ -1517,8 +1649,6 @@ type Tool
|
|
|
1517
1649
|
|
|
1518
1650
|
For extension types, see [Extensions](/extensions) for the full API.
|
|
1519
1651
|
|
|
1520
|
-
<a id="owner-bound-task-supervisor-s1" />
|
|
1521
|
-
|
|
1522
1652
|
## Owner-bound task supervisor
|
|
1523
1653
|
|
|
1524
1654
|
For trusted custom hosts, the package exports `AgentTaskHost` and its integration types rather than the raw native supervisor. Bind the host scope and a mandatory `authorizeLaunch` guard. Never accept ownership or authorization from model input or reconstruct a lease from a task ID or saved history.
|