@bastani/atomic 0.8.26-alpha.6 → 0.8.26-alpha.8

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 (260) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +5 -5
  3. package/dist/builtin/intercom/CHANGELOG.md +12 -0
  4. package/dist/builtin/intercom/package.json +2 -2
  5. package/dist/builtin/mcp/CHANGELOG.md +12 -0
  6. package/dist/builtin/mcp/package.json +3 -3
  7. package/dist/builtin/subagents/CHANGELOG.md +12 -0
  8. package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -9
  9. package/dist/builtin/subagents/agents/debugger.md +6 -6
  10. package/dist/builtin/subagents/package.json +4 -4
  11. package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +1 -1
  12. package/dist/builtin/subagents/skills/browser/EXAMPLES.md +151 -0
  13. package/dist/builtin/subagents/skills/browser/LICENSE.txt +21 -0
  14. package/dist/builtin/subagents/skills/browser/REFERENCE.md +451 -0
  15. package/dist/builtin/subagents/skills/browser/SKILL.md +170 -0
  16. package/dist/builtin/subagents/skills/subagent/SKILL.md +4 -4
  17. package/dist/builtin/web-access/CHANGELOG.md +12 -0
  18. package/dist/builtin/web-access/package.json +2 -2
  19. package/dist/builtin/workflows/CHANGELOG.md +17 -0
  20. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +4 -1
  21. package/dist/builtin/workflows/builtin/goal.ts +127 -99
  22. package/dist/builtin/workflows/builtin/open-claude-design.ts +224 -147
  23. package/dist/builtin/workflows/builtin/ralph.ts +160 -197
  24. package/dist/builtin/workflows/package.json +2 -2
  25. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +1 -1
  26. package/dist/builtin/workflows/src/extension/wiring.ts +13 -1
  27. package/dist/builtin/workflows/src/runs/foreground/executor.ts +12 -6
  28. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +2 -2
  29. package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +2 -2
  30. package/dist/builtin/workflows/src/shared/types.ts +3 -3
  31. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +2 -1
  32. package/dist/core/agent-session.d.ts +33 -6
  33. package/dist/core/agent-session.d.ts.map +1 -1
  34. package/dist/core/agent-session.js +155 -182
  35. package/dist/core/agent-session.js.map +1 -1
  36. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  37. package/dist/core/atomic-guide-command.js +1 -1
  38. package/dist/core/atomic-guide-command.js.map +1 -1
  39. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  40. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  41. package/dist/core/compaction/branch-summarization.js +6 -3
  42. package/dist/core/compaction/branch-summarization.js.map +1 -1
  43. package/dist/core/compaction/compaction.d.ts.map +1 -1
  44. package/dist/core/compaction/compaction.js +23 -10
  45. package/dist/core/compaction/compaction.js.map +1 -1
  46. package/dist/core/compaction/context-compaction.d.ts +61 -0
  47. package/dist/core/compaction/context-compaction.d.ts.map +1 -0
  48. package/dist/core/compaction/context-compaction.js +602 -0
  49. package/dist/core/compaction/context-compaction.js.map +1 -0
  50. package/dist/core/compaction/index.d.ts +1 -0
  51. package/dist/core/compaction/index.d.ts.map +1 -1
  52. package/dist/core/compaction/index.js +1 -0
  53. package/dist/core/compaction/index.js.map +1 -1
  54. package/dist/core/extensions/types.d.ts +3 -2
  55. package/dist/core/extensions/types.d.ts.map +1 -1
  56. package/dist/core/extensions/types.js.map +1 -1
  57. package/dist/core/index.d.ts +1 -1
  58. package/dist/core/index.d.ts.map +1 -1
  59. package/dist/core/index.js.map +1 -1
  60. package/dist/core/session-manager.d.ts +41 -1
  61. package/dist/core/session-manager.d.ts.map +1 -1
  62. package/dist/core/session-manager.js +146 -7
  63. package/dist/core/session-manager.js.map +1 -1
  64. package/dist/core/slash-commands.d.ts.map +1 -1
  65. package/dist/core/slash-commands.js +1 -1
  66. package/dist/core/slash-commands.js.map +1 -1
  67. package/dist/index.d.ts +3 -3
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +2 -2
  70. package/dist/index.js.map +1 -1
  71. package/dist/modes/index.d.ts +1 -1
  72. package/dist/modes/index.d.ts.map +1 -1
  73. package/dist/modes/index.js.map +1 -1
  74. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  75. package/dist/modes/interactive/components/chat-session-host.js +17 -0
  76. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  77. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts +17 -0
  78. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts.map +1 -0
  79. package/dist/modes/interactive/components/context-compaction-summary-message.js +83 -0
  80. package/dist/modes/interactive/components/context-compaction-summary-message.js.map +1 -0
  81. package/dist/modes/interactive/components/index.d.ts +1 -0
  82. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  83. package/dist/modes/interactive/components/index.js +1 -0
  84. package/dist/modes/interactive/components/index.js.map +1 -1
  85. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  86. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  87. package/dist/modes/interactive/interactive-mode.js +72 -8
  88. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  89. package/dist/modes/rpc/rpc-client.d.ts +13 -8
  90. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  91. package/dist/modes/rpc/rpc-client.js +8 -1
  92. package/dist/modes/rpc/rpc-client.js.map +1 -1
  93. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  94. package/dist/modes/rpc/rpc-mode.js +4 -0
  95. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  96. package/dist/modes/rpc/rpc-types.d.ts +14 -3
  97. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  98. package/dist/modes/rpc/rpc-types.js.map +1 -1
  99. package/docs/compaction.md +89 -37
  100. package/docs/custom-provider.md +11 -9
  101. package/docs/extensions.md +44 -40
  102. package/docs/index.md +2 -9
  103. package/docs/json.md +15 -12
  104. package/docs/packages.md +2 -0
  105. package/docs/providers.md +4 -1
  106. package/docs/quickstart.md +5 -12
  107. package/docs/rpc.md +38 -23
  108. package/docs/sdk.md +3 -10
  109. package/docs/session-format.md +26 -13
  110. package/docs/sessions.md +3 -3
  111. package/docs/settings.md +2 -2
  112. package/docs/skills.md +1 -15
  113. package/docs/termux.md +9 -10
  114. package/docs/themes.md +2 -2
  115. package/docs/tmux.md +3 -3
  116. package/docs/tui.md +19 -32
  117. package/docs/usage.md +2 -2
  118. package/docs/workflows.md +44 -2
  119. package/package.json +4 -12
  120. package/dist/builtin/subagents/skills/browser-use/SKILL.md +0 -234
  121. package/dist/builtin/subagents/skills/browser-use/references/cdp-python.md +0 -76
  122. package/dist/builtin/subagents/skills/browser-use/references/multi-session.md +0 -92
  123. package/node_modules/@earendil-works/pi-tui/README.md +0 -779
  124. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +0 -54
  125. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +0 -1
  126. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +0 -632
  127. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +0 -1
  128. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +0 -22
  129. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +0 -1
  130. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +0 -104
  131. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +0 -1
  132. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +0 -22
  133. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +0 -1
  134. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +0 -35
  135. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +0 -1
  136. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +0 -249
  137. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +0 -1
  138. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +0 -1857
  139. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +0 -1
  140. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +0 -28
  141. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +0 -1
  142. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +0 -89
  143. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +0 -1
  144. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +0 -37
  145. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +0 -1
  146. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +0 -378
  147. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +0 -1
  148. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +0 -31
  149. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +0 -1
  150. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +0 -69
  151. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +0 -1
  152. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +0 -96
  153. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +0 -1
  154. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +0 -644
  155. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +0 -1
  156. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +0 -50
  157. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +0 -1
  158. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +0 -159
  159. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +0 -1
  160. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +0 -50
  161. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +0 -1
  162. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +0 -185
  163. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +0 -1
  164. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +0 -12
  165. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +0 -1
  166. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +0 -23
  167. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +0 -1
  168. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +0 -19
  169. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +0 -1
  170. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +0 -89
  171. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +0 -1
  172. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +0 -13
  173. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +0 -1
  174. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +0 -51
  175. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +0 -1
  176. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +0 -39
  177. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +0 -1
  178. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +0 -2
  179. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +0 -1
  180. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +0 -16
  181. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +0 -1
  182. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +0 -110
  183. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +0 -1
  184. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +0 -23
  185. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +0 -1
  186. package/node_modules/@earendil-works/pi-tui/dist/index.js +0 -32
  187. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +0 -1
  188. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +0 -193
  189. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +0 -1
  190. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +0 -174
  191. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +0 -1
  192. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +0 -184
  193. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +0 -1
  194. package/node_modules/@earendil-works/pi-tui/dist/keys.js +0 -1173
  195. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +0 -1
  196. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +0 -28
  197. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +0 -1
  198. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +0 -44
  199. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +0 -1
  200. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +0 -3
  201. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +0 -1
  202. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +0 -53
  203. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +0 -1
  204. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +0 -50
  205. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +0 -1
  206. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +0 -361
  207. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +0 -1
  208. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +0 -90
  209. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +0 -1
  210. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +0 -366
  211. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +0 -1
  212. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +0 -113
  213. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +0 -1
  214. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +0 -472
  215. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +0 -1
  216. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +0 -227
  217. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +0 -1
  218. package/node_modules/@earendil-works/pi-tui/dist/tui.js +0 -1106
  219. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +0 -1
  220. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +0 -17
  221. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +0 -1
  222. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +0 -25
  223. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +0 -1
  224. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -84
  225. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +0 -1
  226. package/node_modules/@earendil-works/pi-tui/dist/utils.js +0 -1029
  227. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +0 -1
  228. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +0 -25
  229. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +0 -1
  230. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +0 -96
  231. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +0 -1
  232. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  233. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  234. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  235. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  236. package/node_modules/@earendil-works/pi-tui/package.json +0 -47
  237. package/node_modules/get-east-asian-width/index.d.ts +0 -60
  238. package/node_modules/get-east-asian-width/index.js +0 -30
  239. package/node_modules/get-east-asian-width/license +0 -9
  240. package/node_modules/get-east-asian-width/lookup-data.js +0 -21
  241. package/node_modules/get-east-asian-width/lookup.js +0 -138
  242. package/node_modules/get-east-asian-width/package.json +0 -71
  243. package/node_modules/get-east-asian-width/readme.md +0 -65
  244. package/node_modules/get-east-asian-width/utilities.js +0 -24
  245. package/node_modules/marked/LICENSE.md +0 -44
  246. package/node_modules/marked/README.md +0 -106
  247. package/node_modules/marked/bin/main.js +0 -282
  248. package/node_modules/marked/bin/marked.js +0 -15
  249. package/node_modules/marked/lib/marked.cjs +0 -2211
  250. package/node_modules/marked/lib/marked.cjs.map +0 -7
  251. package/node_modules/marked/lib/marked.d.cts +0 -728
  252. package/node_modules/marked/lib/marked.d.ts +0 -728
  253. package/node_modules/marked/lib/marked.esm.js +0 -2189
  254. package/node_modules/marked/lib/marked.esm.js.map +0 -7
  255. package/node_modules/marked/lib/marked.umd.js +0 -2213
  256. package/node_modules/marked/lib/marked.umd.js.map +0 -7
  257. package/node_modules/marked/man/marked.1 +0 -111
  258. package/node_modules/marked/man/marked.1.md +0 -92
  259. package/node_modules/marked/marked.min.js +0 -69
  260. package/node_modules/marked/package.json +0 -111
package/docs/packages.md CHANGED
@@ -178,6 +178,8 @@ Atomic bundles core packages for extensions and skills. If you import any of the
178
178
 
179
179
  Workflow packages should author workflow files with `import { defineWorkflow, Type } from "@bastani/workflows"` and export definitions produced by `defineWorkflow(...).compile()`. Do not use the removed `runWorkflow` object-form API, and do not hand-roll objects with `__piWorkflow: true`; discovery accepts only compiled definitions. `@bastani/workflows` is not a separate npm package: its types resolve through `@bastani/atomic`, so list `@bastani/atomic` and `typebox` in `peerDependencies` (the workflow SDK's emitted types reference `typebox`). A pure workflow-only package also adds the one-line ambient opt-in noted above; a package that imports `@bastani/atomic` elsewhere picks the types up automatically.
180
180
 
181
+ Package-authored workflows should follow the same guiding principles as project workflows mentioned in docs/workflows.md.
182
+
181
183
  Other Atomic packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Atomic loads packages with separate module roots, so separate installs do not collide or share modules.
182
184
 
183
185
  Example:
package/docs/providers.md CHANGED
@@ -57,6 +57,7 @@ atomic
57
57
  | OpenAI | `OPENAI_API_KEY` | `openai` |
58
58
  | DeepSeek | `DEEPSEEK_API_KEY` | `deepseek` |
59
59
  | Google Gemini | `GEMINI_API_KEY` | `google` |
60
+ | Google Vertex AI | `GOOGLE_CLOUD_API_KEY` | `google-vertex` |
60
61
  | Mistral | `MISTRAL_API_KEY` | `mistral` |
61
62
  | Groq | `GROQ_API_KEY` | `groq` |
62
63
  | Cerebras | `CEREBRAS_API_KEY` | `cerebras` |
@@ -74,12 +75,14 @@ atomic
74
75
  | Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
75
76
  | MiniMax | `MINIMAX_API_KEY` | `minimax` |
76
77
  | MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
78
+ | Moonshot AI | `MOONSHOT_API_KEY` | `moonshotai` |
79
+ | Moonshot AI (China) | `MOONSHOT_API_KEY` | `moonshotai-cn` |
77
80
  | Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
78
81
  | Xiaomi MiMo Token Plan (China) | `XIAOMI_TOKEN_PLAN_CN_API_KEY` | `xiaomi-token-plan-cn` |
79
82
  | Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` | `xiaomi-token-plan-ams` |
80
83
  | Xiaomi MiMo Token Plan (Singapore) | `XIAOMI_TOKEN_PLAN_SGP_API_KEY` | `xiaomi-token-plan-sgp` |
81
84
 
82
- Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/env-api-keys.ts).
85
+ Reference for environment variables and `auth.json` keys: `findEnvKeys()` / `getEnvApiKey()` in the installed `@earendil-works/pi-ai` dependency (`node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts`). The private provider map those functions use is in `node_modules/@earendil-works/pi-ai/dist/env-api-keys.js`; Atomic does not include a separate `packages/ai` source directory in this monorepo.
83
86
 
84
87
  #### Auth File
85
88
 
@@ -4,23 +4,16 @@ This page gets you from install to a useful first Atomic session.
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- - **Node.js 24 LTS or newer** — Atomic requires the latest Node LTS runtime. Check with `node --version`.
8
- - **A package manager** — use npm (included with Node), pnpm, Yarn, or Bun. Use Bun 1.3.14+ for Bun installs or workflow-authoring examples.
7
+ - **Node.js 20.6 or newer** — required when running Atomic from the published npm package. Check with `node --version`.
8
+ - **Bun 1.3.14 or newer** — use Bun for installation, Atomic repository development, validation commands, and workflow-authoring examples.
9
9
  - **Model-provider access** — Use `/login` after startup. Supports provider subscriptions and APIs.
10
10
 
11
11
  ## Install
12
12
 
13
- Atomic is distributed through npm-compatible package managers. Choose one:
13
+ Install the published package with Bun:
14
14
 
15
15
  ```bash
16
- # npm
17
- npm install -g @bastani/atomic
18
-
19
- # Bun
20
16
  bun install -g @bastani/atomic
21
-
22
- # pnpm
23
- pnpm add -g @bastani/atomic
24
17
  ```
25
18
 
26
19
  Atomic does not require package install scripts. If you want to disable dependency lifecycle scripts during the Atomic install, you can add `--ignore-scripts` to the install command.
@@ -174,7 +167,7 @@ Atomic loads context files at startup. Add an `AGENTS.md` file to tell it how to
174
167
  ```markdown
175
168
  # Project Instructions
176
169
 
177
- - Run `npm run check` after code changes.
170
+ - Run `bun run typecheck` after code changes.
178
171
  - Do not run production migrations locally.
179
172
  - Keep responses concise.
180
173
  ```
@@ -204,7 +197,7 @@ Images can be pasted with CTRL+V (ALT+V on Windows) or dragged into supported te
204
197
  In interactive mode:
205
198
 
206
199
  ```text
207
- !npm run lint
200
+ !bun run lint
208
201
  ```
209
202
 
210
203
  The command output is sent to the model. Use `!!command` to run a command without adding its output to the model context.
package/docs/rpc.md CHANGED
@@ -352,17 +352,12 @@ Response:
352
352
 
353
353
  #### compact
354
354
 
355
- Manually compact conversation context to reduce token usage.
355
+ Run Atomic's default Verbatim Compaction to reduce token usage. This command has no prompt/config fields; send no custom instructions. Atomic asks the selected model for deletion targets using a fixed internal prompt, validates them, appends a `context_compaction` entry, and rebuilds active context with surviving entries/content blocks reused verbatim. This deletion-only Context Compaction approach is informed by Morph's article: <https://www.morphllm.com/context-compaction>.
356
356
 
357
357
  ```json
358
358
  {"type": "compact"}
359
359
  ```
360
360
 
361
- With custom instructions:
362
- ```json
363
- {"type": "compact", "customInstructions": "Focus on code changes"}
364
- ```
365
-
366
361
  Response:
367
362
  ```json
368
363
  {
@@ -370,10 +365,18 @@ Response:
370
365
  "command": "compact",
371
366
  "success": true,
372
367
  "data": {
373
- "summary": "Summary of conversation...",
374
- "firstKeptEntryId": "abc123",
375
- "tokensBefore": 150000,
376
- "details": {}
368
+ "promptVersion": 1,
369
+ "deletedTargets": [{ "kind": "entry", "entryId": "abc123" }],
370
+ "protectedEntryIds": ["user-task-entry"],
371
+ "stats": {
372
+ "objectsBefore": 20,
373
+ "objectsAfter": 19,
374
+ "objectsDeleted": 1,
375
+ "tokensBefore": 150000,
376
+ "tokensAfter": 120000,
377
+ "percentReduction": 20
378
+ },
379
+ "backupPath": "/path/to/session.jsonl.2026-06-06T00-00-00-000Z.compact.bak"
377
380
  }
378
381
  }
379
382
  ```
@@ -455,7 +458,7 @@ If output was truncated, includes `fullOutputPath`:
455
458
  "exitCode": 0,
456
459
  "cancelled": false,
457
460
  "truncated": true,
458
- "fullOutputPath": "/tmp/pi-bash-abc123.log"
461
+ "fullOutputPath": "/tmp/atomic-bash-abc123.log"
459
462
  }
460
463
  }
461
464
  ```
@@ -756,8 +759,10 @@ Events are streamed to stdout as JSON lines during agent operation. Events do NO
756
759
  | `tool_execution_update` | Tool execution progress (streaming output) |
757
760
  | `tool_execution_end` | Tool completes |
758
761
  | `queue_update` | Pending steering/follow-up queue changed |
759
- | `compaction_start` | Compaction begins |
760
- | `compaction_end` | Compaction completes |
762
+ | `compaction_start` | Default Verbatim Compaction begins |
763
+ | `compaction_end` | Default Verbatim Compaction completes |
764
+ | `context_compaction_start` | Legacy context-compaction RPC begins |
765
+ | `context_compaction_end` | Legacy context-compaction RPC completes |
761
766
  | `auto_retry_start` | Auto-retry begins (after transient error) |
762
767
  | `auto_retry_end` | Auto-retry completes (success or final failure) |
763
768
  | `extension_error` | Extension threw an error |
@@ -907,7 +912,7 @@ Emitted whenever the pending steering or follow-up queue changes.
907
912
 
908
913
  ### compaction_start / compaction_end
909
914
 
910
- Emitted when compaction runs, whether manual or automatic.
915
+ Emitted when default Verbatim Compaction runs, whether manual or automatic. The result records deletion targets and stats rather than a generated summary.
911
916
 
912
917
  ```json
913
918
  {"type": "compaction_start", "reason": "threshold"}
@@ -920,10 +925,17 @@ The `reason` field is `"manual"`, `"threshold"`, or `"overflow"`.
920
925
  "type": "compaction_end",
921
926
  "reason": "threshold",
922
927
  "result": {
923
- "summary": "Summary of conversation...",
924
- "firstKeptEntryId": "abc123",
925
- "tokensBefore": 150000,
926
- "details": {}
928
+ "promptVersion": 1,
929
+ "deletedTargets": [{ "kind": "entry", "entryId": "abc123" }],
930
+ "protectedEntryIds": ["user-task-entry"],
931
+ "stats": {
932
+ "objectsBefore": 20,
933
+ "objectsAfter": 19,
934
+ "objectsDeleted": 1,
935
+ "tokensBefore": 150000,
936
+ "tokensAfter": 120000,
937
+ "percentReduction": 20
938
+ }
927
939
  },
928
940
  "aborted": false,
929
941
  "willRetry": false
@@ -936,6 +948,10 @@ If compaction was aborted, `result` is `null` and `aborted` is `true`.
936
948
 
937
949
  If compaction failed (e.g., API quota exceeded), `result` is `null`, `aborted` is `false`, and `errorMessage` contains the error description.
938
950
 
951
+ ### context_compaction_start / context_compaction_end
952
+
953
+ Legacy RPC `context_compact` emits these events. The result contains `deletedTargets`, `protectedEntryIds`, `stats`, `promptVersion`, and optional `backupPath`.
954
+
939
955
  ### auto_retry_start / auto_retry_end
940
956
 
941
957
  Emitted when automatic retry is triggered after a transient error (overloaded, rate limit, 5xx).
@@ -1199,9 +1215,9 @@ Parse errors:
1199
1215
 
1200
1216
  ## Types
1201
1217
 
1202
- Source files:
1203
- - [`packages/ai/src/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/types.ts) - `Model`, `UserMessage`, `AssistantMessage`, `ToolResultMessage`
1204
- - [`packages/agent/src/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/agent/src/types.ts) - `AgentMessage`, `AgentEvent`
1218
+ Source files and installed definitions:
1219
+ - `node_modules/@earendil-works/pi-ai/dist/types.d.ts` - `Model`, `UserMessage`, `AssistantMessage`, `ToolResultMessage`
1220
+ - `node_modules/@earendil-works/pi-agent-core/dist/types.d.ts` - `AgentMessage`, `AgentEvent`
1205
1221
  - [`src/core/messages.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/messages.ts) - `BashExecutionMessage`
1206
1222
  - [`src/modes/rpc/rpc-types.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/modes/rpc/rpc-types.ts) - RPC command/response types, extension UI request/response types
1207
1223
 
@@ -1233,8 +1249,7 @@ Source files:
1233
1249
  {
1234
1250
  "role": "user",
1235
1251
  "content": "Hello!",
1236
- "timestamp": 1733234567890,
1237
- "attachments": []
1252
+ "timestamp": 1733234567890
1238
1253
  }
1239
1254
  ```
1240
1255
 
package/docs/sdk.md CHANGED
@@ -39,17 +39,10 @@ await session.prompt("What files are in the current directory?");
39
39
 
40
40
  ## Installation
41
41
 
42
- Choose npm, Bun, or pnpm:
42
+ Install the SDK package with Bun:
43
43
 
44
44
  ```bash
45
- # npm
46
- npm install @bastani/atomic
47
-
48
- # Bun
49
45
  bun add @bastani/atomic
50
-
51
- # pnpm
52
- pnpm add @bastani/atomic
53
46
  ```
54
47
 
55
48
  Atomic does not require package install scripts. If you want to disable dependency lifecycle scripts during the Atomic install, you can add `--ignore-scripts` to the install command.
@@ -116,8 +109,8 @@ interface AgentSession {
116
109
  // In-place tree navigation within the current session file
117
110
  navigateTree(targetId: string, options?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string }): Promise<{ editorText?: string; cancelled: boolean }>;
118
111
 
119
- // Compaction
120
- compact(customInstructions?: string): Promise<CompactionResult>;
112
+ // Verbatim Compaction (deletion-only Context Compaction)
113
+ compact(): Promise<ContextCompactionResult>;
121
114
  abortCompaction(): void;
122
115
 
123
116
  // Abort current operation
@@ -28,13 +28,11 @@ Existing sessions are automatically migrated to the current version (v3) when lo
28
28
 
29
29
  ## Source Files
30
30
 
31
- Source on GitHub ([pi-mono](https://github.com/earendil-works/pi-mono)):
32
- - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
33
- - [`packages/coding-agent/src/core/messages.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
34
- - [`packages/ai/src/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/types.ts) - Base message types (UserMessage, AssistantMessage, ToolResultMessage)
35
- - [`packages/agent/src/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/agent/src/types.ts) - AgentMessage union type
31
+ Source on GitHub ([atomic](https://github.com/bastani-inc/atomic)):
32
+ - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/session-manager.ts) - Session entry types and SessionManager
33
+ - [`packages/coding-agent/src/core/messages.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/messages.ts) - Extended message types (BashExecutionMessage, CustomMessage, etc.)
36
34
 
37
- For TypeScript definitions in your project, inspect `node_modules/@bastani/atomic/dist/` and `node_modules/@earendil-works/pi-ai/dist/`.
35
+ Base message and agent event types are provided by Atomic's installed runtime dependencies (`@earendil-works/pi-ai` and `@earendil-works/pi-agent-core`), not by separate `packages/ai` or `packages/agent` directories in this monorepo. For TypeScript definitions in your project, inspect `node_modules/@bastani/atomic/dist/`, `node_modules/@earendil-works/pi-ai/dist/`, and `node_modules/@earendil-works/pi-agent-core/dist/`.
38
36
 
39
37
  ## Message Types
40
38
 
@@ -69,7 +67,7 @@ interface ToolCall {
69
67
  }
70
68
  ```
71
69
 
72
- ### Base Message Types (from pi-ai)
70
+ ### Base Message Types (from `@earendil-works/pi-ai`)
73
71
 
74
72
  ```typescript
75
73
  interface UserMessage {
@@ -116,7 +114,7 @@ interface Usage {
116
114
  }
117
115
  ```
118
116
 
119
- ### Extended Message Types (from pi-coding-agent)
117
+ ### Extended Message Types (from Atomic coding-agent)
120
118
 
121
119
  ```typescript
122
120
  interface BashExecutionMessage {
@@ -225,7 +223,7 @@ Emitted when the user changes the thinking/reasoning level.
225
223
 
226
224
  ### CompactionEntry
227
225
 
228
- Created when context is compacted. Stores a summary of earlier messages.
226
+ Legacy summary-compaction entry. Stores a generated summary of earlier messages for older APIs and extension hooks. Default `/compact` and auto-compaction now create `ContextCompactionEntry` records instead.
229
227
 
230
228
  ```json
231
229
  {"type":"compaction","id":"f6g7h8i9","parentId":"e5f6g7h8","timestamp":"2024-12-03T14:10:00.000Z","summary":"User discussed X, Y, Z...","firstKeptEntryId":"c3d4e5f6","tokensBefore":50000}
@@ -233,7 +231,17 @@ Created when context is compacted. Stores a summary of earlier messages.
233
231
 
234
232
  Optional fields:
235
233
  - `details`: Implementation-specific data (e.g., `{ readFiles: string[], modifiedFiles: string[] }` for default, or custom data for extensions)
236
- - `fromHook`: `true` if generated by an extension, `false`/`undefined` if pi-generated (legacy field name)
234
+ - `fromHook`: `true` if generated by an extension, `false`/`undefined` if Atomic-generated (legacy field name)
235
+
236
+ ### ContextCompactionEntry
237
+
238
+ Created by `/compact` and auto-compaction. Stores Atomic's default **Verbatim Compaction** data: validated logical deletion targets, not replacement text. During `buildSessionContext()`, matching entries/content blocks are filtered from active LLM context while retained content remains verbatim. This deletion-only Context Compaction approach is informed by Morph's write-up at <https://www.morphllm.com/context-compaction>.
239
+
240
+ ```json
241
+ {"type":"context_compaction","id":"ctx12345","parentId":"f6g7h8i9","timestamp":"2024-12-03T14:12:00.000Z","promptVersion":1,"deletedTargets":[{"kind":"entry","entryId":"b2c3d4e5"}],"protectedEntryIds":["a1b2c3d4"],"stats":{"objectsBefore":20,"objectsAfter":19,"objectsDeleted":1,"tokensBefore":50000,"tokensAfter":43000,"percentReduction":14},"backupPath":"/path/session.jsonl.2024-12-03T14-12-00-000Z.compact.bak"}
242
+ ```
243
+
244
+ `deletedTargets` entries are either whole entries (`{ kind: "entry", entryId }`) or content blocks (`{ kind: "content_block", entryId, blockIndex }`). The JSONL file remains append-only; this is logical deletion for active context rebuild.
237
245
 
238
246
  ### BranchSummaryEntry
239
247
 
@@ -245,7 +253,7 @@ Created when switching branches via `/tree` with an LLM generated summary of the
245
253
 
246
254
  Optional fields:
247
255
  - `details`: File tracking data (`{ readFiles: string[], modifiedFiles: string[] }`) for default, or custom data for extensions
248
- - `fromHook`: `true` if generated by an extension, `false`/`undefined` if pi-generated (legacy field name)
256
+ - `fromHook`: `true` if generated by an extension, `false`/`undefined` if Atomic-generated (legacy field name)
249
257
 
250
258
  ### CustomEntry
251
259
 
@@ -314,7 +322,8 @@ Entries form a tree:
314
322
  - Emits the summary first
315
323
  - Then messages from `firstKeptEntryId` to compaction
316
324
  - Then messages after compaction
317
- 4. Converts `BranchSummaryEntry` and `CustomMessageEntry` to appropriate message formats
325
+ 4. Applies `ContextCompactionEntry` logical deletions recorded after the latest summary compaction
326
+ 5. Converts `BranchSummaryEntry` and `CustomMessageEntry` to appropriate message formats
318
327
 
319
328
  ## Parsing Example
320
329
 
@@ -336,6 +345,9 @@ for (const line of lines) {
336
345
  case "compaction":
337
346
  console.log(`[${entry.id}] Compaction: ${entry.tokensBefore} tokens summarized`);
338
347
  break;
348
+ case "context_compaction":
349
+ console.log(`[${entry.id}] Context compaction: ${entry.stats.objectsDeleted} objects deleted`);
350
+ break;
339
351
  case "branch_summary":
340
352
  console.log(`[${entry.id}] Branch from ${entry.fromId}`);
341
353
  break;
@@ -382,7 +394,8 @@ Key methods for working with sessions programmatically.
382
394
  - `appendMessage(message)` - Add message
383
395
  - `appendThinkingLevelChange(level)` - Record thinking change
384
396
  - `appendModelChange(provider, modelId)` - Record model change
385
- - `appendCompaction(summary, firstKeptEntryId, tokensBefore, details?, fromHook?)` - Add compaction
397
+ - `appendCompaction(summary, firstKeptEntryId, tokensBefore, details?, fromHook?)` - Add summary compaction
398
+ - `appendContextCompaction(deletedTargets, protectedEntryIds, stats, backupPath?)` - Add logical deletion compaction
386
399
  - `appendCustomEntry(customType, data?)` - Extension state (not in context)
387
400
  - `appendSessionInfo(name)` - Set session display name
388
401
  - `appendCustomMessageEntry(customType, content, display, details?)` - Extension message (in context)
package/docs/sessions.md CHANGED
@@ -29,7 +29,7 @@ For the JSONL file format and SessionManager API, see [Session Format](/session-
29
29
  | `/tree` | Navigate the current session tree |
30
30
  | `/fork` | Create a new session from a previous user message |
31
31
  | `/clone` | Duplicate the current active branch into a new session |
32
- | `/compact [prompt]` | Summarize older context; see [Compaction](/compaction) |
32
+ | `/compact` | Apply Verbatim Compaction with validated logical deletions; see [Compaction](/compaction) |
33
33
  | `/export [file]` | Export session to HTML |
34
34
  | `/share` | Upload as private GitHub gist with shareable HTML link |
35
35
 
@@ -128,10 +128,10 @@ When prompted, choose one of:
128
128
  2. summarize with the default prompt
129
129
  3. summarize with custom focus instructions
130
130
 
131
- See [Compaction](/compaction) for branch summarization internals and extension hooks.
131
+ See [Compaction](/compaction) for Verbatim Compaction, branch summarization internals, and extension hooks.
132
132
 
133
133
  ## Session Format
134
134
 
135
- Session files are JSONL and contain message entries, model changes, thinking-level changes, labels, compactions, branch summaries, and extension entries.
135
+ Session files are JSONL and contain message entries, model changes, thinking-level changes, labels, summary compactions, context compactions, branch summaries, and extension entries.
136
136
 
137
137
  For parsers, extensions, SDK usage, and the full SessionManager API, see [Session Format](/session-format).
package/docs/settings.md CHANGED
@@ -90,9 +90,9 @@ Set `ATOMIC_SKIP_VERSION_CHECK=1` to disable the Atomic version update check. Us
90
90
 
91
91
  | Setting | Type | Default | Description |
92
92
  |---------|------|---------|-------------|
93
- | `compaction.enabled` | boolean | `true` | Enable auto-compaction |
93
+ | `compaction.enabled` | boolean | `true` | Enable automatic Verbatim Compaction |
94
94
  | `compaction.reserveTokens` | number | `16384` | Tokens reserved for LLM response |
95
- | `compaction.keepRecentTokens` | number | `20000` | Recent tokens to keep (not summarized) |
95
+ | `compaction.keepRecentTokens` | number | `20000` | Recent tokens to protect from deletion |
96
96
 
97
97
  ```json
98
98
  {
package/docs/skills.md CHANGED
@@ -116,16 +116,9 @@ description: What this skill does and when to use it. Be specific.
116
116
 
117
117
  ## Setup
118
118
 
119
- Run once before first use (choose one):
119
+ Run once before first use:
120
120
  ```bash
121
- # npm
122
- cd /path/to/skill && npm install
123
-
124
- # Bun
125
121
  cd /path/to/skill && bun install
126
-
127
- # pnpm
128
- cd /path/to/skill && pnpm install
129
122
  ```
130
123
 
131
124
  ## Usage
@@ -216,14 +209,7 @@ description: Web search and content extraction via Brave Search API. Use for sea
216
209
  ## Setup
217
210
 
218
211
  ```bash
219
- # npm
220
- cd /path/to/brave-search && npm install
221
-
222
- # Bun
223
212
  cd /path/to/brave-search && bun install
224
-
225
- # pnpm
226
- cd /path/to/brave-search && pnpm install
227
213
  ```
228
214
 
229
215
  ## Search
package/docs/termux.md CHANGED
@@ -16,16 +16,11 @@ pkg update && pkg upgrade
16
16
  # Install dependencies
17
17
  pkg install nodejs termux-api git
18
18
 
19
- # Install Atomic (choose one package manager available in Termux)
20
- # npm is installed by `pkg install nodejs`; Bun and pnpm must be installed separately before using those commands.
21
- # npm
19
+ # Install Atomic with npm (included with Termux's nodejs package)
22
20
  npm install -g @bastani/atomic
23
21
 
24
- # Bun
25
- bun install -g @bastani/atomic
26
-
27
- # pnpm
28
- pnpm add -g @bastani/atomic
22
+ # If you have installed Bun separately in Termux, you can use Bun instead:
23
+ # bun install -g @bastani/atomic
29
24
 
30
25
  # Create config directory
31
26
  mkdir -p ~/.atomic/agent
@@ -129,9 +124,13 @@ Run once to grant storage permissions:
129
124
  termux-setup-storage
130
125
  ```
131
126
 
132
- ### Node.js installation issues
127
+ ### Package installation issues
128
+
129
+ Termux does not currently provide an official `pkg install bun` package. On a fresh Termux install, use npm from the `nodejs` package; use Bun only if you installed it separately for your device.
130
+
131
+ If npm fails, try clearing the cache before retrying:
133
132
 
134
- If npm fails, try clearing the cache:
135
133
  ```bash
136
134
  npm cache clean --force
135
+ npm install -g @bastani/atomic
137
136
  ```
package/docs/themes.md CHANGED
@@ -52,7 +52,7 @@ vim ~/.atomic/agent/themes/my-theme.json
52
52
 
53
53
  ```json
54
54
  {
55
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
55
+ "$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
56
56
  "name": "my-theme",
57
57
  "vars": {
58
58
  "primary": "#00aaff",
@@ -122,7 +122,7 @@ vim ~/.atomic/agent/themes/my-theme.json
122
122
 
123
123
  ```json
124
124
  {
125
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
125
+ "$schema": "https://raw.githubusercontent.com/bastani-inc/atomic/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
126
126
  "name": "my-theme",
127
127
  "vars": {
128
128
  "blue": "#0066cc",
package/docs/tmux.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # tmux Setup
2
2
 
3
- Pi works inside tmux, but tmux strips modifier information from certain keys by default. Without configuration, `SHIFT+Enter` and `CTRL+Enter` are usually indistinguishable from plain `Enter`.
3
+ Atomic works inside tmux, but tmux strips modifier information from certain keys by default. Without configuration, `SHIFT+Enter` and `CTRL+Enter` are usually indistinguishable from plain `Enter`.
4
4
 
5
5
  ## Recommended Configuration
6
6
 
@@ -18,7 +18,7 @@ tmux kill-server
18
18
  tmux
19
19
  ```
20
20
 
21
- Pi requests extended key reporting automatically when Kitty keyboard protocol is not available. With `extended-keys-format csi-u`, tmux forwards modified keys in CSI-u format, which is the most reliable configuration.
21
+ Atomic requests extended key reporting automatically when Kitty keyboard protocol is not available. With `extended-keys-format csi-u`, tmux forwards modified keys in CSI-u format, which is the most reliable configuration.
22
22
 
23
23
  ## Why `csi-u` Is Recommended
24
24
 
@@ -40,7 +40,7 @@ With `extended-keys-format csi-u`, the same keys are forwarded as:
40
40
  - `CTRL+D` → `\x1b[100;5u`
41
41
  - `CTRL+Enter` → `\x1b[13;5u`
42
42
 
43
- Pi supports both formats, but `csi-u` is the recommended tmux setup.
43
+ Atomic supports both formats, but `csi-u` is the recommended tmux setup.
44
44
 
45
45
  ## What This Fixes
46
46
 
package/docs/tui.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Extensions and custom tools can render custom TUI components for interactive user interfaces. This page covers the component system and available building blocks.
6
6
 
7
- **Source:** [`@earendil-works/pi-tui`](https://github.com/earendil-works/pi-mono/tree/main/packages/tui)
7
+ **Source:** TUI components are provided by Atomic's installed `@earendil-works/pi-tui` runtime dependency (`node_modules/@earendil-works/pi-tui/dist/`).
8
8
 
9
9
  ## Component Interface
10
10
 
@@ -86,27 +86,18 @@ Without this propagation, typing with an IME (Chinese, Japanese, Korean, etc.) w
86
86
 
87
87
  ## Using Components
88
88
 
89
- **In extensions** via `ctx.ui.custom()`:
89
+ 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:
90
90
 
91
91
  ```typescript
92
92
  pi.on("session_start", async (_event, ctx) => {
93
- const handle = ctx.ui.custom(myComponent);
94
- // handle.requestRender() - trigger re-render
95
- // handle.close() - restore normal UI
93
+ const result = await ctx.ui.custom((tui, theme, keybindings, done) => {
94
+ return new MyComponent(done);
95
+ });
96
+ ctx.ui.notify(`Selected: ${result}`, "info");
96
97
  });
97
98
  ```
98
99
 
99
- **In custom tools** via `pi.ui.custom()`:
100
-
101
- ```typescript
102
- async execute(toolCallId, params, onUpdate, ctx, signal) {
103
- const handle = pi.ui.custom(myComponent);
104
- // ...
105
- handle.close();
106
- }
107
- ```
108
-
109
- Pass `{ signal }` to `ctx.ui.custom()` when the UI belongs to an abortable tool or operation. If the signal aborts, Atomic dismisses the custom UI and rejects the returned promise with the signal reason.
100
+ Pass `{ signal }` to `ctx.ui.custom()` when the UI belongs to an abortable operation. If the signal aborts, Atomic dismisses the custom UI and rejects the returned promise with the signal reason. For overlays, use `options.onHandle` to receive an overlay handle for programmatic visibility control.
110
101
 
111
102
  ## Overlays
112
103
 
@@ -371,20 +362,15 @@ pi.registerCommand("pick", {
371
362
  const items = ["Option A", "Option B", "Option C"];
372
363
  const selector = new MySelector(items);
373
364
 
374
- let handle: { close: () => void; requestRender: () => void };
375
-
376
- await new Promise<void>((resolve) => {
377
- selector.onSelect = (item) => {
378
- ctx.ui.notify(`Selected: ${item}`, "info");
379
- handle.close();
380
- resolve();
381
- };
382
- selector.onCancel = () => {
383
- handle.close();
384
- resolve();
385
- };
386
- handle = ctx.ui.custom(selector);
365
+ const selected = await ctx.ui.custom<string | undefined>((_tui, _theme, _keybindings, done) => {
366
+ selector.onSelect = (item) => done(item);
367
+ selector.onCancel = () => done(undefined);
368
+ return selector;
387
369
  });
370
+
371
+ if (selected) {
372
+ ctx.ui.notify(`Selected: ${selected}`, "info");
373
+ }
388
374
  }
389
375
  });
390
376
  ```
@@ -450,10 +436,11 @@ interface MyTheme {
450
436
  Set `PI_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
451
437
 
452
438
  ```bash
453
- # Upstream pi-tui debug env example
454
- PI_TUI_WRITE_LOG=/tmp/tui-ansi.log bunx tsx packages/tui/test/chat-simple.ts
439
+ PI_TUI_WRITE_LOG=/tmp/tui-ansi.log atomic
455
440
  ```
456
441
 
442
+ Atomic vendors TUI components through the installed `@earendil-works/pi-tui` dependency; this monorepo does not include the upstream TUI test source tree.
443
+
457
444
  ## Performance
458
445
 
459
446
  Cache rendered output when possible:
@@ -480,7 +467,7 @@ class CachedComponent {
480
467
  }
481
468
  ```
482
469
 
483
- Call `invalidate()` when state changes, then `handle.requestRender()` to trigger re-render.
470
+ Call `invalidate()` when state changes, then `ctx.ui.requestRender()` from the extension context or `tui.requestRender()` from a `ctx.ui.custom()` factory to trigger re-render.
484
471
 
485
472
  ## Invalidation and Theme Changes
486
473
 
package/docs/usage.md CHANGED
@@ -48,7 +48,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
48
48
  | `/tree` | Jump to any point in the session and continue from there |
49
49
  | `/fork` | Create a new session from a previous user message |
50
50
  | `/clone` | Duplicate the current active branch into a new session |
51
- | `/compact [prompt]` | Manually compact context, optionally with custom instructions |
51
+ | `/compact` | Run Verbatim Compaction by deleting safe older transcript objects |
52
52
  | `/copy` | Copy last assistant message to clipboard |
53
53
  | `/export [file]` | Export session to HTML |
54
54
  | `/share` | Upload as private GitHub gist with shareable HTML link |
@@ -89,7 +89,7 @@ Useful session commands:
89
89
  - `/tree` navigates the in-file session tree and can summarize abandoned branches.
90
90
  - `/fork` creates a new session from an earlier user message.
91
91
  - `/clone` duplicates the current active branch into a new session file.
92
- - `/compact` summarizes older messages to free context.
92
+ - `/compact` uses Verbatim Compaction: a fixed no-argument deletion-only planner applies only validated logical deletions; retained transcript content stays verbatim. Atomic's approach is informed by Morph's Context Compaction article: <https://www.morphllm.com/context-compaction>.
93
93
 
94
94
  See [Sessions](/sessions) and [Compaction](/compaction) for details.
95
95