@bastani/atomic 0.8.26-alpha.1 → 0.8.26-alpha.10
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.
- package/CHANGELOG.md +73 -0
- package/README.md +5 -5
- package/dist/builtin/intercom/CHANGELOG.md +54 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/CHANGELOG.md +54 -0
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +55 -0
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -9
- package/dist/builtin/subagents/agents/debugger.md +6 -6
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +1 -1
- package/dist/builtin/subagents/skills/browser/EXAMPLES.md +151 -0
- package/dist/builtin/subagents/skills/browser/LICENSE.txt +21 -0
- package/dist/builtin/subagents/skills/browser/REFERENCE.md +451 -0
- package/dist/builtin/subagents/skills/browser/SKILL.md +170 -0
- package/dist/builtin/subagents/skills/subagent/SKILL.md +4 -4
- package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +55 -12
- package/dist/builtin/subagents/src/runs/foreground/execution.ts +71 -12
- package/dist/builtin/subagents/src/runs/shared/acceptance.ts +2 -1
- package/dist/builtin/subagents/src/runs/shared/final-drain.ts +34 -0
- package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +416 -7
- package/dist/builtin/subagents/src/runs/shared/worktree.ts +2 -2
- package/dist/builtin/web-access/CHANGELOG.md +54 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +66 -0
- package/dist/builtin/workflows/README.md +10 -8
- package/dist/builtin/workflows/builtin/deep-research-codebase.ts +11 -8
- package/dist/builtin/workflows/builtin/goal.ts +137 -109
- package/dist/builtin/workflows/builtin/index.d.ts +2 -0
- package/dist/builtin/workflows/builtin/open-claude-design.ts +228 -151
- package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
- package/dist/builtin/workflows/builtin/ralph.ts +452 -279
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/create-spec/SKILL.md +14 -0
- package/dist/builtin/workflows/skills/research-codebase/SKILL.md +29 -10
- package/dist/builtin/workflows/src/extension/index.ts +10 -2
- package/dist/builtin/workflows/src/extension/runtime.ts +35 -3
- package/dist/builtin/workflows/src/extension/wiring.ts +13 -1
- package/dist/builtin/workflows/src/runs/background/status.ts +52 -6
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +453 -21
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +77 -11
- package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +402 -8
- package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -2
- package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +2 -2
- package/dist/builtin/workflows/src/shared/persistence-restore.ts +182 -6
- package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +76 -6
- package/dist/builtin/workflows/src/shared/stage-prompt.ts +33 -2
- package/dist/builtin/workflows/src/shared/store-types.ts +31 -0
- package/dist/builtin/workflows/src/shared/store.ts +160 -18
- package/dist/builtin/workflows/src/shared/types.ts +3 -3
- package/dist/builtin/workflows/src/shared/workflow-failures.ts +758 -132
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +39 -3
- package/dist/builtin/workflows/src/tui/store-widget-installer.ts +74 -74
- package/dist/core/agent-session.d.ts +33 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +157 -182
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +11 -9
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +6 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +23 -10
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/context-compaction.d.ts +175 -0
- package/dist/core/compaction/context-compaction.d.ts.map +1 -0
- package/dist/core/compaction/context-compaction.js +1636 -0
- package/dist/core/compaction/context-compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +1 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +3 -0
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +14 -7
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/session-manager.d.ts +41 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +146 -7
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +5 -5
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.js +5 -5
- package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +16 -3
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.js +21 -3
- package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +17 -0
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/context-compaction-summary-message.d.ts +17 -0
- package/dist/modes/interactive/components/context-compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/context-compaction-summary-message.js +83 -0
- package/dist/modes/interactive/components/context-compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +4 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +75 -10
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +13 -8
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +8 -1
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +4 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +14 -3
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/git-env.d.ts +10 -0
- package/dist/utils/git-env.d.ts.map +1 -0
- package/dist/utils/git-env.js +33 -0
- package/dist/utils/git-env.js.map +1 -0
- package/docs/compaction.md +185 -50
- package/docs/custom-provider.md +11 -9
- package/docs/extensions.md +46 -42
- package/docs/index.md +13 -6
- package/docs/json.md +15 -12
- package/docs/packages.md +2 -0
- package/docs/providers.md +4 -1
- package/docs/quickstart.md +18 -11
- package/docs/rpc.md +38 -23
- package/docs/sdk.md +17 -8
- package/docs/session-format.md +26 -13
- package/docs/sessions.md +3 -3
- package/docs/settings.md +2 -2
- package/docs/skills.md +1 -15
- package/docs/termux.md +9 -10
- package/docs/themes.md +2 -2
- package/docs/tmux.md +3 -3
- package/docs/tui.md +19 -32
- package/docs/usage.md +2 -2
- package/docs/workflows.md +60 -16
- package/package.json +6 -12
- package/dist/builtin/subagents/skills/browser-use/SKILL.md +0 -234
- package/dist/builtin/subagents/skills/browser-use/references/cdp-python.md +0 -76
- package/dist/builtin/subagents/skills/browser-use/references/multi-session.md +0 -92
- package/node_modules/@earendil-works/pi-tui/README.md +0 -779
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +0 -54
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +0 -632
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +0 -22
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +0 -104
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +0 -22
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +0 -35
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +0 -249
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +0 -1857
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +0 -28
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +0 -89
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +0 -37
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +0 -378
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +0 -31
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +0 -69
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +0 -96
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +0 -644
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +0 -50
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +0 -159
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +0 -50
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +0 -185
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +0 -12
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +0 -23
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +0 -19
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js +0 -89
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +0 -13
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +0 -51
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +0 -39
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +0 -2
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +0 -16
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +0 -110
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +0 -23
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +0 -32
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +0 -193
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +0 -174
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +0 -184
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.js +0 -1173
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +0 -28
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +0 -44
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +0 -3
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +0 -53
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +0 -50
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +0 -361
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +0 -90
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +0 -366
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +0 -113
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +0 -472
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +0 -227
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +0 -1106
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +0 -17
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +0 -25
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -84
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +0 -1029
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +0 -25
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +0 -96
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/package.json +0 -47
- package/node_modules/get-east-asian-width/index.d.ts +0 -60
- package/node_modules/get-east-asian-width/index.js +0 -30
- package/node_modules/get-east-asian-width/license +0 -9
- package/node_modules/get-east-asian-width/lookup-data.js +0 -21
- package/node_modules/get-east-asian-width/lookup.js +0 -138
- package/node_modules/get-east-asian-width/package.json +0 -71
- package/node_modules/get-east-asian-width/readme.md +0 -65
- package/node_modules/get-east-asian-width/utilities.js +0 -24
- package/node_modules/marked/LICENSE.md +0 -44
- package/node_modules/marked/README.md +0 -106
- package/node_modules/marked/bin/main.js +0 -282
- package/node_modules/marked/bin/marked.js +0 -15
- package/node_modules/marked/lib/marked.cjs +0 -2211
- package/node_modules/marked/lib/marked.cjs.map +0 -7
- package/node_modules/marked/lib/marked.d.cts +0 -728
- package/node_modules/marked/lib/marked.d.ts +0 -728
- package/node_modules/marked/lib/marked.esm.js +0 -2189
- package/node_modules/marked/lib/marked.esm.js.map +0 -7
- package/node_modules/marked/lib/marked.umd.js +0 -2213
- package/node_modules/marked/lib/marked.umd.js.map +0 -7
- package/node_modules/marked/man/marked.1 +0 -111
- package/node_modules/marked/man/marked.1.md +0 -92
- package/node_modules/marked/marked.min.js +0 -69
- package/node_modules/marked/package.json +0 -111
package/docs/compaction.md
CHANGED
|
@@ -1,51 +1,183 @@
|
|
|
1
1
|
# Compaction & Branch Summarization
|
|
2
2
|
|
|
3
|
-
LLMs have limited context windows. When conversations grow too long, Atomic
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- [`packages/coding-agent/src/core/
|
|
10
|
-
- [`packages/coding-agent/src/core/
|
|
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
|
|
20
|
+
Atomic has three compaction/summarization mechanisms:
|
|
17
21
|
|
|
18
22
|
| Mechanism | Trigger | Purpose |
|
|
19
23
|
|-----------|---------|---------|
|
|
20
|
-
| Compaction | Context exceeds threshold, or `/compact` |
|
|
21
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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. **
|
|
42
|
-
2. **
|
|
43
|
-
3. **
|
|
44
|
-
4. **
|
|
45
|
-
5. **
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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,
|
|
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
|
|
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/
|
|
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:
|
|
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
|
-
//
|
|
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
|
|
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/
|
|
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,
|
|
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
|
-
|
|
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/
|
|
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:
|
|
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/
|
|
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
|
-
|
|
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/
|
|
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
|
|
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
|
|
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
|
|
391
|
-
| `reserveTokens` | `16384` | Tokens to reserve for LLM response |
|
|
392
|
-
| `keepRecentTokens` | `20000` |
|
|
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`.
|
package/docs/custom-provider.md
CHANGED
|
@@ -208,7 +208,7 @@ models: [{
|
|
|
208
208
|
id: "custom-model",
|
|
209
209
|
// ...
|
|
210
210
|
reasoning: true,
|
|
211
|
-
thinkingLevelMap: { // map
|
|
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
|
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
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
|
|
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
|
|
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. */
|