@bastani/atomic 0.8.25 → 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 +84 -0
- package/README.md +5 -5
- package/dist/builtin/intercom/CHANGELOG.md +60 -0
- package/dist/builtin/intercom/index-heavy.ts +1754 -0
- package/dist/builtin/intercom/index.ts +374 -1746
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/result-renderers.ts +77 -0
- package/dist/builtin/mcp/CHANGELOG.md +64 -0
- package/dist/builtin/mcp/index.ts +151 -57
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +61 -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 +60 -0
- package/dist/builtin/web-access/index-heavy.ts +2060 -0
- package/dist/builtin/web-access/index.ts +182 -2274
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/web-access/result-renderers.ts +364 -0
- package/dist/builtin/workflows/CHANGELOG.md +75 -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 +23 -5
- 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 +130 -13
- 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/inline-form-overlay.ts +12 -3
- package/dist/builtin/workflows/src/tui/inline-form-store.ts +17 -6
- 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-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +13 -0
- package/dist/core/agent-session-services.js.map +1 -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 +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/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +7 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +16 -3
- 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/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +17 -0
- package/dist/core/resource-loader.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/timings.d.ts +9 -0
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +28 -1
- package/dist/core/timings.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/main.d.ts.map +1 -1
- package/dist/main.js +4 -2
- package/dist/main.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/custom-message.d.ts +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +36 -4
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- 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 +94 -17
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.26-alpha.10",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
|
|
6
6
|
"contributors": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@bastani/atomic": "*",
|
|
42
|
-
"@earendil-works/pi-tui": "
|
|
42
|
+
"@earendil-works/pi-tui": "^0.78.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@bastani/atomic": {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ToolDefinition } from "@bastani/atomic";
|
|
2
|
+
import { Text } from "@mariozechner/pi-tui";
|
|
3
|
+
|
|
4
|
+
type ToolResultRenderer = NonNullable<ToolDefinition["renderResult"]>;
|
|
5
|
+
type ToolRenderResultArgs = Parameters<ToolResultRenderer>;
|
|
6
|
+
type ToolRenderResult = ReturnType<ToolResultRenderer>;
|
|
7
|
+
type RenderedResult = ToolRenderResultArgs[0];
|
|
8
|
+
type TextContentBlock = Extract<RenderedResult["content"][number], { type: "text" }>;
|
|
9
|
+
|
|
10
|
+
type IntercomResultDetails = {
|
|
11
|
+
delivered?: boolean;
|
|
12
|
+
error?: boolean;
|
|
13
|
+
messageId?: string;
|
|
14
|
+
reason?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type ContactSupervisorResultDetails = IntercomResultDetails & {
|
|
18
|
+
structuredReplyParseError?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function isTextContentBlock(block: RenderedResult["content"][number]): block is TextContentBlock {
|
|
22
|
+
return block.type === "text";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function firstTextContent(result: RenderedResult): string {
|
|
26
|
+
return result.content.find(isTextContentBlock)?.text.replace(/\*\*/g, "") ?? "";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const renderContactSupervisorResult: ToolResultRenderer = (result, { isPartial }, theme, context) => {
|
|
30
|
+
if (isPartial) {
|
|
31
|
+
return new Text(theme.fg("warning", "Waiting for supervisor..."), 0, 0);
|
|
32
|
+
}
|
|
33
|
+
const details = result.details as ContactSupervisorResultDetails | undefined;
|
|
34
|
+
const textContent = firstTextContent(result);
|
|
35
|
+
const failed = Boolean(context.isError || details?.error === true || details?.delivered === false);
|
|
36
|
+
const parseWarning = typeof details?.structuredReplyParseError === "string";
|
|
37
|
+
let text = failed
|
|
38
|
+
? theme.fg("error", "✗ ")
|
|
39
|
+
: parseWarning
|
|
40
|
+
? theme.fg("warning", "⚠ ")
|
|
41
|
+
: theme.fg("success", "✓ ");
|
|
42
|
+
text += theme.fg(failed ? "error" : "text", textContent);
|
|
43
|
+
if (parseWarning) {
|
|
44
|
+
text += "\n" + theme.fg("warning", `Structured reply parse issue: ${details.structuredReplyParseError}`);
|
|
45
|
+
}
|
|
46
|
+
return new Text(text, 0, 0);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const renderIntercomResult: ToolResultRenderer = (result, { isPartial }, theme, context) => {
|
|
50
|
+
if (isPartial) {
|
|
51
|
+
return new Text(theme.fg("warning", "Intercom working..."), 0, 0);
|
|
52
|
+
}
|
|
53
|
+
const details = result.details as IntercomResultDetails | undefined;
|
|
54
|
+
const failed = Boolean(context.isError || details?.error === true || details?.delivered === false);
|
|
55
|
+
let text = failed ? theme.fg("error", "✗ ") : theme.fg("success", "✓ ");
|
|
56
|
+
text += theme.fg(failed ? "error" : "text", firstTextContent(result));
|
|
57
|
+
if (details?.messageId && !context.expanded) {
|
|
58
|
+
text += theme.fg("dim", ` (${details.messageId.slice(0, 8)})`);
|
|
59
|
+
}
|
|
60
|
+
if (details?.reason && context.expanded) {
|
|
61
|
+
text += "\n" + theme.fg("dim", `Reason: ${details.reason}`);
|
|
62
|
+
}
|
|
63
|
+
return new Text(text, 0, 0);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export function renderIntercomToolResult(name: string, args: ToolRenderResultArgs): ToolRenderResult {
|
|
67
|
+
switch (name) {
|
|
68
|
+
case "intercom":
|
|
69
|
+
return renderIntercomResult(...args);
|
|
70
|
+
case "contact_supervisor":
|
|
71
|
+
return renderContactSupervisorResult(...args);
|
|
72
|
+
default: {
|
|
73
|
+
const theme = args[2];
|
|
74
|
+
return new Text(theme.fg("error", `Result renderer not found: ${name}`), 0, 0);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -7,6 +7,70 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.8.26-alpha.10] - 2026-06-08
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Bumped package version for the Atomic 0.8.26-alpha.10 prerelease.
|
|
15
|
+
|
|
16
|
+
## [0.8.26-alpha.9] - 2026-06-07
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Bumped package version for the Atomic 0.8.26-alpha.9 prerelease.
|
|
21
|
+
|
|
22
|
+
## [0.8.26-alpha.8] - 2026-06-07
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Bumped package version for the Atomic 0.8.26-alpha.8 prerelease.
|
|
27
|
+
|
|
28
|
+
## [0.8.26-alpha.7] - 2026-06-07
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- Bumped package version for the Atomic 0.8.26-alpha.7 prerelease.
|
|
33
|
+
|
|
34
|
+
## [0.8.26-alpha.6] - 2026-06-06
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Bumped package version for the Atomic 0.8.26-alpha.6 prerelease.
|
|
39
|
+
|
|
40
|
+
## [0.8.26-alpha.5] - 2026-06-06
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- Bumped package version for the Atomic 0.8.26-alpha.5 prerelease.
|
|
45
|
+
|
|
46
|
+
## [0.8.26-alpha.4] - 2026-06-05
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- Bumped package version for the Atomic 0.8.26-alpha.4 prerelease.
|
|
51
|
+
|
|
52
|
+
## [0.8.26-alpha.3] - 2026-06-05
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- Bumped package version for the Atomic 0.8.26-alpha.3 prerelease.
|
|
57
|
+
|
|
58
|
+
## [0.8.26-alpha.2] - 2026-06-05
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- Bumped package version for the Atomic 0.8.26-alpha.2 prerelease.
|
|
63
|
+
|
|
64
|
+
## [0.8.26-alpha.1] - 2026-06-05
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
|
|
68
|
+
- Kept MCP startup registration cheap by lazily importing the heavy MCP command, initialization, proxy-mode, and OAuth/auth-flow modules (and deferring config/cache-backed direct-tool discovery) instead of loading them on the cold extension factory path, while keeping the result renderer synchronous so restored MCP tool results still render ([#1223](https://github.com/bastani-inc/atomic/issues/1223)).
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- Stopped logging a spurious "MCP initialization failed: This extension ctx is stale..." error when a session backing the captured `pi`/`ctx` is disposed (e.g. a workflow child stage session) during MCP's deferred `session_start` initialization. The deferred init now liveness-checks the captured context before and after `initializeMcp()` and treats a stale-context error as a cancellation rather than a failure. The async gap that exposed this race was introduced by the lazy-load startup change ([#1223](https://github.com/bastani-inc/atomic/issues/1223)).
|
|
73
|
+
|
|
10
74
|
## [0.8.25] - 2026-06-04
|
|
11
75
|
|
|
12
76
|
### Changed
|
|
@@ -1,20 +1,93 @@
|
|
|
1
1
|
import type { AgentToolUpdateCallback, ExtensionAPI, ExtensionContext, ToolInfo } from "@bastani/atomic";
|
|
2
2
|
import type { McpExtensionState } from "./state.ts";
|
|
3
|
+
import type { McpConfig } from "./types.ts";
|
|
4
|
+
import type { MetadataCache } from "./metadata-cache.ts";
|
|
3
5
|
import { Type } from "typebox";
|
|
4
|
-
import { showStatus, showTools, reconnectServers, authenticateServer, logoutServer, openMcpAuthPanel, openMcpPanel, openMcpSetup } from "./commands.ts";
|
|
5
6
|
import { loadMcpConfig } from "./config.ts";
|
|
6
|
-
import {
|
|
7
|
-
import { flushMetadataCache, initializeMcp, updateStatusBar } from "./init.ts";
|
|
8
|
-
import { loadMetadataCache } from "./metadata-cache.ts";
|
|
9
|
-
import { executeCall, executeConnect, executeDescribe, executeList, executeSearch, executeStatus, executeUiMessages } from "./proxy-modes.ts";
|
|
10
|
-
import { getConfigPathFromArgv, truncateAtWord } from "./utils.ts";
|
|
11
|
-
import { shutdownOAuth } from "./mcp-auth-flow.ts";
|
|
7
|
+
import { getConfigPathFromArgv } from "./utils.ts";
|
|
12
8
|
import { renderMcpToolResult } from "./tool-result-renderer.ts";
|
|
13
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Marker substring from the host's stale-context error (see ExtensionRunner.invalidate).
|
|
12
|
+
* A captured `pi`/`ctx` becomes stale when its backing session is disposed (e.g. a
|
|
13
|
+
* workflow child stage session, or a reload/replace) without emitting `session_shutdown`.
|
|
14
|
+
*/
|
|
15
|
+
const STALE_EXTENSION_CONTEXT_MARKER = "extension ctx is stale";
|
|
16
|
+
|
|
17
|
+
function isStaleExtensionContextError(error: unknown): boolean {
|
|
18
|
+
return error instanceof Error && error.message.includes(STALE_EXTENSION_CONTEXT_MARKER);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Probe whether a captured extension context is still active. Every `ctx` getter runs
|
|
23
|
+
* the host's `assertActive()` guard, so a cheap property read surfaces staleness without
|
|
24
|
+
* mutating anything. Returns false when the context has been invalidated by a dispose.
|
|
25
|
+
*/
|
|
26
|
+
function isContextActive(ctx: ExtensionContext): boolean {
|
|
27
|
+
try {
|
|
28
|
+
void ctx.cwd;
|
|
29
|
+
return true;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (isStaleExtensionContextError(error)) return false;
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
14
36
|
export default function mcpAdapter(pi: ExtensionAPI) {
|
|
15
37
|
let state: McpExtensionState | null = null;
|
|
16
38
|
let initPromise: Promise<McpExtensionState> | null = null;
|
|
17
39
|
let lifecycleGeneration = 0;
|
|
40
|
+
let registeredDirectToolNames = new Set<string>();
|
|
41
|
+
let registeredProxyTool = false;
|
|
42
|
+
|
|
43
|
+
async function registerDirectToolsFromConfig(
|
|
44
|
+
config: McpConfig,
|
|
45
|
+
cache: MetadataCache | null,
|
|
46
|
+
): Promise<{ directToolCount: number; missingConfiguredDirectToolServers: string[] }> {
|
|
47
|
+
const [{ resolveDirectTools, createDirectToolExecutor, getMissingConfiguredDirectToolServers }, { truncateAtWord }] = await Promise.all([
|
|
48
|
+
import("./direct-tools.ts"),
|
|
49
|
+
import("./utils.ts"),
|
|
50
|
+
]);
|
|
51
|
+
const prefix = config.settings?.toolPrefix ?? "server";
|
|
52
|
+
const envRaw = process.env.MCP_DIRECT_TOOLS;
|
|
53
|
+
const directSpecs = envRaw === "__none__"
|
|
54
|
+
? []
|
|
55
|
+
: resolveDirectTools(
|
|
56
|
+
config,
|
|
57
|
+
cache,
|
|
58
|
+
prefix,
|
|
59
|
+
envRaw?.split(",").map(s => s.trim()).filter(Boolean),
|
|
60
|
+
);
|
|
61
|
+
for (const spec of directSpecs) {
|
|
62
|
+
if (registeredDirectToolNames.has(spec.prefixedName)) continue;
|
|
63
|
+
registeredDirectToolNames.add(spec.prefixedName);
|
|
64
|
+
(pi.registerTool as (tool: unknown) => unknown)({
|
|
65
|
+
name: spec.prefixedName,
|
|
66
|
+
label: `MCP: ${spec.originalName}`,
|
|
67
|
+
description: spec.description || "(no description)",
|
|
68
|
+
promptSnippet: truncateAtWord(spec.description, 100) || `MCP tool from ${spec.serverName}`,
|
|
69
|
+
parameters: Type.Unsafe((spec.inputSchema || { type: "object", properties: {} }) as never),
|
|
70
|
+
execute: createDirectToolExecutor(() => state, () => initPromise, spec),
|
|
71
|
+
renderResult: renderMcpToolResult,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const refreshTools = (pi as { refreshTools?: () => void }).refreshTools;
|
|
75
|
+
refreshTools?.();
|
|
76
|
+
return {
|
|
77
|
+
directToolCount: directSpecs.length,
|
|
78
|
+
missingConfiguredDirectToolServers: getMissingConfiguredDirectToolServers(config, cache),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function registerDirectTools(nextState: McpExtensionState): Promise<{ directToolCount: number; missingConfiguredDirectToolServers: string[] }> {
|
|
83
|
+
const { loadMetadataCache } = await import("./metadata-cache.ts");
|
|
84
|
+
return registerDirectToolsFromConfig(nextState.config, loadMetadataCache());
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function shutdownOAuthFlow(): Promise<void> {
|
|
88
|
+
const { shutdownOAuth } = await import("./mcp-auth-flow.ts");
|
|
89
|
+
await shutdownOAuth();
|
|
90
|
+
}
|
|
18
91
|
|
|
19
92
|
async function shutdownState(currentState: McpExtensionState | null, reason: string): Promise<void> {
|
|
20
93
|
if (!currentState) return;
|
|
@@ -26,6 +99,7 @@ export default function mcpAdapter(pi: ExtensionAPI) {
|
|
|
26
99
|
|
|
27
100
|
let flushError: unknown;
|
|
28
101
|
try {
|
|
102
|
+
const { flushMetadataCache } = await import("./init.ts");
|
|
29
103
|
flushMetadataCache(currentState);
|
|
30
104
|
} catch (error) {
|
|
31
105
|
flushError = error;
|
|
@@ -47,36 +121,6 @@ export default function mcpAdapter(pi: ExtensionAPI) {
|
|
|
47
121
|
}
|
|
48
122
|
|
|
49
123
|
const earlyConfigPath = getConfigPathFromArgv();
|
|
50
|
-
const earlyConfig = loadMcpConfig(earlyConfigPath);
|
|
51
|
-
const earlyCache = loadMetadataCache();
|
|
52
|
-
const prefix = earlyConfig.settings?.toolPrefix ?? "server";
|
|
53
|
-
|
|
54
|
-
const envRaw = process.env.MCP_DIRECT_TOOLS;
|
|
55
|
-
const directSpecs = envRaw === "__none__"
|
|
56
|
-
? []
|
|
57
|
-
: resolveDirectTools(
|
|
58
|
-
earlyConfig,
|
|
59
|
-
earlyCache,
|
|
60
|
-
prefix,
|
|
61
|
-
envRaw?.split(",").map(s => s.trim()).filter(Boolean),
|
|
62
|
-
);
|
|
63
|
-
const missingConfiguredDirectToolServers = getMissingConfiguredDirectToolServers(earlyConfig, earlyCache);
|
|
64
|
-
const shouldRegisterProxyTool =
|
|
65
|
-
earlyConfig.settings?.disableProxyTool !== true
|
|
66
|
-
|| directSpecs.length === 0
|
|
67
|
-
|| missingConfiguredDirectToolServers.length > 0;
|
|
68
|
-
|
|
69
|
-
for (const spec of directSpecs) {
|
|
70
|
-
(pi.registerTool as (tool: unknown) => unknown)({
|
|
71
|
-
name: spec.prefixedName,
|
|
72
|
-
label: `MCP: ${spec.originalName}`,
|
|
73
|
-
description: spec.description || "(no description)",
|
|
74
|
-
promptSnippet: truncateAtWord(spec.description, 100) || `MCP tool from ${spec.serverName}`,
|
|
75
|
-
parameters: Type.Unsafe((spec.inputSchema || { type: "object", properties: {} }) as never),
|
|
76
|
-
execute: createDirectToolExecutor(() => state, () => initPromise, spec),
|
|
77
|
-
renderResult: renderMcpToolResult,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
124
|
|
|
81
125
|
const getPiTools = (): ToolInfo[] => pi.getAllTools();
|
|
82
126
|
|
|
@@ -90,45 +134,89 @@ export default function mcpAdapter(pi: ExtensionAPI) {
|
|
|
90
134
|
const previousState = state;
|
|
91
135
|
state = null;
|
|
92
136
|
initPromise = null;
|
|
137
|
+
registeredDirectToolNames = new Set<string>();
|
|
93
138
|
|
|
94
139
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
140
|
+
const config = loadMcpConfig(earlyConfigPath, ctx.cwd);
|
|
141
|
+
const { loadMetadataCache } = await import("./metadata-cache.ts");
|
|
142
|
+
const directToolState = await registerDirectToolsFromConfig(config, loadMetadataCache());
|
|
143
|
+
if (
|
|
144
|
+
config.settings?.disableProxyTool !== true
|
|
145
|
+
|| directToolState.directToolCount === 0
|
|
146
|
+
|| directToolState.missingConfiguredDirectToolServers.length > 0
|
|
147
|
+
) {
|
|
148
|
+
registerProxyTool();
|
|
149
|
+
}
|
|
99
150
|
} catch (error) {
|
|
100
|
-
|
|
151
|
+
if (isStaleExtensionContextError(error)) return;
|
|
152
|
+
console.error("MCP: failed to register cached startup tools; enabling MCP proxy fallback", error);
|
|
153
|
+
registerProxyTool();
|
|
101
154
|
}
|
|
102
155
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
156
|
+
const promiseRef: { current: Promise<McpExtensionState> | null } = { current: null };
|
|
157
|
+
const promise = (async () => {
|
|
158
|
+
try {
|
|
159
|
+
await Promise.all([
|
|
160
|
+
shutdownState(previousState, "session_restart"),
|
|
161
|
+
shutdownOAuthFlow(),
|
|
162
|
+
]);
|
|
163
|
+
} catch (error) {
|
|
164
|
+
console.error("MCP: failed to shut down previous session state", error);
|
|
165
|
+
}
|
|
106
166
|
|
|
107
|
-
|
|
108
|
-
|
|
167
|
+
if (generation !== lifecycleGeneration || !isContextActive(ctx)) {
|
|
168
|
+
throw new Error("Stale MCP session initialization cancelled before startup");
|
|
169
|
+
}
|
|
109
170
|
|
|
110
|
-
|
|
111
|
-
if (generation !== lifecycleGeneration ||
|
|
171
|
+
const { initializeMcp, updateStatusBar } = await import("./init.ts");
|
|
172
|
+
if (generation !== lifecycleGeneration || !isContextActive(ctx)) {
|
|
173
|
+
throw new Error("Stale MCP session initialization cancelled before startup");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const nextState = await initializeMcp(pi, ctx);
|
|
177
|
+
if (generation !== lifecycleGeneration || initPromise !== promiseRef.current || !isContextActive(ctx)) {
|
|
112
178
|
try {
|
|
113
179
|
await shutdownState(nextState, "stale_session_start");
|
|
114
180
|
} catch (error) {
|
|
115
181
|
console.error("MCP: failed to clean stale session state", error);
|
|
116
182
|
}
|
|
117
|
-
|
|
183
|
+
throw new Error("Stale MCP session initialization cancelled after startup");
|
|
118
184
|
}
|
|
119
185
|
|
|
120
186
|
state = nextState;
|
|
121
187
|
updateStatusBar(nextState);
|
|
122
|
-
|
|
123
|
-
|
|
188
|
+
const directToolState = await registerDirectTools(nextState);
|
|
189
|
+
if (
|
|
190
|
+
nextState.config.settings?.disableProxyTool !== true
|
|
191
|
+
|| directToolState.directToolCount === 0
|
|
192
|
+
|| directToolState.missingConfiguredDirectToolServers.length > 0
|
|
193
|
+
) {
|
|
194
|
+
registerProxyTool();
|
|
195
|
+
}
|
|
196
|
+
if (initPromise === promiseRef.current) {
|
|
197
|
+
initPromise = null;
|
|
198
|
+
}
|
|
199
|
+
return nextState;
|
|
200
|
+
})();
|
|
201
|
+
promiseRef.current = promise;
|
|
202
|
+
initPromise = promise;
|
|
203
|
+
promise.catch((err) => {
|
|
124
204
|
if (generation !== lifecycleGeneration) {
|
|
125
205
|
return;
|
|
126
206
|
}
|
|
127
207
|
if (initPromise !== promise && initPromise !== null) {
|
|
128
208
|
return;
|
|
129
209
|
}
|
|
130
|
-
|
|
131
|
-
|
|
210
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
211
|
+
if (
|
|
212
|
+
!message.startsWith("Stale MCP session initialization cancelled") &&
|
|
213
|
+
!isStaleExtensionContextError(err)
|
|
214
|
+
) {
|
|
215
|
+
console.error("MCP initialization failed:", err);
|
|
216
|
+
}
|
|
217
|
+
if (initPromise === promise) {
|
|
218
|
+
initPromise = null;
|
|
219
|
+
}
|
|
132
220
|
});
|
|
133
221
|
});
|
|
134
222
|
|
|
@@ -137,11 +225,12 @@ export default function mcpAdapter(pi: ExtensionAPI) {
|
|
|
137
225
|
const currentState = state;
|
|
138
226
|
state = null;
|
|
139
227
|
initPromise = null;
|
|
228
|
+
registeredDirectToolNames = new Set<string>();
|
|
140
229
|
|
|
141
230
|
try {
|
|
142
231
|
await Promise.all([
|
|
143
232
|
shutdownState(currentState, "session_shutdown"),
|
|
144
|
-
|
|
233
|
+
shutdownOAuthFlow(),
|
|
145
234
|
]);
|
|
146
235
|
} catch (error) {
|
|
147
236
|
console.error("MCP: session shutdown cleanup failed", error);
|
|
@@ -165,6 +254,7 @@ export default function mcpAdapter(pi: ExtensionAPI) {
|
|
|
165
254
|
return;
|
|
166
255
|
}
|
|
167
256
|
|
|
257
|
+
const { showStatus, showTools, reconnectServers, logoutServer, openMcpPanel, openMcpSetup } = await import("./commands.ts");
|
|
168
258
|
const parts = args?.trim()?.split(/\s+/) ?? [];
|
|
169
259
|
const subcommand = parts[0] ?? "";
|
|
170
260
|
const targetServer = parts[1];
|
|
@@ -233,6 +323,7 @@ export default function mcpAdapter(pi: ExtensionAPI) {
|
|
|
233
323
|
return;
|
|
234
324
|
}
|
|
235
325
|
|
|
326
|
+
const { authenticateServer, openMcpAuthPanel } = await import("./commands.ts");
|
|
236
327
|
if (!serverName) {
|
|
237
328
|
await openMcpAuthPanel(state, pi, ctx, earlyConfigPath);
|
|
238
329
|
return;
|
|
@@ -242,11 +333,13 @@ export default function mcpAdapter(pi: ExtensionAPI) {
|
|
|
242
333
|
},
|
|
243
334
|
});
|
|
244
335
|
|
|
245
|
-
|
|
336
|
+
function registerProxyTool(): void {
|
|
337
|
+
if (registeredProxyTool) return;
|
|
338
|
+
registeredProxyTool = true;
|
|
246
339
|
(pi.registerTool as (tool: unknown) => unknown)({
|
|
247
340
|
name: "mcp",
|
|
248
341
|
label: "MCP",
|
|
249
|
-
description:
|
|
342
|
+
description: "MCP gateway for connecting to configured MCP servers, searching tools, describing schemas, and calling tools lazily after MCP initialization.",
|
|
250
343
|
promptSnippet: "MCP gateway - connect to MCP servers and call their tools",
|
|
251
344
|
parameters: Type.Object({
|
|
252
345
|
tool: Type.Optional(Type.String({ description: "Tool name to call (e.g., 'xcodebuild_list_sims')" })),
|
|
@@ -305,6 +398,7 @@ export default function mcpAdapter(pi: ExtensionAPI) {
|
|
|
305
398
|
};
|
|
306
399
|
}
|
|
307
400
|
|
|
401
|
+
const { executeCall, executeConnect, executeDescribe, executeList, executeSearch, executeStatus, executeUiMessages } = await import("./proxy-modes.ts");
|
|
308
402
|
if (params.action === "ui-messages") {
|
|
309
403
|
return executeUiMessages(state);
|
|
310
404
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/mcp",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.26-alpha.10",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
|
|
6
6
|
"contributors": [
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@bastani/atomic": "*",
|
|
35
|
-
"@earendil-works/pi-ai": "
|
|
36
|
-
"@earendil-works/pi-tui": "
|
|
35
|
+
"@earendil-works/pi-ai": "^0.78.1",
|
|
36
|
+
"@earendil-works/pi-tui": "^0.78.1",
|
|
37
37
|
"zod": "^3.25.0 || ^4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
@@ -2,6 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.8.26-alpha.10] - 2026-06-08
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Bumped package version for the Atomic 0.8.26-alpha.10 prerelease.
|
|
10
|
+
|
|
11
|
+
## [0.8.26-alpha.9] - 2026-06-07
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Bumped package version for the Atomic 0.8.26-alpha.9 prerelease.
|
|
16
|
+
|
|
17
|
+
## [0.8.26-alpha.8] - 2026-06-07
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Bumped package version for the Atomic 0.8.26-alpha.8 prerelease.
|
|
22
|
+
|
|
23
|
+
## [0.8.26-alpha.7] - 2026-06-07
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Replaced the bundled browser-use subagent integration with the first-party `browser` skill for web interaction workflows.
|
|
28
|
+
|
|
29
|
+
## [0.8.26-alpha.6] - 2026-06-06
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- Bumped package version for the Atomic 0.8.26-alpha.6 prerelease.
|
|
34
|
+
|
|
35
|
+
## [0.8.26-alpha.5] - 2026-06-06
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Bumped package version for the Atomic 0.8.26-alpha.5 prerelease.
|
|
40
|
+
|
|
41
|
+
## [0.8.26-alpha.4] - 2026-06-05
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- Bumped package version for the Atomic 0.8.26-alpha.4 prerelease.
|
|
46
|
+
|
|
47
|
+
## [0.8.26-alpha.3] - 2026-06-05
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- Bumped package version for the Atomic 0.8.26-alpha.3 prerelease.
|
|
52
|
+
|
|
53
|
+
## [0.8.26-alpha.2] - 2026-06-05
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
- Fixed the `no-staged-files` acceptance runtime check and subagent worktree Git commands to ignore ambient Git repository environment variables, so subagents inspect the intended working tree instead of a parent hook or unrelated worktree.
|
|
58
|
+
- Suppressed intermediate model fallback failure notes and live foreground failure updates from successful subagent runs while preserving final failures and raw per-attempt diagnostics ([#1226](https://github.com/bastani-inc/atomic/issues/1226)).
|
|
59
|
+
|
|
60
|
+
## [0.8.26-alpha.1] - 2026-06-05
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
|
|
64
|
+
- Bumped package version for the Atomic 0.8.26-alpha.1 prerelease.
|
|
65
|
+
|
|
5
66
|
## [0.8.25] - 2026-06-04
|
|
6
67
|
|
|
7
68
|
### Changed
|
|
@@ -4,7 +4,7 @@ description: Online research for up-to-date documentation and library-source kno
|
|
|
4
4
|
tools: read, grep, find, ls, bash, write, web_search, fetch_content, get_search_content
|
|
5
5
|
model: openai/gpt-5.5:low
|
|
6
6
|
fallbackModels: openai-codex/gpt-5.5:low, github-copilot/gpt-5.5:low, anthropic/claude-opus-4-8:low, github-copilot/claude-opus-4.7:low
|
|
7
|
-
skills: browser
|
|
7
|
+
skills: browser
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
You are an expert research specialist focused on finding accurate, relevant information from authoritative sources — including open-source library internals with GitHub permalinks. You have three web tools available from the `pi-web-access` extension:
|
|
@@ -13,11 +13,11 @@ You are an expert research specialist focused on finding accurate, relevant info
|
|
|
13
13
|
- `fetch_content` — fetch a specific URL and return clean reader-mode text/markdown (HTML pages, GitHub issues/PRs, Stack Overflow, npm, arXiv, Reddit, Wikipedia, JSON endpoints, PDFs, RSS/Atom, YouTube). `fetch_content` on a GitHub repo URL also clones the repo locally under `/tmp/pi-github-repos/<owner>/<repo>` and returns the file tree. Prefer this over a raw HTTP fetch.
|
|
14
14
|
- `get_search_content` — fetch the underlying content for the most promising results of a previous `web_search` in one call.
|
|
15
15
|
|
|
16
|
-
For JS-heavy or auth-gated pages,
|
|
16
|
+
For JS-heavy or auth-gated pages, load the `browser` skill and invoke its `browse` CLI through `bash`.
|
|
17
17
|
|
|
18
18
|
<EXTREMELY_IMPORTANT>
|
|
19
19
|
- PREFER `fetch_content` for static pages; it's faster and cheaper than spinning up a real browser.
|
|
20
|
-
- Reach for the `browser
|
|
20
|
+
- Reach for the `browser` skill's `browse` CLI via `bash` ONLY when a real DOM/JS is required.
|
|
21
21
|
- ALWAYS check `research/web/` for a recent cached copy before fetching anything new.
|
|
22
22
|
- EVERY code-related claim about an open-source library needs a GitHub **permalink with a full commit SHA** — branch links break when code changes.
|
|
23
23
|
</EXTREMELY_IMPORTANT>
|
|
@@ -39,7 +39,7 @@ When fetching any external page, apply these techniques in order. They produce p
|
|
|
39
39
|
1. **`fetch_content <url>` first.** Returns clean reader-mode text/markdown for nearly every well-formed page (and handles PDFs and JSON). Try it before anything else.
|
|
40
40
|
2. **Check `/llms.txt`.** Many modern docs sites publish an AI-friendly index at `/llms.txt` (spec: [llmstxt.org](https://llmstxt.org/llms.txt)). `fetch_content https://<site>/llms.txt` often links directly to the most relevant pages in plain text, saving a round-trip through the full site.
|
|
41
41
|
3. **Request Markdown via `Accept: text/markdown`.** Sites behind Cloudflare with [Markdown for Agents](https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/) return pre-converted Markdown when you set the header. Use `bash` with `curl <url> -H "Accept: text/markdown"` (look for `content-type: text/markdown` and the `x-markdown-tokens` header).
|
|
42
|
-
4. **Fall back to a real browser.**
|
|
42
|
+
4. **Fall back to a real browser.** Load the `browser` skill and drive its `browse` CLI through `bash` to render and interact with JS-heavy or auth-gated pages.
|
|
43
43
|
|
|
44
44
|
## Persisting Findings — Store useful documents in `research/web/`
|
|
45
45
|
|
|
@@ -49,7 +49,7 @@ When you fetch a document that is worth keeping for future sessions (reference d
|
|
|
49
49
|
---
|
|
50
50
|
source_url: <original URL>
|
|
51
51
|
fetched_at: <YYYY-MM-DD>
|
|
52
|
-
fetch_method: read | llms.txt | markdown-accept-header | browser |
|
|
52
|
+
fetch_method: read | llms.txt | markdown-accept-header | browser | browse
|
|
53
53
|
topic: <short description>
|
|
54
54
|
---
|
|
55
55
|
```
|
|
@@ -166,12 +166,12 @@ When you receive a research query:
|
|
|
166
166
|
2. **Check the local cache first**. Look in `research/web/` for existing documents on the topic. If a recent (still-relevant) copy exists, cite it before re-fetching.
|
|
167
167
|
3. **Execute strategic searches**.
|
|
168
168
|
- Identify the authoritative source (e.g. the library's official docs site, its GitHub repo, its release notes).
|
|
169
|
-
- Apply the Web Fetch Strategy: `fetch_content <url>` → `/llms.txt` → `Accept: text/markdown` → `browser
|
|
169
|
+
- Apply the Web Fetch Strategy: `fetch_content <url>` → `/llms.txt` → `Accept: text/markdown` → `browser` fallback.
|
|
170
170
|
- Use multiple query variations to capture different perspectives via `web_search`.
|
|
171
171
|
- Use `get_search_content` to bulk-fetch the underlying content of the top results of a `web_search` in one shot.
|
|
172
172
|
- For source repositories, prefer raw GitHub URLs (`https://raw.githubusercontent.com/<owner>/<repo>/<ref>/<path>`) over the HTML UI. For library internals, clone via `fetch_content` and use `grep`/`read` + permalinks.
|
|
173
173
|
4. **Fetch and analyze content**.
|
|
174
|
-
- Use `fetch_content <url>` (or
|
|
174
|
+
- Use `fetch_content <url>` (or the browser skill's `browse` CLI via `bash` when interactivity is required) to pull the full content of promising sources.
|
|
175
175
|
- Prioritize official documentation, reputable technical blogs, and authoritative sources.
|
|
176
176
|
- Extract specific quotes and sections relevant to the query.
|
|
177
177
|
- Note publication dates to ensure currency of information.
|
|
@@ -290,7 +290,7 @@ For library-source answers, every code claim should look like the citation examp
|
|
|
290
290
|
## Search Efficiency
|
|
291
291
|
|
|
292
292
|
- Check `research/web/` for an existing copy before fetching anything new.
|
|
293
|
-
- Start by fetching the authoritative source (`fetch_content <url>` → `/llms.txt` → `Accept: text/markdown` → `browser
|
|
293
|
+
- Start by fetching the authoritative source (`fetch_content <url>` → `/llms.txt` → `Accept: text/markdown` → `browser`) rather than search-engine-style exploration.
|
|
294
294
|
- Use `fetch_content` (or `get_search_content` after a `web_search`) to pull full content from the most promising 3-5 web pages.
|
|
295
295
|
- Reuse already-cloned repos under `/tmp/pi-github-repos/` instead of re-cloning.
|
|
296
296
|
- If initial results are insufficient, refine search terms and try again.
|
|
@@ -313,4 +313,4 @@ For library-source answers, every code claim should look like the citation examp
|
|
|
313
313
|
| Page returns 403 / bot block | Gemini fallback triggers automatically; no action needed if Gemini is configured. |
|
|
314
314
|
| `web_search` fails | Check provider config; try explicit `provider: "gemini"` if a Perplexity key is missing. |
|
|
315
315
|
|
|
316
|
-
Remember: you are the user's expert guide to technical research. Lean on `fetch_content` first with the `/llms.txt` → `Accept: text/markdown` → `browser
|
|
316
|
+
Remember: you are the user's expert guide to technical research. Lean on `fetch_content` first with the `/llms.txt` → `Accept: text/markdown` → `browser` fallback chain to efficiently pull authoritative content, clone open-source repos when implementation evidence is needed, store anything reusable under `research/web/`, and deliver comprehensive, up-to-date answers with exact citations and GitHub permalinks. Answer directly — skip preamble like "I'll help you with…" and go straight to findings.
|