@herbertgao/pi-extensions 2026.8.1 → 2026.8.3
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/README.md +13 -3
- package/node_modules/@czottmann/pi-automode/README.md +16 -2
- package/node_modules/@czottmann/pi-automode/docs/GLOSSARY.md +35 -0
- package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +18 -9
- package/node_modules/@czottmann/pi-automode/docs/defaults.md +6 -2
- package/node_modules/@czottmann/pi-automode/examples/automode.local.json +6 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +11 -7
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/config.ts +100 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +32 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +78 -3
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/hard-deny.ts +16 -4
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/paths.ts +23 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/permissions.ts +22 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/types.ts +18 -2
- package/node_modules/@czottmann/pi-automode/package.json +4 -4
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-audit.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-debt.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-gain.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-help.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-review.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/ponytail-frontmatter.cjs +23 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/ponytail.mjs +99 -0
- package/node_modules/@dietrichgebert/ponytail/.qoder/rules/ponytail.md +30 -0
- package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +16 -0
- package/node_modules/@dietrichgebert/ponytail/AGENTS.md +32 -0
- package/node_modules/@dietrichgebert/ponytail/LICENSE +21 -0
- package/node_modules/@dietrichgebert/ponytail/README.es.md +298 -0
- package/node_modules/@dietrichgebert/ponytail/README.ko.md +315 -0
- package/node_modules/@dietrichgebert/ponytail/README.md +351 -0
- package/node_modules/@dietrichgebert/ponytail/assets/benchmark-3model.svg +21 -0
- package/node_modules/@dietrichgebert/ponytail/assets/benchmark-agentic.svg +62 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo-dark.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo-dark.svg +115 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo-greenpt-dark.svg +27 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo-greenpt.svg +27 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/social-preview.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner-es.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner-ko.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/claude-codex-hooks.json +44 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/copilot-hooks.json +21 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +96 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-config.js +169 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-instructions.js +98 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-mode-tracker.js +130 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-runtime.js +85 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-statusline.ps1 +24 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-statusline.sh +18 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-subagent.js +77 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/qoder-hooks.json +26 -0
- package/node_modules/@dietrichgebert/ponytail/package.json +47 -0
- package/node_modules/@dietrichgebert/ponytail/pi-extension/index.js +211 -0
- package/node_modules/@dietrichgebert/ponytail/pi-extension/package.json +8 -0
- package/node_modules/@dietrichgebert/ponytail/scripts/uninstall.js +60 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail/SKILL.md +120 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-audit/SKILL.md +41 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-debt/SKILL.md +44 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-gain/SKILL.md +50 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-help/SKILL.md +71 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-review/SKILL.md +57 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +6 -10
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +5 -9
- package/node_modules/@herbertgao/pi-cc-extensions/assets/readme/hero.en.svg +101 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -17
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +15 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/{utils/agent-summary.ts → feature/agent-summary/core.ts} +37 -35
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{agent-summary.ts → agent-summary/index.ts} +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +24 -83
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{session-reference.ts → reference/index.ts} +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{agent-autocomplete.ts → reference/subagent.ts} +19 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{pi-startup-header.ts → shell/startup-header.ts} +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{working-message.ts → shell/working-message.ts} +5 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +32 -28
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +452 -94
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +727 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +66 -776
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/{feature → renderer}/markdown-enhance.ts +134 -11
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/hover.ts +130 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{mouse-interaction.ts → mouse/interaction.ts} +90 -568
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/layout.ts +144 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/packets.ts +143 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +195 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/ansi-utils.ts +56 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/diff-renderer.ts +4 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/line-width-safety.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/write-display-utils.ts +12 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/write-execution.ts +1 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-grouping.ts → tool/grouping.ts} +27 -10
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-result.ts → tool/result.ts} +4 -13
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/transcript-refresh.ts +91 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/fullscreen-detect.ts +0 -27
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark.json +1 -0
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-light.json +2 -2
- package/node_modules/@herbertgao/pi-stash/README.md +9 -9
- package/node_modules/@herbertgao/pi-stash/package.json +1 -1
- package/node_modules/@herbertgao/pi-stash/src/index.ts +2 -1
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +20 -0
- package/node_modules/@herbertgao/pi-subagents/README.md +6 -2
- package/node_modules/@herbertgao/pi-subagents/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +1 -0
- package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +3 -1
- package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +85 -11
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +61 -39
- package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +26 -35
- package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +15 -1
- package/node_modules/@herbertgao/pi-subagents/src/settings.ts +12 -0
- package/node_modules/@herbertgao/pi-subagents/src/types.ts +2 -0
- package/node_modules/@narumitw/pi-btw/LICENSE +21 -0
- package/node_modules/@narumitw/pi-btw/README.md +210 -0
- package/node_modules/@narumitw/pi-btw/package.json +53 -0
- package/node_modules/@narumitw/pi-btw/src/bring-to-main.ts +632 -0
- package/node_modules/@narumitw/pi-btw/src/btw.ts +996 -0
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +339 -0
- package/node_modules/@narumitw/pi-btw/src/index.ts +1 -0
- package/node_modules/@narumitw/pi-btw/src/menu.ts +296 -0
- package/node_modules/@narumitw/pi-btw/src/settings.ts +237 -0
- package/node_modules/@narumitw/pi-btw/src/side-thread.ts +238 -0
- package/node_modules/@narumitw/pi-btw/src/text.ts +10 -0
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +620 -0
- package/node_modules/@pi-plugins/fast-mode/LICENSE +21 -0
- package/node_modules/@pi-plugins/fast-mode/README.md +92 -0
- package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts +6 -0
- package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -0
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +2026 -0
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -0
- package/node_modules/@pi-plugins/fast-mode/package.json +73 -0
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +78 -0
- package/node_modules/pi-mcp-adapter/README.md +80 -16
- package/node_modules/pi-mcp-adapter/agent-dir.ts +40 -0
- package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +377 -0
- package/node_modules/pi-mcp-adapter/commands.ts +21 -9
- package/node_modules/pi-mcp-adapter/config.ts +110 -49
- package/node_modules/pi-mcp-adapter/direct-tools.ts +40 -27
- package/node_modules/pi-mcp-adapter/elicitation-handler.ts +37 -36
- package/node_modules/pi-mcp-adapter/errors.ts +21 -17
- package/node_modules/pi-mcp-adapter/host-html-template.ts +13 -7
- package/node_modules/pi-mcp-adapter/index.ts +52 -17
- package/node_modules/pi-mcp-adapter/init.ts +9 -7
- package/node_modules/pi-mcp-adapter/json-schema-validator.ts +2 -2
- package/node_modules/pi-mcp-adapter/lifecycle.ts +8 -8
- package/node_modules/pi-mcp-adapter/logger.ts +1 -1
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +122 -25
- package/node_modules/pi-mcp-adapter/mcp-auth.ts +120 -2
- package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +138 -61
- package/node_modules/pi-mcp-adapter/mcp-code.ts +13 -11
- package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +62 -17
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +15 -11
- package/node_modules/pi-mcp-adapter/mcp-panel.ts +34 -15
- package/node_modules/pi-mcp-adapter/mcp-probe.ts +131 -34
- package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +2 -2
- package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +7 -4
- package/node_modules/pi-mcp-adapter/mcp-trace.ts +59 -64
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +34 -26
- package/node_modules/pi-mcp-adapter/npx-resolver.ts +6 -4
- package/node_modules/pi-mcp-adapter/oauth-handler.ts +1 -1
- package/node_modules/pi-mcp-adapter/oauth.ts +48 -0
- package/node_modules/pi-mcp-adapter/onboarding-state.ts +19 -11
- package/node_modules/pi-mcp-adapter/package.json +20 -9
- package/node_modules/pi-mcp-adapter/panel-keys.ts +20 -4
- package/node_modules/pi-mcp-adapter/prompts.ts +2 -2
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +56 -21
- package/node_modules/pi-mcp-adapter/sampling-handler.ts +22 -15
- package/node_modules/pi-mcp-adapter/search-ranking.ts +2 -1
- package/node_modules/pi-mcp-adapter/server-manager.ts +165 -113
- package/node_modules/pi-mcp-adapter/session-recovery.ts +11 -12
- package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +3 -3
- package/node_modules/pi-mcp-adapter/state.ts +3 -1
- package/node_modules/pi-mcp-adapter/tool-approval.ts +67 -4
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +6 -5
- package/node_modules/pi-mcp-adapter/tool-registrar.ts +187 -3
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +14 -2
- package/node_modules/pi-mcp-adapter/ts-shape.ts +9 -2
- package/node_modules/pi-mcp-adapter/types.ts +111 -22
- package/node_modules/pi-mcp-adapter/ui-app-bridge-helpers.ts +40 -0
- package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +28 -19
- package/node_modules/pi-mcp-adapter/ui-server.ts +90 -58
- package/node_modules/pi-mcp-adapter/ui-session.ts +16 -14
- package/node_modules/pi-mcp-adapter/unix-socket-transport.ts +4 -4
- package/node_modules/pi-mcp-adapter/utils.ts +23 -9
- package/node_modules/pi-web-access/CHANGELOG.md +45 -0
- package/node_modules/pi-web-access/README.md +104 -29
- package/node_modules/pi-web-access/bocha.ts +221 -0
- package/node_modules/pi-web-access/curator-page.ts +113 -12
- package/node_modules/pi-web-access/curator-server.ts +56 -20
- package/node_modules/pi-web-access/datalab-pdf-extract.ts +568 -0
- package/node_modules/pi-web-access/duckduckgo.ts +123 -0
- package/node_modules/pi-web-access/extract.ts +288 -143
- package/node_modules/pi-web-access/feature-config.ts +29 -0
- package/node_modules/pi-web-access/gemini-api.ts +4 -0
- package/node_modules/pi-web-access/gemini-search.ts +45 -12
- package/node_modules/pi-web-access/gemini-web.ts +68 -3
- package/node_modules/pi-web-access/index.ts +160 -71
- package/node_modules/pi-web-access/jina-search.ts +284 -0
- package/node_modules/pi-web-access/kagi.ts +12 -12
- package/node_modules/pi-web-access/openai-search.ts +12 -2
- package/node_modules/pi-web-access/package.json +4 -3
- package/node_modules/pi-web-access/pdf-extract.ts +327 -228
- package/node_modules/pi-web-access/storage.ts +440 -2
- package/node_modules/pi-web-access/summary-model-scope.ts +1 -1
- package/node_modules/pi-web-access/summary-review.ts +4 -2
- package/node_modules/pi-web-access/video-extract.ts +10 -8
- package/node_modules/pi-web-access/xai-search.ts +12 -2
- package/node_modules/pi-web-access/youtube-extract.ts +2 -1
- package/node_modules/remote-pi/LICENSE +21 -0
- package/node_modules/remote-pi/README.md +675 -0
- package/node_modules/remote-pi/dist/actions/handlers.d.ts +122 -0
- package/node_modules/remote-pi/dist/actions/handlers.js +160 -0
- package/node_modules/remote-pi/dist/actions/handlers.js.map +1 -0
- package/node_modules/remote-pi/dist/actions/registry.d.ts +39 -0
- package/node_modules/remote-pi/dist/actions/registry.js +58 -0
- package/node_modules/remote-pi/dist/actions/registry.js.map +1 -0
- package/node_modules/remote-pi/dist/bin/supervisord.d.ts +2 -0
- package/node_modules/remote-pi/dist/bin/supervisord.js +86 -0
- package/node_modules/remote-pi/dist/bin/supervisord.js.map +1 -0
- package/node_modules/remote-pi/dist/commands/builtin_mirror.d.ts +58 -0
- package/node_modules/remote-pi/dist/commands/builtin_mirror.js +71 -0
- package/node_modules/remote-pi/dist/commands/builtin_mirror.js.map +1 -0
- package/node_modules/remote-pi/dist/commands/list_commands.d.ts +60 -0
- package/node_modules/remote-pi/dist/commands/list_commands.js +73 -0
- package/node_modules/remote-pi/dist/commands/list_commands.js.map +1 -0
- package/node_modules/remote-pi/dist/config.d.ts +62 -0
- package/node_modules/remote-pi/dist/config.js +115 -0
- package/node_modules/remote-pi/dist/config.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/client.d.ts +20 -0
- package/node_modules/remote-pi/dist/daemon/client.js +131 -0
- package/node_modules/remote-pi/dist/daemon/client.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/control_protocol.d.ts +176 -0
- package/node_modules/remote-pi/dist/daemon/control_protocol.js +63 -0
- package/node_modules/remote-pi/dist/daemon/control_protocol.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/cron_log.d.ts +45 -0
- package/node_modules/remote-pi/dist/daemon/cron_log.js +72 -0
- package/node_modules/remote-pi/dist/daemon/cron_log.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/cron_registry.d.ts +80 -0
- package/node_modules/remote-pi/dist/daemon/cron_registry.js +194 -0
- package/node_modules/remote-pi/dist/daemon/cron_registry.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/id.d.ts +24 -0
- package/node_modules/remote-pi/dist/daemon/id.js +36 -0
- package/node_modules/remote-pi/dist/daemon/id.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/install.d.ts +170 -0
- package/node_modules/remote-pi/dist/daemon/install.js +547 -0
- package/node_modules/remote-pi/dist/daemon/install.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/registry.d.ts +63 -0
- package/node_modules/remote-pi/dist/daemon/registry.js +153 -0
- package/node_modules/remote-pi/dist/daemon/registry.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/rpc_child.d.ts +194 -0
- package/node_modules/remote-pi/dist/daemon/rpc_child.js +389 -0
- package/node_modules/remote-pi/dist/daemon/rpc_child.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/supervisor.d.ts +93 -0
- package/node_modules/remote-pi/dist/daemon/supervisor.js +596 -0
- package/node_modules/remote-pi/dist/daemon/supervisor.js.map +1 -0
- package/node_modules/remote-pi/dist/extension_ui_bridge.d.ts +26 -0
- package/node_modules/remote-pi/dist/extension_ui_bridge.js +341 -0
- package/node_modules/remote-pi/dist/extension_ui_bridge.js.map +1 -0
- package/node_modules/remote-pi/dist/index.d.ts +213 -0
- package/node_modules/remote-pi/dist/index.js +4996 -0
- package/node_modules/remote-pi/dist/index.js.map +1 -0
- package/node_modules/remote-pi/dist/mcp/mesh_result.d.ts +10 -0
- package/node_modules/remote-pi/dist/mcp/mesh_result.js +42 -0
- package/node_modules/remote-pi/dist/mcp/mesh_result.js.map +1 -0
- package/node_modules/remote-pi/dist/mcp/mesh_server.d.ts +16 -0
- package/node_modules/remote-pi/dist/mcp/mesh_server.js +327 -0
- package/node_modules/remote-pi/dist/mcp/mesh_server.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/canonical.d.ts +30 -0
- package/node_modules/remote-pi/dist/mesh/canonical.js +61 -0
- package/node_modules/remote-pi/dist/mesh/canonical.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/client.d.ts +18 -0
- package/node_modules/remote-pi/dist/mesh/client.js +125 -0
- package/node_modules/remote-pi/dist/mesh/client.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/encoding.d.ts +38 -0
- package/node_modules/remote-pi/dist/mesh/encoding.js +216 -0
- package/node_modules/remote-pi/dist/mesh/encoding.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/self_revoke.d.ts +73 -0
- package/node_modules/remote-pi/dist/mesh/self_revoke.js +401 -0
- package/node_modules/remote-pi/dist/mesh/self_revoke.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/siblings.d.ts +49 -0
- package/node_modules/remote-pi/dist/mesh/siblings.js +159 -0
- package/node_modules/remote-pi/dist/mesh/siblings.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/types.d.ts +34 -0
- package/node_modules/remote-pi/dist/mesh/types.js +11 -0
- package/node_modules/remote-pi/dist/mesh/types.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/verify.d.ts +17 -0
- package/node_modules/remote-pi/dist/mesh/verify.js +86 -0
- package/node_modules/remote-pi/dist/mesh/verify.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/crypto.d.ts +8 -0
- package/node_modules/remote-pi/dist/pairing/crypto.js +22 -0
- package/node_modules/remote-pi/dist/pairing/crypto.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/handshake.d.ts +28 -0
- package/node_modules/remote-pi/dist/pairing/handshake.js +113 -0
- package/node_modules/remote-pi/dist/pairing/handshake.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/noise-sha256.d.ts +16 -0
- package/node_modules/remote-pi/dist/pairing/noise-sha256.js +103 -0
- package/node_modules/remote-pi/dist/pairing/noise-sha256.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/qr.d.ts +59 -0
- package/node_modules/remote-pi/dist/pairing/qr.js +125 -0
- package/node_modules/remote-pi/dist/pairing/qr.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/storage.d.ts +120 -0
- package/node_modules/remote-pi/dist/pairing/storage.js +604 -0
- package/node_modules/remote-pi/dist/pairing/storage.js.map +1 -0
- package/node_modules/remote-pi/dist/protocol/codec.d.ts +7 -0
- package/node_modules/remote-pi/dist/protocol/codec.js +49 -0
- package/node_modules/remote-pi/dist/protocol/codec.js.map +1 -0
- package/node_modules/remote-pi/dist/protocol/types.d.ts +393 -0
- package/node_modules/remote-pi/dist/protocol/types.js +2 -0
- package/node_modules/remote-pi/dist/protocol/types.js.map +1 -0
- package/node_modules/remote-pi/dist/rooms.d.ts +29 -0
- package/node_modules/remote-pi/dist/rooms.js +57 -0
- package/node_modules/remote-pi/dist/rooms.js.map +1 -0
- package/node_modules/remote-pi/dist/session/address.d.ts +49 -0
- package/node_modules/remote-pi/dist/session/address.js +58 -0
- package/node_modules/remote-pi/dist/session/address.js.map +1 -0
- package/node_modules/remote-pi/dist/session/agent_bridge.d.ts +55 -0
- package/node_modules/remote-pi/dist/session/agent_bridge.js +146 -0
- package/node_modules/remote-pi/dist/session/agent_bridge.js.map +1 -0
- package/node_modules/remote-pi/dist/session/bridge.d.ts +37 -0
- package/node_modules/remote-pi/dist/session/bridge.js +130 -0
- package/node_modules/remote-pi/dist/session/bridge.js.map +1 -0
- package/node_modules/remote-pi/dist/session/broker.d.ts +189 -0
- package/node_modules/remote-pi/dist/session/broker.js +507 -0
- package/node_modules/remote-pi/dist/session/broker.js.map +1 -0
- package/node_modules/remote-pi/dist/session/broker_remote.d.ts +74 -0
- package/node_modules/remote-pi/dist/session/broker_remote.js +583 -0
- package/node_modules/remote-pi/dist/session/broker_remote.js.map +1 -0
- package/node_modules/remote-pi/dist/session/cwd_lock.d.ts +33 -0
- package/node_modules/remote-pi/dist/session/cwd_lock.js +126 -0
- package/node_modules/remote-pi/dist/session/cwd_lock.js.map +1 -0
- package/node_modules/remote-pi/dist/session/envelope.d.ts +33 -0
- package/node_modules/remote-pi/dist/session/envelope.js +117 -0
- package/node_modules/remote-pi/dist/session/envelope.js.map +1 -0
- package/node_modules/remote-pi/dist/session/global_config.d.ts +33 -0
- package/node_modules/remote-pi/dist/session/global_config.js +73 -0
- package/node_modules/remote-pi/dist/session/global_config.js.map +1 -0
- package/node_modules/remote-pi/dist/session/ipc.d.ts +27 -0
- package/node_modules/remote-pi/dist/session/ipc.js +22 -0
- package/node_modules/remote-pi/dist/session/ipc.js.map +1 -0
- package/node_modules/remote-pi/dist/session/leader_election.d.ts +32 -0
- package/node_modules/remote-pi/dist/session/leader_election.js +106 -0
- package/node_modules/remote-pi/dist/session/leader_election.js.map +1 -0
- package/node_modules/remote-pi/dist/session/local_config.d.ts +55 -0
- package/node_modules/remote-pi/dist/session/local_config.js +157 -0
- package/node_modules/remote-pi/dist/session/local_config.js.map +1 -0
- package/node_modules/remote-pi/dist/session/mesh_message.d.ts +20 -0
- package/node_modules/remote-pi/dist/session/mesh_message.js +28 -0
- package/node_modules/remote-pi/dist/session/mesh_message.js.map +1 -0
- package/node_modules/remote-pi/dist/session/mesh_node.d.ts +116 -0
- package/node_modules/remote-pi/dist/session/mesh_node.js +573 -0
- package/node_modules/remote-pi/dist/session/mesh_node.js.map +1 -0
- package/node_modules/remote-pi/dist/session/peer.d.ts +139 -0
- package/node_modules/remote-pi/dist/session/peer.js +451 -0
- package/node_modules/remote-pi/dist/session/peer.js.map +1 -0
- package/node_modules/remote-pi/dist/session/peer_inventory.d.ts +13 -0
- package/node_modules/remote-pi/dist/session/peer_inventory.js +48 -0
- package/node_modules/remote-pi/dist/session/peer_inventory.js.map +1 -0
- package/node_modules/remote-pi/dist/session/peer_limits.d.ts +9 -0
- package/node_modules/remote-pi/dist/session/peer_limits.js +21 -0
- package/node_modules/remote-pi/dist/session/peer_limits.js.map +1 -0
- package/node_modules/remote-pi/dist/session/setup_wizard.d.ts +39 -0
- package/node_modules/remote-pi/dist/session/setup_wizard.js +63 -0
- package/node_modules/remote-pi/dist/session/setup_wizard.js.map +1 -0
- package/node_modules/remote-pi/dist/session/tool_gate.d.ts +5 -0
- package/node_modules/remote-pi/dist/session/tool_gate.js +11 -0
- package/node_modules/remote-pi/dist/session/tool_gate.js.map +1 -0
- package/node_modules/remote-pi/dist/session/tools.d.ts +24 -0
- package/node_modules/remote-pi/dist/session/tools.js +252 -0
- package/node_modules/remote-pi/dist/session/tools.js.map +1 -0
- package/node_modules/remote-pi/dist/session/wizard.d.ts +13 -0
- package/node_modules/remote-pi/dist/session/wizard.js +20 -0
- package/node_modules/remote-pi/dist/session/wizard.js.map +1 -0
- package/node_modules/remote-pi/dist/settings.d.ts +15 -0
- package/node_modules/remote-pi/dist/settings.js +52 -0
- package/node_modules/remote-pi/dist/settings.js.map +1 -0
- package/node_modules/remote-pi/dist/transport/peer_channel.d.ts +37 -0
- package/node_modules/remote-pi/dist/transport/peer_channel.js +98 -0
- package/node_modules/remote-pi/dist/transport/peer_channel.js.map +1 -0
- package/node_modules/remote-pi/dist/transport/pi_forward_client.d.ts +29 -0
- package/node_modules/remote-pi/dist/transport/pi_forward_client.js +62 -0
- package/node_modules/remote-pi/dist/transport/pi_forward_client.js.map +1 -0
- package/node_modules/remote-pi/dist/transport/relay_client.d.ts +91 -0
- package/node_modules/remote-pi/dist/transport/relay_client.js +206 -0
- package/node_modules/remote-pi/dist/transport/relay_client.js.map +1 -0
- package/node_modules/remote-pi/dist/ui/footer.d.ts +32 -0
- package/node_modules/remote-pi/dist/ui/footer.js +34 -0
- package/node_modules/remote-pi/dist/ui/footer.js.map +1 -0
- package/node_modules/remote-pi/docs/daemon.md +289 -0
- package/node_modules/remote-pi/package.json +88 -0
- package/node_modules/remote-pi/service-templates/launchd.plist.template +35 -0
- package/node_modules/remote-pi/service-templates/systemd.service.template +19 -0
- package/node_modules/remote-pi/service-templates/task-launcher.vbs.template +10 -0
- package/node_modules/remote-pi/service-templates/task-scheduler.xml.template +38 -0
- package/node_modules/remote-pi/skills/agent-network/SKILL.md +310 -0
- package/package.json +37 -12
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool-diff/write-display-utils.ts +0 -29
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{session-reference-core.ts → reference/session.ts} +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{pi-aliases.ts → shell/aliases.ts} +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/ATTRIBUTION.md +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/diff-presentation.ts +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/index.ts +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/render-utils.ts +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/shiki-highlight.ts +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/types.ts +0 -0
|
@@ -5,6 +5,7 @@ import { dirname, join, resolve } from "node:path";
|
|
|
5
5
|
import { parse as parseToml } from "smol-toml";
|
|
6
6
|
import stripJsonComments from "strip-json-comments";
|
|
7
7
|
import { getAgentPath } from "./agent-dir.ts";
|
|
8
|
+
import { getAgentPluginSummaries, loadAgentPluginConfigs, type AgentPluginSummary } from "./agent-plugin-loader.ts";
|
|
8
9
|
import { isServerDisabled, type HostConfigDiscovery, type McpConfig, type ServerEntry, type McpSettings, type ImportKind, type ServerProvenance } from "./types.ts";
|
|
9
10
|
import { toStringRecord } from "./utils.ts";
|
|
10
11
|
|
|
@@ -32,31 +33,31 @@ export const KNOWN_SERVER_PRESETS: readonly KnownServerPreset[] = [
|
|
|
32
33
|
id: "deepwiki",
|
|
33
34
|
name: "DeepWiki",
|
|
34
35
|
summary: "Ask questions about public GitHub repositories.",
|
|
35
|
-
entry: { url: "https://mcp.deepwiki.com/mcp" },
|
|
36
|
+
entry: { url: "https://mcp.deepwiki.com/mcp", protocolVersion: "auto" },
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
id: "context7",
|
|
39
40
|
name: "Context7",
|
|
40
41
|
summary: "Look up current library documentation and examples.",
|
|
41
|
-
entry: { url: "https://mcp.context7.com/mcp" },
|
|
42
|
+
entry: { url: "https://mcp.context7.com/mcp", protocolVersion: "auto" },
|
|
42
43
|
},
|
|
43
44
|
{
|
|
44
45
|
id: "notion",
|
|
45
46
|
name: "Notion",
|
|
46
47
|
summary: "Search and work with your Notion workspace.",
|
|
47
|
-
entry: { url: "https://mcp.notion.com/mcp", auth: "oauth" },
|
|
48
|
+
entry: { url: "https://mcp.notion.com/mcp", auth: "oauth", protocolVersion: "auto" },
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
51
|
id: "github",
|
|
51
52
|
name: "GitHub",
|
|
52
53
|
summary: "Work with GitHub through your Copilot account.",
|
|
53
|
-
entry: { url: "https://api.githubcopilot.com/mcp", auth: "oauth" },
|
|
54
|
+
entry: { url: "https://api.githubcopilot.com/mcp", auth: "oauth", protocolVersion: "auto" },
|
|
54
55
|
},
|
|
55
56
|
{
|
|
56
57
|
id: "chrome-devtools",
|
|
57
58
|
name: "Chrome DevTools",
|
|
58
59
|
summary: "Inspect and automate a local Chrome browser.",
|
|
59
|
-
entry: { command: "npx", args: ["-y", "chrome-devtools-mcp@
|
|
60
|
+
entry: { command: "npx", args: ["-y", "chrome-devtools-mcp@1.6.0"] },
|
|
60
61
|
},
|
|
61
62
|
];
|
|
62
63
|
|
|
@@ -137,6 +138,7 @@ export interface McpDiscoverySummary {
|
|
|
137
138
|
imports: ImportConfigSummary[];
|
|
138
139
|
hostConfigs: HostConfigSummary[];
|
|
139
140
|
hostConfigDiscovery: HostConfigDiscovery;
|
|
141
|
+
agentPlugins: AgentPluginSummary[];
|
|
140
142
|
conflicts: McpConfigConflict[];
|
|
141
143
|
hasAnyConfig: boolean;
|
|
142
144
|
hasAnyDetectedPaths: boolean;
|
|
@@ -147,6 +149,12 @@ export interface McpDiscoverySummary {
|
|
|
147
149
|
repoPrompt: RepoPromptDiscovery;
|
|
148
150
|
}
|
|
149
151
|
|
|
152
|
+
export interface McpStandardConfigSummary {
|
|
153
|
+
sources: ConfigDiscoverySource[];
|
|
154
|
+
hasSharedServers: boolean;
|
|
155
|
+
fingerprint: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
150
158
|
export interface ConfigWritePreview {
|
|
151
159
|
path: string;
|
|
152
160
|
existed: boolean;
|
|
@@ -193,9 +201,8 @@ export function findAvailableImportConfigs(cwd = process.cwd()): DiscoveredImpor
|
|
|
193
201
|
return discovered;
|
|
194
202
|
}
|
|
195
203
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const sources = sourceSpecs.map((source) => {
|
|
204
|
+
function getConfigSourceSummaries(sourceSpecs: ConfigSourceSpec[]): ConfigDiscoverySource[] {
|
|
205
|
+
return sourceSpecs.map((source) => {
|
|
199
206
|
const loaded = readValidatedConfig(source.readPath, `MCP config from ${source.readPath}`);
|
|
200
207
|
return {
|
|
201
208
|
id: source.id,
|
|
@@ -207,24 +214,47 @@ export function getMcpDiscoverySummary(overridePath?: string, cwd = process.cwd(
|
|
|
207
214
|
serverCount: loaded ? Object.keys(loaded.mcpServers).length : 0,
|
|
208
215
|
} satisfies ConfigDiscoverySource;
|
|
209
216
|
});
|
|
217
|
+
}
|
|
210
218
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
export function getMcpStandardConfigSummary(overridePath?: string, cwd = process.cwd()): McpStandardConfigSummary {
|
|
220
|
+
const sources = getConfigSourceSummaries(getConfigSources(overridePath, cwd));
|
|
221
|
+
return {
|
|
222
|
+
sources,
|
|
223
|
+
hasSharedServers: sources.some((source) => source.kind === "shared" && source.serverCount > 0),
|
|
224
|
+
fingerprint: JSON.stringify({ sources: sources.map((source) => [source.id, source.exists, source.serverCount]) }),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function getMcpDiscoverySummary(
|
|
229
|
+
overridePath?: string,
|
|
230
|
+
cwd = process.cwd(),
|
|
231
|
+
options: { includeHostConfigs?: boolean } = {},
|
|
232
|
+
): McpDiscoverySummary {
|
|
233
|
+
const sourceSpecs = getConfigSources(overridePath, cwd);
|
|
234
|
+
const sources = getConfigSourceSummaries(sourceSpecs);
|
|
235
|
+
const includeHostConfigs = options.includeHostConfigs !== false;
|
|
236
|
+
|
|
237
|
+
const imports = includeHostConfigs
|
|
238
|
+
? (Object.keys(IMPORT_PATHS) as ImportKind[])
|
|
239
|
+
.map((kind) => {
|
|
240
|
+
const imported = loadImportedConfig(kind, cwd, `Failed to inspect imported MCP config from ${kind}:`);
|
|
241
|
+
if (!imported) return null;
|
|
242
|
+
return {
|
|
243
|
+
kind,
|
|
244
|
+
path: imported.path,
|
|
245
|
+
serverCount: Object.keys(extractServers(imported.value, kind)).length,
|
|
246
|
+
} satisfies ImportConfigSummary;
|
|
247
|
+
})
|
|
248
|
+
.filter((value): value is ImportConfigSummary => value !== null)
|
|
249
|
+
: [];
|
|
222
250
|
const hostConfigDiscovery = getConfiguredHostConfigDiscovery(overridePath, cwd);
|
|
223
251
|
const hostConfigs = imports.map((entry) => ({ ...entry, active: hostConfigDiscovery === "on" }));
|
|
224
|
-
const
|
|
225
|
-
const
|
|
252
|
+
const settings = getMergedSettings(overridePath, cwd);
|
|
253
|
+
const agentPlugins = getAgentPluginSummaries(settings?.agentPluginPaths, cwd);
|
|
254
|
+
const totalServerCount = sources.reduce((sum, source) => sum + source.serverCount, 0) + agentPlugins.reduce((sum, plugin) => sum + plugin.serverCount, 0);
|
|
255
|
+
const hasSharedServers = sources.some((source) => source.kind === "shared" && source.serverCount > 0) || agentPlugins.some(plugin => plugin.serverCount > 0);
|
|
226
256
|
const hasPiOwnedServers = sources.some((source) => source.kind === "pi" && source.serverCount > 0);
|
|
227
|
-
const hasAnyDetectedPaths = sources.some((source) => source.exists) || imports.length > 0;
|
|
257
|
+
const hasAnyDetectedPaths = sources.some((source) => source.exists) || imports.length > 0 || agentPlugins.length > 0;
|
|
228
258
|
const hasAnyConfig = totalServerCount > 0 || imports.some((entry) => entry.serverCount > 0) || hasAnyDetectedPaths;
|
|
229
259
|
|
|
230
260
|
const summaryWithoutRepoPrompt = {
|
|
@@ -232,6 +262,7 @@ export function getMcpDiscoverySummary(overridePath?: string, cwd = process.cwd(
|
|
|
232
262
|
imports,
|
|
233
263
|
hostConfigs,
|
|
234
264
|
hostConfigDiscovery,
|
|
265
|
+
agentPlugins,
|
|
235
266
|
conflicts: getConfigConflicts(sourceSpecs, imports, cwd),
|
|
236
267
|
hasAnyConfig,
|
|
237
268
|
hasAnyDetectedPaths,
|
|
@@ -243,6 +274,7 @@ export function getMcpDiscoverySummary(overridePath?: string, cwd = process.cwd(
|
|
|
243
274
|
const fingerprint = JSON.stringify({
|
|
244
275
|
sources: sources.map((source) => [source.id, source.exists, source.serverCount]),
|
|
245
276
|
imports: imports.map((entry) => [entry.kind, entry.path, entry.serverCount]),
|
|
277
|
+
agentPlugins: agentPlugins.map((entry) => [entry.path, entry.name, entry.serverCount]),
|
|
246
278
|
hostConfigDiscovery,
|
|
247
279
|
conflicts: summaryWithoutRepoPrompt.conflicts,
|
|
248
280
|
});
|
|
@@ -274,16 +306,24 @@ export function loadMcpConfig(overridePath?: string, cwd = process.cwd()): McpCo
|
|
|
274
306
|
config = mergeConfigs(config, expandImports(loaded, cwd));
|
|
275
307
|
}
|
|
276
308
|
|
|
277
|
-
|
|
309
|
+
const pluginConfig = loadAgentPluginConfigs(config.settings?.agentPluginPaths, cwd);
|
|
310
|
+
return mergeConfigs(pluginConfig, config);
|
|
278
311
|
}
|
|
279
312
|
|
|
280
|
-
function
|
|
281
|
-
let
|
|
313
|
+
function getMergedSettings(overridePath?: string, cwd = process.cwd()): McpSettings | undefined {
|
|
314
|
+
let settings: McpSettings | undefined;
|
|
282
315
|
for (const source of getConfigSources(overridePath, cwd)) {
|
|
283
316
|
const loaded = readValidatedConfig(source.readPath, `MCP config from ${source.readPath}`);
|
|
284
|
-
|
|
285
|
-
if (value === "off" || value === "prompt" || value === "on") configured = value;
|
|
317
|
+
if (loaded?.settings) settings = { ...settings, ...loaded.settings };
|
|
286
318
|
}
|
|
319
|
+
return settings;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function getConfiguredHostConfigDiscovery(overridePath?: string, cwd = process.cwd()): HostConfigDiscovery {
|
|
323
|
+
let configured: HostConfigDiscovery = "off";
|
|
324
|
+
const settings = getMergedSettings(overridePath, cwd);
|
|
325
|
+
const value = settings?.hostConfigDiscovery;
|
|
326
|
+
if (value === "off" || value === "prompt" || value === "on") configured = value;
|
|
287
327
|
return configured;
|
|
288
328
|
}
|
|
289
329
|
|
|
@@ -417,10 +457,12 @@ function getConfigSources(overridePath?: string, cwd = process.cwd()): ConfigSou
|
|
|
417
457
|
}
|
|
418
458
|
|
|
419
459
|
function mergeConfigs(base: McpConfig, next: McpConfig): McpConfig {
|
|
460
|
+
const imports = mergeImports(base.imports, next.imports);
|
|
461
|
+
const settings = next.settings ? { ...base.settings, ...next.settings } : base.settings;
|
|
420
462
|
return {
|
|
421
463
|
mcpServers: mergeServerMaps(base.mcpServers, next.mcpServers),
|
|
422
|
-
imports
|
|
423
|
-
settings
|
|
464
|
+
...(imports !== undefined ? { imports } : {}),
|
|
465
|
+
...(settings !== undefined ? { settings } : {}),
|
|
424
466
|
};
|
|
425
467
|
}
|
|
426
468
|
|
|
@@ -499,7 +541,7 @@ function expandImports(config: McpConfig, cwd = process.cwd()): McpConfig {
|
|
|
499
541
|
|
|
500
542
|
return {
|
|
501
543
|
imports: config.imports,
|
|
502
|
-
settings: config.settings,
|
|
544
|
+
...(config.settings !== undefined ? { settings: config.settings } : {}),
|
|
503
545
|
mcpServers: mergeServerMaps(importedServers, config.mcpServers),
|
|
504
546
|
};
|
|
505
547
|
}
|
|
@@ -596,22 +638,32 @@ function readValidatedConfig(path: string, label: string): McpConfig | null {
|
|
|
596
638
|
}
|
|
597
639
|
|
|
598
640
|
function validateConfig(raw: unknown): McpConfig {
|
|
599
|
-
if (!raw
|
|
641
|
+
if (!isRecord(raw)) {
|
|
600
642
|
return { mcpServers: {} };
|
|
601
643
|
}
|
|
602
644
|
|
|
603
|
-
|
|
604
|
-
|
|
645
|
+
return {
|
|
646
|
+
mcpServers: toServerEntries(raw.mcpServers ?? raw["mcp-servers"]),
|
|
647
|
+
...(Array.isArray(raw.imports) ? { imports: raw.imports as ImportKind[] } : {}),
|
|
648
|
+
...(raw.settings !== undefined ? { settings: raw.settings as McpSettings } : {}),
|
|
649
|
+
};
|
|
650
|
+
}
|
|
605
651
|
|
|
606
|
-
|
|
607
|
-
|
|
652
|
+
function toServerEntries(servers: unknown): Record<string, ServerEntry> {
|
|
653
|
+
if (!isRecord(servers)) return {};
|
|
654
|
+
const entries: Record<string, ServerEntry> = {};
|
|
655
|
+
for (const [name, entry] of Object.entries(servers)) {
|
|
656
|
+
if (isServerEntry(entry)) entries[name] = entry;
|
|
608
657
|
}
|
|
658
|
+
return entries;
|
|
659
|
+
}
|
|
609
660
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
661
|
+
function isServerEntry(value: unknown): value is ServerEntry {
|
|
662
|
+
return isRecord(value);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
666
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
615
667
|
}
|
|
616
668
|
|
|
617
669
|
function mergeOpenCodeConfigs(base: Record<string, unknown>, next: Record<string, unknown>): Record<string, unknown> {
|
|
@@ -708,8 +760,10 @@ function extractServers(config: unknown, kind: ImportKind): Record<string, Serve
|
|
|
708
760
|
|
|
709
761
|
if (raw.type === "local" && Array.isArray(raw.command) && raw.command.length > 0 && raw.command.every((value): value is string => typeof value === "string")) {
|
|
710
762
|
const env = toStringRecord(raw.environment);
|
|
763
|
+
const command = raw.command[0];
|
|
764
|
+
if (command === undefined) continue;
|
|
711
765
|
const mapped: ServerEntry = {
|
|
712
|
-
command
|
|
766
|
+
command,
|
|
713
767
|
args: raw.command.slice(1),
|
|
714
768
|
...(env ? { env } : {}),
|
|
715
769
|
...(typeof raw.cwd === "string" ? { cwd: raw.cwd } : {}),
|
|
@@ -733,6 +787,9 @@ function extractServers(config: unknown, kind: ImportKind): Record<string, Serve
|
|
|
733
787
|
...(typeof oauth.clientId === "string" ? { clientId: oauth.clientId } : {}),
|
|
734
788
|
...(typeof oauth.clientSecret === "string" ? { clientSecret: oauth.clientSecret } : {}),
|
|
735
789
|
...(typeof oauth.scope === "string" ? { scope: oauth.scope } : {}),
|
|
790
|
+
...(typeof oauth.skipIssuerMetadataValidation === "boolean"
|
|
791
|
+
? { skipIssuerMetadataValidation: oauth.skipIssuerMetadataValidation }
|
|
792
|
+
: {}),
|
|
736
793
|
};
|
|
737
794
|
}
|
|
738
795
|
mappedServers[name] = mapped;
|
|
@@ -740,12 +797,13 @@ function extractServers(config: unknown, kind: ImportKind): Record<string, Serve
|
|
|
740
797
|
continue;
|
|
741
798
|
}
|
|
742
799
|
|
|
743
|
-
if (
|
|
744
|
-
|
|
800
|
+
if (!isRecord(entry)) continue;
|
|
801
|
+
if (kind !== "codex") {
|
|
802
|
+
mappedServers[name] = entry;
|
|
745
803
|
continue;
|
|
746
804
|
}
|
|
747
805
|
|
|
748
|
-
const mapped = { ...
|
|
806
|
+
const mapped = { ...entry };
|
|
749
807
|
const bearerTokenEnv = mapped.bearer_token_env_var;
|
|
750
808
|
const httpHeaders = mapped.http_headers;
|
|
751
809
|
const envHttpHeaders = mapped.env_http_headers;
|
|
@@ -789,9 +847,12 @@ function buildUnifiedDiff(beforeText: string, afterText: string): string {
|
|
|
789
847
|
|
|
790
848
|
for (let i = rows - 1; i >= 0; i--) {
|
|
791
849
|
for (let j = cols - 1; j >= 0; j--) {
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
850
|
+
const row = lcs[i];
|
|
851
|
+
const nextRow = lcs[i + 1];
|
|
852
|
+
if (!row || !nextRow) continue;
|
|
853
|
+
row[j] = before[i] === after[j]
|
|
854
|
+
? (nextRow[j + 1] ?? 0) + 1
|
|
855
|
+
: Math.max(nextRow[j] ?? 0, row[j + 1] ?? 0);
|
|
795
856
|
}
|
|
796
857
|
}
|
|
797
858
|
|
|
@@ -805,7 +866,7 @@ function buildUnifiedDiff(beforeText: string, afterText: string): string {
|
|
|
805
866
|
j++;
|
|
806
867
|
continue;
|
|
807
868
|
}
|
|
808
|
-
if (j < cols && (i === rows || lcs[i][j + 1] >= lcs[i + 1][j])) {
|
|
869
|
+
if (j < cols && (i === rows || (lcs[i]?.[j + 1] ?? 0) >= (lcs[i + 1]?.[j] ?? 0))) {
|
|
809
870
|
lines.push(`+ ${after[j]}`);
|
|
810
871
|
j++;
|
|
811
872
|
continue;
|
|
@@ -1108,7 +1169,7 @@ export function getServerProvenance(overridePath?: string, cwd = process.cwd()):
|
|
|
1108
1169
|
provenance.set(name, {
|
|
1109
1170
|
path: source.writePath,
|
|
1110
1171
|
kind: source.kind,
|
|
1111
|
-
importKind: source.importKind,
|
|
1172
|
+
...(source.importKind !== undefined ? { importKind: source.importKind } : {}),
|
|
1112
1173
|
});
|
|
1113
1174
|
}
|
|
1114
1175
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentToolResult, AgentToolUpdateCallback, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { UrlElicitationRequiredError } from "@modelcontextprotocol/
|
|
2
|
+
import { UrlElicitationRequiredError, type Client } from "@modelcontextprotocol/client";
|
|
3
3
|
import type { McpExtensionState } from "./state.ts";
|
|
4
4
|
import type { DirectToolSpec, McpConfig, McpContent, ToolPrefix } from "./types.ts";
|
|
5
5
|
import type { MetadataCache } from "./metadata-cache.ts";
|
|
@@ -8,7 +8,7 @@ import { abortable, throwIfAborted } from "./abort.ts";
|
|
|
8
8
|
import { isServerCacheValid, parseDirectToolSelectors } from "./metadata-cache.ts";
|
|
9
9
|
export { getMissingConfiguredDirectToolServers } from "./metadata-cache.ts";
|
|
10
10
|
import { formatSchema } from "./tool-metadata.ts";
|
|
11
|
-
import { resolveMcpResultContent, transformMcpContent } from "./tool-registrar.ts";
|
|
11
|
+
import { resolveMcpResultContent, transformMcpContent, transformMcpResourceContents } from "./tool-registrar.ts";
|
|
12
12
|
import { guardMcpOutput, guardedMcpDetails, resolveMcpOutputGuardOptions } from "./mcp-output-guard.ts";
|
|
13
13
|
import { maybeStartUiSession, summarizeUiSessionResult, type UiSessionRuntime } from "./ui-session.ts";
|
|
14
14
|
import { formatToolName, isServerDisabled, isToolAllowed, resolveToolPrefix } from "./types.ts";
|
|
@@ -19,6 +19,9 @@ import { SessionRecoveryAuthRequiredError, withSessionRecovery } from "./session
|
|
|
19
19
|
import { combineAbortSignals, isAbortError } from "./runtime-owner.ts";
|
|
20
20
|
import { ensureToolCallApproved } from "./tool-approval.ts";
|
|
21
21
|
|
|
22
|
+
type ClientCallToolResult = Awaited<ReturnType<Client["callTool"]>>;
|
|
23
|
+
type ClientReadResourceResult = Awaited<ReturnType<Client["readResource"]>>;
|
|
24
|
+
|
|
22
25
|
const BUILTIN_NAMES = new Set(["read", "bash", "edit", "write", "grep", "find", "ls", "mcp"]);
|
|
23
26
|
const INSTRUCTIONS_SNIPPET_LENGTH = 150;
|
|
24
27
|
export const DIRECT_TOOLS_ADVISORY_THRESHOLD = 75;
|
|
@@ -92,7 +95,10 @@ async function attemptDirectAutoAuth(
|
|
|
92
95
|
: { authStorageOptions: state.authStorageOptions, runtime: state.oauthRuntime },
|
|
93
96
|
);
|
|
94
97
|
} else {
|
|
95
|
-
await authenticate(serverName, serverUrl, definition, {
|
|
98
|
+
await authenticate(serverName, serverUrl, definition, {
|
|
99
|
+
...(signal ? { signal } : {}),
|
|
100
|
+
runtime: state.oauthRuntime,
|
|
101
|
+
});
|
|
96
102
|
}
|
|
97
103
|
return { status: "success" };
|
|
98
104
|
} catch (error) {
|
|
@@ -162,9 +168,9 @@ export function resolveDirectTools(
|
|
|
162
168
|
originalName: tool.name,
|
|
163
169
|
prefixedName,
|
|
164
170
|
description: tool.description ?? "",
|
|
165
|
-
inputSchema: tool.inputSchema,
|
|
166
|
-
uiResourceUri: tool.uiResourceUri,
|
|
167
|
-
uiStreamMode: tool.uiStreamMode,
|
|
171
|
+
...(tool.inputSchema !== undefined ? { inputSchema: tool.inputSchema } : {}),
|
|
172
|
+
...(tool.uiResourceUri !== undefined ? { uiResourceUri: tool.uiResourceUri } : {}),
|
|
173
|
+
...(tool.uiStreamMode !== undefined ? { uiStreamMode: tool.uiStreamMode } : {}),
|
|
168
174
|
});
|
|
169
175
|
}
|
|
170
176
|
|
|
@@ -207,7 +213,7 @@ export function buildProxyDescription(
|
|
|
207
213
|
directSpecs: DirectToolSpec[],
|
|
208
214
|
): string {
|
|
209
215
|
const prefix = config.settings?.toolPrefix ?? "server";
|
|
210
|
-
let desc = `MCP gateway — server status, tool search/describe, auth, and single MCP tool calls. When one request needs several MCP calls with logic between them, use
|
|
216
|
+
let desc = `MCP gateway — server status, tool search/describe, auth, and single MCP tool calls. When one request needs several MCP calls with logic between them, use mcpScript. Non-MCP Pi tools should be called directly, not through mcp.\n`;
|
|
211
217
|
|
|
212
218
|
const directByServer = new Map<string, number>();
|
|
213
219
|
for (const spec of directSpecs) {
|
|
@@ -223,7 +229,7 @@ export function buildProxyDescription(
|
|
|
223
229
|
const serverSummaries: string[] = [];
|
|
224
230
|
for (const serverName of Object.keys(config.mcpServers)) {
|
|
225
231
|
const definition = config.mcpServers[serverName];
|
|
226
|
-
if (isServerDisabled(definition)) continue;
|
|
232
|
+
if (!definition || isServerDisabled(definition)) continue;
|
|
227
233
|
const entry = cache?.servers?.[serverName];
|
|
228
234
|
const effectivePrefix = resolveToolPrefix(definition, prefix);
|
|
229
235
|
const toolCount = (entry?.tools ?? []).filter(
|
|
@@ -377,11 +383,11 @@ export function createDirectToolExecutor(
|
|
|
377
383
|
name: spec.prefixedName,
|
|
378
384
|
originalName: spec.originalName,
|
|
379
385
|
description: spec.description,
|
|
380
|
-
inputSchema: spec.inputSchema,
|
|
381
|
-
resourceUri: spec.resourceUri,
|
|
382
|
-
uiResourceUri: spec.uiResourceUri,
|
|
383
|
-
uiStreamMode: spec.uiStreamMode,
|
|
384
|
-
}, params, ownedSignal);
|
|
386
|
+
...(spec.inputSchema !== undefined ? { inputSchema: spec.inputSchema } : {}),
|
|
387
|
+
...(spec.resourceUri !== undefined ? { resourceUri: spec.resourceUri } : {}),
|
|
388
|
+
...(spec.uiResourceUri !== undefined ? { uiResourceUri: spec.uiResourceUri } : {}),
|
|
389
|
+
...(spec.uiStreamMode !== undefined ? { uiStreamMode: spec.uiStreamMode } : {}),
|
|
390
|
+
}, params, ownedSignal, spec.resourceUri ? "resource" : "direct");
|
|
385
391
|
if (approval.ok === false) {
|
|
386
392
|
const denied = approval.reason === "denied";
|
|
387
393
|
const message = denied
|
|
@@ -430,15 +436,17 @@ export function createDirectToolExecutor(
|
|
|
430
436
|
state.manager.incrementInFlight(spec.serverName);
|
|
431
437
|
|
|
432
438
|
if (spec.resourceUri) {
|
|
433
|
-
const result = await withSessionRecovery(
|
|
434
|
-
{
|
|
439
|
+
const result = await withSessionRecovery<ClientReadResourceResult>(
|
|
440
|
+
{
|
|
441
|
+
manager: state.manager,
|
|
442
|
+
config: state.config,
|
|
443
|
+
...(ownedSignal ? { signal: ownedSignal } : {}),
|
|
444
|
+
onNeedsAuth: recoverAuthConnection,
|
|
445
|
+
},
|
|
435
446
|
spec.serverName,
|
|
436
447
|
(conn) => conn.client.readResource({ uri: spec.resourceUri! }, requestOptions),
|
|
437
448
|
);
|
|
438
|
-
const content = (result.contents ?? [])
|
|
439
|
-
type: "text" as const,
|
|
440
|
-
text: "text" in c ? c.text : ("blob" in c ? `[Binary data: ${(c as { mimeType?: string }).mimeType ?? "unknown"}]` : JSON.stringify(c)),
|
|
441
|
-
}));
|
|
449
|
+
const content = transformMcpResourceContents(result.contents ?? [], state.owner?.signal);
|
|
442
450
|
const guarded = await guardMcpOutput(content.length > 0 ? content : [{ type: "text" as const, text: "(empty resource)" }], outputGuardOptions);
|
|
443
451
|
return {
|
|
444
452
|
content: guarded.content,
|
|
@@ -453,26 +461,31 @@ export function createDirectToolExecutor(
|
|
|
453
461
|
toolName: spec.originalName,
|
|
454
462
|
toolArgs: params ?? {},
|
|
455
463
|
uiResourceUri: spec.uiResourceUri!,
|
|
456
|
-
streamMode: spec.uiStreamMode,
|
|
457
|
-
signal,
|
|
464
|
+
...(spec.uiStreamMode !== undefined ? { streamMode: spec.uiStreamMode } : {}),
|
|
465
|
+
...(signal ? { signal } : {}),
|
|
458
466
|
onNeedsAuth: recoverAuthConnection,
|
|
459
467
|
})
|
|
460
468
|
: null;
|
|
461
469
|
|
|
462
|
-
const result = await withSessionRecovery(
|
|
463
|
-
{
|
|
470
|
+
const result = await withSessionRecovery<ClientCallToolResult>(
|
|
471
|
+
{
|
|
472
|
+
manager: state.manager,
|
|
473
|
+
config: state.config,
|
|
474
|
+
...(ownedSignal ? { signal: ownedSignal } : {}),
|
|
475
|
+
onNeedsAuth: recoverAuthConnection,
|
|
476
|
+
},
|
|
464
477
|
spec.serverName,
|
|
465
478
|
(conn) => abortable(conn.client.callTool({
|
|
466
479
|
name: spec.originalName,
|
|
467
480
|
arguments: params ?? {},
|
|
468
481
|
_meta: uiSession?.requestMeta,
|
|
469
|
-
},
|
|
482
|
+
}, requestOptions), ownedSignal),
|
|
470
483
|
);
|
|
471
|
-
uiSession?.sendToolResult(result as unknown as import("@modelcontextprotocol/
|
|
484
|
+
uiSession?.sendToolResult(result as unknown as import("@modelcontextprotocol/client").CallToolResult);
|
|
472
485
|
|
|
473
486
|
if (result.isError) {
|
|
474
487
|
const mcpContent = (result.content ?? []) as McpContent[];
|
|
475
|
-
const content = transformMcpContent(mcpContent);
|
|
488
|
+
const content = transformMcpContent(mcpContent, state.owner?.signal);
|
|
476
489
|
const outputContent = content.length > 0 ? content : [{ type: "text" as const, text: "(empty result)" }];
|
|
477
490
|
const schemaText = spec.inputSchema ? `\n\nExpected parameters:\n${formatSchema(spec.inputSchema)}` : "";
|
|
478
491
|
const guarded = await guardMcpOutput(outputContent, { ...outputGuardOptions, prefix: "Error: ", suffix: schemaText, emptyTextFallback: "Tool execution failed" });
|
|
@@ -482,7 +495,7 @@ export function createDirectToolExecutor(
|
|
|
482
495
|
};
|
|
483
496
|
}
|
|
484
497
|
|
|
485
|
-
const content = resolveMcpResultContent(result as Record<string, unknown
|
|
498
|
+
const content = resolveMcpResultContent(result as Record<string, unknown>, state.owner?.signal);
|
|
486
499
|
const outputContent = content.length > 0 ? content : [{ type: "text" as const, text: "(empty result)" }];
|
|
487
500
|
if (hasUi) {
|
|
488
501
|
const uiSummary = summarizeUiSessionResult(uiSession);
|