@bastani/atomic 0.10.9 → 0.10.10-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +211 -155
  3. package/dist/_shared/dist-KOELCESV.js +2 -2
  4. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  5. package/dist/_shared/lib-4PES5P4V.js +2 -2
  6. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +27 -12
  7. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
  8. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +47 -7
  9. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
  10. package/dist/_shared/mode-shared-2QJSCUM6.js +48 -19
  11. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  12. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js → p1a-prewarm-XIU57JHF.js} +5 -5
  13. package/dist/_shared/{p1a-prewarm-UQY3X2UK.js.map → p1a-prewarm-XIU57JHF.js.map} +1 -1
  14. package/dist/_shared/p2-shell-main-B2WIALFD.js +30 -25
  15. package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
  16. package/dist/_shared/runtime-O4KCSG4C.js +5 -5
  17. package/dist/_shared/{sdk-OSBEPR3Q.js → sdk-RRLVN7ER.js} +15 -9
  18. package/dist/_shared/sdk-RRLVN7ER.js.map +1 -0
  19. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  20. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  21. package/dist/_shared/settings-startup-8-DNZ2RIHM.js +4 -1
  22. package/dist/_shared/settings-startup-8-DNZ2RIHM.js.map +1 -1
  23. package/dist/_shared/{startup-0-0-TYUFUOJZ.js → startup-0-0-4VG2G44V.js} +427 -33
  24. package/dist/_shared/startup-0-0-4VG2G44V.js.map +1 -0
  25. package/dist/_shared/{startup-0-1-W2G2UY7R.js → startup-0-1-XTIL65D4.js} +18 -11
  26. package/dist/_shared/startup-0-1-XTIL65D4.js.map +1 -0
  27. package/dist/_shared/{startup-0-2-UXBUEOXW.js → startup-0-2-27OWFHV6.js} +145 -58
  28. package/dist/_shared/startup-0-2-27OWFHV6.js.map +1 -0
  29. package/dist/_shared/startup-0-3-T4DVFYWX.js +15 -25
  30. package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
  31. package/dist/_shared/{startup-0-4-HN5EB4K7.js → startup-0-4-ZMJV547D.js} +81 -12
  32. package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -0
  33. package/dist/_shared/startup-0-5-FD2P735I.js +90 -50
  34. package/dist/_shared/startup-0-5-FD2P735I.js.map +1 -1
  35. package/dist/_shared/startup-10-0-TDQNBDDL.js +5 -5
  36. package/dist/_shared/startup-12-0-55AAXBJZ.js +13 -7
  37. package/dist/_shared/startup-12-0-55AAXBJZ.js.map +1 -1
  38. package/dist/_shared/startup-14-0-MLX36RBG.js +4 -4
  39. package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
  40. package/dist/_shared/startup-15-1-4S7FLMNG.js +88 -28
  41. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  42. package/dist/_shared/startup-8-0-34CBHPZH.js +5 -5
  43. package/dist/_shared/startup-8-1-4KANEHRA.js +61 -17
  44. package/dist/_shared/startup-8-1-4KANEHRA.js.map +1 -1
  45. package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
  46. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  47. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  48. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  49. package/dist/builtin/intercom/README.md +85 -114
  50. package/dist/builtin/intercom/broker/broker.bundle.mjs +3 -3
  51. package/dist/builtin/intercom/broker/presence-handler.ts +1 -1
  52. package/dist/builtin/intercom/group.ts +7 -3
  53. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  54. package/dist/builtin/intercom/package.json +1 -1
  55. package/dist/builtin/mcp/README.md +37 -27
  56. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  57. package/dist/builtin/mcp/package.json +1 -1
  58. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  59. package/dist/builtin/subagents/README.md +71 -138
  60. package/dist/builtin/subagents/package.json +1 -1
  61. package/dist/builtin/subagents/src/extension/index.bundle.mjs +213 -74
  62. package/dist/builtin/web-access/CHANGELOG.md +9 -0
  63. package/dist/builtin/web-access/README.md +60 -87
  64. package/dist/builtin/web-access/index.bundle.mjs +387 -351
  65. package/dist/builtin/web-access/package.json +1 -1
  66. package/dist/cli/args.js +2 -2
  67. package/dist/cli/auth-cli.code.js +4 -4
  68. package/dist/cli/auth-cli.impl.js +3 -3
  69. package/dist/cli/auth-cli.js +3 -3
  70. package/dist/cli/blueprint-command.code.js +2 -2
  71. package/dist/cli/blueprint-command.impl.js +3 -3
  72. package/dist/cli/blueprint-command.js +3 -3
  73. package/dist/cli/intercom-command.code.js +3 -3
  74. package/dist/cli/intercom-command.impl.js +3 -3
  75. package/dist/cli/intercom-command.js +3 -3
  76. package/dist/cli/list-models.code.js +3 -3
  77. package/dist/cli/list-models.impl.js +3 -3
  78. package/dist/cli/list-models.js +3 -3
  79. package/dist/cli/session-picker.code.js +2 -2
  80. package/dist/cli/session-picker.impl.js +3 -3
  81. package/dist/cli/session-picker.js +3 -3
  82. package/dist/cli/startup-ui.code.js +2 -2
  83. package/dist/cli/startup-ui.impl.js +3 -3
  84. package/dist/cli/startup-ui.js +3 -3
  85. package/dist/cli/storage-command.impl.js +3 -3
  86. package/dist/cli/storage-command.js +3 -3
  87. package/dist/cli/storage-search-session.code.js +2 -2
  88. package/dist/cli/storage-search-session.impl.js +3 -3
  89. package/dist/cli/storage-search-session.js +3 -3
  90. package/dist/cli/team-command.code.js +2 -2
  91. package/dist/cli/team-command.impl.js +3 -3
  92. package/dist/cli/team-command.js +3 -3
  93. package/dist/cli.js +2 -2
  94. package/dist/core/agent-session-methods.d.ts +4 -1
  95. package/dist/core/agent-session-methods.js.map +1 -1
  96. package/dist/core/agent-session.d.ts +3 -0
  97. package/dist/core/compaction/compactor.d.ts +20 -14
  98. package/dist/core/compaction/errors.d.ts +120 -0
  99. package/dist/core/compaction/index.d.ts +1 -0
  100. package/dist/core/compaction/model-resolver.d.ts +2 -2
  101. package/dist/core/debug.impl.js +3 -3
  102. package/dist/core/debug.js +3 -3
  103. package/dist/core/export-html/card-projection.impl.js +3 -3
  104. package/dist/core/export-html/card-projection.js +3 -3
  105. package/dist/core/export-html/index.code.js +2 -2
  106. package/dist/core/export-html/index.impl.js +3 -3
  107. package/dist/core/export-html/index.js +3 -3
  108. package/dist/core/export-html/json-spans.impl.js +3 -3
  109. package/dist/core/export-html/json-spans.js +3 -3
  110. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  111. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  112. package/dist/core/export-html/tool-renderer.code.js +1 -1
  113. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  114. package/dist/core/export-html/tool-renderer.js +3 -3
  115. package/dist/core/extensions/api-types.d.ts +1 -1
  116. package/dist/core/extensions/api-types.js.map +1 -1
  117. package/dist/core/extensions/index.d.ts +1 -1
  118. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  119. package/dist/core/extensions/jiti-loader.js +3 -3
  120. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  121. package/dist/core/extensions/jiti-static-loader.js +3 -3
  122. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  123. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  124. package/dist/core/extensions/loader-host-modules.js +3 -3
  125. package/dist/core/extensions/loader-virtual-modules.js +1 -1
  126. package/dist/core/extensions/provider-types.d.ts +18 -6
  127. package/dist/core/extensions/provider-types.js.map +1 -1
  128. package/dist/core/extensions/runner-context.js +1 -1
  129. package/dist/core/intercom-broker-control-host.code.js +1 -1
  130. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  131. package/dist/core/intercom-broker-control-host.js +3 -3
  132. package/dist/core/intercom-broker-control.code.js +3 -3
  133. package/dist/core/intercom-broker-control.impl.js +3 -3
  134. package/dist/core/intercom-broker-control.js +3 -3
  135. package/dist/core/model-config.d.ts +40 -0
  136. package/dist/core/model-registry.js +1 -1
  137. package/dist/core/model-resolver-scope.d.ts +4 -4
  138. package/dist/core/model-runtime.d.ts +1 -1
  139. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  140. package/dist/core/package-manager-storage-adapters.js +3 -3
  141. package/dist/core/provider-composer-internal.d.ts +11 -2
  142. package/dist/core/sdk.code.js +3 -3
  143. package/dist/core/sdk.impl.js +3 -3
  144. package/dist/core/sdk.js +3 -3
  145. package/dist/core/session-manager-core.js +5 -5
  146. package/dist/core/session-manager-list.impl.js +3 -3
  147. package/dist/core/session-manager-list.js +3 -3
  148. package/dist/core/session-manager.code.js +1 -1
  149. package/dist/core/session-manager.impl.js +3 -3
  150. package/dist/core/session-manager.js +3 -3
  151. package/dist/core/session-storage.impl.js +3 -3
  152. package/dist/core/session-storage.js +3 -3
  153. package/dist/core/settings-manager-basic-accessors.d.ts +6 -2
  154. package/dist/core/storage/index.js +2 -2
  155. package/dist/core/storage/node-sqlite-thread.js +2 -2
  156. package/dist/core/storage/node-sqlite.js +2 -2
  157. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  158. package/dist/core/storage/offline-snapshot-file.js +3 -3
  159. package/dist/core/storage/provider.js +2 -2
  160. package/dist/core/storage/selection.js +2 -2
  161. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  162. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  163. package/dist/core/storage/session/branch-fork-source.js +3 -3
  164. package/dist/core/storage/session/card-view.impl.js +3 -3
  165. package/dist/core/storage/session/card-view.js +3 -3
  166. package/dist/core/storage/session/child-reader.code.js +3 -3
  167. package/dist/core/storage/session/child-reader.impl.js +3 -3
  168. package/dist/core/storage/session/child-reader.js +3 -3
  169. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  170. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  171. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  172. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  173. package/dist/core/storage/session/expanded-child-details.js +3 -3
  174. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  175. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  176. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  177. package/dist/core/storage/session/fork-row-index.js +3 -3
  178. package/dist/core/storage/session/fork-staging.code.js +2 -2
  179. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  180. package/dist/core/storage/session/fork-staging.js +3 -3
  181. package/dist/core/storage/session/fork-window.code.js +3 -3
  182. package/dist/core/storage/session/fork-window.impl.js +3 -3
  183. package/dist/core/storage/session/fork-window.js +3 -3
  184. package/dist/core/storage/session/history-pages.impl.js +3 -3
  185. package/dist/core/storage/session/history-pages.js +3 -3
  186. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  187. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  188. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  189. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  190. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  191. package/dist/core/storage/session/memory-session-store.js +3 -3
  192. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  193. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  194. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  195. package/dist/core/storage/session/released-history-files.code.js +3 -3
  196. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  197. package/dist/core/storage/session/released-history-files.js +3 -3
  198. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  199. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  200. package/dist/core/storage/session/session-resume.impl.js +3 -3
  201. package/dist/core/storage/session/session-resume.js +3 -3
  202. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  203. package/dist/core/storage/session/snapshot-cut.js +3 -3
  204. package/dist/core/storage/session/snapshot-history.code.js +3 -3
  205. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  206. package/dist/core/storage/session/snapshot-history.js +3 -3
  207. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  208. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  209. package/dist/core/storage/session/sql-session-store.js +3 -3
  210. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  211. package/dist/core/storage/session/tree-outline.js +3 -3
  212. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  213. package/dist/core/storage/session/tree-presentation.js +3 -3
  214. package/dist/core/storage/storage-status.impl.js +3 -3
  215. package/dist/core/storage/storage-status.js +3 -3
  216. package/dist/core/storage/team.impl.js +3 -3
  217. package/dist/core/storage/team.js +3 -3
  218. package/dist/core/structured-output/index.code.js +1 -1
  219. package/dist/core/structured-output/index.impl.js +3 -3
  220. package/dist/core/structured-output/index.js +3 -3
  221. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  222. package/dist/core/tasks/task-completion-entry.js +3 -3
  223. package/dist/core/tasks/task-file-history.code.js +3 -3
  224. package/dist/core/tasks/task-file-history.impl.js +3 -3
  225. package/dist/core/tasks/task-file-history.js +3 -3
  226. package/dist/core/tasks/task-reference-archive.code.js +4 -4
  227. package/dist/core/tasks/task-reference-archive.js +3 -3
  228. package/dist/core/tasks/task-reference-identity.code.js +1 -1
  229. package/dist/core/tasks/task-reference-identity.js +3 -3
  230. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  231. package/dist/core/tasks/task-reference-stream.js +3 -3
  232. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  233. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  234. package/dist/core/tasks/task-view-source.impl.js +3 -3
  235. package/dist/core/tasks/task-view-source.js +3 -3
  236. package/dist/core/tools/read-url.code.js +2 -2
  237. package/dist/core/tools/read-url.impl.js +3 -3
  238. package/dist/core/tools/read-url.js +3 -3
  239. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  240. package/dist/core/worktree-snapshot/errors.code.js +3 -3
  241. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  242. package/dist/core/worktree-snapshot/errors.js +3 -3
  243. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  244. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  245. package/dist/extensions/codemode/execute.code.js +1 -1
  246. package/dist/extensions/codemode/execute.impl.js +3 -3
  247. package/dist/extensions/codemode/execute.js +3 -3
  248. package/dist/extensions/codemode/renderer.code.js +2 -2
  249. package/dist/extensions/codemode/renderer.impl.js +3 -3
  250. package/dist/extensions/codemode/renderer.js +3 -3
  251. package/dist/extensions/mcp/cli.code.js +2 -2
  252. package/dist/extensions/mcp/cli.impl.js +3 -3
  253. package/dist/extensions/mcp/cli.js +3 -3
  254. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  255. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  256. package/dist/extensions/mcp/cli.lazy.js +3 -3
  257. package/dist/extensions/mcp/runtime.code.js +1 -1
  258. package/dist/extensions/mcp/runtime.impl.js +3 -3
  259. package/dist/extensions/mcp/runtime.js +3 -3
  260. package/dist/index-extensions.d.ts +1 -1
  261. package/dist/index.d.ts +8 -1
  262. package/dist/index.js +7 -7
  263. package/dist/main-first-time-setup.code.js +2 -2
  264. package/dist/main-first-time-setup.impl.js +3 -3
  265. package/dist/main-first-time-setup.js +3 -3
  266. package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -0
  267. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  268. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  269. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  270. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  271. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  272. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  273. package/dist/modes/interactive/theme/color-utils.d.ts +5 -5
  274. package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
  275. package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
  276. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
  277. package/dist/modes/print-mode.js +1 -1
  278. package/dist/modes/rpc/rpc-client-api.d.ts +6 -0
  279. package/dist/modes/rpc/rpc-types.d.ts +29 -2
  280. package/dist/package-manager-cli.code.js +5 -5
  281. package/dist/package-manager-cli.impl.js +3 -3
  282. package/dist/package-manager-cli.js +3 -3
  283. package/dist/rpc-entry.js +1 -1
  284. package/dist/startup-files.json +1 -1
  285. package/dist/startup-stages/5.js +1 -1
  286. package/dist/startup-stages/7.js +1 -1
  287. package/dist/startup-stages/8.js +1 -2
  288. package/dist/startup-stages/9.js +2 -1
  289. package/dist/utils/native-module.d.ts +44 -0
  290. package/dist/utils/startup-database-spare.code.js +3 -3
  291. package/dist/utils/startup-database-spare.impl.js +3 -3
  292. package/dist/utils/startup-database-spare.js +3 -3
  293. package/dist/utils/tools-manager.code.js +1 -1
  294. package/dist/utils/tools-manager.impl.js +3 -3
  295. package/dist/utils/tools-manager.js +3 -3
  296. package/docs/background-tasks.md +235 -243
  297. package/docs/build.md +12 -11
  298. package/docs/codemode.md +60 -51
  299. package/docs/compaction/reference.md +61 -24
  300. package/docs/compaction.md +117 -65
  301. package/docs/computer-use.md +179 -146
  302. package/docs/containerization.md +79 -33
  303. package/docs/custom-provider/api-reference.md +148 -11
  304. package/docs/custom-provider/oauth.md +44 -27
  305. package/docs/custom-provider/override.md +14 -7
  306. package/docs/custom-provider/registration.md +75 -65
  307. package/docs/custom-provider/streaming.md +42 -19
  308. package/docs/custom-provider.md +25 -61
  309. package/docs/development.md +47 -43
  310. package/docs/docs.json +33 -33
  311. package/docs/environment-variables.md +83 -57
  312. package/docs/extensions/api-reference.md +323 -734
  313. package/docs/extensions/authoring.md +186 -269
  314. package/docs/extensions/events.md +308 -375
  315. package/docs/extensions/examples.md +122 -74
  316. package/docs/extensions/ui.md +217 -197
  317. package/docs/extensions.md +152 -259
  318. package/docs/getting-started/authentication.md +27 -14
  319. package/docs/getting-started/first-session.md +25 -26
  320. package/docs/getting-started/installation.md +62 -84
  321. package/docs/getting-started/project-instructions.md +39 -14
  322. package/docs/guides/configuration.md +42 -20
  323. package/docs/guides/intercom.md +17 -13
  324. package/docs/guides/non-interactive.md +29 -16
  325. package/docs/guides/orchestration.md +16 -10
  326. package/docs/guides/resume-on-any-machine.md +54 -49
  327. package/docs/guides/subagents.md +22 -14
  328. package/docs/guides/team-setup.md +37 -26
  329. package/docs/guides.md +22 -21
  330. package/docs/herdr.md +21 -16
  331. package/docs/index.md +16 -17
  332. package/docs/intercom/operations.md +68 -66
  333. package/docs/intercom/reference.md +196 -191
  334. package/docs/intercom.md +103 -92
  335. package/docs/json.md +71 -71
  336. package/docs/keybindings.md +63 -50
  337. package/docs/libraries/agent-core.md +49 -8
  338. package/docs/libraries/ai.md +21 -12
  339. package/docs/libraries/codemode.md +28 -6
  340. package/docs/libraries/schema.md +7 -7
  341. package/docs/libraries/telemetry.md +7 -7
  342. package/docs/libraries/tui.md +74 -94
  343. package/docs/libraries.md +5 -5
  344. package/docs/llama-cpp.md +38 -33
  345. package/docs/mcp-servers.md +96 -90
  346. package/docs/models/reference.md +46 -33
  347. package/docs/models-configuration.md +12 -6
  348. package/docs/models.md +93 -88
  349. package/docs/orchestration/migrating-workflows.md +21 -19
  350. package/docs/orchestration/patterns.md +35 -20
  351. package/docs/orchestration.md +22 -21
  352. package/docs/packages/authoring.md +28 -19
  353. package/docs/packages/reference.md +75 -16
  354. package/docs/packages.md +31 -33
  355. package/docs/programmatic.md +22 -21
  356. package/docs/prompt-templates.md +63 -41
  357. package/docs/providers/reference.md +35 -19
  358. package/docs/providers.md +61 -71
  359. package/docs/quickstart.md +32 -46
  360. package/docs/reference/cli.md +249 -252
  361. package/docs/reference.md +23 -20
  362. package/docs/rpc/examples.md +74 -17
  363. package/docs/rpc/extension-ui.md +79 -62
  364. package/docs/rpc/protocol.md +816 -358
  365. package/docs/rpc.md +75 -151
  366. package/docs/sdk/reference.md +175 -45
  367. package/docs/sdk/structured-decisions.md +92 -62
  368. package/docs/sdk/web-server.md +79 -46
  369. package/docs/sdk.md +237 -195
  370. package/docs/security.md +106 -43
  371. package/docs/session-format.md +96 -59
  372. package/docs/sessions.md +149 -113
  373. package/docs/settings.md +289 -204
  374. package/docs/shell-aliases.md +15 -6
  375. package/docs/skills/authoring.md +17 -9
  376. package/docs/skills/reference.md +23 -21
  377. package/docs/skills.md +104 -97
  378. package/docs/storage.md +140 -242
  379. package/docs/subagents/authoring.md +147 -16
  380. package/docs/subagents/reference.md +100 -30
  381. package/docs/subagents.md +220 -252
  382. package/docs/terminal-setup.md +97 -69
  383. package/docs/termux.md +51 -85
  384. package/docs/themes/reference.md +51 -37
  385. package/docs/themes.md +49 -54
  386. package/docs/tmux.md +38 -21
  387. package/docs/tools.md +198 -147
  388. package/docs/tui/reference.md +64 -32
  389. package/docs/tui.md +38 -66
  390. package/docs/usage.md +76 -78
  391. package/docs/verification.md +25 -25
  392. package/docs/web-access.md +72 -55
  393. package/docs/windows.md +53 -58
  394. package/docs/worktree-snapshots.md +62 -65
  395. package/package.json +8 -8
  396. package/schemas/models.schema.json +51 -0
  397. package/dist/_shared/sdk-OSBEPR3Q.js.map +0 -1
  398. package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +0 -1
  399. package/dist/_shared/startup-0-1-W2G2UY7R.js.map +0 -1
  400. package/dist/_shared/startup-0-2-UXBUEOXW.js.map +0 -1
  401. package/dist/_shared/startup-0-4-HN5EB4K7.js.map +0 -1
@@ -1,20 +1,19 @@
1
1
  ---
2
- title: TUI API reference
2
+ title: "TUI API reference"
3
3
  sidebarTitle: "TUI API"
4
- description: Component and focusable interfaces, keyboard input, line width, invalidation, logging, and performance contracts.
4
+ description: "Reference for Atomic TUI component, focusable, keyboard, theme invalidation, debug logging, and host-native UI contracts."
5
5
  ---
6
6
 
7
- # TUI API reference
8
-
9
7
  ## Tool blocks
10
8
 
11
9
  Use `ToolBlock` from `@bastani/atomic` for a transcript item with a state glyph, one header row, and connected result rows. It accepts `status`, `title`, and optional `args`, `meta`, `details`, `body`, and `outputPad` (default `1`).
12
10
 
13
- Supported `ToolBlockStatus` values:
14
- - General tool states: `running` (`∀`), `success`, `failure`, `stopped` (interrupted or not run, muted `◼`), `warning`, `paused` (warning-colored `‖`), `waiting` (dim `◌`, wakes automatically when what it waits on finishes), and `info`.
11
+ Supported `ToolBlockStatus` (aliases `NoticeStatus`) values:
12
+
13
+ - General states: `running` (`∀`), `success`, `failure`, `stopped` (interrupted or not run, muted `◼`), `warning`, `paused` (warning-colored `‖`), `waiting` (dim `◌`, wakes automatically when what it waits on finishes), `heartbeat` (muted `♥`), and `info`.
15
14
  - Subagent and background-task states (shared with the agent panel and `/tasks`): `agent-running` (grey `◯`), `shell-running` (`⧗`), `input` (`◆`, waiting for an answer), `task-queued` (dim `○`), `task-stopping` (warning-colored `◼`), and `task-stopped` (red `◯`).
16
15
 
17
- `TASK_MARKS` from `@bastani/atomic` exports these glyphs for custom rendering. Code switching on `ToolBlockStatus` or `NoticeStatus` should handle `waiting`, `agent-running`, `shell-running`, `input`, `task-queued`, `task-stopping`, and `task-stopped`.
16
+ `TASK_MARKS` from `@bastani/atomic` exports these glyphs for custom rendering. Exhaustive switches on `ToolBlockStatus` or `NoticeStatus` must handle all general states (including `waiting` and `heartbeat`) plus all six subagent and background-task states.
18
17
 
19
18
  A `NoticeLine` reports a task, drawing `running` as a grey `◯`, `stopped` as a red `◯`, and `paused` as warning-colored `‖`. With `NO_COLOR`, running and stopped notices (like `agent-running` and `task-stopped` blocks) both show plain `◯`, distinguished by their text.
20
19
 
@@ -33,7 +32,7 @@ A block does not add a leading blank line; its container controls spacing betwee
33
32
 
34
33
  In ordinary tool renderers, return only the call title from `renderCall` and unframed result content from `renderResult`; Atomic supplies the state glyph and connectors. Return `ToolBlockRecords` when several results need separate connectors.
35
34
 
36
- When embedding `ChatSessionHost`, forward the complete `ctx.ui.getChatRenderSettings()` result. Its optional component factories preserve remote tool renderers and the embedded chat's repaint and expansion settings. Do not copy only `getToolDefinition`. Custom message renderers can use `options.cwd` for the receiving chat's working directory instead of assuming `process.cwd()` matches it.
35
+ When embedding `ChatSessionHost` (an experimental embedded-chat host exported from `@bastani/atomic`; not yet a guaranteed stable extension API), forward the complete `ctx.ui.getChatRenderSettings()` result. Its optional component factories preserve tool renderers and the embedded chat's repaint and expansion settings. Do not copy only `getToolDefinition`. Custom message renderers can use `options.cwd` for the receiving chat's working directory instead of assuming `process.cwd()` matches it.
37
36
 
38
37
  `host.replaceMessages(messages)` starts a fresh unread baseline. Use `host.replaceMessages(messages, { preserveUnread: true })` for a new snapshot of the same conversation; arrivals that have not painted yet remain unread.
39
38
 
@@ -45,25 +44,43 @@ The `Markdown` component from `@bastani/atomic-tui` also accepts per-instance `h
45
44
 
46
45
  ## Component interface
47
46
 
48
- All components implement:
47
+ `@bastani/atomic-tui` defines the base `Component` interface, and Atomic extends it with `ExtensionCustomComponent` for components returned by `ctx.ui.custom()`:
49
48
 
50
49
  ```typescript
50
+ // Base component interface from @bastani/atomic-tui
51
51
  interface Component {
52
52
  render(width: number): string[];
53
- handleInput?(data: string): boolean | void;
53
+ renderSized?(width: number, height: number): string[];
54
+ handleInput?(data: string): void;
55
+ handleMouse?(event: TuiMouseEvent): TuiMouseEventResult | undefined;
56
+ paintedRowKey?(row: number): string | undefined;
57
+ readonly selectionTextMayChangeOnReplay?: boolean;
58
+ readonly historyReplayable?: boolean;
54
59
  wantsKeyRelease?: boolean;
55
60
  capturesViewportInput?: boolean;
56
61
  invalidate(): void;
57
62
  }
63
+
64
+ // Returned by ctx.ui.custom() in @bastani/atomic
65
+ type ExtensionCustomComponent = Omit<Component, "handleInput"> & {
66
+ handleInput?: (data: string) => boolean | undefined | Promise<boolean | undefined>;
67
+ dispose?(): void;
68
+ };
58
69
  ```
59
70
 
60
- | Method | Description |
61
- |--------|-------------|
62
- | `render(width)` | Return array of strings (one per line). Each line **must not exceed `width`**. |
63
- | `handleInput?(data)` | Receive keyboard input when focused (a focused overlay also receives mouse input before the fullscreen viewport). Return `true` when consuming input; return `false`, `undefined`, or `void` so matching fullscreen viewport keys or overlay mouse events fall through to the viewport. Non-overlay focused components leave mouse input with `@bastani/atomic-tui` so transcript scrolling, scrollbar dragging, and text selection remain available. |
71
+ | Member | Description |
72
+ | --- | --- |
73
+ | `render(width)` | Return an array of lines; each line **must not exceed `width`**. |
74
+ | `renderSized?(width, height)` | Optional sized renderer called instead of `render()` when a layout allocates a fixed row count. |
75
+ | `handleInput?(data)` | Receive keyboard input when focused (a focused overlay also receives mouse input before the fullscreen viewport). On `ExtensionCustomComponent`, return `true` (or a promise resolving to `true`) when consuming input; return `false`, `undefined`, or reject to let matching fullscreen viewport keys or overlay mouse events fall through to the viewport. Non-overlay focused components leave mouse input with `@bastani/atomic-tui` so transcript scrolling, scrollbar dragging, and text selection remain available. |
76
+ | `handleMouse?(event)` | Optional normalized mouse event handler on base `@bastani/atomic-tui` components. |
77
+ | `paintedRowKey?(row)` | Optional stable identity for what the last render drew on `row` so click press/release pairs match the same item across repaints. |
78
+ | `selectionTextMayChangeOnReplay?` | Set `true` when rendered text depends on private state that cannot be replayed from history. |
79
+ | `historyReplayable?` | Set `true` as an own data property on chat render components that can be discarded and recreated from saved entries without losing state. |
64
80
  | `wantsKeyRelease?` | If `true`, component receives key release events (Kitty protocol). Default: `false`. |
65
81
  | `capturesViewportInput?` | If `true` while focused, fullscreen viewport keys such as PageUp/PageDown go to the component instead of scrolling the transcript, as they do for a focused overlay. `SelectList`, `SettingsList`, and the editor with open autocomplete set it; wrappers can forward it. Default: `false`. |
66
82
  | `invalidate()` | Clear cached render state. Called on theme changes. |
83
+ | `dispose?()` | Optional cleanup hook on `ExtensionCustomComponent`, invoked when `ctx.ui.custom()` closes or dismisses the component. |
67
84
 
68
85
  The `@bastani/atomic-tui` `Component` type permits handlers returning `void`; Atomic treats a missing or `undefined` return as unhandled only for matching fullscreen viewport keys or mouse events deferred to a focused overlay. Components that mutate state for such inputs must return `true` so the viewport does not apply them a second time.
69
86
 
@@ -190,9 +207,9 @@ Utilities:
190
207
 
191
208
  When the theme changes, the TUI calls `invalidate()` on all components. Clear cached render state there so the new theme takes effect.
192
209
 
193
- ### The problem
210
+ ### Why pre-baked theme strings go stale
194
211
 
195
- If a component pre-bakes theme colors into strings (via `theme.fg()`, `theme.bg()`, etc.) and caches them, the cached strings contain ANSI escape codes from the old theme. Simply clearing the render cache isn't enough if the component stores the themed content separately.
212
+ If a component pre-bakes theme colors into strings (via `theme.fg()`, `theme.bg()`, etc.) and caches them, the cached strings contain ANSI escape codes from the old theme. Clearing the render cache alone does not update pre-baked strings stored separately.
196
213
 
197
214
  **Wrong approach** (theme colors won't update):
198
215
 
@@ -206,12 +223,12 @@ class BadComponent extends Container {
206
223
  this.content = new Text(theme.fg("accent", message), 1, 0);
207
224
  this.addChild(this.content);
208
225
  }
209
- // No invalidate override - parent's invalidate only clears
226
+ // No invalidate override: parent invalidate only clears
210
227
  // child render caches, not the pre-baked content
211
228
  }
212
229
  ```
213
230
 
214
- ### The solution
231
+ ### Rebuilding themed content on invalidate
215
232
 
216
233
  Components that build content with theme colors must rebuild that content when `invalidate()` is called:
217
234
 
@@ -274,7 +291,7 @@ class ComplexComponent extends Container {
274
291
  }
275
292
  ```
276
293
 
277
- ### When this matters
294
+ ### When to rebuild on invalidate
278
295
 
279
296
  This pattern is needed when:
280
297
 
@@ -290,13 +307,19 @@ This pattern is not needed when:
290
307
 
291
308
  ## Debug logging
292
309
 
293
- Set `ATOMIC_TUI_WRITE_LOG` (legacy `PI_TUI_WRITE_LOG`) to capture the raw ANSI stream written to stdout. A directory path writes one `tui-<timestamp>-<pid>.log` file per process. Review logs for sensitive content before sharing.
310
+ Three environment variables capture TUI rendering diagnostics (legacy `PI_*` aliases are also accepted when the `ATOMIC_*` variable is unset):
311
+
312
+ - **`ATOMIC_TUI_WRITE_LOG`** (legacy `PI_TUI_WRITE_LOG`): captures the raw ANSI byte stream written to stdout. Pass a file path, or a directory path to write one `tui-<timestamp>-<pid>.log` file per process.
313
+ - **`ATOMIC_TUI_DEBUG=1`** (legacy `PI_TUI_DEBUG=1`): writes main-screen render snapshots to `/tmp/tui/render-<timestamp>-<random>.log`.
314
+ - **`ATOMIC_TUI_DEBUG_REDRAW=1`** (legacy `PI_TUI_DEBUG_REDRAW=1`): logs full-redraw triggers to `pi-tui-debug.log` in the TUI log directory.
315
+
316
+ Review all captured logs for sensitive content before sharing.
294
317
 
295
318
  ```bash
296
319
  ATOMIC_TUI_WRITE_LOG=/tmp/tui-ansi.log atomic
297
320
  ```
298
321
 
299
- Use this capture when reporting a terminal-rendering problem.
322
+ Use these captures when reporting a terminal-rendering bug.
300
323
 
301
324
  ## Performance
302
325
 
@@ -328,11 +351,11 @@ Call `invalidate()` when state changes, then `ctx.ui.requestRender()` from the e
328
351
 
329
352
  ## Host integration
330
353
 
331
- These runtime contracts moved here from the [TUI components guide](/tui), which keeps the runnable `ctx.ui.custom()` example and the common interaction patterns.
354
+ These runtime contracts pair with [Build TUI components](/tui), which provides runnable `ctx.ui.custom()` examples and common interaction patterns.
332
355
 
333
- ### Host terminal modes from an isolated component
356
+ ### Controlling terminal autowrap
334
357
 
335
- In isolated mode, writing escape sequences to `process.stdout` does not control the host terminal. Use the optional `tui.terminal.setAutowrap` setter when a Windows overlay needs to change autowrap:
358
+ When running inside Atomic's terminal UI, components do not write escape sequences directly to `process.stdout`. Use the optional `tui.terminal.setAutowrap` setter when a Windows overlay needs to toggle autowrap:
336
359
 
337
360
  ```typescript
338
361
  await ctx.ui.custom((tui, theme, keybindings, done) => {
@@ -341,19 +364,19 @@ await ctx.ui.custom((tui, theme, keybindings, done) => {
341
364
  }, { overlay: true });
342
365
  ```
343
366
 
344
- Only autowrap control is exposed. Atomic restores the mode when the component hides, closes, or is disposed, and after an engine crash or restart. Fullscreen mode retains its baseline mouse and autowrap behavior. On non-isolated hosts the setter may be absent; only write escape sequences directly when your component owns the real terminal.
367
+ Only autowrap control is exposed. Atomic restores the previous mode when the component hides, closes, or disposes, or if the terminal host recovers from a crash or restart. Fullscreen mode retains its baseline mouse and autowrap behavior. In custom standalone hosts, `setAutowrap` may be absent; write escape sequences directly only when your component owns the terminal directly.
345
368
 
346
- ### Renderer mode in an isolated component
369
+ ### Detecting fullscreen vs. main-screen mode
347
370
 
348
371
  `tui.mode` is `"fullscreen"` when Atomic paints on the alternate screen and `"regular"` on the main-screen fallback (used under `TERM=dumb`, in CI, or without a TTY).
349
372
 
350
- In isolated mode, a `ctx.ui.custom()` component or component-factory widget runs in the engine child and `tui.mode` reflects the host's renderer: each frame carries its mode, and Atomic invalidates the component when the mode changes. Before the host requests the first frame, `tui.mode` is `"regular"`, so read it inside `render()` rather than only inside the factory.
373
+ Each rendered frame updates `tui.mode` to match the active terminal renderer, and Atomic invalidates the component whenever the mode changes. Before the first frame renders, `tui.mode` starts as `"regular"`, so read `tui.mode` inside `render()` rather than caching it inside the factory.
351
374
 
352
375
  ### Host-native session picker
353
376
 
354
- Use `ctx.ui.hostSessionPicker(request)` for responsive session-list navigation and search, including when an extension is busy. Send JSON-safe rows, update or close the picker, and handle selection, cancellation, and confirmed Ctrl+D deletion through the API.
377
+ Use `ctx.ui.hostSessionPicker(request)` for responsive session-list navigation and search, even while an extension is busy. Pass JSON-safe rows, update or close the picker, and handle selection, cancellation, and confirmed `Ctrl+D` deletion through the API.
355
378
 
356
- The API is available in interactive modes, not headless RPC or print. Report that limitation rather than building a fallback picker. Callers do not need to branch on engine isolation.
379
+ This API is available in interactive terminal sessions and absent in headless RPC or print mode; report that limitation instead of building a fallback picker.
357
380
 
358
381
  ```typescript
359
382
  const picker = ctx.ui.hostSessionPicker?.({
@@ -379,14 +402,23 @@ Set `canDelete: false` on a row to disable deletion even when `onDelete` is pres
379
402
 
380
403
  ### Host-native input form
381
404
 
382
- Use `ctx.ui.hostInputForm(request)` for a structured inline form in the editor slot. It supports Tab/Shift+Tab, arrows, text editing, configured keybindings, Enter, Escape, and Ctrl+C, including under engine isolation. The promise rejects if the host cannot read the form, with "The host could not read this input form."
405
+ Use `ctx.ui.hostInputForm(request)` for a structured inline form in the editor slot. It supports `Tab`/`Shift+Tab`, arrow keys, text editing, configured keybindings, `Enter`, `Escape`, and `Ctrl+C`. The promise rejects with `"The host could not read this input form."` if the host cannot read the form.
383
406
 
384
407
  ```typescript
385
408
  try {
386
409
  const values = await ctx.ui.hostInputForm?.({
387
410
  title: "Release",
411
+ heading: "Prepare release", // optional panel heading label
412
+ submitLabel: "Publish", // optional submit button label
388
413
  fields: [
389
- { name: "version", type: "string", required: true, initialValue: "" },
414
+ {
415
+ name: "version",
416
+ type: "string",
417
+ description: "Semantic version tag",
418
+ placeholder: "1.2.3",
419
+ required: true,
420
+ initialValue: "",
421
+ },
390
422
  { name: "channel", type: "select", choices: ["stable", "beta"], initialValue: "stable" },
391
423
  ],
392
424
  });
@@ -396,7 +428,7 @@ try {
396
428
  }
397
429
  ```
398
430
 
399
- Field types are `string`, `text`, `number`, `integer`, `boolean`, and `select`. Initial and returned values are raw strings; the caller owns domain coercion.
431
+ `HostInputFormRequest` accepts `title`, `fields`, optional `heading`, and optional `submitLabel`. Each `HostInputFormField` accepts `name`, `type` (`"string"`, `"text"`, `"number"`, `"integer"`, `"boolean"`, or `"select"`), `initialValue` (raw string), and optional `description`, `placeholder`, `required`, and `choices`. Returned values are raw strings; your extension owns parsing and domain coercion.
400
432
 
401
433
  Every current interactive Atomic host exposes the optional capability, while headless RPC and print surfaces omit it. Keep a legacy fallback only when compatibility with older hosts is required.
402
434
 
package/docs/tui.md CHANGED
@@ -1,21 +1,14 @@
1
1
  ---
2
- title: "TUI components"
3
- description: "Build custom terminal UI for extensions."
2
+ title: "Build TUI components"
3
+ sidebarTitle: "TUI components"
4
+ description: "Build custom interactive terminal UI components, overlays, selectors, widgets, and editors for Atomic extensions."
4
5
  ---
5
6
 
6
- # TUI components
7
-
8
- Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and common interaction patterns.
9
-
10
- **Source:** TUI components come from Atomic's `@bastani/atomic-tui` runtime dependency. The [`@bastani/atomic-tui` library page](/libraries/tui) documents its full API, including standalone use outside Atomic.
11
-
12
- ## On this page and its reference
13
-
14
- This page covers writing your first component and common interaction patterns. The component and focusable interfaces, host terminal modes, the host-native session picker and input form, keyboard input, line width, invalidation, debug logging, and performance contracts live in the [TUI API reference](/tui/reference).
7
+ Extensions and custom tools can render custom terminal UI (TUI) components for interactive workflows. This guide covers `ctx.ui.custom()`, overlays, built-in components, theming, and common patterns. For the full `Component`, `ExtensionCustomComponent`, `Focusable`, keyboard, invalidation, debug logging, and host-native UI contracts, see [TUI API reference](/tui/reference) and [`@bastani/atomic-tui`](/libraries/tui).
15
8
 
16
9
  ## Using components
17
10
 
18
- Use `ctx.ui.custom()` with a component factory. The factory receives `done(result)`, and `ctx.ui.custom()` resolves with that result when the component finishes:
11
+ Use `ctx.ui.custom()` with a synchronous or `async` component factory (`ExtensionCustomComponent | Promise<ExtensionCustomComponent>`). The factory receives `done(result)`, and `ctx.ui.custom()` resolves with that value when the component calls `done()`. Components may also implement `dispose?(): void` for cleanup when dismissed.
19
12
 
20
13
  ```typescript
21
14
  atomic.on("session_start", async (_event, ctx) => {
@@ -26,23 +19,20 @@ atomic.on("session_start", async (_event, ctx) => {
26
19
  });
27
20
  ```
28
21
 
29
- Pass `{ signal }` to `ctx.ui.custom()` when the UI belongs to an abortable operation. Aborting a mounted custom UI dismisses it and releases its input ownership. In-process mode rejects the returned promise with the signal reason; isolated mode resolves it with `undefined`, like host-side cancellation. For overlays, use `options.onHandle` to receive an overlay handle for programmatic visibility control.
30
-
31
- For inspection or navigation, pass `{ purpose: "navigation" }` so Atomic mounts the component without emitting `ui_prompt_start` or `ui_prompt_end` (preventing persistent viewers from reporting the session as blocked). Inline navigation temporarily hides all `ctx.ui.setWidget()` widgets above and below the editor, including the agent panel, plus queued-message and pending-shell previews, restoring them when the last inline navigation view closes. Overlays do not hide them. The default purpose is `"prompt"` (for approvals and required user decisions); prompts opened during navigation still emit their own lifecycle events.
22
+ Key options for `ctx.ui.custom(factory, options?)`:
32
23
 
33
- Navigation still owns keyboard focus. In `getHostCustomUiState()` and its change listener, `blockingInlineCustomUiActive` counts all inline mounts, while `blockingInlineCustomUiNeedsInput` distinguishes real pending prompts from navigation-only mounts (preserved across the isolated-engine bridge).
24
+ - **`handlesCtrlC?: boolean`:** By default (`false`), Atomic closes a custom component on the first `Ctrl+C` so a wedged component cannot trap the keyboard. Set `handlesCtrlC: true` only when your component handles `Ctrl+C` itself (for example to cancel, skip, or close cleanly).
25
+ - **`handlesInternalUiAction?: boolean`:** Set `true` when the component claims internal UI actions such as clicking the jump-to-bottom URL.
26
+ - **`signal?: AbortSignal`:** Dismisses the component and releases input ownership when aborted. Inside Atomic's CLI terminal UI, aborting resolves with `undefined` (matching user cancellation); in an embedded SDK TUI host, aborting rejects with `signal.reason`.
27
+ - **`purpose?: "prompt" | "navigation"`:** Defaults to `"prompt"` (for approvals and required user decisions). Pass `{ purpose: "navigation" }` for inspection or browsing views so Atomic mounts the component without emitting `ui_prompt_start`/`ui_prompt_end`. Inline navigation temporarily hides `ctx.ui.setWidget()` widgets, the agent panel, and queued previews until the last inline navigation view closes (overlays do not hide them). In `getHostCustomUiState()`, `blockingInlineCustomUiActive` counts all inline mounts while `blockingInlineCustomUiNeedsInput` distinguishes required prompts from navigation views.
28
+ - **`blocked?: { kind: "question" | "permission" | "auth", message: string }`:** Reports Atomic as waiting for user input through [program status](/terminal-setup#program-status). Inline components report blocked while visible; overlays report blocked from mount until `done()` or `signal` abort, even while hidden with `setHidden()` or covered by another overlay. When several blocking prompts are open, the most recently shown one supplies `kind` and `message`.
29
+ - **`overlay?: boolean`, `overlayOptions?: OverlayOptions | (() => OverlayOptions)`, `onHandle?: (handle: OverlayHandle) => void`:** Mounts the component as a floating overlay (see [Overlays](#overlays)). `overlayOptions` may be a static object or a callback evaluated dynamically on render.
30
+ - **`deferInlineCustomUiFocus?: boolean`:** Overlay option that keeps pending inline custom UI deferred in the background while the overlay holds focus.
31
+ - **`reserveTranscriptRows?: boolean`:** Overlay-only option for blocking bottom-anchored dialogs (such as `ask_user_question`). Requires a bottom anchor (`bottom-left`, `bottom-center`, or `bottom-right`), rejects `row` and nonzero `offsetY`, leaves at least 6 transcript rows visible above the overlay, and extends transcript scrollback so every line can scroll into view. On short terminals, embed `OVERLAY_ACTIVE_ROW_MARKER` (exported from `@bastani/atomic`) once per frame in your selected row so Atomic windows the cropped overlay around that row instead of clipping it from the top.
34
32
 
35
- Custom components do not report Atomic as waiting through [program status](/terminal-setup#program-status) by default, because `ctx.ui.custom()` also hosts loaders and non-blocking UI. When a component waits for an answer, pass `blocked: { kind, message }` (`kind` is `"question"`, `"permission"`, or `"auth"`):
33
+ Main-chat inline custom UIs share the editor slot. Completing an older mount leaves the current one visible; closing the current mount restores the most recent pending inline UI, and the main editor returns only after the last inline owner closes. Reserving bottom prompts (`reserveTranscriptRows`) wait out of view while inline navigation or an overlay with `deferInlineCustomUiFocus` owns input, and `Escape` belongs to the active navigation view until it closes.
36
34
 
37
- - Inline components report blocked while visible; a newer dialog shown in their place reports its own status.
38
- - Overlays report blocked from mount until `done()` or `signal` abort, even while hidden with `setHidden()` or covered by another overlay.
39
- - When several blocking prompts are open, the most recently shown one supplies `kind` and `message`.
40
-
41
- Main-chat inline custom UIs share the editor slot. Completing an older mount leaves the current one visible; closing the current mount restores the most recent pending inline UI, and the main editor returns only after the last inline owner closes.
42
-
43
- Reserving bottom prompts (`reserveTranscriptRows`, including `ask_user_question`) wait out of view while inline navigation or an overlay with `deferInlineCustomUiFocus` owns input. Leaving navigation restores the same pending prompt, and `Escape` belongs exclusively to the active navigation view until then.
44
-
45
- In isolated interactive mode, do not access host process objects from `render()` or `handleInput()`. Return JSON-safe values to `done()`. Return `true` for consumed viewport keys or overlay mouse events and `false` to let the transcript handle them. Set `wantsKeyRelease = true` only when your component needs release events. Non-overlay components leave mouse scrolling and selection with the transcript.
35
+ Do not rely on host process globals from `render()` or `handleInput()`, and pass only JSON-safe values to `done()`. Return `true` for consumed viewport keys or overlay mouse events and `false` to let the transcript handle them. Set `wantsKeyRelease = true` only when your component needs key release events. Non-overlay components leave mouse scrolling and selection with the transcript.
46
36
 
47
37
  ## Overlays
48
38
 
@@ -55,7 +45,7 @@ const result = await ctx.ui.custom<string | null>(
55
45
  );
56
46
  ```
57
47
 
58
- For positioning and sizing, use `overlayOptions`:
48
+ For positioning and sizing, pass `overlayOptions` as a static object or a `() => OverlayOptions` function for dynamic updates:
59
49
 
60
50
  ```typescript
61
51
  const result = await ctx.ui.custom<string | null>(
@@ -309,8 +299,8 @@ renderResult(result, options, theme, context) {
309
299
  **Foreground colors** (`theme.fg(color, text)`):
310
300
 
311
301
  | Category | Colors |
312
- |----------|--------|
313
- | General | `text`, `accent`, `muted`, `dim` |
302
+ | --- | --- |
303
+ | General | `text`, `accent`, `muted`, `dim`, `searchMatchText` |
314
304
  | Status | `success`, `error`, `warning` |
315
305
  | Borders | `border`, `borderAccent`, `borderMuted` |
316
306
  | Messages | `userMessageText`, `customMessageText`, `customMessageLabel` |
@@ -318,12 +308,12 @@ renderResult(result, options, theme, context) {
318
308
  | Diffs | `toolDiffAdded`, `toolDiffRemoved`, `toolDiffContext` |
319
309
  | Markdown | `mdHeading`, `mdLink`, `mdLinkUrl`, `mdCode`, `mdCodeBlock`, `mdCodeBlockBorder`, `mdQuote`, `mdQuoteBorder`, `mdHr`, `mdListBullet` |
320
310
  | Syntax | `syntaxComment`, `syntaxKeyword`, `syntaxFunction`, `syntaxVariable`, `syntaxString`, `syntaxNumber`, `syntaxType`, `syntaxOperator`, `syntaxPunctuation` |
321
- | Thinking | `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh` |
311
+ | Thinking | `thinkingText`, `thinkingOff`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh` |
322
312
  | Modes | `bashMode` |
323
313
 
324
314
  **Background colors** (`theme.bg(color, text)`):
325
315
 
326
- `selectedBg`, `userMessageBg`, `customMessageBg`, `toolPendingBg`, `toolSuccessBg`, `toolErrorBg`
316
+ `selectedBg`, `userMessageBg`, `customMessageBg`, `toolPendingBg`, `toolSuccessBg`, `toolErrorBg`, `scrollbarThumb`, `searchMatchBg`
327
317
 
328
318
  **For Markdown**, use `getMarkdownTheme()`:
329
319
 
@@ -481,7 +471,7 @@ atomic.registerCommand("pick", {
481
471
 
482
472
  **Examples:** [preset.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/preset.ts), [tools.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/tools.ts)
483
473
 
484
- ### Pattern 2: Async Operation with Cancel (BorderedLoader)
474
+ ### Pattern 2: Async operation with cancel (`BorderedLoader`)
485
475
 
486
476
  For operations that take time and should be cancellable. `BorderedLoader` shows a spinner and handles escape to cancel.
487
477
 
@@ -513,7 +503,7 @@ atomic.registerCommand("fetch", {
513
503
 
514
504
  **Examples:** [qna.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/qna.ts), [handoff.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/handoff.ts)
515
505
 
516
- ### Pattern 3: Settings/Toggles (SettingsList)
506
+ ### Pattern 3: Settings and toggles (`SettingsList`)
517
507
 
518
508
  For toggling multiple settings. Use `SettingsList` from `@bastani/atomic-tui` with `getSettingsListTheme()`.
519
509
 
@@ -560,7 +550,7 @@ atomic.registerCommand("settings", {
560
550
 
561
551
  **Examples:** [tools.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/tools.ts)
562
552
 
563
- ### Pattern 4: Persistent Status Indicator
553
+ ### Pattern 4: Persistent status indicator
564
554
 
565
555
  Show status in the footer that persists across renders. Good for mode indicators.
566
556
 
@@ -610,7 +600,7 @@ Compaction and retry loaders use their own factual text and the built-in indicat
610
600
 
611
601
  **Examples:** [working-indicator.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/working-indicator.ts)
612
602
 
613
- ### Pattern 5: Widgets Above/Below Editor
603
+ ### Pattern 5: Widgets above or below the editor
614
604
 
615
605
  Show persistent content above or below the input editor. Good for todo lists, progress.
616
606
 
@@ -645,7 +635,7 @@ The listener runs after the host removes that key, so the extension can reset lo
645
635
 
646
636
  Opt in with `scroll: { maxHeight: 6 }` to give a widget its own fullscreen viewport. The host may allocate fewer rows when the editor or other widgets need space. Render the full content, not a pre-clipped slice. Wheel input over the widget scrolls only that widget, including at either end. A one-column scrollbar appears only while content overflows. Scrolling does not take editor focus or register keyboard shortcuts.
647
637
 
648
- For a cap that follows terminal resizing, use `scroll: { maxHeight: 10, maxHeightFraction: 1 / 3 }`. The fraction is applied to live terminal rows, rounded down with a one-row minimum, then limited by `maxHeight`. Actual allocation may still be zero when other dock content uses all available rows. Omitting the fraction retains the fixed cap. The same options work for isolated-engine widgets.
638
+ For a cap that follows terminal resizing, use `scroll: { maxHeight: 10, maxHeightFraction: 1 / 3 }`. The fraction applies to live terminal rows, rounded down with a one-row minimum, then capped at `maxHeight`. Actual allocation may still be zero when other dock content uses all available rows. Omitting the fraction keeps the fixed cap.
649
639
 
650
640
  ```typescript
651
641
  import type { ScrollableWidgetComponent, WidgetScrollRequest } from "@bastani/atomic";
@@ -673,11 +663,11 @@ ctx.ui.requestRender();
673
663
 
674
664
  `getScrollRequest` and `onScroll` are optional. Keep the request version unchanged during ordinary updates so they do not reset wheel scrolling. New positions are clamped to the actual viewport. Requests with older versions are ignored. Unmounting starts a fresh viewport. Keep item identity and insertion/deletion anchors in your extension; positions here count rendered rows.
675
665
 
676
- `installReactiveWidget` accepts the same `scroll`, `getScrollRequest`, and `onScroll` options. Existing widgets remain unscrolled unless they opt in. Factory widgets work in both in-process and isolated-engine sessions. Native wheel input requires the fullscreen renderer and a terminal that forwards mouse events; the guarded main-screen fallback does not provide a native viewport. No Option/Alt key setup is required for wheel input.
666
+ `installReactiveWidget` accepts the same `scroll`, `getScrollRequest`, and `onScroll` options. Existing widgets remain unscrolled unless they opt in. Native wheel input requires fullscreen mode and a terminal that forwards mouse events; the main-screen fallback (such as `TERM=dumb` or non-TTY sessions) does not provide a native viewport. No Option/Alt key setup is required for wheel input.
677
667
 
678
668
  **Examples:** [plan-mode/index.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/plan-mode/index.ts)
679
669
 
680
- ### Pattern 6: Custom Footer
670
+ ### Pattern 6: Custom footer
681
671
 
682
672
  Replace the footer. `footerData` exposes data not otherwise accessible to extensions.
683
673
 
@@ -695,7 +685,7 @@ ctx.ui.setFooter((tui, theme, footerData) => ({
695
685
  ctx.ui.setFooter(undefined); // restore default
696
686
  ```
697
687
 
698
- `ctx.ui.getFooterDataProvider()` exposes the same read-only status and Git-branch provider to embedded extension UIs, including isolated interactive sessions.
688
+ `ctx.ui.getFooterDataProvider()` exposes the same read-only status and Git-branch provider to embedded extension UIs in Atomic's terminal UI.
699
689
 
700
690
  For a viewer with a different cwd, subscribe with that cwd to retain its branch watcher, and read the live branch during each render using the same raw cwd string:
701
691
 
@@ -718,7 +708,7 @@ Token stats available via `ctx.sessionManager.getBranch()` and `ctx.model`.
718
708
 
719
709
  **Examples:** [custom-footer.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/custom-footer.ts)
720
710
 
721
- ### Pattern 7: Custom Editor (vim mode, etc.)
711
+ ### Pattern 7: Custom editor (vim mode)
722
712
 
723
713
  Replace the main input editor with a custom implementation. Useful for modal editing (vim), different keybindings (emacs), or specialized input handling.
724
714
 
@@ -787,14 +777,14 @@ export default function (atomic: ExtensionAPI) {
787
777
 
788
778
  - **Extend `CustomEditor`** (not base `Editor`) to get app keybindings (escape to abort, ctrl+d to exit, model switching, etc.)
789
779
  - **Call `super.handleInput(data)`** for keys you don't handle
790
- - **Working status**: editors keep the standalone working row by default. Pass `{ embedWorkingStatus: true }` as the fourth `CustomEditor` constructor argument to opt into the editor-border spinner.
791
- - **Factory pattern**: `setEditorComponent` receives a factory function that gets `tui`, `theme`, and `keybindings`
792
- - **Autocomplete limit**: custom editors installed through `setEditorComponent()` that expose `setAutocompleteMaxVisible()` inherit the active `autocompleteMaxVisible` setting
793
- - **Pass `undefined`** to restore the default editor: `ctx.ui.setEditorComponent(undefined)`
780
+ - **`CustomEditorOptions`**: The optional fourth argument to `new CustomEditor(tui, theme, keybindings, options?)` accepts `{ promptPrefix?, placeholder?, embedWorkingStatus?, topRuleLabel?, paddingX?, autocompleteMaxVisible? }`. Editors keep the standalone working row by default; pass `{ embedWorkingStatus: true }` to render the working spinner in the editor's top border.
781
+ - **Factory pattern**: `setEditorComponent` receives a factory function that gets `tui`, `theme`, and `keybindings`.
782
+ - **Autocomplete limit**: Custom editors installed through `setEditorComponent()` that expose `setAutocompleteMaxVisible()` inherit the active `autocompleteMaxVisible` setting.
783
+ - **Pass `undefined`** to restore the default editor: `ctx.ui.setEditorComponent(undefined)`.
794
784
 
795
785
  **Examples:** [modal-editor.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/modal-editor.ts)
796
786
 
797
- ### Pattern 7b: Attached Composer
787
+ ### Pattern 7b: Attached composer
798
788
 
799
789
  When an extension or custom SDK host embeds a secondary chat editor, `applyAttachedComposer(style, label, placeholder, lines)` distinguishes it from the main prompt: accent-coloured rules above and below the prompt, the top rule ending in a bold `label`, and a dim `placeholder` after the cursor while nothing is typed.
800
790
 
@@ -831,7 +821,7 @@ export default function (atomic: ExtensionAPI) {
831
821
  }
832
822
  ```
833
823
 
834
- It replaces only a plain editor rule or one that reads `↑ N more` or `↓ N more`: a first or last line that is not a rule, such as one your editor draws itself, is left as it is. A long label is cut with `…` to fit. Below `INPUT_LABEL_MIN_COLUMNS` (40) columns, the rules stay heavy without the label. Pass `undefined` for `label` or `placeholder` to leave either out.
824
+ It replaces only a plain editor rule or one that reads `↑ N more` or `↓ N more`: a first or last line that is not a rule, such as one your editor draws itself, is left unchanged. Composer rules draw with the light box-drawing glyph (`─`). A long label truncates with `…` to fit, and below `INPUT_LABEL_MIN_COLUMNS` (40) columns, the light `─` rules render without the label. Pass `undefined` for `label` or `placeholder` to omit either.
835
825
 
836
826
  ## Key rules
837
827
 
@@ -841,7 +831,7 @@ It replaces only a plain editor rule or one that reads `↑ N more` or `↓ N mo
841
831
 
842
832
  3. **Call `tui.requestRender()` after state changes.** In `handleInput`, call `tui.requestRender()` after updating state.
843
833
 
844
- 4. **Return the three-method object.** Custom components need `{ render, invalidate, handleInput }`.
834
+ 4. **Return the component object.** Custom components implement `{ render, invalidate, handleInput?, dispose? }`.
845
835
 
846
836
  5. **Use existing components.** `Selector`, `SelectList`, `SettingsList`, and `BorderedLoader` cover most interactive UI cases.
847
837
 
@@ -857,22 +847,4 @@ It replaces only a plain editor rule or one that reads `↑ N more` or `↓ N mo
857
847
  - **Snake game**: [examples/extensions/snake.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/snake.ts): game with keyboard input and game loop.
858
848
  - **Custom tool rendering**: [examples/extensions/todo.ts](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/todo.ts): `renderCall` and `renderResult`.
859
849
 
860
- ## Moved sections
861
-
862
- <a id="component-interface" />
863
- <a id="focusable-interface-ime-support" />
864
- <a id="container-components-with-embedded-inputs" />
865
- <a id="host-terminal-modes-from-an-isolated-component" />
866
- <a id="host-native-session-picker" />
867
- <a id="host-native-input-form" />
868
- <a id="keyboard-input" />
869
- <a id="line-width" />
870
- <a id="debug-logging" />
871
- <a id="performance" />
872
- <a id="invalidation-and-theme-changes" />
873
- <a id="the-problem" />
874
- <a id="the-solution" />
875
- <a id="pattern-rebuild-on-invalidate" />
876
- <a id="when-this-matters" />
877
-
878
- These component, input, invalidation, logging, performance, and host-integration contracts moved to [TUI API reference](/tui/reference).
850
+ For component, focusable, keyboard input, invalidation, debug logging, and host-native UI contracts, continue to [TUI API reference](/tui/reference).