@bastani/atomic 0.10.14 → 0.10.15-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 +31 -0
- package/README.md +1 -1
- 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 +3 -3
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
- package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/runtime-O4KCSG4C.js +2 -2
- package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
- package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
- package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
- package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
- package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
- package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
- package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
- package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
- package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
- package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
- package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
- package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/auth-cli.code.js +1 -1
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- 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.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +1 -1
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/compaction/compactor.d.ts +0 -8
- 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.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- 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.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- 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 +2 -2
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.code.js +1 -1
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +3 -3
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- 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/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 +2 -2
- 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 +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/core/tasks/task-reference-archive.js +3 -3
- 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.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 +1 -1
- 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.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +1 -1
- 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.d.ts +21 -1
- package/dist/index.js +2 -2
- package/dist/main-first-time-setup.code.js +1 -1
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- 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/print-mode.js +1 -1
- package/dist/package-manager-cli.code.js +2 -2
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/6.js +1 -1
- package/dist/utils/startup-database-spare.code.js +1 -1
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks/reference.md +182 -0
- package/docs/background-tasks.md +98 -405
- package/docs/build.md +67 -27
- package/docs/changelog.mdx +11 -1
- package/docs/codemode.md +108 -39
- package/docs/compaction/branch-summaries.md +54 -0
- package/docs/compaction/custom-compactors.md +161 -0
- package/docs/compaction/memory-compaction.md +77 -0
- package/docs/compaction/reference.md +86 -38
- package/docs/compaction.md +51 -252
- package/docs/computer-use.md +169 -321
- package/docs/containerization.md +71 -57
- package/docs/custom-provider/api-reference.md +119 -25
- package/docs/custom-provider/oauth.md +114 -132
- package/docs/custom-provider/override.md +37 -27
- package/docs/custom-provider/registration.md +107 -83
- package/docs/custom-provider/streaming.md +85 -71
- package/docs/custom-provider.md +85 -52
- package/docs/development.md +39 -29
- package/docs/docs.json +80 -67
- package/docs/environment-variables.md +94 -44
- package/docs/extensions/api-reference.md +86 -43
- package/docs/extensions/authoring.md +162 -154
- package/docs/extensions/events.md +80 -25
- package/docs/extensions/examples.md +90 -85
- package/docs/extensions/ui.md +206 -82
- package/docs/extensions.md +79 -108
- package/docs/getting-started/authentication.md +67 -36
- package/docs/getting-started/first-session.md +53 -43
- package/docs/getting-started/installation.md +117 -90
- package/docs/getting-started/project-instructions.md +48 -34
- package/docs/guides/configuration.md +82 -20
- package/docs/guides/non-interactive.md +66 -24
- package/docs/guides/resume-on-any-machine.md +135 -82
- package/docs/guides/team-setup.md +114 -105
- package/docs/guides.md +76 -32
- package/docs/herdr.md +16 -17
- package/docs/how-atomic-works.md +140 -0
- package/docs/index.md +58 -44
- package/docs/intercom/operations.md +141 -151
- package/docs/intercom/reference.md +85 -108
- package/docs/intercom.md +84 -145
- package/docs/json.md +120 -67
- package/docs/keybindings.md +85 -49
- package/docs/libraries/agent-core.md +137 -275
- package/docs/libraries/ai.md +100 -84
- package/docs/libraries/codemode.md +210 -300
- package/docs/libraries/schema.md +59 -53
- package/docs/libraries/storage-postgres.md +49 -35
- package/docs/libraries/telemetry.md +153 -354
- package/docs/libraries/tui.md +265 -393
- package/docs/libraries.md +42 -26
- package/docs/llama-cpp.md +171 -161
- package/docs/mcp-servers.md +90 -51
- package/docs/models/choose-a-model.md +188 -0
- package/docs/models/reference.md +74 -30
- package/docs/models.md +153 -88
- package/docs/orchestration/migrating-workflows.md +23 -16
- package/docs/orchestration/patterns.md +39 -44
- package/docs/orchestration.md +65 -26
- package/docs/packages/authoring.md +51 -29
- package/docs/packages/reference.md +42 -21
- package/docs/packages.md +69 -58
- package/docs/programmatic.md +118 -24
- package/docs/prompt-templates.md +84 -83
- package/docs/providers/reference.md +43 -48
- package/docs/providers.md +219 -451
- package/docs/quickstart.md +140 -120
- package/docs/reference/cli.md +135 -97
- package/docs/reference.md +20 -19
- package/docs/rpc/examples.md +76 -20
- package/docs/rpc/extension-ui.md +64 -38
- package/docs/rpc/protocol.md +361 -110
- package/docs/rpc.md +57 -17
- package/docs/sdk/reference.md +409 -534
- package/docs/sdk/storage.md +53 -13
- package/docs/sdk/structured-decisions.md +82 -56
- package/docs/sdk/web-server.md +57 -43
- package/docs/sdk.md +106 -84
- package/docs/security.md +42 -64
- package/docs/session-format.md +62 -38
- package/docs/sessions.md +99 -214
- package/docs/settings.md +165 -195
- package/docs/shell-aliases.md +9 -6
- package/docs/skills/authoring.md +69 -48
- package/docs/skills/reference.md +51 -20
- package/docs/skills.md +99 -148
- package/docs/slash-commands.md +129 -0
- package/docs/storage/custom-adapters.md +160 -85
- package/docs/storage/jsonl.md +81 -66
- package/docs/storage/postgres/pgbouncer.md +120 -126
- package/docs/storage/postgres/tuning.md +120 -143
- package/docs/storage/postgres.md +314 -330
- package/docs/storage/sqlite.md +71 -42
- package/docs/storage.md +298 -302
- package/docs/subagents/authoring.md +55 -38
- package/docs/subagents/reference.md +73 -33
- package/docs/subagents.md +119 -187
- package/docs/terminal-setup.md +51 -39
- package/docs/themes/reference.md +23 -19
- package/docs/themes.md +142 -127
- package/docs/tmux.md +47 -55
- package/docs/tools.md +147 -109
- package/docs/tui/reference.md +166 -214
- package/docs/tui.md +196 -341
- package/docs/usage.md +118 -138
- package/docs/verification.md +79 -51
- package/docs/web-access.md +121 -101
- package/docs/windows.md +26 -27
- package/docs/worktree-snapshots/reference.md +245 -0
- package/docs/worktree-snapshots.md +71 -259
- package/package.json +8 -8
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
- package/docs/guides/intercom.md +0 -32
- package/docs/guides/orchestration.md +0 -28
- package/docs/guides/subagents.md +0 -37
- package/docs/termux.md +0 -118
package/docs/containerization.md
CHANGED
|
@@ -1,64 +1,71 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Run Atomic in containers"
|
|
3
|
-
sidebarTitle: "Containers"
|
|
3
|
+
sidebarTitle: "Run in Containers"
|
|
4
4
|
description: "Isolate Atomic or its built-in tools using Gondolin micro-VMs, Docker containers, or NVIDIA OpenShell sandboxes."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Atomic runs with all of your local user permissions by default. To restrict which directories it can
|
|
7
|
+
Atomic runs with all of your local user permissions by default. To restrict which directories and processes it can reach, choose one of two isolation models:
|
|
8
8
|
|
|
9
9
|
1. Run the whole `atomic` process inside a container or managed sandbox.
|
|
10
10
|
2. Run `atomic` on your host and route built-in file and shell tools into a micro-VM.
|
|
11
11
|
|
|
12
|
-
Containerization is the outer boundary, not the only one. Read [
|
|
12
|
+
Containerization is the outer boundary, not the only one. Read [Manage security and project trust](/security) alongside this page to see how project trust gates project extensions, skills, and settings before work starts.
|
|
13
13
|
|
|
14
14
|
## Choose an isolation pattern
|
|
15
15
|
|
|
16
16
|
| Pattern | What is isolated | Best for | Notes |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
-
| Gondolin micro-VM | Selected file tools, `bash`, and `!` commands | Local VM tool routing while keeping credentials on the host | `search` and custom host extensions
|
|
19
|
-
| Docker | Whole `atomic` process in a local container |
|
|
18
|
+
| Gondolin micro-VM | Selected file tools, `bash`, and `!` commands | Local VM tool routing while keeping credentials on the host | `search` and custom host extensions stay on the host. See [`examples/extensions/gondolin/`](https://github.com/bastani-inc/atomic/tree/main/packages/coding-agent/examples/extensions/gondolin). |
|
|
19
|
+
| Docker | Whole `atomic` process in a local container | Straightforward local process and filesystem isolation | Provider API keys enter the container. |
|
|
20
20
|
| NVIDIA OpenShell | Whole `atomic` process in a policy-controlled sandbox | Local or remote managed sandboxes with upstream credential injection | Requires an OpenShell gateway. |
|
|
21
21
|
|
|
22
|
-
Extensions run wherever the `atomic` process runs.
|
|
22
|
+
Extensions run wherever the `atomic` process runs. When you run host `atomic` with a tool-routing extension, other loaded extensions still run on your host unless they also route their work into the VM. To route built-in file tools and `!` commands to a remote machine over SSH instead of a local micro-VM, see `examples/extensions/ssh.ts` in [Extension examples](/extensions/examples#remote-execution-and-sandboxes).
|
|
23
23
|
|
|
24
24
|
## Gondolin micro-VM
|
|
25
25
|
|
|
26
|
-
[Gondolin](https://github.com/earendil-works/gondolin) runs a local Linux micro-VM. Use the [Gondolin example extension](https://github.com/bastani-inc/atomic/tree/main/packages/coding-agent/examples/extensions/gondolin) when you want `atomic` on your host with selected file tools and shell
|
|
26
|
+
[Gondolin](https://github.com/earendil-works/gondolin) runs a local Linux micro-VM. Use the [Gondolin example extension](https://github.com/bastani-inc/atomic/tree/main/packages/coding-agent/examples/extensions/gondolin) when you want `atomic` on your host with selected file tools and shell commands routed into the VM. This does not isolate the entire session.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**Requirements:** npm, Node.js 23.6.0 or newer (required by `@earendil-works/gondolin`), and QEMU installed through your system package manager.
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
npm ci --ignore-scripts
|
|
34
|
-
```
|
|
30
|
+
<Steps>
|
|
31
|
+
<Step title="Copy the extension outside your global extensions directory">
|
|
32
|
+
Copy `examples/extensions/gondolin` to a standalone path such as `~/.local/share/atomic-gondolin` for opt-in use with `-e`, then install its dependencies:
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
```bash
|
|
35
|
+
cp -R "$(npm root -g)/@bastani/atomic/examples/extensions/gondolin" ~/.local/share/atomic-gondolin
|
|
36
|
+
cd ~/.local/share/atomic-gondolin
|
|
37
|
+
npm ci --ignore-scripts
|
|
38
|
+
```
|
|
39
|
+
</Step>
|
|
40
|
+
<Step title="Launch Atomic from your project directory">
|
|
41
|
+
Start Atomic with `-e` from the project directory you want mounted at `/workspace` inside the VM:
|
|
37
42
|
|
|
38
|
-
```bash
|
|
39
|
-
cd /path/to/project
|
|
40
|
-
atomic -e ~/.local/share/atomic-gondolin
|
|
41
|
-
```
|
|
43
|
+
```bash
|
|
44
|
+
cd /path/to/project
|
|
45
|
+
atomic -e ~/.local/share/atomic-gondolin
|
|
46
|
+
```
|
|
47
|
+
</Step>
|
|
48
|
+
</Steps>
|
|
42
49
|
|
|
43
|
-
|
|
50
|
+
<Warning>
|
|
51
|
+
Do **not** copy the extension into `~/.atomic/agent/extensions/gondolin` unless you want **every** `atomic` session on your machine to boot a Gondolin VM automatically. Because that directory contains both `index.ts` and `package.json`, Atomic auto-loads it globally even without `-e`.
|
|
52
|
+
</Warning>
|
|
44
53
|
|
|
45
54
|
### What the Gondolin extension routes and omits
|
|
46
55
|
|
|
47
56
|
- **Workspace mount:** Mounts your current host working directory at `/workspace` inside the VM. Edits under `/workspace` write through to your host files.
|
|
48
|
-
- **Routed tools and status:** Overrides `read`, `write`, `edit`, `bash`, `find`, and `ls`, plus interactive `!` commands. Registers the `/gondolin` command (
|
|
57
|
+
- **Routed tools and status:** Overrides `read`, `write`, `edit`, `bash`, `find`, and `ls`, plus interactive `!` commands. Registers the `/gondolin` command (shows VM ID, host workspace, guest workspace, and guest shell) and a footer status item (`Gondolin: <id> (/workspace)`).
|
|
49
58
|
- **Environment isolation:** Does not forward host shell environment variables into VM commands, keeping host API keys out of the VM.
|
|
50
59
|
- **Guest shell and tool caveats:** Probes `bash` first inside the guest and falls back to `/bin/sh`. Routed `find` skips `.git` and `node_modules` only and does not apply `.gitignore`. Routed `read` detects images by filename extension (`.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`), and routed `write` writes UTF-8 text.
|
|
51
60
|
- **Unrouted tools:** `search` stays on the host and is not routed into the VM. Run searches inside the guest through `bash` or `!`.
|
|
52
61
|
|
|
53
|
-
To expose only the routed built-in tools in a session:
|
|
62
|
+
To expose only the routed built-in tools and prevent host MCP connections in a session:
|
|
54
63
|
|
|
55
64
|
```bash
|
|
56
|
-
atomic --tools read,write,edit,bash,find,ls -e ~/.local/share/atomic-gondolin
|
|
65
|
+
atomic --no-mcp --tools read,write,edit,bash,find,ls -e ~/.local/share/atomic-gondolin
|
|
57
66
|
```
|
|
58
67
|
|
|
59
|
-
`ls` is a built-in tool that is off by default unless listed. Restricting [`--tools`](/reference/cli#tool-options)
|
|
60
|
-
|
|
61
|
-
**Requirements:** npm to install dependencies, Node.js 23.6.0 or newer for `@earendil-works/gondolin`, and QEMU installed through your system package manager.
|
|
68
|
+
`ls` is a built-in tool that is off by default unless listed. Adding `--no-mcp` disables host MCP server connections; without `--no-mcp`, a `--tools` allowlist that omits `mcp__*` still connects host MCP servers and keeps their tools registered (and callable if you also enable `codemode` or `tool_search`). Restricting [`--tools`](/reference/cli#tool-options) disables `intercom`, `subagent`, and other extension tools, though other loaded host extensions can still run code on the host — use whole-process isolation when host filesystem access must be prevented completely.
|
|
62
69
|
|
|
63
70
|
## Docker
|
|
64
71
|
|
|
@@ -93,9 +100,9 @@ WORKDIR /workspace
|
|
|
93
100
|
ENTRYPOINT ["atomic"]
|
|
94
101
|
```
|
|
95
102
|
|
|
96
|
-
The archive installer unpacks a self-contained bundle with no JavaScript runtime required. If you adapt this Dockerfile to a
|
|
103
|
+
The archive installer unpacks a self-contained bundle with no JavaScript runtime required. If you adapt this Dockerfile to a minimal base image, keep standard POSIX core utilities plus `curl` (or `wget`), `tar`/`gzip`, `sha256sum` (or `shasum`/`openssl`), and `ldd` on non-Alpine Linux; `debian:bookworm-slim` already includes them.
|
|
97
104
|
|
|
98
|
-
For Alpine Linux (`musl`), `install.sh` detects `/etc/alpine-release` and downloads the musl release archive (`atomic-linux-x64-musl.tar.gz` or `atomic-linux-arm64-musl.tar.gz`). Those archives bundle `libgcc` and `libstdc++`, so stock Alpine needs no extra C++ runtime libraries; install `bash`, `ca-certificates`, `curl`, `git`, and `ripgrep` for the installer and built-in tools
|
|
105
|
+
For Alpine Linux (`musl`), `install.sh` detects `/etc/alpine-release` and downloads the musl release archive (`atomic-linux-x64-musl.tar.gz` or `atomic-linux-arm64-musl.tar.gz`). Those archives bundle `libgcc` and `libstdc++`, so stock Alpine needs no extra C++ runtime libraries; install `bash`, `ca-certificates`, `curl`, `git`, and `ripgrep` for the installer and built-in tools ([Alpine and musl Linux archives](/getting-started/installation#alpine-and-musl-linux-archives)).
|
|
99
106
|
|
|
100
107
|
Build and run the container:
|
|
101
108
|
|
|
@@ -115,48 +122,55 @@ docker run --rm -it \
|
|
|
115
122
|
|
|
116
123
|
Mount a named volume on `/root/.atomic` (`-v atomic-home:/root/.atomic`) to persist both container-local settings (`/root/.atomic/agent`) and the default SQLite session database (`/root/.atomic/workflows/journal.sqlite`).
|
|
117
124
|
|
|
118
|
-
|
|
125
|
+
<Warning>
|
|
126
|
+
Mounting only `/root/.atomic/agent` loses session history when the container exits — even if you set `ATOMIC_CODING_AGENT_DIR=/root/.atomic/agent`. Because that path matches the default agent directory, Atomic still writes `journal.sqlite` outside the volume at `/root/.atomic/workflows/journal.sqlite`.
|
|
119
127
|
|
|
120
|
-
|
|
128
|
+
To persist sessions when mounting only `/root/.atomic/agent`, either mount `/root/.atomic` instead, pass `--session-store /root/.atomic/agent/journal.sqlite` (or set `ATOMIC_STORAGE` / `ATOMIC_SESSIONS_STORAGE`; see [Selecting storage per process](/storage#selecting-storage-per-process)), or set [`ATOMIC_CODING_AGENT_DIR`](/environment-variables) to a non-default subdirectory such as `/root/.atomic/agent/state`.
|
|
129
|
+
</Warning>
|
|
121
130
|
|
|
122
|
-
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Do not bind-mount your host `~/.atomic` or `~/.atomic/agent` into a running container. Beyond exposing host credentials, settings, and sessions, OS file locks on `settings.json`, `auth.json`, `trust.json`, and session claims do not coordinate safely across a host path and a container mount of the same directory ([Locks in the agent directory](/storage#locks-in-the-agent-directory)). Give each container its own agent directory and share sessions through a remote database instead ([Sharing storage across hosts](/storage#sharing-storage-across-hosts), [SDK storage](/sdk/storage)).
|
|
131
|
+
<Warning>
|
|
132
|
+
Do **not** bind-mount your host `~/.atomic` or `~/.atomic/agent` into a running container. Beyond exposing host credentials, settings, and sessions, OS file locks on `settings.json`, `auth.json`, `trust.json`, and session claims do not coordinate safely across a host path and a container mount of the same directory ([Locks in the agent directory](/storage#locks-in-the-agent-directory)). Give each container its own agent directory and share sessions through a remote database instead ([Sharing storage across hosts](/storage#sharing-storage-across-hosts), [SDK storage](/sdk/storage)).
|
|
133
|
+
</Warning>
|
|
127
134
|
|
|
128
135
|
### Container runtime, network, and CI options
|
|
129
136
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
| Need | Flag or env var | Notes |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| Node.js heap sizing | `ATOMIC_HEAP_MB` | On npm/Node.js installs, Atomic sizes the heap to half the cgroup memory limit when larger than Node's default; set `0` to keep Node's default ([Diagnostics and performance](/environment-variables#diagnostics-and-performance)). |
|
|
140
|
+
| Background shell cgroups | `ATOMIC_TASK_CGROUP=0` | On Linux with user-owned cgroup v2, Atomic contains background shell trees in cgroups; set `0` if container cgroup policies block it ([Background tasks reference](/background-tasks/reference#lifetime-retention-and-cleanup)). |
|
|
141
|
+
| Restricted egress / offline | `--offline` or `ATOMIC_OFFLINE=1` | Disables automatic update checks, telemetry, and binary downloads. |
|
|
142
|
+
| Proxies and private CAs | `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`, `NODE_EXTRA_CA_CERTS` | Or set `httpProxy` in [Network proxy settings](/settings#network-proxy). See [TLS certificates](/environment-variables#tls-certificates) and [PostgreSQL through an HTTP proxy](/storage/postgres#through-an-http-proxy). |
|
|
143
|
+
| Reading container-local URLs | `ATOMIC_ALLOW_PRIVATE_URL_READS=1` | Set only if `read` must reach localhost or private-network services inside the container. |
|
|
144
|
+
| Headless and CI runs | `-p` / `--mode json` / `--mode rpc`, `--no-session`, `--approve` / `--no-approve` | Run without `-it` ([Non-interactive usage](/guides/non-interactive)). For shared CI fleets, set `ATOMIC_STORAGE` ([Team and CI setup](/guides/team-setup#ci-and-swarms)) and pre-warm environments with `.atomic/blueprint.yaml` and `atomic blueprint prebuild` ([Resume on any machine](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint)). |
|
|
133
145
|
|
|
134
146
|
## NVIDIA OpenShell
|
|
135
147
|
|
|
136
148
|
Use [NVIDIA OpenShell](https://docs.nvidia.com/openshell/about/overview) for a policy-controlled sandbox with filesystem, process, network, credential, and inference controls. OpenShell runs sandboxes through a local gateway backed by Docker, Podman, or a VM runtime, or through a remote Kubernetes gateway.
|
|
137
149
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
openshell gateway add <gateway-url> --name <name>
|
|
142
|
-
openshell gateway select <name>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Launch
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
<Steps>
|
|
151
|
+
<Step title="Register and select an OpenShell gateway">
|
|
152
|
+
```bash
|
|
153
|
+
openshell gateway add <gateway-url> --name <name>
|
|
154
|
+
openshell gateway select <name>
|
|
155
|
+
```
|
|
156
|
+
</Step>
|
|
157
|
+
<Step title="Launch Atomic inside a sandbox">
|
|
158
|
+
```bash
|
|
159
|
+
openshell sandbox create --name atomic-sandbox --from atomic -- atomic
|
|
160
|
+
```
|
|
161
|
+
</Step>
|
|
162
|
+
<Step title="Transfer files for remote gateways (optional)">
|
|
163
|
+
With a remote gateway, host files are not bind-mounted, so sandbox edits do not touch your local checkout. Clone inside the sandbox or copy files explicitly:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
openshell sandbox upload atomic-sandbox ./repo /workspace
|
|
167
|
+
openshell sandbox download atomic-sandbox /workspace/repo ./repo-out
|
|
168
|
+
```
|
|
169
|
+
</Step>
|
|
170
|
+
</Steps>
|
|
150
171
|
|
|
151
172
|
The whole `atomic` process runs inside the sandbox, so built-in tools, `!` commands, and extension tools execute inside the OpenShell boundary.
|
|
152
173
|
|
|
153
|
-
With a remote gateway, project files are not bind-mounted from the host, so writes in the sandbox do not modify your local checkout. Clone the repository inside the sandbox or transfer files with OpenShell:
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
openshell sandbox upload atomic-sandbox ./repo /workspace
|
|
157
|
-
openshell sandbox download atomic-sandbox /workspace/repo ./repo-out
|
|
158
|
-
```
|
|
159
|
-
|
|
160
174
|
### Routing inference through OpenShell
|
|
161
175
|
|
|
162
176
|
OpenShell providers can keep raw model API keys outside the sandbox. When inference routing is enabled, tools inside the sandbox call `https://inference.local` and the OpenShell gateway injects provider credentials upstream.
|
|
@@ -178,4 +192,4 @@ Point Atomic at `https://inference.local` by adding a provider entry to `~/.atom
|
|
|
178
192
|
}
|
|
179
193
|
```
|
|
180
194
|
|
|
181
|
-
Use `"api": "anthropic-messages"` when your OpenShell gateway exposes an Anthropic-compatible endpoint, or override `baseUrl` on a built-in provider entry. See [
|
|
195
|
+
Use `"api": "anthropic-messages"` when your OpenShell gateway exposes an Anthropic-compatible endpoint, or override `baseUrl` on a built-in provider entry. See [Configure custom models](/models) and [Build custom providers](/custom-provider) for full `models.json` and extension options.
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Custom provider API reference"
|
|
3
|
-
sidebarTitle: "Custom
|
|
4
|
-
description: "TypeScript interfaces and
|
|
3
|
+
sidebarTitle: "Custom Provider API"
|
|
4
|
+
description: "Package imports, TypeScript interfaces, and method signatures for registerProvider(), registerProviderAlias(), unregisterProvider(), OAuth callbacks, and native Provider registrations."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## Package imports
|
|
8
|
+
|
|
9
|
+
Extension registration interfaces live in `@bastani/atomic`, while core provider, streaming, and OAuth credential types live in `@bastani/atomic-ai`:
|
|
10
|
+
|
|
11
|
+
| Package | Exports |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `@bastani/atomic` | `ExtensionAPI`, `ProviderConfig`, `ProviderModelConfig`, `ProviderChatModelConfig`, `ProviderImageModelConfig`, `ProviderClassifierModelConfig`, `ProviderCompactorModelConfig`, `ProviderAliasConfig`, `AtomicProviderCompat`, `OAuthRefreshRejectedError`, `isOAuthRefreshRejectedError` |
|
|
14
|
+
| `@bastani/atomic-ai` | `Provider`, `ProviderAuth`, `ApiKeyAuth`, `OAuthAuth`, `ProviderImages`, `ProviderClassifier`, `RefreshModelsContext`, `ModelsStoreEntry`, `ModelsPublication`, `Credential`, `OAuthCredentials`, `OAuthLoginCallbacks`, `OAuthRefreshRejectedError`, `Api`, `ImageApi`, `ClassifierApi`, `CompactorApi`, `Model`, `Context`, `TranscriptContext`, `SimpleStreamOptions`, `AssistantMessageEventStream`, `createAssistantMessageEventStream`, `calculateCost`, `getCurrentSystemPrompt`, `getCurrentTools`, `ToolCallArgumentsStream`, `SystemOneCompat`, `ImageModelCapabilities`, `ModelInputLimits` |
|
|
15
|
+
|
|
7
16
|
## Extension methods
|
|
8
17
|
|
|
9
18
|
Extensions register, alias, and unregister providers through `ExtensionAPI` (including inline `extensionFactories` in SDK hosts; see [SDK extensions](/sdk/reference#extensions)):
|
|
@@ -17,26 +26,26 @@ interface ExtensionAPI {
|
|
|
17
26
|
}
|
|
18
27
|
```
|
|
19
28
|
|
|
20
|
-
- Calling `registerProvider(name, config)` again for the same `name` merges defined fields over the previous registration
|
|
21
|
-
-
|
|
29
|
+
- Calling `registerProvider(name, config)` again for the same `name` merges defined fields over the previous registration, except when setting or replacing `aliasOf`, which resets it.
|
|
30
|
+
- Calls made after initial extension loading take effect immediately without running `/reload`.
|
|
22
31
|
|
|
23
|
-
##
|
|
32
|
+
## ProviderConfig
|
|
24
33
|
|
|
25
34
|
```typescript
|
|
26
35
|
interface ProviderConfig {
|
|
27
36
|
/** Display name for the provider in UI such as /login. */
|
|
28
37
|
name?: string;
|
|
29
38
|
|
|
30
|
-
/** Source provider ID to alias (
|
|
39
|
+
/** Source provider ID to alias (equivalent to registerProviderAlias). Only `name` may be set alongside `aliasOf`. */
|
|
31
40
|
aliasOf?: string;
|
|
32
41
|
|
|
33
42
|
/** API endpoint URL. Required at provider or model level when defining models (unless overriding a built-in provider). */
|
|
34
43
|
baseUrl?: string;
|
|
35
44
|
|
|
36
|
-
/** Optional API key literal or config value ("$ENV_VAR", "${ENV_VAR}", or "!command"). Omitting it lets users authenticate via /login <provider
|
|
45
|
+
/** Optional API key literal or config value ("$ENV_VAR", "${ENV_VAR}", or "!command"). Omitting it lets users authenticate via /login <provider>. */
|
|
37
46
|
apiKey?: string;
|
|
38
47
|
|
|
39
|
-
/** Default API for chat and compactor models. Required at provider level when supplying streamSimple
|
|
48
|
+
/** Default API for chat and compactor models. Required at provider level when supplying `streamSimple`, and at provider or model level when defining chat or compactor models. */
|
|
40
49
|
api?: Api;
|
|
41
50
|
|
|
42
51
|
/** Custom streaming implementation for non-standard chat APIs. */
|
|
@@ -46,16 +55,16 @@ interface ProviderConfig {
|
|
|
46
55
|
options?: SimpleStreamOptions
|
|
47
56
|
) => AssistantMessageEventStream;
|
|
48
57
|
|
|
49
|
-
/** Image API implementations keyed by each image model's api
|
|
58
|
+
/** Image API implementations keyed by each image model's `api`. */
|
|
50
59
|
images?: Partial<Record<ImageApi, ProviderImages>>;
|
|
51
60
|
|
|
52
|
-
/** Classifier API implementations keyed by each classifier model's api
|
|
61
|
+
/** Classifier API implementations keyed by each classifier model's `api`. */
|
|
53
62
|
classifiers?: Partial<Record<ClassifierApi, ProviderClassifier>>;
|
|
54
63
|
|
|
55
|
-
/** Custom headers sent with every request. Values use the same config-value syntax as apiKey
|
|
64
|
+
/** Custom headers sent with every request. Values use the same config-value syntax as `apiKey`. */
|
|
56
65
|
headers?: Record<string, string>;
|
|
57
66
|
|
|
58
|
-
/** When true, sends Authorization: Bearer <apiKey
|
|
67
|
+
/** When true, sends `Authorization: Bearer <apiKey>`. Fails if no API key resolves. */
|
|
59
68
|
authHeader?: boolean;
|
|
60
69
|
|
|
61
70
|
/** Models to register. Replaces all existing chat, image, classifier, and compactor models for this provider. */
|
|
@@ -64,7 +73,7 @@ interface ProviderConfig {
|
|
|
64
73
|
/** Refresh this provider's catalog. Returned definitions replace extension-provided models. */
|
|
65
74
|
refreshModels?(context: RefreshModelsContext): Promise<ProviderModelConfig[]>;
|
|
66
75
|
|
|
67
|
-
/** OAuth provider for /login support. */
|
|
76
|
+
/** OAuth provider configuration for /login support. See OAuthLoginCallbacks and OAuthCredentials below. */
|
|
68
77
|
oauth?: {
|
|
69
78
|
name: string;
|
|
70
79
|
loginLabel?: string;
|
|
@@ -78,9 +87,9 @@ interface ProviderConfig {
|
|
|
78
87
|
}
|
|
79
88
|
```
|
|
80
89
|
|
|
81
|
-
##
|
|
90
|
+
## ProviderModelConfig
|
|
82
91
|
|
|
83
|
-
`ProviderModelConfig` is a discriminated union of chat (`type?: "chat"`), image (`type: "image"`), classifier (`type: "classifier"`), and compactor (`type: "compactor"`)
|
|
92
|
+
`ProviderModelConfig` is a discriminated union of chat (`type?: "chat"`), image (`type: "image"`), classifier (`type: "classifier"`), and compactor (`type: "compactor"`) definitions:
|
|
84
93
|
|
|
85
94
|
```typescript
|
|
86
95
|
interface ProviderModelConfigBase {
|
|
@@ -109,7 +118,7 @@ interface ProviderModelConfigBase {
|
|
|
109
118
|
cacheRead: number;
|
|
110
119
|
cacheWrite: number;
|
|
111
120
|
tiers?: Array<{
|
|
112
|
-
/** Tier applies only when input + cacheRead + cacheWrite strictly exceeds this value. */
|
|
121
|
+
/** Tier applies only when `input + cacheRead + cacheWrite` strictly exceeds this value. */
|
|
113
122
|
inputTokensAbove: number;
|
|
114
123
|
input: number;
|
|
115
124
|
output: number;
|
|
@@ -135,7 +144,7 @@ interface ProviderChatModelConfig extends ProviderModelConfigBase {
|
|
|
135
144
|
/** Best-effort prompt cache lifetimes in seconds for short and long retention tiers. */
|
|
136
145
|
promptCache?: { short?: number; long?: number };
|
|
137
146
|
samplingParams?: Record<string, unknown>;
|
|
138
|
-
/** Sampling parameter overrides applied per Atomic thinking level on top of samplingParams
|
|
147
|
+
/** Sampling parameter overrides applied per Atomic thinking level on top of `samplingParams`. */
|
|
139
148
|
samplingParamsByThinkingLevel?: Partial<
|
|
140
149
|
Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max", Record<string, unknown>>
|
|
141
150
|
>;
|
|
@@ -154,8 +163,8 @@ interface ProviderClassifierModelConfig extends ProviderModelConfigBase {
|
|
|
154
163
|
type: "classifier";
|
|
155
164
|
api?: ClassifierApi;
|
|
156
165
|
contextWindow: number;
|
|
157
|
-
/**
|
|
158
|
-
compat?:
|
|
166
|
+
/** Compatibility overrides for System One classifier APIs (`typesafe-system-one`, `cloudflare-workers-ai-system-one`). */
|
|
167
|
+
compat?: SystemOneCompat;
|
|
159
168
|
}
|
|
160
169
|
|
|
161
170
|
interface ProviderCompactorModelConfig extends ProviderModelConfigBase {
|
|
@@ -168,7 +177,7 @@ interface ProviderCompactorModelConfig extends ProviderModelConfigBase {
|
|
|
168
177
|
compactionParams?: Record<string, unknown>;
|
|
169
178
|
/** Wall-clock request timeout in milliseconds (default `120000`). */
|
|
170
179
|
timeoutMs?: number;
|
|
171
|
-
/** Optional upper bound on compacted output in estimated tokens; longer output clears the context instead.
|
|
180
|
+
/** Optional upper bound on compacted output in estimated tokens; longer output clears the context instead. Omitted means no limit. */
|
|
172
181
|
maxTokens?: number;
|
|
173
182
|
}
|
|
174
183
|
|
|
@@ -187,14 +196,77 @@ For how Atomic sends requests to `ProviderCompactorModelConfig` endpoints, see [
|
|
|
187
196
|
|
|
188
197
|
### Compatibility and capability flags
|
|
189
198
|
|
|
190
|
-
For the complete list of per-API `compat` fields
|
|
191
|
-
|
|
192
|
-
Keep these rules in mind when declaring capabilities on custom providers:
|
|
199
|
+
For the complete list of per-API `compat` fields, see [`models.json` compatibility fields](/models-configuration#compatibility). Keep these rules in mind when declaring capabilities on custom providers:
|
|
193
200
|
|
|
194
|
-
- **Capability flags are enforcement claims, not preferences.** `supportsStrictMode`
|
|
201
|
+
- **Capability flags are enforcement claims, not preferences.** `supportsStrictMode` enables strict JSON-schema tools for OpenAI-compatible APIs and Amazon Bedrock Converse (`bedrock-converse-stream`); `supportsStrictTools` applies to Anthropic Messages (`anthropic-messages`) only; `supportsOpenAIGrammarTools` (or Atomic's alias `supportsGrammarTools`, where the canonical field wins on conflict) enables OpenAI Lark/regex custom tools. Leave these unset or `false` unless the endpoint actually enforces them ([Constrained sampling](/extensions/authoring#constrained-sampling)).
|
|
195
202
|
- **Session affinity headers differ by OpenAI API.** For `openai-responses`, `compat.sessionAffinityFormat: "openai"` sends `session-id` (with `-`) and `x-client-request-id`, `"openai-nosession"` sends only `x-client-request-id`, and `"openrouter"` sends `x-session-id`. For `openai-completions`, `"openai"` sends `session_id` (with `_`), `x-client-request-id`, and `x-session-affinity`.
|
|
196
203
|
- **Responses gateway options.** Set `supportsToolSearch: true` only on `openai-responses` providers that support deferred tool loading. `supportsMaxOutputTokens` defaults to `true`; set it to `false` for Responses-compatible gateways that reject `max_output_tokens` with HTTP 400.
|
|
197
204
|
|
|
205
|
+
## OAuthLoginCallbacks
|
|
206
|
+
|
|
207
|
+
`callbacks` exposes the user-interaction surface passed to `ProviderConfig.oauth.login()` (see [Add OAuth login to a provider](/custom-provider/oauth)):
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
interface OAuthLoginCallbacks {
|
|
211
|
+
/** Open a URL in the browser (for OAuth redirects). */
|
|
212
|
+
onAuth(info: { url: string; instructions?: string }): void;
|
|
213
|
+
|
|
214
|
+
/** Show a device code (for device authorization flows). */
|
|
215
|
+
onDeviceCode(info: {
|
|
216
|
+
userCode: string;
|
|
217
|
+
verificationUri: string;
|
|
218
|
+
openBrowserOnConfirm?: boolean; // default true
|
|
219
|
+
copyCodeOnConfirm?: boolean; // default true
|
|
220
|
+
intervalSeconds?: number;
|
|
221
|
+
expiresInSeconds?: number;
|
|
222
|
+
}): void;
|
|
223
|
+
|
|
224
|
+
/** Prompt the user for input (for manual code or token entry). */
|
|
225
|
+
onPrompt(prompt: {
|
|
226
|
+
message: string;
|
|
227
|
+
placeholder?: string;
|
|
228
|
+
allowEmpty?: boolean;
|
|
229
|
+
}): Promise<string>;
|
|
230
|
+
|
|
231
|
+
/** Report non-blocking status updates during login. */
|
|
232
|
+
onProgress?(message: string): void;
|
|
233
|
+
|
|
234
|
+
/** Read a manually pasted redirect URL or authorization code. */
|
|
235
|
+
onManualCodeInput?(): Promise<string>;
|
|
236
|
+
|
|
237
|
+
/** Let the user pick from a list of options (for example tenant or workspace). */
|
|
238
|
+
onSelect(prompt: {
|
|
239
|
+
message: string;
|
|
240
|
+
options: Array<{ id: string; label: string }>;
|
|
241
|
+
}): Promise<string | undefined>;
|
|
242
|
+
|
|
243
|
+
/** Cancellation signal for the active login attempt. */
|
|
244
|
+
signal?: AbortSignal;
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
In `/login`, pressing **Enter** on a device-code prompt opens the verification URL and copies `userCode` by default. Set `openBrowserOnConfirm: false` or `copyCodeOnConfirm: false` to disable either action.
|
|
249
|
+
|
|
250
|
+
## OAuthCredentials
|
|
251
|
+
|
|
252
|
+
OAuth credentials persist to `~/.atomic/agent/auth.json` (Atomic may also read legacy `~/.pi/agent/auth.json`):
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
interface OAuthCredentials {
|
|
256
|
+
/** Refresh token passed to refreshToken(). */
|
|
257
|
+
refresh: string;
|
|
258
|
+
|
|
259
|
+
/** Access token returned by getApiKey(). */
|
|
260
|
+
access: string;
|
|
261
|
+
|
|
262
|
+
/** Expiration timestamp in Unix milliseconds. */
|
|
263
|
+
expires: number;
|
|
264
|
+
|
|
265
|
+
/** Optional provider-specific metadata persisted alongside the tokens. */
|
|
266
|
+
[key: string]: unknown;
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
198
270
|
## ProviderAliasConfig
|
|
199
271
|
|
|
200
272
|
Passed to `atomic.registerProviderAlias(config)` to create an account alias for an existing provider:
|
|
@@ -217,8 +289,22 @@ interface ProviderAliasConfig {
|
|
|
217
289
|
Passed to `refreshModels(context)` on both `ProviderConfig` and native `Provider` registrations:
|
|
218
290
|
|
|
219
291
|
```typescript
|
|
292
|
+
interface ModelsStoreEntry {
|
|
293
|
+
/** Persisted models of every type (chat, image, classifier, compactor). */
|
|
294
|
+
models: readonly AnyModel[];
|
|
295
|
+
/** Optional Last-Modified Unix timestamp from the remote catalog. */
|
|
296
|
+
lastModified?: number;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
interface ModelsPublication {
|
|
300
|
+
/** Persisted catalog entry for models-store.json. Omit to leave storage unchanged; null deletes it. */
|
|
301
|
+
persist?: ModelsStoreEntry | null;
|
|
302
|
+
/** Optional synchronous callback to update provider-private in-memory catalog state. */
|
|
303
|
+
update?: () => void;
|
|
304
|
+
}
|
|
305
|
+
|
|
220
306
|
interface RefreshModelsContext {
|
|
221
|
-
/** Effective configured credential (OAuth tokens are refreshed before network access
|
|
307
|
+
/** Effective configured credential (`ApiKeyCredential | OAuthCredential`). OAuth tokens are refreshed before network access. */
|
|
222
308
|
credential?: Credential;
|
|
223
309
|
|
|
224
310
|
/** Immutable provider-scoped catalog snapshot read from models-store.json before this refresh. */
|
|
@@ -271,6 +357,12 @@ interface ProviderClassifier {
|
|
|
271
357
|
For full control over authentication flows, credential-scoped model filtering, and persisted catalog state, pass a native `Provider<TApi>` object from `@bastani/atomic-ai` directly to `atomic.registerProvider(provider)`:
|
|
272
358
|
|
|
273
359
|
```typescript
|
|
360
|
+
/** At least one of `apiKey` or `oauth` is required. */
|
|
361
|
+
interface ProviderAuth {
|
|
362
|
+
apiKey?: ApiKeyAuth;
|
|
363
|
+
oauth?: OAuthAuth;
|
|
364
|
+
}
|
|
365
|
+
|
|
274
366
|
interface Provider<TApi extends Api = Api> {
|
|
275
367
|
readonly id: string;
|
|
276
368
|
readonly name: string;
|
|
@@ -289,3 +381,5 @@ interface Provider<TApi extends Api = Api> {
|
|
|
289
381
|
classify?(model: ClassifierModel<ClassifierApi>, context: ClassifierContext, options?: ClassifierOptions): Promise<ClassifierResult>;
|
|
290
382
|
}
|
|
291
383
|
```
|
|
384
|
+
|
|
385
|
+
`Credential` is the union of stored API-key credentials (`{ type: "api_key"; key?: string; env?: Record<string, string> }`) and stored OAuth credentials (`{ type: "oauth"; refresh: string; access: string; expires: number; [key: string]: unknown }`).
|