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