@bastani/atomic 0.10.9-alpha.1 → 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 +69 -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,11 +1,9 @@
1
1
  ---
2
- title: SDK API reference
2
+ title: "SDK API reference"
3
3
  sidebarTitle: "SDK API"
4
- description: SDK options, resource loaders, return values, run modes, and exports.
4
+ description: "Complete API reference for Atomic SDK session options, model scoping, session stores, resource loaders, run modes, task supervision, and exports."
5
5
  ---
6
6
 
7
- # SDK API reference
8
-
9
7
  ## Options reference
10
8
 
11
9
  ### Directories
@@ -118,15 +116,37 @@ if (auto) {
118
116
  }
119
117
  ```
120
118
 
119
+ #### Resolving scoped models
120
+
121
+ `resolveModelScopeFromModels(patterns, models)` and `resolveModelScopeWithDiagnostics(patterns, modelRuntime)` expand `--models` / `enabledModels` pattern arrays into `{ scopedModels, diagnostics }`. Each pattern resolves in three stages:
122
+
123
+ 1. Exact literal reference without a thinking suffix (matches `provider/id` or `id`).
124
+ 2. If the pattern contains `*`, `?`, or `[`: strips a valid trailing `:<thinking>` suffix, retries an exact literal match first (so bracketed model IDs like `model[1m]` stay literal), then runs case-insensitive `minimatch` against both `provider/id` and `id`.
125
+ 3. Fuzzy substring matching with lenient `:<thinking>` suffix parsing.
126
+
127
+ Matches are deduplicated in order (first match wins). `diagnostics` lists warnings with `code: "no-match" | "invalid-thinking-level"`.
128
+
129
+ ```typescript
130
+ import { resolveModelScopeWithDiagnostics } from "@bastani/atomic";
131
+
132
+ const { scopedModels, diagnostics } = await resolveModelScopeWithDiagnostics(
133
+ ["anthropic/*sonnet*:high", "openai/o3"],
134
+ modelRuntime,
135
+ );
136
+ ```
137
+
121
138
  #### Model catalog persistence and refresh
122
139
 
123
- `ModelRuntime.create()` restores cached catalogs from local persistence and does not download the models.dev catalog unless you opt in. Pass `catalogBaseUrl` (or set `ATOMIC_MODEL_CATALOG_URL`) to read `<url>/api.json` from your own models.dev mirror instead of https://models.dev.
140
+ `ModelRuntime.create()` restores cached catalogs from local persistence and does not download the models.dev catalog unless you opt in. Pass `catalogBaseUrl` (or set `ATOMIC_MODEL_CATALOG_URL`) to read `<url>/api.json` from your own models.dev mirror instead of `https://models.dev`.
124
141
 
125
- - `allowModelNetwork` (default `false`): enables a create-time network refresh.
126
- - `modelRefreshTimeoutMs` (default `15_000`): bounds how long that refresh may run before it is aborted.
142
+ - `allowModelNetwork` (tri-state):
143
+ - **Omitted (`undefined`):** skips create-time network refresh, but still allows a first-prompt GitHub Copilot lookup when no cached Copilot catalog or fallback model exists.
144
+ - **`false`:** disables **both** create-time network refresh and first-prompt GitHub Copilot lookup.
145
+ - **`true`:** enables create-time network refresh (bounded by `modelRefreshTimeoutMs`).
146
+ - `modelRefreshTimeoutMs` (default `15_000`): bounds how long the create-time refresh may run before aborting.
127
147
  - `refreshOnCreate: false`: skips the initial catalog and availability refresh entirely; built-in models remain available.
128
148
 
129
- `createAgentSession()` does not fetch an account model list at startup. If its cache restore found no GitHub Copilot catalog and its first prompt has no usable model or fallback, the session can look up the exact saved Copilot model. A supplied `model`, a working preset or fallback, and a cached catalog need no lookup. Only that session uses the result; `models-store.json`, credentials, and model listings do not change.
149
+ `createAgentSession()` does not fetch an account model list at startup. If cache restore found no GitHub Copilot catalog and the first prompt has no usable model or fallback, the session can look up the exact saved Copilot model unless `allowModelNetwork: false` was passed to `ModelRuntime.create()`. A supplied `model`, a working preset or fallback, and a cached catalog need no lookup. Only that session uses the result; `models-store.json`, credentials, and model listings do not change.
130
150
 
131
151
  The `modelFallbackMessage` returned by `createAgentSession()` describes startup. If the account confirms the model is absent, the first prompt's error says so; a refused, offline, or cancelled lookup keeps the usual error. Pass `signal` to `createAgentSession()` to cancel the lookup, or pass `allowModelNetwork: false` to `ModelRuntime.create()` to disable it. Custom asynchronous-only credential stores keep normal local selection; discovery never waits on their read queue.
132
152
 
@@ -220,11 +240,12 @@ Specify which tools to expose by name:
220
240
  - `find` discovers filesystem paths by glob; `search` searches file contents with regex patterns across files, directories, globs, and internal URLs.
221
241
  - `builtins` selects shipped packages independently of tools: keys are `subagents`, `mcp`, `web-access`, and `intercom`. Omitted, `{}`, and omitted keys enable packages. A `false` value removes that package's extensions and resources, including on reload; `true` enables it.
222
242
  - The `subagents` builtin ships all 21 bundled subagent skills: `agent-browser`, `agent-desktop`, `bro`, `create-spec`, `feedback`, `herdr`, `how`, `impeccable`, `liteparse`, `prompt-engineer`, `qlty`, `research-codebase`, `show-me`, `skill-creator`, `subagent`, `tdd`, `teach`, `tmux`, `unslop`, `why`, and `workflow-files`. If you want these skills without the delegation tool, keep `subagents` enabled and pass `excludedTools: ["subagent"]`. If you disable the package, install independent copies of the skills you need in your [skills directory](/skills#locations).
223
- - `tools` accepts an allowlist of coding, extension, and custom tool names or `*` patterns. `tools: []` exposes no tools, including Intercom. A list containing only `+name`/`-name` entries modifies resolved defaults (for example `tools: ["+codemode", "-write"]`). Modifiers require exact names, cannot mix with plain entries, and apply across reloads. Invalid lists throw.
224
- - `excludedTools` removes matching names from the registry and active selection. Exclusions win over `tools`; unknown names are ignored.
243
+ - `tools` accepts an allowlist of coding, extension, and custom tool names or `*` patterns. Pattern matching is **case-sensitive** and treats only `*` as a wildcard (matching any characters); `?`, `[]`, and `{}` are matched literally. `tools: []` exposes no tools, including Intercom. A list containing only `+name`/`-name` entries modifies resolved defaults (for example `tools: ["+codemode", "-write"]`). Modifiers require exact names (no `*`), cannot mix with plain entries, and apply across reloads. Invalid lists throw.
244
+ - **MCP retention with allowlists:** When `tools` is a non-empty allowlist with no `mcp__*` entry, MCP tools remain registered for `codemode` and `tool_search`. Adding any `mcp__*` entry switches MCP tools to explicit allowlisting too.
245
+ - `excludedTools` removes matching names (using the same case-sensitive `*`-only matching) from the registry and active selection. Exclusions win over `tools`; unknown names are ignored.
225
246
  - `noTools: "all"` exposes no tools, even with a nonempty `tools` list. It does not remove package resources or authorize services.
226
247
  - `noTools: "builtin"` suppresses the built-in selection, including `codemode`, when `tools` is omitted. Other extension and custom tools keep their default activation unless excluded. An explicit `tools` list wins over this mode.
227
- - Configured `defaultTools` selects initial coding tools when `tools` and `noTools` are omitted. Plain names replace defaults; modifier-only lists such as `["-bash", "+ls"]` modify defaults, and project modifier-only lists layer over global settings. See [defaultTools](/settings#tools).
248
+ - Configured `defaultTools` narrows only the initial built-in coding selection when `tools` and `noTools` are omitted (it never disables extension or custom tools). Plain names replace defaults; modifier-only lists such as `["-bash", "+ls"]` modify defaults, and project modifier-only lists layer over global settings. See [defaultTools](/settings#tools).
228
249
 
229
250
  Subagent children inherit these restrictions. Child allowlists intersect with parent selections, including during model fallback, and a child cannot restore a parent-disabled package or excluded tool. See [child configuration](/sdk#subagent-children) for model, auth, host callback, and working-directory inheritance.
230
251
 
@@ -383,7 +404,7 @@ Do not mix wait arguments with launch fields. Unknown IDs, foreign IDs, and unbo
383
404
 
384
405
  PowerShell tools and local operations accept a trusted `taskOwner` binding and the same `wait` observation policy as `bash`. Owned native Windows runs auto-yield after the owner's command budget (normally 10000 ms); explicit per-call budgets override it, while execution timeout stays separate. Without a supported owner, explicit background requests reject and foreground execution waits for completion.
385
406
 
386
- On native Windows, an unowned `bash` or `powershell` command runs in its own job object so a timeout or abort terminates child processes even after the shell exits. Processes that break away (`CREATE_BREAKAWAY_FROM_JOB`), including commands started by Git Bash, are terminated on timeout or abort only while still under the running shell; detached children left behind by a finished command continue running.
407
+ On native Windows, a `bash` or `powershell` tool call without a `taskOwner` binding runs in its own job object so a timeout or abort terminates child processes even after the shell exits. Processes that break away (`CREATE_BREAKAWAY_FROM_JOB`), including commands started by Git Bash, are terminated on timeout or abort only while still under the running shell; detached children left behind by a finished command continue running.
387
408
 
388
409
  ```typescript
389
410
  import { createPowerShellTool } from "@bastani/atomic";
@@ -446,7 +467,7 @@ Use `defineTool()` for standalone definitions and arrays like `customTools: [myT
446
467
 
447
468
  Custom tools passed via `customTools` combine with extension-registered tools. When you pass a plain-name `tools` allowlist, include each custom or extension tool you want active (for example `tools: ["read", "bash", "my_tool"]`). Modifier-only lists keep default activation and can enable inactive tools with `+name`. `excludedTools` removes any matching tool from the active set.
448
469
 
449
- `ToolDefinition.constrainedSampling` survives `defineTool()`, `customTools`, tool wrappers, inspection, and isolated execution:
470
+ `ToolDefinition.constrainedSampling` survives `defineTool()`, `customTools`, tool wrappers, inspection, and interactive terminal execution:
450
471
 
451
472
  - `{ type: "json_schema", strict: "prefer" | "require" }`: `prefer` may fall back; `require` fails if the active model cannot enforce strict JSON Schema.
452
473
  - `{ type: "grammar", variants: { openai_lark?: string, openai_regex?: string } }`: requires one required string parameter and capable model metadata.
@@ -454,7 +475,7 @@ Custom tools passed via `customTools` combine with extension-registered tools. W
454
475
 
455
476
  Inspection preserves optional-property identity (`undefined` stays present when explicitly set). See `ConstrainedSamplingConfig`, [Constrained sampling](/extensions/authoring#constrained-sampling), and `ModelInfo.compat` in [RPC](/rpc/protocol#get_available_models).
456
477
 
457
- Factory-created `createBashTool()` instances receive the same execution-time `ATOMIC_SESSION_*` and `PI_SESSION_*` snapshot as the built-in `bash` tool unless you pass `exposeSessionEnvironment: false`. `MessageRenderOptions.outputPad` is also forwarded to normal and isolated custom message renderers.
478
+ Factory-created `createBashTool()` instances receive the same execution-time `ATOMIC_SESSION_*` and `PI_SESSION_*` snapshot as the built-in `bash` tool unless you pass `exposeSessionEnvironment: false`. `MessageRenderOptions.outputPad` is forwarded to all custom message renderers.
458
479
 
459
480
  Normal sessions expose `kill({ id: taskId })` for owned `bash` and `powershell` background tasks. Include `kill` in any explicit `tools` allowlist if the agent should be able to stop tasks. `createKillTool` and `createKillToolDefinition` accept `KillToolOptions.taskOwner` (the same trusted binding used by shell launches) and reject without one. Result details carry the supervisor's `CancelReceipt`. See [Stop a shell task from a tool call](/background-tasks#stop-a-shell-task-from-a-tool-call).
460
481
 
@@ -477,12 +498,12 @@ const waitForCi = defineTool({
477
498
 
478
499
  A detachable call follows its message's `concurrency` ordering before starting. If a tool must save a durable handoff first, set `detachmentRequiresReady: true`: check `toolCallNeedsDetachmentHandoff(signal)` while running, then call `markToolCallReadyForDetachment(signal)` once saved. The call detaches only after both that signal and the host's delay (or returns inline if it finishes sooner).
479
500
 
480
- Without a detachment policy, detachable calls run inline. A host using persistent storage enables detachment with `session.setToolDetachment({ afterMs })`, where `afterMs` is `0` to `MAX_TOOL_DETACHMENT_AFTER_MS` (`2,147,483,647`):
501
+ Without a detachment policy, detachable calls run inline. A host using persistent storage enables detachment with `session.setToolDetachment({ afterMs })`, where `afterMs` is any finite number from `0` to `MAX_TOOL_DETACHMENT_AFTER_MS` (`2,147,483,647`):
481
502
 
482
503
  - **Inline vs. detached:** Calls finishing within `afterMs` complete inline. Calls still running detach: the turn's other results save, the detached call remains pending, and `prompt()` resolves so the host can release or dispose of the session.
483
504
  - **Interrupts:** Once a turn is interrupted, inline calls no longer detach (even if marked ready in the same tick). They keep their result if they stop within `ATOMIC_TOOL_ABORT_GRACE_MS` (default 10 s); otherwise they record `Operation aborted` and later outcomes are discarded. Queued calls fail immediately with `Operation aborted`. Calls that detached before the interrupt are unaffected and remain available from `takeDetachedToolCalls()`.
484
505
  - **`session.takeDetachedToolCalls()`:** Returns each detached call once as a `DetachedToolCall` (`toolCallId`, `toolName`, non-rejecting `result` promise, `abort(reason)`). Calls whose turn the transcript has moved past are cancelled, dropped, and logged as `stale-detached-call`. Thrown errors become `isError` results; errors with a string `code` populate `details.error` via `toJSON()` (or a fallback object with `serialization: "fallback"` if `toJSON()` throws). Unrecordable payloads record a call error instead, while session-store failures still reject resume.
485
- - **`session.resumeDetachedTurn(results)`:** On a reopened session, records each result after its call and continues the turn (without a new user message) once every detachable call of that turn has a result. You can supply results across multiple calls; until the last arrives, `hasPendingDetachedTurn()` stays `true`. Duplicate, already-answered, or stale results are ignored (stale ones log `stale-detached-call`), while results for nonexistent calls throw `unknown-tool-call`. Calling with no new results continues a turn whose calls already have results.
506
+ - **`session.resumeDetachedTurn(results, onRecorded?)`:** On a reopened session, records each result after its call (invoking optional `onRecorded(toolCallIds)` once recorded) and continues the turn without a new user message once every detachable call of that turn has a result. You can supply results across multiple calls; until the last arrives, `hasPendingDetachedTurn()` stays `true`. Duplicate, already-answered, or stale results are ignored (stale ones log `stale-detached-call`), while results for nonexistent calls throw `unknown-tool-call`. Calling with no new results continues a turn whose calls already have results.
486
507
  - **`session.isWaitingOnDetachedResults()`:** Reports whether the transcript still awaits a detached result. While waiting under a detachment policy, nothing starts a turn on the idle session (including subagent notices, steering, follow-ups, and post-compaction continuations); held custom messages are persisted and replayed after `resumeDetachedTurn()` continues the turn. Do not call `prompt()` while waiting on results.
487
508
  - **`session.hasPendingDetachedTurn()` and `session.redispatchDetachedToolCalls()`:** `hasPendingDetachedTurn()` reports whether a reopened transcript ends on a detached turn; continue it with `redispatchDetachedToolCalls()` and `resumeDetachedTurn()` instead of prompting again. `redispatchDetachedToolCalls()` restarts unanswered detachable calls with their original IDs and arguments and emits `tool_execution_start` before returning.
488
509
 
@@ -541,12 +562,17 @@ The tool infers the answer through the session's model registry rather than capt
541
562
 
542
563
  Each call shares one wall-clock deadline covering repairs, retries, and fallbacks. It defaults to the session's [`httpIdleTimeoutMs`](/settings#http) setting; pass `timeoutMs` (a positive integer in milliseconds) to `createStructuredOutputTool()` to override it. See [Structured decisions](/sdk/structured-decisions#cancellation-and-failures).
543
564
 
544
- To register under a custom name, pass `name` and include it in any explicit `tools` allowlist:
565
+ To register under a custom name or capture the validated value in memory or to a private file (`0600`), pass `name`, `capture`, or `output`:
545
566
 
546
567
  ```typescript
568
+ import { createStructuredOutputCapture, createStructuredOutputTool } from "@bastani/atomic";
569
+
570
+ const capture = createStructuredOutputCapture<{ category: "question" | "statement" }>();
547
571
  const finalDecision = createStructuredOutputTool({
548
572
  name: "final_decision",
549
573
  schema: DecisionSchema,
574
+ capture, // sets capture.value and capture.called = true on success
575
+ output: { outputPath: "/tmp/decision.json" }, // writes JSON with mode 0600
550
576
  });
551
577
 
552
578
  await createAgentSession({
@@ -583,9 +609,26 @@ const { session } = await createAgentSession({ resourceLoader: loader });
583
609
 
584
610
  - **Synthetic builtin factories:** Named `extensionFactories` descriptors may set `builtin: true` to expose a `builtin:<name>` resource and `replaceable: true` to yield if another extension registers the same tool, command, or flag. Pass `additionalExtensionPaths: ["builtin:codemode"]` for explicit loading even with `noExtensions: true`. See [built-in extension resources](/extensions#built-in-extension-resources).
585
611
  - **Inline built-in extensions:** `DefaultResourceLoader` includes `codemode`, `tool-search`, and `llama.cpp` as `builtin:<name>` paths. `codemode` is active by default (opt out with `tools: ["-codemode"]`), while `tool_search` is opt-in. Turn off an inline builtin with `noExtensions: true`, `disabledBuiltinExtensions: ["codemode"]`, or `extensions: ["-builtin:codemode"]`.
586
- - **Bindings and startup:** Pass `extensionBindings` to `createAgentSession()` to install `uiContext`, `mode`, `commandContextActions`, `shutdownHandler`, or `onError` before `session_start` runs. Creation awaits startup and resource discovery, shutting down a partial session if startup fails. Pass `reportStartupErrors: true` to report `session_start` and `resources_discover` errors to `onError` while keeping the session open. Later `bindExtensions()` calls update bindings without replaying `session_start`.
612
+ - **Bindings and startup (`ExtensionBindings`):** Pass `extensionBindings` to `createAgentSession()` to install bindings before `session_start` runs: `humanInput`, `onDiagnostic`, `onUIPrompt`, `uiContext`, `onStatus` (receives extension `setStatus` writes when no `uiContext` is bound), `isPresentationOnly`, `mode`, `commandContextActions`, `shutdownHandler`, `onError`, and `reportStartupErrors` (when `true`, forwards `session_start` and `resources_discover` errors to `onError` and keeps the session open instead of rolling back). Later `bindExtensions()` calls update bindings without replaying `session_start`.
587
613
  - **Strict reloads:** `failOnExtensionErrors: true` requires transactional `prepareReload()` support (`DefaultResourceLoader` implements it). Custom loaders without `prepareReload()` work for ordinary reloads, while strict reload fails before calling their mutating `reload()`.
588
614
 
615
+ #### Reload lifecycle and resource ownership
616
+
617
+ - **Transactional vs. ordinary reload:** Failed transactional reloads keep the previous extension generation active; failed ordinary reloads do not. Both clean up newly acquired resources and report cleanup failures through an `AggregateError` tagged with `code: "ShutdownFailed"`.
618
+ - **Lifecycle effects:** Acquire shared resources in `session_start` (or register `session_shutdown` immediately if acquired earlier). Use `publishExtensionContextEffect(ctx, effect)` (default `"start"` phase after retirement, or synchronous `"commit"` phase before revocation) to publish shared state only on commit, and `registerExtensionContextRetirementEffect(ctx, dispose)` for synchronous pre-revocation cleanup. Never cache `ctx.ui` across reloads.
619
+
620
+ ```typescript
621
+ import { publishExtensionContextEffect, type ExtensionFactory } from "@bastani/atomic";
622
+
623
+ const extension: ExtensionFactory = (atomic) => {
624
+ atomic.on("session_start", (_event, ctx) =>
625
+ publishExtensionContextEffect(ctx, () => {
626
+ atomic.events.emit("example:session-ready", { sessionId: ctx.sessionManager.getSessionId() });
627
+ }),
628
+ );
629
+ };
630
+ ```
631
+
589
632
  #### Session disposal and lifecycle
590
633
 
591
634
  Always `await session.dispose()`. Disposal seals new admission immediately and waits for active work, extension shutdown handlers, pending settings writes, pending notice-line saves, lease release, and up to 5 seconds for in-flight extension transpile-cache writes started by that session.
@@ -593,13 +636,13 @@ Always `await session.dispose()`. Disposal seals new admission immediately and w
593
636
  Once `dispose()` resolves, nothing the session started is still writing to its session store or extension transpile cache, so deleting `agentDir` or a caller-owned store directory right afterward will not race. (Transpile-cache writes still unfinished after 5 seconds are logged to debug output and left to finish asynchronously.)
594
637
 
595
638
  - Concurrent `dispose()` calls share one promise.
596
- - Catch `ShutdownFailed` to inspect component `errors`; a failed close still leaves the session closed.
639
+ - Disposal failures reject with an `AggregateError` tagged with `code: "ShutdownFailed"` (not an exported class); inspect `error.errors` for individual component failures. A failed close still leaves the session closed.
597
640
  - Settings persistence failures can reject disposal; repair storage and repeat the write before closing (`dispose()` does not drain `SettingsManager.drainErrors()`).
598
641
  - Caller-supplied settings, storage, and model runtimes remain caller-owned. Do not add manual MCP or Intercom teardown.
599
642
  - `AgentSessionRuntime` uses the same awaited close during session replacement and transfers bindings before the replacement starts. Reload invalidates stale input requests and subscriptions so late replies cannot authorize new work.
600
643
  - Duplicate `executeBash()` IDs act as correlation IDs: `abortBash(id)` cancels every active call with that ID.
601
644
 
602
- For reload, replacement, and resource ownership patterns, see [Finishing admitted work](/sdk#finishing-admitted-work).
645
+ For reload, replacement, and resource ownership patterns, see [Draining work on reload and shutdown](/sdk#finishing-admitted-work).
603
646
 
604
647
  #### Prompting options
605
648
 
@@ -608,7 +651,7 @@ For reload, replacement, and resource ownership patterns, see [Finishing admitte
608
651
  - `expandPromptTemplates` (default `true`): expands file-based prompt templates, skill commands, and extension commands.
609
652
  - `images`: optional `ImageContent[]` attachments.
610
653
  - `streamingBehavior`: `"steer"` or `"followUp"` when sending while a turn is active; omitting it while streaming rejects with `AgentSessionBusyError`.
611
- - `startTurnOnly`: when `true`, starts a turn only if the session is idle and queued messages are not paused. When a turn is already running or queued input is paused, nothing is sent or queued and `prompt()` resolves as `"handled"`.
654
+ - `startTurnOnly`: when `true`, starts a turn only if the session is idle and queued messages are not paused. When a turn is already running or queued input is paused, nothing is sent or queued, `preflightResult` is called with `(true, "handled")`, and `prompt()` resolves with `undefined`.
612
655
  - `source`: `InputSource` metadata for `input` hooks.
613
656
  - `preflightResult`: callback `(success, disposition?)` invoked once preflight accepts (`"handled"`, `"queued"`, or `"started"`) or rejects the prompt.
614
657
 
@@ -729,10 +772,12 @@ const { session } = await createAgentSession({
729
772
  sessionManager: SessionManager.inMemory(),
730
773
  });
731
774
 
732
- // New persistent session
775
+ // New persistent session (default resolved store, or pass an explicit SessionStore)
733
776
  const { session: persisted } = await createAgentSession({
734
777
  sessionManager: await SessionManager.create(process.cwd()),
735
778
  });
779
+ // Or with a caller-owned store:
780
+ // await SessionManager.create(store, process.cwd())
736
781
 
737
782
  // Continue most recent
738
783
  const { session: continued, modelFallbackMessage } = await createAgentSession({
@@ -784,7 +829,7 @@ await runtime.fork("entry-id");
784
829
  await runtime.fork("entry-id", { position: "at" });
785
830
  ```
786
831
 
787
- `runtime.switchSession(id, options?)` and `runtime.rehydrate(id, options?)` resume at the current context window, so `getEntries()` and `getTree()` return only the resident window.
832
+ `runtime.switchSession(id, options?)` and `runtime.rehydrate(id, options?)` resume at the current context window, so `getEntries()` and `getTree()` return only the loaded context window.
788
833
 
789
834
  To visit older entries without loading them into memory, iterate `for await (const page of sessionManager.readHistory({ fromSeq, toSeq, signal }))`:
790
835
 
@@ -807,7 +852,28 @@ for await (const page of sessionManager.readHistory()) {
807
852
  const entry = await sessionManager.readEntry("entry-id");
808
853
  ```
809
854
 
810
- `sessionManager.loadFullHistory()` and `{ history: "full" }` on `SessionManager.open()`, `openSessionById()`, `continueRecent()`, `switchSession()`, and `rehydrate()` load every stored entry across every branch into memory so `getEntries()` and `getTree()` cover the whole session. Use them only when you need all entries resident at once.
855
+ `sessionManager.loadFullHistory()` and `{ history: "full" }` on `SessionManager.open()`, `openSessionById()`, `continueRecent()`, `switchSession()`, and `rehydrate()` load every stored entry across every branch into memory so `getEntries()` and `getTree()` cover the whole session. Use them only when you need all entries loaded in memory at once.
856
+
857
+ #### Session stores and claims
858
+
859
+ Construct or open concrete `SessionStore` implementations directly when you manage store lifetimes yourself:
860
+
861
+ - **`SqlSessionStore.open(database, { prefix?, cwdMatcher? })`:** Opens a SQL-backed session store on a caller-owned `SqliteDatabase` or storage adapter handle.
862
+ - **`JsonlSessionStore.open(directory, { exactDirectory?, scanExisting?, lockFs?, createDirectory? })`:** Opens a JSONL session directory store (creates `directory` unless `createDirectory: false`).
863
+ - **`new MemorySessionStore(cwdMatcher?, historyFiles?)`:** Creates a caller-owned in-memory store that preserves history across `session.release()` and `runtime.rehydrate()`.
864
+
865
+ Coordinate single-writer session ownership across processes with session claims (stored at `<agentDir>/session-claims/<sessionId>.json`, refreshed on a 15-second heartbeat, with a 60-second staleness window for remote hosts and automatic dead-claim takeover):
866
+
867
+ - **`await prepareSessionClaim(sessionId, { agentDir })`:** Awaits any in-flight asynchronous claim release in this process and prepares stale-claim takeover locking. Always await `prepareSessionClaim()` before `claimSession()` when re-claiming a session right after closing or releasing it.
868
+ - **`claimSession(sessionId, { agentDir })`:** Synchronously acquires the claim and returns a `release()` function (throws `SessionAlreadyOpenError` if another live process holds the session or if a prior release in this process is still pending).
869
+ - **`attachSessionClaim(sessionId)`:** Transfers an active claim to the opened session's lifetime marker, returning a `() => Promise<void>` disposer (after attaching, the earlier `release()` callback becomes a no-op).
870
+
871
+ #### Session services (`createAgentSessionServices` and `createAgentSessionFromServices`)
872
+
873
+ When managing multiple sessions that share a working directory (or inside `createAgentSessionRuntime()`), split directory-scoped service initialization from session creation:
874
+
875
+ - **`createAgentSessionServices({ cwd, agentDir?, settingsManager?, modelRuntime?, ... })`:** Builds shared `AgentSessionServices` (`cwd`, `agentDir`, `modelRuntime`, `settingsManager`, `resourceLoader`, `diagnostics`).
876
+ - **`createAgentSessionFromServices({ services, sessionManager, sessionStartEvent?, ... })`:** Creates an `AgentSession` backed by those shared services without re-discovering extensions, skills, or models.
811
877
 
812
878
  `SessionManager.create()`, `open()`, `continueRecent()`, `forkFrom()`, and all mutations are asynchronous. `SessionManager.inMemory()` with no entries is synchronous; when supplying entries, await `SessionManager.inMemory(cwd, options, entries)` and keep the input array stable until it resolves. A resolved write is committed (there is no `flush()` method), and a failed write rejects with the store's typed error without publishing the entry. Reads remain synchronous.
813
879
 
@@ -978,7 +1044,7 @@ const loader = new DefaultResourceLoader({
978
1044
  });
979
1045
  ```
980
1046
 
981
- During interactive startup, deferred resource loading can run discovery twice. Both calls run, but if the same registration reports the same error, the terminal shows it once. A later `/reload` reports the failure again.
1047
+ During interactive startup, Atomic can run resource discovery twice (before and after optional extensions finish loading). Both calls run, and if the same registration reports the same error, the terminal shows it once. A later `/reload` reports the failure again.
982
1048
 
983
1049
  Creating `(...args) => handler(...args)` on every load registers a new callback each time, so you can see two startup errors. Keep separate callbacks when your override changes the handler, adds a step that can fail, or forwards on behalf of separate installations. Don't cache a previous load's handler or share a forwarder by extension name.
984
1050
 
@@ -990,13 +1056,16 @@ Creating `(...args) => handler(...args)` on every load registers a new callback
990
1056
  interface CreateAgentSessionResult {
991
1057
  // The session
992
1058
  session: AgentSession;
993
-
1059
+
994
1060
  // Extensions result (for runner setup)
995
1061
  extensionsResult: LoadExtensionsResult;
996
-
1062
+
997
1063
  // Warning if session model couldn't be restored
998
1064
  modelFallbackMessage?: string;
999
1065
 
1066
+ // Machine-readable fallback reason when startup fell back from a requested or saved model
1067
+ modelFallbackReason?: ModelFallbackReason;
1068
+
1000
1069
  // The resolved binding when the session was created with `workspace`
1001
1070
  workspace?: BoundWorkspace;
1002
1071
  }
@@ -1052,13 +1121,13 @@ const mode = new InteractiveMode(runtime, {
1052
1121
  await mode.run();
1053
1122
  ```
1054
1123
 
1055
- If you quit the host or call `session.dispose()` during the initial interactive extension bind, `await mode.init()` or `await mode.run()` returns normally. The disposed session does not enter the input loop. This also applies when an incoming event or a pending provider retry started the UI. Track your own shutdown request instead of catching `SessionClosed` to detect it.
1124
+ If you quit the host or call `session.dispose()` during the initial interactive extension bind, `await mode.init()` or `await mode.run()` returns normally. The disposed session does not enter the input loop. This also applies when an incoming event or a pending provider retry started the UI. Track your own shutdown request instead of checking for `code: "SessionClosed"` errors to detect it.
1056
1125
 
1057
- Replacing the session during the initial bind is not a quit: the interrupted startup still rejects. If you dispose only the session and then create a replacement with `await runtime.newSession()`, call `mode.run()` again to accept input for the replacement. Direct `session.bindExtensions()` and `mode.handleEvent(event)` calls still reject on close, so custom handlers can catch startup failures and report errors from their recovery work.
1126
+ Replacing the session during the initial bind is not a quit: the interrupted startup still rejects. If you dispose only the session and then create a replacement with `await runtime.newSession()`, call `mode.run()` again to accept input for the replacement. Direct `session.bindExtensions()` and `mode.handleEvent(event)` calls still reject on close (with an `Error` tagged `code: "SessionClosed"`), so custom handlers can catch startup failures and report errors from their recovery work.
1058
1127
 
1059
1128
  ### runPrintMode
1060
1129
 
1061
- Single-shot mode: send prompts, output result, exit:
1130
+ Single-shot mode: send prompts, output text or JSONL events, and return the exit code (`Promise<number>`, `0` on success or `1` on fatal error):
1062
1131
 
1063
1132
  ```typescript
1064
1133
  import {
@@ -1085,7 +1154,7 @@ const runtime = await createAgentSessionRuntime(createRuntime, {
1085
1154
  sessionManager: await SessionManager.create(process.cwd()),
1086
1155
  });
1087
1156
 
1088
- await runPrintMode(runtime, {
1157
+ const exitCode = await runPrintMode(runtime, {
1089
1158
  mode: "text",
1090
1159
  initialMessage: "Hello",
1091
1160
  initialImages: [],
@@ -1176,7 +1245,7 @@ try {
1176
1245
 
1177
1246
  ## Session start errors
1178
1247
 
1179
- An in-process subagent that does not start within its start budget fails with a `SessionStartTimeoutError`; see [Subagent start timeouts](/subagents#subagent-start-timeouts) for the budget and how to change it. The child's result carries it serialized as `startError`, and its `error` text is the error's `message`. Every error in this family extends `SessionStartError`. Branch on the class, a guard, or `code`, never on the message:
1248
+ A subagent that does not start within its start budget fails with a `SessionStartTimeoutError`; see [Subagent start timeouts](/subagents#subagent-start-timeouts) for the budget and how to change it. The child's result carries it serialized as `startError`, and its `error` text is the error's `message`. Every error in this family extends `SessionStartError`. Branch on the class, a guard, or `code`, never on the message:
1180
1249
 
1181
1250
  | Class | `code` | When | Fields | What to do |
1182
1251
  | --- | --- | --- | --- | --- |
@@ -1201,9 +1270,9 @@ if (startError && isRetryableSessionStartError(startError)) {
1201
1270
  These helpers let extensions and SDK code follow [debug mode](/development#debugging):
1202
1271
 
1203
1272
  - `isDebugEnabled(area?, env?)` returns whether debug mode is on. The same setting applies to every area. `env` defaults to `process.env`.
1204
- - `reportDebug(area, event, fields, ownOutput?, env?)` records one event. In debug mode it appends a JSON line to the debug log, with credentials redacted and long text cut to 2,000 characters. `fields` holds strings, numbers, booleans, `null` or lists of strings and numbers, never objects. The optional `ownOutput` callback is not used by any current area.
1205
- - `appendDebugRecord(path, record)` appends one redacted JSON line to another debug file, such as a trace file. It and `reportDebug()` retain their synchronous write and immediate failure-reporting behavior.
1206
- - `appendDebugRecordAsync(path, record)` and `reportDebugAsync(area, event, fields, ownOutput?, env?)` provide the same redaction and reporting without blocking the host. Await their promises to observe the completed write, or call `flushDebugLog()` to wait for all queued debug records.
1273
+ - `reportDebug(area, event, fields, env?)` records one event. In debug mode it appends a JSON line to the debug log, with credentials redacted and long text cut to 2,000 characters. `fields` holds strings, numbers, booleans, `null`, or lists of strings and numbers, never objects.
1274
+ - `appendDebugRecord(path, record)` appends one redacted JSON line to another debug file, such as a trace file. Both `appendDebugRecord()` and `reportDebug()` write synchronously and report failures immediately.
1275
+ - `appendDebugRecordAsync(path, record)` and `reportDebugAsync(area, event, fields, env?)` provide the same redaction and reporting without blocking the host. Await their promises to observe the completed write, or call `flushDebugLog()` to wait for all queued debug records.
1207
1276
  - `DEBUG_AREA_VARIABLES` lists `decision`, `storage` and `engine`. All have value `undefined`: there are no separate environment switches for these areas.
1208
1277
  - `getDebugLogFailure()` returns the first `DebugLogUnwritableError` of this process, if writing a debug log ever failed.
1209
1278
  - `setDebugSetting(enabled)` turns debug mode on or off for this process and for child processes it starts afterwards. It does not save the `debug` setting.
@@ -1218,7 +1287,11 @@ These helpers let extensions and SDK code follow [debug mode](/development#debug
1218
1287
 
1219
1288
  Both extend `DebugError`, whose `code` is a `DebugErrorCode` and whose `fields()` returns the fields above. Branch on the class or `code`, not the message. `isDebugError`, `isDebugLogUnwritableError` and `isDebugConfigError` recognize them, including an error that crossed a process boundary as a plain object with the same `name` and `code`.
1220
1289
 
1221
- To pass one between processes, `serializeDebugError(error)` turns it into a `SerializedDebugError` (`name`, `code`, `message`, `hint`, `retryable`, `fields`, and a cause chain of at most eight errors), and `rehydrateDebugError(serialized)` rebuilds the same class with the same fields. An unknown `name` comes back as a `DebugError` that keeps its `name`, `code`, `fields` and `retryable`. The RPC client does this for you: when the engine refuses `set_debug`, `setDebug()` rejects with the `DebugConfigError`.
1290
+ To pass one between processes, `serializeDebugError(error)` turns it into a `SerializedDebugError` (`name`, `code`, `message`, `hint`, `retryable`, `fields`, and a cause chain of at most eight errors), and `rehydrateDebugError(serialized)` rebuilds the same class with the same fields. An unknown `name` comes back as a `DebugError` that keeps its `name`, `code`, `fields` and `retryable`. The RPC client does this for you: when Atomic refuses `set_debug`, `setDebug()` rejects with the `DebugConfigError`.
1291
+
1292
+ ### Compaction errors
1293
+
1294
+ Compaction settings, session compaction calls, and direct `requestCompactorOutput()` calls throw subclasses of `CompactionError` (`CompactionConfigError`, `CompactionCancelledError`, `CompactionStateError`, and `CompactorFailure`). Branch on the class or `code`, not the message. Every `CompactionError` exposes `code`, `hint`, `retryable`, and `fields()`, and comes with cross-realm guards (`isCompactionError`, `isCompactionConfigError`, `isCompactionCancelledError`, `isCompactionStateError`, `isCompactorFailure`, `findCompactionError`, `isRetryableCompactionError`) plus `serializeCompactionError()`, `parseSerializedCompactionError()`, and `rehydrateCompactionError()`. The RPC client automatically rehydrates `compaction_error` responses (for example when `set_compaction_model` or `compact` rejects). See [Compaction errors](/compaction/reference#compaction-errors).
1222
1295
 
1223
1296
  ## Nonblocking helpers
1224
1297
 
@@ -1258,20 +1331,49 @@ On Windows, the native module reads directory ownership and access lists directl
1258
1331
  The main entry point exports:
1259
1332
 
1260
1333
  ```typescript
1261
- // Factory
1334
+ // Session factories and runtime
1262
1335
  createAgentSession
1336
+ createAgentSessionServices
1337
+ createAgentSessionFromServices
1263
1338
  createAgentSessionRuntime
1339
+ AgentSession
1264
1340
  AgentSessionRuntime
1341
+ AgentSessionBusyError, isAgentSessionBusyError
1342
+ NativeModuleUnavailableError
1265
1343
 
1266
1344
  // Auth and Models
1345
+ ModelRuntime
1346
+ type CreateModelRuntimeOptions
1347
+ type ModelRuntimeAuthOverrides
1348
+ CredentialSynchronizationError
1267
1349
  AuthStorage
1350
+ readStoredCredential
1268
1351
  ModelRegistry
1269
1352
  resolveAutoModel
1353
+ resolveRestoredModelReference
1270
1354
  resolveModelScopeFromModels
1271
1355
  resolveModelScopeWithDiagnostics
1272
1356
  type ResolveModelScopeResult
1273
1357
  type ModelScopeDiagnostic
1274
1358
  OAuthLoginTransactionError
1359
+ GitHubCopilotError, GitHubCopilotAuthenticationError, GitHubCopilotContentFilterError
1360
+ GitHubCopilotEmptyResponseError, GitHubCopilotInvalidRequestError, GitHubCopilotModelUnavailableError
1361
+ GitHubCopilotPromptTooLargeError, GitHubCopilotQuotaExhaustedError, GitHubCopilotRateLimitError
1362
+ GitHubCopilotServiceUnavailableError, GitHubCopilotStreamEndedEarlyError, GitHubCopilotUnrecognizedResponseError
1363
+ LlamaServerError, LlamaServerRequestError, LlamaServerUnreachableError
1364
+
1365
+ // Workspaces and Intercom policy
1366
+ workspace
1367
+ bindSessionWorkspace
1368
+ resolveWorkspace
1369
+ restoreWorkspace
1370
+ workspaceChangeSet
1371
+ publishPullRequest
1372
+ WorkspaceError, WorkspaceConfigError, WorkspaceBindingError, WorkspaceGitError
1373
+ WorkspaceSnapshotError, WorkspaceRestoreError, WorkspaceDriftError, WorkspacePublicationError
1374
+ isWorkspaceError, findWorkspaceError, isRetryableWorkspaceError, serializeWorkspaceError, rehydrateWorkspaceError
1375
+ IntercomPolicyError
1376
+ MAX_INTERCOM_REACHABLE_GROUPS
1275
1377
 
1276
1378
  // Resource loading
1277
1379
  DefaultResourceLoader
@@ -1332,7 +1434,7 @@ type Transcript
1332
1434
  type TranscriptOptions
1333
1435
  type TranscriptPart
1334
1436
 
1335
- // Session management
1437
+ // Session management and resume
1336
1438
  SessionManager
1337
1439
  SettingsManager
1338
1440
  JsonlSessionStore
@@ -1363,6 +1465,10 @@ SettingsFileChangedError
1363
1465
  JsonlStoragePoisonedError
1364
1466
  StorageTransferError
1365
1467
  StorageImportIncompleteError
1468
+ ResumeError, ResumeNotFoundError, ResumePreconditionError, ResumeCatalogUnavailableError, ResumeCatalogTimeoutError
1469
+ isResumeError, findResumeError, isRetryableResumeError, serializeResumeError, rehydrateResumeError
1470
+ BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, BlueprintBuildFailedError
1471
+ isBlueprintError, findBlueprintError, serializeBlueprintError, rehydrateBlueprintError
1366
1472
  type SessionJsonValue
1367
1473
  type SessionTextField
1368
1474
  type SessionTimestampField
@@ -1380,7 +1486,7 @@ DecisionTimeoutError, DecisionOutputError, DecisionProviderError
1380
1486
  type DecisionErrorCode, DecisionConfigErrorCode, DecisionRequestErrorReason, DecisionModelUnavailableReason
1381
1487
  isDecisionError, isDecisionConfigError, isDecisionRequestError, isDecisionModelUnavailableError
1382
1488
  isDecisionTimeoutError, isDecisionOutputError, isDecisionProviderError
1383
- findDecisionError, isRetryableDecisionError, serializeDecisionError, rehydrateDecisionError
1489
+ findDecisionError, isRetryableDecisionError, serializeDecisionError, parseSerializedDecisionError, rehydrateDecisionError
1384
1490
 
1385
1491
  // Session start errors
1386
1492
  SessionStartError
@@ -1405,19 +1511,27 @@ type SessionStartConfigSource
1405
1511
  type SessionStartConfigReason
1406
1512
  type SerializedSessionStartError
1407
1513
  type SerializedSessionStartCause
1514
+
1408
1515
  // Finished task retention (see "Owner-bound task supervisor")
1409
1516
  FINISHED_TASK_RETENTION
1410
1517
  TaskEvictedError, isTaskEvictedError, findTaskEvictedError, rehydrateTaskEvictedError
1411
1518
  type TaskEvictedErrorCode, type TaskEvictedErrorFields
1412
1519
  TaskToolError, isTaskToolError, rehydrateTaskToolError
1413
1520
  type TaskToolFailureCode, type TaskToolErrorFields, type SerializedTaskToolError
1521
+
1414
1522
  // Messages typed into a task's transcript (see "Task transcript references")
1415
1523
  TaskMessageError, TaskMessageTimeoutError, isTaskMessageError, isTaskMessageTimeoutError
1416
1524
  findTaskMessageError, isRetryableTaskMessageError, rehydrateTaskMessageError
1417
1525
  type TaskMessageErrorCode, type TaskMessageErrorFields, type TaskMessageTimeoutErrorFields
1418
1526
  type TaskMessageTimeoutPhase, type SerializedTaskMessageError
1419
- // Detached tool call failures (see "Detachable tool calls")
1527
+
1528
+ // Detachable tool calls (see "Detachable tool calls")
1529
+ ToolDetachmentError, isToolDetachmentError, findToolDetachmentError, deserializeToolDetachmentError
1530
+ MAX_TOOL_DETACHMENT_AFTER_MS
1531
+ markToolCallReadyForDetachment, toolCallNeedsDetachmentHandoff
1532
+ type ToolDetachmentErrorCode, type ToolDetachmentErrorFields, type SerializedToolDetachmentError
1420
1533
  type DetachedCallFailure, type DetachedCallFailureCause
1534
+
1421
1535
  // Git resolution (see "Resolving git")
1422
1536
  resolveGit, resolveGitSync, resolveInstalledGit, getGitStatus, getGitStatusAsync, GIT_MINIMUM_VERSION
1423
1537
  GitProvisionError, GitUnavailableError, GitProvisionTimeoutError, GitProvisionConfigError
@@ -1436,7 +1550,10 @@ type ManagedToolName, type ManagedToolRequestPhase, type ManagedToolErrorCode, t
1436
1550
  // Debug output
1437
1551
  isDebugEnabled
1438
1552
  reportDebug
1553
+ reportDebugAsync
1439
1554
  appendDebugRecord
1555
+ appendDebugRecordAsync
1556
+ flushDebugLog
1440
1557
  DEBUG_AREA_VARIABLES
1441
1558
  getDebugLogFailure
1442
1559
  setDebugSetting
@@ -1489,17 +1606,32 @@ isSubscriptionSetupError, isSubscriptionSubscriberUnavailableError, isSubscripti
1489
1606
  isRetryableSubscriptionError, serializeSubscriptionError, deserializeSubscriptionError
1490
1607
  type SubscriptionErrorCode, type SubscriptionConfigReason, type SubscriptionSetupMissing, type SubscriberUnavailableReason, type SubscriptionRecordKind, type SubscriptionTimeoutPhase, type WebhookRequestFailures
1491
1608
 
1492
- // Tool factories
1609
+ // Tool factories and shell/file tool errors
1493
1610
  createCodingTools
1494
1611
  createReadOnlyTools
1495
1612
  createReadTool, createBashTool, createPowerShellTool, createKillTool
1496
1613
  createEditTool, createWriteTool, createSearchTool, createFindTool, createLsTool
1497
-
1498
- // Edit and write errors (see Built-in tools: Edit and write errors)
1614
+ ShellToolError, ShellTimeoutError, isShellToolError, isShellTimeoutError, rehydrateShellToolError
1499
1615
  EditToolError, EditInputError, EditMatchError, EditTargetError, WriteSelectorError, FileToolAbortedError
1500
1616
  isEditToolError, isEditInputError, isEditMatchError, isEditTargetError, isWriteSelectorError, isFileToolAbortedError
1501
1617
  serializeFileToolError, rehydrateEditToolError, rehydrateWriteSelectorError
1502
1618
 
1619
+ // Compaction, errors, and custom compactor models
1620
+ type CompactorModel, type CompactorApi
1621
+ type ProviderCompactorModelConfig, type ProviderChatModelConfig, type ProviderClassifierModelConfig, type ProviderImageModelConfig
1622
+ type CompactorRequest, type CompactorMessage, type CompactionModelSelection, type CompactionModelKind
1623
+ CompactionError, CompactionConfigError, CompactionCancelledError, CompactionStateError, CompactorFailure
1624
+ type CompactionErrorCode, type CompactionConfigErrorCode, type CompactionStateErrorCode, type CompactorFailureCode
1625
+ type CompactionConfigSource, type CompactionSettingsScope, type CompactionCancelReason, type CompactionErrorFieldValue
1626
+ type CompactionConfigErrorFields, type CompactionCancelledErrorFields, type CompactionStateErrorFields, type CompactorFailureOptions
1627
+ type SerializedCompactionError
1628
+ isCompactionError, isCompactionConfigError, isCompactionCancelledError, isCompactionStateError, isCompactorFailure
1629
+ findCompactionError, isRetryableCompactionError, serializeCompactionError, parseSerializedCompactionError, rehydrateCompactionError
1630
+ requestCompactorOutput, buildCompactorMessages, compactedOutputTokenCap, classifyCompactionModel, resolveCompactionModel
1631
+ estimateTextTokens, wrapLongLines
1632
+ COMPACTOR_REQUEST_TIMEOUT_MS, COMPACTOR_LINE_WIDTH
1633
+ COMPACTED_OUTPUT_MAX_TOKENS, COMPACTED_OUTPUT_MAX_TRIGGER_SHARE
1634
+
1503
1635
  // Types
1504
1636
  type CreateAgentSessionOptions
1505
1637
  type CreateAgentSessionResult
@@ -1517,8 +1649,6 @@ type Tool
1517
1649
 
1518
1650
  For extension types, see [Extensions](/extensions) for the full API.
1519
1651
 
1520
- <a id="owner-bound-task-supervisor-s1" />
1521
-
1522
1652
  ## Owner-bound task supervisor
1523
1653
 
1524
1654
  For trusted custom hosts, the package exports `AgentTaskHost` and its integration types rather than the raw native supervisor. Bind the host scope and a mandatory `authorizeLaunch` guard. Never accept ownership or authorization from model input or reconstruct a lease from a task ID or saved history.