@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/tools.md
CHANGED
|
@@ -1,74 +1,80 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Built-in tools"
|
|
3
|
-
|
|
3
|
+
sidebarTitle: "Built-in tools"
|
|
4
|
+
description: "Reference for Atomic's default coding tools, path and resource selectors, background shell execution, task tracking, and output persistence."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
By default, Atomic enables `read`, `write`, `edit`, `bash`, `kill`, `find`, `search`, `ask_user_question`, `todo`, and `codemode` (plus `powershell` on native Windows when `pwsh.exe` or `powershell.exe` is on `PATH`). Two more built-in tools, `ls` and `tool_search`, are off by default and can be enabled with `--tools` or `defaultTools`.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- [Read files and select lines](#read-and-path-selectors)
|
|
11
|
-
- [Find paths and search contents](#find-and-search)
|
|
9
|
+
- [Read files, archives, SQLite, and URLs](#read-and-path-selectors)
|
|
12
10
|
- [Edit existing files](#edit) or [write files](#write)
|
|
13
11
|
- [Run shell commands](#bash) or [stop background shells](#kill)
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
12
|
+
- [Find paths and search contents](#find-and-search) or [list directories](#ls)
|
|
13
|
+
- [Track file-based tasks with `todo`](#todo) or [ask interactive questions](#ask_user_question)
|
|
14
|
+
- [Compose tool calls with `codemode`](#codemode) or [discover deferred tools](#tool_search)
|
|
16
15
|
|
|
17
16
|
Bundled integrations also add [public repository search](#code_search), [web access](/web-access), and [MCP servers](/mcp-servers).
|
|
18
17
|
|
|
19
|
-
**
|
|
18
|
+
**Tool concurrency.** Within a single assistant turn, `edit`, `write`, `todo`, `ask_user_question`, and `bash` or `powershell` with `pty: true` run one at a time in call order. `read`, `find`, `search`, `ls`, and non-PTY shell commands can run in parallel.
|
|
19
|
+
|
|
20
|
+
**Inspecting active tools.** Run `/tools` to see active tools, why inactive tools are off, and any unregistered names in `defaultTools`. Its **Git** section reports which `git` binary Atomic uses: `system` (from your `PATH`), `provisioned` (Atomic's managed portable Git copy), or `unavailable` (with an install command), plus any failed portable Git update. See [Git](/getting-started/installation#git). SDK and RPC clients get the same report from [`session.getToolStatus()`](/sdk/reference#checking-tool-status) and [`get_tools`](/rpc/protocol#get_tools). If portable Git cannot be selected, ordinary shell commands still run while Git-dependent features report the error.
|
|
20
21
|
|
|
21
22
|
**Malformed tool arguments.** If a model produces invalid or truncated JSON tool arguments, Atomic rejects the call instead of executing a partial request and returns the original arguments so the model can retry.
|
|
22
23
|
|
|
23
|
-
## `
|
|
24
|
+
## `read` and path selectors
|
|
24
25
|
|
|
25
|
-
`
|
|
26
|
+
`read` reads files, directories, images, documents, archives, SQLite databases, internal Atomic resources, and public HTTP(S) URLs through one `path` parameter.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
Reading a directory returns a depth-2 tree sorted by most-recent modification time (with sizes and ages). It prunes `.git` and `node_modules` and caps each child directory at 12 entries while preserving the oldest shown entry with an elision marker.
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
{ "defaultTools": ["-codemode"] }
|
|
31
|
-
```
|
|
30
|
+
### Lines and local resources
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
For local text files, `read` returns plain text with LF line endings, no per-line numbers, and no trailing newline. Existing file or directory names take priority over selector parsing (so `notes:0` or `build:12` reads that literal file when it exists). Otherwise, a trailing `:...` is parsed as a selector:
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
- **Line selectors.** Supported forms are `file.ts:5-16`, `file.ts:L5-L16`, `file.ts:5..16`, `file.ts:5+3` (start plus count), `file.ts:5-` or `file.ts:5` (line 5 to end of file without widening), `file.ts:5:16` (colon range or grep-style `file:LINE:COL`), comma-separated ranges (`file.ts:5-16,960-973`), and URL line ranges (`https://example.test/page:5-8`). Line numbers are 1-indexed (`:0` fails with an error), and adjacent or overlapping ranges sort and merge automatically. Bounded reads add 1 leading and 3 trailing context lines, prefix each slice with `[Lines 9-14 of 40]`, and end limited reads with the continuation selector. Append `:raw` for exact bytes, CRLF endings, or raw notebook JSON without labels. Out-of-range selectors report beyond EOF. On `history://sessions/<id>:A-B`, numbers select 1-indexed session entries rather than lines.
|
|
35
|
+
- **Oversized selected ranges.** If an explicit selected range exceeds 50,000 characters (or 50 KiB for archive, SQLite, document, internal resource, or URL selectors), `read` stops with an error (`isError: true`) and asks for a narrower range or byte slice instead of silently truncating.
|
|
36
|
+
- **Images.** `read` detects supported image files, resizes them automatically by default (`autoResizeImages: true`, matching the active model's resize profile), and returns an image block. If the active model does not accept image inputs, the result sets `details.imageUnsupportedByModel`.
|
|
37
|
+
- **Archives (`read`, `search`, `write`).** Supports `.zip`, `.jar`, `.tar`, `.tgz`, `.tar.gz`, and `.gz` members without Python. Limits are 256 MiB per tar archive, 64 MiB per member, and 500 entries per directory listing. Member names may contain `raw`, `conflicts`, `1`, `L1`, or `raw:notes.txt`. Archive writes reject directory targets ending in `/`. Tar writes preserve all other members and file modes and refuse to overwrite links, directories, duplicate members, or damaged headers.
|
|
38
|
+
- **SQLite (`read`, `search`, `write`).** Supports `.sqlite`, `.sqlite3`, `.db`, and `.db3` files (including Windows drive paths). Select tables and rows with `limit`, `offset`, `where`, `order`, `schema`, `sampleRows` (or `sample_rows`), and `id`. Non-SQLite files with those extensions are treated as plain files.
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
// @options: {"max_output_tokens": 2000, "timeout_ms": 60000}
|
|
39
|
-
const files = await Promise.all([
|
|
40
|
-
tools.read({ path: "README.md" }),
|
|
41
|
-
tools.read({ path: "package.json" }),
|
|
42
|
-
]);
|
|
43
|
-
return files.map((text) => text.slice(0, 1000));
|
|
44
|
-
```
|
|
40
|
+
### Internal URLs and web schemes
|
|
45
41
|
|
|
46
|
-
|
|
47
|
-
- **Sandbox and permissions.** Runs with no Node, filesystem, network, timer, or credential globals. Tool calls run with the session's permissions, and side effects are not rolled back if a script fails.
|
|
48
|
-
- **Settings and MCP.** Configure `codemode.inlineBudget` (default `3000` estimated tokens) and `codemode.mode` in [tool settings](/settings#tools). Atomic's [MCP host](/mcp-servers) remains the sole MCP connection owner.
|
|
42
|
+
Each URL scheme has a fixed set of supported tools and permissions:
|
|
49
43
|
|
|
50
|
-
|
|
44
|
+
| Scheme | Supported tools | Access | Purpose |
|
|
45
|
+
| --- | --- | --- | --- |
|
|
46
|
+
| `local://` | `read`, `search`, `write`, `find`, `bash` | Read and write | Workspace-relative local resources mapped to their underlying filesystem paths. |
|
|
47
|
+
| `skill://` | `read`, `search`, `find`, `bash` | Read-only | `skill://<name>` reads `<skill-dir>/SKILL.md`; `skill://<name>/<subpath>` reads files inside the skill directory. Edit skills by filesystem path. |
|
|
48
|
+
| `artifact://<id>` | `read`, `search`, `find`, `bash` | Read-only | Saved tool output artifacts. |
|
|
49
|
+
| `conflict://` | `read`, `search`, `write` | Read and write | Inspect and resolve Git merge conflicts under the working directory (individual sides are read-only; rejected by `find`; stays literal in `bash`). |
|
|
50
|
+
| `history://` | `read`, `search` | Read-only | Past sessions for this project ([Recalling earlier work](/sessions#recalling-earlier-work)) (rejected by `find` and `write`; stays literal in `bash`). |
|
|
51
|
+
| `tool-output://<sha256>` | `read`, `search` | Read-only | Persisted session-blob tool output, including line ranges like `tool-output://<sha256>:1-200` (rejected by `find` and `write`; stays literal in `bash`). |
|
|
52
|
+
| `http://`, `https://` | `read` | Read-only | Public web pages (rejected by `search` and `write`; stays literal in `bash`). |
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
Any other `scheme://` is rejected by `read`, `search`, and `write`, and stays literal text in `bash`. Workspace-scoped selectors block lexical and symlink escapes outside the workspace or skill root. Cancelling `read` or `find` throws `FileToolAbortedError` (see [Edit and write errors](#edit-and-write-errors)).
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
### SQLite limits and writes
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
- **Read limits.** Table reads return the schema plus 5 sample rows by default (`sampleRows` or `sample_rows` clamps from `0` to `100`, `schema=true` or `schema=1` requests schema output, `order=col:asc,col2:desc` sets sort order defaulting to `asc`, and `id` aliases `:rowId`). Query reads default to 20 rows (max 500). Raw `?q=` accepts a single `SELECT` statement only (max 1,000 rows) and blocks `sqlite_%`, `pragma_*`, `ATTACH`, `DETACH`, `UNION`, `INTERSECT`, `EXCEPT`, `INSERT`, `UPDATE`, `DELETE`, `DROP`, `ALTER`, `CREATE`, `REPLACE`, `VACUUM`, `REINDEX`, `load_extension`, comments (`--` and `/*`), and `;`. Table listings cap at 500 (excluding `sqlite_%`); row counts probe up to 50,001 rows.
|
|
59
|
+
- **Writes.** Table writes accept `{}` (`INSERT DEFAULT VALUES`). Row writes accept non-empty JSON5 objects (unquoted keys, single quotes, comments, trailing commas, `+`, and hex numbers) and validate columns and scalar values. Empty row writes delete only when a row ID is specified.
|
|
60
|
+
- **Row addressing.** Target a row by primary key (`data.sqlite:users:42`), `rowid` (tables without a primary key), or a full JSON array for composite keys (`data.sqlite:members:["acme",2]`; partial keys are rejected). Row IDs are never misread as line ranges (`data.sqlite:events:2024-01-05`), untyped key columns match numeric IDs numerically, and any update or delete affecting more than 1 row is aborted.
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
### Conflict resolution and file writes
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
- **Reading.** `conflict://*` lists up to 100 conflict regions across up to 10,000 scanned files under the working directory (skipping `.git`, `node_modules`, and `.gitignore` or `.ignore` paths; files previously read with `:conflicts` appear first in read order). Conflict IDs are 1-indexed (`conflict://1`, never `conflict://0`). `conflict://<id>` shows `ours`, `theirs`, and `base`; `conflict://<id>/ours`, `theirs`, or `base` returns one read-only side.
|
|
65
|
+
- **Matching.** Matches exact Git 7-character markers (`<<<<<<<`, `|||||||`, `=======`, `>>>>>>>`, alone or followed by a space and label) in order. Longer runs such as markdown `==========` stay untouched, and malformed regions are skipped.
|
|
66
|
+
- **Writing.** Write to `conflict://<id>` or `conflict://*` using literal text or `@ours`, `@theirs`, and `@base` (preserving that side's exact bytes). Other text writes as UTF-8 using the region's line endings while keeping the rest of the file byte-identical. Stale conflicts that changed on disk since reading are refused.
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
code_search({ repoName: "facebook/react", query: "How does useEffect cleanup work?" })
|
|
64
|
-
```
|
|
68
|
+
### Documents and URLs
|
|
65
69
|
|
|
66
|
-
- **
|
|
67
|
-
- **
|
|
70
|
+
- **Formats.** Extracts readable text from HTML URLs, Jupyter notebooks (0-based `cell:N` IDs, preserving unknown fields), and PDF, `.doc`, `.docx`, `.ppt`, `.pptx`, `.xls`, `.xlsx`, `.rtf`, and `.epub` documents (including extensionless downloads identified by `Content-Type`).
|
|
71
|
+
- **URL fetching.** Public HTTP(S) fetches use a 10-second timeout, follow up to 5 redirects, cap response bodies at 10 MiB, and keep a session-scoped cache of 100 entries. Atomic checks for native markdown representations first (alternate `<link>`, `.md` suffix, `Accept: text/markdown`, `llms.txt`, and `llms.md`) and converts HTML to markdown otherwise.
|
|
72
|
+
- **Output caps.** Unselected local text reads cap at 3,000 lines or 50 KiB; unselected URL reads cap at 300 rendered lines or 50 KiB (truncated with metadata rather than blocked). Explicit selected ranges over 50,000 characters (or 50 KiB for resource selectors) stop with an error instead of truncating. Successful reads populate `details.meta.source`, `sourcePath`, `truncation`, and `limits`.
|
|
73
|
+
- **Network safety.** Blocks private, localhost, cloud-metadata, multicast, and reserved IP targets (including alternate numeric IPv4 and IPv6 forms and redirects). Use public URLs.
|
|
68
74
|
|
|
69
75
|
## `edit`
|
|
70
76
|
|
|
71
|
-
`edit` applies exact-text replacements to one existing file (`path`
|
|
77
|
+
`edit` applies exact-text replacements to one existing file (`path` plus `edits: [{ oldText, newText }]`). It also accepts a single edit object, a JSON-stringified `edits` array or object, or legacy top-level `{ path, oldText, newText }`:
|
|
72
78
|
|
|
73
79
|
```json
|
|
74
80
|
{
|
|
@@ -80,152 +86,118 @@ code_search({ repoName: "facebook/react", query: "How does useEffect cleanup wor
|
|
|
80
86
|
}
|
|
81
87
|
```
|
|
82
88
|
|
|
83
|
-
- **Unique, non-overlapping matches
|
|
84
|
-
- **No prior `read` required
|
|
85
|
-
- **Fallback normalization
|
|
86
|
-
- **Encoding
|
|
87
|
-
- **Atomicity
|
|
88
|
-
- **Notebooks
|
|
89
|
+
- **Unique, non-overlapping matches.** Each `oldText` must match exactly once against the current file (overlapping occurrences count: `}\n}` occurs twice in `}\n}\n}`). Edits match against the original file simultaneously and cannot overlap; merge adjacent changes into one edit.
|
|
90
|
+
- **No prior `read` required.** Matches against the file's current bytes on disk, even if changed by `bash` or another process.
|
|
91
|
+
- **Fallback normalization.** If no exact match exists, `edit` retries after applying NFKC normalization per grapheme cluster, stripping trailing whitespace per line, and mapping smart single quotes (`U+2018` through `U+201B` to `'`), smart double quotes (`U+201C` through `U+201F` to `"`), Unicode dashes (`U+2010` through `U+2015` and `U+2212` to `-`), and Unicode spaces (`U+00A0`, `U+2002` through `U+200A`, `U+202F`, `U+205F`, and `U+3000` to ASCII space). Normalization locates the region only; `newText` replaces that exact slice and leaves surrounding bytes untouched. A single exact match always wins over normalized matches.
|
|
92
|
+
- **Encoding and line endings.** UTF-8 text only (invalid UTF-8 fails with `target-not-utf8`). `oldText` and `newText` cannot split surrogate pairs (`text-splits-character`). Preserves UTF-8 BOM and surrounding line endings (LF, CRLF, or lone CR when the file contains no LF at all); newlines in `newText` adopt the line ending where the match starts.
|
|
93
|
+
- **Atomicity.** Either all edits apply or the file stays unchanged.
|
|
94
|
+
- **Notebooks.** `.ipynb` files are edited using the `# %% [code] cell:N` format shown by `read`, preserving cell metadata, outputs, and execution counts.
|
|
89
95
|
|
|
90
|
-
Returns the replacement count plus `details` (`diff`, unified `patch`, and `firstChangedLine`). Interactive mode previews file diffs as soon as arguments arrive (notebook diffs appear with the result).
|
|
96
|
+
Returns the replacement count plus `details` (`diff`, unified `patch`, and `firstChangedLine`). Interactive mode previews file diffs as soon as arguments arrive (notebook diffs appear with the result). See [Edit and write errors](#edit-and-write-errors) for typed error codes.
|
|
91
97
|
|
|
92
98
|
## `write`
|
|
93
99
|
|
|
94
|
-
`write` creates a file or replaces its full content (`path` and `content`),
|
|
100
|
+
`write` creates a file or replaces its full content (`path` and `content`), creating missing parent directories automatically and returning `Successfully wrote to <path>`. No prior `read` is required. Use `edit` for targeted changes to existing files.
|
|
95
101
|
|
|
96
|
-
`write` also supports archive members, SQLite table
|
|
102
|
+
`write` also supports archive members, SQLite table and row selectors, `conflict://` resolutions, and `local://` resources (see [Lines and local resources](#lines-and-local-resources) and [Edit and write errors](#edit-and-write-errors)).
|
|
97
103
|
|
|
98
|
-
##
|
|
104
|
+
## `bash`
|
|
99
105
|
|
|
100
|
-
`
|
|
106
|
+
`bash` runs shell commands in the workspace and can observe or wait on background shell tasks. It supports two mutually exclusive call modes:
|
|
101
107
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
| `EditInputError` | `edits-empty` | `edits` is empty or missing | `path`, `totalEdits` | Pass at least one replacement. |
|
|
105
|
-
| `EditInputError` | `old-text-empty` | An `oldText` is empty | `path`, `editIndex`, `totalEdits` | Provide at least one character from the file in `oldText`. |
|
|
106
|
-
| `EditInputError` | `text-splits-character` | `oldText` or `newText` splits a surrogate pair (for example half an emoji) | `path`, `editIndex`, `totalEdits` | Copy complete characters. |
|
|
107
|
-
| `EditMatchError` | `text-not-found` | `oldText` is not in the file | `path`, `editIndex`, `totalEdits` | Re-read the file and copy `oldText` verbatim. |
|
|
108
|
-
| `EditMatchError` | `text-not-unique` | `oldText` matches more than once | `path`, `editIndex`, `totalEdits`, `occurrences` | Include more surrounding lines. |
|
|
109
|
-
| `EditMatchError` | `edits-overlap` | Two edits touch the same region | `path`, `editIndex`, `overlapsEditIndex`, `totalEdits` | Merge them into one edit. |
|
|
110
|
-
| `EditMatchError` | `no-change` | Resulting file is identical | `path`, `totalEdits` | Make `newText` differ from `oldText`. |
|
|
111
|
-
| `EditTargetError` | `target-inaccessible` | File cannot be read and written | `path`, optional `errnoCode`, `cause` | Check file existence and permissions. |
|
|
112
|
-
| `EditTargetError` | `target-not-utf8` | File is not valid UTF-8 (left unchanged) | `path` | Convert to UTF-8 or use an encoding-aware tool. |
|
|
113
|
-
| `WriteSelectorError` | `sqlite-query-parameters` | SQLite write selector contains `?` query parameters | `path` | Target a table or row selector instead. |
|
|
114
|
-
| `WriteSelectorError` | `sqlite-not-found` | Database does not exist or is not SQLite | `path` | Verify the database path. |
|
|
115
|
-
| `WriteSelectorError` | `conflict-target-required` | `conflict://` omits the conflict target | `path` | Write to `conflict://<id>` or `conflict://*`. |
|
|
116
|
-
| `WriteSelectorError` | `conflict-side-read-only` | Target is a side (such as `conflict://1/ours`) | `path` | Write the resolution to `conflict://<id>`. |
|
|
117
|
-
| `WriteSelectorError` | `conflict-markers-not-found` | No conflict markers exist under the working directory | `path` | Read `conflict://*` to list conflicts. |
|
|
118
|
-
| `WriteSelectorError` | `conflict-target-invalid` | Conflict ID is not a number | `path`, `conflictId` | Use an ID from `conflict://*`. |
|
|
119
|
-
| `WriteSelectorError` | `conflict-id-not-found` | No conflict has that ID | `path`, `conflictId` | Read `conflict://*` again. |
|
|
120
|
-
| `WriteSelectorError` | `conflict-stale` | Conflict markers or sides changed since read | `path`, optional `conflictId` | Re-read `conflict://*` or `:conflicts` first. |
|
|
121
|
-
| `WriteSelectorError` | `conflict-not-utf8` | Conflict region is not valid UTF-8 | `path` | Resolve with an encoding-aware tool or convert to UTF-8. |
|
|
122
|
-
| `WriteSelectorError` | `unsupported-scheme` | Path is a non-Atomic URL scheme | `path` | Use a file path or supported selector. |
|
|
108
|
+
1. **Run a command:** pass `command` (required) with optional `cwd`, `env`, `timeout`, `wait`, `pty`, and `heartbeatMs`.
|
|
109
|
+
2. **Wait on an existing background task:** pass `action: "wait"`, `id` (the owned task ID), and optional `budgetMs`. Do not combine `action: "wait"` with command fields.
|
|
123
110
|
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
```json
|
|
112
|
+
{ "command": "npm test", "wait": { "kind": "foreground", "budgetMs": 30000 } }
|
|
113
|
+
```
|
|
126
114
|
|
|
127
|
-
|
|
115
|
+
```json
|
|
116
|
+
{ "command": "npm run dev", "wait": { "kind": "background" } }
|
|
117
|
+
```
|
|
128
118
|
|
|
129
|
-
|
|
119
|
+
```json
|
|
120
|
+
{ "action": "wait", "id": "task-1234", "budgetMs": 15000 }
|
|
121
|
+
```
|
|
130
122
|
|
|
131
|
-
-
|
|
132
|
-
- **`
|
|
133
|
-
- **`
|
|
134
|
-
- **`
|
|
123
|
+
- **Observation and background yield (`wait`, `action: "wait"`).** `wait` controls how long the tool observes output and never changes the execution `timeout`. When `wait` is omitted in interactive and standard sessions, Atomic yields automatically after 10 seconds by default while the command keeps running in the background. Pass `wait: { kind: "background" }` to return immediately with the task ID after the command starts, or `wait: { kind: "foreground", budgetMs }` to wait up to `budgetMs` milliseconds before yielding. Call `{ action: "wait", id, budgetMs? }` to observe an owned background task later (omitting `budgetMs` uses the default yield budget). Background mode and task waits require sessions with background task support; standalone SDK sessions without background task support wait until the command finishes.
|
|
124
|
+
- **`cwd` and leading `cd`.** Sets the working directory for the command. If `cwd` is omitted, a leading `cd <path> && ...` or `cd <path>; ...` sets the working directory when `<path>` is a single literal word (optionally single- or double-quoted, with no variables, globs, or leading `-`). Unquoted `~` and `~/` expand to your home directory. Atomic skips stripping when `CDPATH` applies to a non-dot relative path or the local directory cannot be entered.
|
|
125
|
+
- **`env` and session variables.** Adds or overrides environment variables for the command. Every key in `env` must match `^[A-Za-z_][A-Za-z0-9_]*$`; invalid names fail before spawning. Atomic automatically sets `ATOMIC_SESSION_ID`, `ATOMIC_PROVIDER`, `ATOMIC_MODEL`, and `ATOMIC_REASONING_LEVEL` (plus legacy `PI_*` aliases) and strips any caller-supplied values for those keys as well as `ATOMIC_SESSION_FILE` and `PI_SESSION_FILE`.
|
|
126
|
+
- **`timeout`.** Execution deadline in seconds (default `300`, range `(0, 3600]`, rounded to the nearest millisecond with a 1 ms minimum; invalid values fail before running). The timer keeps running if a command continues in the background; see [Background shells](/background-tasks#background-shells).
|
|
127
|
+
- **`pty: true`.** Runs the command in the bundled native PTY. In interactive and standard sessions, native PTY errors fail the call rather than silently falling back to pipes; standalone SDK sessions without background task support fall back to pipes if the native PTY is unavailable. Set `ATOMIC_NO_PTY=1` to force pipes (`ATOMIC_NO_PTY=0` overrides a legacy `PI_NO_PTY=1`).
|
|
128
|
+
- **`heartbeatMs`.** Background [task heartbeat](/background-tasks#task-heartbeats) interval in milliseconds (defaults to `tasks.heartbeatMs` or 15 minutes; `0` disables; minimum `60000`).
|
|
135
129
|
|
|
136
|
-
Foreground results include `timeoutSeconds`, `requestedTimeoutSeconds`, `wallTimeMs`, non-zero `exitCode`, and `fullOutputPath` when truncated.
|
|
130
|
+
Model-facing output truncates at 3,000 lines or 50 KiB with `Full output: <path>`. Structured output (used by codemode) keeps up to 1 MiB (the first and last 512 KiB around an omission marker if longer). Foreground results include `timeoutSeconds`, `requestedTimeoutSeconds`, `wallTimeMs`, non-zero `exitCode`, and `fullOutputPath` when truncated.
|
|
137
131
|
|
|
138
132
|
**Internal URL expansion (`skill://`, `local://`, `artifact://`):**
|
|
139
|
-
- Only unquoted URLs starting a plain shell word expand to shell-quoted filesystem paths (for example `printf %s local://notes.txt`). Other
|
|
140
|
-
- URLs inside quotes, heredocs, comments, escapes, command substitutions, or directly after `$`, `[`, or quotes stay verbatim. Expansion also stops after the first `((`, `=(`, or non-test `[` (arithmetic, array subscripts, compound assignments). In PowerShell, typographic quotes (
|
|
133
|
+
- Only unquoted URLs starting a plain shell word expand to shell-quoted filesystem paths (for example `printf %s local://notes.txt`). Other schemes (`conflict://`, `history://`, `tool-output://`, `http://`, `https://`) stay literal text.
|
|
134
|
+
- URLs inside quotes, heredocs, comments, escapes, command substitutions, or directly after `$`, `[`, or quotes stay verbatim. Expansion also stops after the first `((`, `=(`, or non-test `[` (arithmetic, array subscripts, compound assignments). In PowerShell, typographic single and double quotes (`U+2018` to `U+201B` and `U+201C` to `U+201F`), `<#...#>` block comments, and anything after `--%` are not expanded.
|
|
141
135
|
- Structured `cwd` and `env` values always expand supported URLs.
|
|
142
|
-
- Avoid combining URL expansion with custom command prefixes or
|
|
136
|
+
- Avoid combining URL expansion with custom command prefixes or spawn wrappers that leave quotes, substitutions, or heredocs open; pass paths in structured `cwd` or `env` instead.
|
|
137
|
+
|
|
138
|
+
### PowerShell
|
|
143
139
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
-
|
|
140
|
+
On native Windows, Atomic enables the `powershell` tool automatically when `pwsh.exe` or `powershell.exe` resolves on `PATH`. It accepts the same parameters and wait modes as `bash`, preferring PowerShell 7 and falling back to Windows PowerShell 5.1.
|
|
141
|
+
|
|
142
|
+
- Resolved paths use PowerShell single-quoted literals (doubling ASCII apostrophes and `U+2018` to `U+201B` smart single quotes). `bash` always uses POSIX quoting, even on Windows.
|
|
143
|
+
- Redirected stderr on a successful native command (such as `git push 2>&1 | Select-Object -Last 3`) still reports success. Failed final statements report failure, and scripts can return an explicit status with `exit <code>`.
|
|
147
144
|
|
|
148
145
|
## `kill`
|
|
149
146
|
|
|
150
|
-
`kill({ id: taskId })` cancels an owned background shell task started by `bash` or `powershell` (including commands that yielded automatically). Pass the returned task ID verbatim, not an OS PID.
|
|
147
|
+
`kill({ id: taskId })` cancels an owned background shell task started by `bash` or `powershell` (including commands that yielded automatically). Pass the returned task ID verbatim, not an OS PID. Cancellation is scoped to the launching session and does not cancel subagents or another session's tasks.
|
|
151
148
|
|
|
152
|
-
Returns the cancellation decision plus execution and cleanup state. A request does not guarantee immediate termination; repeated calls preserve the first decision, finished tasks keep their outcome, and cleanup errors are reported explicitly. See [
|
|
149
|
+
Returns the cancellation decision plus execution and cleanup state. A cancellation request does not guarantee immediate termination; repeated calls preserve the first decision, finished tasks keep their outcome, and cleanup errors are reported explicitly. See [Stop a shell task from a tool call](/background-tasks#stop-a-shell-task-from-a-tool-call).
|
|
153
150
|
|
|
154
151
|
## `find` and `search`
|
|
155
152
|
|
|
156
|
-
Use `find` to locate paths by glob and `search` to match file contents by
|
|
153
|
+
Use `find` to locate paths by glob and `search` to match file contents by regular expression.
|
|
157
154
|
|
|
158
155
|
### Finding paths
|
|
159
156
|
|
|
160
|
-
`find`
|
|
161
|
-
|
|
162
|
-
- **Anchoring & case:** Relative globs start at `cwd` (`src/**/*.ts` searches `src/`; `**/src/**/*.ts` searches any nested `src/`). Rooted globs (`/**/*.ts`, `C:\**\*.ts`, `\\server\share\**\*.ts`) search that root. Glob matching is case-sensitive on every platform (`*.ts` never matches `A.TS`).
|
|
163
|
-
- **Defaults & limits:** Includes hidden files, respects nested `.gitignore` rules, prunes `.git` and `node_modules` even with `gitignore: false` (name `node_modules` explicitly to scan it), caps at `200` results, and defaults to a `5`s timeout.
|
|
164
|
-
- **Literal glob characters:** If a path exists verbatim on disk (such as `app/[id]/page.tsx`), it is matched literally. Otherwise escape `[`, `]`, `*`, `?`, `{`, or `}` with `\` (`app/\[id\]/*.tsx`); on Windows/UNC paths `\` is always a separator, so only the exact-path rule applies.
|
|
165
|
-
- **Path splitting:** Strips surrounding quotes. Existing paths with spaces, commas, or semicolons stay intact; otherwise comma/semicolon lists split if any part resolves, and whitespace lists split only if every part resolves.
|
|
157
|
+
`find` takes a required non-empty `paths` string array (unlike `search`, it does not accept a bare string), plus optional `hidden` (default `true`), `gitignore` (default `true`), `limit` (default `200`, clamped from `1` to `200`), and `timeout` (default `5` seconds, clamped from `0.5` to `60`).
|
|
166
158
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
### Searching contents
|
|
170
|
-
|
|
171
|
-
`search` takes `pattern` plus optional `paths`, `i` / `case`, `gitignore`, and `skip`. Searches files, directories, globs, archive members, SQLite selectors, and supported local resource selectors.
|
|
172
|
-
|
|
173
|
-
- **Scope & patterns:** Omitted or empty `paths` search the workspace root (quoting/splitting rules match `find`). Whitespace-only patterns are rejected; all others pass verbatim, including inline `(?i)`, `(?m)`, and `(?x)` flags on resource-backed selectors.
|
|
174
|
-
- **Paging & context:** Multi-file searches return 20 files per page (up to 20 matches/file); single-file searches return up to 200 matches (`skip` paginates files in multi-file mode). Context defaults to 1 line before / 3 after (`search.contextBefore`, `search.contextAfter`). Line selectors restrict matches before adding context.
|
|
175
|
-
- **Limits & format:** Local files are capped at 4 MiB and lines truncate at 512 chars. Output is plain text (`path:LINE: text` for matches, `path-LINE- text` for context). `fileLimitReached` and `meta.limits.fileLimit` indicate more pages.
|
|
176
|
-
|
|
177
|
-
## `read` and path selectors
|
|
178
|
-
|
|
179
|
-
Reading a directory returns a depth-2 tree sorted by most-recent mtime (with sizes and ages), pruning `.git` and `node_modules` and capping child directories at 12 entries (preserving the oldest shown entry with an elision marker).
|
|
180
|
-
|
|
181
|
-
### Lines and local resources
|
|
159
|
+
Entries in `paths` can be files, directories (including filesystem roots), globs, or `local://`, `skill://`, and `artifact://` selectors. A `skill://<name>` selector with a glob (such as `skill://tmux/**/*.sh`) searches the skill directory rather than `SKILL.md`. Virtual schemes (`history://`, `conflict://`, and `tool-output://`) are rejected with an error directing you to `read` or `search`.
|
|
182
160
|
|
|
183
|
-
|
|
161
|
+
- **Anchoring and case.** Relative globs start at `cwd` (`src/**/*.ts` searches `src/`; `**/src/**/*.ts` searches any nested `src/`). Rooted globs (`/**/*.ts`, `C:\**\*.ts`, `\\server\share\**\*.ts`) search that root. Glob matching is case-sensitive on every platform (`*.ts` never matches `A.TS`).
|
|
162
|
+
- **Defaults and pruning.** Includes hidden files and respects nested `.gitignore` rules by default. Prunes `.git` and `node_modules` even with `gitignore: false` (name `node_modules` explicitly to scan it).
|
|
163
|
+
- **Literal glob characters.** If a path exists verbatim on disk (such as `app/[id]/page.tsx`), it matches literally. Otherwise escape `[`, `]`, `*`, `?`, `{`, or `}` with `\` (`app/\[id\]/*.tsx`); on Windows and UNC paths `\` is always a separator, so only the exact-path rule applies.
|
|
164
|
+
- **Path splitting.** Strips surrounding quotes. Existing paths with spaces, commas, or semicolons stay intact; otherwise comma or semicolon lists split if any part resolves, and whitespace lists split only if every part resolves.
|
|
184
165
|
|
|
185
|
-
|
|
186
|
-
- **Archives (`read`, `search`, `write`):** zip, jar, tar, tgz, and gzip members (no Python required). Member names may contain `raw`, `conflicts`, `1`, `L1`, or `raw:notes.txt`. Archive writes reject directory targets ending in `/`; tar writes preserve all other members and file modes and refuse to overwrite links, directories, duplicate members, or damaged headers.
|
|
187
|
-
- **SQLite (`read`, `search`, `write`):** Table and row selectors with `limit`, `offset`, `where`, `order`, `schema`, and `sampleRows`. Non-SQLite `.db`/`.sqlite` files stay plain files.
|
|
188
|
-
- **Internal URLs.**
|
|
189
|
-
- `local://` (`read`, `search`, `write`, `find`) accesses source-backed local resources and reports underlying filesystem paths.
|
|
190
|
-
- `skill://` (`read`, `search`, `find`) reads skill content (edit skills by filesystem path).
|
|
191
|
-
- `artifact://<id>` (`read`, `search`, `find`) reads saved tool output.
|
|
192
|
-
- `conflict://` (`read`, `search`, `write`) inspects and resolves merge conflicts under the working directory.
|
|
193
|
-
- `history://` (`read`, `search`) reads past sessions for this project ([Recalling earlier work](/sessions#recalling-earlier-work)).
|
|
166
|
+
Returns `scopePath`, `fileCount`, `files`, truncation and missing-path metadata, and streaming progress snapshots.
|
|
194
167
|
|
|
195
|
-
|
|
168
|
+
### Searching contents
|
|
196
169
|
|
|
197
|
-
|
|
170
|
+
`search` takes a required `pattern` regex plus optional `paths` (string or string array; omitted or empty searches `.`), `i` (boolean), `case` (boolean), `gitignore` (default `true`), and `skip` (non-negative integer or `null`, floored; ignored in single-file mode). Hidden files are searched by default.
|
|
198
171
|
|
|
199
|
-
- **
|
|
200
|
-
- **
|
|
201
|
-
- **
|
|
172
|
+
- **Targets.** Searches files, directories, globs, archive members, SQLite selectors (`.sqlite`, `.sqlite3`, `.db`, `.db3`), and supported internal URLs (`local://`, `skill://`, `artifact://`, `conflict://`, `history://`, `tool-output://`). Rejects `http://` and `https://`.
|
|
173
|
+
- **Patterns and case sensitivity.** Whitespace-only patterns are rejected; all other patterns pass verbatim, including inline `(?i)`, `(?m)`, `(?s)`, and `(?x)` flags at the start of patterns on resource-backed selectors. Setting `i: true` or `case: false` enables case-insensitive matching (if both `i: true` and `case: true` are passed, case-insensitive matching wins).
|
|
174
|
+
- **Line selectors.** Line-range selectors (`file.ts:10-50`) work on single files only (directories and globs fail with an error) and restrict matches before adding context lines.
|
|
175
|
+
- **Paging and context.** Multi-file searches return 20 files per page (up to 20 matches per file), and `skip` paginates files in multi-file mode. Single-file searches return up to 200 matches. Pagination over internal and resource selectors collects at most 2,000 matches. Context defaults to 1 line before and 3 after (`search.contextBefore` and `search.contextAfter`).
|
|
176
|
+
- **Limits and format.** Local files cap at 4 MiB and lines truncate at 512 characters. Output is plain text (`path:LINE: text` for matches, `path-LINE- text` for context). `fileLimitReached` and `meta.limits.fileLimit` indicate more pages.
|
|
202
177
|
|
|
203
|
-
|
|
178
|
+
## `ls`
|
|
204
179
|
|
|
205
|
-
|
|
206
|
-
- **Matching.** Matches exact Git 7-character markers (`<<<<<<<`, `|||||||`, `=======`, `>>>>>>>`, alone or followed by a space and label) in order; longer runs like markdown `==========` stay untouched, and malformed regions are skipped.
|
|
207
|
-
- **Writing.** Write to `conflict://<id>` or `conflict://*` using literal text or `@ours`, `@theirs`, and `@base` (preserving that side's exact bytes). Other text writes as UTF-8 using the region's line endings while keeping the rest of the file byte-identical. Stale conflicts changed on disk since reading are refused.
|
|
180
|
+
`ls` is a built-in directory listing tool that is disabled by default. Enable it for one run with `atomic --tools +ls` or permanently with `"defaultTools": ["+ls"]`.
|
|
208
181
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
- **Formats.** Extracts readable text from HTML URLs, Jupyter notebooks (0-based `cell:N` IDs, preserving unknown fields), and PDF, `.doc`, `.docx`, `.ppt`, `.pptx`, `.xls`, `.xlsx`, `.rtf`, and `.epub` documents via `markit-ai` (bundled directly into Atomic, including extensionless downloads identified by `Content-Type`).
|
|
212
|
-
- **Output caps.** Local text reads cap at 3,000 lines or 50 KiB; unselected URL reads cap at 300 rendered lines or 50 KiB (truncated with metadata rather than blocked); search lines cap at 512 chars. Successful reads populate `details.meta.source`, `sourcePath`, `truncation`, and `limits`.
|
|
213
|
-
- **Network safety.** Blocks private, localhost, cloud-metadata, multicast, and reserved IP targets (including alternate numeric IPv4 and IPv6 forms and redirects). Use public URLs.
|
|
182
|
+
- **Parameters.** Optional `path` (defaults to the current directory) and optional `limit` (maximum entries to return, default `500`).
|
|
183
|
+
- **Output.** Lists directory entries sorted alphabetically, appends `/` to directories, includes dotfiles, and truncates at `limit` entries or 50 KiB (whichever is hit first).
|
|
214
184
|
|
|
215
185
|
## `todo`
|
|
216
186
|
|
|
217
|
-
`todo` manages file-based task lists stored in `.atomic/todos` (override the directory with `ATOMIC_TODO_PATH` or legacy `PI_TODO_PATH`). Each task is a standalone `<hex>.md` file starting with a JSON frontmatter object (`id`, `title`, `tags`, `status`, `created_at`, and optional `assigned_to_session`) followed by optional markdown notes.
|
|
187
|
+
`todo` manages file-based task lists stored in `.atomic/todos` (override the directory with `ATOMIC_TODO_PATH` or legacy `PI_TODO_PATH`). Each task is a standalone `<hex>.md` file starting with a JSON frontmatter object (`id`, `title`, `tags`, `status`, `created_at`, and optional `assigned_to_session`) followed by optional markdown notes.
|
|
218
188
|
|
|
219
|
-
- **IDs.**
|
|
220
|
-
- **
|
|
221
|
-
- **
|
|
189
|
+
- **IDs.** Task IDs are 8 lowercase hex characters (`^[a-f0-9]{8}$`, matched case-insensitively). Tasks display as `TODO-<hex>`, and `id` accepts `TODO-<hex>`, `#<hex>`, or the raw 8-hex string.
|
|
190
|
+
- **Statuses and ordering.** New tasks default to `"open"`. Only `"closed"` and `"done"` (case-insensitive) count as closed; updating a task to `"closed"` or `"done"` clears `assigned_to_session` automatically. `list` returns open tasks sorted with assigned tasks first, then unassigned tasks by `created_at` ascending. `list-all` returns every task including closed ones.
|
|
191
|
+
- **Locking.** While a session edits a task, Atomic creates a `<hex>.lock` file with a 30-minute lifetime. Within 30 minutes, conflicting writes fail immediately. After 30 minutes, interactive mode prompts to take over the stale lock while non-interactive mode fails with an error.
|
|
192
|
+
- **Actions and parameters.** Required `action`: `list`, `list-all`, `get`, `create`, `update` (replaces `body` and updates fields), `append` (appends to `body`), `delete`, `claim` (assigns a task to the current session; pass `force: true` to override another session's assignment), and `release`. Optional parameters: `id`, `title`, `body`, `status`, `tags`, and `force`.
|
|
222
193
|
|
|
223
194
|
## `ask_user_question`
|
|
224
195
|
|
|
225
|
-
When `ask_user_question` is enabled, the agent
|
|
196
|
+
When `ask_user_question` is enabled, the agent displays interactive multiple-choice and free-text prompts in the TUI for clarifications, preferences, and explicit confirmations instead of asking in plain chat text. `ask_user_question` is model-only and cannot be called inside codemode scripts.
|
|
226
197
|
|
|
227
|
-
- Each call
|
|
228
|
-
-
|
|
198
|
+
- **Limits and validation.** Each call accepts 1 to 4 questions with 2 to 4 options per question, `header` up to 16 characters, and option `label` up to 60 characters. Duplicate questions and duplicate option labels are rejected. Reserved labels (`"Other"`, `"Type something."`, `"Chat about this"`, and multi-select navigation labels) are rejected even on `multiSelect: true`.
|
|
199
|
+
- **Multi-select and previews.** Pass `multiSelect: true` to let the user choose multiple options (this hides the custom `"Type something."` choice). On single-select questions, options can include a markdown `preview` rendered side by side (which also hides `"Type something."` while keeping `"Chat about this"`). See [Keybindings](/keybindings#tui-fullscreen-viewport) for dialog controls.
|
|
200
|
+
- **Scoped approvals.** A confirmation question should name the exact action, identify the target PRs or resources, and offer explicit proceed and decline choices:
|
|
229
201
|
|
|
230
202
|
```json
|
|
231
203
|
{
|
|
@@ -240,19 +212,98 @@ When `ask_user_question` is enabled, the agent uses it to display interactive mu
|
|
|
240
212
|
}
|
|
241
213
|
```
|
|
242
214
|
|
|
243
|
-
A cancelled or unanswered question is not approval. When no interactive question tool is available (for example in non-interactive runs or
|
|
215
|
+
A cancelled or unanswered question is not approval. When no interactive question tool is available (for example in non-interactive runs or with `--exclude-tools ask_user_question`), the agent continues autonomously while respecting safety and approval gates.
|
|
216
|
+
|
|
217
|
+
## `codemode`
|
|
218
|
+
|
|
219
|
+
`codemode` lets the model run JavaScript in a sandboxed worker (256 MiB memory cap) to compose permitted tool calls and return only filtered output. It is enabled by default.
|
|
220
|
+
|
|
221
|
+
Disable it in `~/.atomic/agent/settings.json` or `.atomic/settings.json`:
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{ "defaultTools": ["-codemode"] }
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Disable it for one run with `atomic --tools -codemode`. Explicit allowlists must name every desired tool (for example `atomic --tools read,search,find,codemode`). MCP servers configured for codemode exposure activate `codemode` if `defaultTools` omits it, but not after an explicit `-codemode`.
|
|
228
|
+
|
|
229
|
+
Example call (`codemode({ code: "..." })` supports top-level `await` and `return`):
|
|
230
|
+
|
|
231
|
+
```javascript
|
|
232
|
+
// @options: {"max_output_tokens": 2000, "timeout_ms": 60000}
|
|
233
|
+
const files = await Promise.all([
|
|
234
|
+
tools.read({ path: "README.md" }),
|
|
235
|
+
tools.read({ path: "package.json" }),
|
|
236
|
+
]);
|
|
237
|
+
return files.map((text) => text.slice(0, 1000));
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
- **Provider support.** Works with every provider. Models supporting OpenAI grammar tools receive JavaScript-constrained input; other models see a regular tool. Confirm status with `/tools`.
|
|
241
|
+
- **Sandbox and permissions.** Runs with no Node, filesystem, network, timer, or credential globals. Tool calls run with the session's permissions, and side effects are not rolled back if a script fails.
|
|
242
|
+
- **Settings and MCP.** Configure `codemode.inlineBudget` (default `3000` estimated tokens) and `codemode.mode` in [tool settings](/settings#tools). Atomic's [MCP host](/mcp-servers) remains the sole MCP connection owner.
|
|
243
|
+
|
|
244
|
+
See the [Codemode reference](/codemode) for globals, return shapes, `store()` and `load()`, `models.classify()`, `models.generateImages()`, subagent and Intercom access, and limits.
|
|
245
|
+
|
|
246
|
+
## `tool_search`
|
|
247
|
+
|
|
248
|
+
Deferred tools and namespaces are omitted from codemode's inline catalog. Scripts discover them via `await searchTools()`, `await describeNamespace()`, or `ALL_TOOLS`; for direct tool calls, enable `tool_search`.
|
|
249
|
+
|
|
250
|
+
`tool_search` is off by default. Enable it with `"defaultTools": ["+tool_search"]` or `--tools +tool_search`. It accepts a required non-empty `query` string and an optional positive integer `limit` (default `8`).
|
|
251
|
+
|
|
252
|
+
- Searches only registered `codemode` and `deferred` tools that are not already active, then activates matches for the next model turn.
|
|
253
|
+
- Name matching normalizes punctuation to `_`, ignores case, and accepts dotted `mcp.<server>.<tool>` names, `mcp__<server>__<tool>`, and `__` suffixes (such as `thread_read` for `mcp__app__thread_read`). Exact names and `__` suffixes rank first.
|
|
254
|
+
- `tool_search` is model-only (codemode scripts use `await searchTools()`). It respects session tool restrictions and does not replace MCP server discovery.
|
|
255
|
+
|
|
256
|
+
## `code_search`
|
|
257
|
+
|
|
258
|
+
Provided by the bundled [web access](/web-access#code_search) integration, `code_search` answers code, architecture, and API questions about public GitHub repositories via DeepWiki MCP (`https://mcp.deepwiki.com/mcp`) with no API key or MCP setup:
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
code_search({ repoName: "facebook/react", query: "How does useEffect cleanup work?" })
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
- **Parameters.** `repoName` (`owner/repo`, single repository, not a URL) and non-empty `query` (sent verbatim to DeepWiki's `ask_question`) are required. Optional `maxTokens` defaults to `5000` (range `1000` to `50000`, best-effort output cap of about 4 characters per token plus truncation notice).
|
|
265
|
+
- **Limits and fallback.** Uses a 60-second deadline with cancellation support. Results depend on DeepWiki indexing; errors and empty responses do not fall back to Exa. Use `web_search` for broader discovery or unindexed repositories.
|
|
244
266
|
|
|
245
267
|
## Persisted tool output
|
|
246
268
|
|
|
247
|
-
|
|
269
|
+
Text tool results over 50,000 characters are saved automatically and replaced inline with a 2,000-byte preview inside `<persisted-output>` tags, referencing `Full output: <path>` (for `bash`) or `Full output saved to: <path>`. Tool results that contain images are not redirected.
|
|
248
270
|
|
|
249
271
|
- **Session-directory sessions.** Saved under `<sessionDir>/tool-results/`, content-addressed by SHA-256 (`Content: sha256:<hex>`).
|
|
250
|
-
- **
|
|
251
|
-
- **Bash overflow, spill files, and
|
|
272
|
+
- **Blob-capable session stores.** When a background subagent or detached tool result runs on SQLite, libSQL, or an in-memory store, output is saved as a session blob addressed by `tool-output://<sha256>` (readable via `read` with line ranges such as `tool-output://<sha256>:1-200`, or `search`). Blobs share across hosts and branches, export with the session, and delete when the session is deleted. Custom stores without blob storage fall back to the temp tree below.
|
|
273
|
+
- **Bash overflow, spill files, and sessions without a session directory.** Stored in a session-scoped temp tree (POSIX `0700` directories and `0600` files; unsafe shared or symlinked temp paths are refused; Windows uses an account-specific name instead of `<uid>`):
|
|
252
274
|
|
|
253
275
|
```text
|
|
254
276
|
<tmpdir>/atomic-<uid>/<session-id>/
|
|
255
277
|
```
|
|
256
278
|
|
|
257
279
|
- **Size cap.** 64 MiB per persisted file; excess bytes are replaced with `[Output truncated: persisted-output cap of 67108864 bytes reached]` without splitting UTF-8 characters.
|
|
258
|
-
- **Retention and cleanup.**
|
|
280
|
+
- **Retention and cleanup.** A cleanup sweep runs 10 seconds after startup (at most once every 24 hours) and deletes temp trees and `tool-results/` directories (including custom `--session-dir` and `ATOMIC_CODING_AGENT_SESSION_DIR` roots) whose newest file is over 30 days old. Active sessions are protected, session `.jsonl` transcripts are never deleted, and symlinks are never followed. Copy output you need long-term elsewhere.
|
|
281
|
+
|
|
282
|
+
## Edit and write errors
|
|
283
|
+
|
|
284
|
+
`edit` and `write` failures are typed. In extensions and SDK integrations, branch on the error class or `code` rather than message text. Every error sets `hint` (next step) and `retryable: false`.
|
|
285
|
+
|
|
286
|
+
| Class | `code` | When | Fields | What to do |
|
|
287
|
+
| --- | --- | --- | --- | --- |
|
|
288
|
+
| `EditInputError` | `edits-empty` | `edits` is empty or missing | `path`, `totalEdits` | Pass at least one replacement. |
|
|
289
|
+
| `EditInputError` | `old-text-empty` | An `oldText` is empty | `path`, `editIndex`, `totalEdits` | Provide at least one character from the file in `oldText`. |
|
|
290
|
+
| `EditInputError` | `text-splits-character` | `oldText` or `newText` splits a surrogate pair (for example half an emoji) | `path`, `editIndex`, `totalEdits` | Copy complete characters. |
|
|
291
|
+
| `EditMatchError` | `text-not-found` | `oldText` is not in the file | `path`, `editIndex`, `totalEdits` | Re-read the file and copy `oldText` verbatim. |
|
|
292
|
+
| `EditMatchError` | `text-not-unique` | `oldText` matches more than once | `path`, `editIndex`, `totalEdits`, `occurrences` | Include more surrounding lines. |
|
|
293
|
+
| `EditMatchError` | `edits-overlap` | Two edits touch the same region | `path`, `editIndex`, `overlapsEditIndex`, `totalEdits` | Merge them into one edit. |
|
|
294
|
+
| `EditMatchError` | `no-change` | Resulting file is identical | `path`, `totalEdits` | Make `newText` differ from `oldText`. |
|
|
295
|
+
| `EditTargetError` | `target-inaccessible` | File cannot be read and written | `path`, optional `errnoCode`, `cause` | Check file existence and permissions. |
|
|
296
|
+
| `EditTargetError` | `target-not-utf8` | File is not valid UTF-8 (left unchanged) | `path` | Convert to UTF-8 or use an encoding-aware tool. |
|
|
297
|
+
| `WriteSelectorError` | `sqlite-query-parameters` | SQLite write selector contains `?` query parameters | `path` | Target a table or row selector instead. |
|
|
298
|
+
| `WriteSelectorError` | `sqlite-not-found` | Database does not exist or is not SQLite | `path` | Verify the database path. |
|
|
299
|
+
| `WriteSelectorError` | `conflict-target-required` | `conflict://` omits the conflict target | `path` | Write to `conflict://<id>` or `conflict://*`. |
|
|
300
|
+
| `WriteSelectorError` | `conflict-side-read-only` | Target is a side (such as `conflict://1/ours`) | `path` | Write the resolution to `conflict://<id>`. |
|
|
301
|
+
| `WriteSelectorError` | `conflict-markers-not-found` | No conflict markers exist under the working directory | `path` | Read `conflict://*` to list conflicts. |
|
|
302
|
+
| `WriteSelectorError` | `conflict-target-invalid` | Conflict ID is not a number | `path`, `conflictId` | Use an ID from `conflict://*`. |
|
|
303
|
+
| `WriteSelectorError` | `conflict-id-not-found` | No conflict has that ID | `path`, `conflictId` | Read `conflict://*` again. |
|
|
304
|
+
| `WriteSelectorError` | `conflict-stale` | Conflict markers or sides changed since read | `path`, optional `conflictId` | Re-read `conflict://*` or `:conflicts` first. |
|
|
305
|
+
| `WriteSelectorError` | `conflict-not-utf8` | Conflict region is not valid UTF-8 | `path` | Resolve with an encoding-aware tool or convert to UTF-8. |
|
|
306
|
+
| `WriteSelectorError` | `unsupported-scheme` | Path is a non-Atomic URL scheme | `path` | Use a file path or supported selector. |
|
|
307
|
+
|
|
308
|
+
- **Inheritance and cross-process helpers (SDK).** `EditInputError`, `EditMatchError`, and `EditTargetError` extend `EditToolError`. Type guards (`isEditToolError`, `isEditInputError`, `isEditMatchError`, `isEditTargetError`, and `isWriteSelectorError`) also match cross-process copies by `name` and `code`. Use `serializeFileToolError` (which strips URL credentials from causes) with `rehydrateEditToolError` and `rehydrateWriteSelectorError` across process boundaries.
|
|
309
|
+
- **Aborts and OS errors.** Cancelling `read`, `find`, `edit`, or `write` throws `FileToolAbortedError` (`name: "AbortError"`, `code: "aborted"`, `cause` set to the abort reason). OS write errors (`EACCES`, `EISDIR`, and similar) propagate directly.
|