@bastani/atomic 0.10.9 → 0.10.10-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 (401) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +211 -155
  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} +145 -58
  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 +85 -114
  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 +37 -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 +71 -138
  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 +60 -87
  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 +235 -243
  297. package/docs/build.md +12 -11
  298. package/docs/codemode.md +60 -51
  299. package/docs/compaction/reference.md +61 -24
  300. package/docs/compaction.md +117 -65
  301. package/docs/computer-use.md +179 -146
  302. package/docs/containerization.md +79 -33
  303. package/docs/custom-provider/api-reference.md +148 -11
  304. package/docs/custom-provider/oauth.md +44 -27
  305. package/docs/custom-provider/override.md +14 -7
  306. package/docs/custom-provider/registration.md +75 -65
  307. package/docs/custom-provider/streaming.md +42 -19
  308. package/docs/custom-provider.md +25 -61
  309. package/docs/development.md +47 -43
  310. package/docs/docs.json +33 -33
  311. package/docs/environment-variables.md +83 -57
  312. package/docs/extensions/api-reference.md +323 -734
  313. package/docs/extensions/authoring.md +186 -269
  314. package/docs/extensions/events.md +308 -375
  315. package/docs/extensions/examples.md +122 -74
  316. package/docs/extensions/ui.md +217 -197
  317. package/docs/extensions.md +152 -259
  318. package/docs/getting-started/authentication.md +27 -14
  319. package/docs/getting-started/first-session.md +25 -26
  320. package/docs/getting-started/installation.md +62 -84
  321. package/docs/getting-started/project-instructions.md +39 -14
  322. package/docs/guides/configuration.md +42 -20
  323. package/docs/guides/intercom.md +17 -13
  324. package/docs/guides/non-interactive.md +29 -16
  325. package/docs/guides/orchestration.md +16 -10
  326. package/docs/guides/resume-on-any-machine.md +54 -49
  327. package/docs/guides/subagents.md +22 -14
  328. package/docs/guides/team-setup.md +37 -26
  329. package/docs/guides.md +22 -21
  330. package/docs/herdr.md +21 -16
  331. package/docs/index.md +16 -17
  332. package/docs/intercom/operations.md +68 -66
  333. package/docs/intercom/reference.md +196 -191
  334. package/docs/intercom.md +103 -92
  335. package/docs/json.md +71 -71
  336. package/docs/keybindings.md +63 -50
  337. package/docs/libraries/agent-core.md +49 -8
  338. package/docs/libraries/ai.md +21 -12
  339. package/docs/libraries/codemode.md +28 -6
  340. package/docs/libraries/schema.md +7 -7
  341. package/docs/libraries/telemetry.md +7 -7
  342. package/docs/libraries/tui.md +74 -94
  343. package/docs/libraries.md +5 -5
  344. package/docs/llama-cpp.md +38 -33
  345. package/docs/mcp-servers.md +96 -90
  346. package/docs/models/reference.md +46 -33
  347. package/docs/models-configuration.md +12 -6
  348. package/docs/models.md +93 -88
  349. package/docs/orchestration/migrating-workflows.md +21 -19
  350. package/docs/orchestration/patterns.md +35 -20
  351. package/docs/orchestration.md +22 -21
  352. package/docs/packages/authoring.md +28 -19
  353. package/docs/packages/reference.md +75 -16
  354. package/docs/packages.md +31 -33
  355. package/docs/programmatic.md +22 -21
  356. package/docs/prompt-templates.md +63 -41
  357. package/docs/providers/reference.md +35 -19
  358. package/docs/providers.md +61 -71
  359. package/docs/quickstart.md +32 -46
  360. package/docs/reference/cli.md +249 -252
  361. package/docs/reference.md +23 -20
  362. package/docs/rpc/examples.md +74 -17
  363. package/docs/rpc/extension-ui.md +79 -62
  364. package/docs/rpc/protocol.md +816 -358
  365. package/docs/rpc.md +75 -151
  366. package/docs/sdk/reference.md +175 -45
  367. package/docs/sdk/structured-decisions.md +92 -62
  368. package/docs/sdk/web-server.md +79 -46
  369. package/docs/sdk.md +237 -195
  370. package/docs/security.md +106 -43
  371. package/docs/session-format.md +96 -59
  372. package/docs/sessions.md +149 -113
  373. package/docs/settings.md +289 -204
  374. package/docs/shell-aliases.md +15 -6
  375. package/docs/skills/authoring.md +17 -9
  376. package/docs/skills/reference.md +23 -21
  377. package/docs/skills.md +104 -97
  378. package/docs/storage.md +140 -242
  379. package/docs/subagents/authoring.md +147 -16
  380. package/docs/subagents/reference.md +100 -30
  381. package/docs/subagents.md +220 -252
  382. package/docs/terminal-setup.md +97 -69
  383. package/docs/termux.md +51 -85
  384. package/docs/themes/reference.md +51 -37
  385. package/docs/themes.md +49 -54
  386. package/docs/tmux.md +38 -21
  387. package/docs/tools.md +198 -147
  388. package/docs/tui/reference.md +64 -32
  389. package/docs/tui.md +38 -66
  390. package/docs/usage.md +76 -78
  391. package/docs/verification.md +25 -25
  392. package/docs/web-access.md +72 -55
  393. package/docs/windows.md +53 -58
  394. package/docs/worktree-snapshots.md +62 -65
  395. package/package.json +8 -8
  396. package/schemas/models.schema.json +51 -0
  397. package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
  398. package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
  399. package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
  400. package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
  401. package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
@@ -1,17 +1,16 @@
1
1
  ---
2
- title: "Orchestration with codemode and subagents"
3
- description: "Run multi-step work in chat, keep track of background children, and convert an earlier workflow file into a reusable skill."
2
+ title: "Orchestrate with codemode and subagents"
3
+ sidebarTitle: "Orchestration"
4
+ description: "Coordinate parallel subagents from codemode, handle results as they finish, and recover after interruptions."
4
5
  ---
5
6
 
6
- # Orchestration with codemode and subagents
7
-
8
7
  Describe the outcome you want and how to verify it. For example: "Review the installation guide for Linux and Windows in parallel. Report any commands that do not match the CLI. Do not edit files."
9
8
 
10
- The parent chat decides whether to answer directly, run checks in [codemode](/codemode), or split work across [subagents](/subagents).
9
+ Your main session decides whether to answer directly, run checks in [codemode](/codemode), or split work across [subagents](/subagents).
11
10
 
12
11
  ## Launch now, use the result later
13
12
 
14
- The snippet below is JavaScript that the parent model runs inside `codemode`, not a file you install. Run `/tools` if your session uses a custom tool list to confirm `codemode` and `subagent` are active.
13
+ The snippet below is JavaScript that your main session runs inside `codemode`, not a file you install. Run `/tools` if your session uses a custom tool list to confirm `codemode` and `subagent` are active.
15
14
 
16
15
  ```js
17
16
  const launch = await tools.subagent({
@@ -24,37 +23,39 @@ store("guide-review", launch.tasks);
24
23
  return launch.tasks;
25
24
  ```
26
25
 
27
- - **Admission, not completion.** `await` resolves once children are admitted. Admitted or queued slots return `{ taskId, childId }`; refused slots return `{ reason }` with no running child. The parent can continue working or end its turn. Completion notices return results automatically, and `/tasks` lets you inspect children directly.
28
- - **Explicit wait.** When a later step needs a result immediately, wait briefly without launching a second child:
26
+ - **Launch, not completion.** `await` resolves as soon as subagents start or enter the queue. Started or queued slots return `{ taskId, childId, agent, state: "admitted" | "queued", intercomTarget? }` (`intercomTarget` is included when Intercom is enabled for the subagent). Refused slots return `{ agent, state: "refused", reason }` with no running subagent. Your main session can continue working or end its turn while completion notices return results automatically, and `/tasks` lets you inspect subagents directly.
27
+ - **Explicit parallel batches.** Separate `tools.subagent()` calls inside codemode are not merged into one burst. Pass `tasks: [...]` when you want a parallel batch.
28
+ - **Explicit wait.** When a later step needs a result immediately, wait briefly without launching a second subagent. The `// @options` comment sets per-script [codemode options](/codemode) such as `timeout_ms` (codemode scripts have a 256 MiB memory limit and no default timeout):
29
29
 
30
30
  ```js
31
31
  // @options: {"timeout_ms": 10000}
32
32
  const task = load("guide-review").find((t) => t.taskId);
33
- if (!task) return "No review was admitted.";
33
+ if (!task) return "No review was started.";
34
34
  return await tools.subagent({ action: "wait", id: task.taskId, budgetMs: 2000 });
35
35
  ```
36
36
 
37
- - **Cancellation and evidence.** Hitting `budgetMs` or interrupting the script never stops an admitted child. Use `tools.subagent({ action: "quit", id: childId })` to stop it. Treat actual child results and status, not launch receipts, as evidence, and account for every required child in joint reviews.
38
- - **Flat delegation.** Only the parent launches subagents. If a child uncovers follow-up work, it reports back so the parent can launch the next batch.
39
- - **Peer messaging.** Pass `group: true` or a shared named `group` so children can coordinate over Intercom. Address them with the exact `intercomTarget` from the launch receipt ([Intercom from codemode](/intercom/reference#from-codemode-scripts)). A delivery acknowledgement is not a task result.
37
+ Inside codemode, `tools.subagent({ action: "wait" })` defaults to a 30-second budget even when a host configures unlimited foreground waits.
38
+ - **Cancellation and evidence.** Hitting `budgetMs`, returning early, or interrupting the script never stops an already-launched subagent (unawaited tool calls are cancelled when the script returns, while already-launched background subagents keep running). Use `tools.subagent({ action: "quit", id: childId })` to stop one. Treat actual subagent results and status, not launch receipts, as evidence, and account for every required subagent in joint reviews.
39
+ - **One-level delegation.** Only the main session launches subagents. If a subagent uncovers follow-up work, it reports back so the main session can launch the next batch.
40
+ - **Peer messaging.** Pass `group: true` to create a unique shared Intercom group for that batch, or pass a shared named `group`. Peer isolation keeps unrelated sessions out while `contact_supervisor` still reaches the main session across groups. Address subagents with the exact `intercomTarget` from the launch result ([Intercom from codemode](/intercom/reference#from-codemode-scripts)). A delivery acknowledgement is not a task result.
40
41
 
41
- ## What survives interruption?
42
+ ## What survives interruption
42
43
 
43
- Children are persisted sessions; codemode scripts are not checkpointed programs.
44
+ Subagents are persisted sessions; codemode scripts are not checkpointed programs.
44
45
 
45
- - Reopening the original parent session automatically restores unfinished children. Paused or quit children resume from `/tasks` or `tools.subagent({ action: "resume", id: childId })`.
46
- - The parent resumes in chat from notices, saved results, and decisions instead of re-entering an old JavaScript loop.
47
- - Save small handoff state, such as task IDs, round count, and next checks, with [the codemode store](/codemode#store-values), which persists per branch when a script succeeds. Tool side effects happen even if a script later fails, so inspect `/tasks`, chat, and changed files before retrying.
48
- - On recovery, call `await tools.subagent({ action: "status" })` and reconcile `children` against stored `childId` values. Collect finished results, resume paused work that is still needed, and relaunch missing children only after checking what they left behind.
46
+ - Reopening the original main session automatically restores running subagents. Paused or quit subagents resume from `/tasks` or `tools.subagent({ action: "resume", id: childId })`.
47
+ - Your main session resumes in chat from completion notices, saved results, and decisions instead of re-entering an old JavaScript loop.
48
+ - Save small handoff state, such as task IDs, round count, and next checks, with [the codemode store](/codemode#store-values), which persists per branch only when a script succeeds. If a script throws or times out, all `store()` writes from that script are discarded, even though any `tools.subagent()` launches already started. Inspect `/tasks`, chat, and changed files before retrying.
49
+ - On recovery, call `await tools.subagent({ action: "status" })` and reconcile `children` against stored `childId` values. Collect finished results, resume paused work that is still needed, and relaunch missing subagents only after checking what they left behind.
49
50
 
50
51
  ## Choose a pattern
51
52
 
52
53
  - [Classify-and-act](/orchestration/patterns#classify-and-act) triages input first, then dispatches the matching specialist.
53
- - [Fan-out-and-synthesize](/orchestration/patterns#fan-out-and-synthesize) splits an analysis across parallel children and reconciles their findings.
54
- - [Adversarial verification](/orchestration/patterns#adversarial-verification) asks an independent child to break a candidate.
54
+ - [Fan-out-and-synthesize](/orchestration/patterns#fan-out-and-synthesize) splits an analysis across parallel subagents and reconciles their findings.
55
+ - [Adversarial verification](/orchestration/patterns#adversarial-verification) asks an independent subagent to break a candidate.
55
56
  - [Generate-and-filter](/orchestration/patterns#generate-and-filter) collects candidates and keeps only those passing a deterministic check.
56
57
  - [Tournament](/orchestration/patterns#tournament) compares competing implementations on shared fixtures.
57
58
  - [Loop-until-done](/orchestration/patterns#loop-until-done) runs verification checks between bounded repair rounds.
58
59
  - [Stacked slices](/orchestration/patterns#stacked-slices) branches each dependent slice from the verified prior commit.
59
60
 
60
- To migrate an earlier workflow file or built-in name, see [Convert an earlier workflow into a skill](/orchestration/migrating-workflows). To save new repeatable procedures, use a [skill](/skills#skills-as-workflows).
61
+ To migrate an earlier workflow file or built-in name, see [Migrate an earlier workflow to a skill](/orchestration/migrating-workflows). To save new repeatable procedures, use a [skill](/skills#skills-as-workflows).
@@ -1,13 +1,12 @@
1
1
  ---
2
- title: Creating packages
3
- description: Create an Atomic package, lay out its structure, and declare dependencies.
2
+ title: "Create and publish packages"
3
+ sidebarTitle: "Create packages"
4
+ description: "Declare Atomic package manifests for extensions, skills, subagents, prompts, themes, MCP servers, and storage adapters."
4
5
  ---
5
6
 
6
- # Creating packages
7
+ <div id="creating-an-atomic-package" />
7
8
 
8
- ## Creating an Atomic package
9
-
10
- Declare resources under the `atomic` key in `package.json` (legacy `pi` is still supported as a shim; paths are relative to the package root and support globs and `!exclusions`), and include `"atomic-package"` in `keywords`:
9
+ Declare package resources under the `atomic` key in `package.json` (legacy `pi` is also supported), and include `"atomic-package"` in `keywords`:
11
10
 
12
11
  ```json
13
12
  {
@@ -23,7 +22,12 @@ Declare resources under the `atomic` key in `package.json` (legacy `pi` is still
23
22
  }
24
23
  ```
25
24
 
26
- ### Subagents
25
+ Manifest rules to know before adding an `atomic` key:
26
+
27
+ - **Manifest overrides convention discovery.** Once `package.json` contains an `"atomic"` (or legacy `"pi"`) key, Atomic stops auto-discovering omitted convention directories. For example, if you add `"atomic": { "mcpServers": "./mcp.json" }` without listing `"extensions": ["./extensions"]`, your `extensions/` directory is no longer loaded automatically. List every resource directory you want to expose.
28
+ - **Paths and filters.** Every array entry in `extensions`, `skills`, `prompts`, `themes`, `storageAdapters`, and `agents` must be a string (non-string arrays are ignored). Paths resolve relative to the package root, glob expansion skips dotfiles and dot-directories, and `!`, `+`, and `-` entries filter the files matched by plain entries in the same array.
29
+
30
+ ## Subagents
27
31
 
28
32
  Ship [custom subagents](/subagents/authoring) via the `agents` array (relative `.md` files or directories searched recursively). Package subagents are manifest-only and are never auto-discovered from an `agents/` convention directory.
29
33
 
@@ -55,13 +59,13 @@ tools: read, search, bash, mcp:acme-search
55
59
  Review the change you are given without editing files. Cite each issue with file:line evidence and stop once the diff and its call paths are covered.
56
60
  ```
57
61
 
58
- - **Qualified name.** Package subagents run as `<namespace>.<name>`, where `<namespace>` is the lowercased package `name` with any `@scope/` converted to `<scope>.` (so `@acme/review-kit` with `reviewer` becomes `acme.review-kit.reviewer`; unnamed packages use their directory name). Frontmatter `package:` is ignored, and names containing dots are skipped.
62
+ - **Qualified name.** Package subagents run as `<namespace>.<name>`, where `<namespace>` is the lowercased package `name` with any `@scope/` converted to `<scope>.` (so `@acme/review-kit` with `reviewer` becomes `acme.review-kit.reviewer`; unnamed packages use their directory name). Frontmatter `package:` is ignored. Subagent names containing dots are skipped with a diagnostic, and if neither `package.json` `name` nor the directory name forms a valid namespace identifier, all agents in that package are skipped with a diagnostic.
59
63
  - **Pins and tools.** Attach [reasoning levels](/subagents/reference#reasoning-levels) directly to `model` and `fallbackModels`. `tools` is an exact allowlist: `mcp:<server>` adds all tools from that server, and `mcp:<server>/<tool>` adds one. Ship the server itself with [`mcpServers`](#mcp-servers).
60
64
  - **Launching.** From codemode, call `await tools.subagent({ agent: "acme.review-kit.reviewer", task })` without a per-call `model` so the agent's pins apply.
61
65
  - **Overrides and trust.** User or project agents with a matching full name (`name: reviewer` with `package: acme.review-kit`) override the package agent. Builtins have no dots and cannot be replaced by packages. Project-installed package agents require project trust; `-e` package agents load for that run.
62
66
  - **Lifecycle and filtering.** Run `/reload` after install, update, or remove (running subagents keep their launch definition). Filter per package with `agents` in [settings](/packages/reference#package-filtering) (`atomic config` does not list agents). `subagent` `update` and `delete` refuse package agents. Edit the package or add an override instead.
63
67
 
64
- ### MCP servers
68
+ ## MCP servers
65
69
 
66
70
  Contribute [MCP servers](/mcp-servers) via `mcpServers` in the manifest (manifest-only, never convention-discovered), either pointing to a JSON file or inline:
67
71
 
@@ -84,11 +88,14 @@ Contribute [MCP servers](/mcp-servers) via `mcpServers` in the manifest (manifes
84
88
  }
85
89
  ```
86
90
 
87
- - Contributed servers use the standard `mcp.json` schema (URL environment interpolation, `exposure`, `toolExposure`, `timeout` in seconds). Relative `cwd` resolves against the package root (`"cwd": "."` targets files shipped in the package). `auth.provider` is not allowed in package manifests.
91
+ - A referenced JSON file accepts either a top-level `"mcpServers"` or `"mcp-servers"` key.
92
+ - Contributed servers follow the standard `mcp.json` schema (URL environment interpolation, `exposure`, `toolExposure`, positive `timeout` in seconds). Server names must match `^[A-Za-z0-9_-]+$`.
93
+ - Relative `cwd` resolves against the package root when it does not start with `/`, `~`, or `$` (`"cwd": "."` targets files shipped in the package; absolute, home-relative, and `$VAR` paths stay as written).
94
+ - `type: "sse"` is rejected (use streamable HTTP), and `auth.provider` is not allowed in package manifests.
88
95
  - Contributed servers have lowest precedence. User and project configurations can override or disable them by name, and settings can filter them via `mcpServers` patterns. Project packages contribute servers only in trusted projects.
89
96
  - For dynamically computed server configs, call [`atomic.registerMcpServer()`](/extensions/api-reference#atomic-registermcpserver-name-config) from an extension.
90
97
 
91
- ### Storage adapters
98
+ ## Storage adapters
92
99
 
93
100
  Expose [storage adapters](/storage#selecting-an-adapter) via `storageAdapters` (manifest-only, paths relative to the package root). Put database drivers in `dependencies` and `@bastani/atomic` in `peerDependencies`:
94
101
 
@@ -101,9 +108,11 @@ Expose [storage adapters](/storage#selecting-an-adapter) via `storageAdapters` (
101
108
  }
102
109
  ```
103
110
 
104
- Select an adapter by package name (`"storage": { "adapter": "@example/atomic-libsql" }`) or `<package>/<file-stem>` when a package exports multiple adapters. Adapters load only from user-settings packages or explicit extension paths (`--extension <dir>` or `additionalExtensionPaths`, which take precedence over settings). See [Adapters from Atomic packages](/storage#adapters-from-atomic-packages).
111
+ - Select an adapter by package name (`"storage": { "adapter": "@example/atomic-libsql" }`), which selects the first entry in `storageAdapters` when a package lists multiple adapters.
112
+ - Select a specific adapter from a multi-adapter package with `<package>/<file-stem>`, where `<file-stem>` is the filename without its extension (for example `"@example/atomic-libsql/libsql-adapter"`).
113
+ - Storage adapters load only from user-settings packages or explicit extension paths (`--extension <dir>` or `additionalExtensionPaths`, which take precedence over settings). Project-installed packages cannot supply storage adapters, and global npm adapter lookup checks `~/.atomic/agent/npm/` only (not the system global npm root). See [Adapters from Atomic packages](/storage#adapters-from-atomic-packages).
105
114
 
106
- ### Gallery metadata
115
+ ## Gallery metadata
107
116
 
108
117
  Include both `"atomic-package"` and legacy `"pi-package"` in `keywords` for gallery visibility, plus optional `video` (MP4; autoplays on hover and takes precedence over `image`) or `image` (PNG, JPEG, GIF, WebP):
109
118
 
@@ -123,14 +132,14 @@ Include both `"atomic-package"` and legacy `"pi-package"` in `keywords` for gall
123
132
 
124
133
  ### Convention directories
125
134
 
126
- Without an `atomic` (or legacy `pi`) manifest key, Atomic auto-discovers:
135
+ When `package.json` has no `atomic` (or legacy `pi`) key, Atomic auto-discovers these directories:
127
136
 
128
137
  | Directory | Loaded files |
129
138
  | --- | --- |
130
- | `extensions/` | `.ts` and `.js` files |
139
+ | `extensions/` | Top-level `.ts` and `.js` files, plus subdirectories containing `index.ts`, `index.js`, or a `package.json` with `atomic.extensions` (or legacy `pi.extensions`) |
131
140
  | `skills/` | Recursive `SKILL.md` folders and top-level `.md` files |
132
- | `prompts/` | `.md` files |
133
- | `themes/` | `.json` files |
141
+ | `prompts/` | `.md` files (scanned recursively inside package convention directories, unlike `.atomic/prompts/` which is non-recursive) |
142
+ | `themes/` | `.json` files (scanned recursively inside package convention directories, unlike `.atomic/themes/` which is non-recursive) |
134
143
 
135
144
  Subagents, MCP servers, and storage adapters require an explicit manifest entry.
136
145
 
@@ -139,8 +148,8 @@ Subagents, MCP servers, and storage adapters require an explicit manifest entry.
139
148
  ## Dependencies
140
149
 
141
150
  - **Third-party runtime dependencies.** Declare them in `dependencies`. Atomic runs your npm-compatible installer for npm and git packages automatically. Local path packages manage their own `node_modules`.
142
- - **Host-provided packages (`peerDependencies: "*"` only).** Never list `@bastani/atomic`, `@bastani/atomic-ai`, `@bastani/atomic-agent-core`, `@bastani/atomic-tui`, `@bastani/atomic-codemode`, `@bastani/atomic-schema`, `@bastani/atomic-telemetry`, `typebox`, or their legacy `@earendil-works/pi-*`, `@mariozechner/pi-*`, or `@bastani/pi-ai` names in `dependencies` (doing so duplicates host registries and triggers a startup warning). Declare them in `peerDependencies` with `"*"` and do not bundle them.
143
- - **Depending on other Atomic packages.** Add them to both `dependencies` and `bundledDependencies`, then reference their resources via `node_modules/...` paths (each package loads with its own isolated module root):
151
+ - **Host-provided packages (`peerDependencies: "*"` only).** Never list `@bastani/atomic`, `@bastani/atomic-ai`, `@bastani/atomic-agent-core`, `@bastani/atomic-tui`, `@bastani/atomic-codemode`, `@bastani/atomic-schema`, `@bastani/atomic-telemetry`, `typebox`, `@sinclair/typebox`, or their legacy `@earendil-works/pi-*`, `@mariozechner/pi-*`, or `@bastani/pi-ai` names in `dependencies` (doing so duplicates host registries and triggers a startup warning). Declare them in `peerDependencies` with `"*"` and do not bundle them.
152
+ - **Depending on other Atomic packages.** Add them to both `dependencies` and `bundledDependencies`, then reference their resources via `node_modules/...` paths (each package resolves dependencies from its own directory):
144
153
 
145
154
  ```json
146
155
  {
@@ -1,10 +1,9 @@
1
1
  ---
2
- title: Package reference
3
- description: Package filtering, scope, and deduplication contracts.
2
+ title: "Package reference"
3
+ sidebarTitle: "Packages"
4
+ description: "Reference for package resource filtering patterns, glob vs exact matching, autoload overrides, precedence, and deduplication."
4
5
  ---
5
6
 
6
- # Package reference
7
-
8
7
  ## Package filtering
9
8
 
10
9
  Use the object form in `settings.json` to filter which resources load from a package:
@@ -26,23 +25,83 @@ Use the object form in `settings.json` to filter which resources load from a pac
26
25
  }
27
26
  ```
28
27
 
29
- Pattern rules (applied on top of the package manifest):
28
+ Package filters run on top of the files collected from the package manifest (or convention directories when the package has no `atomic` manifest key). A filter cannot force-include files that the package manifest omitted or excluded.
29
+
30
+ ### Pattern syntax
31
+
32
+ | Entry | Mode | Meaning |
33
+ | --- | --- | --- |
34
+ | *(key omitted)* | Default | Load all resources of this type exposed by the package |
35
+ | `[]` | Empty | Load no resources of this type |
36
+ | `pattern` (plain) | Glob (`minimatch`) | Restrict to entries matching at least one plain pattern |
37
+ | `!pattern` | Glob (`minimatch`) | Exclude matching entries |
38
+ | `+path` / `+name` | Exact match | Force-include an exact relative path, full path, or MCP server name |
39
+ | `-path` / `-name` | Exact match | Force-exclude an exact relative path, full path, or MCP server name |
40
+
41
+ ### Glob vs exact matching rules
42
+
43
+ - **Glob patterns (plain and `!pattern`)** use `minimatch` (case-sensitive, POSIX `/` separators on all platforms; `*` matches within one path segment, `**` crosses segments, `?` matches one character):
44
+ - For file resources (`extensions`, `skills`, `prompts`, `themes`, `agents`), globs test the relative path from the package root (or settings directory), the bare filename (`basename`), and the full path.
45
+ - For `SKILL.md` files, globs also test the skill's parent directory (relative path, directory basename, and full path). Writing `"!my-skill"` excludes `skills/my-skill/SKILL.md`.
46
+ - For `mcpServers`, globs test the server name from the manifest.
47
+ - **Exact patterns (`+path` and `-path`)** strip leading `./` or `.\`, expand `~` in top-level settings arrays, and normalize slashes to `/`:
48
+ - For file resources, exact patterns match **only** the exact relative path or exact full path, plus the exact parent directory path for `SKILL.md` files (for example `"-skills/my-skill"` excludes `skills/my-skill/SKILL.md`).
49
+ - Exact patterns do **not** match bare filenames. Writing `"-legacy.json"` will not exclude `themes/legacy.json`; use `"-themes/legacy.json"` or `"!legacy.json"` instead.
50
+ - For `mcpServers`, `+name` and `-name` match exact server names.
51
+
52
+ ### Evaluation order
53
+
54
+ In **normal mode** (`autoload` omitted or `true`), operator type decides precedence regardless of array order:
30
55
 
31
- | Pattern | Meaning |
32
- | --- | --- |
33
- | *(key omitted)* | Load all resources of this type |
34
- | `[]` | Load none of this type |
35
- | `!pattern` | Exclude matching entries |
36
- | `+path` / `+name` | Force-include an exact relative path (or server name for `mcpServers`) |
37
- | `-path` / `-name` | Force-exclude an exact relative path (or server name for `mcpServers`) |
56
+ 1. **Plain include globs:** if any plain patterns exist, narrow the set to files matching at least one of them; if none exist, start with every manifest resource.
57
+ 2. **`!pattern` glob excludes:** remove matching entries.
58
+ 3. **`+path` / `+name` exact force-includes:** re-add matching manifest entries (overrides plain filters and `!pattern`).
59
+ 4. **`-path` / `-name` exact force-excludes:** remove matching entries last (`-` always beats `+`).
38
60
 
39
- - In top-level `extensions`, `skills`, `prompts`, and `themes` arrays, patterns expand `~` to your home directory (for example `!~/skills/legacy-*` or `-~/skills/legacy`).
61
+ With **`"autoload": false`**, evaluation switches to **array order (last match wins)**:
62
+
63
+ - On a **project** entry matching a **global** package, `"autoload": false` starts from the inherited global selection and applies each entry in array order as a delta override without discovering new resources from the package.
64
+ - On a **standalone** package (not present in global settings), `"autoload": false` starts empty and loads only resources explicitly enabled by matching entries in array order.
65
+
66
+ ```json
67
+ {
68
+ "packages": [
69
+ {
70
+ "source": "npm:my-package",
71
+ "autoload": false,
72
+ "extensions": ["-extensions/heavy.ts", "+extensions/project-helper.ts"]
73
+ }
74
+ ]
75
+ }
76
+ ```
77
+
78
+ ### Top-level settings arrays
79
+
80
+ Top-level `extensions`, `skills`, `prompts`, and `themes` arrays in `settings.json` mix additive file or directory paths with `!`, `+`, and `-` filter patterns applied to both those paths and auto-discovered resources in the same scope:
81
+
82
+ - Patterns expand `~` to your home directory (for example `"!~/skills/legacy-*"` or `"-~/skills/legacy"`).
83
+ - Toggle built-in extensions (`builtin:codemode`, `builtin:tool-search`, `builtin:llama.cpp`) in the top-level `extensions` array with `"-builtin:<name>"` or `"+builtin:<name>"`.
40
84
  - Package [subagents](/packages/authoring#subagents) have no top-level settings array. Filter them per package with `agents` (matching paths relative to the package root).
41
85
  - `mcpServers` matches server names from the manifest rather than file paths.
42
86
 
43
87
  ## Scope and deduplication
44
88
 
45
- - **Project overrides global.** When the same package appears in both global and project settings, the project entry wins.
46
- - **Adjusting without autoloading.** Set `"autoload": false` on a project entry to filter inherited global resources without discovering new ones.
89
+ - **Project overrides global.** When the same package appears in both global and project settings, the project entry wins (unless `"autoload": false` is set on the project entry to adjust the inherited global selection).
90
+ - **Listing packages.** `atomic list` displays `User packages` and `Project packages` separately and marks object-form entries with `(filtered)`.
91
+ - **Package identity.** Atomic deduplicates packages by npm package name (`npm`), normalized repository URL without `@ref` (`git`), or resolved canonical path (`local`, so `./pkg` and `/abs/path/to/pkg` match as the same package).
47
92
  - **Subagent collisions.** When multiple packages define the same full subagent name, `-e` packages take precedence over project-installed packages, which take precedence over globally installed packages.
48
- - **Package identity.** Atomic matches packages by npm package name (`npm`), repository URL without `@ref` (`git`), or resolved absolute path (`local`).
93
+
94
+ ### Resource precedence order
95
+
96
+ When multiple sources declare a skill, prompt template, or theme with the same name, Atomic keeps the first match in this order:
97
+
98
+ 1. Packages passed with `-e` / `--extension`
99
+ 2. Project `settings.json` top-level resource arrays (`skills`, `prompts`, `themes`)
100
+ 3. Project auto-discovered directories (`.atomic/`, then legacy `.pi/`, plus `.agents/skills/` for skills)
101
+ 4. Global `settings.json` top-level resource arrays
102
+ 5. Global auto-discovered directories (`~/.atomic/agent/`, then legacy `~/.pi/agent/`, plus `~/.agents/skills/` for skills)
103
+ 6. Configured packages (project packages, then global packages)
104
+ 7. Bundled packages (`@bastani/subagents`, `@bastani/intercom`)
105
+ 8. Explicit CLI flags (`--skill`, `--prompt-template`, `--theme`)
106
+
107
+ For prompt templates, an inherited legacy `.pi` template yields to a bundled template with the same name. For extensions, `-e` flags load before configured and auto-discovered extensions.
package/docs/packages.md CHANGED
@@ -1,18 +1,15 @@
1
1
  ---
2
- title: "Atomic packages"
3
- description: "Install, manage, and share Atomic packages that bundle extensions, skills, subagents, prompt templates, themes, MCP servers, and storage adapters."
2
+ title: "Install and manage packages"
3
+ sidebarTitle: "Atomic packages"
4
+ description: "Install, update, remove, and configure Atomic packages from npm, git, or local directories."
4
5
  ---
5
6
 
6
- # Atomic packages
7
-
8
7
  Atomic packages bundle extensions, skills, [subagents](/packages/authoring#subagents), prompt templates, themes, MCP servers, and [storage adapters](/storage#adapters-from-atomic-packages) for distribution over npm, git, or local paths. Declare resources under the `atomic` key in `package.json`, or use convention directories.
9
8
 
10
9
  ## Where to go next
11
10
 
12
- - [Creating packages](/packages/authoring). Configure the package manifest, subagents, MCP servers, storage adapters, directory structure, and dependencies.
13
- - [Package reference](/packages/reference). Review per-package filtering, scope precedence, and deduplication rules.
14
-
15
- <a id="table-of-contents" />
11
+ - [Create and publish packages](/packages/authoring). Configure the package manifest, subagents, MCP servers, storage adapters, directory structure, and dependencies.
12
+ - [Package reference](/packages/reference). Review pattern matching, `autoload: false` overrides, resource precedence, and deduplication rules.
16
13
 
17
14
  ## Install and manage
18
15
 
@@ -24,24 +21,28 @@ atomic install git:github.com/user/repo@v1
24
21
  atomic install https://github.com/user/repo # Raw URLs work too
25
22
  atomic install /absolute/path/to/package
26
23
  atomic install ./relative/path/to/package
24
+ atomic install -l npm:@foo/bar # Install into project settings (--local)
27
25
 
28
26
  atomic remove npm:@foo/bar # Alias: atomic uninstall
29
27
  atomic list # Show packages configured in settings
30
28
  atomic update # Update Atomic CLI only
31
29
  atomic update --all # Update Atomic + packages + reconcile git refs
32
30
  atomic update --extensions # Update packages + reconcile git refs only
33
- atomic update --models # Force-refresh authenticated model catalogs
34
- atomic update --self # Update Atomic CLI only
31
+ atomic update --models # Force-refresh authenticated model catalogs (15s timeout)
32
+ atomic update --self # Update Atomic CLI only (also: atomic update self | atomic)
35
33
  atomic update --self --force # Reinstall Atomic even if current
34
+ atomic update --self --extensions # Same as atomic update --all
36
35
  atomic update npm:@foo/bar # Update one package (or --extension <src>)
37
36
  ```
38
37
 
39
- Install and update behavior:
38
+ Install, trust, and update behavior:
40
39
 
41
- - **Global and project scope.** `install` and `remove` edit `~/.atomic/agent/settings.json` by default. Pass `-l` to write to `.atomic/settings.json` (legacy `.pi/settings.json` is also read). Missing project packages install automatically on startup once the project is trusted.
40
+ - **Global and project scope.** `install` and `remove` edit `~/.atomic/agent/settings.json` by default. Pass `-l` or `--local` to write to `.atomic/settings.json` (legacy `.pi/settings.json` is also read). Missing project packages install automatically on startup once you trust the project.
41
+ - **Project trust gate.** In an untrusted project, `atomic install -l` and `atomic remove -l` exit with code 1 (`Project is not trusted. Use --approve to modify local package config.`) unless you trust the project first or pass `-a` / `--approve`. Both `-a` / `--approve` and `-na` / `--no-approve` are accepted on `install`, `remove`, `update`, `list`, and `config`.
42
42
  - **Update output.** Atomic lists each updated npm version or git commit (for example `npm:@foo/bar 1.2.0 -> 1.3.0`), prints `Packages are already up to date` when nothing changed, prints warnings when no package upgraded, and reports skipped updates in offline mode.
43
- - **Self-update safety.** Atomic installs the exact advertised version (showing any release note first) and only modifies installations managed and writable by the detected global package manager. Otherwise it prints the manual command. To uninstall Atomic itself, see [Uninstall](/getting-started/installation#uninstall).
44
- - **Resilience and concurrency.** Startup install failures (such as offline registries) warn with the `atomic remove` command, skip that package's resources, and retry on the next start or `/reload` (`atomic install` and `atomic update --extensions` still exit non-zero). Concurrent installs serialize per package, interrupted git clones re-clone on retry, and `atomic remove` also cleans orphaned directories.
43
+ - **Offline mode.** Pass `--offline` or set `ATOMIC_OFFLINE=1` to skip automatic startup installs and package updates.
44
+ - **Self-update safety.** Atomic installs the exact advertised version (showing any release note first) and only modifies installations managed and writable by the detected global package manager. On Windows, automatic self-update supports `npm` and `pnpm` installs only unless you override the command. Override auto-detection with `selfUpdateCommand` in global `settings.json` or the `ATOMIC_SELF_UPDATE_COMMAND` environment variable; otherwise Atomic prints the manual update command. To uninstall Atomic itself, see [Uninstall](/getting-started/installation#uninstall).
45
+ - **Resilience and concurrency.** Startup install failures (such as offline registries) warn with the `atomic remove` command, skip that package's resources, and retry on the next start or `/reload` (`atomic install` and `atomic update --extensions` still exit non-zero). Concurrent installs serialize per package, interrupted git clones re-clone on retry, and `atomic remove` cleans up orphaned package directories.
45
46
 
46
47
  Try a package for one run with `-e` or `--extension`:
47
48
 
@@ -50,7 +51,7 @@ atomic -e npm:@foo/bar
50
51
  atomic -e git:github.com/user/repo
51
52
  ```
52
53
 
53
- `-e` installs into a private user-owned cache (`$XDG_RUNTIME_DIR/atomic/extensions`, else `<agentDir>/cache/tmp/extensions`, else `<tmpdir>/atomic-<uid>/extensions`; symlinks or shared or other-owned directories are refused). Unpinned npm specs and non-commit git refs refresh on start and `/reload` (falling back to cache offline or on error). Exact `@1.2.3` npm pins and checked-out git commit hashes are not re-fetched. Local `-e <dir>` paths can also load `<dir>/.atomic`, `<dir>/.pi`, and `<dir>/.agents/skills` after resolving trust for that directory.
54
+ `-e` installs into a private user-owned cache (`$XDG_RUNTIME_DIR/atomic/extensions`, else `<agentDir>/cache/tmp/extensions`, else `<tmpdir>/atomic-<uid>/extensions`; symlinks and shared or other-owned directories are refused). Unpinned npm specs and branch or tag git refs refresh on start and `/reload` (falling back to cache offline or on error). Exact `@1.2.3` npm pins and checked-out git commit hashes (7 to 64 hex characters matching `HEAD`) skip network refresh. Local `-e <dir>` paths can also load `<dir>/.atomic`, `<dir>/.pi`, and `<dir>/.agents/skills` after resolving trust for that directory.
54
55
 
55
56
  ## Package sources
56
57
 
@@ -58,12 +59,14 @@ atomic -e git:github.com/user/repo
58
59
 
59
60
  ```text
60
61
  npm:@scope/pkg@1.2.3
62
+ npm:@scope/pkg@^1.2.0
63
+ npm:pkg@next
61
64
  npm:pkg
62
65
  ```
63
66
 
64
- - Pinned versions (`@1.2.3`) are skipped by `atomic update --extensions` and `--all`.
65
- - Global installs use your npm command. Project installs (`-l`) install under `.atomic/npm/` (legacy `.pi/npm/` fallback).
66
- - Override the npm executable with `npmCommand` in `settings.json` when using version managers such as `mise` or `asdf`:
67
+ - **Install locations.** Global npm packages install under `~/.atomic/agent/npm/` (a dedicated directory managed by Atomic, not your system global `npm -g` root). Atomic falls back to reading your system global `npm`, `pnpm`, or `bun` root only for legacy global installs already present there. Project installs (`-l` / `--local`) install under `.atomic/npm/` (legacy `.pi/npm/` fallback).
68
+ - **Pinning and ranges.** Exact semver versions (`npm:pkg@1.2.3`) are pinned and skipped by `atomic update --extensions` and `--all`. Semver ranges (`^1.2.3`, `~1.2.3`) and dist-tags (`@next`) update within that range or tag when you run `atomic update --extensions` or `--all`.
69
+ - **Custom package manager.** Override the npm executable with `npmCommand` in `settings.json` when using `pnpm`, `bun`, or version managers such as `mise` or `asdf`. Atomic detects `npm`, `pnpm`, and `bun` even inside wrapper commands and passes manager-specific flags to avoid unwanted peer-dependency installs (`--legacy-peer-deps` for npm, `--omit=peer` for bun, `--config.auto-install-peers=false` for pnpm):
67
70
 
68
71
  ```json
69
72
  {
@@ -75,15 +78,16 @@ npm:pkg
75
78
 
76
79
  ```text
77
80
  git:github.com/user/repo@v1
78
- git:git@github.com:user/repo@v1
81
+ git:git@github.com:user/repo@main
79
82
  https://github.com/user/repo@v1
80
83
  ssh://git@github.com/user/repo@v1
81
84
  ```
82
85
 
83
86
  - Bare protocol URLs (`https://`, `http://`, `ssh://`, `git://`) work directly. Shorthand (`github.com/user/repo`, `git@github.com:user/repo`) requires the `git:` prefix.
87
+ - Repository paths must include at least two path segments (`owner/repo`). Single-segment paths, path traversal (`..`, `.`), backslashes, and null bytes are rejected.
84
88
  - SSH uses your configured keys and `~/.ssh/config`. For CI or non-interactive use, set `GIT_TERMINAL_PROMPT=0` and `GIT_SSH_COMMAND="ssh -o BatchMode=yes -o ConnectTimeout=5"`.
85
89
  - Repositories clone to `~/.atomic/agent/git/<host>/<path>` (global) or `.atomic/git/<host>/<path>` (project; legacy `.pi/git/` fallback).
86
- - `@ref` pins a tag or commit. `atomic update --extensions` and `--all` reconcile the clone to that ref (resetting, cleaning, and re-running `npm install` if `package.json` exists) without advancing it. Move a pin with `atomic install git:host/user/repo@new-ref`.
90
+ - `@ref` accepts a branch name, tag, or commit hash. Running `atomic update --extensions` or `--all` fetches that ref (`git fetch origin -- <ref>`) and resets hard to `FETCH_HEAD`: branch refs advance to new commits on that branch, while tags and commit hashes reconcile to their exact target. Whenever the checked-out commit changes, Atomic runs `git clean -fdx` (removing untracked files in the clone) and installs production dependencies if `package.json` exists. Change a pin with `atomic install git:host/user/repo@new-ref`.
87
91
 
88
92
  ```bash
89
93
  atomic install git:git@github.com:user/repo
@@ -98,27 +102,21 @@ atomic install git:git@github.com/user/repo@v1.0.0
98
102
  ./relative/path/to/package
99
103
  ```
100
104
 
101
- Local paths are added to settings in place without copying (relative paths resolve from the settings file). A file loads as a single extension; a directory loads as a package.
105
+ Local paths are referenced in place without copying. When you run `atomic install /absolute/path/to/package`, Atomic stores the path in `settings.json` relative to the settings directory (`~/.atomic/agent` or `.atomic`). A file loads as a single extension; a directory loads as a package.
106
+
107
+ Running `atomic remove <local-path>` deletes only the entry from `settings.json` and never deletes files from your local directory.
102
108
 
103
109
  ## Enable and disable resources
104
110
 
105
111
  Run `atomic config` to toggle extensions, skills, prompt templates, and themes interactively:
106
112
 
107
113
  - Opens global settings (`~/.atomic/agent/settings.json`). Press `Tab` to switch between global and project scope.
108
- - Run `atomic config -l` to open project overrides (`.atomic/settings.json`) with inherited global entries dimmed.
114
+ - Run `atomic config -l` (or `--local`) to open project overrides (`.atomic/settings.json`) with inherited global entries dimmed.
109
115
  - Package subagents do not appear in `atomic config`. Filter them per package with `agents` in settings ([Package filtering](/packages/reference#package-filtering)).
110
- - Toggle built-in inline extensions (`llama.cpp`, `codemode`, `tool-search`) using `builtin:<name>` entries rather than filesystem paths ([Built-in extension resources](/extensions#built-in-extension-resources)).
111
- - If an interactive session crashes with an uncaught error whose stack crosses a loaded extension, Atomic names the extension in the exit output and suggests `atomic config` or `atomic -ne` to isolate it.
112
-
113
- <a id="creating-an-atomic-package" />
114
- <a id="gallery-metadata" />
115
- <a id="package-structure" />
116
- <a id="convention-directories" />
117
- <a id="dependencies" />
118
- <a id="package-filtering" />
119
- <a id="scope-and-deduplication" />
116
+ - Toggle built-in extensions (`llama.cpp`, `codemode`, `tool-search`) using `builtin:<name>` entries rather than filesystem paths ([Built-in extension resources](/extensions#built-in-extension-resources)).
117
+ - If an interactive session crashes with an uncaught error whose stack crosses a loaded extension, Atomic names the extension in the exit output and suggests `atomic config` or `atomic -ne` to narrow down the cause.
120
118
 
121
119
  ## Authoring and reference
122
120
 
123
- - [Creating an Atomic package](/packages/authoring#creating-an-atomic-package). Review manifest fields, [subagents](/packages/authoring#subagents), [MCP servers](/packages/authoring#mcp-servers), [storage adapters](/packages/authoring#storage-adapters), [gallery metadata](/packages/authoring#gallery-metadata), [convention directories](/packages/authoring#convention-directories), and [dependencies](/packages/authoring#dependencies).
121
+ - [Create and publish packages](/packages/authoring#creating-an-atomic-package). Review manifest fields, [subagents](/packages/authoring#subagents), [MCP servers](/packages/authoring#mcp-servers), [storage adapters](/packages/authoring#storage-adapters), [gallery metadata](/packages/authoring#gallery-metadata), [convention directories](/packages/authoring#convention-directories), and [dependencies](/packages/authoring#dependencies).
124
122
  - [Package reference](/packages/reference). Review [package filtering](/packages/reference#package-filtering) and [scope and deduplication](/packages/reference#scope-and-deduplication).
@@ -1,32 +1,33 @@
1
1
  ---
2
- title: Programmatic use
3
- description: Choose between JSON event stream mode, RPC mode, the SDK, and the TUI component APIs, then follow one minimal integration.
2
+ title: "Programmatic integration"
3
+ sidebarTitle: "Overview"
4
+ description: "Choose between JSON event stream mode, RPC mode, the TypeScript SDK, and TUI component APIs, then follow a minimal integration."
4
5
  ---
5
6
 
6
- # Programmatic use
7
+ Atomic provides three programmatic integration modes plus a component API for interactive extension interfaces. Choose the smallest mode that fits your integration, run its minimal example, and continue to its reference.
7
8
 
8
- Atomic exposes three integration modes plus a component API for interactive extension interfaces. Pick one mode, complete its minimal example, then continue to its reference.
9
+ ## Choose an integration mode
9
10
 
10
- ## Choose a mode
11
-
12
- | You want | Use | Start at |
11
+ | Goal | Mode | Entry point |
13
12
  | --- | --- | --- |
14
- | A one-shot run whose output you parse as structured events | [JSON event stream mode](/json) | `atomic --mode json` |
15
- | A long-lived process you drive with commands and read events from | [RPC mode](/rpc) | `atomic --mode rpc` |
16
- | Atomic embedded inside a Node.js application, with its resources and lifecycle in-process | [SDK](/sdk) | `@bastani/atomic` |
13
+ | Run one or more prompts and parse structured output as JSON lines | [JSON event stream](/json) | `atomic --mode json` |
14
+ | Drive a long-lived process with commands, interrupts, and extension UI prompts | [RPC mode](/rpc) | `atomic --mode rpc` |
15
+ | Embed Atomic directly inside a Node.js application (Node.js 22.19+) | [TypeScript SDK](/sdk) | `@bastani/atomic` |
17
16
 
18
- - JSON mode runs one process with one prompt, streams newline-delimited events, then exits.
19
- - RPC mode keeps the process alive so you can send more input, interrupt, switch models, and answer extension UI dialogs and OAuth prompts (see [RPC extension UI protocol](/rpc/extension-ui)).
20
- - The SDK provides the same engine as a library, with programmatic control over extensions, skills, tools, and session storage.
17
+ - **JSON event stream** executes one or more positional prompts in sequence, writes newline-delimited session events to stdout, and exits.
18
+ - **RPC mode** keeps an Atomic subprocess running over stdin/stdout JSON Lines so you can send follow-up prompts, steer or abort turns, switch models, and answer extension dialogs and OAuth prompts.
19
+ - **TypeScript SDK** runs the same agent runtime as a library inside your Node.js application, with direct control over extensions, skills, tools, models, workspaces, and session storage.
21
20
 
22
- ## Then continue to the contracts
21
+ ## Protocol and API references
23
22
 
24
- - [RPC protocol](/rpc/protocol): every command, event, and type.
25
- - [RPC extension UI protocol](/rpc/extension-ui): drive extension-rendered UI and OAuth prompts over RPC.
26
- - [RPC client examples](/rpc/examples): additional client implementations.
27
- - [SDK API reference](/sdk/reference): options, loaders, return values, run modes, and exports.
23
+ - [RPC protocol reference](/rpc/protocol): every RPC command, streamed event, error shape, and JSON type.
24
+ - [RPC extension UI protocol](/rpc/extension-ui): handle extension dialogs, widgets, questionnaires, and OAuth flows over RPC.
25
+ - [RPC client examples](/rpc/examples): connect with the typed `RpcClient` or a standalone Node.js script.
26
+ - [SDK API reference](/sdk/reference): complete session options, loaders, tool status, task supervision, run modes, and exports.
27
+ - [Structured decisions API](/sdk/structured-decisions): run typed classifier or chat decisions with `decide()` and `generateStructuredOutput()`.
28
+ - [Embed Atomic in a web server](/sdk/web-server): build a streaming HTTP API with Next.js App Router and `createAgentSession()`.
28
29
 
29
- ## Build interactive interfaces and use standalone libraries
30
+ ## Terminal UI and standalone libraries
30
31
 
31
- - [TUI components](/tui) covers writing a first component and common interaction patterns. [TUI API reference](/tui/reference) holds the component, focusable, input, and rendering contracts.
32
- - [Libraries](/libraries) documents the standalone `@bastani/atomic-*` packages (`ai`, `agent-core`, `tui`, `codemode`, `schema`, and `telemetry`).
32
+ - [Build TUI components](/tui) walks through custom interactive components and common patterns, and [TUI API reference](/tui/reference) documents the component, focus, input, and rendering contracts.
33
+ - [Standalone libraries](/libraries) covers the six `@bastani/atomic-*` packages (`ai`, `agent-core`, `tui`, `codemode`, `schema`, and `telemetry`) that you can install independently of the CLI.