@bastani/atomic 0.8.26-alpha.1 → 0.8.26-alpha.11

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 (308) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +5 -5
  3. package/dist/builtin/intercom/CHANGELOG.md +60 -0
  4. package/dist/builtin/intercom/package.json +2 -2
  5. package/dist/builtin/mcp/CHANGELOG.md +60 -0
  6. package/dist/builtin/mcp/package.json +3 -3
  7. package/dist/builtin/subagents/CHANGELOG.md +61 -0
  8. package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
  9. package/dist/builtin/subagents/agents/codebase-locator.md +1 -1
  10. package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -9
  11. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +1 -1
  12. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
  13. package/dist/builtin/subagents/agents/codebase-research-locator.md +1 -1
  14. package/dist/builtin/subagents/agents/debugger.md +6 -6
  15. package/dist/builtin/subagents/package.json +4 -4
  16. package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +1 -1
  17. package/dist/builtin/subagents/skills/browser/EXAMPLES.md +151 -0
  18. package/dist/builtin/subagents/skills/browser/LICENSE.txt +21 -0
  19. package/dist/builtin/subagents/skills/browser/REFERENCE.md +451 -0
  20. package/dist/builtin/subagents/skills/browser/SKILL.md +170 -0
  21. package/dist/builtin/subagents/skills/subagent/SKILL.md +4 -4
  22. package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +55 -12
  23. package/dist/builtin/subagents/src/runs/foreground/execution.ts +71 -12
  24. package/dist/builtin/subagents/src/runs/shared/acceptance.ts +2 -1
  25. package/dist/builtin/subagents/src/runs/shared/final-drain.ts +34 -0
  26. package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +416 -7
  27. package/dist/builtin/subagents/src/runs/shared/worktree.ts +2 -2
  28. package/dist/builtin/web-access/CHANGELOG.md +60 -0
  29. package/dist/builtin/web-access/package.json +2 -2
  30. package/dist/builtin/workflows/CHANGELOG.md +72 -0
  31. package/dist/builtin/workflows/README.md +10 -8
  32. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +11 -8
  33. package/dist/builtin/workflows/builtin/goal.ts +137 -109
  34. package/dist/builtin/workflows/builtin/index.d.ts +2 -0
  35. package/dist/builtin/workflows/builtin/open-claude-design.ts +228 -151
  36. package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
  37. package/dist/builtin/workflows/builtin/ralph.ts +452 -279
  38. package/dist/builtin/workflows/package.json +2 -2
  39. package/dist/builtin/workflows/skills/create-spec/SKILL.md +14 -0
  40. package/dist/builtin/workflows/skills/research-codebase/SKILL.md +29 -10
  41. package/dist/builtin/workflows/src/extension/index.ts +10 -2
  42. package/dist/builtin/workflows/src/extension/runtime.ts +35 -3
  43. package/dist/builtin/workflows/src/extension/wiring.ts +13 -1
  44. package/dist/builtin/workflows/src/runs/background/status.ts +52 -6
  45. package/dist/builtin/workflows/src/runs/foreground/executor.ts +453 -21
  46. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +77 -11
  47. package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +402 -8
  48. package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -2
  49. package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +2 -2
  50. package/dist/builtin/workflows/src/shared/persistence-restore.ts +182 -6
  51. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +76 -6
  52. package/dist/builtin/workflows/src/shared/stage-prompt.ts +33 -2
  53. package/dist/builtin/workflows/src/shared/store-types.ts +31 -0
  54. package/dist/builtin/workflows/src/shared/store.ts +160 -18
  55. package/dist/builtin/workflows/src/shared/types.ts +3 -3
  56. package/dist/builtin/workflows/src/shared/workflow-failures.ts +758 -132
  57. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +39 -3
  58. package/dist/builtin/workflows/src/tui/store-widget-installer.ts +74 -74
  59. package/dist/core/agent-session.d.ts +33 -6
  60. package/dist/core/agent-session.d.ts.map +1 -1
  61. package/dist/core/agent-session.js +157 -182
  62. package/dist/core/agent-session.js.map +1 -1
  63. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  64. package/dist/core/atomic-guide-command.js +11 -9
  65. package/dist/core/atomic-guide-command.js.map +1 -1
  66. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  67. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  68. package/dist/core/compaction/branch-summarization.js +6 -3
  69. package/dist/core/compaction/branch-summarization.js.map +1 -1
  70. package/dist/core/compaction/compaction.d.ts.map +1 -1
  71. package/dist/core/compaction/compaction.js +23 -10
  72. package/dist/core/compaction/compaction.js.map +1 -1
  73. package/dist/core/compaction/context-compaction.d.ts +175 -0
  74. package/dist/core/compaction/context-compaction.d.ts.map +1 -0
  75. package/dist/core/compaction/context-compaction.js +1636 -0
  76. package/dist/core/compaction/context-compaction.js.map +1 -0
  77. package/dist/core/compaction/index.d.ts +1 -0
  78. package/dist/core/compaction/index.d.ts.map +1 -1
  79. package/dist/core/compaction/index.js +1 -0
  80. package/dist/core/compaction/index.js.map +1 -1
  81. package/dist/core/extensions/types.d.ts +3 -2
  82. package/dist/core/extensions/types.d.ts.map +1 -1
  83. package/dist/core/extensions/types.js.map +1 -1
  84. package/dist/core/footer-data-provider.d.ts.map +1 -1
  85. package/dist/core/footer-data-provider.js +3 -0
  86. package/dist/core/footer-data-provider.js.map +1 -1
  87. package/dist/core/index.d.ts +1 -1
  88. package/dist/core/index.d.ts.map +1 -1
  89. package/dist/core/index.js.map +1 -1
  90. package/dist/core/package-manager.d.ts.map +1 -1
  91. package/dist/core/package-manager.js +14 -7
  92. package/dist/core/package-manager.js.map +1 -1
  93. package/dist/core/session-manager.d.ts +41 -1
  94. package/dist/core/session-manager.d.ts.map +1 -1
  95. package/dist/core/session-manager.js +146 -7
  96. package/dist/core/session-manager.js.map +1 -1
  97. package/dist/core/slash-commands.d.ts.map +1 -1
  98. package/dist/core/slash-commands.js +1 -1
  99. package/dist/core/slash-commands.js.map +1 -1
  100. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +5 -5
  101. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
  102. package/dist/core/tools/ask-user-question/tool/format-answer.js +5 -5
  103. package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
  104. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +16 -3
  105. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
  106. package/dist/core/tools/ask-user-question/tool/response-envelope.js +21 -3
  107. package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
  108. package/dist/index.d.ts +4 -3
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +3 -2
  111. package/dist/index.js.map +1 -1
  112. package/dist/modes/index.d.ts +1 -1
  113. package/dist/modes/index.d.ts.map +1 -1
  114. package/dist/modes/index.js.map +1 -1
  115. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  116. package/dist/modes/interactive/components/chat-session-host.js +17 -0
  117. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  118. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts +17 -0
  119. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts.map +1 -0
  120. package/dist/modes/interactive/components/context-compaction-summary-message.js +83 -0
  121. package/dist/modes/interactive/components/context-compaction-summary-message.js.map +1 -0
  122. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  123. package/dist/modes/interactive/components/footer.js +4 -1
  124. package/dist/modes/interactive/components/footer.js.map +1 -1
  125. package/dist/modes/interactive/components/index.d.ts +1 -0
  126. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  127. package/dist/modes/interactive/components/index.js +1 -0
  128. package/dist/modes/interactive/components/index.js.map +1 -1
  129. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  130. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  131. package/dist/modes/interactive/interactive-mode.js +75 -10
  132. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  133. package/dist/modes/rpc/rpc-client.d.ts +13 -8
  134. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  135. package/dist/modes/rpc/rpc-client.js +8 -1
  136. package/dist/modes/rpc/rpc-client.js.map +1 -1
  137. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  138. package/dist/modes/rpc/rpc-mode.js +4 -0
  139. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  140. package/dist/modes/rpc/rpc-types.d.ts +14 -3
  141. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  142. package/dist/modes/rpc/rpc-types.js.map +1 -1
  143. package/dist/utils/git-env.d.ts +10 -0
  144. package/dist/utils/git-env.d.ts.map +1 -0
  145. package/dist/utils/git-env.js +33 -0
  146. package/dist/utils/git-env.js.map +1 -0
  147. package/docs/compaction.md +185 -50
  148. package/docs/custom-provider.md +11 -9
  149. package/docs/extensions.md +46 -42
  150. package/docs/index.md +13 -6
  151. package/docs/json.md +15 -12
  152. package/docs/packages.md +2 -0
  153. package/docs/providers.md +4 -1
  154. package/docs/quickstart.md +18 -11
  155. package/docs/rpc.md +38 -23
  156. package/docs/sdk.md +17 -8
  157. package/docs/session-format.md +26 -13
  158. package/docs/sessions.md +3 -3
  159. package/docs/settings.md +2 -2
  160. package/docs/skills.md +1 -15
  161. package/docs/termux.md +9 -10
  162. package/docs/themes.md +2 -2
  163. package/docs/tmux.md +3 -3
  164. package/docs/tui.md +19 -32
  165. package/docs/usage.md +2 -2
  166. package/docs/workflows.md +60 -16
  167. package/package.json +6 -12
  168. package/dist/builtin/subagents/skills/browser-use/SKILL.md +0 -234
  169. package/dist/builtin/subagents/skills/browser-use/references/cdp-python.md +0 -76
  170. package/dist/builtin/subagents/skills/browser-use/references/multi-session.md +0 -92
  171. package/node_modules/@earendil-works/pi-tui/README.md +0 -779
  172. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +0 -54
  173. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +0 -1
  174. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +0 -632
  175. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +0 -1
  176. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +0 -22
  177. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +0 -1
  178. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +0 -104
  179. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +0 -1
  180. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +0 -22
  181. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +0 -1
  182. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +0 -35
  183. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +0 -1
  184. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +0 -249
  185. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +0 -1
  186. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +0 -1857
  187. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +0 -1
  188. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +0 -28
  189. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +0 -1
  190. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +0 -89
  191. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +0 -1
  192. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +0 -37
  193. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +0 -1
  194. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +0 -378
  195. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +0 -1
  196. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +0 -31
  197. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +0 -1
  198. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +0 -69
  199. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +0 -1
  200. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +0 -96
  201. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +0 -1
  202. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +0 -644
  203. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +0 -1
  204. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +0 -50
  205. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +0 -1
  206. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +0 -159
  207. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +0 -1
  208. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +0 -50
  209. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +0 -1
  210. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +0 -185
  211. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +0 -1
  212. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +0 -12
  213. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +0 -1
  214. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +0 -23
  215. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +0 -1
  216. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +0 -19
  217. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +0 -1
  218. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +0 -89
  219. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +0 -1
  220. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +0 -13
  221. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +0 -1
  222. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +0 -51
  223. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +0 -1
  224. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +0 -39
  225. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +0 -1
  226. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +0 -2
  227. package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +0 -1
  228. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +0 -16
  229. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +0 -1
  230. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +0 -110
  231. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +0 -1
  232. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +0 -23
  233. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +0 -1
  234. package/node_modules/@earendil-works/pi-tui/dist/index.js +0 -32
  235. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +0 -1
  236. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +0 -193
  237. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +0 -1
  238. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +0 -174
  239. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +0 -1
  240. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +0 -184
  241. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +0 -1
  242. package/node_modules/@earendil-works/pi-tui/dist/keys.js +0 -1173
  243. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +0 -1
  244. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +0 -28
  245. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +0 -1
  246. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +0 -44
  247. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +0 -1
  248. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +0 -3
  249. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +0 -1
  250. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +0 -53
  251. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +0 -1
  252. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +0 -50
  253. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +0 -1
  254. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +0 -361
  255. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +0 -1
  256. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +0 -90
  257. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +0 -1
  258. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +0 -366
  259. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +0 -1
  260. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +0 -113
  261. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +0 -1
  262. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +0 -472
  263. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +0 -1
  264. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +0 -227
  265. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +0 -1
  266. package/node_modules/@earendil-works/pi-tui/dist/tui.js +0 -1106
  267. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +0 -1
  268. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +0 -17
  269. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +0 -1
  270. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +0 -25
  271. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +0 -1
  272. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -84
  273. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +0 -1
  274. package/node_modules/@earendil-works/pi-tui/dist/utils.js +0 -1029
  275. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +0 -1
  276. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +0 -25
  277. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +0 -1
  278. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +0 -96
  279. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +0 -1
  280. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  281. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  282. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  283. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  284. package/node_modules/@earendil-works/pi-tui/package.json +0 -47
  285. package/node_modules/get-east-asian-width/index.d.ts +0 -60
  286. package/node_modules/get-east-asian-width/index.js +0 -30
  287. package/node_modules/get-east-asian-width/license +0 -9
  288. package/node_modules/get-east-asian-width/lookup-data.js +0 -21
  289. package/node_modules/get-east-asian-width/lookup.js +0 -138
  290. package/node_modules/get-east-asian-width/package.json +0 -71
  291. package/node_modules/get-east-asian-width/readme.md +0 -65
  292. package/node_modules/get-east-asian-width/utilities.js +0 -24
  293. package/node_modules/marked/LICENSE.md +0 -44
  294. package/node_modules/marked/README.md +0 -106
  295. package/node_modules/marked/bin/main.js +0 -282
  296. package/node_modules/marked/bin/marked.js +0 -15
  297. package/node_modules/marked/lib/marked.cjs +0 -2211
  298. package/node_modules/marked/lib/marked.cjs.map +0 -7
  299. package/node_modules/marked/lib/marked.d.cts +0 -728
  300. package/node_modules/marked/lib/marked.d.ts +0 -728
  301. package/node_modules/marked/lib/marked.esm.js +0 -2189
  302. package/node_modules/marked/lib/marked.esm.js.map +0 -7
  303. package/node_modules/marked/lib/marked.umd.js +0 -2213
  304. package/node_modules/marked/lib/marked.umd.js.map +0 -7
  305. package/node_modules/marked/man/marked.1 +0 -111
  306. package/node_modules/marked/man/marked.1.md +0 -92
  307. package/node_modules/marked/marked.min.js +0 -69
  308. package/node_modules/marked/package.json +0 -111
@@ -1,51 +1,183 @@
1
1
  # Compaction & Branch Summarization
2
2
 
3
- LLMs have limited context windows. When conversations grow too long, Atomic uses compaction to summarize older content while preserving recent work. This page covers both auto-compaction and branch summarization.
3
+ LLMs have limited context windows. When conversations grow too long, Atomic's default compaction path uses **Verbatim Compaction**: it deletes safe older transcript objects while preserving every retained object exactly as it was recorded. This page covers default auto/manual compaction, legacy summary compaction internals, and branch summarization.
4
4
 
5
- **Source files** ([pi-mono](https://github.com/earendil-works/pi-mono)):
6
- - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Auto-compaction logic
7
- - [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
8
- - [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
9
- - [`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) - Entry types (`CompactionEntry`, `BranchSummaryEntry`)
10
- - [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
5
+ Atomic's default compaction design and terminology are informed by Morph's Context Compaction work: [Morph's Context Compaction](https://www.morphllm.com/context-compaction). Atomic follows the same core idea that coding agents often benefit more from deleting low-signal context than from rewriting high-signal details like file paths, line numbers, commands, and error strings into a lossy summary.
6
+
7
+ **Source files** ([atomic](https://github.com/bastani-inc/atomic)):
8
+
9
+ - [`packages/coding-agent/src/core/compaction/context-compaction.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/context-compaction.ts) - Verbatim Compaction planner, transcript tools, validation, and prompt
10
+ - [`packages/coding-agent/src/core/compaction/compaction.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) - Legacy summary compaction logic and shared threshold helpers
11
+ - [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
12
+ - [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
13
+ - [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`ContextCompactionEntry`, `CompactionEntry`, `BranchSummaryEntry`) and active-context rebuild logic
14
+ - [`packages/coding-agent/src/core/extensions/types.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/extensions/types.ts) - Extension event types
11
15
 
12
16
  For TypeScript definitions in your project, inspect `node_modules/@bastani/atomic/dist/`.
13
17
 
14
18
  ## Overview
15
19
 
16
- Atomic has two summarization mechanisms:
20
+ Atomic has three compaction/summarization mechanisms:
17
21
 
18
22
  | Mechanism | Trigger | Purpose |
19
23
  |-----------|---------|---------|
20
- | Compaction | Context exceeds threshold, or `/compact` | Summarize old messages to free up context |
21
- | Branch summarization | `/tree` navigation | Preserve context when switching branches |
24
+ | Verbatim Compaction (default context compaction) | Context exceeds threshold, context overflow, or `/compact` | Delete safe old transcript entries/content blocks while retaining surviving content verbatim |
25
+ | Summary compaction internals | Legacy core APIs and legacy extension hooks | Summarize old messages into replacement context |
26
+ | Branch summarization | `/tree` navigation | Preserve useful context when switching branches |
27
+
28
+ `/compact` has no user-facing arguments. It uses a fixed internal prompt, transcript-bound inspection/deletion tools, local validation, and a `context_compaction` session entry. Auto-compaction uses the same deletion-only path.
29
+
30
+ ## Default Context Compaction (Verbatim Compaction)
31
+
32
+ ### What "Verbatim" Means
33
+
34
+ Verbatim Compaction never asks a model to rewrite the conversation for the main active context. Instead, the model may only choose deletion targets by stable transcript ID:
35
+
36
+ - **Whole entries** such as an old assistant message or obsolete tool result.
37
+ - **Individual content blocks** inside a multi-block message, such as one stale tool call block while keeping other blocks.
22
38
 
23
- Both use the same structured summary format and track file operations cumulatively.
39
+ Atomic records those targets in an append-only `context_compaction` entry. When the active branch is rebuilt, Atomic filters the targeted objects out and reuses every retained entry/content block unchanged. There is no generated summary, no paraphrasing, and no replacement message inserted by default.
24
40
 
25
- ## Compaction
41
+ The raw session JSONL remains append-only. Deleted objects stay available in the stored session file and backup snapshot; they are only omitted from future active LLM context on that branch.
26
42
 
27
43
  ### When It Triggers
28
44
 
29
45
  Auto-compaction triggers when:
30
46
 
31
- ```
47
+ ```text
32
48
  contextTokens > contextWindow - reserveTokens
33
49
  ```
34
50
 
35
51
  By default, `reserveTokens` is 16384 tokens. Configure it in `~/.atomic/agent/settings.json` or `<project-dir>/.atomic/settings.json`; legacy `.pi` paths are also supported. This leaves room for the LLM's response.
36
52
 
37
- You can also trigger manually with `/compact [instructions]`, where optional instructions focus the summary.
53
+ You can also trigger compaction manually with `/compact`. Custom summary instructions are no longer accepted because default compaction is deletion-only and retained transcript content stays verbatim.
38
54
 
39
55
  ### How It Works
40
56
 
41
- 1. **Find cut point**: Walk backwards from newest message, accumulating token estimates until `keepRecentTokens` is reached. The default is 20k tokens; configure it in `~/.atomic/agent/settings.json` or `<project-dir>/.atomic/settings.json`. Legacy `.pi` paths are also supported.
42
- 2. **Extract messages**: Collect messages from the previous kept boundary (or session start) up to the cut point
43
- 3. **Generate summary**: Call LLM to summarize with structured format, passing the previous summary as iterative context when present
44
- 4. **Append entry**: Save `CompactionEntry` with summary and `firstKeptEntryId`
45
- 5. **Reload**: Session reloads, using summary + messages from `firstKeptEntryId` onwards
57
+ 1. **Collect active branch context.** Atomic walks the current session branch, applies any earlier `context_compaction` logical deletions, and respects legacy summary-compaction boundaries if they exist.
58
+ 2. **Build a compactable transcript.** Each compactable entry includes a stable `entryId`, role, token estimate, full text, content-block indexes, tool-call IDs, and tool-result links.
59
+ 3. **Mark protected context.** Standard compaction protects user instructions, custom messages, branch/summary messages, the last five context-eligible entries, unresolved assistant/tool errors, and failed bash executions.
60
+ 4. **Write a temporary transcript file.** The compaction assistant receives a compact manifest plus the path to a JSONL transcript file. It should inspect with tools instead of loading the whole transcript into prompt context.
61
+ 5. **Run the deletion planner.** The selected model runs with Atomic's fixed Verbatim Compaction prompt and the lowest supported thinking level for that model. It can search/read transcript slices and then call deletion tools.
62
+ 6. **Validate fail-closed.** Atomic validates every cumulative deletion plan locally. Unknown IDs, protected targets, duplicate/overlapping targets, empty-context plans, missing task-bearing context, and tool-call/tool-result orphaning are rejected.
63
+ 7. **Save and rebuild.** Atomic writes a backup snapshot for persisted sessions, appends a `context_compaction` entry with validated targets and stats, then rebuilds the active LLM context from the filtered branch.
64
+
65
+ ### Transcript-Bound Tools
66
+
67
+ The compaction assistant can only compact by using these internal tools:
68
+
69
+ | Tool | Purpose |
70
+ |------|---------|
71
+ | `context_search_transcript` | Search entry or content-block text and return small snippets. |
72
+ | `context_read_entry` | Read a bounded slice of one entry or content block. |
73
+ | `context_delete` | Record exact entry/content-block deletion targets. |
74
+ | `context_grep_delete` | Bulk-delete matching entries or content blocks with guardrails. |
75
+
76
+ `context_grep_delete` supports literal or regex matching, skips protected/already-deleted context, has match-count caps, can require `expectedMatchCount`, and routes matches through the same validation pipeline as exact deletions.
77
+
78
+ Tool calls are cumulative during one compaction run. The assistant can apply several small deletion batches, inspect the updated state, and stop when enough safe context has been removed. Atomic uses the validated tool state as the compaction result; deletion JSON written in ordinary assistant text is not used for the final action.
46
79
 
80
+ ### Protection and Validation Rules
81
+
82
+ In standard mode, Atomic protects:
83
+
84
+ - User messages and user-provided task context.
85
+ - Custom messages, branch summaries, and existing summary-compaction messages.
86
+ - The last five context-eligible entries on the active branch.
87
+ - Assistant messages whose stop reason is an error.
88
+ - Tool results marked as errors.
89
+ - Failed bash executions.
90
+
91
+ Validation also preserves tool-call/tool-result consistency. If deleting a tool call would leave a tool result behind, Atomic either deletes the paired result too or rejects the plan when that would violate protection. If deleting a tool result would leave a visible dangling tool call, Atomic either deletes the paired call too or rejects the plan.
92
+
93
+ Atomic also refuses plans that would delete all context or leave no task-bearing context. These checks are local; the model cannot bypass them.
94
+
95
+ ### Standard vs. Critical Overflow Mode
96
+
97
+ Manual `/compact` and threshold auto-compaction run in **standard** mode: protected entries and protected content blocks cannot be deleted.
98
+
99
+ When a provider returns a context-overflow error, Atomic runs one **critical overflow** recovery pass before retrying. Critical overflow mode first tries stale unprotected context. If that is not enough, it may delete older protected user/custom/summary context, but it still preserves the last five context-eligible entries, unresolved errors, failed commands, and enough task-bearing context for continuation. Atomic retries once after a successful overflow compaction.
100
+
101
+ ### ContextCompactionEntry Structure
102
+
103
+ Defined in [`session-manager.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/session-manager.ts):
104
+
105
+ ```typescript
106
+ type ContextDeletionTarget =
107
+ | { kind: "entry"; entryId: string }
108
+ | { kind: "content_block"; entryId: string; blockIndex: number };
109
+
110
+ interface ContextCompactionStats {
111
+ objectsBefore: number;
112
+ objectsAfter: number;
113
+ objectsDeleted: number;
114
+ tokensBefore: number;
115
+ tokensAfter: number;
116
+ percentReduction: number;
117
+ }
118
+
119
+ interface ContextCompactionEntry {
120
+ type: "context_compaction";
121
+ id: string;
122
+ parentId: string | null;
123
+ timestamp: string;
124
+ promptVersion: 1;
125
+ deletedTargets: ContextDeletionTarget[];
126
+ protectedEntryIds: string[];
127
+ stats: ContextCompactionStats;
128
+ backupPath?: string;
129
+ }
47
130
  ```
48
- Before compaction:
131
+
132
+ `deletedTargets` is the only active-context mutation. The entry records what to omit; it does not contain replacement prose.
133
+
134
+ ### Verbatim Compaction Diagram
135
+
136
+ Unlike legacy summary compaction, Verbatim Compaction does not add a generated summary or rewrite retained messages. It appends a `context_compaction` entry that records exactly which older transcript objects should be hidden from future active context rebuilds.
137
+
138
+ ```text
139
+ Before verbatim compaction:
140
+
141
+ entry: 0 1 2 3 4 5 6 7
142
+ ┌─────┬─────┬─────┬──────┬─────┬──────┬──────┬─────┐
143
+ │ hdr │ usr │ ass │ tool │ usr │ ass │ tool │ ass │
144
+ └─────┴─────┴─────┴──────┴─────┴──────┴──────┴─────┘
145
+ │ │ │ │
146
+ └──────┴────────────┴──────┘
147
+ planner may mark low-signal old objects
148
+
149
+ Validated deletion plan:
150
+
151
+ delete entry 2 (older assistant text)
152
+ delete entry 3 (superseded tool output)
153
+ keep entries 0,1,4,5,6,7 unchanged
154
+
155
+ After compaction (new entry appended; JSONL remains append-only):
156
+
157
+ entry: 0 1 2 3 4 5 6 7 8
158
+ ┌─────┬─────┬─────┬──────┬─────┬──────┬──────┬─────┬─────┐
159
+ │ hdr │ usr │ ass │ tool │ usr │ ass │ tool │ ass │ ctx │
160
+ └─────┴─────┴─────┴──────┴─────┴──────┴──────┴─────┴─────┘
161
+ ╳ ╳ ↑
162
+ logical deletions context_compaction entry
163
+
164
+ What the LLM sees after rebuild:
165
+
166
+ ┌────────┬─────┬─────┬──────┬──────┬─────┐
167
+ │ system │ usr │ usr │ ass │ tool │ ass │
168
+ └────────┴─────┴─────┴──────┴──────┴─────┘
169
+ entry 1 entry 4 entry 5 entry 6 entry 7
170
+
171
+ No generated summary is inserted. Every surviving entry/content block is reused
172
+ verbatim; deleted objects are simply omitted from the active LLM context.
173
+ ```
174
+
175
+ ## Summary Compaction Internals
176
+
177
+ The older summarization pipeline still exists in the core compaction module and for legacy extension hook types, but `/compact` and auto-compaction no longer use it by default.
178
+
179
+ ```text
180
+ Before summary compaction:
49
181
 
50
182
  entry: 0 1 2 3 4 5 6 7 8 9
51
183
  ┌─────┬─────┬─────┬─────┬──────┬─────┬─────┬──────┬──────┬─────┐
@@ -76,15 +208,15 @@ What the LLM sees:
76
208
  prompt from cmp messages from firstKeptEntryId
77
209
  ```
78
210
 
79
- On repeated compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. Pi also recalculates `tokensBefore` from the rebuilt session context before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced.
211
+ On repeated legacy summary compactions, the summarized span starts at the previous compaction's kept boundary (`firstKeptEntryId`), not at the compaction entry itself, falling back to the entry after the previous compaction if that kept entry cannot be found in the path. This preserves messages that survived the earlier compaction by including them in the next summarization pass as well. Atomic also recalculates `tokensBefore` from the rebuilt session context before writing the new `CompactionEntry`, so the token count reflects the actual pre-compaction context being replaced.
80
212
 
81
213
  ### Split Turns
82
214
 
83
- A "turn" starts with a user message and includes all assistant responses and tool calls until the next user message. Normally, compaction cuts at turn boundaries.
215
+ A "turn" starts with a user message and includes all assistant responses and tool calls until the next user message. The legacy summary pipeline normally cuts at turn boundaries.
84
216
 
85
217
  When a single turn exceeds `keepRecentTokens`, the cut point lands mid-turn at an assistant message. This is a "split turn":
86
218
 
87
- ```
219
+ ```text
88
220
  Split turn (one huge turn exceeds budget):
89
221
 
90
222
  entry: 0 1 2 3 4 5 6 7 8
@@ -102,30 +234,32 @@ Split turn (one huge turn exceeds budget):
102
234
  turnPrefixMessages = [usr, ass, tool, ass, tool, tool]
103
235
  ```
104
236
 
105
- For split turns, pi generates two summaries and merges them:
237
+ For split turns, Atomic generates two summaries and merges them:
238
+
106
239
  1. **History summary**: Previous context (if any)
107
240
  2. **Turn prefix summary**: The early part of the split turn
108
241
 
109
242
  ### Cut Point Rules
110
243
 
111
- Valid cut points are:
244
+ Valid legacy summary-compaction cut points are:
245
+
112
246
  - User messages
113
247
  - Assistant messages
114
248
  - BashExecution messages
115
249
  - Custom messages (custom_message, branch_summary)
116
250
 
117
- Never cut at tool results (they must stay with their tool call).
251
+ Never cut at tool results because they must stay with their tool call.
118
252
 
119
253
  ### CompactionEntry Structure
120
254
 
121
- Defined in [`session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
255
+ Defined in [`session-manager.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/session-manager.ts):
122
256
 
123
257
  ```typescript
124
258
  interface CompactionEntry<T = unknown> {
125
259
  type: "compaction";
126
260
  id: string;
127
- parentId: string;
128
- timestamp: number;
261
+ parentId: string | null;
262
+ timestamp: string; // ISO timestamp
129
263
  summary: string;
130
264
  firstKeptEntryId: string;
131
265
  tokensBefore: number;
@@ -133,22 +267,22 @@ interface CompactionEntry<T = unknown> {
133
267
  details?: T; // implementation-specific data
134
268
  }
135
269
 
136
- // Default compaction uses this for details (from compaction.ts):
270
+ // Legacy summary compaction uses this for details (from compaction.ts):
137
271
  interface CompactionDetails {
138
272
  readFiles: string[];
139
273
  modifiedFiles: string[];
140
274
  }
141
275
  ```
142
276
 
143
- Extensions can store any JSON-serializable data in `details`. The default compaction tracks file operations, but custom extension implementations can use their own structure.
277
+ Extensions can store any JSON-serializable data in `details`. The legacy summary compaction pipeline tracks file operations, but custom extension implementations can use their own structure.
144
278
 
145
- See [`prepareCompaction()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
279
+ See [`prepareCompaction()`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) and [`compact()`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/compaction.ts) for the implementation.
146
280
 
147
281
  ## Branch Summarization
148
282
 
149
283
  ### When It Triggers
150
284
 
151
- When you use `/tree` to navigate to a different branch, pi offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
285
+ When you use `/tree` to navigate to a different branch, Atomic offers to summarize the work you're leaving. This injects context from the left branch into the new branch.
152
286
 
153
287
  ### How It Works
154
288
 
@@ -158,7 +292,7 @@ When you use `/tree` to navigate to a different branch, pi offers to summarize t
158
292
  4. **Generate summary**: Call LLM with structured format
159
293
  5. **Append entry**: Save `BranchSummaryEntry` at navigation point
160
294
 
161
- ```
295
+ ```text
162
296
  Tree before navigation:
163
297
 
164
298
  ┌─ B ─ C ─ D (old leaf, being abandoned)
@@ -177,22 +311,23 @@ After navigation with summary:
177
311
 
178
312
  ### Cumulative File Tracking
179
313
 
180
- Both compaction and branch summarization track files cumulatively. When generating a summary, pi extracts file operations from:
314
+ Legacy summary compaction and branch summarization track files cumulatively. When generating a summary, Atomic extracts file operations from:
315
+
181
316
  - Tool calls in the messages being summarized
182
317
  - Previous compaction or branch summary `details` (if any)
183
318
 
184
- This means file tracking accumulates across multiple compactions or nested branch summaries, preserving the full history of read and modified files.
319
+ This means file tracking accumulates across multiple summary compactions or nested branch summaries, preserving the full history of read and modified files.
185
320
 
186
321
  ### BranchSummaryEntry Structure
187
322
 
188
- Defined in [`session-manager.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/session-manager.ts):
323
+ Defined in [`session-manager.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/session-manager.ts):
189
324
 
190
325
  ```typescript
191
326
  interface BranchSummaryEntry<T = unknown> {
192
327
  type: "branch_summary";
193
328
  id: string;
194
- parentId: string;
195
- timestamp: number;
329
+ parentId: string | null;
330
+ timestamp: string; // ISO timestamp
196
331
  summary: string;
197
332
  fromId: string; // Entry we navigated from
198
333
  fromHook?: boolean; // true if provided by extension (legacy field name)
@@ -206,13 +341,13 @@ interface BranchSummaryDetails {
206
341
  }
207
342
  ```
208
343
 
209
- Same as compaction, extensions can store custom data in `details`.
344
+ Same as legacy summary compaction, extensions can store custom data in `details`.
210
345
 
211
- See [`collectEntriesForBranchSummary()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
346
+ See [`collectEntriesForBranchSummary()`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), [`prepareBranchEntries()`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts), and [`generateBranchSummary()`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) for the implementation.
212
347
 
213
- ## Summary Format
348
+ ## Legacy Summary Format
214
349
 
215
- Both compaction and branch summarization use the same structured format:
350
+ Legacy summary compaction and branch summarization use the same structured format:
216
351
 
217
352
  ```markdown
218
353
  ## Goal
@@ -252,9 +387,9 @@ path/to/changed.ts
252
387
 
253
388
  ### Message Serialization
254
389
 
255
- Before summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
390
+ Before legacy summarization, messages are serialized to text via [`serializeConversation()`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/utils.ts):
256
391
 
257
- ```
392
+ ```text
258
393
  [User]: What they said
259
394
  [Assistant thinking]: Internal reasoning
260
395
  [Assistant]: Response text
@@ -268,11 +403,11 @@ Tool results are truncated to 2000 characters during serialization. Content beyo
268
403
 
269
404
  ## Custom Summarization via Extensions
270
405
 
271
- Extensions can intercept and customize both compaction and branch summarization. See [`extensions/types.ts`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
406
+ Extensions can still customize the legacy summary compaction pipeline and branch summarization. Default `/compact` and auto-compaction use deletion-only Verbatim Compaction and do not call summary customization hooks. See [`extensions/types.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/extensions/types.ts) for event type definitions.
272
407
 
273
408
  ### session_before_compact
274
409
 
275
- Fired before auto-compaction or `/compact`. Can cancel or provide custom summary. See `SessionBeforeCompactEvent` and `CompactionPreparation` in the types file.
410
+ Fired before legacy summary compaction. Can cancel or provide custom summary. See `SessionBeforeCompactEvent` and `CompactionPreparation` in the types file.
276
411
 
277
412
  ```typescript
278
413
  pi.on("session_before_compact", async (event, ctx) => {
@@ -387,8 +522,8 @@ Configure compaction in `~/.atomic/agent/settings.json` or `<project-dir>/.atomi
387
522
 
388
523
  | Setting | Default | Description |
389
524
  |---------|---------|-------------|
390
- | `enabled` | `true` | Enable auto-compaction |
391
- | `reserveTokens` | `16384` | Tokens to reserve for LLM response |
392
- | `keepRecentTokens` | `20000` | Recent tokens to keep (not summarized) |
525
+ | `enabled` | `true` | Enable automatic Verbatim Compaction. |
526
+ | `reserveTokens` | `16384` | Tokens to reserve for the next LLM response; auto-compaction starts when context usage exceeds `contextWindow - reserveTokens`. |
527
+ | `keepRecentTokens` | `20000` | Legacy summary-compaction retained-token budget. Default Verbatim Compaction protects recent entries structurally instead of using this as a token cut point. |
393
528
 
394
529
  Disable auto-compaction with `"enabled": false`. You can still compact manually with `/compact`.
@@ -208,7 +208,7 @@ models: [{
208
208
  id: "custom-model",
209
209
  // ...
210
210
  reasoning: true,
211
- thinkingLevelMap: { // map pi levels to provider values; null hides unsupported levels
211
+ thinkingLevelMap: { // map Atomic thinking levels to provider values; null hides unsupported levels
212
212
  minimal: null,
213
213
  low: null,
214
214
  medium: null,
@@ -345,12 +345,14 @@ interface OAuthCredentials {
345
345
  For providers with non-standard APIs, implement `streamSimple`. Study the existing provider implementations before writing your own:
346
346
 
347
347
  **Reference implementations:**
348
- - [anthropic.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/providers/anthropic.ts) - Anthropic Messages API
349
- - [mistral.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/providers/mistral.ts) - Mistral Conversations API
350
- - [openai-completions.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/providers/openai-completions.ts) - OpenAI Chat Completions
351
- - [openai-responses.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/providers/openai-responses.ts) - OpenAI Responses API
352
- - [google.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/providers/google.ts) - Google Generative AI
353
- - [amazon-bedrock.ts](https://github.com/earendil-works/pi-mono/blob/main/packages/ai/src/providers/amazon-bedrock.ts) - AWS Bedrock
348
+
349
+ Atomic uses provider implementations from its installed `@earendil-works/pi-ai` dependency. Inspect the compiled declarations and JavaScript under `node_modules/@earendil-works/pi-ai/dist/providers/`, including:
350
+ - `anthropic.d.ts` / `anthropic.js` - Anthropic Messages API
351
+ - `mistral.d.ts` / `mistral.js` - Mistral Conversations API
352
+ - `openai-completions.d.ts` / `openai-completions.js` - OpenAI Chat Completions
353
+ - `openai-responses.d.ts` / `openai-responses.js` - OpenAI Responses API
354
+ - `google.d.ts` / `google.js` - Google Generative AI
355
+ - `amazon-bedrock.d.ts` / `amazon-bedrock.js` - AWS Bedrock
354
356
 
355
357
  ### Stream Pattern
356
358
 
@@ -522,7 +524,7 @@ pi.registerProvider("my-provider", {
522
524
 
523
525
  ## Testing Your Implementation
524
526
 
525
- Test your provider against the same test suites used by built-in providers. Copy and adapt these test files from [packages/ai/test/](https://github.com/earendil-works/pi-mono/tree/main/packages/ai/test):
527
+ Test your provider against focused tests that mirror Atomic's provider contract. If you are working from the source checkout, note that provider internals come from `@earendil-works/pi-ai`; this monorepo does not contain a `packages/ai/test` directory to copy from directly:
526
528
 
527
529
  | Test | Purpose |
528
530
  |------|---------|
@@ -602,7 +604,7 @@ interface ProviderModelConfig {
602
604
  /** Whether the model supports extended thinking. */
603
605
  reasoning: boolean;
604
606
 
605
- /** Maps pi thinking levels to provider/model-specific values; null marks a level unsupported. */
607
+ /** Maps Atomic thinking levels to provider/model-specific values; null marks a level unsupported. */
606
608
  thinkingLevelMap?: Partial<Record<"off" | "minimal" | "low" | "medium" | "high" | "xhigh", string | null>>;
607
609
 
608
610
  /** Supported input types. */