@bastani/atomic 0.10.9 → 0.10.10-alpha.2

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