@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,34 +1,57 @@
1
1
  ---
2
2
  title: "Keybindings"
3
- description: "Default keyboard shortcuts and custom ~/.atomic/agent/keybindings.json actions."
3
+ sidebarTitle: "Keybindings"
4
+ description: "Default keyboard shortcuts and custom ~/.atomic/agent/keybindings.json configuration rules."
4
5
  ---
5
6
 
6
- # Keybindings
7
+ Customize keyboard shortcuts in `~/.atomic/agent/keybindings.json`. Run `/reload` after editing the file to apply changes without restarting. Add `"$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/schemas/keybindings.schema.json"` for editor completion and validation (Atomic ignores `$schema` at load time).
7
8
 
8
- Customize keyboard shortcuts in `~/.atomic/agent/keybindings.json`. Each action accepts one key or an array of keys (pass `[]` to unbind).
9
+ ## Key format
9
10
 
10
- The config file uses the same namespaced action IDs that Atomic uses internally and that extensions pass to `keyHint()` and injected `keybindings` managers. Older configs using pre-namespaced names such as `cursorUp` or `expandTools` migrate automatically on startup.
11
+ Write keys as `modifier+key` using any combination of `ctrl`, `shift`, `alt`, and `super`:
11
12
 
12
- After editing `keybindings.json`, run `/reload` to apply changes without restarting. Add `"$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/schemas/keybindings.schema.json"` for editor completion and validation (Atomic ignores `$schema` at load time).
13
+ - **Letters:** `a` to `z`
14
+ - **Digits:** `0` to `9`
15
+ - **Special:** `escape`, `esc`, `enter`, `return`, `tab`, `space`, `backspace`, `delete`, `insert`, `clear`, `home`, `end`, `pageUp`, `pageDown`, `up`, `down`, `left`, `right`
16
+ - **Function:** `f1` to `f12`
17
+ - **Symbols:** `` ` ``, `-`, `=`, `[`, `]`, `\`, `;`, `'`, `,`, `.`, `/`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `|`, `~`, `{`, `}`, `:`, `<`, `>`, `?`
13
18
 
14
- ## Key format
19
+ Examples: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+super+x`, `ctrl+1`, `ctrl++`. Support for `super` depends on your terminal.
15
20
 
16
- Write keys as `modifier+key` using any combination of `ctrl`, `shift`, `alt`, and `super`:
21
+ **Key syntax rules:**
22
+
23
+ - Key names and modifiers are **case-insensitive** (`pageUp` and `pageup`, `CTRL+P` and `ctrl+p` are equivalent).
24
+ - Modifier order does not matter (`ctrl+shift+p` and `shift+ctrl+p` are equivalent), but duplicate modifiers (such as `ctrl+ctrl+x`) are invalid and never match.
25
+ - **`escape` and `esc` never match with any modifier.** Bind plain `escape` or `esc` only.
26
+ - Binding `+` with modifiers works (`ctrl++`, `alt++`).
27
+
28
+ ## Custom configuration
29
+
30
+ Create `~/.atomic/agent/keybindings.json`:
31
+
32
+ ```json
33
+ {
34
+ "$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/schemas/keybindings.schema.json",
35
+ "tui.editor.historyPrevious": "ctrl+p",
36
+ "tui.editor.historyNext": "ctrl+n",
37
+ "tui.editor.deleteWordBackward": ["ctrl+w", "alt+backspace"],
38
+ "app.model.cycleForward": []
39
+ }
40
+ ```
17
41
 
18
- - **Letters.** `a` to `z`
19
- - **Digits.** `0` to `9`
20
- - **Special.** `escape`, `esc`, `enter`, `return`, `tab`, `space`, `backspace`, `delete`, `insert`, `clear`, `home`, `end`, `pageUp`, `pageDown`, `up`, `down`, `left`, `right`
21
- - **Function.** `f1` to `f12`
22
- - **Symbols.** `` ` ``, `-`, `=`, `[`, `]`, `\`, `;`, `'`, `,`, `.`, `/`, `!`, `@`, `#`, `$`, `%`, `^`, `&`, `*`, `(`, `)`, `_`, `+`, `|`, `~`, `{`, `}`, `:`, `<`, `>`, `?`
42
+ **Configuration rules:**
23
43
 
24
- Examples: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+super+x`, `ctrl+1`. Support for `super` depends on your terminal.
44
+ - **Replacement semantics:** Setting an action in `keybindings.json` **completely replaces** its default keys rather than appending to them. Pass an array to keep defaults alongside a new key, or pass `[]` to unbind the action.
45
+ - **Invalid config fallback:** Malformed JSON or a non-object top-level value is silently ignored and all defaults apply with no warning. Unknown action IDs, entries whose value is not a string or string array, and unrecognized key strings are also silently ignored.
46
+ - **Legacy migration:** If your file contains older pre-namespaced action names (such as `cursorUp`, `expandTools`, `app.tasks.inspect`, or `app.tasks.cancel`), Atomic migrates them automatically on startup and **rewrites `~/.atomic/agent/keybindings.json` in place** (sorting known keys and dropping any legacy key whose current namespaced equivalent is already present).
47
+ - **Windows and WSL defaults:** WSL defaults apply on Linux whenever `WSL_DISTRO_NAME` or `WSL_INTEROP` is set. On native Windows, `app.suspend` defaults to `alt+z` and opens an interactive PowerShell subshell (leaving `ctrl+z` for editor undo; type `exit` to return while background tasks keep running). On WSL, standard Linux `ctrl+z`/`fg` suspension applies and `tui.editor.undo` defaults to `alt+z`. See [Windows](/windows).
25
48
 
26
49
  ## All actions
27
50
 
28
51
  ### TUI editor cursor movement
29
52
 
30
53
  | Keybinding id | Default | Description |
31
- |--------|---------|-------------|
54
+ | --- | --- | --- |
32
55
  | `tui.editor.cursorUp` | `up` | Move cursor up |
33
56
  | `tui.editor.cursorDown` | `down` | Move cursor down |
34
57
  | `tui.editor.cursorLeft` | `left`, `ctrl+b` | Move cursor left |
@@ -49,7 +72,7 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
49
72
  ### TUI editor deletion
50
73
 
51
74
  | Keybinding id | Default | Description |
52
- |--------|---------|-------------|
75
+ | --- | --- | --- |
53
76
  | `tui.editor.deleteCharBackward` | `backspace` | Delete character backward |
54
77
  | `tui.editor.deleteCharForward` | `delete`, `ctrl+d` | Delete character forward |
55
78
  | `tui.editor.deleteWordBackward` | `ctrl+w`, `alt+backspace` | Delete word backward |
@@ -60,7 +83,7 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
60
83
  ### TUI input
61
84
 
62
85
  | Keybinding id | Default | Description |
63
- |--------|---------|-------------|
86
+ | --- | --- | --- |
64
87
  | `tui.input.newLine` | `shift+enter`, `ctrl+j` | Insert new line |
65
88
  | `tui.input.submit` | `enter` | Submit input |
66
89
  | `tui.input.tab` | `tab` | Tab / autocomplete |
@@ -68,7 +91,7 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
68
91
  ### TUI kill ring
69
92
 
70
93
  | Keybinding id | Default | Description |
71
- |--------|---------|-------------|
94
+ | --- | --- | --- |
72
95
  | `tui.editor.yank` | `ctrl+y` | Paste most recently deleted text |
73
96
  | `tui.editor.yankPop` | `alt+y` | Cycle through deleted text after yank |
74
97
  | `tui.editor.undo` | `ctrl+-` (`ctrl+z` on native Windows, `alt+z` on WSL) | Undo last edit |
@@ -76,7 +99,7 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
76
99
  ### TUI clipboard and selection
77
100
 
78
101
  | Keybinding id | Default | Description |
79
- |--------|---------|-------------|
102
+ | --- | --- | --- |
80
103
  | `tui.input.copy` | `ctrl+c` | Copy selection |
81
104
  | `tui.select.up` | `up` | Move selection up |
82
105
  | `tui.select.down` | `down` | Move selection down |
@@ -87,9 +110,11 @@ Dedicated history actions switch prompt history entries regardless of cursor lin
87
110
 
88
111
  Local copy requires a working clipboard utility (`wl-clipboard` on Wayland, `xclip` or `xsel` on X11, or Termux:API on Termux). Atomic forwards copies through OSC 52 over SSH, Mosh, and Rex and as a headless Linux fallback; set `ATOMIC_CLIPBOARD_OSC52=1` (legacy `PI_CLIPBOARD_OSC52=1`) to force OSC 52 after local copy. See [Terminal setup](/terminal-setup) for terminal clipboard and mouse configuration.
89
112
 
90
- ### TUI fullscreen viewport
113
+ <div id="tui-fullscreen-viewport" />
91
114
 
92
- Interactive sessions run in fullscreen with a scrollable transcript above the docked composer. `app.tools.expand` (`Ctrl+O` by default) expands or collapses all tool and summary blocks in the displayed transcript.
115
+ ### Transcript scrolling and mouse
116
+
117
+ Interactive sessions run in fullscreen with a scrollable transcript above the docked input box. `app.tools.expand` (`Ctrl+O` by default) expands or collapses all tool and summary blocks in the displayed transcript.
93
118
 
94
119
  **Clicking blocks:**
95
120
 
@@ -109,10 +134,10 @@ Interactive sessions run in fullscreen with a scrollable transcript above the do
109
134
  - When scrolled up, a centered `↓ jump to bottom · ctrl+end` pill appears above the editor (counting new messages as they arrive) and the current turn's opening prompt stays pinned at the top. Viewed subagent transcripts and `/tasks` shell views scroll independently without moving `main`.
110
135
  - Drag to select characters, double-click for a word or path, and triple-click for a line. Selection copies automatically unless `fullscreenCopyOnSelect` is `false`. On Windows, pressing the secondary mouse button pastes clipboard text into the focused component. See [Terminal setup](/terminal-setup) for mouse and trackpad behavior.
111
136
 
112
- While the main editor has focus, `home` and `end` stay with the editor, `ctrl+home` and `ctrl+end` jump to the transcript top and bottom, `pageUp` and `pageDown` scroll the transcript, and `ctrl+pageUp` and `ctrl+pageDown` scroll the editor. Focused overlays and scrollable lists (autocomplete, `/settings`, `/model`) capture scrolling actions first.
137
+ **Editor vs. transcript scrolling:** While the main editor has focus, `home` and `end` stay with the editor, `ctrl+home` and `ctrl+end` jump to the transcript top and bottom, `pageUp` and `pageDown` scroll the transcript, and `ctrl+pageUp` and `ctrl+pageDown` scroll the editor. Focused overlays and scrollable lists (autocomplete, `/settings`, `/model`) capture scrolling actions first.
113
138
 
114
139
  | Key | Editor action | Fullscreen action |
115
- |-----|---------------|------------------|
140
+ | --- | --- | --- |
116
141
  | `home`, `end` | Editor | Editor |
117
142
  | `ctrl+home`, `ctrl+end` | *(none)* | Transcript |
118
143
  | `pageUp`, `pageDown` | Editor | Transcript |
@@ -120,10 +145,10 @@ While the main editor has focus, `home` and `end` stay with the editor, `ctrl+ho
120
145
 
121
146
  Rebind these like any other action: for example `"tui.altScreen.pageUp": "ctrl+pageUp"` keeps `pageUp` in the editor and moves transcript paging to `ctrl+pageUp`, and `[]` unbinds a shortcut. Focused custom components may consume viewport keys first; see the [input handling contract](/extensions/ui#custom-components).
122
147
 
123
- Transcript scroll keys also work while the bottom-pinned `ask_user_question` dialog or Notes is open. Inside `ask_user_question`, use `↑`/`↓` to move between options, `Enter` to pick (`Enter` or `Space` to toggle multi-select boxes), type on **Type something.** for a custom answer, `n` to add a note, `Tab` or `←`/`→` to switch questions, and `Esc` to cancel.
148
+ **`ask_user_question` controls:** Transcript scroll keys also work while the bottom-pinned `ask_user_question` dialog or Notes is open. Inside `ask_user_question`, use `↑`/`↓` to move between options, `Enter` to pick (`Enter` or `Space` to toggle multi-select boxes), type on **Type something.** for a custom answer, `n` to add a note, `Tab` or `←`/`→` to switch questions, and `Esc` to cancel.
124
149
 
125
150
  | Keybinding id | Default | Description |
126
- |--------|---------|-------------|
151
+ | --- | --- | --- |
127
152
  | `tui.altScreen.pageUp` | `pageUp` | Scroll the transcript up by one page |
128
153
  | `tui.altScreen.pageDown` | `pageDown` | Scroll the transcript down by one page |
129
154
  | `tui.altScreen.halfPageUp` | *(none)* | Scroll the transcript up by half a page |
@@ -140,12 +165,12 @@ Atomic does not ship a find-in-transcript shortcut. The four `tui.altScreen.sear
140
165
  ### Application
141
166
 
142
167
  | Keybinding id | Default | Description |
143
- |--------|---------|-------------|
168
+ | --- | --- | --- |
144
169
  | `app.interrupt` | `escape` | Abort active or queued work and restore queued messages to the editor (pauses a viewed subagent without switching to `main`) |
145
- | `app.clear` | `ctrl+c` | Clear editor text, interrupt work, recover an unresponsive engine, or press twice within 0.8 s on an empty idle prompt to exit (while viewing a subagent, pauses it instead of exiting) |
170
+ | `app.clear` | `ctrl+c` | Clear editor text, interrupt work, recover an unresponsive session, or press twice within 0.8 s on an empty idle prompt to exit (while viewing a subagent, pauses it instead of exiting) |
146
171
  | `app.exit` | `ctrl+d` | Exit when the editor is empty |
147
172
  | `app.suspend` | `ctrl+z` (`alt+z` on native Windows) | Suspend to background on POSIX and WSL; open a PowerShell subshell on native Windows |
148
- | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, or `$EDITOR`) |
173
+ | `app.editor.external` | `ctrl+g` | Open in external editor (`externalEditor`, `$VISUAL`, or `$EDITOR`, falling back to `notepad` on Windows or `nano` on macOS and Linux) |
149
174
  | `app.history.search` | `ctrl+r` | Search the viewed agent's past prompts and place the chosen one in the editor without sending |
150
175
  | `app.clipboard.pasteImage` | `ctrl+v` (`alt+v`, `ctrl+v` on Windows and WSL) | Paste files on macOS, images, or text from clipboard |
151
176
 
@@ -157,12 +182,12 @@ Atomic does not ship a find-in-transcript shortcut. The four `tui.altScreen.sear
157
182
  **`Ctrl+C`, `Esc`, and `Ctrl+X` routing:**
158
183
 
159
184
  - `Ctrl+X` does not copy text; paired with `Ctrl+K` it stops all background work ([Navigation](#navigation)), on OAuth sign-in screens it copies the sign-in URL (`app.auth.copyUrl`), and in `/scoped-models` it clears selections. Use `/copy` to copy the viewed agent's last assistant message.
160
- - Physical `Esc` always requests cooperative cancellation without replacing the engine, while physical `Ctrl+C` remains the host's recovery route over stalled controls or stuck custom extension UI (`handlesCtrlC` components receive the first press and close on the second). Rebinding `app.clear` does not change that physical routing. See [Message queue](/usage#message-queue) for full interrupt and recovery rules.
185
+ - Physical `Esc` always requests cooperative cancellation without restarting the session. Physical `Ctrl+C` closes stuck custom dialogs (dialogs that handle `Ctrl+C` receive the first press and close on the second) and restarts an unresponsive background session process, even if you remap `app.clear`. See [Message queue](/usage#message-queue) for full interrupt and recovery rules.
161
186
 
162
187
  ### Sessions
163
188
 
164
189
  | Keybinding id | Default | Description |
165
- |--------|---------|-------------|
190
+ | --- | --- | --- |
166
191
  | `app.session.new` | *(none)* | Start a new session (`/new`) |
167
192
  | `app.session.tree` | *(none)* | Open session tree navigator (`/tree`) |
168
193
  | `app.session.fork` | *(none)* | Fork current session (`/fork`) |
@@ -179,7 +204,7 @@ While viewing a subagent, `app.session.new`, `app.session.tree`, and `app.sessio
179
204
  ### Models and thinking
180
205
 
181
206
  | Keybinding id | Default | Description |
182
- |--------|---------|-------------|
207
+ | --- | --- | --- |
183
208
  | `app.model.select` | `ctrl+l` | Open model selector |
184
209
  | `app.model.cycleForward` | `ctrl+p` | Cycle to next model |
185
210
  | `app.model.cycleBackward` | `shift+ctrl+p` (`alt+p` on Windows and WSL) | Cycle to previous model |
@@ -191,7 +216,7 @@ Interactive model and thinking choices save automatically as startup defaults; t
191
216
  ### Display and message queue
192
217
 
193
218
  | Keybinding id | Default | Description |
194
- |--------|---------|-------------|
219
+ | --- | --- | --- |
195
220
  | `app.tools.expand` | `ctrl+o` | Collapse or expand tool detail in the viewed transcript (main chat or subagent) |
196
221
  | `app.auth.copyUrl` | `ctrl+x` | Copy the URL on an OAuth sign-in screen |
197
222
  | `app.message.followUp` | `alt+enter` (`ctrl+q` on Windows and WSL) | Queue follow-up message |
@@ -204,7 +229,7 @@ Message queue shortcuts work identically on `main` and while viewing a subagent.
204
229
  Atomic shares one chat screen across `main` and its subagents, with the [agent panel](/background-tasks#the-agent-panel) below the prompt and `/tasks` for full task inspection. Press `↓` on an empty prompt to focus the agent panel, `←` on an empty prompt while viewing a subagent to return to `main`, `Ctrl+X` then `Ctrl+K` (twice within 3 seconds) to stop all background work, and `?` on an empty prompt or list to show active keys. See [Background tasks](/background-tasks) for full navigation and stop workflows.
205
230
 
206
231
  | Keybinding id | Default | Description |
207
- |--------|---------|-------------|
232
+ | --- | --- | --- |
208
233
  | `app.nav.back` | `left` | Go back one level in `/tasks`, shell output, or the focused panel, and from a viewed subagent's empty prompt to `main`. `Esc` and `Ctrl+C` never act as this key |
209
234
  | `app.list.open` | `enter`, `right` | Switch to the selected subagent (or `main`), or open the selected shell output |
210
235
  | `app.list.stop` | `x` | Stop the selected item (press again to confirm); dismiss a finished one |
@@ -214,18 +239,18 @@ Atomic shares one chat screen across `main` and its subagents, with the [agent p
214
239
  | `app.agents.focus` | `down` | Focus the agent panel from an empty prompt |
215
240
  | `app.agents.chord` | `ctrl+x` | Start a background-work chord in the main chat |
216
241
  | `app.agents.stopAll` | `ctrl+k` | After the chord key: stop all background subagents and shells (press twice to confirm) |
217
- | `app.tasks.open` | Unbound | Command-only `/tasks` route |
218
- | `app.tasks.input` | Unbound | Focus stdin only when the selected task has writable input |
242
+ | `app.tasks.open` | *(none)* | Command-only `/tasks` route |
243
+ | `app.tasks.input` | *(none)* | Focus stdin only when the selected task has writable input |
219
244
  | `app.tasks.openWaited` | `alt+w` | Open the output of the shell a waiting subagent waits on, while viewing that subagent or from its `/tasks` row |
220
245
 
221
246
  On macOS, `Alt+W` requires your terminal to send Option as Meta (enable **Use Option as Meta key** in Terminal.app, set Option to **Esc+** in iTerm2, set `macos-option-as-alt` in Ghostty, or set `macos_option_as_alt both` in kitty). Otherwise remap `app.tasks.openWaited`. Avoid binding `alt+w` to another editor action because `app.tasks.openWaited` takes priority while viewing a waiting subagent or its `/tasks` row.
222
247
 
223
- Older configs using `app.tasks.inspect` and `app.tasks.cancel` migrate automatically to `app.list.open` and `app.list.stop`. Mounted human-input prompts and the composer retain priority; `Esc` leaves stdin or task detail before leaving task focus, and unbound actions show no key hint.
248
+ Open question prompts and the main input box keep keyboard priority; `Esc` leaves stdin or task detail before leaving task focus, and unbound actions show no key hint.
224
249
 
225
250
  ### Tree navigation
226
251
 
227
252
  | Keybinding id | Default | Description |
228
- |--------|---------|-------------|
253
+ | --- | --- | --- |
229
254
  | `app.tree.foldOrUp` | `ctrl+left`, `alt+left` | Fold current branch segment, or jump to the previous segment start |
230
255
  | `app.tree.unfoldOrDown` | `ctrl+right`, `alt+right` | Unfold current branch segment, or jump to the next segment start or branch end |
231
256
  | `app.tree.editLabel` | `shift+l` | Edit the label on the selected tree node |
@@ -243,26 +268,14 @@ Older configs using `app.tasks.inspect` and `app.tasks.cancel` migrate automatic
243
268
  Used inside `/scoped-models`. `Enter` toggles the selected model, typing filters by model or provider name, and `Esc` or `Ctrl+C` clears the search before closing. Changes save automatically.
244
269
 
245
270
  | Keybinding id | Default | Description |
246
- |--------|---------|-------------|
271
+ | --- | --- | --- |
247
272
  | `app.models.enableAll` | `ctrl+a` | Enable all models (or all matching the current search) |
248
273
  | `app.models.clearAll` | `ctrl+x` | Clear all models (or all matching the current search) |
249
274
  | `app.models.toggleProvider` | `ctrl+p` | Toggle all models for the current provider |
250
275
  | `app.models.reorderUp` | `alt+up` (`alt+q` on Windows and WSL) | Move the selected model up in the cycle order |
251
276
  | `app.models.reorderDown` | `alt+down` | Move the selected model down in the cycle order |
252
277
 
253
- ## Custom configuration
254
-
255
- Create `~/.atomic/agent/keybindings.json`:
256
-
257
- ```json
258
- {
259
- "tui.editor.historyPrevious": "ctrl+p",
260
- "tui.editor.historyNext": "ctrl+n",
261
- "tui.editor.deleteWordBackward": ["ctrl+w", "alt+backspace"]
262
- }
263
- ```
264
-
265
- User entries override defaults. On native Windows, `app.suspend` defaults to `alt+z` and opens an interactive PowerShell subshell (leaving `ctrl+z` for editor undo; type `exit` to return while background tasks keep running). In WSL, standard Linux `ctrl+z`/`fg` suspension applies and editor undo defaults to `alt+z`. See [Windows](/windows).
278
+ ## Preset examples
266
279
 
267
280
  ### Emacs example
268
281
 
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  title: "@bastani/atomic-agent-core"
3
- sidebarTitle: "Agent core"
4
- description: "Stateful agent loop with tool execution, event streaming, steering and follow-up messages."
3
+ sidebarTitle: "@bastani/atomic-agent-core"
4
+ description: "Stateful agent loop with tool execution, event streaming, steering, and follow-up messages."
5
5
  ---
6
6
 
7
- Stateful agent with tool execution and event streaming, built on [`@bastani/atomic-ai`](/libraries/ai). Atomic's sessions run on this agent loop, and you can use it directly to build your own agent. Atomic's [SDK](/sdk) wraps it with sessions, tools, extensions, and compaction, so prefer the SDK when you want Atomic's built-in behavior.
7
+ Stateful agent with tool execution and event streaming, built on [`@bastani/atomic-ai`](/libraries/ai) (requires Node.js 22.19+). Atomic's sessions run on this agent loop, and you can use it directly to build your own agent. Atomic's [TypeScript SDK](/sdk) wraps it with sessions, tools, extensions, and compaction, so prefer the SDK when you want Atomic's built-in behavior.
8
8
 
9
9
  ## Installation
10
10
 
@@ -71,7 +71,7 @@ The agent emits events as turns run so your interface can update incrementally.
71
71
 
72
72
  When you call `prompt("Hello")`:
73
73
 
74
- ```
74
+ ```text
75
75
  prompt("Hello")
76
76
  ├─ agent_start
77
77
  ├─ turn_start
@@ -122,6 +122,8 @@ Set the mode globally through `toolExecution` in `AgentOptions`, or per tool thr
122
122
 
123
123
  `beforeToolCall` runs after `tool_execution_start` and argument validation. It can block execution and attach `terminate: true` to the blocked result. `afterToolCall` runs after tool execution finishes and before `tool_execution_end` and the final tool result message events are emitted.
124
124
 
125
+ **`afterToolCall` merge rules:** Overrides merge field-by-field (`content`, `details`, `structuredContent`, `isError`, `usage`, `terminate`) with no deep merge. Importantly, returning `content` **without** `structuredContent` drops the original `structuredContent` so the two cannot go out of sync; pass `structuredContent` alongside `content` if you want to keep it.
126
+
125
127
  Tools, blocked `beforeToolCall` results, and `afterToolCall` overrides can return `terminate: true` to skip the automatic follow-up LLM call. The loop stops early only when every finalized tool result in that batch sets `terminate: true`. Mixed batches continue normally.
126
128
 
127
129
  With the `Agent` class, assistant `message_end` processing finishes before tool preflight begins. That guarantees `beforeToolCall` sees agent state that already includes the assistant message requesting the tool call.
@@ -204,7 +206,7 @@ await agent.continue(); // Uses the queued message only because the tail is assi
204
206
  | `tool_execution_update` | Tool streams progress |
205
207
  | `tool_execution_end` | Tool completes |
206
208
 
207
- `Agent.subscribe()` listeners are awaited in registration order. `agent_end` means no more loop events will be emitted, but `await agent.waitForIdle()` and `await agent.prompt(...)` only settle after awaited `agent_end` listeners finish.
209
+ `Agent.subscribe()` listeners receive `(event, signal)` and are awaited in registration order. If a listener throws or rejects, the error propagates to the caller awaiting `prompt()` or `continue()`. `agent_end` means no more loop events will be emitted, and `await agent.waitForIdle()` and `await agent.prompt(...)` settle only after awaited `agent_end` listeners finish.
208
210
 
209
211
  ## Agent options
210
212
 
@@ -220,7 +222,7 @@ const agent = new Agent({
220
222
  messages: AgentMessage[],
221
223
  },
222
224
 
223
- // Convert AgentMessage[] to LLM Message[] (required for custom message types)
225
+ // Convert AgentMessage[] to LLM Message[] (required for custom message types; must not throw or reject)
224
226
  convertToLlm: (messages) => messages.filter(...),
225
227
 
226
228
  // Transform context before convertToLlm (for pruning, compaction)
@@ -247,9 +249,19 @@ const agent = new Agent({
247
249
  // Dynamic API key resolution (for expiring OAuth tokens)
248
250
  getApiKey: async (provider) => refreshToken(),
249
251
 
252
+ // Optional provider transport, retry cap, and request/response inspection hooks
253
+ transport: "sse",
254
+ maxRetryDelayMs: 60_000,
255
+ onPayload: (payload, model) => payload,
256
+ onResponse: (response) => {},
257
+ onProviderStreamEvent: (event) => {},
258
+
250
259
  // Tool execution mode: "parallel" (default) or "sequential"
251
260
  toolExecution: "parallel",
252
261
 
262
+ // Custom error text when the model calls an unregistered tool name
263
+ unknownToolMessage: (toolName) => `Tool "${toolName}" is not available.`,
264
+
253
265
  // Preflight each tool call after args are validated. Can block execution.
254
266
  beforeToolCall: async ({ toolCall, args, context }) => {
255
267
  if (toolCall.name === "bash") {
@@ -272,6 +284,10 @@ const agent = new Agent({
272
284
  return { context: { ...context, messages: await loadCanonicalMessages(signal) } };
273
285
  },
274
286
 
287
+ // Optional turn-boundary hooks that update model, tools, or system messages between turns.
288
+ prepareNextTurn: async (signal) => undefined,
289
+ prepareNextTurnWithContext: async (context, signal) => undefined,
290
+
275
291
  // Finalize a completed turn before turn_end is emitted.
276
292
  // `continue` ensures one next request; existing tool/queue scheduling can satisfy it.
277
293
  // `end` ends this run after turn_end without polling queues.
@@ -289,6 +305,12 @@ const agent = new Agent({
289
305
  });
290
306
  ```
291
307
 
308
+ ### `StreamFn`, `setDefaultStreamFn()`, and `convertToLlm` contracts
309
+
310
+ - **`StreamFn` must never throw or reject** for request, model, or runtime failures. Always return an `AssistantMessageEventStream` and encode failures via stream `error` events and a final `AssistantMessage` with `stopReason: "error"` or `"aborted"` and `errorMessage`.
311
+ - **`convertToLlm` must never throw or reject**; filter or normalize custom messages deterministically.
312
+ - **`setDefaultStreamFn(streamFn | undefined)`:** Sets a process-wide fallback `StreamFn` used when `Agent` or `agentLoop()` callers do not supply an explicit `streamFn`.
313
+
292
314
  ## Agent state
293
315
 
294
316
  ```typescript
@@ -479,6 +501,8 @@ const readFileTool: AgentTool<typeof readFileParameters> = {
479
501
  label: "Read File", // For UI display
480
502
  description: "Read a file's contents",
481
503
  parameters: readFileParameters,
504
+ // Optional JSON Schema describing structuredContent returned to programmatic/codemode callers
505
+ outputSchema: obj({ path: str(), content: str() }),
482
506
  // Override execution mode for this tool (optional).
483
507
  // "sequential" forces the entire batch to run one at a time.
484
508
  // "parallel" allows concurrent execution with other tool calls.
@@ -494,6 +518,7 @@ const readFileTool: AgentTool<typeof readFileParameters> = {
494
518
  // when every finalized tool result in the batch does the same.
495
519
  return {
496
520
  content: [{ type: "text", text: content }],
521
+ structuredContent: { path: params.path, content },
497
522
  details: { path: params.path, size: content.length },
498
523
  };
499
524
  },
@@ -520,9 +545,25 @@ The agent catches thrown errors and reports them to the LLM as tool errors with
520
545
 
521
546
  Return `terminate: true` from `execute()`, a blocked `beforeToolCall`, or `afterToolCall` to skip the follow-up LLM call after the current tool batch. This takes effect only when every finalized tool result in the batch sets `terminate: true`. The hint is runtime-only, so emitted `toolResult` transcript messages remain standard LLM tool results.
522
547
 
523
- ### MCP and Codemode
548
+ ### MCP, Codemode, and `runToolCall()`
549
+
550
+ [`@bastani/atomic-codemode`](/libraries/codemode) runs model-written JavaScript that calls tools. Wrap it as an `AgentTool` named `codemode` whose scripts invoke the agent's tools through `runToolCall(toolCall, options)` so argument validation, `beforeToolCall`, and `afterToolCall` apply to nested calls too.
551
+
552
+ ```typescript
553
+ import { type AgentToolCall, type AgentToolCallOutcome, type RunToolCallOptions, runToolCall } from "@bastani/atomic-agent-core";
554
+
555
+ const outcome: AgentToolCallOutcome = await runToolCall(toolCall, {
556
+ tools,
557
+ assistantMessage,
558
+ context,
559
+ beforeToolCall: agent.beforeToolCall,
560
+ afterToolCall: agent.afterToolCall,
561
+ signal,
562
+ });
563
+ // outcome: { result: AgentToolResult<unknown>, isError: boolean, durationMs?: number }
564
+ ```
524
565
 
525
- [`@bastani/atomic-codemode`](/libraries/codemode) runs model-written JavaScript that calls tools. Wrap it as an `AgentTool` named `codemode` whose scripts call the agent's tools through `runToolCall()` so `beforeToolCall` and `afterToolCall` apply to nested calls too. See [Using with agent-core](/libraries/codemode#using-with-agent-core). Tools that wrap an MCP server's tools work the same way. Atomic's own MCP support lives in the [MCP servers](/mcp-servers) extension.
566
+ `runToolCall()` returns `{ result, isError, durationMs? }` (returning tool failures as `isError: true` rather than throwing). See [Using with agent-core](/libraries/codemode#using-with-agent-core). Tools that wrap an MCP server's tools work the same way. Atomic's own MCP support lives in the [MCP servers](/mcp-servers) extension.
526
567
 
527
568
  ## Proxy usage
528
569
 
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  title: "@bastani/atomic-ai"
3
- sidebarTitle: "AI"
4
- description: "Unified LLM API: providers, models, auth, streaming, tools, images, classification and thinking."
3
+ sidebarTitle: "@bastani/atomic-ai"
4
+ description: "Unified LLM API for providers, models, auth, streaming, tool calling, images, classification, and thinking."
5
5
  ---
6
6
 
7
- `@bastani/atomic-ai` is the LLM library Atomic itself runs on. It ships in every Atomic release at Atomic's version, and you can install it on its own:
7
+ `@bastani/atomic-ai` is the LLM library Atomic runs on (requires Node.js 22.19+). It ships in every Atomic release at Atomic's version, and you can install it independently:
8
8
 
9
9
  ```bash
10
10
  npm install @bastani/atomic-ai
11
11
  ```
12
12
 
13
- Inside an Atomic extension, import it without installing it because the host provides it. See [Libraries](/libraries) for how the packages fit together and for legacy package names that still resolve inside Atomic.
13
+ Inside an Atomic extension, import it without installing it because the host provides it. See [Standalone libraries](/libraries) for how the packages fit together and for legacy package names that still resolve inside Atomic.
14
14
 
15
15
  `@bastani/atomic-ai` provides one LLM API across providers with provider collections, automatic auth resolution, token and cost tracking, and JSON-serializable contexts for mid-session model handoffs.
16
16
 
@@ -18,14 +18,14 @@ Inside an Atomic extension, import it without installing it because the host pro
18
18
 
19
19
  ## Supported providers
20
20
 
21
- - **OpenAI** (API key or Sign in with ChatGPT; separate `openai-images` and `openai-decisions` providers share OpenAI API keys)
21
+ - **OpenAI** (`openai`: API key or Sign in with ChatGPT OAuth; `openai-api` via `openaiApiProvider()`: dedicated API-key-only provider so API billing stays separate from ChatGPT OAuth; separate `openai-images` and `openai-decisions` providers share OpenAI API keys)
22
22
  - **Ant Ling**
23
23
  - **Azure** (Azure OpenAI Responses and Microsoft Foundry Chat Completions)
24
24
  - **OpenAI Codex** (ChatGPT subscription via OAuth)
25
25
  - **TypeSafe** (System One classifier API)
26
26
  - **DeepSeek**
27
27
  - **NVIDIA NIM**
28
- - **Anthropic** (API key, bearer token, workload identity federation, or Claude Pro/Max OAuth)
28
+ - **Anthropic** (`anthropic`: API key, bearer token, workload identity federation, or Claude Pro/Max OAuth; `anthropic-api` via `anthropicApiProvider()`: dedicated API-key-only provider so API billing stays separate from Claude Pro/Max OAuth)
29
29
  - **Google**
30
30
  - **Vertex AI** (Gemini via Google Cloud Vertex AI)
31
31
  - **Mistral**
@@ -60,7 +60,12 @@ Inside an Atomic extension, import it without installing it because the host pro
60
60
  npm install @bastani/atomic-ai
61
61
  ```
62
62
 
63
- `@bastani/atomic-ai` re-exports TypeBox's `Type`, `Static`, and `TSchema`.
63
+ Requires Node.js 22.19 or newer.
64
+
65
+ Key root and subpath exports:
66
+
67
+ - Root `@bastani/atomic-ai`: `createModels`, `createProvider`, `Type`/`Static`/`TSchema` (re-exported from TypeBox), thinking helpers (`DEFAULT_THINKING_BUDGETS`, `fittedThinkingBudget`, `thinkingBudgetForLevel`, `getSupportedThinkingLevels`, `clampThinkingLevel`), `OAuthRefreshRejectedError`, `GitHubCopilot*Error`, `cleanupSessionResources`, and `PI_AI_VERSION`.
68
+ - Subpaths: `@bastani/atomic-ai/providers/<provider>`, `@bastani/atomic-ai/providers/all`, `@bastani/atomic-ai/api/<api-id>`, `@bastani/atomic-ai/session-resources`, `@bastani/atomic-ai/bun-oauth`, `@bastani/atomic-ai/oauth`, and `@bastani/atomic-ai/compat`.
64
69
 
65
70
  ## Quick start
66
71
 
@@ -1774,6 +1779,8 @@ Rules:
1774
1779
 
1775
1780
  Avoid `@bastani/atomic-ai/compat` in new bundled apps because it preserves the legacy global API and pulls in the full built-in catalog.
1776
1781
 
1782
+ ### Bundler troubleshooting
1783
+
1777
1784
  For single-file Node ESM bundles, some SDK dependencies may still use dynamic CommonJS `require()` internally. If you see errors such as `Dynamic require of "child_process" is not supported`, add a Node `require` shim to the bundle. With esbuild:
1778
1785
 
1779
1786
  ```bash
@@ -1913,15 +1920,17 @@ Official docs: [Application Default Credentials](https://cloud.google.com/docs/a
1913
1920
 
1914
1921
  ### CLI login
1915
1922
 
1916
- The quickest way to authenticate:
1923
+ `@bastani/atomic-ai` ships the `atomic-ai` binary (with `pi-ai` kept as a legacy alias) to log into built-in **OAuth** providers:
1917
1924
 
1918
1925
  ```bash
1919
- npx @bastani/atomic-ai login # interactive provider selection
1920
- npx @bastani/atomic-ai login anthropic # login to specific provider
1921
- npx @bastani/atomic-ai list # list available providers
1926
+ npx @bastani/atomic-ai login # interactive OAuth provider selection
1927
+ npx @bastani/atomic-ai login anthropic # log into a specific OAuth provider
1928
+ npx @bastani/atomic-ai list # list OAuth-enabled providers
1929
+ # Or when installed locally/globally:
1930
+ atomic-ai login anthropic
1922
1931
  ```
1923
1932
 
1924
- Credentials are saved to `auth.json` in the current directory.
1933
+ The CLI lists only providers that support OAuth (`provider.auth.oauth`), and writes credentials to `auth.json` in the current working directory with owner-only permissions (`0600`).
1925
1934
 
1926
1935
  ### Programmatic OAuth
1927
1936
 
@@ -1,11 +1,27 @@
1
1
  ---
2
2
  title: "@bastani/atomic-codemode"
3
- sidebarTitle: "Codemode"
4
- description: "Sandboxed JavaScript execution where the only capability is calling injected tools."
3
+ sidebarTitle: "@bastani/atomic-codemode"
4
+ description: "Run model-written JavaScript in a QuickJS WebAssembly sandbox whose only capability is calling injected tools."
5
5
  ---
6
6
 
7
7
  Runs model-written JavaScript in a QuickJS VM (compiled to WebAssembly) where the only capability is calling injected tools. Nested tool calls never enter the LLM context; only the script's output and return value do.
8
8
 
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @bastani/atomic-codemode
13
+ ```
14
+
15
+ Requires Node.js 22.19+ (or Bun / Cloudflare Workers via the portable subpaths). Available package entry points:
16
+
17
+ - `@bastani/atomic-codemode`: `CodemodeSandbox`, `loadQuickJSWasm`, `parseCodemodeSource`, `renderDeclarations`, and worker runtime for Node and Bun.
18
+ - `@bastani/atomic-codemode/portable`: `RemoteCodemodeSandbox` and `InlineCodemodeSandbox` with zero Node.js imports.
19
+ - `@bastani/atomic-codemode/cloudflare`: `CodemodeSandboxDurableObject` and `createInlineCodemodeSandbox` for Cloudflare Workers.
20
+ - `@bastani/atomic-codemode/declarations`: lightweight `renderDeclarations()` without worker or WebAssembly dependencies.
21
+ - `@bastani/atomic-codemode/source`: lightweight `parseCodemodeSource()`, `CodemodeSourceError`, and `CODEMODE_SOURCE_GRAMMAR`.
22
+ - `@bastani/atomic-codemode/node-options`: Node worker option helpers.
23
+ - `@bastani/atomic-codemode/worker`: worker entrypoint for bundled hosts.
24
+
9
25
  Scripts use `tools`, `ALL_TOOLS`, `text`, `image`, `exit`, `store`, and `load`, and may start with a `// @options:` line. Atomic uses it for its built-in [`codemode` tool](/codemode). It has no dependency on the other Atomic packages and can be used on its own to expose any functions (remote APIs, MCP servers, application services) to model-written scripts.
10
26
 
11
27
  The package runs in two kinds of environments. Each has its own sandbox class, but they share one API, one script environment, and one result format:
@@ -50,16 +66,17 @@ await sandbox.close();
50
66
 
51
67
  `code` is the body of an async function, so `return` and top-level `await` work. Inside the script, every sandbox provides:
52
68
 
53
- - `tools.<name>(args)` returns a promise. Arguments and results go through a JSON round trip, and a tool that throws rejects with an `Error` carrying the same message. Tool names are also exposed as identifiers with invalid characters replaced by `_` via `toCodemodeIdentifier`, so `my-tool` is available as both `tools.my_tool` and `tools["my-tool"]`.
69
+ - `tools.<name>(args)` returns a promise. Arguments and results go through a JSON round trip. When a tool rejects with an `Error`, the script catches an `Error` with the same message plus any extra JSON-serializable own properties from that error (such as `code`, excluding `name`, `message`, and `stack`). Tool names are also exposed as identifiers with invalid characters replaced by `_` via `toCodemodeIdentifier`, so `my-tool` is available as both `tools.my_tool` and `tools["my-tool"]`.
54
70
  - `ALL_TOOLS` lists `{ name, description }` for every tool, using the identifier form for `name`.
55
71
  - `text(value)` appends a text item to `result.output`, JSON-stringifying non-string values. `console.log`, `info`, `warn`, `error`, and `debug` append text items with `console: true`.
56
72
  - `image(urlOrItem)` appends an image item. It accepts a base64 `data:` URL, `{ image_url }`, or an image block (`{ type: "image", data, mimeType }`, as MCP tools and `@bastani/atomic-ai` produce). Remote URLs are rejected.
57
73
  - `exit()` ends the script immediately with a successful result, keeping its output and store writes.
58
- - `globals` passed to the sandbox are callable as top-level functions, such as a host helper `image(ref)`. They behave like tools but are not recorded in `result.calls`. A dotted name like `models.classify` places the function on a frozen `models` object. With `spread: true`, `execute` receives all call arguments as an array instead of only the first argument, and `signature` replaces the declaration generated from the schemas.
74
+ - `globals` passed to the sandbox are callable as top-level functions, such as a host helper `image(ref)`. They behave like tools but are not recorded in `result.calls`. Global names must be valid JavaScript identifiers (or dotted `namespace.member` forms, placing the function on a frozen namespace object) and cannot collide with reserved names: `tools`, `ALL_TOOLS`, `console`, `text`, `image`, `exit`, `globalThis`, `store`, or `load`. With `spread: true`, `execute` receives all call arguments as an array instead of only the first argument, and `signature` replaces the declaration generated from the schemas.
59
75
  - `store(key, value)` and `load(key)` read and write JSON values synchronously. See [Store](#store).
76
+ - **Frozen built-in prototypes:** Before running scripts, the VM freezes built-in prototypes (`Object.prototype`, `Array.prototype`, and others, while still allowing instance overrides of `constructor`, `name`, `message`, `toString`, `toLocaleString`, `valueOf`, and `toJSON`). Scripts that attempt to monkey-patch built-in prototypes throw a `TypeError`.
60
77
  - Nothing else is available. There are no timers, `fetch`, `process`, `require`, modules, or `WebAssembly`. `eval` and `Function` work, but they only evaluate code inside the same VM.
61
78
 
62
- Setting `timeoutMs: Infinity` disables the deadline so the script runs until it settles or `signal` aborts it. A script that awaits a promise nothing can settle (with no tool call pending and no timers or I/O in the VM) fails immediately instead of hanging.
79
+ When `timeoutMs` is omitted, `CodemodeSandbox` uses `DEFAULT_TIMEOUT_MS` (`300_000` ms, or 5 minutes). Setting `timeoutMs: Infinity` disables the deadline so the script runs until it settles or `signal` aborts it. A script that awaits a promise nothing can settle (with no tool call pending and no timers or I/O in the VM) fails immediately instead of hanging.
63
80
 
64
81
  `memoryLimitBytes` caps the VM heap. Allocations beyond that limit fail inside the script with `InternalError: out of memory`.
65
82
 
@@ -107,7 +124,12 @@ const source = await tools.read({ path: "package.json" });
107
124
  text(JSON.parse(source).name);
108
125
  ```
109
126
 
110
- Supported fields are `max_output_tokens` (an output token budget) and `timeout_ms` (a hard deadline). The sandbox does not enforce them; the caller decides how to apply them. The options line is replaced by an empty line so line numbers in stack traces still match the input.
127
+ Supported JSON fields on the `// @options:` header line are snake_case:
128
+
129
+ - `max_output_tokens`: non-negative safe integer (`>= 0`; `0` is valid), returned as `options.maxOutputTokens`.
130
+ - `timeout_ms`: positive safe integer from `1` to `2,147,483,647`, returned as `options.timeoutMs`.
131
+
132
+ `parseCodemodeSource()` returns `{ code, options: { maxOutputTokens?, timeoutMs? } }`. The sandbox does not enforce these limits itself; the caller decides how to apply them. The options line is replaced by a blank line so line numbers in stack traces still match the input.
111
133
 
112
134
  Empty input, invalid JSON, unknown fields, an options line without code, or an options line after line 1 throw `CodemodeSourceError`. `CODEMODE_SOURCE_GRAMMAR` is a Lark grammar for providers that support grammar-constrained tool input. Both exports are also available from the lightweight `@bastani/atomic-codemode/source` entry.
113
135
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "@bastani/atomic-schema"
3
- sidebarTitle: "Schema"
4
- description: "JSON Schema builders and validation without eval, for drafts 2020-12 and 7."
3
+ sidebarTitle: "@bastani/atomic-schema"
4
+ description: "Build and validate JSON Schema drafts 2020-12 and 7 without eval, with zero runtime dependencies and optional coercion."
5
5
  ---
6
6
 
7
7
  JSON Schema builders and validation without `eval`. Each schema compiles once into plain closures, so validation runs without code generation, works under a strict Content Security Policy, and needs no runtime dependencies.
@@ -48,7 +48,7 @@ read.errors({ offset: 0, extra: true });
48
48
 
49
49
  `check(value)` is the fast boolean path. It is a standalone function you can pass around, and it avoids allocations for most schemas.
50
50
 
51
- `errors(value)` explains failures and returns `[]` for valid values. The error explainer is built on the first failure and reused, so schemas whose inputs always pass never pay for it. `validate(value)` runs both without modifying the input and returns `{ ok: true, value }` or `{ ok: false, errors }`.
51
+ `errors(value)` explains failures and returns `ValidationError[]` (`{ path: string; keyword: string; message: string }`), or `[]` for valid values. The error explainer is built on the first failure and reused, so schemas whose inputs always pass never pay for it. `validate(value)` runs both without modifying the input and returns `ParseResult<T>` (`{ ok: true; value: T } | { ok: false; errors: ValidationError[] }`).
52
52
 
53
53
  ### Builders
54
54
 
@@ -59,7 +59,7 @@ read.errors({ offset: 0, extra: true });
59
59
  | `bool()`, `nul()`, `unknown()` | `{ type: "boolean" }`, `{ type: "null" }`, `{}` | `boolean`, `null`, `unknown` |
60
60
  | `lit(value)` | `{ const: value }` | the literal |
61
61
  | `oneOf(["a", "b"])` | `{ enum: [...] }` | `"a" \| "b"` |
62
- | `obj({ a: str(), b: opt(num()) }, { open })` | closed object; `open: true` allows other properties | `{ a: string; b?: number }` |
62
+ | `obj({ a: str(), b: opt(num()) }, { open })` | closed object (`additionalProperties: false`); `open: true` omits `additionalProperties` | `{ a: string; b?: number }` |
63
63
  | `arr(items, { minItems, maxItems, uniqueItems })` | `{ type: "array", items }` | `T[]` |
64
64
  | `tuple([str(), num()])` | `prefixItems`, no additional items | `[string, number]` |
65
65
  | `map(value)` | `{ type: "object", additionalProperties: value }` | `Record<string, T>` |
@@ -105,16 +105,16 @@ const validator = compile(schema, {
105
105
  });
106
106
  ```
107
107
 
108
- `formats` includes every format defined in JSON Schema 2020-12 (`date-time`, `email`, `uri`, `uuid`, `ipv6`, and the rest), plus `url` and `json-pointer-uri-fragment`. Pass your own record to check a subset of formats or add custom checks.
108
+ `formats` includes all 21 supported format keys: `date`, `date-time`, `duration`, `email`, `hostname`, `idn-email`, `idn-hostname`, `ipv4`, `ipv6`, `iri`, `iri-reference`, `json-pointer`, `json-pointer-uri-fragment`, `regex`, `relative-json-pointer`, `time`, `uri`, `uri-reference`, `uri-template`, `url`, and `uuid`. Pass your own record to check a subset of formats or add custom checks.
109
109
 
110
110
  By default, an unresolved `$ref` (a missing definition or a document not in `schemas`) throws during `compile()`. With `unresolvedRefs: "reject"`, that reference compiles as `false` instead. Only values at that position fail, with the error `unresolved reference <ref>`, while the rest of the schema continues to validate. Use this option for external schemas such as MCP tool schemas whose references may dangle.
111
111
 
112
112
  ### TypeBox schemas
113
113
 
114
- TypeBox 1.x schemas are JSON Schema objects, so they compile directly:
114
+ TypeBox 1.x schemas are JSON Schema objects, so they compile directly. Inside Atomic extensions and SDK apps, import `Type` from `@bastani/atomic/typebox`; in standalone apps using `@bastani/atomic-schema` alone, import from `typebox` directly:
115
115
 
116
116
  ```typescript
117
- import Type from "typebox";
117
+ import Type from "typebox"; // standalone app; inside Atomic use: import { Type } from "@bastani/atomic/typebox"
118
118
 
119
119
  const user = compile(Type.Object({ name: Type.String(), tags: Type.Array(Type.String()) }));
120
120
  ```