@bastani/atomic 0.10.14 → 0.10.15-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +3 -3
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +3 -3
  7. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -3
  8. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  9. package/dist/_shared/runtime-O4KCSG4C.js +2 -2
  10. package/dist/_shared/{sdk-B5LEWGGI.js → sdk-OHKMDJ74.js} +27 -5
  11. package/dist/_shared/{sdk-B5LEWGGI.js.map → sdk-OHKMDJ74.js.map} +1 -1
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/startup-0-0-Q3MWKUK4.js +2 -2
  14. package/dist/_shared/startup-0-1-M6OWAYHH.js +2 -2
  15. package/dist/_shared/{startup-0-2-5QHPCEON.js → startup-0-2-2HUMCPKX.js} +14 -16
  16. package/dist/_shared/startup-0-2-2HUMCPKX.js.map +1 -0
  17. package/dist/_shared/startup-0-3-4ZYBYQNM.js +3 -3
  18. package/dist/_shared/startup-0-4-ZMJV547D.js +3 -3
  19. package/dist/_shared/startup-0-5-YDW47QX6.js +3 -3
  20. package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
  21. package/dist/_shared/startup-14-0-MLX36RBG.js +1 -1
  22. package/dist/_shared/startup-15-0-YUKGAC63.js +1 -1
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js +6 -30
  24. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  25. package/dist/_shared/startup-8-0-34CBHPZH.js +3 -3
  26. package/dist/_shared/startup-8-1-LZFXSD3Z.js +3 -3
  27. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  28. package/dist/_shared/storage-status-K7PX2RXA.js +3 -3
  29. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  30. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  31. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  32. package/dist/builtin/intercom/package.json +1 -1
  33. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  34. package/dist/builtin/mcp/package.json +1 -1
  35. package/dist/builtin/subagents/package.json +1 -1
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.code.js +1 -1
  40. package/dist/cli/auth-cli.impl.js +3 -3
  41. package/dist/cli/auth-cli.js +3 -3
  42. package/dist/cli/blueprint-command.impl.js +3 -3
  43. package/dist/cli/blueprint-command.js +3 -3
  44. package/dist/cli/intercom-command.code.js +3 -3
  45. package/dist/cli/intercom-command.impl.js +3 -3
  46. package/dist/cli/intercom-command.js +3 -3
  47. package/dist/cli/list-models.impl.js +3 -3
  48. package/dist/cli/list-models.js +3 -3
  49. package/dist/cli/session-picker.code.js +1 -1
  50. package/dist/cli/session-picker.impl.js +3 -3
  51. package/dist/cli/session-picker.js +3 -3
  52. package/dist/cli/startup-ui.code.js +1 -1
  53. package/dist/cli/startup-ui.impl.js +3 -3
  54. package/dist/cli/startup-ui.js +3 -3
  55. package/dist/cli/storage-command.impl.js +3 -3
  56. package/dist/cli/storage-command.js +3 -3
  57. package/dist/cli/storage-search-session.code.js +1 -1
  58. package/dist/cli/storage-search-session.impl.js +3 -3
  59. package/dist/cli/storage-search-session.js +3 -3
  60. package/dist/cli/team-command.code.js +1 -1
  61. package/dist/cli/team-command.impl.js +3 -3
  62. package/dist/cli/team-command.js +3 -3
  63. package/dist/cli.js +2 -2
  64. package/dist/core/compaction/compactor.d.ts +0 -8
  65. package/dist/core/debug.impl.js +3 -3
  66. package/dist/core/debug.js +3 -3
  67. package/dist/core/export-html/card-projection.impl.js +3 -3
  68. package/dist/core/export-html/card-projection.js +3 -3
  69. package/dist/core/export-html/index.code.js +2 -2
  70. package/dist/core/export-html/index.impl.js +3 -3
  71. package/dist/core/export-html/index.js +3 -3
  72. package/dist/core/export-html/json-spans.impl.js +3 -3
  73. package/dist/core/export-html/json-spans.js +3 -3
  74. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  75. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  76. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  77. package/dist/core/export-html/tool-renderer.js +3 -3
  78. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  79. package/dist/core/extensions/jiti-loader.js +3 -3
  80. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  81. package/dist/core/extensions/jiti-static-loader.js +3 -3
  82. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  83. package/dist/core/extensions/loader-host-modules.js +3 -3
  84. package/dist/core/intercom-broker-control-host.code.js +1 -1
  85. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  86. package/dist/core/intercom-broker-control-host.js +3 -3
  87. package/dist/core/intercom-broker-control.code.js +2 -2
  88. package/dist/core/intercom-broker-control.impl.js +3 -3
  89. package/dist/core/intercom-broker-control.js +3 -3
  90. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  91. package/dist/core/package-manager-storage-adapters.js +3 -3
  92. package/dist/core/sdk.code.js +1 -1
  93. package/dist/core/sdk.impl.js +3 -3
  94. package/dist/core/sdk.js +3 -3
  95. package/dist/core/session-manager-core.js +3 -3
  96. package/dist/core/session-manager-list.impl.js +3 -3
  97. package/dist/core/session-manager-list.js +3 -3
  98. package/dist/core/session-manager.impl.js +3 -3
  99. package/dist/core/session-manager.js +3 -3
  100. package/dist/core/session-storage.impl.js +3 -3
  101. package/dist/core/session-storage.js +3 -3
  102. package/dist/core/storage/index.js +2 -2
  103. package/dist/core/storage/node-sqlite-thread.js +2 -2
  104. package/dist/core/storage/node-sqlite.js +2 -2
  105. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  106. package/dist/core/storage/offline-snapshot-file.js +3 -3
  107. package/dist/core/storage/provider.js +2 -2
  108. package/dist/core/storage/selection.js +2 -2
  109. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  110. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  111. package/dist/core/storage/session/branch-fork-source.js +3 -3
  112. package/dist/core/storage/session/card-view.impl.js +3 -3
  113. package/dist/core/storage/session/card-view.js +3 -3
  114. package/dist/core/storage/session/child-reader.code.js +2 -2
  115. package/dist/core/storage/session/child-reader.impl.js +3 -3
  116. package/dist/core/storage/session/child-reader.js +3 -3
  117. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  118. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  119. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  120. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  121. package/dist/core/storage/session/expanded-child-details.js +3 -3
  122. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  123. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  124. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  125. package/dist/core/storage/session/fork-row-index.js +3 -3
  126. package/dist/core/storage/session/fork-staging.code.js +1 -1
  127. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  128. package/dist/core/storage/session/fork-staging.js +3 -3
  129. package/dist/core/storage/session/fork-window.code.js +2 -2
  130. package/dist/core/storage/session/fork-window.impl.js +3 -3
  131. package/dist/core/storage/session/fork-window.js +3 -3
  132. package/dist/core/storage/session/history-pages.impl.js +3 -3
  133. package/dist/core/storage/session/history-pages.js +3 -3
  134. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  135. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  136. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  137. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  138. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  139. package/dist/core/storage/session/memory-session-store.js +3 -3
  140. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  141. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  142. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  143. package/dist/core/storage/session/released-history-files.code.js +1 -1
  144. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  145. package/dist/core/storage/session/released-history-files.js +3 -3
  146. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  147. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  148. package/dist/core/storage/session/session-resume.impl.js +3 -3
  149. package/dist/core/storage/session/session-resume.js +3 -3
  150. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  151. package/dist/core/storage/session/snapshot-cut.js +3 -3
  152. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  153. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  154. package/dist/core/storage/session/snapshot-history.js +3 -3
  155. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  156. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  157. package/dist/core/storage/session/sql-session-store.js +3 -3
  158. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  159. package/dist/core/storage/session/tree-outline.js +3 -3
  160. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  161. package/dist/core/storage/session/tree-presentation.js +3 -3
  162. package/dist/core/storage/storage-status.impl.js +3 -3
  163. package/dist/core/storage/storage-status.js +3 -3
  164. package/dist/core/storage/team.impl.js +3 -3
  165. package/dist/core/storage/team.js +3 -3
  166. package/dist/core/structured-output/index.code.js +1 -1
  167. package/dist/core/structured-output/index.impl.js +3 -3
  168. package/dist/core/structured-output/index.js +3 -3
  169. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  170. package/dist/core/tasks/task-completion-entry.js +3 -3
  171. package/dist/core/tasks/task-file-history.code.js +2 -2
  172. package/dist/core/tasks/task-file-history.impl.js +3 -3
  173. package/dist/core/tasks/task-file-history.js +3 -3
  174. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  175. package/dist/core/tasks/task-reference-archive.js +3 -3
  176. package/dist/core/tasks/task-reference-identity.js +3 -3
  177. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  178. package/dist/core/tasks/task-reference-stream.js +3 -3
  179. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  180. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  181. package/dist/core/tasks/task-view-source.impl.js +3 -3
  182. package/dist/core/tasks/task-view-source.js +3 -3
  183. package/dist/core/tools/read-url.impl.js +3 -3
  184. package/dist/core/tools/read-url.js +3 -3
  185. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  186. package/dist/core/worktree-snapshot/errors.code.js +1 -1
  187. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  188. package/dist/core/worktree-snapshot/errors.js +3 -3
  189. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  190. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  191. package/dist/extensions/codemode/execute.impl.js +3 -3
  192. package/dist/extensions/codemode/execute.js +3 -3
  193. package/dist/extensions/codemode/renderer.impl.js +3 -3
  194. package/dist/extensions/codemode/renderer.js +3 -3
  195. package/dist/extensions/mcp/cli.code.js +1 -1
  196. package/dist/extensions/mcp/cli.impl.js +3 -3
  197. package/dist/extensions/mcp/cli.js +3 -3
  198. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  199. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  200. package/dist/extensions/mcp/cli.lazy.js +3 -3
  201. package/dist/extensions/mcp/runtime.code.js +1 -1
  202. package/dist/extensions/mcp/runtime.impl.js +3 -3
  203. package/dist/extensions/mcp/runtime.js +3 -3
  204. package/dist/index.d.ts +21 -1
  205. package/dist/index.js +2 -2
  206. package/dist/main-first-time-setup.code.js +1 -1
  207. package/dist/main-first-time-setup.impl.js +3 -3
  208. package/dist/main-first-time-setup.js +3 -3
  209. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  210. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  211. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  212. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  213. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  214. package/dist/modes/print-mode.js +1 -1
  215. package/dist/package-manager-cli.code.js +2 -2
  216. package/dist/package-manager-cli.impl.js +3 -3
  217. package/dist/package-manager-cli.js +3 -3
  218. package/dist/startup-files.json +1 -1
  219. package/dist/startup-stages/6.js +1 -1
  220. package/dist/utils/startup-database-spare.code.js +1 -1
  221. package/dist/utils/startup-database-spare.impl.js +3 -3
  222. package/dist/utils/startup-database-spare.js +3 -3
  223. package/dist/utils/tools-manager.impl.js +3 -3
  224. package/dist/utils/tools-manager.js +3 -3
  225. package/docs/background-tasks/reference.md +182 -0
  226. package/docs/background-tasks.md +98 -405
  227. package/docs/build.md +67 -27
  228. package/docs/changelog.mdx +1 -1
  229. package/docs/codemode.md +108 -39
  230. package/docs/compaction/branch-summaries.md +54 -0
  231. package/docs/compaction/custom-compactors.md +161 -0
  232. package/docs/compaction/memory-compaction.md +77 -0
  233. package/docs/compaction/reference.md +86 -38
  234. package/docs/compaction.md +51 -252
  235. package/docs/computer-use.md +169 -321
  236. package/docs/containerization.md +71 -57
  237. package/docs/custom-provider/api-reference.md +119 -25
  238. package/docs/custom-provider/oauth.md +114 -132
  239. package/docs/custom-provider/override.md +37 -27
  240. package/docs/custom-provider/registration.md +107 -83
  241. package/docs/custom-provider/streaming.md +85 -71
  242. package/docs/custom-provider.md +85 -52
  243. package/docs/development.md +39 -29
  244. package/docs/docs.json +76 -63
  245. package/docs/environment-variables.md +94 -44
  246. package/docs/extensions/api-reference.md +86 -43
  247. package/docs/extensions/authoring.md +162 -154
  248. package/docs/extensions/events.md +80 -25
  249. package/docs/extensions/examples.md +90 -85
  250. package/docs/extensions/ui.md +206 -82
  251. package/docs/extensions.md +79 -108
  252. package/docs/getting-started/authentication.md +67 -36
  253. package/docs/getting-started/first-session.md +53 -43
  254. package/docs/getting-started/installation.md +116 -89
  255. package/docs/getting-started/project-instructions.md +48 -34
  256. package/docs/guides/configuration.md +82 -20
  257. package/docs/guides/non-interactive.md +66 -24
  258. package/docs/guides/resume-on-any-machine.md +135 -82
  259. package/docs/guides/team-setup.md +114 -105
  260. package/docs/guides.md +76 -32
  261. package/docs/herdr.md +15 -16
  262. package/docs/how-atomic-works.md +140 -0
  263. package/docs/index.md +58 -44
  264. package/docs/intercom/operations.md +141 -151
  265. package/docs/intercom/reference.md +85 -108
  266. package/docs/intercom.md +84 -145
  267. package/docs/json.md +120 -67
  268. package/docs/keybindings.md +85 -49
  269. package/docs/libraries/agent-core.md +137 -275
  270. package/docs/libraries/ai.md +100 -84
  271. package/docs/libraries/codemode.md +210 -300
  272. package/docs/libraries/schema.md +59 -53
  273. package/docs/libraries/storage-postgres.md +49 -35
  274. package/docs/libraries/telemetry.md +153 -354
  275. package/docs/libraries/tui.md +265 -393
  276. package/docs/libraries.md +42 -26
  277. package/docs/llama-cpp.md +171 -161
  278. package/docs/mcp-servers.md +90 -51
  279. package/docs/models/choose-a-model.md +188 -0
  280. package/docs/models/reference.md +74 -30
  281. package/docs/models.md +153 -88
  282. package/docs/orchestration/migrating-workflows.md +23 -16
  283. package/docs/orchestration/patterns.md +39 -44
  284. package/docs/orchestration.md +65 -26
  285. package/docs/packages/authoring.md +51 -29
  286. package/docs/packages/reference.md +42 -21
  287. package/docs/packages.md +69 -58
  288. package/docs/programmatic.md +118 -24
  289. package/docs/prompt-templates.md +84 -83
  290. package/docs/providers/reference.md +43 -48
  291. package/docs/providers.md +219 -451
  292. package/docs/quickstart.md +140 -120
  293. package/docs/reference/cli.md +135 -97
  294. package/docs/reference.md +20 -18
  295. package/docs/rpc/examples.md +76 -20
  296. package/docs/rpc/extension-ui.md +64 -38
  297. package/docs/rpc/protocol.md +361 -110
  298. package/docs/rpc.md +57 -17
  299. package/docs/sdk/reference.md +409 -534
  300. package/docs/sdk/storage.md +53 -13
  301. package/docs/sdk/structured-decisions.md +82 -56
  302. package/docs/sdk/web-server.md +57 -43
  303. package/docs/sdk.md +106 -84
  304. package/docs/security.md +42 -64
  305. package/docs/session-format.md +62 -38
  306. package/docs/sessions.md +99 -214
  307. package/docs/settings.md +165 -195
  308. package/docs/shell-aliases.md +9 -6
  309. package/docs/skills/authoring.md +69 -48
  310. package/docs/skills/reference.md +51 -20
  311. package/docs/skills.md +99 -148
  312. package/docs/slash-commands.md +129 -0
  313. package/docs/storage/custom-adapters.md +160 -85
  314. package/docs/storage/jsonl.md +81 -66
  315. package/docs/storage/postgres/pgbouncer.md +120 -126
  316. package/docs/storage/postgres/tuning.md +120 -143
  317. package/docs/storage/postgres.md +314 -330
  318. package/docs/storage/sqlite.md +71 -42
  319. package/docs/storage.md +298 -302
  320. package/docs/subagents/authoring.md +55 -38
  321. package/docs/subagents/reference.md +73 -33
  322. package/docs/subagents.md +119 -187
  323. package/docs/terminal-setup.md +50 -38
  324. package/docs/termux.md +67 -41
  325. package/docs/themes/reference.md +23 -19
  326. package/docs/themes.md +142 -127
  327. package/docs/tmux.md +47 -55
  328. package/docs/tools.md +147 -109
  329. package/docs/tui/reference.md +166 -214
  330. package/docs/tui.md +196 -341
  331. package/docs/usage.md +118 -138
  332. package/docs/verification.md +79 -51
  333. package/docs/web-access.md +121 -101
  334. package/docs/windows.md +26 -27
  335. package/docs/worktree-snapshots/reference.md +245 -0
  336. package/docs/worktree-snapshots.md +71 -259
  337. package/package.json +8 -8
  338. package/dist/_shared/startup-0-2-5QHPCEON.js.map +0 -1
  339. package/docs/guides/intercom.md +0 -32
  340. package/docs/guides/orchestration.md +0 -28
  341. package/docs/guides/subagents.md +0 -37
@@ -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 access and modify, choose one of two isolation models:
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 [Security and project trust](/security) alongside this page to see how project trust gates which project extensions, skills, and settings load before work starts.
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 remain 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 | Simple local isolation | Provider API keys enter the 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. If 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).
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 execution routed into the VM. This does not isolate the entire session.
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
- Copy `examples/extensions/gondolin` to a directory **outside** `~/.atomic/agent/extensions/` (for example `~/.local/share/atomic-gondolin`) when you want opt-in per-session use with `-e`, then install its dependencies:
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
- ```bash
31
- cp -R "$(npm root -g)/@bastani/atomic/examples/extensions/gondolin" ~/.local/share/atomic-gondolin
32
- cd ~/.local/share/atomic-gondolin
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
- Launch Atomic with `-e` from the project directory you want mounted inside the VM:
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
- 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`, placing it inside `~/.atomic/agent/extensions/` causes Atomic to auto-load it globally even without `-e`.
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 (prints VM ID, host workspace, guest workspace, and guest shell) and a footer status item (`Gondolin: <id> (/workspace)`).
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) to this allowlist also disables `intercom`, `subagent`, and other extension tools; MCP tools stay hidden unless a `mcp__*` pattern is listed. Other loaded host extensions can still run code on the host, so use whole-process isolation when host filesystem access must be prevented completely.
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 smaller base image, make sure `install.sh` has `uname`, `tar` with `gzip`, core file utilities (`mkdir`, `mv`, `chmod`, `ln`, `rm`, `rmdir`), `curl` or `wget`, `sha256sum` (or `shasum` or `openssl`), and `ldd` on non-Alpine Linux. `debian:bookworm-slim` already includes these tools.
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. See [Alpine and musl Linux archives](/getting-started/installation#alpine-and-musl-linux-archives).
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
- If you mount only `/root/.atomic/agent`, setting `ATOMIC_CODING_AGENT_DIR=/root/.atomic/agent` does **not** keep sessions inside that volume. Because `/root/.atomic/agent` matches the default agent directory, Atomic still places `journal.sqlite` outside the volume at `/root/.atomic/workflows/journal.sqlite`.
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
- When mounting only `/root/.atomic/agent`, persist sessions with one of these options:
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
- - Pass `--session-store /root/.atomic/agent/journal.sqlite`, or set `ATOMIC_STORAGE` or `ATOMIC_SESSIONS_STORAGE` to point inside `/root/.atomic/agent` ([Selecting storage per process](/storage#selecting-storage-per-process)).
123
- - Set [`ATOMIC_CODING_AGENT_DIR`](/environment-variables) to a non-default subdirectory inside the volume, such as `/root/.atomic/agent/state`, so Atomic stores sessions at `/root/.atomic/agent/state/workflows/journal.sqlite`.
124
- - Mount `/root/.atomic` instead of only `/root/.atomic/agent`.
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
- - **Memory and cgroup controls.** For npm and Node.js installs, Atomic sizes the Node.js heap automatically to half of the container's cgroup memory limit when that exceeds Node's default; override with `ATOMIC_HEAP_MB` (`0` keeps Node's default). On Linux with a user-owned cgroup v2 hierarchy, Atomic also uses cgroups to contain background shell process trees; set `ATOMIC_TASK_CGROUP=0` if container cgroup policies block it ([Background tasks](/background-tasks#lifetime-retention-and-cleanup), [Environment variables](/environment-variables#diagnostics-and-performance)).
131
- - **Restricted networks, proxies, and private CAs.** Pass `--offline` or set `ATOMIC_OFFLINE=1` in restricted-egress containers to disable automatic update checks, telemetry, and binary downloads. Configure `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` (or `httpProxy` in [Network proxy settings](/settings#network-proxy)), point `NODE_EXTRA_CA_CERTS` at private CA bundles ([Environment variables](/environment-variables#tls-certificates)), and set `ATOMIC_ALLOW_PRIVATE_URL_READS=1` only if `read` needs to reach container-local services. For PostgreSQL over an HTTP `CONNECT` proxy, see [Through an HTTP proxy](/storage/postgres#through-an-http-proxy).
132
- - **Unattended and CI containers.** For headless runs without `-it`, use print mode (`-p`), `--mode json`, or `--mode rpc`, and combine `--no-session` (or shared storage) with explicit `--approve` or `--no-approve` trust flags ([Non-interactive usage](/guides/non-interactive)). In CI or multi-container runs, set `ATOMIC_STORAGE` to the team database ([Team and CI setup](/guides/team-setup#ci-and-swarms)), and use `.atomic/blueprint.yaml` with `atomic blueprint prebuild` to pre-install project dependencies and warm caches ([Resume on any machine](/guides/resume-on-any-machine#set-the-environment-up-with-a-blueprint)).
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
- Register and select an active gateway before creating a sandbox:
139
-
140
- ```bash
141
- openshell gateway add <gateway-url> --name <name>
142
- openshell gateway select <name>
143
- ```
144
-
145
- Launch `atomic` inside an OpenShell sandbox:
146
-
147
- ```bash
148
- openshell sandbox create --name atomic-sandbox --from atomic -- atomic
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 [Custom models](/models) and [Custom providers](/custom-provider) for full `models.json` options.
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 provider API"
4
- description: "TypeScript interfaces and methods for registerProvider(), registerProviderAlias(), unregisterProvider(), and model definitions."
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 (except when setting or replacing `aliasOf`, which resets it).
21
- - `registerProvider`, `registerProviderAlias`, and `unregisterProvider` take effect immediately when called after initial extension loading without running `/reload`.
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
- ## Config reference
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 (shorthand equivalent of registerProviderAlias). No other config fields may be set alongside aliasOf except name. */
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> in auth.json. */
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, and at provider or model level when defining chat or compactor models. */
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>. Fails if no API key resolves. */
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
- ## Model definition reference
90
+ ## ProviderModelConfig
82
91
 
83
- `ProviderModelConfig` is a discriminated union of chat (`type?: "chat"`), image (`type: "image"`), classifier (`type: "classifier"`), and compactor (`type: "compactor"`) model definitions:
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
- /** Classifier API compatibility overrides (such as System One imageInput and sendImageOptInHeader). */
158
- compat?: ClassifierCompat;
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. No default: omitted means no size limit. */
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 (`thinkingFormat`, `chatTemplateKwargs`, `chatTemplateArgs`, `thinkingTokenBudgetField`, `vllmPriority`, `cacheControlFormat`, `supportsToolSearch`, `supportsAdditionalTools`, `supportsExplicitPromptCacheMode`, `supportsMidConvoEffort`, and more), see [`models.json` field reference](/models-configuration#compatibility).
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` controls 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) controls OpenAI Lark/regex custom tools. Leave these unset or `false` unless the endpoint actually enforces them. See [Constrained sampling](/extensions/authoring#constrained-sampling).
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 }`).