@bastani/atomic 0.10.9 → 0.10.10-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/README.md +226 -163
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +27 -12
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
- package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
- package/dist/_shared/sdk-RRLVN7ER.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js +4 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
- package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
- package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
- package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
- package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
- package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +150 -62
- package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
- package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
- package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
- package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
- package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
- package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
- package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
- package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
- package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
- package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
- package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
- package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
- package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/README.md +87 -116
- package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
- package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
- package/dist/builtin/intercom/group.ts +7 -3
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/README.md +61 -27
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +8 -0
- package/dist/builtin/subagents/README.md +74 -141
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
- package/dist/builtin/web-access/CHANGELOG.md +9 -0
- package/dist/builtin/web-access/README.md +61 -88
- package/dist/builtin/web-access/index.bundle.mjs +387 -351
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +4 -4
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +2 -2
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +3 -3
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +2 -2
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +2 -2
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +2 -2
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +2 -2
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/agent-session-methods.d.ts +4 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/compaction/compactor.d.ts +20 -14
- package/dist/core/compaction/errors.d.ts +120 -0
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/model-resolver.d.ts +2 -2
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.code.js +1 -1
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/api-types.d.ts +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/provider-types.d.ts +18 -6
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-context.js +1 -1
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/model-config.d.ts +40 -0
- package/dist/core/model-registry.js +1 -1
- package/dist/core/model-resolver-scope.d.ts +4 -4
- package/dist/core/model-runtime.d.ts +1 -1
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/provider-composer-internal.d.ts +11 -2
- package/dist/core/sdk.code.js +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +5 -5
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +1 -1
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/settings-manager-basic-accessors.d.ts +6 -2
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +3 -3
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +2 -2
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +3 -3
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +3 -3
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +3 -3
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +3 -3
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +4 -4
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.code.js +1 -1
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.code.js +2 -2
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.code.js +3 -3
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.code.js +1 -1
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +2 -2
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +2 -2
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +7 -7
- package/dist/main-first-time-setup.code.js +2 -2
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -0
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/interactive/theme/color-utils.d.ts +5 -5
- package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
- package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
- package/dist/modes/rpc/rpc-types.d.ts +29 -2
- package/dist/package-manager-cli.code.js +5 -5
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/5.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +1 -2
- package/dist/startup-stages/9.js +2 -1
- package/dist/utils/native-module.d.ts +44 -0
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks.md +238 -243
- package/docs/build.md +21 -15
- package/docs/changelog.mdx +1 -1
- package/docs/codemode.md +68 -51
- package/docs/compaction/reference.md +65 -26
- package/docs/compaction.md +118 -66
- package/docs/computer-use.md +179 -146
- package/docs/containerization.md +87 -33
- package/docs/custom-provider/api-reference.md +152 -13
- package/docs/custom-provider/oauth.md +45 -28
- package/docs/custom-provider/override.md +14 -7
- package/docs/custom-provider/registration.md +77 -67
- package/docs/custom-provider/streaming.md +42 -19
- package/docs/custom-provider.md +26 -62
- package/docs/development.md +81 -42
- package/docs/docs.json +54 -38
- package/docs/environment-variables.md +92 -64
- package/docs/extensions/api-reference.md +326 -735
- package/docs/extensions/authoring.md +186 -269
- package/docs/extensions/events.md +308 -375
- package/docs/extensions/examples.md +122 -74
- package/docs/extensions/ui.md +217 -197
- package/docs/extensions.md +189 -259
- package/docs/getting-started/authentication.md +27 -14
- package/docs/getting-started/first-session.md +25 -26
- package/docs/getting-started/installation.md +62 -84
- package/docs/getting-started/project-instructions.md +39 -14
- package/docs/guides/configuration.md +62 -20
- package/docs/guides/intercom.md +20 -12
- package/docs/guides/non-interactive.md +31 -16
- package/docs/guides/orchestration.md +17 -9
- package/docs/guides/resume-on-any-machine.md +63 -52
- package/docs/guides/subagents.md +26 -14
- package/docs/guides/team-setup.md +49 -27
- package/docs/guides.md +30 -23
- package/docs/herdr.md +22 -17
- package/docs/index.md +24 -17
- package/docs/intercom/operations.md +90 -66
- package/docs/intercom/reference.md +219 -192
- package/docs/intercom.md +111 -92
- package/docs/json.md +73 -71
- package/docs/keybindings.md +74 -48
- package/docs/libraries/agent-core.md +52 -9
- package/docs/libraries/ai.md +90 -63
- package/docs/libraries/codemode.md +31 -8
- package/docs/libraries/schema.md +12 -9
- package/docs/libraries/storage-libsql.md +92 -0
- package/docs/libraries/storage-postgres.md +119 -0
- package/docs/libraries/telemetry.md +42 -9
- package/docs/libraries/tui.md +74 -94
- package/docs/libraries.md +25 -8
- package/docs/llama-cpp.md +38 -33
- package/docs/mcp-servers.md +140 -88
- package/docs/models/reference.md +53 -36
- package/docs/models-configuration.md +19 -13
- package/docs/models.md +102 -87
- package/docs/orchestration/migrating-workflows.md +22 -20
- package/docs/orchestration/patterns.md +36 -21
- package/docs/orchestration.md +24 -21
- package/docs/packages/authoring.md +29 -18
- package/docs/packages/reference.md +77 -16
- package/docs/packages.md +34 -34
- package/docs/programmatic.md +28 -21
- package/docs/prompt-templates.md +65 -41
- package/docs/providers/reference.md +36 -20
- package/docs/providers.md +78 -76
- package/docs/quickstart.md +42 -54
- package/docs/reference/cli.md +256 -254
- package/docs/reference.md +30 -23
- package/docs/rpc/examples.md +121 -17
- package/docs/rpc/extension-ui.md +86 -63
- package/docs/rpc/protocol.md +817 -358
- package/docs/rpc.md +78 -152
- package/docs/sdk/reference.md +309 -73
- package/docs/sdk/storage.md +614 -0
- package/docs/sdk/structured-decisions.md +168 -65
- package/docs/sdk/web-server.md +80 -46
- package/docs/sdk.md +168 -215
- package/docs/security.md +117 -44
- package/docs/session-format.md +127 -76
- package/docs/sessions.md +155 -113
- package/docs/settings.md +293 -205
- package/docs/shell-aliases.md +15 -6
- package/docs/skills/authoring.md +17 -9
- package/docs/skills/reference.md +23 -21
- package/docs/skills.md +148 -97
- package/docs/storage.md +172 -260
- package/docs/subagents/authoring.md +148 -15
- package/docs/subagents/reference.md +105 -29
- package/docs/subagents.md +247 -250
- package/docs/terminal-setup.md +97 -69
- package/docs/termux.md +51 -85
- package/docs/themes/reference.md +51 -37
- package/docs/themes.md +52 -55
- package/docs/tmux.md +38 -21
- package/docs/tools.md +209 -147
- package/docs/tui/reference.md +64 -32
- package/docs/tui.md +38 -66
- package/docs/usage.md +94 -86
- package/docs/verification.md +25 -25
- package/docs/web-access.md +106 -54
- package/docs/windows.md +55 -57
- package/docs/worktree-snapshots.md +82 -74
- package/examples/sdk/11-sessions.ts +4 -4
- package/package.json +8 -8
- package/schemas/models.schema.json +58 -7
- package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
- package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
- package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
- package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
package/docs/packages.md
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
|
|
2
|
+
title: "Install and manage packages"
|
|
3
|
+
sidebarTitle: "Atomic packages"
|
|
4
|
+
description: "Install, update, remove, and configure Atomic packages from npm, git, or local directories."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# Atomic packages
|
|
7
|
-
|
|
8
7
|
Atomic packages bundle extensions, skills, [subagents](/packages/authoring#subagents), prompt templates, themes, MCP servers, and [storage adapters](/storage#adapters-from-atomic-packages) for distribution over npm, git, or local paths. Declare resources under the `atomic` key in `package.json`, or use convention directories.
|
|
9
8
|
|
|
10
9
|
## Where to go next
|
|
11
10
|
|
|
12
|
-
- [
|
|
13
|
-
- [Package reference](/packages/reference). Review
|
|
14
|
-
|
|
15
|
-
<a id="table-of-contents" />
|
|
11
|
+
- [Create and publish packages](/packages/authoring). Configure the package manifest, subagents, MCP servers, storage adapters, directory structure, and dependencies.
|
|
12
|
+
- [Package reference](/packages/reference). Review pattern matching, `autoload: false` overrides, resource precedence, and deduplication rules.
|
|
16
13
|
|
|
17
14
|
## Install and manage
|
|
18
15
|
|
|
19
|
-
> **Security:** Atomic packages run with full system access. Extensions execute arbitrary code and skills instruct the agent. Review source code before installing third-party packages.
|
|
16
|
+
> **Security:** Atomic packages run with full system access. Extensions execute arbitrary code and skills instruct the agent. Review source code before installing third-party packages. See [Security](/security) for project trust rules and [Package CLI commands](/reference/cli#package-commands) for the full command list.
|
|
20
17
|
|
|
21
18
|
```bash
|
|
22
19
|
atomic install npm:@foo/bar@1.0.0
|
|
@@ -24,24 +21,28 @@ atomic install git:github.com/user/repo@v1
|
|
|
24
21
|
atomic install https://github.com/user/repo # Raw URLs work too
|
|
25
22
|
atomic install /absolute/path/to/package
|
|
26
23
|
atomic install ./relative/path/to/package
|
|
24
|
+
atomic install -l npm:@foo/bar # Install into project settings (--local)
|
|
27
25
|
|
|
28
26
|
atomic remove npm:@foo/bar # Alias: atomic uninstall
|
|
29
27
|
atomic list # Show packages configured in settings
|
|
30
28
|
atomic update # Update Atomic CLI only
|
|
31
29
|
atomic update --all # Update Atomic + packages + reconcile git refs
|
|
32
30
|
atomic update --extensions # Update packages + reconcile git refs only
|
|
33
|
-
atomic update --models # Force-refresh authenticated model catalogs
|
|
34
|
-
atomic update --self # Update Atomic CLI only
|
|
31
|
+
atomic update --models # Force-refresh authenticated model catalogs (15s timeout)
|
|
32
|
+
atomic update --self # Update Atomic CLI only (also: atomic update self | atomic)
|
|
35
33
|
atomic update --self --force # Reinstall Atomic even if current
|
|
34
|
+
atomic update --self --extensions # Same as atomic update --all
|
|
36
35
|
atomic update npm:@foo/bar # Update one package (or --extension <src>)
|
|
37
36
|
```
|
|
38
37
|
|
|
39
|
-
Install and update behavior:
|
|
38
|
+
Install, trust, and update behavior:
|
|
40
39
|
|
|
41
|
-
- **Global and project scope.** `install` and `remove` edit `~/.atomic/agent/settings.json` by default. Pass `-l` to write to `.atomic/settings.json` (legacy `.pi/settings.json` is also read). Missing project packages install automatically on startup once the project
|
|
40
|
+
- **Global and project scope.** `install` and `remove` edit `~/.atomic/agent/settings.json` by default ([Settings](/settings)). Pass `-l` or `--local` to write to `.atomic/settings.json` (legacy `.pi/settings.json` is also read). Missing project packages install automatically on startup once you trust the project.
|
|
41
|
+
- **Project trust gate.** In an untrusted project, `atomic install -l` and `atomic remove -l` exit with code 1 (`Project is not trusted. Use --approve to modify local package config.`) unless you trust the project first ([Security](/security)) or pass `-a` / `--approve`. Both `-a` / `--approve` and `-na` / `--no-approve` are accepted on `install`, `remove`, `update`, `list`, and `config`.
|
|
42
42
|
- **Update output.** Atomic lists each updated npm version or git commit (for example `npm:@foo/bar 1.2.0 -> 1.3.0`), prints `Packages are already up to date` when nothing changed, prints warnings when no package upgraded, and reports skipped updates in offline mode.
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
43
|
+
- **Offline mode.** Pass `--offline` or set `ATOMIC_OFFLINE=1` to skip automatic startup installs and package updates.
|
|
44
|
+
- **Self-update safety.** Atomic installs the exact advertised version (showing any release note first) and only modifies installations managed and writable by the detected global package manager. On Windows, automatic self-update supports `npm` and `pnpm` installs only unless you override the command. Override auto-detection with `selfUpdateCommand` in global `settings.json` or the `ATOMIC_SELF_UPDATE_COMMAND` environment variable; otherwise Atomic prints the manual update command. To uninstall Atomic itself, see [Uninstall](/getting-started/installation#uninstall).
|
|
45
|
+
- **Resilience and concurrency.** Startup install failures (such as offline registries) warn with the `atomic remove` command, skip that package's resources, and retry on the next start or `/reload` (`atomic install` and `atomic update --extensions` still exit non-zero). Concurrent installs serialize per package, interrupted git clones re-clone on retry, and `atomic remove` cleans up orphaned package directories.
|
|
45
46
|
|
|
46
47
|
Try a package for one run with `-e` or `--extension`:
|
|
47
48
|
|
|
@@ -50,7 +51,7 @@ atomic -e npm:@foo/bar
|
|
|
50
51
|
atomic -e git:github.com/user/repo
|
|
51
52
|
```
|
|
52
53
|
|
|
53
|
-
`-e` installs into a private user-owned cache (`$XDG_RUNTIME_DIR/atomic/extensions`, else `<agentDir>/cache/tmp/extensions`, else `<tmpdir>/atomic-<uid>/extensions`; symlinks
|
|
54
|
+
`-e` installs into a private user-owned cache (`$XDG_RUNTIME_DIR/atomic/extensions`, else `<agentDir>/cache/tmp/extensions`, else `<tmpdir>/atomic-<uid>/extensions`; symlinks and shared or other-owned directories are refused). Unpinned npm specs and branch or tag git refs refresh on start and `/reload` (falling back to cache offline or on error). Exact `@1.2.3` npm pins and checked-out git commit hashes (7 to 64 hex characters matching `HEAD`) skip network refresh. Local `-e <dir>` paths can also load `<dir>/.atomic`, `<dir>/.pi`, and `<dir>/.agents/skills` after resolving trust for that directory.
|
|
54
55
|
|
|
55
56
|
## Package sources
|
|
56
57
|
|
|
@@ -58,12 +59,14 @@ atomic -e git:github.com/user/repo
|
|
|
58
59
|
|
|
59
60
|
```text
|
|
60
61
|
npm:@scope/pkg@1.2.3
|
|
62
|
+
npm:@scope/pkg@^1.2.0
|
|
63
|
+
npm:pkg@next
|
|
61
64
|
npm:pkg
|
|
62
65
|
```
|
|
63
66
|
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
- Override the npm executable with `npmCommand` in `settings.json` when using version managers such as `mise` or `asdf
|
|
67
|
+
- **Install locations.** Global npm packages install under `~/.atomic/agent/npm/` (a dedicated directory managed by Atomic, not your system global `npm -g` root). Atomic falls back to reading your system global `npm`, `pnpm`, or `bun` root only for legacy global installs already present there. Project installs (`-l` / `--local`) install under `.atomic/npm/` (legacy `.pi/npm/` fallback).
|
|
68
|
+
- **Pinning and ranges.** Exact semver versions (`npm:pkg@1.2.3`) are pinned and skipped by `atomic update --extensions` and `--all`. Semver ranges (`^1.2.3`, `~1.2.3`) and dist-tags (`@next`) update within that range or tag when you run `atomic update --extensions` or `--all`.
|
|
69
|
+
- **Custom package manager.** Override the npm executable with `npmCommand` in `settings.json` when using `pnpm`, `bun`, or version managers such as `mise` or `asdf`. Atomic detects `npm`, `pnpm`, and `bun` even inside wrapper commands and passes manager-specific flags to avoid unwanted peer-dependency installs (`--legacy-peer-deps` for npm, `--omit=peer` for bun, `--config.auto-install-peers=false` for pnpm):
|
|
67
70
|
|
|
68
71
|
```json
|
|
69
72
|
{
|
|
@@ -75,15 +78,16 @@ npm:pkg
|
|
|
75
78
|
|
|
76
79
|
```text
|
|
77
80
|
git:github.com/user/repo@v1
|
|
78
|
-
git:git@github.com:user/repo@
|
|
81
|
+
git:git@github.com:user/repo@main
|
|
79
82
|
https://github.com/user/repo@v1
|
|
80
83
|
ssh://git@github.com/user/repo@v1
|
|
81
84
|
```
|
|
82
85
|
|
|
83
86
|
- Bare protocol URLs (`https://`, `http://`, `ssh://`, `git://`) work directly. Shorthand (`github.com/user/repo`, `git@github.com:user/repo`) requires the `git:` prefix.
|
|
87
|
+
- Repository paths must include at least two path segments (`owner/repo`). Single-segment paths, path traversal (`..`, `.`), backslashes, and null bytes are rejected.
|
|
84
88
|
- SSH uses your configured keys and `~/.ssh/config`. For CI or non-interactive use, set `GIT_TERMINAL_PROMPT=0` and `GIT_SSH_COMMAND="ssh -o BatchMode=yes -o ConnectTimeout=5"`.
|
|
85
89
|
- Repositories clone to `~/.atomic/agent/git/<host>/<path>` (global) or `.atomic/git/<host>/<path>` (project; legacy `.pi/git/` fallback).
|
|
86
|
-
- `@ref`
|
|
90
|
+
- `@ref` accepts a branch name, tag, or commit hash. Running `atomic update --extensions` or `--all` fetches that ref (`git fetch origin -- <ref>`) and resets hard to `FETCH_HEAD`: branch refs advance to new commits on that branch, while tags and commit hashes reconcile to their exact target. Whenever the checked-out commit changes, Atomic runs `git clean -fdx` (removing untracked files in the clone) and installs production dependencies if `package.json` exists. Change a pin with `atomic install git:host/user/repo@new-ref`.
|
|
87
91
|
|
|
88
92
|
```bash
|
|
89
93
|
atomic install git:git@github.com:user/repo
|
|
@@ -98,27 +102,23 @@ atomic install git:git@github.com/user/repo@v1.0.0
|
|
|
98
102
|
./relative/path/to/package
|
|
99
103
|
```
|
|
100
104
|
|
|
101
|
-
Local paths are
|
|
105
|
+
Local paths are referenced in place without copying. When you run `atomic install /absolute/path/to/package`, Atomic stores the path in `settings.json` relative to the settings directory (`~/.atomic/agent` or `.atomic`). A file loads as a single extension; a directory loads as a package.
|
|
106
|
+
|
|
107
|
+
Running `atomic remove <local-path>` deletes only the entry from `settings.json` and never deletes files from your local directory.
|
|
102
108
|
|
|
103
109
|
## Enable and disable resources
|
|
104
110
|
|
|
105
111
|
Run `atomic config` to toggle extensions, skills, prompt templates, and themes interactively:
|
|
106
112
|
|
|
107
113
|
- Opens global settings (`~/.atomic/agent/settings.json`). Press `Tab` to switch between global and project scope.
|
|
108
|
-
- Run `atomic config -l` to open project overrides (`.atomic/settings.json`) with inherited global entries dimmed.
|
|
114
|
+
- Run `atomic config -l` (or `--local`) to open project overrides (`.atomic/settings.json`) with inherited global entries dimmed.
|
|
109
115
|
- Package subagents do not appear in `atomic config`. Filter them per package with `agents` in settings ([Package filtering](/packages/reference#package-filtering)).
|
|
110
|
-
- Toggle built-in
|
|
111
|
-
- If an interactive session crashes with an uncaught error whose stack crosses a loaded extension, Atomic names the extension in the exit output and suggests `atomic config` or `atomic -ne` to
|
|
112
|
-
|
|
113
|
-
<a id="creating-an-atomic-package" />
|
|
114
|
-
<a id="gallery-metadata" />
|
|
115
|
-
<a id="package-structure" />
|
|
116
|
-
<a id="convention-directories" />
|
|
117
|
-
<a id="dependencies" />
|
|
118
|
-
<a id="package-filtering" />
|
|
119
|
-
<a id="scope-and-deduplication" />
|
|
116
|
+
- Toggle built-in extensions (`llama.cpp`, `codemode`, `tool-search`) using `builtin:<name>` entries rather than filesystem paths ([Built-in extension resources](/extensions#built-in-extension-resources)).
|
|
117
|
+
- If an interactive session crashes with an uncaught error whose stack crosses a loaded extension, Atomic names the extension in the exit output and suggests `atomic config` or `atomic -ne` to narrow down the cause.
|
|
120
118
|
|
|
121
119
|
## Authoring and reference
|
|
122
120
|
|
|
123
|
-
- [
|
|
121
|
+
- [Create and publish packages](/packages/authoring#creating-an-atomic-package). Review manifest fields, [subagents](/packages/authoring#subagents), [MCP servers](/packages/authoring#mcp-servers), [storage adapters](/packages/authoring#storage-adapters), [gallery metadata](/packages/authoring#gallery-metadata), [convention directories](/packages/authoring#convention-directories), and [dependencies](/packages/authoring#dependencies).
|
|
124
122
|
- [Package reference](/packages/reference). Review [package filtering](/packages/reference#package-filtering) and [scope and deduplication](/packages/reference#scope-and-deduplication).
|
|
123
|
+
- [SDK extensions](/sdk/reference#extensions). Load local packages and extensions programmatically with `DefaultResourceLoader({ additionalExtensionPaths })`.
|
|
124
|
+
- [Package CLI commands](/reference/cli#package-commands), [Settings](/settings), and [Security](/security). Review CLI subcommands, `settings.json` keys, and project trust gates.
|
package/docs/programmatic.md
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Programmatic
|
|
3
|
-
|
|
2
|
+
title: "Programmatic integration"
|
|
3
|
+
sidebarTitle: "Programmatic modes"
|
|
4
|
+
description: "Choose between JSON event stream mode, RPC mode, the TypeScript SDK, storage adapters, and TUI component APIs, then follow a minimal integration."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
Atomic provides three programmatic integration modes plus a component API for interactive extension interfaces. Choose the smallest mode that fits your integration, run its minimal example, and continue to its reference.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
## Choose an integration mode
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
| You want | Use | Start at |
|
|
11
|
+
| Goal | Mode | Entry point |
|
|
13
12
|
| --- | --- | --- |
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
| Atomic
|
|
13
|
+
| Run one or more prompts and parse structured output as JSON lines | [JSON event stream](/json) | `atomic --mode json` |
|
|
14
|
+
| Drive a long-lived process with commands, interrupts, and extension UI prompts | [RPC mode](/rpc) | `atomic --mode rpc` |
|
|
15
|
+
| Embed Atomic directly inside a Node.js application (Node.js 22.19+) | [TypeScript SDK](/sdk) | `@bastani/atomic` |
|
|
16
|
+
|
|
17
|
+
- **JSON event stream** executes one or more positional prompts in sequence, writes newline-delimited session events to stdout, and exits.
|
|
18
|
+
- **RPC mode** keeps an Atomic subprocess running over stdin/stdout JSON Lines so you can send follow-up prompts, steer or abort turns, switch models, and answer extension dialogs and OAuth prompts.
|
|
19
|
+
- **TypeScript SDK** runs the same agent runtime as a library inside your Node.js application, with direct control over extensions, skills, tools, models, workspaces, and [session storage backends](/sdk/storage).
|
|
20
|
+
|
|
21
|
+
## SDK guides and APIs
|
|
17
22
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
23
|
+
- [SDK overview](/sdk): create sessions, bind workspaces, configure Intercom policies, and handle lifecycle events.
|
|
24
|
+
- [SDK storage backends](/sdk/storage): configure SQLite, JSONL, in-memory, libSQL/Turso, and PostgreSQL for `createAgentSession()`, `createAgentSessionRuntime()`, and `SessionManager`.
|
|
25
|
+
- [Structured decisions API](/sdk/structured-decisions): run typed classifier or chat decisions with `decide()` and `generateStructuredOutput()`.
|
|
26
|
+
- [Embed Atomic in a web server](/sdk/web-server): build a streaming HTTP API with Next.js App Router and `createAgentSession()`.
|
|
27
|
+
- [SDK API reference](/sdk/reference): complete session options, loaders, tool status, task supervision, run modes, and exports.
|
|
28
|
+
- [Remote compaction models](/models#remote-compaction-models) and [Environment blueprints](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint): plug in custom remote compactors and repeatable worktree setup for cross-machine resume.
|
|
21
29
|
|
|
22
|
-
##
|
|
30
|
+
## RPC protocol and client guides
|
|
23
31
|
|
|
24
|
-
- [RPC protocol](/rpc/protocol): every command, event, and type.
|
|
25
|
-
- [RPC extension UI protocol](/rpc/extension-ui):
|
|
26
|
-
- [RPC client examples](/rpc/examples):
|
|
27
|
-
- [SDK API reference](/sdk/reference): options, loaders, return values, run modes, and exports.
|
|
32
|
+
- [RPC protocol reference](/rpc/protocol): every RPC command, streamed event, error shape, and JSON type.
|
|
33
|
+
- [RPC extension UI protocol](/rpc/extension-ui): handle extension dialogs, widgets, questionnaires, and OAuth flows over RPC.
|
|
34
|
+
- [RPC client examples](/rpc/examples): connect with the typed `RpcClient` or a standalone Node.js script.
|
|
28
35
|
|
|
29
|
-
##
|
|
36
|
+
## Terminal UI and standalone libraries
|
|
30
37
|
|
|
31
|
-
- [TUI components](/tui)
|
|
32
|
-
- [
|
|
38
|
+
- [Build TUI components](/tui) walks through custom interactive components and common patterns, and [TUI API reference](/tui/reference) documents the component, focus, input, and rendering contracts.
|
|
39
|
+
- [Standalone libraries](/libraries) covers the six core `@bastani/atomic-*` packages (`ai`, `agent-core`, `tui`, `codemode`, `schema`, and `telemetry`) plus the optional storage adapter packages ([`@bastani/atomic-storage-postgres`](/libraries/storage-postgres) and [`@bastani/atomic-storage-libsql`](/libraries/storage-libsql)).
|
package/docs/prompt-templates.md
CHANGED
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Prompt templates
|
|
3
|
-
|
|
2
|
+
title: "Prompt templates"
|
|
3
|
+
sidebarTitle: "Prompt templates"
|
|
4
|
+
description: "Create reusable Markdown slash commands with bash-style argument placeholders, defaults, and slicing."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# Prompt templates
|
|
7
|
-
|
|
8
7
|
Prompt templates are Markdown snippets that expand into full prompts. Type `/name` in the editor to invoke a template, where `name` is the filename without `.md`.
|
|
9
8
|
|
|
10
9
|
**Prerequisites:** Atomic installed and running in a project. See the [Quickstart](/quickstart). No code or build step is required.
|
|
11
10
|
|
|
12
11
|
Use prompt templates when you repeat the same instructions and want a slash command for them. They are Atomic's lightest customization option. Use a [skill](/skills) if the agent should decide when to load the instructions, or an [extension](/extensions) if you need to run code.
|
|
13
12
|
|
|
14
|
-
## Locations
|
|
13
|
+
## Locations and loading rules
|
|
14
|
+
|
|
15
|
+
Atomic loads prompt templates from these sources:
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
- **Global:** `~/.atomic/agent/prompts/*.md` (legacy `~/.pi/agent/prompts/*.md`)
|
|
18
|
+
- **Project** (only after you grant [project trust](/security#project-trust)): `.atomic/prompts/*.md` (legacy `.pi/prompts/*.md`)
|
|
19
|
+
- **Packages:** `prompts/` directories, `atomic.prompts`, or legacy `pi.prompts` entries in `package.json`
|
|
20
|
+
- **Settings:** `prompts` array in global or project `settings.json` ([Resource settings](/settings#resources)), which accepts files, directories, and filter patterns (`!glob`, `+path`, `-path` with `~` expansion; see [Package filtering](/packages/reference#package-filtering))
|
|
21
|
+
- **CLI:** `--prompt-template <path>` (repeatable; accepts either a `.md` file or a directory, and still loads with `--no-prompt-templates`; see [CLI resource options](/reference/cli#resource-options))
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
- Project: `.atomic/prompts/*.md` (legacy `.pi/prompts/*.md`, only after the project is trusted)
|
|
20
|
-
- Packages: `prompts/` directories, `atomic.prompts`, or legacy `pi.prompts` entries in `package.json`
|
|
21
|
-
- Settings: `prompts` array with files or directories
|
|
22
|
-
- CLI: `--prompt-template <path>` (repeatable)
|
|
23
|
+
Disable default discovery with `--no-prompt-templates` (short flag `-np`). Explicit `--prompt-template` paths and `-e` package prompts still load.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
### Discovery and precedence rules
|
|
26
|
+
|
|
27
|
+
- Auto-discovery in `~/.atomic/agent/prompts/` and `.atomic/prompts/` is non-recursive. To load templates from subdirectories, add them explicitly in `settings.json` `prompts` or in a package manifest.
|
|
28
|
+
- Scanning skips dotfiles, `node_modules`, broken symlinks, and files matched by `.gitignore`, `.ignore`, or `.fdignore` inside the `prompts/` directory. Direct symlinks to `.md` files are followed.
|
|
29
|
+
- When multiple templates share a filename, Atomic keeps the first match in this order:
|
|
30
|
+
1. Packages passed with `-e` / `--extension`
|
|
31
|
+
2. Project `settings.json` `prompts` array
|
|
32
|
+
3. Project auto-discovered directories (`.atomic/prompts/`, then legacy `.pi/prompts/`)
|
|
33
|
+
4. Global `settings.json` `prompts` array
|
|
34
|
+
5. Global auto-discovered directories (`~/.atomic/agent/prompts/`, then legacy `~/.pi/agent/prompts/`)
|
|
35
|
+
6. Configured packages (project packages, then global packages)
|
|
36
|
+
7. Bundled packages
|
|
37
|
+
8. Explicit CLI `--prompt-template <path>` paths
|
|
38
|
+
- Exception: if an inherited legacy `.pi` template collides with a bundled template, the bundled template wins.
|
|
39
|
+
- Built-in interactive commands and extension slash commands take precedence over prompt templates with the same name.
|
|
25
40
|
|
|
26
41
|
## Format
|
|
27
42
|
|
|
@@ -36,9 +51,9 @@ Review the staged changes (`git diff --cached`). Focus on:
|
|
|
36
51
|
```
|
|
37
52
|
|
|
38
53
|
- The filename becomes the command name. `review.md` becomes `/review`.
|
|
39
|
-
- `description` is optional. If
|
|
54
|
+
- `description` is optional. If omitted, Atomic uses the first non-empty line of the template body, truncated to 60 characters with `...` appended when longer.
|
|
40
55
|
- `argument-hint` is optional. When set, the hint appears before the description in the autocomplete dropdown.
|
|
41
|
-
- Invalid YAML frontmatter (for example an unquoted `description: Broken: value`) skips only that template and reports a warning naming the file and
|
|
56
|
+
- Invalid YAML frontmatter (for example an unquoted `description: Broken: value`) skips only that template and reports a warning naming the file and parse position. Valid sibling templates still load.
|
|
42
57
|
|
|
43
58
|
### Argument hints
|
|
44
59
|
|
|
@@ -53,37 +68,46 @@ argument-hint: "<PR-URL>"
|
|
|
53
68
|
|
|
54
69
|
This renders in the autocomplete dropdown as:
|
|
55
70
|
|
|
56
|
-
```
|
|
57
|
-
→ pr <PR-URL>
|
|
58
|
-
is <issue>
|
|
59
|
-
wr [instructions]
|
|
60
|
-
cl
|
|
71
|
+
```text
|
|
72
|
+
→ pr <PR-URL> Review PRs from URLs with structured issue and code analysis
|
|
73
|
+
is <issue> Analyze GitHub issues (bugs or feature requests)
|
|
74
|
+
wr [instructions] Finish the current task end-to-end
|
|
75
|
+
cl Audit changelog entries before release
|
|
61
76
|
```
|
|
62
77
|
|
|
63
78
|
## Usage
|
|
64
79
|
|
|
65
|
-
Type `/` followed by the template name in the editor. Autocomplete shows available templates with descriptions.
|
|
80
|
+
Type `/` followed by the template name in the editor. Autocomplete shows available templates with hints and descriptions.
|
|
66
81
|
|
|
67
|
-
```
|
|
82
|
+
```text
|
|
68
83
|
/review # Expands review.md
|
|
69
84
|
/component Button # Expands with argument
|
|
70
85
|
/component Button "click handler" # Multiple arguments
|
|
71
86
|
```
|
|
72
87
|
|
|
73
|
-
The template name ends at the first space, tab, or line break, so arguments can also start on a new line with Shift+Enter. Line breaks inside the arguments are
|
|
88
|
+
The template name ends at the first space, tab, or line break, so arguments can also start on a new line with Shift+Enter. Line breaks inside the arguments are preserved. The same rule applies to extension commands and `/skill:name` commands.
|
|
89
|
+
|
|
90
|
+
Run `/reload` after adding or editing `.md` template files to pick up changes without restarting Atomic. While viewing a subagent, invoking a prompt template expands and sends the prompt to that viewed subagent rather than `main` ([Commands while viewing a subagent](/background-tasks#commands-while-viewing-a-subagent)).
|
|
91
|
+
|
|
92
|
+
## Arguments and placeholders
|
|
74
93
|
|
|
75
|
-
|
|
94
|
+
Templates support bash-style positional arguments, defaults, and slicing. Substitution is single-pass (not recursive), so argument values containing `$1` or `$@` remain literal text.
|
|
76
95
|
|
|
77
|
-
|
|
96
|
+
| Placeholder | Expansion |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| `$1`, `$2`, `$10`, ... | Positional argument by 1-based index. Missing arguments and `$0` expand to `""` (empty string). |
|
|
99
|
+
| `$@` or `$ARGUMENTS` | All arguments joined with single spaces. Interchangeable except for slicing. |
|
|
100
|
+
| `${N:-default}` | Argument `N` when present and non-empty; otherwise `default`. Empty defaults like `${1:-}` expand to `""`. |
|
|
101
|
+
| `${@:-default}` or `${ARGUMENTS:-default}` | All arguments joined with spaces when present and non-empty; otherwise `default`. |
|
|
102
|
+
| `${@:N}` | Arguments from 1-based position `N` to the end, joined with spaces. `N = 0` clamps to `1`; `N` past the last argument expands to `""`. |
|
|
103
|
+
| `${@:N:L}` | Up to `L` arguments starting at 1-based position `N`, joined with spaces. `L = 0` expands to `""`. Slicing works with `@` only (not `${ARGUMENTS:N}`). |
|
|
78
104
|
|
|
79
|
-
-
|
|
80
|
-
- `$@` or `$ARGUMENTS` for all arguments joined with spaces
|
|
81
|
-
- `${1:-default}` uses argument 1 when present and non-empty, otherwise `default` (up to 1,024 characters)
|
|
82
|
-
- `${@:-default}` or `${ARGUMENTS:-default}` uses all arguments when present and non-empty, otherwise `default`
|
|
83
|
-
- `${@:N}` for arguments from the Nth position (1-indexed)
|
|
84
|
-
- `${@:N:L}` for `L` arguments starting at N
|
|
105
|
+
Default-value syntax rules:
|
|
85
106
|
|
|
86
|
-
|
|
107
|
+
- `default` inside `${N:-default}` or `${@:-default}` cannot contain a closing `}`.
|
|
108
|
+
- If `default` is longer than 1,024 characters, the placeholder does not match and remains literal text in the expanded prompt.
|
|
109
|
+
|
|
110
|
+
Example with positional arguments and `$@`:
|
|
87
111
|
|
|
88
112
|
```markdown
|
|
89
113
|
---
|
|
@@ -92,26 +116,26 @@ description: Create a component
|
|
|
92
116
|
Create a React component named $1 with features: $@
|
|
93
117
|
```
|
|
94
118
|
|
|
95
|
-
|
|
119
|
+
Usage: `/component Button "onClick handler" "disabled support"`
|
|
120
|
+
|
|
121
|
+
Example with a default value:
|
|
96
122
|
|
|
97
123
|
```markdown
|
|
98
124
|
Summarize the current state in ${1:-7} bullet points.
|
|
99
125
|
```
|
|
100
126
|
|
|
101
|
-
Usage: `/component Button "onClick handler" "disabled support"`
|
|
102
|
-
|
|
103
127
|
Use `""` or `''` to pass an empty argument without shifting later positions. For a template containing `Review $2. Focus: ${1:-correctness}.`, `/review "" src/index.ts` expands to `Review src/index.ts. Focus: correctness.`
|
|
104
128
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
## Loading rules
|
|
129
|
+
### Quoting and splitting rules
|
|
108
130
|
|
|
109
|
-
-
|
|
110
|
-
-
|
|
131
|
+
- Arguments split on space (` `) and tab (`\t`) only, **not on newlines (`\n`)**. If arguments span multiple lines (via Shift+Enter) without spaces or tabs between them, the newline stays inside the same positional argument.
|
|
132
|
+
- Quotes (`"` or `'`) start a quoted argument only at the beginning of a token. Apostrophes inside words such as `doesn't` remain ordinary characters.
|
|
133
|
+
- An unclosed quote is treated as a literal character, and the rest of the text is tokenized normally.
|
|
134
|
+
- Backslash escaping works only for a matching quote inside a quoted argument (`\"` inside `"..."` or `\'` inside `'...'`). For example, `/review "the \"fast\" path"` passes `the "fast" path`. All other backslashes (including `\\` and backslashes outside quotes) remain literal.
|
|
111
135
|
|
|
112
136
|
## Next steps
|
|
113
137
|
|
|
114
|
-
- [
|
|
138
|
+
- [Use and organize skills](/skills). Provide instructions the agent loads on its own when a task matches, instead of requiring an explicit slash command.
|
|
115
139
|
- [Subagents](/subagents). Delegate a focused, bounded task to a child agent.
|
|
116
|
-
- [
|
|
140
|
+
- [Install and manage packages](/packages). Bundle your prompt templates with skills, themes, and extensions to share them.
|
|
117
141
|
- [Build with Atomic](/build). Compare every customization option.
|
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Provider reference
|
|
3
|
-
|
|
2
|
+
title: "Provider reference"
|
|
3
|
+
sidebarTitle: "Providers"
|
|
4
|
+
description: "Credential resolution order, provider stop reasons, and GitHub Copilot error classes and helpers."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
This reference covers credential precedence, terminal stop reasons, and GitHub Copilot's typed error classes. For setup steps, subscriptions, and API keys, see [Authentication](/getting-started/authentication) and [Model providers](/providers).
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
+
## Credential resolution order {#resolution-order}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Atomic resolves provider credentials from highest to lowest priority:
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
1. **CLI [`--api-key`](/reference/cli#model-options) flag** (or [SDK runtime API key override](/sdk/reference#api-keys-and-oauth)).
|
|
14
|
+
2. **Stored credential in `~/.atomic/agent/auth.json`** (API key or OAuth token; falls back to legacy `~/.pi/agent/auth.json`).
|
|
15
|
+
3. **Provider configuration `apiKey`** from an extension's [`registerProvider()`](/custom-provider) call, then from [`~/.atomic/agent/models.json`](/models).
|
|
16
|
+
4. **Built-in [environment variable](/environment-variables#provider-credentials) or ambient credentials** (such as `ANTHROPIC_API_KEY`, AWS profiles/IAM/IRSA, Google Application Default Credentials, or Anthropic Workload Identity Federation).
|
|
17
|
+
|
|
18
|
+
Watch out for two precedence rules:
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
- **Unset `$VAR` in `models.json` blocks env fallback.** If you configure `"apiKey": "$UNSET_VAR"` on a built-in provider in `models.json` and `UNSET_VAR` is unset or empty, credential resolution stops and returns no credential instead of falling back to the provider's built-in environment variable.
|
|
21
|
+
- **Anthropic environment variable order.** When no CLI flag, `auth.json` entry, or `models.json` `apiKey` is set for `anthropic`, Atomic checks `ANTHROPIC_AUTH_TOKEN`, then `ANTHROPIC_OAUTH_TOKEN`, then `ANTHROPIC_API_KEY`, then Anthropic Workload Identity Federation.
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
### SDK login options
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
Applications calling [`@bastani/atomic-ai`](/libraries/ai) directly can pass `{ agentName: "my-app" }` as the fourth argument to `models.login()` to set the OpenAI ChatGPT sign-in name hint or Codex login originator. ChatGPT sign-in defaults to `Atomic`. For host session authentication helpers, see [SDK API keys and OAuth](/sdk/reference#api-keys-and-oauth).
|
|
26
|
+
|
|
27
|
+
## Stop reasons
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
Every provider reports why a turn ended. Atomic maps the provider's raw stop reason (`end_turn`, `MAX_TOKENS`, `tool_calls`, and similar values) onto `stop`, `length`, `toolUse`, `error`, `aborted`, or `deferred` (for asynchronous batch APIs).
|
|
30
|
+
|
|
31
|
+
An unrecognized terminal reason becomes a provider error that names the raw value instead of an ordinary stop. This surfaces new truncation or safety signals rather than letting a turn appear complete. Provider safety and refusal errors keep their raw reason, such as `Provider stopped with: SAFETY`.
|
|
32
|
+
|
|
33
|
+
A streaming partial message carries `pending` until a terminal reason replaces it. A completed turn cannot remain `pending`, so a stream that ends in that state becomes a provider error. See [Implement provider streaming](/custom-provider/streaming#stop-reasons) for custom streaming requirements.
|
|
24
34
|
|
|
25
35
|
## GitHub Copilot errors
|
|
26
36
|
|
|
27
|
-
Atomic classifies failed GitHub Copilot requests into typed error classes so retries and [model fallback](/settings#
|
|
37
|
+
Atomic classifies failed GitHub Copilot requests into typed error classes so [retries](/settings#retry) and [model fallback](/settings#fallbackmodels) react to the failure cause rather than message text. Each message states what failed, the model, the error code, the next step, and Copilot's response excerpt.
|
|
28
38
|
|
|
29
|
-
Every `GitHubCopilotError` carries `code`, `retryable`, `hint`, `modelId`, `api`, `status`, `providerCode` (Copilot's error code), `requestId` (Copilot's `x-request-id`), `detail` (a
|
|
39
|
+
Every `GitHubCopilotError` carries `code`, `retryable`, `hint`, `modelId`, `api`, `status`, `providerCode` (Copilot's error code), `requestId` (Copilot's `x-request-id`), `detail` (a response excerpt truncated to 300 characters, which may quote parts of the request), and `cause`.
|
|
30
40
|
|
|
31
41
|
| Class | Code | When | Extra fields | Retried on same model | Falls back to next model | What to do |
|
|
32
42
|
| --- | --- | --- | --- | --- | --- | --- |
|
|
@@ -46,10 +56,16 @@ All 11 classes extend `GitHubCopilotError`. The same retry and fallback rules ap
|
|
|
46
56
|
|
|
47
57
|
### GitHub Copilot error helpers
|
|
48
58
|
|
|
49
|
-
SDK callers can
|
|
50
|
-
|
|
51
|
-
The error is stored in the message `diagnostics`, so it survives workers, RPC, and saved sessions. Use `serializeGitHubCopilotError()` and `deserializeGitHubCopilotError()` for explicit conversion. `deserializeGitHubCopilotError()` returns `undefined` if the class name does not match the code or if the `reason` does not belong to that class.
|
|
59
|
+
SDK callers can inspect, classify, and serialize Copilot errors using functions exported from [`@bastani/atomic`](/sdk) and [`@bastani/atomic-ai`](/libraries/ai):
|
|
52
60
|
|
|
53
|
-
|
|
61
|
+
- **Extract or classify errors:**
|
|
62
|
+
- `getGitHubCopilotError(message)`: reads the typed error from a failed assistant message's `diagnostics`.
|
|
63
|
+
- `findGitHubCopilotError(error)`: searches an error, its `cause` chain, or a wrapped message and returns the typed `GitHubCopilotError` instance.
|
|
64
|
+
- `classifyGitHubCopilotFailure(error, failure)`: maps a raw error and request context into a typed `GitHubCopilotError`.
|
|
65
|
+
- **Serialize across processes:** Errors are stored in assistant message `diagnostics` under `GITHUB_COPILOT_ERROR_DIAGNOSTIC` (`"github_copilot_error"`), so they survive subagent workers, RPC, and saved sessions. Inferred Chat Completions stop reasons are recorded under `GITHUB_COPILOT_INFERRED_STOP_REASON_DIAGNOSTIC` (`"github_copilot_inferred_stop_reason"`). Use `serializeGitHubCopilotError()` and `deserializeGitHubCopilotError()` for explicit conversion; `deserializeGitHubCopilotError()` returns `undefined` if the class name does not match the code or if `reason` does not belong to that class.
|
|
66
|
+
- **Type guards:** Return a plain `boolean` checking an error, its `cause` chain, or a failed message (including errors relayed from another process):
|
|
67
|
+
- `isGitHubCopilotError`, `isRetryableGitHubCopilotError`
|
|
68
|
+
- `isGitHubCopilotModelUnavailableError`, `isGitHubCopilotRateLimitError`, `isGitHubCopilotQuotaExhaustedError`, `isGitHubCopilotContentFilterError`, `isGitHubCopilotPromptTooLargeError`, `isGitHubCopilotInvalidRequestError`, `isGitHubCopilotAuthenticationError`, `isGitHubCopilotServiceUnavailableError`, `isGitHubCopilotStreamEndedEarlyError`, `isGitHubCopilotEmptyResponseError`, `isGitHubCopilotUnrecognizedResponseError`
|
|
69
|
+
- **Model inspection:** Call `describeGitHubCopilotModel(model)` to inspect a Copilot model's capabilities.
|
|
54
70
|
|
|
55
|
-
The guards and `findGitHubCopilotError()`
|
|
71
|
+
The guards and `findGitHubCopilotError()` reject malformed serialized payloads. Only minimal serialized error objects containing `name`, `code`, and an optional string `message` are reconstructed without structured fields; a malformed full payload is never rebuilt with dropped context.
|