@bastani/atomic 0.10.19 → 0.10.20-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/dist/_shared/adapter-open-DXXV6ATH.js +22 -0
  3. package/dist/_shared/adapter-open-DXXV6ATH.js.map +1 -0
  4. package/dist/_shared/dist-KOELCESV.js +2 -2
  5. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  6. package/dist/_shared/lib-4PES5P4V.js +2 -2
  7. package/dist/_shared/mode-interactive-sdk-JXBZ3H27.js +484 -229
  8. package/dist/_shared/mode-interactive-sdk-JXBZ3H27.js.map +1 -1
  9. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +63 -16
  10. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
  11. package/dist/_shared/mode-shared-2QJSCUM6.js +61 -16
  12. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  13. package/dist/_shared/p0-cli-BB45ZQY6.js +2 -2
  14. package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
  15. package/dist/_shared/p1b-elig-BY2G5BUE.js +6 -3
  16. package/dist/_shared/p1b-elig-BY2G5BUE.js.map +1 -1
  17. package/dist/_shared/runtime-O4KCSG4C.js +5 -5
  18. package/dist/_shared/{sdk-BHX35EPK.js → sdk-5ZFNDXUJ.js} +319 -86
  19. package/dist/_shared/sdk-5ZFNDXUJ.js.map +1 -0
  20. package/dist/_shared/session-data-AHTU7IS6.js +15 -7
  21. package/dist/_shared/session-data-AHTU7IS6.js.map +1 -1
  22. package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
  23. package/dist/_shared/settings-startup-HXQLSUWM.js +2 -2
  24. package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -1
  25. package/dist/_shared/{startup-0-0-4EDVBK5P.js → startup-0-0-OWBJIX35.js} +162 -44
  26. package/dist/_shared/startup-0-0-OWBJIX35.js.map +1 -0
  27. package/dist/_shared/{startup-0-1-H5IXVRXQ.js → startup-0-1-DZYE4E5Z.js} +462 -37
  28. package/dist/_shared/startup-0-1-DZYE4E5Z.js.map +1 -0
  29. package/dist/_shared/{startup-0-2-YZZOC22D.js → startup-0-2-WFLTE4SC.js} +147 -6
  30. package/dist/_shared/startup-0-2-WFLTE4SC.js.map +1 -0
  31. package/dist/_shared/startup-0-3-DE2NCS6A.js +59 -50
  32. package/dist/_shared/startup-0-3-DE2NCS6A.js.map +1 -1
  33. package/dist/_shared/{startup-0-4-ZMJV547D.js → startup-0-4-6XXL4JMZ.js} +115 -25
  34. package/dist/_shared/startup-0-4-6XXL4JMZ.js.map +1 -0
  35. package/dist/_shared/{startup-0-5-HZX3ZPTP.js → startup-0-5-DNS6FYS7.js} +229 -156
  36. package/dist/_shared/startup-0-5-DNS6FYS7.js.map +1 -0
  37. package/dist/_shared/{startup-10-0-TDQNBDDL.js → startup-10-0-O6DAT7U4.js} +131 -162
  38. package/dist/_shared/startup-10-0-O6DAT7U4.js.map +1 -0
  39. package/dist/_shared/startup-12-0-55AAXBJZ.js +3 -3
  40. package/dist/_shared/startup-14-0-MLX36RBG.js +9 -6
  41. package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
  42. package/dist/_shared/{startup-15-0-YUKGAC63.js → startup-15-0-E7RYG5YF.js} +9 -9
  43. package/dist/_shared/{startup-15-0-YUKGAC63.js.map → startup-15-0-E7RYG5YF.js.map} +1 -1
  44. package/dist/_shared/startup-15-1-WQZBOTMZ.js +340 -128
  45. package/dist/_shared/startup-15-1-WQZBOTMZ.js.map +1 -1
  46. package/dist/_shared/startup-8-0-34CBHPZH.js +279 -151
  47. package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
  48. package/dist/_shared/{startup-8-1-QZMXUGHI.js → startup-8-1-VXBL37AI.js} +352 -27
  49. package/dist/_shared/startup-8-1-VXBL37AI.js.map +1 -0
  50. package/dist/_shared/storage-command-7MGXLJGZ.js +15 -273
  51. package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
  52. package/dist/_shared/{storage-status-K7PX2RXA.js → storage-status-T6FUXRIM.js} +8 -24
  53. package/dist/_shared/{storage-status-K7PX2RXA.js.map → storage-status-T6FUXRIM.js.map} +1 -1
  54. package/dist/_shared/task-reference-stream-JWMUZSJX.js +1 -1
  55. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  56. package/dist/_shared/team-DOQKICG2.js +4 -3
  57. package/dist/_shared/team-DOQKICG2.js.map +1 -1
  58. package/dist/_shared/tree-outline-MUEPK5B7.js +9 -2
  59. package/dist/_shared/tree-outline-MUEPK5B7.js.map +1 -1
  60. package/dist/binary-self-update.js +3 -3
  61. package/dist/builtin/intercom/broker/broker.bundle.mjs +46 -8
  62. package/dist/builtin/intercom/broker/broker.ts +1 -0
  63. package/dist/builtin/intercom/broker/client.ts +5 -1
  64. package/dist/builtin/intercom/broker/departed-children.ts +12 -6
  65. package/dist/builtin/intercom/broker/ended-child-wakes.ts +2 -0
  66. package/dist/builtin/intercom/index.bundle.mjs +130 -264
  67. package/dist/builtin/intercom/message-display.ts +42 -0
  68. package/dist/builtin/intercom/package.json +1 -1
  69. package/dist/builtin/intercom/types.ts +1 -0
  70. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  71. package/dist/builtin/mcp/package.json +1 -1
  72. package/dist/builtin/subagents/package.json +1 -1
  73. package/dist/builtin/subagents/src/extension/index.bundle.mjs +99 -20
  74. package/dist/builtin/web-access/index.bundle.mjs +15 -9
  75. package/dist/builtin/web-access/package.json +1 -1
  76. package/dist/cli/args.js +2 -2
  77. package/dist/cli/auth-cli.code.js +6 -6
  78. package/dist/cli/auth-cli.impl.js +3 -3
  79. package/dist/cli/auth-cli.js +3 -3
  80. package/dist/cli/blueprint-command.code.js +4 -4
  81. package/dist/cli/blueprint-command.impl.js +3 -3
  82. package/dist/cli/blueprint-command.js +3 -3
  83. package/dist/cli/intercom-command.code.js +3 -3
  84. package/dist/cli/intercom-command.impl.js +3 -3
  85. package/dist/cli/intercom-command.js +3 -3
  86. package/dist/cli/list-models.code.js +3 -3
  87. package/dist/cli/list-models.impl.js +3 -3
  88. package/dist/cli/list-models.js +3 -3
  89. package/dist/cli/session-picker.code.js +2 -2
  90. package/dist/cli/session-picker.impl.js +3 -3
  91. package/dist/cli/session-picker.js +3 -3
  92. package/dist/cli/startup-ui.code.js +2 -2
  93. package/dist/cli/startup-ui.impl.js +3 -3
  94. package/dist/cli/startup-ui.js +3 -3
  95. package/dist/cli/storage-command.impl.js +3 -3
  96. package/dist/cli/storage-command.js +3 -3
  97. package/dist/cli/storage-search-session.code.js +3 -3
  98. package/dist/cli/storage-search-session.impl.js +3 -3
  99. package/dist/cli/storage-search-session.js +3 -3
  100. package/dist/cli/team-command.code.js +3 -3
  101. package/dist/cli/team-command.impl.js +3 -3
  102. package/dist/cli/team-command.js +3 -3
  103. package/dist/cli.js +2 -2
  104. package/dist/core/agent-session-runtime.d.ts +16 -4
  105. package/dist/core/agent-session-types.d.ts +5 -1
  106. package/dist/core/debug.impl.js +3 -3
  107. package/dist/core/debug.js +3 -3
  108. package/dist/core/export-html/card-projection.code.js +74 -72
  109. package/dist/core/export-html/card-projection.code.js.map +1 -1
  110. package/dist/core/export-html/card-projection.impl.js +3 -3
  111. package/dist/core/export-html/card-projection.js +3 -3
  112. package/dist/core/export-html/index.code.js +52 -41
  113. package/dist/core/export-html/index.code.js.map +1 -1
  114. package/dist/core/export-html/index.impl.js +3 -3
  115. package/dist/core/export-html/index.js +3 -3
  116. package/dist/core/export-html/json-spans.impl.js +3 -3
  117. package/dist/core/export-html/json-spans.js +3 -3
  118. package/dist/core/export-html/oversized-render-inputs.code.js +1 -1
  119. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  120. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  121. package/dist/core/export-html/template.js +27 -39
  122. package/dist/core/export-html/tool-renderer.code.js +1 -1
  123. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  124. package/dist/core/export-html/tool-renderer.js +3 -3
  125. package/dist/core/extensions/context-types.d.ts +3 -0
  126. package/dist/core/extensions/context-types.js.map +1 -1
  127. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  128. package/dist/core/extensions/jiti-loader.js +3 -3
  129. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  130. package/dist/core/extensions/jiti-static-loader.js +3 -3
  131. package/dist/core/extensions/loader-host-modules.code.js +1 -1
  132. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  133. package/dist/core/extensions/loader-host-modules.js +3 -3
  134. package/dist/core/extensions/loader-virtual-modules.js +2 -2
  135. package/dist/core/extensions/runner-context.d.ts +1 -0
  136. package/dist/core/extensions/runner-context.js +18 -2
  137. package/dist/core/extensions/runner-context.js.map +1 -1
  138. package/dist/core/extensions/runner.d.ts +1 -0
  139. package/dist/core/extensions/runtime-types.d.ts +1 -0
  140. package/dist/core/extensions/runtime-types.js.map +1 -1
  141. package/dist/core/intercom-broker-control-host.code.js +1 -1
  142. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  143. package/dist/core/intercom-broker-control-host.js +3 -3
  144. package/dist/core/intercom-broker-control.code.js +3 -3
  145. package/dist/core/intercom-broker-control.impl.js +3 -3
  146. package/dist/core/intercom-broker-control.js +3 -3
  147. package/dist/core/model-registry.js +2 -2
  148. package/dist/core/model-runtime-streaming.d.ts +3 -1
  149. package/dist/core/model-runtime.d.ts +2 -0
  150. package/dist/core/package-manager-storage-adapters.code.js +1 -1
  151. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  152. package/dist/core/package-manager-storage-adapters.js +3 -3
  153. package/dist/core/resume/failure.d.ts +1 -1
  154. package/dist/core/sdk.code.js +4 -4
  155. package/dist/core/sdk.impl.js +3 -3
  156. package/dist/core/sdk.js +3 -3
  157. package/dist/core/session-claims.d.ts +13 -2
  158. package/dist/core/session-load-events.d.ts +42 -0
  159. package/dist/core/session-manager-core.d.ts +17 -2
  160. package/dist/core/session-manager-core.js +234 -93
  161. package/dist/core/session-manager-core.js.map +1 -1
  162. package/dist/core/session-manager-errors.d.ts +2 -2
  163. package/dist/core/session-manager-history.d.ts +1 -1
  164. package/dist/core/session-manager-list.impl.js +3 -3
  165. package/dist/core/session-manager-list.js +3 -3
  166. package/dist/core/session-manager.code.js +2 -2
  167. package/dist/core/session-manager.impl.js +3 -3
  168. package/dist/core/session-manager.js +3 -3
  169. package/dist/core/session-storage.code.js +1 -1
  170. package/dist/core/session-storage.impl.js +3 -3
  171. package/dist/core/session-storage.js +3 -3
  172. package/dist/core/settings-manager.js +2 -2
  173. package/dist/core/storage/adapter-open.js +3 -0
  174. package/dist/core/storage/adapter-open.js.map +1 -0
  175. package/dist/core/storage/index.js +2 -2
  176. package/dist/core/storage/node-sqlite-thread.js +2 -2
  177. package/dist/core/storage/node-sqlite.js +2 -2
  178. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  179. package/dist/core/storage/offline-snapshot-file.js +3 -3
  180. package/dist/core/storage/prefix.js +1 -0
  181. package/dist/core/storage/prefix.js.map +1 -1
  182. package/dist/core/storage/provider.js +2 -2
  183. package/dist/core/storage/schema-catalog.d.ts +2 -1
  184. package/dist/core/storage/schema-catalog.js +25 -6
  185. package/dist/core/storage/schema-catalog.js.map +1 -1
  186. package/dist/core/storage/selection.js +2 -2
  187. package/dist/core/storage/session/branch-fork-source.code.js +17 -4
  188. package/dist/core/storage/session/branch-fork-source.code.js.map +1 -1
  189. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  190. package/dist/core/storage/session/branch-fork-source.js +3 -3
  191. package/dist/core/storage/session/card-view.impl.js +3 -3
  192. package/dist/core/storage/session/card-view.js +3 -3
  193. package/dist/core/storage/session/child-reader.code.js +7 -7
  194. package/dist/core/storage/session/child-reader.code.js.map +1 -1
  195. package/dist/core/storage/session/child-reader.d.ts +1 -0
  196. package/dist/core/storage/session/child-reader.impl.js +3 -3
  197. package/dist/core/storage/session/child-reader.js +3 -3
  198. package/dist/core/storage/session/chunked-resume-projection.code.js +1 -1
  199. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  200. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  201. package/dist/core/storage/session/expanded-child-details.code.js +3 -3
  202. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  203. package/dist/core/storage/session/expanded-child-details.js +3 -3
  204. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  205. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  206. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  207. package/dist/core/storage/session/fork-row-index.js +3 -3
  208. package/dist/core/storage/session/fork-staging.code.js +9 -5
  209. package/dist/core/storage/session/fork-staging.code.js.map +1 -1
  210. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  211. package/dist/core/storage/session/fork-staging.js +3 -3
  212. package/dist/core/storage/session/fork-window.code.js +29 -13
  213. package/dist/core/storage/session/fork-window.code.js.map +1 -1
  214. package/dist/core/storage/session/fork-window.impl.js +3 -3
  215. package/dist/core/storage/session/fork-window.js +3 -3
  216. package/dist/core/storage/session/history-pages.impl.js +3 -3
  217. package/dist/core/storage/session/history-pages.js +3 -3
  218. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  219. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  220. package/dist/core/storage/session/jsonl-session-store.d.ts +8 -4
  221. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  222. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  223. package/dist/core/storage/session/memory-session-store.d.ts +3 -3
  224. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  225. package/dist/core/storage/session/memory-session-store.js +3 -3
  226. package/dist/core/storage/session/parent-links.d.ts +122 -0
  227. package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
  228. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  229. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  230. package/dist/core/storage/session/released-history-files.code.js +3 -3
  231. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  232. package/dist/core/storage/session/released-history-files.js +3 -3
  233. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  234. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  235. package/dist/core/storage/session/session-resume.impl.js +3 -3
  236. package/dist/core/storage/session/session-resume.js +3 -3
  237. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  238. package/dist/core/storage/session/snapshot-cut.js +3 -3
  239. package/dist/core/storage/session/snapshot-history.code.js +5 -6
  240. package/dist/core/storage/session/snapshot-history.code.js.map +1 -1
  241. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  242. package/dist/core/storage/session/snapshot-history.js +3 -3
  243. package/dist/core/storage/session/sql-session-store.code.js +1 -1
  244. package/dist/core/storage/session/sql-session-store.d.ts +7 -20
  245. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  246. package/dist/core/storage/session/sql-session-store.js +3 -3
  247. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  248. package/dist/core/storage/session/tree-outline.js +3 -3
  249. package/dist/core/storage/session/tree-presentation.code.js +1 -1
  250. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  251. package/dist/core/storage/session/tree-presentation.js +3 -3
  252. package/dist/core/storage/session/types.d.ts +11 -3
  253. package/dist/core/storage/session/usage-observations.d.ts +27 -0
  254. package/dist/core/storage/session/usage-observations.js +3 -0
  255. package/dist/core/storage/session/usage-observations.js.map +1 -0
  256. package/dist/core/storage/storage-status.code.js +1 -1
  257. package/dist/core/storage/storage-status.impl.js +3 -3
  258. package/dist/core/storage/storage-status.js +3 -3
  259. package/dist/core/storage/team.impl.js +3 -3
  260. package/dist/core/storage/team.js +3 -3
  261. package/dist/core/structured-output/index.code.js +1 -1
  262. package/dist/core/structured-output/index.impl.js +3 -3
  263. package/dist/core/structured-output/index.js +3 -3
  264. package/dist/core/subscription-usage-identity.d.ts +9 -0
  265. package/dist/core/subscription-usage-observations.d.ts +15 -0
  266. package/dist/core/subscription-usage-storage.js +3 -0
  267. package/dist/core/subscription-usage-storage.js.map +1 -0
  268. package/dist/core/subscription-usage.d.ts +20 -3
  269. package/dist/core/tasks/task-completion-entry.code.js +1 -1
  270. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  271. package/dist/core/tasks/task-completion-entry.js +3 -3
  272. package/dist/core/tasks/task-file-history.code.js +3 -3
  273. package/dist/core/tasks/task-file-history.impl.js +3 -3
  274. package/dist/core/tasks/task-file-history.js +3 -3
  275. package/dist/core/tasks/task-reference-archive.code.js +5 -5
  276. package/dist/core/tasks/task-reference-archive.js +3 -3
  277. package/dist/core/tasks/task-reference-identity.code.js +1 -1
  278. package/dist/core/tasks/task-reference-identity.js +3 -3
  279. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  280. package/dist/core/tasks/task-reference-stream.js +3 -3
  281. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  282. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  283. package/dist/core/tasks/task-view-source.code.js +1 -1
  284. package/dist/core/tasks/task-view-source.impl.js +3 -3
  285. package/dist/core/tasks/task-view-source.js +3 -3
  286. package/dist/core/tools/read-url.code.js +3 -3
  287. package/dist/core/tools/read-url.impl.js +3 -3
  288. package/dist/core/tools/read-url.js +3 -3
  289. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  290. package/dist/core/worktree-snapshot/errors.code.js +3 -3
  291. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  292. package/dist/core/worktree-snapshot/errors.js +3 -3
  293. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  294. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  295. package/dist/extensions/codemode/execute.code.js +2 -2
  296. package/dist/extensions/codemode/execute.impl.js +3 -3
  297. package/dist/extensions/codemode/execute.js +3 -3
  298. package/dist/extensions/codemode/renderer.code.js +12 -7
  299. package/dist/extensions/codemode/renderer.code.js.map +1 -1
  300. package/dist/extensions/codemode/renderer.impl.js +3 -3
  301. package/dist/extensions/codemode/renderer.js +3 -3
  302. package/dist/extensions/mcp/cli.code.js +3 -3
  303. package/dist/extensions/mcp/cli.impl.js +3 -3
  304. package/dist/extensions/mcp/cli.js +3 -3
  305. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  306. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  307. package/dist/extensions/mcp/cli.lazy.js +3 -3
  308. package/dist/extensions/mcp/runtime.code.js +1 -1
  309. package/dist/extensions/mcp/runtime.impl.js +3 -3
  310. package/dist/extensions/mcp/runtime.js +3 -3
  311. package/dist/index.d.ts +6 -3
  312. package/dist/index.js +10 -10
  313. package/dist/main-first-time-setup.code.js +2 -2
  314. package/dist/main-first-time-setup.impl.js +3 -3
  315. package/dist/main-first-time-setup.js +3 -3
  316. package/dist/main.js +1 -1
  317. package/dist/modes/index.d.ts +1 -1
  318. package/dist/modes/interactive/components/intercom-wake-notice.d.ts +4 -0
  319. package/dist/modes/interactive/components/notice-line.d.ts +1 -1
  320. package/dist/modes/interactive/components/stored-tree-view.code.js +6 -5
  321. package/dist/modes/interactive/components/stored-tree-view.code.js.map +1 -1
  322. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  323. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  324. package/dist/modes/interactive/components/tool-block.d.ts +5 -1
  325. package/dist/modes/interactive/components/user-message-selector-archive.code.js +1 -1
  326. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  327. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  328. package/dist/modes/interactive-engine/isolated-runtime.d.ts +4 -3
  329. package/dist/modes/print-mode.js +1 -1
  330. package/dist/modes/rpc/rpc-client-api.d.ts +5 -0
  331. package/dist/modes/rpc/rpc-client.d.ts +1 -1
  332. package/dist/modes/rpc/rpc-types.d.ts +26 -3
  333. package/dist/package-manager-cli.code.js +7 -7
  334. package/dist/package-manager-cli.impl.js +3 -3
  335. package/dist/package-manager-cli.js +3 -3
  336. package/dist/rpc-entry.js +1 -1
  337. package/dist/startup-files.json +1 -1
  338. package/dist/startup-stages/10.js +1 -1
  339. package/dist/startup-stages/12.js +1 -1
  340. package/dist/startup-stages/13.js +2 -1
  341. package/dist/startup-stages/14.js +1 -0
  342. package/dist/startup-stages/4.js +1 -1
  343. package/dist/startup-stages/6.js +1 -1
  344. package/dist/startup-stages/7.js +1 -1
  345. package/dist/startup-stages/8.js +1 -1
  346. package/dist/startup-stages/stages.json +1 -1
  347. package/dist/utils/startup-database-spare.code.js +3 -3
  348. package/dist/utils/startup-database-spare.impl.js +3 -3
  349. package/dist/utils/startup-database-spare.js +3 -3
  350. package/dist/utils/tools-manager.code.js +1 -1
  351. package/dist/utils/tools-manager.impl.js +3 -3
  352. package/dist/utils/tools-manager.js +3 -3
  353. package/docs/.agents/context/DESIGN.md +30 -0
  354. package/docs/changelog.mdx +46 -0
  355. package/docs/docs.json +1 -1
  356. package/docs/extensions/api-reference.md +6 -0
  357. package/docs/guides/subscription-usage.md +28 -82
  358. package/docs/intercom.md +3 -1
  359. package/docs/json.md +3 -3
  360. package/docs/providers.md +2 -0
  361. package/docs/reference/cli.md +3 -1
  362. package/docs/rpc/protocol.md +31 -3
  363. package/docs/sdk/reference.md +26 -1
  364. package/docs/sdk.md +2 -0
  365. package/docs/sessions.md +38 -1
  366. package/docs/slash-commands.md +1 -1
  367. package/docs/subagents.md +2 -0
  368. package/docs/usage.md +1 -1
  369. package/package.json +8 -8
  370. package/dist/_shared/sdk-BHX35EPK.js.map +0 -1
  371. package/dist/_shared/startup-0-0-4EDVBK5P.js.map +0 -1
  372. package/dist/_shared/startup-0-1-H5IXVRXQ.js.map +0 -1
  373. package/dist/_shared/startup-0-2-YZZOC22D.js.map +0 -1
  374. package/dist/_shared/startup-0-4-ZMJV547D.js.map +0 -1
  375. package/dist/_shared/startup-0-5-HZX3ZPTP.js.map +0 -1
  376. package/dist/_shared/startup-10-0-TDQNBDDL.js.map +0 -1
  377. package/dist/_shared/startup-8-1-QZMXUGHI.js.map +0 -1
@@ -4,60 +4,32 @@ sidebarTitle: "Subscription usage"
4
4
  description: "See how much of your AI subscriptions you have used and when the limits reset."
5
5
  ---
6
6
 
7
- Type `/usage` in Atomic to see how much of your subscription allowance is left and when it resets. You can check without interrupting a reply. **Current** marks the account selected in this session. Press `r` to check again, the arrow keys to scroll, or `Esc` to close.
7
+ Type `/usage` to see how much of each signed-in subscription’s allowance you’ve used and when it resets, without interrupting a reply. If Atomic has no figures yet, the account says **Not available**.
8
8
 
9
9
  ```text
10
10
  Subscription usage
11
11
 
12
- OpenAI Codex · Current · openai-codex
13
- Session (5 h) █████░░░░░░░ 42.5% used Resets in 2 h 14 min · Sat 4:30 PM
14
- Weekly (7 d) ██████████░░ 87% used Resets in 2 d 3 h · Mon 5:16 PM
15
- Reset credits: 1 available
16
- ```
17
-
18
- A usage window is the period a provider's limit covers. In this example, `Session (5 h)` is the provider's five-hour window, not the current Atomic chat. The weekly bar shows 87% used, so 13% is left until the Monday reset. Atomic shows reset times in your terminal's local time.
12
+ Anthropic account 2 · anthropic-2
13
+ Weekly (7 d) ████░░░░░░░░ 37% used Resets in 3 d 20 h · Wed 1:00 PM
19
14
 
20
- Atomic shows only the windows your provider reports for your plan. A full bar means the account has reached that limit. If the provider offers reset credits, the report shows how many are available. Checking usage does not spend them or change settings. For token counts and costs for this Atomic session, use `/session` instead.
21
-
22
- | Sign-in | What you can see |
23
- | --- | --- |
24
- | **OpenAI Codex** (`openai-codex`) | The short and weekly windows, extra model limits, plan, usage credits, and reset credits when reported. |
25
- | **Anthropic Claude** (`anthropic`) | The five-hour and weekly windows, model-specific weekly windows such as Sonnet and Opus, and whether extra usage is on. Anthropic can bill use from tools like Atomic separately from what the Claude plan includes. |
26
- | **Grok** (`xai`) | Weekly credits, per-product use, and monthly use on accounts with monthly billing. |
27
- | **GitHub Copilot** (`github-copilot`) | Premium requests, chat, and completions if your plan reports them. Some of these may be unlimited. |
28
- | **Kimi Code** (`kimi-coding`) | The short and longer limits Kimi reports for your plan, including separate code use when available. |
29
- | **OpenRouter sign-in** (`openrouter`) | The sign-in’s credit cap, amount left, and spending in USD, not a subscription window. |
30
- | **Sign in with ChatGPT for the OpenAI API** (`openai`) | Figures from the account’s last model response. If it did not report subscription windows, Atomic shows the request and token limits instead. For full plan windows, sign in through OpenAI Codex (`openai-codex`). |
31
- | **Meta** | This sign-in does not report subscription usage. |
15
+ OpenAI Codex · openai-codex
16
+ Not available
32
17
 
33
- ### If an account has no usage numbers
18
+ ↑ ↓ scroll Esc close r refresh
19
+ ```
34
20
 
35
- Read the message below the account name. If a provider’s check fails, other accounts can still show their usage. Where possible, Atomic shows figures from a recent reply and marks them as older.
21
+ New figures can appear while the panel is open. Atomic remembers the last figures it received. If a window has reset since then, it shows `0% used` without guessing the next reset time. Times are local.
36
22
 
37
- | What the report says | What it means and what to do |
38
- | --- | --- |
39
- | API key (`api_key`) | You pay for API use instead of using a subscription allowance. Check the provider’s billing dashboard. |
40
- | No subscription figures (`unsupported`, `no_subscription`) | That provider or account does not make plan figures available to Atomic. Check its own usage page. |
41
- | Not signed in (`not_signed_in`) or sign in again (`sign_in_again`) | There’s no saved sign-in for this account, or the provider rejected it. Use `/login` or `atomic auth login <provider>`. |
42
- | Claude login lacks usage access (`needs_profile_scope`) | A setup token can run models but can’t read usage. Use `/login anthropic` or `atomic auth login anthropic` and complete the full Claude sign-in instead. If you set a setup token in your environment, remove it when switching. |
43
- | No access (`forbidden`) | The provider did not grant this login permission to read its usage. Check the account’s permissions or its usage page. |
44
- | No usage observed yet (`not_observed`) | Send a normal prompt with that ChatGPT sign-in, then reopen `/usage` or press `r`. The standalone CLI can’t read figures from an open session’s last reply; use RPC to check that session from a script. |
45
- | Offline (`offline`) | Atomic did not contact the provider. Turn off offline mode and try again if you want a live check. |
46
- | Too many checks (`rate_limited`) | Wait a little before trying again. |
47
- | Timeout, connection, or provider error (`timeout`, `request_failed`, `http_error`, `malformed`) | The provider was unreachable, too slow, or returned a report Atomic could not read. Press `r` to retry; if it persists, check the provider’s own usage page. |
23
+ Use the up and down arrows or the mouse wheel to scroll. Press `Esc` to close or `r` to refresh. The **Fullscreen scrollbar** setting applies to the panel and the chat. Checking usage never spends reset credits. For this chat’s token counts and costs, use `/session` instead.
48
24
 
49
25
  ## Check from a script
50
26
 
51
- Use the text report in a terminal and the JSON report in scripts. Neither starts a chat.
52
-
53
27
  ```bash
54
28
  atomic usage
55
29
  atomic usage --json
56
30
  ```
57
31
 
58
- Add `--offline` to list accounts without contacting providers. If you have not signed in, the text report tells you to run `atomic auth login`. The JSON report is `{"accounts":[]}`.
59
-
60
- `--json` prints one JSON object. The command can succeed even if one account has no figures or a check fails. Read each account's `status` before using its data. To check an open session from an RPC client, send [`get_usage`](/rpc/protocol#get_usage).
32
+ The first command prints a readable report. The second prints one JSON object. Both list all configured accounts, including API keys, without starting a chat. Add `--offline` to check without contacting providers. If there are no accounts, the JSON report is `{"accounts":[]}`. An [RPC client](/rpc/protocol#get_usage) can read the same report from an open session.
61
33
 
62
34
  ```json
63
35
  {
@@ -67,20 +39,12 @@ Add `--offline` to list accounts without contacting providers. If you have not s
67
39
  "name": "OpenAI Codex",
68
40
  "current": true,
69
41
  "status": "ready",
70
- "source": "live",
42
+ "availability": "available",
43
+ "source": "stored",
44
+ "observedAt": "2026-11-28T16:30:00.000Z",
71
45
  "windows": [
72
- { "label": "Session", "usedPercent": 42.5, "durationSeconds": 18000, "resetsAt": "2026-11-28T16:30:00.000Z" },
73
46
  { "label": "Weekly", "usedPercent": 87, "durationSeconds": 604800, "resetsAt": "2026-11-30T17:16:00.000Z" }
74
- ],
75
- "resetCredits": 1
76
- },
77
- {
78
- "provider": "anthropic",
79
- "name": "Anthropic",
80
- "current": false,
81
- "status": "unavailable",
82
- "reason": "needs_profile_scope",
83
- "message": "This login lacks usage access (user:profile). Sign in to Claude again without a setup token."
47
+ ]
84
48
  }
85
49
  ]
86
50
  }
@@ -88,46 +52,28 @@ Add `--offline` to list accounts without contacting providers. If you have not s
88
52
 
89
53
  ### JSON and SDK contract
90
54
 
91
- `atomic usage --json` and the SDK return the same stable `SubscriptionUsageReport` structure. Credentials, tokens and raw provider responses are never part of the report. Fields described as optional are omitted when not reported; missing values do not mean zero. Consumers can ignore new fields or reason codes if added in the future.
55
+ The CLI, RPC, SDK, and extension reports use the same account fields. They never include credentials or raw provider replies.
92
56
 
93
57
  | Field | Meaning |
94
58
  | --- | --- |
95
- | `accounts` | An array of results. It is empty if there are no accounts to check. |
96
- | `provider`, `name`, `current` | `provider` is the account ID, such as `openai-codex`. `name` is the display name. `current` is `true` for the selected account in an open session or the configured default in a standalone report, if known. |
97
- | `status` | `ready` means figures are available. `unavailable` explains why there are no figures. `failed` means the check did not complete. |
98
- | `source`, `observedAt` | For a `ready` account, `live` means a provider usage check supplied the figures. Atomic can reuse those figures briefly. `recent_response` means a live check did not supply figures, so Atomic used a recent reply. `last_request` means the figures came from an ordinary reply without a separate usage check. `observedAt` on `last_request` is when Atomic saw those figures, in UTC. |
99
- | `windows` | The limits the provider reported. Each has a `label` such as `Weekly`, a `usedPercent`, a length in seconds (`durationSeconds`), and a reset time in UTC (`resetsAt`). A percentage of `0` means unused, `100` means full, and some providers report more than `100`. Unknown lengths and reset times are `null`. |
100
- | `rateLimits` | Optional limits from the last OpenAI API request, distinct from subscription windows. Each entry says whether it covers `requests` or `tokens` (`kind`), plus any `limit`, `remaining`, or `resetsAt` the provider reported. |
101
- | `plan`, `resetCredits` | Optional. The provider’s plan name and the number of reset credits still available. |
102
- | `credits`, `extraUsage` | Optional. `credits` describes ordinary usage credits: whether you have any (`available`), whether they’re unlimited (`unlimited`), and how many remain (`balance`). `extraUsage` says whether Claude’s paid extra use is on (`enabled`) and how much of it has been used (`usedPercent`), if known. |
103
- | `creditCap`, `unlimitedWindows` | Optional. The OpenRouter cap (`limit`, or `null` if uncapped), dollars left (`remaining`), how often it resets (`reset`), and dollars used this day, week, or month (`dailyUsed`, `weeklyUsed`, `monthlyUsed`). `unlimitedWindows` lists any limits the provider reports as unlimited. |
104
- | `reason`, `message` | On `unavailable`, `failed`, or `recent_response` results, a code for scripts and a plain explanation for people. |
105
-
106
- The [account message table](#if-an-account-has-no-usage-numbers) explains the codes. If Atomic shows figures from a recent reply, `reason` still explains why the latest check did not return figures.
59
+ | `provider`, `name`, `current` | The account ID, display name, and whether it is selected. |
60
+ | `availability` | `"available"` or `"unavailable"`. An API-key account can be available without any subscription windows. |
61
+ | `status` | The outcome of the check: `"ready"`, `"unavailable"`, or `"failed"`. A report can contain all three. |
62
+ | `observedAt` | When Atomic learned these figures, in UTC. Check it if you need to know how old the figures are. |
63
+ | `source` | `"live"` for a provider check, `"recent_response"` for a reply used as a fallback, `"last_request"` for figures from the last OpenAI API request, or `"stored"` for the last saved figures. |
64
+ | `windows` | The limits the provider reported. An unknown length (`durationSeconds`) or reset time (`resetsAt`) is `null`. |
65
+ | `plan`, `credits`, `resetCredits`, `extraUsage`, `creditCap`, `unlimitedWindows`, `rateLimits` | More details when the provider reports them. `rateLimits` are request or token limits, not subscription windows. |
66
+ | `reason`, `message` | Additional details for scripts that need them. |
107
67
 
108
68
  ## Check from the SDK
109
69
 
110
- Install `@bastani/atomic` and import `getSubscriptionUsage`. It checks all configured accounts by default. Pass `accounts` to check selected IDs, `maxAgeMs: 0` to skip the cache (normally one minute), or `signal` to cancel the whole check. To include accounts registered only on an SDK session, pass `modelRuntime: session.modelRuntime`.
111
-
112
70
  ```typescript
113
71
  import { getSubscriptionUsage } from "@bastani/atomic";
114
72
 
115
- const { accounts } = await getSubscriptionUsage({
116
- accounts: ["openai-codex", "anthropic"],
117
- signal: AbortSignal.timeout(10_000),
118
- });
119
-
120
- const byWeeklyCapacity = accounts.flatMap((account) => {
121
- if (account.status !== "ready" || account.source !== "live") return [];
122
- const weekly = account.windows.find((window) => window.label === "Weekly");
123
- if (!weekly) return [];
124
- return [{ provider: account.provider, remainingPercent: Math.max(0, 100 - weekly.usedPercent) }];
125
- }).sort((a, b) => b.remainingPercent - a.remainingPercent);
126
-
127
- if (byWeeklyCapacity.length) console.table(byWeeklyCapacity);
128
- else console.log("No current weekly usage was reported.");
73
+ const { accounts } = await getSubscriptionUsage({ accounts: ["openai-codex"] });
74
+ for (const account of accounts) {
75
+ if (account.status === "ready") console.log(account.name, account.windows);
76
+ }
129
77
  ```
130
78
 
131
- This example compares weekly limits only. If OpenAI Codex reports 87% used, its row shows `13` under `remainingPercent`. It skips figures from earlier model replies.
132
-
133
- The SDK call rejects if you cancel it or Atomic can't read the saved accounts. A problem with one provider appears in that account's result without rejecting the whole report.
79
+ Omit `accounts` to check all configured accounts. Pass `maxAgeMs: 0` to check again instead of reusing a recent provider check. Extensions can call `ctx.getSubscriptionUsage()` for the accounts in their session.
package/docs/intercom.md CHANGED
@@ -43,7 +43,9 @@ Sent messages are recorded in session history and confirmed with a notification.
43
43
 
44
44
  ### From the agent
45
45
 
46
- Agents list sessions and exchange messages through the `intercom` tool. Tool calls and results render as compact transcript rows so message flows stay easy to scan:
46
+ Agents list sessions and exchange messages through the `intercom` tool. The chat shows whether a message was delivered and a short preview. When you see an expand hint, press `Ctrl+O` or your own expand shortcut to read the full message and see the delivery details. In fullscreen mode, you can also click to expand it.
47
+
48
+ If a message wakes a subagent, expand the notice in the chat that launched it to see the full message, who sent it, and which subagent woke up.
47
49
 
48
50
  ```typescript
49
51
  // List active sessions
package/docs/json.md CHANGED
@@ -19,18 +19,18 @@ Need to send follow-up commands to a live process or embed Atomic in Node.js? Co
19
19
  - **Per-process storage isolation:** Pass `--storage '<json>'`, `--storage-file <path>`, or `--session-store <path>` (with optional `--session-prefix <prefix>`), or set `ATOMIC_STORAGE` or `ATOMIC_SESSIONS_STORAGE` in the environment, to isolate script or CI runs without changing saved settings. See [Selecting storage per process](/storage#selecting-storage-per-process).
20
20
 
21
21
  <Note>
22
- If a saved default `provider/model` names an unsupported provider or a storage override fails with `StorageConfigError`, JSON mode writes the diagnostic to stderr, leaves stdout completely empty so downstream JSON parsers never see non-JSON text, and exits with code `1`. Supported providers with an unknown model or missing credentials fall back through normal model selection.
22
+ If a saved default `provider/model` names an unsupported provider or a storage override fails with `StorageConfigError`, JSON mode writes the diagnostic to stderr and exits with code `1`. Stdout can contain loading events, but not a model reply. Supported providers with an unknown model or missing credentials fall back through normal model selection.
23
23
  </Note>
24
24
 
25
25
  ## Output format
26
26
 
27
- Each line on stdout is one JSON object terminated by `\n`. Atomic emits the session header before session events (including when `--no-session` is passed, which emits the in-memory session header):
27
+ Each line on stdout is one JSON object terminated by `\n`. [Loading events](/sessions#show-your-own-loading-indicator) come before the session header. Look for `type: "session"` rather than assuming it’s the first line. With `--no-session` the header describes the in-memory session:
28
28
 
29
29
  ```json
30
30
  {"type":"session","version":4,"id":"uuid","createdAt":"2026-01-01T00:00:00.000Z","cwd":"/path"}
31
31
  ```
32
32
 
33
- When resuming a session whose worktree blueprint build is running in another process, a runner-level `blueprint_build_waiting` event can arrive **before** the session header.
33
+ When resuming a session whose worktree blueprint build is running in another process, a `blueprint_build_waiting` event can also arrive before the session header.
34
34
 
35
35
  Session events follow as they occur:
36
36
 
package/docs/providers.md CHANGED
@@ -25,6 +25,8 @@ OpenRouter, Atomic's preferred partner, appears first in `/login`, `/logout`, an
25
25
 
26
26
  Run `/login <provider>` (such as `/login openrouter` or `/login kimi-coding`) to open a provider directly. When a provider offers both sign-in and an API key, Atomic prompts with **Use a subscription** (or **Use an account**) and **Use an API key**.
27
27
 
28
+ Once signed in, run `/usage` to see how much of each subscription you've used. See [Check subscription usage](/guides/subscription-usage).
29
+
28
30
  To sign in from the shell without starting a session, run `atomic auth login <provider>`. Pass `--no-browser` for a device-code or non-browser flow (such as over SSH), or `--api-key` to store an API key without echoing it. See [Credential commands](/reference/cli#credential-commands).
29
31
 
30
32
  - **Browser callback sign-in (OpenRouter, Claude, OpenAI, ChatGPT Codex, and compatible extension providers):** Opens a browser login and listens on a local callback port. On remote or headless machines where the browser cannot reach localhost, paste the final redirect URL or authorization code into the prompt instead.
@@ -368,7 +368,9 @@ The credential print commands emit one configured credential for an external cli
368
368
 
369
369
  ## Subscription usage
370
370
 
371
- Run `atomic usage` for a plain-text report of your signed-in accounts and `atomic usage --json` for the same report as one JSON object. Neither starts a session. A report can contain an unavailable or failed account without failing the command. `atomic usage --offline` lists accounts without contacting providers. See [Check subscription usage](/guides/subscription-usage) for supported accounts, an example, and the JSON fields.
371
+ Run `atomic usage` for a readable report or `atomic usage --json` for the same report as one JSON object. Neither starts a chat. Both include configured API-key accounts. Add `--offline` to see the last known figures without contacting providers.
372
+
373
+ Each account has `availability`, either `"available"` or `"unavailable"`. For example, `{"availability":"available","observedAt":"2026-11-28T16:30:00.000Z"}` says figures were available at that time. The existing `status` still describes the outcome of the check. See [Check subscription usage](/guides/subscription-usage) for a full example.
372
374
 
373
375
  ## MCP commands
374
376
 
@@ -258,12 +258,40 @@ Key fields on `data`:
258
258
 
259
259
  #### get_usage
260
260
 
261
- Read subscription usage without interrupting the current turn. The response `data` is the same [usage report](/guides/subscription-usage#json-and-sdk-contract) as `atomic usage --json`. An optional `provider` selects an account by its Atomic ID. Set `refresh` to `true` to skip the cache.
261
+ Use `get_usage` to show account usage in an app connected to Atomic, without interrupting a reply. Omit `provider` to check all configured accounts, including API keys. Set `refresh` to `true` to check again instead of reusing a recent check.
262
+
263
+ For example, check Codex usage in an offline session that uses Codex:
262
264
 
263
265
  ```json
264
- {"type":"get_usage","id":"report","refresh":true}
266
+ {"id":"report","type":"get_usage","provider":"openai-codex"}
265
267
  ```
266
268
 
269
+ If Atomic has not saved any figures for this account, the reply looks like this:
270
+
271
+ ```json
272
+ {
273
+ "id": "report",
274
+ "type": "response",
275
+ "command": "get_usage",
276
+ "success": true,
277
+ "data": {
278
+ "accounts": [
279
+ {
280
+ "provider": "openai-codex",
281
+ "name": "OpenAI Codex",
282
+ "current": true,
283
+ "status": "unavailable",
284
+ "availability": "unavailable",
285
+ "reason": "offline",
286
+ "message": "Usage checks are off in offline mode."
287
+ }
288
+ ]
289
+ }
290
+ }
291
+ ```
292
+
293
+ `data` has the same [report fields](/guides/subscription-usage#json-and-sdk-contract) as `atomic usage --json`. Each account's `availability` is `"available"` or `"unavailable"`; an API-key account can be available without subscription windows. `success: true` means Atomic returned a report, even when an account has no figures or its check failed. Read the account's `reason` or `message` for details. An error of `Could not read subscription accounts.` with `success: false` means Atomic could not make the report at all.
294
+
267
295
  #### get_messages
268
296
 
269
297
  Return all messages in the active conversation branch.
@@ -1785,7 +1813,7 @@ Returns `{"completions": null}` when the command does not exist or does not prov
1785
1813
 
1786
1814
  ## Events
1787
1815
 
1788
- Events stream to stdout as JSON lines. Most events carry no `id`; `bash_execution_update` is the exception and carries the originating shell command's `id`.
1816
+ Events stream to stdout as JSON lines. Most events carry no `id`. Shell updates (`bash_execution_update`) and [session loading updates](/sessions#show-your-own-loading-indicator) carry the originating command's `id` when provided. Ignore event types your client doesn’t use.
1789
1817
 
1790
1818
  ### Event types
1791
1819
 
@@ -6,7 +6,32 @@ description: "Complete API reference for Atomic SDK session options, model scopi
6
6
 
7
7
  ## Subscription usage
8
8
 
9
- Call `getSubscriptionUsage()` to check account limits without starting a session. It returns a `Promise<SubscriptionUsageReport>` with the same fields as `atomic usage --json`. By default it checks every configured account. Pass `accounts` for specific provider IDs, `maxAgeMs: 0` to check again instead of reusing a recent result, or `signal` to cancel. To include accounts added only to an existing SDK session, pass `modelRuntime: session.modelRuntime`. See [the SDK example](/guides/subscription-usage#check-from-the-sdk) for a script that compares weekly limits.
9
+ Use `getSubscriptionUsage()` in a script to see how much of your accounts' allowances you've used, without starting a chat. It returns the same report as `atomic usage --json`, including API-key accounts.
10
+
11
+ ```typescript
12
+ import { getSubscriptionUsage } from "@bastani/atomic";
13
+
14
+ const { accounts } = await getSubscriptionUsage({ accounts: ["openai-codex"] });
15
+ for (const account of accounts) {
16
+ if (account.status !== "ready") {
17
+ console.log(`${account.name}: ${account.message}`);
18
+ continue;
19
+ }
20
+ for (const window of account.windows) {
21
+ console.log(`${account.name}: ${window.label}, ${window.usedPercent}% used`);
22
+ }
23
+ }
24
+ ```
25
+
26
+ Example output: `OpenAI Codex: Weekly, 87% used`.
27
+
28
+ Omit `accounts` to check all configured accounts. Pass `maxAgeMs: 0` to check again instead of reusing a recent check, or pass `signal` to cancel. To use the accounts from an existing SDK session, pass `modelRuntime: session.modelRuntime`.
29
+
30
+ Each account's `availability` is `"available"` or `"unavailable"`. An available API-key account need not have subscription windows. The separate `status` tells you how the check went: `"ready"`, `"unavailable"`, or `"failed"`. A provider that takes too long can return `reason: "timeout"` and a readable `message`, while other accounts still return figures.
31
+
32
+ If the call throws `Could not read subscription accounts.`, Atomic could not make the report at all. A cancelled call throws the reason from the supplied `signal` instead.
33
+
34
+ See [Check subscription usage](/guides/subscription-usage#json-and-sdk-contract) for the report fields.
10
35
 
11
36
  ## Options reference
12
37
 
package/docs/sdk.md CHANGED
@@ -396,6 +396,8 @@ console.log(result.form, result.history?.boundaryEntry);
396
396
 
397
397
  ### Replacing and rehydrating sessions
398
398
 
399
+ If people wait for sessions to open in your app, [show your own loading indicator](/sessions#show-your-own-loading-indicator) with the events from `runtime.subscribe()`.
400
+
399
401
  Use `createAgentSessionRuntime()` and `AgentSessionRuntime` when your host needs session replacement (`newSession()`, `switchSession()`, `fork()`, clone via `fork(entryId, { position: "at" })`, `importFromJsonl()`) with rebuilt working-directory services:
400
402
 
401
403
  ```typescript
package/docs/sessions.md CHANGED
@@ -37,6 +37,8 @@ atomic --import <file> # Import an exported JSONL session into storage
37
37
  atomic --export <file> [output] # Convert an exported .jsonl file on disk to HTML
38
38
  ```
39
39
 
40
+ Atomic fixes broken history links and duplicate entry IDs automatically and tells you what it changed. An entry whose earlier link is broken is placed after the entry recorded just before it. If it is the first entry, it starts a branch. Import gives each repeated entry after the first a new ID, so later messages still follow the right entry. Atomic does not edit a separate source file. If a matching session in storage is already damaged, importing repairs that copy too. Opening a damaged session without importing it shows a warning and leaves the saved history unchanged.
41
+
40
42
  Inside an interactive session, use these slash commands (see [Slash commands](/slash-commands) for the complete list):
41
43
 
42
44
  | Command | Action |
@@ -71,7 +73,7 @@ Every session binds to its original working directory so tools, `@path` referenc
71
73
  - **Custom IDs and flag conflicts.** `--session-id <id>` opens an existing project-local session with that exact ID in the current directory, or creates a new one (printing a notice on stderr) if none exists. IDs use ASCII letters, digits, `.`, `_`, and `-`, starting and ending with a letter or digit. Combining `--fork` with `--session-id <id>` names the new forked session and fails if that ID already exists. `--fork` cannot be combined with `--session`, `--continue`, `--resume`, or `--no-session`; `--session-id` cannot be combined with `--session`, `--continue`, or `--resume`; `--import` cannot be combined with `--session`, `--fork`, `--session-id`, `--continue`, or `--resume` (combining `--import` with `--no-session` inspects the file without saving it). Conflicting flags exit with code `1`.
72
74
  - **Snapshots on resume.** When a session recorded [worktree snapshots](/worktree-snapshots), `atomic --session <id>` from another directory reopens it directly—reusing a matching local checkout or restoring files into `~/.atomic/agent/worktree-snapshots/` with a one-line notice. Inspect snapshots with `/session snapshot` ([Inspecting snapshots](/worktree-snapshots#inspecting-snapshots)).
73
75
  - **Missing working directory.** If the recorded directory is gone and Atomic cannot restore a checkout from a snapshot, start `atomic --session <id>` from the directory you want to use, or select the session with `/resume`. At the interactive prompt, choose **Continue** to use the current directory without changing the saved path, **Fork** to create a separate session in the current directory, or **Cancel** to leave the session alone. Non-interactive modes (`-p`, RPC) and programmatic session switches report a missing-directory error rather than prompting.
74
- - **Fast resume.** Compacted sessions open from the latest compaction boundary instead of loading the entire history upfront. Commands that inspect earlier entries (`/tree`, `/fork`, `/clone`, `/export`, `/share`, and `/session`) page older history on demand. `/session` shows totals immediately and fills in per-model cost and cache stats once that scan finishes. Slow resumes or sessions with 100,000 or more entries print step timings before opening the TUI.
76
+ - **Fast resume.** Compacted sessions open from the latest compaction boundary instead of loading the entire history upfront. Commands that inspect earlier entries (`/tree`, `/fork`, `/clone`, `/export`, `/share`, and `/session`) page older history on demand. `/session` shows totals immediately and fills in per-model cost and cache stats once that scan finishes. When opening a session takes a little longer, Atomic shows what’s loading; set `ATOMIC_REDUCED_MOTION=1` for a still indicator.
75
77
  - **Draft preservation.** Text typed before a startup picker or prompt appears waits as a draft without confirming pickers or `Fork this session? [y/N]`.
76
78
  - **Tool restoration.** Plain resume restores the session's recorded tool selection along with newly available extension tools. Explicitly disabled tools stay off, `--tools +name,-name` adjusts the restored set, and previously used tools that are no longer installed appear under **Missing** in `/tools`.
77
79
 
@@ -84,6 +86,41 @@ When you reopen an interactive session (`--session`, `-c`, `-r`, or `/resume`) a
84
86
  - Unseen background task results render as cards without starting a turn, followed by a recovery summary line.
85
87
  - Non-interactive runs (`atomic -p`) leave interrupted work pending until the next interactive resume.
86
88
 
89
+ ### Show your own loading indicator
90
+
91
+ Atomic always sends loading updates on its event streams when it opens, switches, forks, imports, or reloads a session. Subscribe once and ignore what you don’t need. Each load sends one `session_load_started`, any available `session_load_progress` updates, and one final `session_load_finished` or `session_load_failed`. Use `loadId` to keep overlapping loads apart and `target` to see which session or path is being loaded. Show a progress `message` as-is. When `historyEntries` is present, it’s how many saved entries Atomic plans to read, not how many it has already read.
92
+
93
+ **TypeScript SDK.** `runtime.subscribe()` follows the active session across swaps. It also sends the initial open updates when you subscribe. To see an initial open live, including one that fails before a session exists, subscribe with `subscribeToSessionLoads(listener)` before creating it instead. If you already have a session and only need its own events, `session.subscribe()` also sees its reload.
94
+
95
+ ```typescript
96
+ const stop = runtime.subscribe((event) => {
97
+ if (event.type === "session_load_progress") console.log(event.message);
98
+ });
99
+ await runtime.switchSession("my-task");
100
+ // Reading session history
101
+ // Reading 450 history entries
102
+ // Preparing session
103
+ stop();
104
+ ```
105
+
106
+ **RPC.** Listen on the usual event stream. When a command has an `id`, its load updates carry that same `id`, and its usual response still follows:
107
+
108
+ ```json
109
+ {"id":"open-task","type":"switch_session","sessionId":"my-task"}
110
+ ```
111
+
112
+ ```jsonl
113
+ {"id":"open-task","type":"session_load_started","loadId":"load-1","target":"my-task"}
114
+ {"id":"open-task","type":"session_load_progress","loadId":"load-1","target":"my-task","message":"Reading session history"}
115
+ {"id":"open-task","type":"session_load_progress","loadId":"load-1","target":"my-task","message":"Reading 450 history entries","historyEntries":450}
116
+ {"id":"open-task","type":"session_load_progress","loadId":"load-1","target":"my-task","message":"Preparing session"}
117
+ {"id":"open-task","type":"session_load_finished","loadId":"load-1","target":"my-task","cancelled":false}
118
+ ```
119
+
120
+ **CLI scripts.** `atomic --mode json --session my-task` sends the same updates, without an `id`, before the session header. Read one [JSON line](/json) at a time and look at its `type` instead of expecting the header on the first line.
121
+
122
+ Clear your indicator on either final event. `cancelled: true` means the load stopped without opening its target. `session_load_failed` includes a message explaining why, such as a missing session; the SDK still rejects, RPC returns its usual error response, and the CLI still reports an error and exits as before. If the process stops unexpectedly, clear the indicator when the connection closes.
123
+
87
124
  ### Session picker search and shortcuts
88
125
 
89
126
  Each row in the **Resume** picker shows the session name or first message, age, message count, folder (in all-folders scope), and summary.
@@ -16,7 +16,7 @@ Extensions, prompt templates, and skills can add more commands at runtime, so th
16
16
  | `/thinking` | `[level]` | Open the thinking-level selector, or set and persist a specific level directly (such as `off`, `low`, `medium`, `high`). |
17
17
  | `/scoped-models` | *(bare only)* | Enable or disable models included in `Ctrl+P` / `Shift+Ctrl+P` quick cycling. |
18
18
  | `/login` | `[provider]` | Configure subscription, account, or API-key authentication. Passing a provider jumps straight to login, opens the method chooser, or filters the provider list. |
19
- | `/usage` | *(bare only)* | Check [subscription usage](/guides/subscription-usage) without interrupting a reply. Press `r` to refresh or `Esc` to close. |
19
+ | `/usage` | *(bare only)* | Check [subscription usage](/guides/subscription-usage) for your signed-in subscription accounts without interrupting a reply. Press `r` to refresh or `Esc` to close. |
20
20
  | `/logout` | `[provider]` | Remove stored credentials from `~/.atomic/agent/auth.json` (and legacy `~/.pi/agent/auth.json`). Does not clear environment variables, CLI flags, or `models.json` keys. |
21
21
 
22
22
  ## Sessions and context
package/docs/subagents.md CHANGED
@@ -201,6 +201,8 @@ subagent({ action: "resume", id: "<child-id>", message: "Focus on the failing te
201
201
  - **Interrupting control calls.** Pressing `Esc` stops waiting on `pause`, `quit`, or `resume` (already-requested stops finish; unstarted resumes cancel cleanly).
202
202
  - **Removed actions.** `kill` and `interrupt` were removed; calls fail and point to `{ action: "quit", id }`.
203
203
 
204
+ When you see an expand hint after resuming a subagent, press `Ctrl+O` or your own expand shortcut to see what happened, the task ID, and any message you sent.
205
+
204
206
  #### Messages that resume a finished subagent
205
207
 
206
208
  Any session allowed to message a subagent under Intercom group and reach rules can wake it. A single-target `intercom` `send` or `ask` to a completed or failed subagent returns immediately with `queued: true`, and the launching session resumes the subagent to handle the message. Calling `subagent({ action: "resume", id: "<intercom-name>", message })` for a subagent launched by another session sends `message` through that same wake queue.
package/docs/usage.md CHANGED
@@ -90,7 +90,7 @@ Here are the everyday commands you will use most often:
90
90
  | Command | Description |
91
91
  | --- | --- |
92
92
  | `/login [provider]` | Sign in with an OAuth account/subscription or save an API key ([Authentication](/getting-started/authentication)) |
93
- | `/usage` | See [subscription usage](/guides/subscription-usage) for signed-in accounts while your reply keeps running |
93
+ | `/usage` | See [subscription usage](/guides/subscription-usage) for all your subscription accounts while your reply keeps running |
94
94
  | `/logout [provider]` | Remove stored credentials from `~/.atomic/agent/auth.json` (leaves env vars and `models.json` untouched) |
95
95
  | `/model [provider/model]` | Switch models and save the startup default ([Choose a model](/models/choose-a-model)). Exact matches switch immediately; other text pre-filters the picker. Inside the picker, press `←`/`→` to adjust effort level and `Tab` to toggle scoped vs. all models |
96
96
  | `/thinking [level]` | Set the thinking level and save the startup default (rejects levels unsupported by the current model) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.10.19",
3
+ "version": "0.10.20-alpha.2",
4
4
  "description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "atomicConfig": {
@@ -118,13 +118,13 @@
118
118
  "prepack": "node -e \"require('node:fs').existsSync('scripts/split-dist.mjs') && import('./scripts/split-dist.mjs').then(() => import('./scripts/write-startup-files.mjs')).then(() => import('./scripts/write-startup-stages.mjs'))\""
119
119
  },
120
120
  "dependencies": {
121
- "@bastani/atomic-natives": "0.10.19",
122
- "@bastani/atomic-ai": "0.10.19",
123
- "@bastani/atomic-agent-core": "0.10.19",
124
- "@bastani/atomic-codemode": "0.10.19",
125
- "@bastani/atomic-tui": "0.10.19",
126
- "@bastani/atomic-schema": "0.10.19",
127
- "@bastani/atomic-telemetry": "0.10.19",
121
+ "@bastani/atomic-natives": "0.10.20-alpha.2",
122
+ "@bastani/atomic-ai": "0.10.20-alpha.2",
123
+ "@bastani/atomic-agent-core": "0.10.20-alpha.2",
124
+ "@bastani/atomic-codemode": "0.10.20-alpha.2",
125
+ "@bastani/atomic-tui": "0.10.20-alpha.2",
126
+ "@bastani/atomic-schema": "0.10.20-alpha.2",
127
+ "@bastani/atomic-telemetry": "0.10.20-alpha.2",
128
128
  "@silvia-odwyer/photon-node": "0.3.4",
129
129
  "chalk": "6.0.0",
130
130
  "glob": "14.0.6",