@bastani/atomic 0.10.9 → 0.10.10-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +211 -155
  3. package/dist/_shared/dist-KOELCESV.js +2 -2
  4. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  5. package/dist/_shared/lib-4PES5P4V.js +2 -2
  6. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +27 -12
  7. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
  8. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
  9. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
  10. package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
  11. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  12. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
  13. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
  14. package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
  15. package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
  16. package/dist/_shared/runtime-O4KCSG4C.js +5 -5
  17. package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
  18. package/dist/_shared/sdk-RRLVN7ER.js.map +1 -0
  19. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  20. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  21. package/dist/_shared/settings-startup-8-DNZ2RIHM.js +4 -1
  22. package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
  23. package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
  24. package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
  25. package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
  26. package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
  27. package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +145 -58
  28. package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
  29. package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
  30. package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
  31. package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
  32. package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
  33. package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
  34. package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
  35. package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
  36. package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
  37. package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
  38. package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
  39. package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
  40. package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
  41. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  42. package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
  43. package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
  44. package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
  45. package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
  46. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  47. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  48. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  49. package/dist/builtin/intercom/README.md +85 -114
  50. package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
  51. package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
  52. package/dist/builtin/intercom/group.ts +7 -3
  53. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  54. package/dist/builtin/intercom/package.json +1 -1
  55. package/dist/builtin/mcp/README.md +37 -27
  56. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  57. package/dist/builtin/mcp/package.json +1 -1
  58. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  59. package/dist/builtin/subagents/README.md +71 -138
  60. package/dist/builtin/subagents/package.json +1 -1
  61. package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
  62. package/dist/builtin/web-access/CHANGELOG.md +9 -0
  63. package/dist/builtin/web-access/README.md +60 -87
  64. package/dist/builtin/web-access/index.bundle.mjs +387 -351
  65. package/dist/builtin/web-access/package.json +1 -1
  66. package/dist/cli/args.js +2 -2
  67. package/dist/cli/auth-cli.code.js +4 -4
  68. package/dist/cli/auth-cli.impl.js +3 -3
  69. package/dist/cli/auth-cli.js +3 -3
  70. package/dist/cli/blueprint-command.code.js +2 -2
  71. package/dist/cli/blueprint-command.impl.js +3 -3
  72. package/dist/cli/blueprint-command.js +3 -3
  73. package/dist/cli/intercom-command.code.js +3 -3
  74. package/dist/cli/intercom-command.impl.js +3 -3
  75. package/dist/cli/intercom-command.js +3 -3
  76. package/dist/cli/list-models.code.js +3 -3
  77. package/dist/cli/list-models.impl.js +3 -3
  78. package/dist/cli/list-models.js +3 -3
  79. package/dist/cli/session-picker.code.js +2 -2
  80. package/dist/cli/session-picker.impl.js +3 -3
  81. package/dist/cli/session-picker.js +3 -3
  82. package/dist/cli/startup-ui.code.js +2 -2
  83. package/dist/cli/startup-ui.impl.js +3 -3
  84. package/dist/cli/startup-ui.js +3 -3
  85. package/dist/cli/storage-command.impl.js +3 -3
  86. package/dist/cli/storage-command.js +3 -3
  87. package/dist/cli/storage-search-session.code.js +2 -2
  88. package/dist/cli/storage-search-session.impl.js +3 -3
  89. package/dist/cli/storage-search-session.js +3 -3
  90. package/dist/cli/team-command.code.js +2 -2
  91. package/dist/cli/team-command.impl.js +3 -3
  92. package/dist/cli/team-command.js +3 -3
  93. package/dist/cli.js +2 -2
  94. package/dist/core/agent-session-methods.d.ts +4 -1
  95. package/dist/core/agent-session-methods.js.map +1 -1
  96. package/dist/core/agent-session.d.ts +3 -0
  97. package/dist/core/compaction/compactor.d.ts +20 -14
  98. package/dist/core/compaction/errors.d.ts +120 -0
  99. package/dist/core/compaction/index.d.ts +1 -0
  100. package/dist/core/compaction/model-resolver.d.ts +2 -2
  101. package/dist/core/debug.impl.js +3 -3
  102. package/dist/core/debug.js +3 -3
  103. package/dist/core/export-html/card-projection.impl.js +3 -3
  104. package/dist/core/export-html/card-projection.js +3 -3
  105. package/dist/core/export-html/index.code.js +2 -2
  106. package/dist/core/export-html/index.impl.js +3 -3
  107. package/dist/core/export-html/index.js +3 -3
  108. package/dist/core/export-html/json-spans.impl.js +3 -3
  109. package/dist/core/export-html/json-spans.js +3 -3
  110. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  111. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  112. package/dist/core/export-html/tool-renderer.code.js +1 -1
  113. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  114. package/dist/core/export-html/tool-renderer.js +3 -3
  115. package/dist/core/extensions/api-types.d.ts +1 -1
  116. package/dist/core/extensions/api-types.js.map +1 -1
  117. package/dist/core/extensions/index.d.ts +1 -1
  118. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  119. package/dist/core/extensions/jiti-loader.js +3 -3
  120. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  121. package/dist/core/extensions/jiti-static-loader.js +3 -3
  122. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  123. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  124. package/dist/core/extensions/loader-host-modules.js +3 -3
  125. package/dist/core/extensions/loader-virtual-modules.js +1 -1
  126. package/dist/core/extensions/provider-types.d.ts +18 -6
  127. package/dist/core/extensions/provider-types.js.map +1 -1
  128. package/dist/core/extensions/runner-context.js +1 -1
  129. package/dist/core/intercom-broker-control-host.code.js +1 -1
  130. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  131. package/dist/core/intercom-broker-control-host.js +3 -3
  132. package/dist/core/intercom-broker-control.code.js +3 -3
  133. package/dist/core/intercom-broker-control.impl.js +3 -3
  134. package/dist/core/intercom-broker-control.js +3 -3
  135. package/dist/core/model-config.d.ts +40 -0
  136. package/dist/core/model-registry.js +1 -1
  137. package/dist/core/model-resolver-scope.d.ts +4 -4
  138. package/dist/core/model-runtime.d.ts +1 -1
  139. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  140. package/dist/core/package-manager-storage-adapters.js +3 -3
  141. package/dist/core/provider-composer-internal.d.ts +11 -2
  142. package/dist/core/sdk.code.js +3 -3
  143. package/dist/core/sdk.impl.js +3 -3
  144. package/dist/core/sdk.js +3 -3
  145. package/dist/core/session-manager-core.js +5 -5
  146. package/dist/core/session-manager-list.impl.js +3 -3
  147. package/dist/core/session-manager-list.js +3 -3
  148. package/dist/core/session-manager.code.js +1 -1
  149. package/dist/core/session-manager.impl.js +3 -3
  150. package/dist/core/session-manager.js +3 -3
  151. package/dist/core/session-storage.impl.js +3 -3
  152. package/dist/core/session-storage.js +3 -3
  153. package/dist/core/settings-manager-basic-accessors.d.ts +6 -2
  154. package/dist/core/storage/index.js +2 -2
  155. package/dist/core/storage/node-sqlite-thread.js +2 -2
  156. package/dist/core/storage/node-sqlite.js +2 -2
  157. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  158. package/dist/core/storage/offline-snapshot-file.js +3 -3
  159. package/dist/core/storage/provider.js +2 -2
  160. package/dist/core/storage/selection.js +2 -2
  161. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  162. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  163. package/dist/core/storage/session/branch-fork-source.js +3 -3
  164. package/dist/core/storage/session/card-view.impl.js +3 -3
  165. package/dist/core/storage/session/card-view.js +3 -3
  166. package/dist/core/storage/session/child-reader.code.js +3 -3
  167. package/dist/core/storage/session/child-reader.impl.js +3 -3
  168. package/dist/core/storage/session/child-reader.js +3 -3
  169. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  170. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  171. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  172. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  173. package/dist/core/storage/session/expanded-child-details.js +3 -3
  174. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  175. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  176. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  177. package/dist/core/storage/session/fork-row-index.js +3 -3
  178. package/dist/core/storage/session/fork-staging.code.js +2 -2
  179. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  180. package/dist/core/storage/session/fork-staging.js +3 -3
  181. package/dist/core/storage/session/fork-window.code.js +3 -3
  182. package/dist/core/storage/session/fork-window.impl.js +3 -3
  183. package/dist/core/storage/session/fork-window.js +3 -3
  184. package/dist/core/storage/session/history-pages.impl.js +3 -3
  185. package/dist/core/storage/session/history-pages.js +3 -3
  186. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  187. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  188. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  189. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  190. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  191. package/dist/core/storage/session/memory-session-store.js +3 -3
  192. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  193. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  194. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  195. package/dist/core/storage/session/released-history-files.code.js +3 -3
  196. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  197. package/dist/core/storage/session/released-history-files.js +3 -3
  198. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  199. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  200. package/dist/core/storage/session/session-resume.impl.js +3 -3
  201. package/dist/core/storage/session/session-resume.js +3 -3
  202. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  203. package/dist/core/storage/session/snapshot-cut.js +3 -3
  204. package/dist/core/storage/session/snapshot-history.code.js +3 -3
  205. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  206. package/dist/core/storage/session/snapshot-history.js +3 -3
  207. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  208. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  209. package/dist/core/storage/session/sql-session-store.js +3 -3
  210. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  211. package/dist/core/storage/session/tree-outline.js +3 -3
  212. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  213. package/dist/core/storage/session/tree-presentation.js +3 -3
  214. package/dist/core/storage/storage-status.impl.js +3 -3
  215. package/dist/core/storage/storage-status.js +3 -3
  216. package/dist/core/storage/team.impl.js +3 -3
  217. package/dist/core/storage/team.js +3 -3
  218. package/dist/core/structured-output/index.code.js +1 -1
  219. package/dist/core/structured-output/index.impl.js +3 -3
  220. package/dist/core/structured-output/index.js +3 -3
  221. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  222. package/dist/core/tasks/task-completion-entry.js +3 -3
  223. package/dist/core/tasks/task-file-history.code.js +3 -3
  224. package/dist/core/tasks/task-file-history.impl.js +3 -3
  225. package/dist/core/tasks/task-file-history.js +3 -3
  226. package/dist/core/tasks/task-reference-archive.code.js +4 -4
  227. package/dist/core/tasks/task-reference-archive.js +3 -3
  228. package/dist/core/tasks/task-reference-identity.code.js +1 -1
  229. package/dist/core/tasks/task-reference-identity.js +3 -3
  230. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  231. package/dist/core/tasks/task-reference-stream.js +3 -3
  232. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  233. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  234. package/dist/core/tasks/task-view-source.impl.js +3 -3
  235. package/dist/core/tasks/task-view-source.js +3 -3
  236. package/dist/core/tools/read-url.code.js +2 -2
  237. package/dist/core/tools/read-url.impl.js +3 -3
  238. package/dist/core/tools/read-url.js +3 -3
  239. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  240. package/dist/core/worktree-snapshot/errors.code.js +3 -3
  241. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  242. package/dist/core/worktree-snapshot/errors.js +3 -3
  243. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  244. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  245. package/dist/extensions/codemode/execute.code.js +1 -1
  246. package/dist/extensions/codemode/execute.impl.js +3 -3
  247. package/dist/extensions/codemode/execute.js +3 -3
  248. package/dist/extensions/codemode/renderer.code.js +2 -2
  249. package/dist/extensions/codemode/renderer.impl.js +3 -3
  250. package/dist/extensions/codemode/renderer.js +3 -3
  251. package/dist/extensions/mcp/cli.code.js +2 -2
  252. package/dist/extensions/mcp/cli.impl.js +3 -3
  253. package/dist/extensions/mcp/cli.js +3 -3
  254. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  255. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  256. package/dist/extensions/mcp/cli.lazy.js +3 -3
  257. package/dist/extensions/mcp/runtime.code.js +1 -1
  258. package/dist/extensions/mcp/runtime.impl.js +3 -3
  259. package/dist/extensions/mcp/runtime.js +3 -3
  260. package/dist/index-extensions.d.ts +1 -1
  261. package/dist/index.d.ts +8 -1
  262. package/dist/index.js +7 -7
  263. package/dist/main-first-time-setup.code.js +2 -2
  264. package/dist/main-first-time-setup.impl.js +3 -3
  265. package/dist/main-first-time-setup.js +3 -3
  266. package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -0
  267. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  268. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  269. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  270. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  271. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  272. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  273. package/dist/modes/interactive/theme/color-utils.d.ts +5 -5
  274. package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
  275. package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
  276. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
  277. package/dist/modes/print-mode.js +1 -1
  278. package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
  279. package/dist/modes/rpc/rpc-types.d.ts +29 -2
  280. package/dist/package-manager-cli.code.js +5 -5
  281. package/dist/package-manager-cli.impl.js +3 -3
  282. package/dist/package-manager-cli.js +3 -3
  283. package/dist/rpc-entry.js +1 -1
  284. package/dist/startup-files.json +1 -1
  285. package/dist/startup-stages/5.js +1 -1
  286. package/dist/startup-stages/7.js +1 -1
  287. package/dist/startup-stages/8.js +1 -2
  288. package/dist/startup-stages/9.js +2 -1
  289. package/dist/utils/native-module.d.ts +44 -0
  290. package/dist/utils/startup-database-spare.code.js +3 -3
  291. package/dist/utils/startup-database-spare.impl.js +3 -3
  292. package/dist/utils/startup-database-spare.js +3 -3
  293. package/dist/utils/tools-manager.code.js +1 -1
  294. package/dist/utils/tools-manager.impl.js +3 -3
  295. package/dist/utils/tools-manager.js +3 -3
  296. package/docs/background-tasks.md +235 -243
  297. package/docs/build.md +12 -11
  298. package/docs/codemode.md +60 -51
  299. package/docs/compaction/reference.md +61 -24
  300. package/docs/compaction.md +117 -65
  301. package/docs/computer-use.md +179 -146
  302. package/docs/containerization.md +79 -33
  303. package/docs/custom-provider/api-reference.md +148 -11
  304. package/docs/custom-provider/oauth.md +44 -27
  305. package/docs/custom-provider/override.md +14 -7
  306. package/docs/custom-provider/registration.md +75 -65
  307. package/docs/custom-provider/streaming.md +42 -19
  308. package/docs/custom-provider.md +25 -61
  309. package/docs/development.md +47 -43
  310. package/docs/docs.json +33 -33
  311. package/docs/environment-variables.md +83 -57
  312. package/docs/extensions/api-reference.md +323 -734
  313. package/docs/extensions/authoring.md +186 -269
  314. package/docs/extensions/events.md +308 -375
  315. package/docs/extensions/examples.md +122 -74
  316. package/docs/extensions/ui.md +217 -197
  317. package/docs/extensions.md +152 -259
  318. package/docs/getting-started/authentication.md +27 -14
  319. package/docs/getting-started/first-session.md +25 -26
  320. package/docs/getting-started/installation.md +62 -84
  321. package/docs/getting-started/project-instructions.md +39 -14
  322. package/docs/guides/configuration.md +42 -20
  323. package/docs/guides/intercom.md +17 -13
  324. package/docs/guides/non-interactive.md +29 -16
  325. package/docs/guides/orchestration.md +16 -10
  326. package/docs/guides/resume-on-any-machine.md +54 -49
  327. package/docs/guides/subagents.md +22 -14
  328. package/docs/guides/team-setup.md +37 -26
  329. package/docs/guides.md +22 -21
  330. package/docs/herdr.md +21 -16
  331. package/docs/index.md +16 -17
  332. package/docs/intercom/operations.md +68 -66
  333. package/docs/intercom/reference.md +196 -191
  334. package/docs/intercom.md +103 -92
  335. package/docs/json.md +71 -71
  336. package/docs/keybindings.md +63 -50
  337. package/docs/libraries/agent-core.md +49 -8
  338. package/docs/libraries/ai.md +21 -12
  339. package/docs/libraries/codemode.md +28 -6
  340. package/docs/libraries/schema.md +7 -7
  341. package/docs/libraries/telemetry.md +7 -7
  342. package/docs/libraries/tui.md +74 -94
  343. package/docs/libraries.md +5 -5
  344. package/docs/llama-cpp.md +38 -33
  345. package/docs/mcp-servers.md +96 -90
  346. package/docs/models/reference.md +46 -33
  347. package/docs/models-configuration.md +12 -6
  348. package/docs/models.md +93 -88
  349. package/docs/orchestration/migrating-workflows.md +21 -19
  350. package/docs/orchestration/patterns.md +35 -20
  351. package/docs/orchestration.md +22 -21
  352. package/docs/packages/authoring.md +28 -19
  353. package/docs/packages/reference.md +75 -16
  354. package/docs/packages.md +31 -33
  355. package/docs/programmatic.md +22 -21
  356. package/docs/prompt-templates.md +63 -41
  357. package/docs/providers/reference.md +35 -19
  358. package/docs/providers.md +61 -71
  359. package/docs/quickstart.md +32 -46
  360. package/docs/reference/cli.md +249 -252
  361. package/docs/reference.md +23 -20
  362. package/docs/rpc/examples.md +74 -17
  363. package/docs/rpc/extension-ui.md +79 -62
  364. package/docs/rpc/protocol.md +816 -358
  365. package/docs/rpc.md +75 -151
  366. package/docs/sdk/reference.md +175 -45
  367. package/docs/sdk/structured-decisions.md +92 -62
  368. package/docs/sdk/web-server.md +79 -46
  369. package/docs/sdk.md +237 -195
  370. package/docs/security.md +106 -43
  371. package/docs/session-format.md +96 -59
  372. package/docs/sessions.md +149 -113
  373. package/docs/settings.md +289 -204
  374. package/docs/shell-aliases.md +15 -6
  375. package/docs/skills/authoring.md +17 -9
  376. package/docs/skills/reference.md +23 -21
  377. package/docs/skills.md +104 -97
  378. package/docs/storage.md +140 -242
  379. package/docs/subagents/authoring.md +147 -16
  380. package/docs/subagents/reference.md +100 -30
  381. package/docs/subagents.md +220 -252
  382. package/docs/terminal-setup.md +97 -69
  383. package/docs/termux.md +51 -85
  384. package/docs/themes/reference.md +51 -37
  385. package/docs/themes.md +49 -54
  386. package/docs/tmux.md +38 -21
  387. package/docs/tools.md +198 -147
  388. package/docs/tui/reference.md +64 -32
  389. package/docs/tui.md +38 -66
  390. package/docs/usage.md +76 -78
  391. package/docs/verification.md +25 -25
  392. package/docs/web-access.md +72 -55
  393. package/docs/windows.md +53 -58
  394. package/docs/worktree-snapshots.md +62 -65
  395. package/package.json +8 -8
  396. package/schemas/models.schema.json +51 -0
  397. package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
  398. package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
  399. package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
  400. package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
  401. package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
package/docs/reference.md CHANGED
@@ -1,45 +1,48 @@
1
1
  ---
2
- title: Reference
2
+ title: "Reference index"
3
3
  sidebarTitle: "Reference index"
4
- description: "Exact contracts for Atomic CLI commands, settings, environment variables, keybindings, tools, storage, models, extensions, SDK, RPC, and TUI."
4
+ description: "Look up Atomic CLI flags, settings, environment variables, keybindings, tools, storage, customization schemas, and APIs."
5
5
  ---
6
6
 
7
- # Reference
7
+ Look up exact commands, settings, configuration schemas, tool behaviors, and API references here. For task walkthroughs, start with [Task guides](/guides) or [Build with Atomic](/build).
8
8
 
9
- Look up exact commands, settings, types, and tool contracts here. For a walkthrough, start with [Guides](/guides) or [Build with Atomic](/build).
9
+ ## Core reference
10
10
 
11
- ## Everyday contracts
12
-
13
- - [CLI reference](/reference/cli) covers commands, flags, arguments, and exit codes.
14
- - [Settings](/settings) lists every `settings.json` field with defaults and constraints.
15
- - [Environment variables](/environment-variables) documents Atomic and legacy Pi variables, provider credentials, and shell session metadata.
16
- - [Keybindings](/keybindings) lists default shortcuts and custom `keybindings.json` actions.
11
+ - [CLI reference](/reference/cli) covers commands, flags, model-matching rules, arguments, and exit codes.
12
+ - [Settings](/settings) lists every `settings.json` field with defaults, scopes, and constraints.
13
+ - [Environment variables](/environment-variables) documents Atomic variables, value parsing rules, legacy Pi aliases, color controls, and shell session metadata.
14
+ - [Keybindings](/keybindings) lists default shortcuts and custom `keybindings.json` configuration rules.
17
15
  - [Built-in tools](/tools) covers default coding tools, path selectors, and [exact-text editing](/tools#edit).
18
16
  - [Codemode](/codemode) documents sandbox globals, tool calls, stored values, classifiers, image generation, and limits.
19
- - [MCP Servers](/mcp-servers) covers server configuration, tool exposure, resources, and authentication.
17
+ - [MCP servers](/mcp-servers) covers server configuration, tool exposure, resources, and authentication.
20
18
  - [Web access](/web-access) documents `web_search`, `fetch_content`, `get_search_content`, `code_search`, slash commands, shortcuts, and `web-search.json`.
21
- - [Session format](/session-format) specifies the JSONL format, entry types, and `SessionManager` API.
22
19
 
23
- ## Domain contracts
20
+ ## Models, sessions, and storage
24
21
 
25
22
  - [Provider reference](/providers/reference) covers stop reasons and credential resolution order.
26
23
  - [Model configuration reference](/models/reference) covers provider and model overrides, variants, and API compatibility.
27
24
  - [Models configuration](/models-configuration) lists the generated `models.json` field reference.
25
+ - [Session format](/session-format) specifies the JSONL format, entry types, and `SessionManager` API.
28
26
  - [Compaction reference](/compaction/reference) covers parameters, saved boundaries, hooks, exports, settings, and historical formats.
27
+ - [Storage](/storage) covers local SQLite, shared libSQL and PostgreSQL databases, adapters, and CLI commands.
28
+
29
+ ## Customization reference
30
+
29
31
  - [Skill reference](/skills/reference) specifies `SKILL.md` frontmatter and validation rules.
30
32
  - [Subagent reference](/subagents/reference) covers discovery, automatic model selection, fallback models, and reasoning levels.
31
- - [Intercom reference](/intercom/reference) specifies the `intercom` tool contract, delivery rules, and settings.
33
+ - [Intercom reference](/intercom/reference) specifies the `intercom` tool, delivery rules, groups, and settings.
32
34
  - [Package reference](/packages/reference) covers package filtering, scope, and deduplication.
33
35
  - [Theme reference](/themes/reference) specifies the theme file format, color tokens, and color values.
36
+
37
+ ## API and protocol reference
38
+
34
39
  - [Extension API reference](/extensions/api-reference) documents `ExtensionContext`, `ExtensionCommandContext`, and `ExtensionAPI` methods.
35
40
  - [Extension events](/extensions/events) lists every extension event and its payload.
36
- - [Provider API reference](/custom-provider/api-reference) specifies custom provider configuration and model definition contracts.
41
+ - [Provider API reference](/custom-provider/api-reference) specifies custom provider configuration and model definition options.
37
42
  - [SDK API reference](/sdk/reference) covers options, loaders, return values, run modes, and exports.
38
- - [Storage](/storage) covers local SQLite, shared libSQL and PostgreSQL databases, adapters, and CLI commands.
39
43
  - [Structured decisions](/sdk/structured-decisions) documents `decide()`, structured output tools, and provider limits.
40
44
  - [RPC protocol](/rpc/protocol) documents RPC commands, events, types, and errors.
41
- - [TUI API reference](/tui/reference) specifies component, focusable, input, and rendering contracts.
42
- - [Orchestration](/orchestration) explains how to launch subagents from codemode and combine their results.
45
+ - [TUI API reference](/tui/reference) specifies component, focusable, input, and rendering interfaces.
43
46
 
44
47
  ## Platform setup
45
48
 
@@ -50,7 +53,7 @@ Look up exact commands, settings, types, and tool contracts here. For a walkthro
50
53
  - [Herdr](/herdr)
51
54
  - [Shell aliases](/shell-aliases)
52
55
 
53
- ## Project
56
+ ## Diagnostics and changelog
54
57
 
55
- - [Development](/development) covers debug mode, UI stall profiling, and conversion diagnostics.
58
+ - [Diagnostics and debugging](/development) covers debug mode, `/debug` snapshots, UI stall profiling, and conversion diagnostics.
56
59
  - [Changelog](/changelog) lists version history and release notes.
@@ -1,13 +1,32 @@
1
1
  ---
2
- title: RPC client examples
3
- description: Additional RPC client implementations.
2
+ title: "RPC client examples"
3
+ sidebarTitle: "RPC examples"
4
+ description: "Connect to Atomic RPC mode using the typed RpcClient in TypeScript or a standalone Node.js script."
4
5
  ---
5
6
 
6
- # RPC client examples
7
-
8
7
  ## Typed TypeScript client (`RpcClient`)
9
8
 
10
- Install `@bastani/atomic` and use the exported `RpcClient` to launch Atomic in a child process, send typed commands, stream events, and wait for turns to settle. By default `RpcClient` runs `bun dist/cli.js`; pass `runtimeExecutable: process.execPath` and resolve `@bastani/atomic/rpc-entry` to launch the installed package under Node.js (or pass `runtimeExecutable: "atomic"` with `cliPath: ""` to drive an `atomic` binary on `PATH`).
9
+ Install `@bastani/atomic` and use `RpcClient` to spawn Atomic in a child process, send typed commands, stream events, answer extension UI requests, and wait for turns to settle.
10
+
11
+ By default `RpcClient` launches `bun dist/cli.js`. To launch the installed package under Node.js, pass `runtimeExecutable: process.execPath` and resolve `@bastani/atomic/rpc-entry`. To drive an `atomic` binary already on `PATH`, pass `runtimeExecutable: "atomic"` and `cliPath: ""`.
12
+
13
+ ### `RpcClientOptions`
14
+
15
+ | Option | Default | Description |
16
+ | --- | --- | --- |
17
+ | `cliPath` | `"dist/cli.js"` | Path to the Atomic CLI entry script (pass `""` when `runtimeExecutable` is `"atomic"`). |
18
+ | `cwd` | `process.cwd()` | Working directory for the child process. |
19
+ | `env` | `undefined` | Extra environment variables merged into the child process environment. |
20
+ | `provider` | `undefined` | Passed as `--provider <provider>`. |
21
+ | `model` | `undefined` | Passed as `--model <model>`. |
22
+ | `args` | `[]` | Additional CLI flags forwarded to Atomic (for example `["--no-session"]`). |
23
+ | `runtimeExecutable` | `"bun"` | Executable used to spawn the child process. |
24
+ | `runtimeArgs` | `[]` | Arguments passed to `runtimeExecutable` before `cliPath`. |
25
+ | `requestTimeoutMs` | `30000` | Timeout in milliseconds for short metadata and control commands. |
26
+
27
+ **Request timeout exemptions:** `requestTimeoutMs` (default `30_000` ms) applies only to short metadata and control requests such as `get_state`, `get_available_models`, `set_model`, `get_entries`, and `list_sessions`. Long-lived or interaction-gated commands (`prompt`, `steer`, `follow_up`, `resume_queued_messages`, `bash`, `user_bash`, `compact`, `login_provider`, `fork`, `clone`, `switch_session`, `new_session`, `import_session`, `navigate_tree`, `invoke_shortcut`, `start_pending_recovery`, `start_pending_recovery_restore`) and cooperative cancellation commands (`abort`, `abort_bash`, `abort_compaction`, `abort_branch_summary`, `abort_retry`, `cancel_login_provider`) are exempt and never time out on the client timer. If the child exits or the transport breaks, pending requests reject immediately.
28
+
29
+ ### Basic prompt and streaming
11
30
 
12
31
  ```typescript
13
32
  import { fileURLToPath } from "node:url";
@@ -17,6 +36,7 @@ const client = new RpcClient({
17
36
  runtimeExecutable: process.execPath,
18
37
  cliPath: fileURLToPath(import.meta.resolve("@bastani/atomic/rpc-entry")),
19
38
  args: ["--no-session"],
39
+ requestTimeoutMs: 30_000,
20
40
  });
21
41
 
22
42
  const unsubscribe = client.onEvent((event) => {
@@ -35,15 +55,52 @@ try {
35
55
  }
36
56
  ```
37
57
 
58
+ ### Handling extension UI and questionnaires
59
+
60
+ Subscribe with `onExtensionUIRequest()` and reply with `respondExtensionUI()`. Opt in to `ask_user_question` questionnaires by calling `setExtensionUiCapabilities({ questionnaire: true })` right after `start()`:
61
+
62
+ ```typescript
63
+ await client.start();
64
+ await client.setExtensionUiCapabilities({ questionnaire: true });
65
+
66
+ const unsubscribeUi = client.onExtensionUIRequest((request) => {
67
+ if (request.method === "confirm") {
68
+ void client.respondExtensionUI({
69
+ type: "extension_ui_response",
70
+ id: request.id,
71
+ confirmed: true,
72
+ });
73
+ } else if (request.method === "select") {
74
+ void client.respondExtensionUI({
75
+ type: "extension_ui_response",
76
+ id: request.id,
77
+ value: request.options[0],
78
+ });
79
+ } else if (request.method === "questionnaire") {
80
+ const answers = request.questions.map((q, questionIndex) => ({
81
+ questionIndex,
82
+ question: q.question,
83
+ kind: "option" as const,
84
+ answer: q.options[0].label,
85
+ }));
86
+ void client.respondExtensionUI({
87
+ type: "extension_ui_response",
88
+ id: request.id,
89
+ answers,
90
+ });
91
+ }
92
+ });
93
+ ```
94
+
38
95
  More TypeScript examples live in the repository under [`examples/rpc-client.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/rpc-client.ts), [`examples/rpc-extension-ui.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/rpc-extension-ui.ts), and [`examples/extensions/rpc-demo.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/rpc-demo.ts).
39
96
 
40
- ## Example: interactive client (Node.js)
97
+ ## Standalone Node.js client
41
98
 
42
- This standalone Node.js script spawns an installed `atomic --mode rpc` binary directly and reads stdout with strict LF-only JSONL framing (avoiding Node's `readline`, which splits on `U+2028` and `U+2029`).
99
+ This ESM script spawns an installed `atomic --mode rpc` binary without importing `@bastani/atomic`, parses stdout with strict LF-only JSONL framing (avoiding Node's `readline`, which splits on `U+2028` and `U+2029`), aborts on `SIGINT`, and closes stdin cleanly when the turn finishes:
43
100
 
44
101
  ```javascript
45
- const { spawn } = require("child_process");
46
- const { StringDecoder } = require("string_decoder");
102
+ import { spawn } from "node:child_process";
103
+ import { StringDecoder } from "node:string_decoder";
47
104
 
48
105
  const agent = spawn("atomic", ["--mode", "rpc", "--no-session"]);
49
106
 
@@ -61,7 +118,7 @@ function attachJsonlReader(stream, onLine) {
61
118
  let line = buffer.slice(0, newlineIndex);
62
119
  buffer = buffer.slice(newlineIndex + 1);
63
120
  if (line.endsWith("\r")) line = line.slice(0, -1);
64
- onLine(line);
121
+ if (line.length > 0) onLine(line);
65
122
  }
66
123
  });
67
124
 
@@ -76,18 +133,18 @@ function attachJsonlReader(stream, onLine) {
76
133
  attachJsonlReader(agent.stdout, (line) => {
77
134
  const event = JSON.parse(line);
78
135
 
79
- if (event.type === "message_update") {
80
- const { assistantMessageEvent } = event;
81
- if (assistantMessageEvent.type === "text_delta") {
82
- process.stdout.write(assistantMessageEvent.delta);
83
- }
136
+ if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
137
+ process.stdout.write(event.assistantMessageEvent.delta);
138
+ }
139
+
140
+ if (event.type === "agent_end") {
141
+ process.stdout.write("\n");
142
+ agent.stdin.end();
84
143
  }
85
144
  });
86
145
 
87
- // Send prompt
88
146
  agent.stdin.write(JSON.stringify({ type: "prompt", message: "Hello" }) + "\n");
89
147
 
90
- // Abort on CTRL+C
91
148
  process.on("SIGINT", () => {
92
149
  agent.stdin.write(JSON.stringify({ type: "abort" }) + "\n");
93
150
  });
@@ -1,39 +1,49 @@
1
1
  ---
2
- title: RPC extension UI protocol
3
- description: Drive extension-rendered UI over the RPC transport.
2
+ title: "RPC extension UI protocol"
3
+ sidebarTitle: "RPC UI protocol"
4
+ description: "Handle extension dialogs, notifications, status bars, widgets, questionnaires, and OAuth prompts over the RPC transport."
4
5
  ---
5
6
 
6
- # RPC extension UI protocol
7
-
8
- ## Extension UI protocol
7
+ <div id="extension-ui-protocol" />
9
8
 
10
9
  Extensions request user interaction through `ctx.ui.select()`, `ctx.ui.confirm()`, and related methods. Provider OAuth logins started with `login_provider` use the same `extension_ui_request` and `extension_ui_response` sub-protocol.
11
10
 
12
- There are three categories of extension UI requests:
11
+ Extension UI requests fall into three categories:
13
12
 
14
13
  - **Dialog methods** (`select`, `confirm`, `input`, `editor`, and `questionnaire` when the client [opted in](/rpc/protocol#set_extension_ui_capabilities)): emit an `extension_ui_request` on stdout and wait until the client sends an `extension_ui_response` on stdin with the matching `id`.
15
- - **Fire-and-forget UI methods** (`cancel`, `notify`, `setStatus`, `setWidget`, `setTitle`, `set_editor_text`): emit an `extension_ui_request` on stdout and expect no response. Handle `cancel` by closing its matching dialog; other methods update the client display.
14
+ - **Fire-and-forget UI methods** (`cancel`, `notify`, `setStatus`, `setWidget`, `setTitle`, `set_editor_text`): emit an `extension_ui_request` on stdout and expect no response. Handle `cancel` by closing its matching dialog; other methods update your display.
16
15
  - **OAuth login methods** (`oauth_auth`, `oauth_device_code`, `oauth_progress`, `oauth_info`, `oauth_prompt`, `oauth_select`, `oauth_manual_code`, `oauth_manual_code_cancel`): drive interactive OAuth sign-in during `login_provider`. `oauth_prompt`, `oauth_select`, and `oauth_manual_code` expect an `extension_ui_response` with `value` or `cancelled: true`; the other OAuth methods are fire-and-forget.
17
16
 
18
- When a dialog request includes `timeout` (milliseconds), Atomic auto-resolves with a default value when the timeout expires; clients do not need to track timeouts. For `select`, `confirm`, `input`, and `editor`, Atomic sends `cancel` when a request times out or its caller aborts it.
17
+ When a dialog request carries a `timeout` (in milliseconds) or an `AbortSignal`, Atomic resolves it automatically with its default value (`undefined` for `select`/`input`/`editor`, `false` for `confirm`, `{ answers: [], cancelled: true }` for `questionnaire`) if the timeout expires or the signal aborts. Clients do not need to run their own timers. For `select`, `confirm`, `input`, `editor`, and `questionnaire`, Atomic sends a matching `cancel` notification when the request times out or aborts. Note that `editor` does not serialize `timeout` on the wire request, even though Atomic still enforces `opts.timeout` locally and emits `cancel` if it expires.
18
+
19
+ ## Unsupported and degraded methods in plain RPC mode
20
+
21
+ In RPC mode, `ctx.mode` is `"rpc"` and `ctx.hasUI` is `true` because dialog and fire-and-forget methods work through this protocol. Guard terminal-only features such as `ctx.ui.custom()` with `ctx.mode === "tui"`.
22
+
23
+ The following `ExtensionUIContext` methods are unsupported or degraded in plain RPC mode:
19
24
 
20
- Some `ExtensionUIContext` methods are unsupported or degraded in RPC mode because they require direct TUI access:
21
- - `custom()` returns `undefined`.
22
- - `setWorkingMessage()`, `setWorkingIndicator()`, `setFooter()`, `setHeader()`, and `setEditorComponent()` are no-ops.
23
- - `getEditorText()` returns `""`.
24
- - `setToolsExpanded()` and `getToolsExpanded()` maintain context-local expansion state, matching `getChatRenderSettings().toolOutputExpanded` (not sent over the extension UI protocol). `getChatRenderSettings().hideThinkingBlock` is `false` unless Atomic's own interactive host drives the session.
25
- - `pasteToEditor()` delegates to `setEditorText()` without paste or collapse handling.
26
- - `getAllThemes()` returns `[]`, `getTheme()` returns `undefined`, and `setTheme()` returns `{ success: false, error: "..." }`.
25
+ - `setWidget(key, factory)`: passing a component factory function throws `Error("Component-factory widgets are unavailable in this RPC host.")`. Only string arrays (or `undefined` to clear) work over plain RPC.
26
+ - `custom()`: resolves to `undefined`.
27
+ - `hostSessionPicker` and `hostInputForm`: omitted (`undefined`).
28
+ - `setWorkingMessage()`, `setWorkingVisible()`, `setWorkingIndicator()`, `setHiddenThinkingLabel()`, `setFooter()`, `setHeader()`, `setEditorComponent()`, `addAutocompleteProvider()`, and `requestRender()`: no-ops.
29
+ - `onTerminalInput()`, `onHostCustomUiStateChange()`, and `onWidgetRelease()`: return a no-op unsubscribe function.
30
+ - `getEditorText()`: returns `""`.
31
+ - `getEditorComponent()`: returns `undefined`.
32
+ - `pasteToEditor(text)`: delegates to `setEditorText(text)` without paste-collapse handling.
33
+ - `getFooterDataProvider()`: returns a stub where `getGitBranch()` returns `null`, `getExtensionStatuses()` returns an empty `Map`, `getAvailableProviderCount()` returns `1`, and `onBranchChange()` returns a no-op unsubscribe function.
34
+ - `getHostCustomUiState()`: returns `{ blockingInlineCustomUiDepth: 0, blockingInlineCustomUiActive: false }`; `focusHostInlineCustomUi()` returns `false`.
35
+ - `setToolsExpanded()` and `getToolsExpanded()`: store expansion state locally for the session, matching `getChatRenderSettings().toolOutputExpanded` (not sent over the wire). `getChatRenderSettings().hideThinkingBlock` is `false`.
36
+ - `getAllThemes()` returns `[]`, `getTheme()` returns `undefined`, and `setTheme()` returns `{ success: false, error: "Theme switching not supported in RPC mode" }`.
27
37
 
28
- In RPC mode, `ctx.mode` is `"rpc"` and `ctx.hasUI` is `true` because dialog and fire-and-forget methods work through this protocol. Guard terminal-only features like `custom()` with `ctx.mode === "tui"`.
38
+ ## Extension UI requests (stdout)
29
39
 
30
- ### Extension UI requests (stdout)
40
+ Every request includes `type: "extension_ui_request"`, a unique `id`, and a `method`. A later `cancel` request repeats the `id` of the dialog it cancels.
31
41
 
32
- All requests have `type: "extension_ui_request"`, an `id`, and a `method` field. Each dialog has a unique `id`; a later `cancel` request repeats that dialog's `id`. Requests can overlap. If your client displays one dialog at a time, queue later requests instead of replacing the current dialog. Remove a queued dialog on a matching `cancel` without showing it or sending a response.
42
+ Requests can overlap. If your client shows one dialog at a time, queue incoming dialogs instead of replacing the active one. When a `cancel` arrives for a queued dialog, remove it without showing it or sending a response.
33
43
 
34
- #### select
44
+ ### select
35
45
 
36
- Prompt the user to choose from a list. Dialog methods with a `timeout` field include the timeout in milliseconds; the agent auto-resolves with `undefined` if the client doesn't respond in time.
46
+ Prompt the user to pick one option from a list. If `timeout` expires, Atomic resolves with `undefined` and sends `cancel`.
37
47
 
38
48
  ```json
39
49
  {
@@ -48,7 +58,7 @@ Prompt the user to choose from a list. Dialog methods with a `timeout` field inc
48
58
 
49
59
  Expected response: `extension_ui_response` with `value` (the selected option string) or `cancelled: true`.
50
60
 
51
- #### confirm
61
+ ### confirm
52
62
 
53
63
  Prompt the user for yes/no confirmation.
54
64
 
@@ -63,11 +73,11 @@ Prompt the user for yes/no confirmation.
63
73
  }
64
74
  ```
65
75
 
66
- Expected response: `extension_ui_response` with `confirmed: true/false` or `cancelled: true`.
76
+ Expected response: `extension_ui_response` with `confirmed: true` or `false`, or `cancelled: true`.
67
77
 
68
- #### input
78
+ ### input
69
79
 
70
- Prompt the user for free-form text.
80
+ Prompt the user for single-line text.
71
81
 
72
82
  ```json
73
83
  {
@@ -79,11 +89,11 @@ Prompt the user for free-form text.
79
89
  }
80
90
  ```
81
91
 
82
- Expected response: `extension_ui_response` with `value` (the entered text) or `cancelled: true`.
92
+ Expected response: `extension_ui_response` with `value` (the entered string) or `cancelled: true`.
83
93
 
84
- #### editor
94
+ ### editor
85
95
 
86
- Open a multi-line text editor with optional prefilled content.
96
+ Open a multi-line text editor with optional prefilled text.
87
97
 
88
98
  ```json
89
99
  {
@@ -95,11 +105,11 @@ Open a multi-line text editor with optional prefilled content.
95
105
  }
96
106
  ```
97
107
 
98
- Expected response: `extension_ui_response` with `value` (the edited text) or `cancelled: true`.
108
+ Expected response: `extension_ui_response` with `value` (the edited string) or `cancelled: true`.
99
109
 
100
- #### cancel
110
+ ### cancel
101
111
 
102
- Close the dialog with the matching `id` and stop reading its input. The request has already ended on the agent side, so do not send a response. Ignore a cancellation for a dialog that is already closed.
112
+ Close the dialog (`select`, `confirm`, `input`, `editor`, or `questionnaire`) with the matching `id` and stop reading input for it. The request has already ended on the agent side, so do not send a response. Ignore a `cancel` for a dialog that is already closed.
103
113
 
104
114
  ```json
105
115
  {
@@ -109,9 +119,9 @@ Close the dialog with the matching `id` and stop reading its input. The request
109
119
  }
110
120
  ```
111
121
 
112
- #### questionnaire
122
+ ### questionnaire
113
123
 
114
- A whole `ask_user_question` call: one to four questions, each with a short `header`, its options (`label`, `description`, optional markdown `preview`) and `multiSelect`. Sent only to a client that turned the `questionnaire` capability on with [`set_extension_ui_capabilities`](/rpc/protocol#set_extension_ui_capabilities); otherwise `ask_user_question` fails in RPC mode, because it needs a terminal.
124
+ Represents one `ask_user_question` tool call: one to four questions, each with a short `header`, `options` (`label`, `description`, optional markdown `preview`), and optional `multiSelect`. Sent only when the client enabled the `questionnaire` capability through [`set_extension_ui_capabilities`](/rpc/protocol#set_extension_ui_capabilities); otherwise `ask_user_question` fails in RPC mode because no terminal is attached.
115
125
 
116
126
  ```json
117
127
  {
@@ -131,12 +141,12 @@ A whole `ask_user_question` call: one to four questions, each with a short `head
131
141
  }
132
142
  ```
133
143
 
134
- Expected response: `extension_ui_response` with `answers`, one per answered question, or `cancelled: true`. Each answer names its `questionIndex` and repeats its `question`, and its `kind` says what the user chose:
144
+ Expected response: `extension_ui_response` with `answers` (one entry per answered question) or `cancelled: true`. Each answer specifies `questionIndex`, repeats `question`, and sets `kind`:
135
145
 
136
- - `option`: one of the question's options; `answer` is its label.
146
+ - `option`: one of the question's options; `answer` is its `label`.
137
147
  - `multi`: for a `multiSelect` question; `answer` is `null` and `selected` lists the chosen labels.
138
148
  - `custom`: free text typed instead of an option (single-select questions without previews); `answer` is the text.
139
- - `chat`: the user wants to talk it over instead; `answer` is their text or `null`.
149
+ - `chat`: the user chose to discuss instead; `answer` is their text or `null`.
140
150
 
141
151
  ```json
142
152
  {
@@ -146,48 +156,48 @@ Expected response: `extension_ui_response` with `answers`, one per answered ques
146
156
  }
147
157
  ```
148
158
 
149
- Answers that don't match the questions, such as an unknown label, are rejected and the tool call fails.
159
+ Answers that do not match the questions (such as an unknown option label) are rejected and fail the `ask_user_question` tool call.
150
160
 
151
- #### notify
161
+ ### notify
152
162
 
153
- Display a notification. Fire-and-forget, no response expected.
163
+ Display a notification. Fire-and-forget; send no response.
154
164
 
155
165
  ```json
156
166
  {
157
167
  "type": "extension_ui_request",
158
- "id": "uuid-5",
168
+ "id": "uuid-6",
159
169
  "method": "notify",
160
170
  "message": "Command blocked by user",
161
171
  "notifyType": "warning"
162
172
  }
163
173
  ```
164
174
 
165
- The `notifyType` field is `"info"`, `"warning"`, or `"error"`. Defaults to `"info"` if omitted.
175
+ `notifyType` is `"info"`, `"warning"`, or `"error"` (defaults to `"info"` when omitted).
166
176
 
167
- #### setStatus
177
+ ### setStatus
168
178
 
169
- Set or clear a status entry in the footer/status bar. Fire-and-forget.
179
+ Set or clear a status entry in the status bar. Fire-and-forget.
170
180
 
171
181
  ```json
172
182
  {
173
183
  "type": "extension_ui_request",
174
- "id": "uuid-6",
184
+ "id": "uuid-7",
175
185
  "method": "setStatus",
176
186
  "statusKey": "my-ext",
177
187
  "statusText": "Turn 3 running..."
178
188
  }
179
189
  ```
180
190
 
181
- Send `statusText: undefined` (or omit it) to clear the status entry for that key.
191
+ Omit `statusText` (or pass `undefined`) to clear the entry for `statusKey`.
182
192
 
183
- #### setWidget
193
+ ### setWidget
184
194
 
185
- Set or clear a widget (block of text lines) displayed above or below the editor. Fire-and-forget.
195
+ Set or clear a text widget displayed above or below the editor. Fire-and-forget.
186
196
 
187
197
  ```json
188
198
  {
189
199
  "type": "extension_ui_request",
190
- "id": "uuid-7",
200
+ "id": "uuid-8",
191
201
  "method": "setWidget",
192
202
  "widgetKey": "my-ext",
193
203
  "widgetLines": ["--- My Widget ---", "Line 1", "Line 2"],
@@ -195,37 +205,37 @@ Set or clear a widget (block of text lines) displayed above or below the editor.
195
205
  }
196
206
  ```
197
207
 
198
- Send `widgetLines: undefined` (or omit it) to clear the widget. `widgetPlacement` is `"aboveEditor"` (default) or `"belowEditor"`. Optional `widgetScroll` (`{ maxHeight: number, maxHeightFraction?: number }`) passes scroll-bound hints when a widget requests scrolling. Only string arrays are supported in RPC mode; component factories are ignored.
208
+ Omit `widgetLines` (or pass `undefined`) to clear the widget. `widgetPlacement` is `"aboveEditor"` (default) or `"belowEditor"`. Optional `widgetScroll` (`{ maxHeight: number, maxHeightFraction?: number }`) passes scroll bounds when requested. Plain RPC supports only string arrays; passing a component factory throws `Error("Component-factory widgets are unavailable in this RPC host.")`.
199
209
 
200
- #### setTitle
210
+ ### setTitle
201
211
 
202
- Set the terminal window/tab title. Fire-and-forget.
212
+ Set the window or tab title. Fire-and-forget.
203
213
 
204
214
  ```json
205
215
  {
206
216
  "type": "extension_ui_request",
207
- "id": "uuid-8",
217
+ "id": "uuid-9",
208
218
  "method": "setTitle",
209
219
  "title": "atomic - my project"
210
220
  }
211
221
  ```
212
222
 
213
- #### set_editor_text
223
+ ### set_editor_text
214
224
 
215
- Set the text in the input editor. Fire-and-forget.
225
+ Replace the text in the input editor. Fire-and-forget.
216
226
 
217
227
  ```json
218
228
  {
219
229
  "type": "extension_ui_request",
220
- "id": "uuid-9",
230
+ "id": "uuid-10",
221
231
  "method": "set_editor_text",
222
232
  "text": "prefilled text for the user"
223
233
  }
224
234
  ```
225
235
 
226
- #### OAuth login methods
236
+ ### OAuth login methods
227
237
 
228
- During `login_provider`, Atomic emits OAuth UI requests carrying `type: "extension_ui_request"`, `id`, `provider`, `loginId`, and `method`:
238
+ During `login_provider`, Atomic emits OAuth UI requests containing `type: "extension_ui_request"`, `id`, `provider`, `loginId`, and `method`:
229
239
 
230
240
  | Method | Additional fields | Response expected |
231
241
  | --- | --- | --- |
@@ -238,11 +248,18 @@ During `login_provider`, Atomic emits OAuth UI requests carrying `type: "extensi
238
248
  | `oauth_manual_code` | None | `extension_ui_response` with `value` or `cancelled: true` |
239
249
  | `oauth_manual_code_cancel` | None | None (close pending manual-code prompt) |
240
250
 
241
- ### Extension UI responses (stdin)
251
+ ## Extension UI responses (stdin)
252
+
253
+ Send responses for dialog methods (`select`, `confirm`, `input`, `editor`, `questionnaire`) and interactive OAuth methods (`oauth_prompt`, `oauth_select`, `oauth_manual_code`). The `id` must match the request.
254
+
255
+ **Response handling rules:**
242
256
 
243
- Responses are sent for dialog methods (`select`, `confirm`, `input`, `editor`, `questionnaire`) and interactive OAuth methods (`oauth_prompt`, `oauth_select`, `oauth_manual_code`). The `id` must match the request. Answer `questionnaire` with `answers` (see [questionnaire](#questionnaire)).
257
+ - Responses with an unknown or already-resolved `id` are silently ignored.
258
+ - For `select`, `input`, and `editor`, a non-cancelled response without `value` resolves to `undefined`. `select` does not validate `value` against the original `options` list, so clients should send one of the offered options.
259
+ - For `confirm`, a non-cancelled response without `confirmed` resolves to `false`.
260
+ - For `questionnaire`, see [questionnaire](#questionnaire) for answer validation.
244
261
 
245
- #### Value response (select, input, editor)
262
+ ### Value response (`select`, `input`, `editor`)
246
263
 
247
264
  Also used for `oauth_prompt`, `oauth_select`, and `oauth_manual_code`:
248
265
 
@@ -250,15 +267,15 @@ Also used for `oauth_prompt`, `oauth_select`, and `oauth_manual_code`:
250
267
  {"type": "extension_ui_response", "id": "uuid-1", "value": "Allow"}
251
268
  ```
252
269
 
253
- #### Confirmation response (confirm)
270
+ ### Confirmation response (`confirm`)
254
271
 
255
272
  ```json
256
273
  {"type": "extension_ui_response", "id": "uuid-2", "confirmed": true}
257
274
  ```
258
275
 
259
- #### Cancellation response (any dialog)
276
+ ### Cancellation response (any dialog)
260
277
 
261
- Dismiss any dialog method. The extension receives `undefined` (for select/input/editor) or `false` (for confirm).
278
+ Dismiss any dialog method. The extension receives `undefined` (for `select`, `input`, `editor`), `false` (for `confirm`), or `{ answers: [], cancelled: true }` (for `questionnaire`).
262
279
 
263
280
  ```json
264
281
  {"type": "extension_ui_response", "id": "uuid-3", "cancelled": true}