@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
@@ -1,33 +1,80 @@
1
1
  ---
2
- title: Custom subagents
3
- description: Define, scope, and configure your own subagents.
2
+ title: "Create custom subagents"
3
+ sidebarTitle: "Custom subagents"
4
+ description: "Define custom Markdown subagents, configure YAML frontmatter fields, and override or disable built-in agents."
4
5
  ---
5
6
 
6
- # Custom subagents
7
+ Define a custom subagent as a Markdown file with YAML frontmatter and a self-contained system prompt body. Run `/reload` after adding or editing files on disk so Atomic picks up your changes.
7
8
 
8
- ## Custom agents
9
+ Looking for another subagents page? Start with [Subagents overview](/guides/subagents) for concepts, [Run subagents](/subagents) for launching, worktrees, and run control, [Subagent reference](/subagents/reference) for precedence and `config.json`, or [Subagent children in the SDK](/sdk#subagent-children) for programmatic setup.
9
10
 
10
- Define a custom agent as a Markdown file with YAML frontmatter and a self-contained system prompt body.
11
+ ## Where agent files live {#custom-agents}
11
12
 
12
- Atomic discovers agents in the scopes below. Later scopes and later directories inside a scope override earlier ones on matching names. See [Agent discovery](/subagents/reference#agent-discovery) for the full rules.
13
+ Atomic discovers `.md` files recursively (`**/*.md`, following symlinks and sorted lexicographically) across four scopes. Later scopes and later directories inside a scope override earlier ones on matching names. Project scopes resolve from the nearest ancestor directory containing `.atomic/`, `.pi/`, or `.agents/` (not necessarily the Git root). See [Agent discovery](/subagents/reference#agent-discovery) for complete rules.
13
14
 
14
15
  | Scope | Locations (increasing precedence) |
15
16
  | --- | --- |
16
17
  | Package | `agents` field in an installed package, qualified as `<namespace>.<name>` ([package subagents](/packages/authoring#subagents)) |
17
18
  | Builtin | Bundled with Atomic |
18
- | User | `~/.pi/agent/agents/**/*.md` (omitted when `ATOMIC_CODING_AGENT_DIR` is set), then `~/.agents/**/*.md`, then `~/.atomic/agent/agents/**/*.md` (or `<ATOMIC_CODING_AGENT_DIR>/agents/**/*.md`) |
19
+ | User | `~/.pi/agent/agents/**/*.md` (omitted when `ATOMIC_CODING_AGENT_DIR` or legacy `PI_CODING_AGENT_DIR` is set), then `~/.agents/**/*.md`, then `~/.atomic/agent/agents/**/*.md` (or `<ATOMIC_CODING_AGENT_DIR>/agents/**/*.md`) |
19
20
  | Project (trusted only) | Nearest ancestor project root: `.agents/**/*.md`, then `.pi/agents/**/*.md`, then `.atomic/agents/**/*.md` |
20
21
 
21
- Example read-only inspection agent (`.atomic/agents/strict-inspector.md`):
22
+ ## Frontmatter reference
23
+
24
+ | Field | Required | Type / format | Default | Behavior |
25
+ | --- | --- | --- | --- | --- |
26
+ | `name` | Yes | Plain string | None | Agent identifier. Files missing `name` (or setting it to a YAML list) are skipped. Sanitized to `[a-z0-9-]` when created via the `subagent` tool. Package agents cannot contain `.`. |
27
+ | `description` | Yes | Plain string | None | Short summary shown in `/agents` and `subagent({ action: "list" })`. Files missing `description` (or setting it to a YAML list) are skipped. |
28
+ | `package` | No | Namespace string (`a-z`, `0-9`, `-`, `.`) | None | Optional namespace for user or project agents. The runtime name becomes `<package>.<name>` (used to override an installed package agent). Ignored inside installed packages where the manifest sets the namespace. |
29
+ | `model` | No | `"auto"`, `provider/id`, `provider/id:effort`, or bare `id` | Inherit | Selects the agent's primary model. `"auto"` uses your default model (`/model`) or the launching session's model. Omitting both `model` and `fallbackModels` inherits the launching session's model and thinking level. Effort suffixes are case-insensitive. |
30
+ | `fallbackModels` | No | Comma-separated string or YAML list | None | Ordered fallback models tried on retryable provider errors, with optional `:effort` suffixes (for example `[openai/gpt-5:medium, anthropic/claude-haiku-4-5:off]`). |
31
+ | `tools` | No | Comma-separated string or YAML list | Inherit | Restricts the subagent to named tools. Supports built-in tools plus `mcp:<server>` and `mcp:<server>/<tool>`. Omitting `tools` inherits tools from the launching session. |
32
+ | `defaultContext` | No | `"fresh"` or `"fork"` | `"fresh"` | Whether the subagent starts clean or forks the main conversation when `context` is omitted at launch. |
33
+ | `systemPromptMode` | No | `"replace"` or `"append"` | `"replace"` (`"append"` for `delegate`) | Whether the Markdown body replaces or appends to the base system prompt. |
34
+ | `inheritProjectContext` | No | Boolean | `false` (`true` for `delegate`) | Include `AGENTS.md` project context files in a `fresh` subagent. Has no effect on `fork`. |
35
+ | `inheritSkills` | No | Boolean | `false` | Include active skills from the launching session in a `fresh` subagent. Has no effect on `fork`. |
36
+ | `skills` (or `skill`) | No | Comma-separated string or YAML list | None | Named skills injected into the subagent. If both `skill` and `skills` appear, `skill` takes precedence. |
37
+ | `extensions` | No | Comma-separated string or YAML list | Inherit | Restricts loaded extensions by name. Set `extensions: ""` or `extensions: []` to disable extensions; omit to inherit. |
38
+ | `output` | No | File path string | None | Default output file path for results, resolved relative to the subagent's `cwd`. |
39
+ | `defaultReads` | No | Comma-separated string or YAML list | None | Files automatically prepended into context before the task runs, resolved relative to the subagent's `cwd`. |
40
+ | `defaultProgress` | No | Boolean | `false` | Enables run-scoped `progress.md` tracking in isolated artifact storage (suppressed for read-only tasks unless `progress: true` is passed at launch). |
41
+ | `interactive` | No | Boolean | `false` | Accepted in frontmatter and preserved when updating an agent through the `subagent` tool. |
42
+ | `thinking` | No | Thinking level string | None | Deprecated. Use `:effort` on `model` instead; applies only when `model` has no suffix. |
43
+ | `fallbackThinkingLevels` | No | Comma-separated string or YAML list | None | Deprecated. Index-aligned thinking levels for `fallbackModels`; prefer `:effort` suffixes directly on `fallbackModels`. |
44
+
45
+ <Warning>
46
+ When you omit `context` on a parallel `tasks` launch, if **any** requested agent declares `defaultContext: fork`, the **entire batch** runs in forked context. Keep `defaultContext: fresh` on review and research agents unless you want forked history.
47
+ </Warning>
48
+
49
+ ### YAML syntax rules
50
+
51
+ Frontmatter is parsed by a strict YAML parser, not a loose line reader:
52
+
53
+ - **Quote colons followed by a space.** Write `description: "Deploy: verify staging first"` instead of `description: Deploy: verify staging first`. Invalid YAML (unquoted `: `, duplicate keys, unclosed brackets, or tab-indented lists) skips the entire agent file and records a load diagnostic.
54
+ - **Lists or comma-separated strings.** `tools`, `fallbackModels`, `fallbackThinkingLevels`, `skills`/`skill`, `defaultReads`, and `extensions` accept comma-separated strings (`read, search, bash`), YAML flow lists (`[read, search, bash]`), and YAML block lists.
55
+ - **Extra keys.** Nested YAML objects are ignored. Unknown scalar or string-array fields are preserved across tool-based updates (legacy `completionGuard` is stripped automatically).
56
+
57
+ ## Example custom agent
58
+
59
+ Save a read-only inspection agent at `.atomic/agents/strict-inspector.md`:
22
60
 
23
61
  ```markdown
24
62
  ---
25
63
  name: strict-inspector
26
64
  description: Inspect code for correctness and regressions
27
- tools: read, search, bash
65
+ tools:
66
+ - read
67
+ - search
68
+ - bash
69
+ - mcp:issue-tracker/get_issue
28
70
  model: anthropic/claude-sonnet-4-6:high
29
- fallbackModels: openai/gpt-5-mini:medium
71
+ fallbackModels:
72
+ - openai/gpt-5-mini:medium
73
+ - anthropic/claude-haiku-4-5:off
74
+ skills:
75
+ - tdd
30
76
  inheritProjectContext: true
77
+ defaultContext: fresh
31
78
  ---
32
79
 
33
80
  ## Role and goal
@@ -40,10 +87,96 @@ Cite each actionable issue with file:line evidence and the observed failure or r
40
87
  Return only issues worth fixing now. Stop when the relevant diff and affected call paths have been inspected, or name the evidence you could not access.
41
88
  ```
42
89
 
43
- Tips for writing agent prompts:
90
+ ## Tool and MCP allowlists
44
91
 
45
- - Lead with the role, goal, and observable success criteria.
46
- - Specify constraints, tool rules, output shape, and an explicit stop rule.
47
- - Reserve strict wording for true invariants. Ask for evidence and conclusions instead of private reasoning or repeated self-checks.
92
+ - **Built-in tools.** List tool names such as `read`, `search`, `find`, `ls`, `edit`, `write`, `bash`, `todo`, `web_search`, `fetch_content`, or `intercom`.
93
+ - **MCP tools.** Use `mcp:<server>` to allow every tool exposed by that MCP server, or `mcp:<server>/<tool>` to allow a single tool.
94
+ - **Parent restrictions still apply.** An agent's `tools` list can narrow what the subagent may use, but it cannot re-enable tools or packages excluded by the launching session.
95
+ - **Automatic Intercom tools.** By default (`intercomBridge.mode: "always"` in `config.json`), Atomic automatically adds `intercom` and `contact_supervisor` to every subagent whose launching session has Intercom active, even if the agent's `tools` list omits them.
96
+
97
+ ## Managing agents with the `subagent` tool
98
+
99
+ You can inspect and manage user and project agents without editing Markdown files manually:
100
+
101
+ ```ts
102
+ // List active agents (deduplicated across user/project/builtin/package scopes)
103
+ subagent({ action: "list" })
104
+
105
+ // Inspect one agent definition
106
+ subagent({ action: "get", agent: "strict-inspector" })
107
+
108
+ // Create a project-scoped agent
109
+ subagent({
110
+ action: "create",
111
+ config: {
112
+ name: "strict-inspector",
113
+ description: "Inspect diffs for regressions without editing",
114
+ scope: "project",
115
+ model: "auto",
116
+ tools: "read, search, bash",
117
+ systemPrompt: "Inspect the diff and return file:line evidence.",
118
+ },
119
+ })
48
120
 
49
- To run an agent on your default model, set `model: auto`. Atomic uses the model you last chose with `/model` at the agent's `thinking` level or the default thinking level, falling back to the launching session's model if no default is set. A per-call `model` argument always overrides `auto`. See [Automatic model selection](/subagents/reference#automatic-model-selection).
121
+ // Update an existing agent (pass false or "" to clear an optional field)
122
+ subagent({
123
+ action: "update",
124
+ agent: "strict-inspector",
125
+ agentScope: "project",
126
+ config: { model: "anthropic/claude-sonnet-4-6:high", output: false },
127
+ })
128
+
129
+ // Delete a user or project agent
130
+ subagent({ action: "delete", agent: "strict-inspector", agentScope: "project" })
131
+ ```
132
+
133
+ Key management rules:
134
+
135
+ - **`scope` default.** `create` defaults `scope` to `"user"`. Pass `scope: "project"` to write into `.atomic/agents/`.
136
+ - **Disambiguation.** If an agent exists in both user and project scopes, pass `agentScope: "user"` or `"project"` to `update` or `delete`. User-scope directories deduplicate in the same precedence order as execution (`~/.atomic/agent/agents` > `~/.agents` > `~/.pi/agent/agents`).
137
+ - **Overriding a package agent.** Pass `package` separately in `config` (for example `{ name: "reviewer", package: "acme.review-kit", ... }`). Putting dots inside `config.name` strips them during name sanitization.
138
+ - **Built-in and package agents.** `update` and `delete` refuse built-in and package agents. Override built-ins via `settings.json` or by creating a user or project Markdown file with the same name.
139
+
140
+ ## Overriding or disabling built-in agents
141
+
142
+ Override or disable bundled agents in user (`~/.atomic/agent/settings.json`) or trusted project (`.atomic/settings.json`) settings without copying their Markdown files. Project settings override user settings.
143
+
144
+ ```json
145
+ {
146
+ "subagents": {
147
+ "disableBuiltins": false,
148
+ "agentOverrides": {
149
+ "worker": {
150
+ "model": "anthropic/claude-sonnet-4-6:high",
151
+ "fallbackModels": ["openai/gpt-5:medium"],
152
+ "defaultContext": "fresh"
153
+ },
154
+ "code-simplifier": {
155
+ "disabled": true
156
+ }
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
162
+ - **`subagents.disableBuiltins`.** Set to `true` to disable all bundled agents. A trusted project setting `disableBuiltins: false` or per-agent overrides still apply on top.
163
+ - **`subagents.agentOverrides.<name>`.** Supports 12 fields:
164
+ - `model` (string)
165
+ - `fallbackModels` (string array, or `false` to clear)
166
+ - `fallbackThinkingLevels` (deprecated string array, or `false` to clear)
167
+ - `thinking` (deprecated string, or `""`/`false` to clear an inherited thinking level)
168
+ - `systemPromptMode` (`"replace"` or `"append"`)
169
+ - `inheritProjectContext` (boolean)
170
+ - `inheritSkills` (boolean)
171
+ - `defaultContext` (`"fresh"`, `"fork"`, or `false` to clear)
172
+ - `disabled` (boolean)
173
+ - `systemPrompt` (string)
174
+ - `skills` (string array, or `false` to clear)
175
+ - `tools` (string array supporting `mcp:<server>` and `mcp:<server>/<tool>`, or `false` to clear)
176
+
177
+ ## Writing effective agent prompts
178
+
179
+ - Lead with the role, goal, and observable success criteria.
180
+ - Specify edit permissions, tool rules, output shape, and an explicit stop rule.
181
+ - Reserve strict wording for true invariants. Ask for evidence and conclusions rather than private reasoning or repeated self-checks.
182
+ - Set `model: auto` to run an agent on your default model (`/model`). See [Automatic model selection](/subagents/reference#automatic-model-selection) for the exact resolution chain.
@@ -1,26 +1,27 @@
1
1
  ---
2
- title: Subagent reference
3
- description: Agent discovery, fallback model resolution, and reasoning-level contracts.
2
+ title: "Subagent reference"
3
+ sidebarTitle: "Subagents"
4
+ description: "Discovery precedence, model selection, fallback rules, reasoning levels, configuration keys, and SDK integration."
4
5
  ---
5
6
 
6
- # Subagent reference
7
+ This page is the exact reference for subagent discovery, model resolution, `config.json`, tool parameters, and SDK contracts. For concepts, see [Subagents overview](/guides/subagents). For day-to-day usage, worktrees, and run control, see [Run subagents](/subagents). For writing custom agent files, see [Create custom subagents](/subagents/authoring). For programmatic child configuration, see [Subagent children in the SDK](/sdk#subagent-children).
7
8
 
8
9
  ## Agent discovery
9
10
 
10
- Atomic loads agent definitions from four sources. When two definitions share the same full name, the later source wins:
11
+ Atomic loads agent definitions recursively (`**/*.md`, sorted lexicographically, following symlinks) from four sources. When two definitions share the same full name, the later source wins:
11
12
 
12
- 1. **Package.** Declared through the `agents` field in an installed package's `package.json`, qualified as `<namespace>.<name>` (for example `acme.review-kit.reviewer`). Package agents have the lowest precedence among named definitions and never shadow builtins because builtin names contain no dots. See [package subagents](/packages/authoring#subagents).
13
+ 1. **Package.** Declared through the `agents` field in an installed package's `package.json`, qualified as `<namespace>.<name>` (for example `acme.review-kit.reviewer`). The namespace derives from `package.json` `name` (`@scope/pkg` becomes `scope.pkg`, lowercased and sanitized) or falls back to the package directory name. Package agents have the lowest precedence among named definitions and never shadow builtins because builtin names contain no dots. See [package subagents](/packages/authoring#subagents).
13
14
  2. **Builtin.** Bundled with Atomic under unqualified names without dots.
14
- 3. **User.** Loaded in increasing precedence from `~/.pi/agent/agents/**/*.md` (omitted when `ATOMIC_CODING_AGENT_DIR` is set), then `~/.agents/**/*.md`, then `~/.atomic/agent/agents/**/*.md` (or `<ATOMIC_CODING_AGENT_DIR>/agents/**/*.md`).
15
- 4. **Project.** Loaded only in trusted projects from the nearest ancestor project root, in increasing precedence: `.agents/**/*.md`, then `.pi/agents/**/*.md`, then `.atomic/agents/**/*.md`.
15
+ 3. **User.** Loaded in increasing precedence from `~/.pi/agent/agents/**/*.md` (omitted when `ATOMIC_CODING_AGENT_DIR` or legacy `PI_CODING_AGENT_DIR` is set), then `~/.agents/**/*.md`, then `~/.atomic/agent/agents/**/*.md` (or `<ATOMIC_CODING_AGENT_DIR>/agents/**/*.md`).
16
+ 4. **Project.** Loaded only in trusted projects from the nearest ancestor directory containing `.atomic/`, `.pi/`, or `.agents/` (not necessarily the Git root), in increasing precedence: `.agents/**/*.md`, then `.pi/agents/**/*.md`, then `.atomic/agents/**/*.md`.
16
17
 
17
18
  Precedence and override rules:
18
19
 
19
20
  - **Package collisions.** If multiple packages declare the same full name, the first wins in order: `-e` packages, then project-installed packages, then globally installed packages. Skipped package agents (collisions, dotted `name`, or unusable package name) appear under **Package agents not offered** in `subagent({ action: "list" })`.
20
- - **Overriding a package agent.** Define a user or project agent with the matching full name (for example `name: reviewer` with `package: acme.review-kit`).
21
+ - **Overriding a package agent.** Define a user or project agent with the matching full name (for example `name: reviewer` with `package: acme.review-kit`). When using `subagent({ action: "create" })`, pass `{ name: "reviewer", package: "acme.review-kit", ... }` in `config`; passing `"acme.review-kit.reviewer"` in `config.name` strips the dots during name sanitization.
21
22
  - **Untrusted projects.** Project agents and project-installed package agents are skipped. Packages passed via `-e` still load.
22
- - **Scopes and reload.** `agentScope: "user"` loads user agents plus global and `-e` packages. `agentScope: "project"` loads project agents plus project and `-e` packages. Run `/reload` to pick up changes; running children keep the definition they started with.
23
- - **Inspecting and editing.** `list` labels package agents with their source (`acme.review-kit.reviewer (package npm:@acme/review-kit)`) and omits overridden entries. `get` returns scope details and both definitions when overridden. `/agents` lists them under **Package agents**. `update` and `delete` apply only to user and project agents and refuse package agents. Calling `create` with a package agent's full name creates a user or project override.
23
+ - **Scopes and reload.** `agentScope` defaults to `"both"` (project overrides user, and both override builtin and package). `agentScope: "user"` loads builtins, user agents, and global/`-e` packages. `agentScope: "project"` loads builtins, project agents, and project/`-e` packages. Run `/reload` to pick up disk changes; running subagents keep the definition they started with.
24
+ - **Inspecting and editing.** `list`, `update`, and `delete` deduplicate user agents in the exact same precedence order as execution (`~/.atomic/agent/agents` > `~/.agents` > `~/.pi/agent/agents`). `list` labels package agents with their source (`acme.review-kit.reviewer (package npm:@acme/review-kit)`) and omits overridden entries. `get` returns scope details and both definitions when overridden. `/agents` lists them under **Package agents**. `update` and `delete` apply only to user and project agents and refuse built-in and package agents.
24
25
 
25
26
  ## Automatic model selection
26
27
 
@@ -34,12 +35,13 @@ subagent({
34
35
  });
35
36
  ```
36
37
 
37
- - **Resolution.** `auto` resolves to `defaultProvider` and `defaultModel` from [settings](/settings#model-&-thinking) (the model last picked with `/model`) when credentials exist. It runs at the agent's `thinking` level, then `modelThinkingLevels`, then `defaultThinkingLevel`, then `medium`. If no default model is configured or available, it uses the launching session's model and thinking level unless the agent sets `thinking`. Unsupported levels clamp automatically.
38
- - **Deterministic selection.** No router model runs and task wording does not change selection. An explicit per-call `model` overrides `auto`. Omitting `model` on a custom agent keeps normal inheritance.
39
- - **Fallbacks.** An `auto` child falls back through the agent's `fallbackModels`, then the launching session's model ([Fallback models](#fallback-models)).
38
+ - **Resolution.** `auto` resolves to `defaultProvider` and `defaultModel` from [settings](/settings#models-and-thinking) (the model last picked with `/model`) when credentials exist and the model is allowed by the active model scope. It runs at the agent's `thinking` level (ignoring invalid strings), then `modelThinkingLevels`, then `defaultThinkingLevel`, then `medium`. If no default model is configured or available, it uses the launching session's model (skipped if outside active `enabledModels` scope) and thinking level unless the agent sets `thinking`. Unsupported levels clamp automatically.
39
+ - **Deterministic selection.** No router model runs and task wording does not change selection. An explicit per-call `model` overrides `auto`.
40
+ - **Normal inheritance when `model` is omitted.** If a custom agent omits both `model` and `fallbackModels` and no per-call `model` is passed, it inherits both the launching session's current model and current thinking level. If it declares `fallbackModels` without `model`, it starts from its own first fallback candidate and thinking configuration.
41
+ - **Fallbacks.** An `auto` subagent falls back through the agent's `fallbackModels`, then the launching session's model ([Fallback models](#fallback-models)).
40
42
  - **Legacy fields.** Deprecated `taskNeeds` and `modelConstraints` are ignored and automatically cleaned from saved builtin overrides in global and trusted project settings on startup with a one-time notice.
41
43
 
42
- Override a built-in agent's model or effort persistently in `settings.json`. Set `thinking` to `""` or `false` to clear an inherited effort:
44
+ Override a built-in agent's model, effort, tools, or default context persistently in `settings.json`, or set `subagents.disableBuiltins: true` to disable all bundled agents. Set `thinking` to `""` or `false` to clear an inherited effort (see [Overriding or disabling built-in agents](/subagents/authoring#overriding-or-disabling-built-in-agents) for all 12 override fields):
43
45
 
44
46
  ```json
45
47
  {
@@ -63,19 +65,19 @@ When no concrete model was pinned, the default fallback chain tries:
63
65
  2. Configured `fallbackModels`, in order.
64
66
  3. Current user-selected model, when available.
65
67
 
66
- A child launched with a concrete `model` (via call or agent definition) uses strict pinning. It runs only that model and the agent's own `fallbackModels`, never step 3 or global settings `fallbackModels`.
68
+ A subagent launched with a concrete `model` (via call or agent definition) uses strict pinning. It runs only that model and the agent's own `fallbackModels`, never step 3 or global settings `fallbackModels`.
67
69
 
68
- If none are available or all fail at launch, mid-task, or on unrecoverable context overflow, the child fails and names the model and provider reason. Restored children stay on their active fallback if available, or return to the pinned model. A child whose last turn ends in a model error is always reported as failed.
70
+ If none are available or all fail at launch, mid-task, or on unrecoverable context overflow, the subagent fails and names the model and provider reason. Restored subagents stay on their active fallback if available, or return to the pinned model. A subagent whose last turn ends in a model error is always reported as failed.
69
71
 
70
- When fallback occurs, the child keeps its prompt, role, and tools, and is notified of its new model. The result, completion notice, status, and heartbeat report both models (for example `Model: ran on anthropic/claude-opus-4-8, not the requested openai/gpt-5.5:high.`).
72
+ When fallback occurs, the subagent keeps its prompt, role, and tools, and is notified of its new model. The result, completion notice, status, and heartbeat report both models (for example `Model: ran on anthropic/claude-opus-4-6, not the requested openai/gpt-5.4:high.`).
71
73
 
72
74
  What triggers fallback:
73
75
 
74
76
  - **Retryable provider errors.** Rate limits, quota exhaustion (`The usage limit has been reached`, `usage_limit_reached`, `insufficient_quota`), auth failures, unavailable models, timeouts, and 5xx errors.
75
77
  - **Request-incompatible candidates.** HTTP 400, 413, and 422 payload or parameter errors, unsupported tools, and context-window overflows. Context-window overflow advances to the user-selected model only when not pinned.
76
78
  - **Content-filter refusals.** Advances without retrying the refusing model (OpenAI HTTP 422 `cyber_policy`, Anthropic refusal stop, or `content_filter` finish reason). Set `retry.fallbackOnContentFilter: false` in settings to stay on the refusing model.
77
- - **Credential skipping.** Before starting a concrete-model child, Atomic skips known providers without credentials and still tries unknown or custom providers. If all candidates are skipped, launch fails and names each missing provider. During execution, HTTP 401 or an invalid key disables that provider for the rest of the chain, while model-scoped HTTP 403 blocks only that model.
78
- - **Session model scope (`enabledModels` / `--models` / `/scoped-models`).** When the parent session has a non-empty model scope, `subagent({ action: "models" })`, `model: "auto"`, pre-spawn candidate filtering, and child mid-run fallbacks enforce that allowlist. Candidates outside the scope are skipped with a reason naming `enabledModels`, and explicit launches targeting a disallowed model fail instead of running it. When unset or empty, all available models remain allowed.
79
+ - **Credential skipping.** Before launching a concrete-model subagent, Atomic skips known providers without credentials and still tries unknown or custom providers. If all candidates are skipped, launch fails and names each missing provider. During execution, HTTP 401 or an invalid key disables that provider for the rest of the chain, while model-scoped HTTP 403 blocks only that model.
80
+ - **Session model scope (`enabledModels` / `--models` / `/scoped-models`).** Subagents enforce the launching session's model scope using the exact same matching engine as the main session (`minimatch` `*`/`?`/`[...]` globs, literal bracketed IDs, fuzzy substring matching, case-insensitive `:thinking` suffixes, and Azure compatibility). `subagent({ action: "models" })`, `model: "auto"`, filtering candidates before launch, and mid-run fallbacks all honor that allowlist. Bare model IDs prefer matches inside the active scope before falling back to the full catalog for error reporting. Candidates outside the scope are skipped with a reason naming `enabledModels`, and explicit launches targeting a disallowed model fail instead of running. If `enabledModels` is set to patterns matching zero available models, **all** subagent launches are rejected; only an unset or empty `enabledModels` allows all models.
79
81
 
80
82
  Refused tool calls, ordinary tool or task errors, validation errors, and cancellations never trigger fallback. There is no per-attempt idle watchdog or wall-clock kill cap.
81
83
 
@@ -83,7 +85,7 @@ Refused tool calls, ordinary tool or task errors, validation errors, and cancell
83
85
 
84
86
  ## Reasoning levels
85
87
 
86
- Attach `:effort` directly to `model` and each `fallbackModels` entry. Valid levels are `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max` (`xhigh` and `max` require model support).
88
+ Attach `:effort` directly to `model` and each `fallbackModels` entry. Valid levels are `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max` (`xhigh` and `max` require model support). Suffix matching is case-insensitive (`:HIGH` matches `high`).
87
89
 
88
90
  ```markdown
89
91
  ---
@@ -95,22 +97,96 @@ fallbackModels: openai/gpt-5:medium, anthropic/claude-haiku-4-5:off
95
97
  ---
96
98
  ```
97
99
 
98
- - When a model supports the requested effort, it runs at that exact effort. Otherwise it uses that model's `modelThinkingLevels` entry or `defaultThinkingLevel`.
100
+ - When a model supports the requested effort, it runs at that exact effort. Unsupported levels (such as `xhigh` or `max` on a model supporting only up to `high`) clamp to the model's supported level; when no level is requested, the model's `modelThinkingLevels` entry or `defaultThinkingLevel` applies.
99
101
  - Fallback entries use their own `:effort` suffix if present, or inherit the launch effort without drifting silently. Attempt metadata records the resolved model and effective effort.
102
+ - Explicit `model: provider/id:off` preserves `:off`, whereas the deprecated `thinking: "off"` frontmatter field does not append `:off` automatically.
100
103
 
101
104
  The separate `thinking:` frontmatter field and index-aligned `fallbackThinkingLevels` are deprecated and used only as defaults when an entry has no suffix. Prefer suffixed model strings:
102
105
 
103
106
  ```diff
104
- -model: openai/gpt-5.5
105
- -fallbackModels: anthropic/claude-opus-4-8
107
+ -model: openai/gpt-5.4
108
+ -fallbackModels: anthropic/claude-opus-4-6
106
109
  -thinking: xhigh
107
- +model: openai/gpt-5.5:xhigh
108
- +fallbackModels: anthropic/claude-opus-4-8:xhigh
110
+ +model: openai/gpt-5.4:xhigh
111
+ +fallbackModels: anthropic/claude-opus-4-6:xhigh
109
112
  ```
110
113
 
111
- ## Owner-bound task projection
112
-
113
- SDK host adapters bind task observation to a live session in three steps:
114
+ ## Subagent `config.json` reference {#subagent-config-json-reference}
115
+
116
+ Global subagent runtime configuration lives at `~/.atomic/agent/extensions/subagent/config.json` (falling back to `~/.pi/agent/extensions/subagent/config.json` when the Atomic file is absent). Invalid `resumeInFlight` or `sessionStartTimeoutMs` values drop only that field and log an error while loading the rest; invalid JSON falls back to `{}`.
117
+
118
+ | Key | Default | Description |
119
+ | --- | --- | --- |
120
+ | `parallel.maxTasks` | `1000` | Maximum tasks allowed in one parallel launch (counted after `tasks[].count` expansion). No hard cap. |
121
+ | `parallel.concurrency` | `1000` | Default maximum concurrent tasks per parallel launch. Overridden by per-call `concurrency`. |
122
+ | `parallel.runningCapacity` | `1000` | Maximum simultaneously running subagents across this session (also bounds concurrent released-subagent wakes). Takes effect when the first subagent starts; restart Atomic after changing. |
123
+ | `resumeInFlight` | `"never"` | How startup and `/resume` handle paused or quit subagents awaiting resume: `"never"`, `"ask"` (one confirmation prompt; falls back to `"never"` without a UI), or `"auto"`. |
124
+ | `sessionStartTimeoutMs` | `300000` | Startup budget per attempt in milliseconds (`1` to `2147483647`). Queue wait under `parallel.runningCapacity` does not count. |
125
+ | `defaultSessionDir` | None | Directory where fresh (non-forked) subagents store JSONL session files instead of the launching session's store. |
126
+ | `worktreeSetupHook` | None | Executable script path (absolute, `~/...`, or repo-relative containing `/` or `\`) run after creating each `worktree: true` temporary worktree. Receives JSON metadata on stdin and prints `{ "syntheticPaths": [...] }` on stdout to exclude generated files from diff capture. |
127
+ | `worktreeSetupHookTimeoutMs` | `30000` | Timeout in milliseconds for `worktreeSetupHook`. |
128
+ | `intercomBridge.mode` | `"always"` | Controls automatic injection of `intercom`, `contact_supervisor`, and Intercom orchestration prompt instructions into subagents: `"always"` (all subagents), `"fork-only"` (forked subagents only), or `"off"` (frontmatter tool lists only). |
129
+ | `intercomBridge.instructionFile` | None | Optional custom Markdown file replacing the default Intercom orchestration instructions injected into subagents. |
130
+ | `control.enabled` | `true` | Enable subagent attention and long-running activity tracking. |
131
+ | `control.needsAttentionAfterMs` | `60000` | Milliseconds without observed activity before raising `needs_attention`. |
132
+ | `control.activeNoticeAfterMs` | `240000` | Elapsed milliseconds before raising `active_long_running`. |
133
+ | `control.activeNoticeAfterTurns` | Disabled | Optional turn-count threshold for `active_long_running`. |
134
+ | `control.activeNoticeAfterTokens` | Disabled | Optional total-token threshold for `active_long_running`. |
135
+ | `control.failedToolAttemptsBeforeAttention` | `3` | Consecutive mutating-tool failures before raising `needs_attention`. |
136
+ | `control.notifyOn` | `["active_long_running", "needs_attention"]` | Which control events emit parent notices. |
137
+ | `control.notifyChannels` | `["event", "intercom"]` | Channels used to deliver control notices. |
138
+
139
+ ## Tool parameters and actions
140
+
141
+ | Parameter | Scope | Description |
142
+ | --- | --- | --- |
143
+ | `action` | Management / control | Omit for launch mode. Valid actions: `"list"`, `"get"`, `"create"`, `"update"`, `"delete"`, `"models"`, `"status"`, `"wait"`, `"pause"`, `"resume"`, `"quit"`. Removed actions `"kill"` and `"interrupt"` fail and point to `"quit"`. |
144
+ | `agent` | Single launch or management | Agent name for single-agent launch, or target name for `get`, `update`, and `delete`. |
145
+ | `task` | Single launch | Task prompt (optional in single mode for self-contained agents). |
146
+ | `tasks` | Parallel launch | Array of `{ agent, task, count?, cwd?, worktree?, output?, outputMode?, reads?, progress?, model?, skill?, group?, heartbeatMs? }`. |
147
+ | `id` | Control / inspect | Target for `status`, `wait` (task ID), or `pause`/`resume`/`quit` (child ID `<runId>:<index>`, task ID, Intercom name, or single-child run ID). Prefer `id` over legacy `runId`. |
148
+ | `all` | `pause` / `quit` | Act on every running subagent launched by this session (`quit` also covers paused subagents). Not valid with `resume` or `id`. |
149
+ | `message` | `resume` | Optional prompt delivered once when resuming a subagent. |
150
+ | `budgetMs` | `wait` | Wait duration in milliseconds (`0` polls immediately; omitted uses session default `30000` ms). |
151
+ | `context` | Launch | `"fresh"` or `"fork"`. If omitted and any requested agent has `defaultContext: "fork"`, the entire launch runs forked. |
152
+ | `worktree` | Launch | `true` (parallel mode only: isolated temporary Git worktrees) or `{ branch, base?, path? }` (single or parallel: permanent named worktree). |
153
+ | `concurrency` | Parallel launch | Overrides `parallel.concurrency` for this batch. |
154
+ | `group` | Launch / task | Named Intercom group string, or `true` / `"true"` / `"auto"` for one shared auto-generated UUID group. |
155
+ | `heartbeatMs` | Launch / task | Heartbeat interval in ms (`0` disables; minimum `60000`). Per-task value wins over top-level. |
156
+ | `model` | Single launch / task | Concrete model override (`provider/id[:effort]`) or `"auto"`. |
157
+ | `skill` | Single launch / task | Skill override: comma-separated string, string array, `true` (agent default), or `false` (disable). |
158
+ | `output` / `outputMode` | Single launch / task | `output` file path (or `false`); `outputMode` is `"inline"` (default) or `"file-only"` (requires an `output` path). |
159
+ | `reads` | Single launch / task | Array of file paths prepended relative to child `cwd`, or `false` to disable `defaultReads`. |
160
+ | `progress` / `includeProgress` | Launch / task | `progress` toggles isolated run-scoped `progress.md`; `includeProgress` adds runtime progress telemetry to the tool result. |
161
+ | `cwd`, `sessionDir`, `agentScope`, `artifacts`, `maxOutput`, `control` | Launch | Working directory, fresh-child JSONL directory, discovery scope (`"user" \| "project" \| "both"`, default `"both"`), debug artifacts (`true`), output truncation (`{ bytes?, lines? }`), and per-run `control` overrides. |
162
+
163
+ ## SDK integration and errors
164
+
165
+ For programmatic child inheritance, startup timeout errors, and task supervision in embedded hosts, see [Subagent children in the SDK](/sdk#subagent-children), [Session start errors](/sdk/reference#session-start-errors), and [Owner-bound task supervisor](/sdk/reference#owner-bound-task-supervisor).
166
+
167
+ Import `OwnerTaskStore`, `bindOwnerTaskStore`, `SessionStartError`, and `SessionStartTimeoutError` from `@bastani/atomic`.
168
+
169
+ ### `ReleasedChildError` codes
170
+
171
+ When tracking or waking a [released subagent](/subagents#released-subagents) fails, the built-in subagents extension reports a typed `ReleasedChildError` in `status` output and failure notices. `ReleasedChildError` is not exported as a top-level class from `@bastani/atomic`; inspect its serialized `name` (`"ReleasedChildError"`), `code`, `subject`, `hint`, `retryable`, and `fields` in reported results and notices:
172
+
173
+ | Code | Cause | Action |
174
+ | --- | --- | --- |
175
+ | `child-record-missing` | Current session has no record of this subagent. | Wake from the launching session. |
176
+ | `child-record-unreadable` | The subagent's latest record lives in a session not open here. | Open the launching session and retry. |
177
+ | `child-unrestorable` | Saved session or agent definition is missing or invalid. | Fix the reported cause and `resume`, or launch a new subagent. |
178
+ | `record-append-failed` | Could not persist subagent state to session storage (retryable). | Check session storage before relying on restart recovery. |
179
+ | `hold-failed` | Intercom broker could not reserve the released subagent (retryable; verified against restored reservations on reconnect, up to 5 seconds delay). | Confirm Intercom connectivity; until held, sends fail as not found. |
180
+ | `completion-not-held` | A subagent's shell finished after the subagent resumed or ended. | None. The notice waits for the subagent's next run. |
181
+ | `wake-failed` | Wake failed for another reason (retryable). | Results are preserved; call `resume` to retry. |
182
+
183
+ ### `subagent:finishing` event
184
+
185
+ Extension authors integrating with `worktree: true` cleanup can subscribe to `atomic.events.on("subagent:finishing", ({ runId, index, taskId, cwd, status }) => ...)` before launch so external watchers release file handles before Git teardown runs.
186
+
187
+ ### Owner-bound task projection
188
+
189
+ This section describes an SDK host integration API for custom frontends. Import `OwnerTaskStore` and `bindOwnerTaskStore` from `@bastani/atomic`, and see [Owner-bound task supervisor](/sdk/reference#owner-bound-task-supervisor) for creating the host and lease. SDK host adapters bind task observation to a live session in three steps:
114
190
 
115
191
  1. Construct an `OwnerTaskStore` from the supervisor and owner lease.
116
192
  2. Check `store.connect()`.
@@ -118,7 +194,7 @@ SDK host adapters bind task observation to a live session in three steps:
118
194
 
119
195
  Behavior and limits:
120
196
 
121
- - **Lifecycle.** Binding never creates or connects an owner, reconciles snapshots and cursors even when producers attach lazily, and disposing the view does not cancel the owner. Reattachment keeps identities and foreground versus background distinctions without restarting work or adding waits.
197
+ - **Lifecycle.** Binding never creates or connects an owner, reconciles snapshots and cursors even when producers attach after binding, and disposing the view does not cancel the owner. Reattachment preserves identities and foreground versus background distinctions without restarting work or adding waits.
122
198
  - **Agent panel rendering.** Interactive sessions display active and recent background tasks in the agent panel below the prompt, with each subagent's running shells nested beneath it, rather than permanent transcript rows. Old rows clear on session replacement, and notices share one completion-notice renderer.
123
199
  - **Custom host adapters.** Custom `ChatSessionHost` adapters can keep transcript rows or set `taskRowsInChat: false` to use the agent panel only. Colliding labels receive a short task-ID suffix, and previews cap at 64 reports and 8 KiB per task with omission markers.
124
200
  - **Scope.** Binding only projects task state. It does not auto-migrate custom producers or provide `/tasks` transcript inspection.