@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/llama-cpp.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Local models"
|
|
3
|
-
|
|
2
|
+
title: "Local models with llama.cpp"
|
|
3
|
+
sidebarTitle: "Local models"
|
|
4
|
+
description: "Connect Atomic to a local llama.cpp router server to discover, load, download, and run GGUF models and local classifiers."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Atomic supports the [llama.cpp](https://llama.app) router server. The router discovers multiple GGUF models and loads or unloads them on demand.
|
|
7
|
+
Atomic integrates with the [llama.cpp](https://llama.app) router server to discover local GGUF models, load or unload them on demand, download models from Hugging Face, and run local classification.
|
|
9
8
|
|
|
10
9
|
## Install llama.cpp
|
|
11
10
|
|
|
@@ -46,7 +45,7 @@ For settings tuned to a specific NVIDIA GPU and model, see [NVIDIA RTX recipes](
|
|
|
46
45
|
|
|
47
46
|
## Configure Atomic
|
|
48
47
|
|
|
49
|
-
Run `/login llama.cpp` and enter the router URL and optional API key. The default URL is `http://127.0.0.1:9931
|
|
48
|
+
Run `/login llama.cpp` inside an interactive session and enter the router URL and optional API key. The default URL is `http://127.0.0.1:9931` (trailing slashes and `/v1` are normalized automatically). Shell `atomic auth login` does not load extension providers, so use `/login llama.cpp` or environment variables below instead (see [CLI reference](/reference/cli#credential-commands) and [Model providers](/providers)). When the router runs with `--no-models-autoload`, login saves only the connection; load a model with `/llama`, then select it with `/model`.
|
|
50
49
|
|
|
51
50
|
You can configure the same values with environment variables instead of `/login`:
|
|
52
51
|
|
|
@@ -56,14 +55,14 @@ export LLAMA_API_KEY=optional-secret
|
|
|
56
55
|
atomic
|
|
57
56
|
```
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
A server URL saved with `/login llama.cpp` (stored in `auth.json` under `env.LLAMA_BASE_URL`) takes precedence over `LLAMA_BASE_URL`. When no API key is configured, Atomic sends `"local"` as a placeholder key. If the server requires authentication, start `llama serve` with the matching `--api-key` and keep `--host 127.0.0.1` for local-only access.
|
|
60
59
|
|
|
61
60
|
## Manage models
|
|
62
61
|
|
|
63
62
|
Run `/llama` in interactive mode to manage router models:
|
|
64
63
|
|
|
65
64
|
- Select an unloaded model to load it, or a loaded model to unload it.
|
|
66
|
-
- Select **Download model
|
|
65
|
+
- Select **Download model...** to search Hugging Face and pick a repository and quantization. Search returns up to 20 GGUF repositories sorted by downloads (15-second timeout). The quantization picker excludes `mmproj` projection files, lists `Q4_K_M` first, and sorts remaining quantizations from smallest to largest. Typing an exact `owner/repository` or `owner/repository:QUANT` value and pressing Enter downloads it directly.
|
|
67
66
|
- Press Escape during a load or download to confirm cancellation.
|
|
68
67
|
|
|
69
68
|
Hugging Face search checks `HF_TOKEN`, then `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Unauthenticated search has lower rate limits. Atomic warns before gated downloads and links to the access page; because llama.cpp performs the download, its process also needs `HF_TOKEN` for gated repositories.
|
|
@@ -74,7 +73,36 @@ Atomic caches the last loaded-model catalog in `~/.atomic/agent/models-store.jso
|
|
|
74
73
|
|
|
75
74
|
If the router disconnects, select **Retry** to reconnect and refresh state without replaying the interrupted action.
|
|
76
75
|
|
|
77
|
-
Each llama.cpp model sets both `contextWindow` and `maxTokens` from the router-reported context window (`meta.n_ctx`, then the model's configured `--ctx-size`, cached context, training context `meta.n_ctx_train`, or the 128,000-token fallback). The server remains authoritative and may enforce a smaller generation limit.
|
|
76
|
+
Each llama.cpp model sets both `contextWindow` and `maxTokens` from the router-reported context window (`meta.n_ctx`, then the model's configured `--ctx-size`, `-c`, or `-ctx` argument, cached context, training context `meta.n_ctx_train`, or the 128,000-token fallback). The server remains authoritative and may enforce a smaller generation limit.
|
|
77
|
+
|
|
78
|
+
### Thinking and vision detection
|
|
79
|
+
|
|
80
|
+
- **Thinking controls:** Atomic enables thinking controls only when a **currently loaded** model's server `/props` `chat_template` contains `"enable_thinking"`. Sleeping or unloaded autoload-preset models are not queried during discovery so they are not woken unexpectedly; load a model in `/llama` and refresh to detect its thinking template. When thinking is detected, Atomic exposes only **`off`** and **`medium`** thinking levels (`minimal`, `low`, `high`, `xhigh`, and `max` are unavailable).
|
|
81
|
+
- **Vision support:** Image input is enabled automatically when the server reports `"image"` in `architecture.input_modalities`.
|
|
82
|
+
|
|
83
|
+
## Classification
|
|
84
|
+
|
|
85
|
+
Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, letting a local model serve `decide()` and `structured_output` decisions as your [`decisionModel`](/settings#decisionmodel) (see [Structured decisions](/sdk/structured-decisions)). Extensions can call `ctx.modelRegistry.classify()` and codemode scripts can call `models.classify()`; see [Classifier models](/models#use-classifier-models).
|
|
86
|
+
|
|
87
|
+
Atomic exposes llama.cpp models as classifiers in two ways:
|
|
88
|
+
|
|
89
|
+
- **Decision models** (such as Julia-1, Laya, Kev, lev, and OpenJev) answer natively through llama.cpp's decision endpoint (`/v1/systemone`, API `typesafe-system-one`). Decision-only models do not appear in `/model`.
|
|
90
|
+
- **Chat models** are also exposed as classifiers under the same ID using next-token probability classification (API `llama-cpp-classify`).
|
|
91
|
+
|
|
92
|
+
llama.cpp 0.6.0 and newer identify decision models by including `decisions` in `architecture.output_modalities`. Atomic detects them even when sleeping or unloaded without waking them during discovery. Unloaded presets are selectable only when router autoload is enabled. Older servers omit this metadata and fall back to `llama-cpp-classify`.
|
|
93
|
+
|
|
94
|
+
### Chat models as classifiers
|
|
95
|
+
|
|
96
|
+
Rather than generating text, Atomic formats each question as a single chat prompt (state, all request questions, state again, then the target question and single-token labels) and reads next-token probabilities for the labels. Labels are alphanumeric characters for `choice` (2 to 62 options; 1 option throws an error), `Yes`/`No` for `bool`, and digits for `score` (2 to 10 levels). If a label token is absent from the server's top probabilities, Atomic retries with larger `n_probs` up to 32,768. Choices return normalized option probabilities and a confidence of `(n * peak - 1) / (n - 1)`; scores return the expected level.
|
|
97
|
+
|
|
98
|
+
Key behavior for chat-model classifiers:
|
|
99
|
+
|
|
100
|
+
- An explicit [`decisionModel`](/settings#decisionmodel) resolves classifiers before chat models, so `decisionModel: "llama.cpp/<id>"` uses the classifier. A choice with more than 62 options fails on `llama-cpp-classify` and falls back to the active chat model. The **Decision model** picker lists each chat model twice (classifier and chat), saving the same ID; decision-only models have only a classifier row.
|
|
101
|
+
- `structured_output` and `generateStructuredOutput()` resolve chat models before classifiers when both share an ID, so naming `llama.cpp/<id>` there uses the chat model.
|
|
102
|
+
- SDK `classify()` accepts a `temperature` option that divides label logits before normalizing. Values above `1` soften overconfident probabilities without changing the winning answer.
|
|
103
|
+
- Questions run sequentially and share the prompt prefix so the server's prompt cache evaluates it once. Because the state appears twice in the prompt, reserve twice the state size in context.
|
|
104
|
+
- Small models may follow prompt-injection instructions inside the state despite the system prompt instructing them to judge the state as data.
|
|
105
|
+
- Hybrid models such as Qwen3.5 need context checkpoints to reuse a cached prefix across questions. If every question reprocesses the full state, start the router with `--ctx-checkpoints 32 --checkpoint-min-step 0`.
|
|
78
106
|
|
|
79
107
|
## NVIDIA RTX recipes
|
|
80
108
|
|
|
@@ -169,30 +197,6 @@ Follow [Configure Atomic](#configure-atomic) to connect to `http://127.0.0.1:993
|
|
|
169
197
|
|
|
170
198
|
NVIDIA recipe memory budgets assume only that model occupies the GPU. Unload any other loaded models in `/llama` before running the recipe model.
|
|
171
199
|
|
|
172
|
-
## Classification
|
|
173
|
-
|
|
174
|
-
Classifier models answer typed `choice`, `bool`, and `score` questions about JSON state, letting a local model serve `decide()` and `structured_output` decisions as your [`decisionModel`](/settings#decisionmodel). Extensions can call `ctx.modelRegistry.classify()` and codemode scripts can call `models.classify()`; see [Classifier models](/models#use-classifier-models).
|
|
175
|
-
|
|
176
|
-
Atomic exposes llama.cpp models as classifiers in two ways:
|
|
177
|
-
|
|
178
|
-
- **Decision models** (such as Julia-1, Laya, Kev, lev, and OpenJev) answer natively through llama.cpp's `/v1/systemone` endpoint with the `typesafe-system-one` API. Decision-only models do not appear in `/model`.
|
|
179
|
-
- **Chat models** are also exposed as classifiers under the same ID with the `llama-cpp-classify` API, using next-token log-probabilities.
|
|
180
|
-
|
|
181
|
-
llama.cpp 0.6.0 and newer identify decision models by including `decisions` in `architecture.output_modalities`. Atomic detects them even when sleeping or unloaded without waking them during discovery. Unloaded presets are selectable only when router autoload is enabled. Older servers omit this metadata and fall back to `llama-cpp-classify`.
|
|
182
|
-
|
|
183
|
-
### Chat models as classifiers
|
|
184
|
-
|
|
185
|
-
Rather than generating text, Atomic formats each question as a single chat prompt (state, all request questions, state again, then the target question and single-token labels) and reads next-token probabilities for the labels. Labels are alphanumeric characters for `choice` (2 to 62 options), `Yes`/`No` for `bool`, and digits for `score` (2 to 10 levels). Choices return normalized option probabilities and a confidence of `(n * peak - 1) / (n - 1)`; scores return the expected level.
|
|
186
|
-
|
|
187
|
-
Key behavior for chat-model classifiers:
|
|
188
|
-
|
|
189
|
-
- An explicit [`decisionModel`](/settings#decisionmodel) resolves classifiers before chat models, so `decisionModel: "llama.cpp/<id>"` uses the classifier. A choice with more than 62 options fails on `llama-cpp-classify` and falls back to the active chat model. The **Decision model** picker lists each chat model twice (classifier and chat), saving the same ID; decision-only models have only a classifier row.
|
|
190
|
-
- `structured_output` and `generateStructuredOutput()` resolve chat models before classifiers when both share an ID, so naming `llama.cpp/<id>` there uses the chat model.
|
|
191
|
-
- SDK `classify()` accepts a `temperature` option that divides label logits before normalizing. Values above `1` soften overconfident probabilities without changing the winning answer.
|
|
192
|
-
- Questions run sequentially and share the prompt prefix so the server's prompt cache evaluates it once. Because the state appears twice in the prompt, reserve twice the state size in context.
|
|
193
|
-
- Small models may follow prompt-injection instructions inside the state despite the system prompt instructing them to judge the state as data.
|
|
194
|
-
- Hybrid models such as Qwen3.5 need context checkpoints to reuse a cached prefix across questions. If every question reprocesses the full state, start the router with `--ctx-checkpoints 32 --checkpoint-min-step 0`.
|
|
195
|
-
|
|
196
200
|
## Troubleshooting
|
|
197
201
|
|
|
198
202
|
```bash
|
|
@@ -202,5 +206,6 @@ curl http://127.0.0.1:9931/models
|
|
|
202
206
|
|
|
203
207
|
- **No models in `/llama`:** Verify cached models or `--models-dir` layout, then restart the router.
|
|
204
208
|
- **Model missing from `/model` with `--no-models-autoload`:** Load it in `/llama` first.
|
|
209
|
+
- **Thinking controls missing:** Load the model in `/llama`, then refresh `/model`; thinking controls appear only for loaded models whose chat template includes `"enable_thinking"`.
|
|
205
210
|
- **Load fails or runs out of memory:** Lower `-c` or unload another model.
|
|
206
211
|
- **Server is not in router mode:** Start `llama serve` without `--model`, `-m`, or `-hf`.
|
package/docs/mcp-servers.md
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "MCP
|
|
3
|
-
|
|
2
|
+
title: "MCP servers"
|
|
3
|
+
sidebarTitle: "MCP servers"
|
|
4
|
+
description: "Configure stdio and streamable HTTP MCP servers, control tool exposure, read resources, and authenticate with OAuth or provider logins."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Atomic includes [Model Context Protocol](https://modelcontextprotocol.io) support in npm and binary installations. It connects to servers over stdio or streamable HTTP. No separate extension install is needed.
|
|
7
|
+
Atomic includes built-in [Model Context Protocol](https://modelcontextprotocol.io) support in both npm and standalone binary installations. It connects to MCP servers over stdio or streamable HTTP with no separate extension install required.
|
|
9
8
|
|
|
10
9
|
## Quick setup
|
|
11
10
|
|
|
12
|
-
Add a local server,
|
|
11
|
+
Add a local stdio server, verify the connection, and start Atomic:
|
|
13
12
|
|
|
14
|
-
```
|
|
13
|
+
```bash
|
|
15
14
|
atomic mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem .
|
|
16
15
|
atomic mcp list
|
|
17
16
|
atomic
|
|
18
17
|
```
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
Add a remote streamable HTTP server:
|
|
21
20
|
|
|
22
|
-
```
|
|
21
|
+
```bash
|
|
23
22
|
atomic mcp add docs --url https://example.com/mcp --bearer-token-env-var DOCS_TOKEN
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
CLI commands write user-level configuration by default. Pass `--local` or `-l` to write `.atomic/mcp.json` in the current project instead, then start Atomic and grant project trust before using project servers.
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
Run `/mcp` inside Atomic to inspect connections and manage servers. After editing configuration outside a session, run `/reload` or restart Atomic.
|
|
29
28
|
|
|
30
29
|
## Configure servers
|
|
31
30
|
|
|
32
|
-
Atomic reads user-level servers from `~/.atomic/agent/mcp.json` and project servers from `.atomic/mcp.json`. Project configuration
|
|
31
|
+
Atomic reads user-level servers from `~/.atomic/agent/mcp.json` (relocated by `ATOMIC_CODING_AGENT_DIR`) and project servers from `.atomic/mcp.json`. Project configuration loads only after [project trust](/security) is granted. Both files use a top-level `mcpServers` object. Keep personal servers and credentials in the user-level file.
|
|
32
|
+
|
|
33
|
+
A full project entry replaces a user-level entry with the exact same key name. A project entry without `command`, `url`, or `type` acts as a lightweight override that can set **only** `enabled`, `exposure`, and `toolExposure` on a user-level server with the exact same key name while keeping the rest (`env`, `headers`, `auth`, and `oauth`). Adding any other field (such as `timeout` or `description`) or referencing a server not present in user-level `mcp.json` reports a configuration error and skips the entry.
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
For example, to turn off a user-level server in one project:
|
|
35
36
|
|
|
36
37
|
```json
|
|
37
38
|
{
|
|
@@ -41,13 +42,11 @@ A project entry without `command`, `url`, or `type` overrides only `enabled`, `e
|
|
|
41
42
|
}
|
|
42
43
|
```
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Stdio servers use `command`, `args`, `env`, and `cwd`. `command` is one executable, not a shell command string. A `command` with a path runs as written; one named without a path is looked up in the absolute directories on `PATH` from `env`, and on Windows first in `cwd` when that lies outside the project folder (the project folder counts only when `PATH` names it).
|
|
45
|
+
**Server names and namespace collisions.** Server names may contain letters, digits, `_`, and `-`. Reserved JavaScript property names (`__proto__`, `constructor`, and `prototype`) are rejected. Names that differ only in `-` versus `_` share the same tool namespace, while project overrides look up user-level servers by exact key name. If user-level config defines `my-server`, a project entry named `my_server` does not match as an override and is rejected as a namespace conflict if defined as a full server. Always use the exact same key name to override or replace a user-level server. Invalid entries are reported and skipped without blocking other servers.
|
|
47
46
|
|
|
48
|
-
On Windows, variables in `env` (such as `PATH`) replace inherited variables case-insensitively
|
|
47
|
+
**Stdio servers.** Configure `command`, `args`, `env`, and `cwd`. `command` must be one executable, not a shell command string. A `command` with a path runs as written; a bare command name is searched in the absolute directories on `PATH` from `env` (and on Windows first in `cwd` when `cwd` is outside the project folder; the project folder counts only if `PATH` lists it). On Windows, variables in `env` (such as `PATH`) replace inherited variables case-insensitively both when locating `command` and inside the spawned server. A missing executable fails with `spawn <command> ENOENT`. Relative `cwd` values resolve against the session directory.
|
|
49
48
|
|
|
50
|
-
HTTP servers
|
|
49
|
+
**Streamable HTTP servers.** Configure `url`, optional `headers`, and optional `oauth` or `auth`:
|
|
51
50
|
|
|
52
51
|
```json
|
|
53
52
|
{
|
|
@@ -61,49 +60,53 @@ HTTP servers use `url`, optional `headers`, and optional `oauth`. For bearer aut
|
|
|
61
60
|
}
|
|
62
61
|
```
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
**Variable, command, and home-directory expansion.** Interpolation rules differ by field:
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
| Fields | Supported syntax | Escaping and caveats |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| `url` | `${NAME}`, `$env:NAME` | Resolved in memory before URL validation without rewriting config files. Does **not** support unbraced `$NAME`, `!command`, or `$$` escaping. |
|
|
68
|
+
| `env`, `headers`, `oauth.clientSecret` | `${NAME}`, unbraced `$NAME`, whole-value `!command` (such as `"!echo Bearer $(gh auth token)"`) | **Escape literal `$` as `$$` and literal leading `!` as `$!`.** Because unbraced `$NAME` is interpolated automatically, secrets containing `$word` expand or fail unless escaped as `$$word`. Only use `!command` in configuration you trust. On failure, Atomic never echoes `!command` text; `${NAME}` reports the unset variable name, while unbraced `$NAME` reports the name only when it looks like a POSIX variable name so literal secret fragments do not leak. |
|
|
69
|
+
| `command`, `args`, `cwd` | Leading `~`, `~/`, and (on Windows) `~\` | Expands to your home directory. Does not interpolate environment variables or `!command`. |
|
|
70
|
+
| `oauth.clientId`, `oauth.scope`, `oauth.callbackUrl`, `oauth.authServerMetadataUrl` | Literal strings only | No environment variable, `!command`, or `~` expansion. |
|
|
67
71
|
|
|
68
|
-
|
|
69
|
-
- `enabled: false`: keep a server listed without connecting to it.
|
|
70
|
-
- `exposure` and `toolExposure`: control how tools reach the model.
|
|
71
|
-
- `description`: a short server summary for the system prompt, tool search, and `describeNamespace()`. Without it, Atomic uses the first line of server instructions once connected.
|
|
72
|
-
|
|
73
|
-
Server names may contain letters, digits, `_`, and `-`. Names that differ only in `-` and `_` identify the same namespace. Invalid entries are reported and skipped without preventing other servers from connecting.
|
|
72
|
+
**Fields shared by both transports:**
|
|
74
73
|
|
|
75
|
-
`
|
|
74
|
+
- `timeout`: per-request inactivity timeout in seconds (default `60`). Server progress notifications reset this timer; it is not a total execution deadline.
|
|
75
|
+
- `enabled: false`: keep a server configured without connecting to it.
|
|
76
|
+
- `exposure` and `toolExposure`: control how tools reach the model.
|
|
77
|
+
- `description`: a short summary for the model's system prompt, tool search, and `describeNamespace()`. If omitted, Atomic uses the first line of the server's instructions once connected.
|
|
78
|
+
- `type`: optional (`command` selects stdio and `url` selects streamable HTTP). When present, must be `stdio`, `http`, or `streamable-http`. SSE endpoints are not supported; point to the server's streamable HTTP endpoint (typically `/mcp` rather than `/sse`).
|
|
76
79
|
|
|
77
80
|
### Servers from packages and extensions
|
|
78
81
|
|
|
79
|
-
Installed [packages](/packages/authoring#mcp-servers) and extensions can contribute servers
|
|
82
|
+
Installed [packages](/packages/authoring#mcp-servers) and [extensions](/extensions/api-reference#atomic-registermcpserver-name-config) can contribute MCP servers using the same configuration shape. File-configured servers take precedence over package or extension contributions with the same normalized name. Project packages load only after project trust is granted.
|
|
80
83
|
|
|
81
|
-
`/mcp` shows each server's source. Enabled-state and exposure changes
|
|
84
|
+
`/mcp` shows each server's source. Enabled-state and exposure changes to file-configured servers save back to `mcp.json` while preserving formatting and unrelated settings (setting a full entry back to the defaults `enabled: true` or `exposure: "codemode"` omits those default keys on disk, while project overrides keep explicit keys). In a trusted project, **Enable in this project** and **Disable in this project** create or update a project override for a user-level server, and `atomic mcp list` displays the override. Changes to extension-contributed servers apply to the current session only.
|
|
82
85
|
|
|
83
86
|
## Manage servers
|
|
84
87
|
|
|
85
|
-
|
|
88
|
+
Run `/mcp` to open the interactive server manager showing connection state, tool count, exposure, and source, even while startup connections are still pending.
|
|
86
89
|
|
|
87
|
-
Select a server to inspect tools and details, sign in or out, reconnect, enable or disable it, or change exposure. Servers needing attention appear first. Enable, disable, and reconnect run in the background while the manager updates live, so you can keep navigating or close it. Use
|
|
90
|
+
Select a server to inspect tools and details, sign in or out, reconnect, enable or disable it, or change exposure. Servers needing attention appear first. Enable, disable, and reconnect run in the background while the manager updates live, so you can keep navigating or close it. Use `↑` and `↓` to select, `Enter` to open, `Esc` to go back, and type to filter lists longer than one screen.
|
|
88
91
|
|
|
89
92
|
| Command | Action |
|
|
90
93
|
| --- | --- |
|
|
91
|
-
| `/mcp` | Open the manager in the TUI, or
|
|
94
|
+
| `/mcp` | Open the manager in the TUI, or print status outside the TUI. |
|
|
92
95
|
| `/mcp login [server]` | Sign in with OAuth. |
|
|
93
96
|
| `/mcp logout [server]` | Remove stored OAuth credentials. |
|
|
94
97
|
| `/mcp reconnect [server]` | Reconnect a server and refresh its tools. |
|
|
95
98
|
|
|
96
|
-
|
|
99
|
+
Tab completion suggests subcommands and eligible server names. When you omit a server name, Atomic selects the only eligible server automatically or prompts you to choose. `/mcp login` requires an interactive UI; run `atomic mcp login` in your shell before unattended runs.
|
|
97
100
|
|
|
98
|
-
Enabled servers connect in the background at
|
|
101
|
+
Enabled servers connect in the background at startup. The first prompt waits up to 10 seconds for servers with `direct` tools, while codemode, `tool_search`, and resource calls wait for the servers they need. Dropped connections reconnect on the next call, and server-announced tool list changes apply automatically.
|
|
99
102
|
|
|
100
|
-
When you resume a session, its previously used MCP tools
|
|
103
|
+
When you resume a session, its previously used MCP tools remain available and keep their summaries while servers reconnect, as long as the server stays defined in the same scope with the same command and `cwd` (or the same URL scheme, host, port, and path; argument and query changes do not invalidate it). Calls wait for reconnect and run only if the tool still exists. Tools from servers that fail to reconnect, require sign-in, or removed them update on the next turn.
|
|
101
104
|
|
|
102
105
|
### Shell commands
|
|
103
106
|
|
|
104
|
-
|
|
107
|
+
CLI subcommands operate on file-configured servers and do not load extensions (see [MCP CLI commands](/reference/cli#mcp-commands)):
|
|
105
108
|
|
|
106
|
-
```
|
|
109
|
+
```bash
|
|
107
110
|
atomic mcp add <server> [options] -- <command> [args...]
|
|
108
111
|
atomic mcp add <server> [options] --url <url>
|
|
109
112
|
atomic mcp remove <server> [-l]
|
|
@@ -114,28 +117,28 @@ atomic mcp logout <server> [-l]
|
|
|
114
117
|
|
|
115
118
|
`add` replaces an existing entry with the same name. `add` and `remove` accept `--local` (`-l`) to write `.atomic/mcp.json`; `login` and `logout` accept `-l` to require a project-defined server (otherwise they search both files).
|
|
116
119
|
|
|
117
|
-
For stdio servers, pass repeatable `--env KEY=VALUE` and `--cwd`. For HTTP servers, pass repeatable `--header KEY=VALUE`, `--bearer-token-env-var NAME`, and `--oauth-client-id`, `--oauth-client-secret`, `--oauth-callback-port`, or `--oauth-client-name`. Both transports accept `--exposure` and `--description`. Passing `--help` or `-h` after `--` (for example `atomic mcp add srv -- cmd --help`) or as
|
|
120
|
+
For stdio servers, pass repeatable `--env KEY=VALUE` and `--cwd`. For HTTP servers, pass repeatable `--header KEY=VALUE`, `--bearer-token-env-var NAME`, and `--oauth-client-id`, `--oauth-client-secret`, `--oauth-callback-port`, or `--oauth-client-name`. Both transports accept `--exposure` and `--description`. Advanced options without CLI flags (`timeout`, `enabled`, `auth.provider`, `oauth.callbackUrl`, `oauth.scope`, and `oauth.authServerMetadataUrl`) can be edited directly in `mcp.json`. Passing `--help` or `-h` after `--` (for example `atomic mcp add srv -- cmd --help`) or as a flag value passes through instead of printing MCP help. Run `atomic mcp --help` for full usage.
|
|
118
121
|
|
|
119
|
-
`list` connects to enabled servers and reports state, tools, and errors, exiting `1` on invalid config or any disconnected enabled server. Pass `--json` for machine-readable output. `login` times out after 300 seconds by default (`--timeout` caps the entire sign-in, including authorization-server requests, not MCP
|
|
122
|
+
`list` connects to enabled servers and reports state, tools, and errors, exiting `1` on invalid config or any disconnected enabled server. Pass `--json` for machine-readable output. `login` times out after 300 seconds by default (`--timeout` caps the entire sign-in flow, including authorization-server requests, not MCP request timeouts). Running sessions pick up new credentials on their next turn.
|
|
120
123
|
|
|
121
|
-
Resource-capable servers show
|
|
124
|
+
Resource-capable servers show `offers resources` rather than counts (`resources: true` in `--json` output). Use the resource tools below to list resources on demand.
|
|
122
125
|
|
|
123
126
|
## Find and call tools
|
|
124
127
|
|
|
125
|
-
|
|
128
|
+
MCP tools register as `mcp__<server>__<tool>` with punctuation replaced by `_`. Names longer than 64 characters, or names that collide after normalization, are shortened to at most 64 characters with an 8-hex SHA-256 hash suffix (`_xxxxxxxx`). Always use the names returned by discovery rather than constructing them by hand.
|
|
126
129
|
|
|
127
130
|
### Control tool exposure
|
|
128
131
|
|
|
129
132
|
| Exposure | Behavior |
|
|
130
133
|
| --- | --- |
|
|
131
|
-
| `codemode
|
|
132
|
-
| `deferred` | Not declared until `tool_search`
|
|
134
|
+
| `codemode` (default) | Callable from [codemode](/codemode) scripts, but not declared directly to the model or listed in codemode's inline catalog. Discover with `await searchTools()`, `await describeTool()`, or `ALL_TOOLS`. |
|
|
135
|
+
| `deferred` | Not declared until [`tool_search`](/tools#tool_search) activates matching tools for the next model turn. |
|
|
133
136
|
| `direct` | Declared like a built-in tool and also callable from codemode. |
|
|
134
137
|
| `hidden` | Unreachable. |
|
|
135
138
|
|
|
136
|
-
`codemode-deferred` is accepted as an alias for `codemode`. Atomic activates `codemode` for codemode servers and `tool_search` for deferred servers. An explicit `-codemode` in `defaultTools` or `--tools` takes precedence
|
|
139
|
+
`codemode-deferred` is accepted as an alias for `codemode`. Atomic activates `codemode` for codemode servers and `tool_search` for deferred servers automatically. An explicit `-codemode` in `defaultTools` or `--tools` takes precedence so MCP leaves codemode off (merely omitting `codemode` from `defaultTools` does not block MCP activation). Set `"autoEnableCodemode": false` beside `mcpServers` to turn off automatic codemode activation without changing ordinary defaults; a project setting overrides the user-level setting.
|
|
137
140
|
|
|
138
|
-
`toolExposure` overrides individual tools. Keys
|
|
141
|
+
`toolExposure` overrides exposure for individual tools. Keys match the **original server tool name** (case-sensitive) before `mcp__<server>__` prefixing. `*` is the only wildcard (`?`, `[...]`, and regex syntax match literally). Exact matches win first, followed by wildcard patterns in JSON key order (first match wins):
|
|
139
142
|
|
|
140
143
|
```json
|
|
141
144
|
{
|
|
@@ -153,35 +156,35 @@ Tools are named `mcp__<server>__<tool>`, with punctuation replaced by `_`. Names
|
|
|
153
156
|
}
|
|
154
157
|
```
|
|
155
158
|
|
|
156
|
-
|
|
159
|
+
Both `codemode` and `deferred` tools can be reached through either discovery mechanism. Atomic adds a short summary of connected servers to the model's system prompt (capped at 250 characters per server and 4,096 characters total). Scripts can read full server instructions and tool lists with `await describeNamespace("mcp__github")`.
|
|
157
160
|
|
|
158
|
-
`--tools` keeps MCP tools unless an entry starts with `mcp__`. For example, `atomic --tools read,codemode`
|
|
161
|
+
`--tools` keeps MCP tools unless an entry starts with `mcp__`. For example, `atomic --tools read,codemode` still lets codemode scripts call non-hidden `codemode` and `deferred` MCP tools, while unmatched `direct` tools stay registered but inactive. Include `tool_search` to load unmatched non-direct tools, or filter explicitly with patterns such as `atomic --tools read,codemode,'mcp__docs__*'`. `--exclude-tools` accepts the same `*` patterns and applies to MCP resource tools as well.
|
|
159
162
|
|
|
160
|
-
`--no-mcp` disables built-in MCP support for one run
|
|
163
|
+
`--no-mcp` disables built-in MCP support for one run: no built-in servers connect, no MCP tools load, and `/mcp` does not register. A custom replacement extension is unaffected.
|
|
161
164
|
|
|
162
|
-
Codemode
|
|
165
|
+
**Output handling.** Codemode scripts receive the complete untruncated `CallToolResult` (`content`, `structuredContent`, and `isError`, with `_meta` stripped). For direct model calls, text over 20 KiB (`20,480` bytes) is middle-truncated (keeping the start and end) with the full text saved to a temporary file (`pi-mcp*.txt`) named in the result. Every MCP call passes through Atomic's tool pipeline, including permission hooks.
|
|
163
166
|
|
|
164
167
|
## Use resources
|
|
165
168
|
|
|
166
|
-
When a connected server offers resources, Atomic registers:
|
|
169
|
+
When a connected server offers resources, Atomic registers three tools:
|
|
167
170
|
|
|
168
|
-
- `list_mcp_resources
|
|
169
|
-
- `list_mcp_resource_templates
|
|
170
|
-
- `read_mcp_resource
|
|
171
|
+
- `list_mcp_resources`: lists resources. Pass `server` to fetch one page from a single server (and `cursor` for the next page); omit `server` to paginate through every page of every server automatically.
|
|
172
|
+
- `list_mcp_resource_templates`: lists URI templates, using the same `server` and `cursor` pagination rules.
|
|
173
|
+
- `read_mcp_resource`: reads a resource by `server` and `uri`. Text and images reach the model directly; other binary content is saved to a temporary file.
|
|
171
174
|
|
|
172
|
-
These tools
|
|
175
|
+
These tools cover enabled, non-hidden resource servers. Their exposure equals the widest exposure among those servers, using the priority order `direct` > `codemode` > `deferred` > `hidden`. Resource links inside tool results identify the server and `read_mcp_resource`.
|
|
173
176
|
|
|
174
|
-
MCP Apps resources (`ui://` URIs or `text/html;profile=mcp-app`) are omitted because Atomic does not render
|
|
177
|
+
MCP Apps resources (`ui://` URIs or `text/html;profile=mcp-app`) are omitted because Atomic does not render interactive web UIs inside the terminal.
|
|
175
178
|
|
|
176
179
|
## Authentication
|
|
177
180
|
|
|
178
|
-
For a remote OAuth server, configure its
|
|
181
|
+
For a remote OAuth server, configure its `url` and run `/mcp login my-server`, or choose **Sign in** in `/mcp`. Atomic opens the authorization page and prints a clickable URL. If your browser runs on another machine, paste the full redirect URL into the waiting sign-in prompt. Press `Esc` to cancel at any step; authorization-server requests time out after 15 seconds. Treat authorization and redirect URLs as sensitive.
|
|
179
182
|
|
|
180
|
-
Atomic registers OAuth clients as `atomic`, stores
|
|
183
|
+
Atomic registers OAuth clients as `atomic`, stores tokens in `~/.atomic/agent/mcp-auth.json`, and refreshes access tokens proactively 30 seconds before expiry (or when rejected). A successful sign-in reconnects the server. If a server requests extra scopes later, sign in again. Run `/mcp logout my-server` or `atomic mcp logout my-server` to delete stored credentials.
|
|
181
184
|
|
|
182
|
-
Credentials
|
|
185
|
+
Credentials are keyed by server name and URL. Two server entries with the same URL under different names (such as separate accounts) sign in independently; entries with the same name and URL across global and project `mcp.json` files share one sign-in.
|
|
183
186
|
|
|
184
|
-
OAuth applies to HTTP servers
|
|
187
|
+
OAuth applies to HTTP servers that do not set an `Authorization` header or `auth.provider`. For a pre-registered OAuth client:
|
|
185
188
|
|
|
186
189
|
```json
|
|
187
190
|
{
|
|
@@ -199,15 +202,15 @@ OAuth applies to HTTP servers without an `Authorization` header or provider-toke
|
|
|
199
202
|
}
|
|
200
203
|
```
|
|
201
204
|
|
|
202
|
-
`clientSecret` is optional
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
Use `oauth.clientName` when a server requires a
|
|
205
|
+
- `clientSecret` is optional and supports `${NAME}`, `$NAME`, and `!command` expansion (escape literal `$` as `$$`).
|
|
206
|
+
- `callbackPort` must be between `1` and `65535` and uses `http://127.0.0.1:<port>/callback`.
|
|
207
|
+
- `callbackUrl` lets you specify another registered redirect URI. It must use HTTP on `localhost`, `127.0.0.1`, or `[::1]` and must not include a query string (`?`) or fragment (`#`). If `callbackUrl` omits a port, Atomic adds `callbackPort` or picks a free port. If both `callbackUrl` (with an explicit port) and `callbackPort` are set, their ports must match or validation fails.
|
|
208
|
+
- When pasting a redirect URL manually, keep its scheme, host, port, and path unchanged. Atomic rejects URLs that do not match the active sign-in's redirect URI, even when the authorization code and state are valid.
|
|
209
|
+
- Use `oauth.clientName` when a server requires a specific client registration name (sign out before signing in again after changing it). Use `oauth.scope` for servers that do not advertise required scopes; later scope requests are merged with it.
|
|
207
210
|
|
|
208
211
|
### Override OAuth authorization server discovery
|
|
209
212
|
|
|
210
|
-
If
|
|
213
|
+
If an MCP server advertises the wrong authorization server or none at all, set `oauth.authServerMetadataUrl` to a trusted RFC 8414 or OpenID Connect metadata document:
|
|
211
214
|
|
|
212
215
|
```json
|
|
213
216
|
{
|
|
@@ -220,44 +223,93 @@ If a server advertises the wrong authorization server or none, set `oauth.authSe
|
|
|
220
223
|
}
|
|
221
224
|
```
|
|
222
225
|
|
|
223
|
-
Atomic uses
|
|
226
|
+
Atomic uses that document instead of running authorization server discovery and trusts its configured issuer. Point it only at a metadata URL you trust. The URL must use HTTPS, except for HTTP on `localhost`, `127.0.0.1`, or `[::1]`.
|
|
224
227
|
|
|
225
|
-
Atomic rejects authorization responses whose `iss` names another issuer
|
|
228
|
+
Atomic rejects authorization responses whose `iss` names another issuer before exchanging the code. When a server advertises RFC 9207 issuer parameter support, the response must include `iss`. An empty refresh token does not overwrite a stored refresh token, and a missing or null `expires_in` value does not expire the access token immediately.
|
|
226
229
|
|
|
227
230
|
### Authenticate with a provider login
|
|
228
231
|
|
|
229
|
-
An HTTP server can
|
|
232
|
+
An HTTP server can reuse an active Atomic provider login token instead of MCP OAuth:
|
|
230
233
|
|
|
231
234
|
```json
|
|
232
|
-
{
|
|
235
|
+
{
|
|
236
|
+
"mcpServers": {
|
|
237
|
+
"gateway": {
|
|
238
|
+
"url": "https://gateway.example/mcp",
|
|
239
|
+
"auth": { "provider": "openrouter" }
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
233
243
|
```
|
|
234
244
|
|
|
235
|
-
Atomic reads the current token
|
|
245
|
+
Atomic reads the current provider token on every request and never copies it into `mcp-auth.json`. If the token is missing or rejected, run `/login <provider>` and retry.
|
|
236
246
|
|
|
237
|
-
`atomic mcp list` also sends the provider token,
|
|
247
|
+
`atomic mcp list` also sends the provider token, refreshes expired logins, and prompts with `/login <provider>` if sign-in is required. `atomic mcp login` and `atomic mcp logout` do not manage provider logins; use `atomic auth login <provider>` and `atomic auth logout <provider>` instead.
|
|
238
248
|
|
|
239
|
-
|
|
249
|
+
Provider-token authentication enforces these restrictions:
|
|
240
250
|
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
-
-
|
|
251
|
+
- Accepted only from user-level `~/.atomic/agent/mcp.json` and extension registrations, never from project `.atomic/mcp.json` or package manifests.
|
|
252
|
+
- Requires HTTPS, except for HTTP on `localhost`, `127.0.0.1`, or `[::1]`.
|
|
253
|
+
- Sends tokens only to the server's configured origin. Atomic follows same-origin `301`, `302`, `303`, `307`, and `308` redirects up to 10 hops (rewriting `POST` to `GET` on `301` and `302`, and non-`HEAD` requests to `GET` on `303`). Cross-origin redirects are rejected.
|
|
244
254
|
|
|
245
|
-
##
|
|
255
|
+
## Using MCP from the SDK
|
|
246
256
|
|
|
247
|
-
|
|
257
|
+
`createAgentSession()` enables built-in MCP support by default and loads servers from `mcp.json`, installed packages, and extensions. Control MCP behavior programmatically from `@bastani/atomic`:
|
|
248
258
|
|
|
249
|
-
|
|
259
|
+
```typescript
|
|
260
|
+
import { createAgentSession, DefaultResourceLoader } from "@bastani/atomic";
|
|
250
261
|
|
|
251
|
-
|
|
262
|
+
// Disable built-in MCP support completely
|
|
263
|
+
const noMcp = await createAgentSession({
|
|
264
|
+
builtins: { mcp: false },
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// Allow only specific MCP tools, or exclude a server's tools
|
|
268
|
+
const filtered = await createAgentSession({
|
|
269
|
+
tools: ["read", "codemode", "mcp__docs__*"],
|
|
270
|
+
excludedTools: ["mcp__docs__delete_*"],
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// Register an MCP server dynamically at runtime via an inline extension factory
|
|
274
|
+
const loader = new DefaultResourceLoader({
|
|
275
|
+
extensionFactories: [
|
|
276
|
+
(atomic) => {
|
|
277
|
+
atomic.registerMcpServer("local-service", {
|
|
278
|
+
url: "http://127.0.0.1:4321/mcp",
|
|
279
|
+
exposure: "direct",
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
});
|
|
284
|
+
await loader.reload();
|
|
252
285
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
|
|
286
|
+
const { session } = await createAgentSession({ resourceLoader: loader });
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
- **Tool filtering.** When `tools` is a non-empty allowlist with no `mcp__*` entry, MCP tools stay registered for `codemode` and `tool_search`. Adding any `mcp__*` entry switches MCP tools to explicit allowlisting. See [SDK tools](/sdk/reference#tools).
|
|
290
|
+
- **Dynamic registration.** Call [`atomic.registerMcpServer()`](/extensions/api-reference#atomic-registermcpserver-name-config) inside an inline extension factory when a server URL or port is computed at runtime.
|
|
291
|
+
- **Custom resource loaders.** Implement `getMcpServerContributions()` on a custom `ResourceLoader` to supply `McpServerContribution[]` directly under your own trust policy. See [ResourceLoader](/sdk/reference#resourceloader).
|
|
292
|
+
|
|
293
|
+
## Supported configuration and limits
|
|
260
294
|
|
|
261
|
-
|
|
295
|
+
- Atomic reads only `~/.atomic/agent/mcp.json`, trusted `.atomic/mcp.json`, and package or extension contributions. External MCP client config files and third-party credential stores are not imported.
|
|
296
|
+
- Supported transports are stdio and streamable HTTP. SSE endpoints and MCP Apps (`ui://`) rendering are not supported.
|
|
297
|
+
- All enabled servers connect in the background, register tools under `mcp__<server>__<tool>`, and default to `codemode` exposure.
|
|
298
|
+
|
|
299
|
+
## Troubleshooting
|
|
262
300
|
|
|
263
|
-
|
|
301
|
+
- **Inspect logs and stderr.** Check `~/.atomic/agent/mcp.log` for full connection and protocol logs, or run `/mcp` to inspect connection errors, server tools, and the tail of a failed stdio server's stderr.
|
|
302
|
+
- **Reload after config edits.** Run `/reload` or restart Atomic after editing `mcp.json`. Use `/mcp reconnect my-server` to reconnect and refresh tools.
|
|
303
|
+
- **Missing tools.** Check both server-level `exposure` and per-tool `toolExposure`. `hidden` tools cannot be called; `codemode` and `deferred` tools need codemode or `tool_search` enabled.
|
|
304
|
+
- **OAuth redirect failures.** Verify `callbackPort` and `callbackUrl` match the registered redirect URI with no query string or fragment. Over SSH, paste the complete redirected URL into the waiting sign-in prompt.
|
|
305
|
+
- **Temporary authorization server outage.** Stored tokens stay intact and Atomic retries automatically; run `/mcp reconnect my-server` once the authorization server recovers. You are asked to sign in again only when credentials are rejected or revoked.
|
|
306
|
+
- **Issuer mismatch.** Verify the authorization server's metadata and callback configuration before retrying rather than bypassing issuer validation.
|
|
307
|
+
- **Slow tool calls.** Increase `timeout` (in seconds). Server progress notifications reset this inactivity timer.
|
|
308
|
+
|
|
309
|
+
## Related docs
|
|
310
|
+
|
|
311
|
+
- [SDK tools](/sdk/reference#tools) and [ResourceLoader](/sdk/reference#resourceloader) cover `builtins.mcp`, `tools`, `excludedTools`, and `getMcpServerContributions()`.
|
|
312
|
+
- [Extensions API reference](/extensions/api-reference#atomic-registermcpserver-name-config) documents `atomic.registerMcpServer()`.
|
|
313
|
+
- [Codemode reference](/codemode) and [`tool_search`](/tools#tool_search) cover discovering and calling `codemode` and `deferred` MCP tools.
|
|
314
|
+
- [Tool and MCP allowlists](/subagents/authoring#tool-and-mcp-allowlists) explains `mcp:<server>` and `mcp:<server>/<tool>` syntax in custom subagents.
|
|
315
|
+
- [CLI reference](/reference/cli#mcp-commands) lists all `atomic mcp` subcommands and `--no-mcp`.
|