@ashx-j/lunr-dev 0.2.13-dev.8.1 → 0.2.16-dev.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/dist/builtin-extensions/ashxj-tui.d.ts +14 -0
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +37 -3
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts +1 -15
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +7 -21
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js +6 -2
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts +4 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +163 -169
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +46 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +109 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts +7 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js +211 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts +0 -5
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +0 -202
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +251 -94
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts +4 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.js +10 -3
- package/dist/builtin-extensions/pi-mcp-adapter/init.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js +2 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +38 -14
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/extract.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/extract.js +105 -54
- package/dist/builtin-extensions/pi-web-access/extract.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.js +82 -65
- package/dist/builtin-extensions/pi-web-access/gemini-search.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.js +2 -0
- package/dist/builtin-extensions/pi-web-access/github-extract.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +167 -77
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/lazy.d.ts +18 -0
- package/dist/builtin-extensions/pi-web-access/lazy.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/lazy.js +19 -0
- package/dist/builtin-extensions/pi-web-access/lazy.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts +6 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.js +17 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.js.map +1 -0
- package/dist/catalog/publication.json +12 -12
- package/dist/cli-runtime.d.ts +3 -0
- package/dist/cli-runtime.d.ts.map +1 -0
- package/dist/cli-runtime.js +73 -0
- package/dist/cli-runtime.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -53
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +56 -12
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +10 -5
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/host-static.d.ts.map +1 -1
- package/dist/core/extensions/host-static.js +34 -12
- package/dist/core/extensions/host-static.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -2
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +10 -64
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +2 -0
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/permissions.d.ts +0 -2
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +10 -18
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +0 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/timings.d.ts +2 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +17 -2
- package/dist/core/timings.js.map +1 -1
- package/dist/gateway/commands.d.ts +1 -1
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +1 -18
- package/dist/gateway/commands.js.map +1 -1
- package/dist/main.d.ts +2 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +57 -48
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +12 -21
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +120 -144
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +95 -84
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/node-runtime/agent-session-services-IFJMSX7Z.js +36 -0
- package/dist/node-runtime/benchmark-request-UC7PD3V3.js +57 -0
- package/dist/node-runtime/brave-UWDA3I22.js +143 -0
- package/dist/node-runtime/builtin-extensions-LYZ3BFWQ.js +28 -0
- package/dist/node-runtime/chunk-2QKLKMKC.js +173 -0
- package/dist/node-runtime/chunk-3GHXVUAK.js +21 -0
- package/dist/node-runtime/chunk-3RCWXWAY.js +466 -0
- package/dist/node-runtime/chunk-3WFAEVKS.js +115 -0
- package/dist/node-runtime/chunk-3X3KZKMI.js +49 -0
- package/dist/node-runtime/chunk-4HXHDDCF.js +16 -0
- package/dist/node-runtime/chunk-4TLO4PO2.js +3427 -0
- package/dist/node-runtime/chunk-4ZWGEEAS.js +69 -0
- package/dist/node-runtime/chunk-53YJI7JU.js +137 -0
- package/dist/node-runtime/chunk-5P7PZMRU.js +610 -0
- package/dist/node-runtime/chunk-7N3YHTYF.js +26 -0
- package/dist/node-runtime/chunk-7NBZ5P7I.js +24 -0
- package/dist/node-runtime/chunk-A2KQXUJD.js +105 -0
- package/dist/node-runtime/chunk-AD6VXAO7.js +342 -0
- package/dist/node-runtime/chunk-AHSTJBIB.js +64 -0
- package/dist/node-runtime/chunk-AJX357CL.js +20211 -0
- package/dist/node-runtime/chunk-ARC4KOTI.js +11178 -0
- package/dist/node-runtime/chunk-AUXVGBO4.js +19 -0
- package/dist/node-runtime/chunk-AY6CAJSL.js +30 -0
- package/dist/node-runtime/chunk-BHO7O6E5.js +296 -0
- package/dist/node-runtime/chunk-BI3DHYCN.js +8845 -0
- package/dist/node-runtime/chunk-BR7YDUKA.js +109 -0
- package/dist/node-runtime/chunk-BRJX2PRC.js +53 -0
- package/dist/node-runtime/chunk-C4O2RSQQ.js +37 -0
- package/dist/node-runtime/chunk-CCZJ3PYY.js +17 -0
- package/dist/node-runtime/chunk-CDFZEWPU.js +8388 -0
- package/dist/node-runtime/chunk-CGBXPL3E.js +1171 -0
- package/dist/node-runtime/chunk-CJECDQKP.js +19 -0
- package/dist/node-runtime/chunk-DAPBPCBP.js +53 -0
- package/dist/node-runtime/chunk-DDGMHUOW.js +305 -0
- package/dist/node-runtime/chunk-DMMTJQMQ.js +43 -0
- package/dist/node-runtime/chunk-DVGWF6A2.js +1180 -0
- package/dist/node-runtime/chunk-ECD5L7YI.js +1369 -0
- package/dist/node-runtime/chunk-EDBJNRSM.js +46 -0
- package/dist/node-runtime/chunk-F4VQFJI2.js +1269 -0
- package/dist/node-runtime/chunk-FVDOXRUD.js +96 -0
- package/dist/node-runtime/chunk-GZQHMEWL.js +126 -0
- package/dist/node-runtime/chunk-H2EOZYMP.js +57 -0
- package/dist/node-runtime/chunk-HQCKFM2O.js +56 -0
- package/dist/node-runtime/chunk-HYHJIRDW.js +19 -0
- package/dist/node-runtime/chunk-I6R76AG7.js +22 -0
- package/dist/node-runtime/chunk-IPA627GP.js +296 -0
- package/dist/node-runtime/chunk-JHYKXIMM.js +378 -0
- package/dist/node-runtime/chunk-KKSIVROT.js +88 -0
- package/dist/node-runtime/chunk-LZAW4ZX3.js +633 -0
- package/dist/node-runtime/chunk-M3LZLQW2.js +98 -0
- package/dist/node-runtime/chunk-MGWCVY6Y.js +47 -0
- package/dist/node-runtime/chunk-MJQDX3BA.js +72 -0
- package/dist/node-runtime/chunk-MKKH27PH.js +8956 -0
- package/dist/node-runtime/chunk-MX3GJNXJ.js +986 -0
- package/dist/node-runtime/chunk-N77MY65L.js +966 -0
- package/dist/node-runtime/chunk-NUIFPZWX.js +209 -0
- package/dist/node-runtime/chunk-OBMWP3I5.js +68 -0
- package/dist/node-runtime/chunk-OR4L3IB2.js +42 -0
- package/dist/node-runtime/chunk-PBC2Y6GS.js +903 -0
- package/dist/node-runtime/chunk-PCGNAY2O.js +1324 -0
- package/dist/node-runtime/chunk-PCIGF2XK.js +250 -0
- package/dist/node-runtime/chunk-PGAJ5MO5.js +7558 -0
- package/dist/node-runtime/chunk-PL6JKXWI.js +3622 -0
- package/dist/node-runtime/chunk-PVCDKGR6.js +55 -0
- package/dist/node-runtime/chunk-Q4Q6D4IY.js +364 -0
- package/dist/node-runtime/chunk-Q5ZU2VRT.js +83 -0
- package/dist/node-runtime/chunk-QFWG2RVL.js +5477 -0
- package/dist/node-runtime/chunk-QH42CDX3.js +9451 -0
- package/dist/node-runtime/chunk-RQ2Q5IYR.js +72 -0
- package/dist/node-runtime/chunk-RQ5DNUNG.js +429 -0
- package/dist/node-runtime/chunk-RRIZE6QQ.js +17 -0
- package/dist/node-runtime/chunk-SN6G4OU6.js +4753 -0
- package/dist/node-runtime/chunk-SWSN6HAB.js +53 -0
- package/dist/node-runtime/chunk-TQNSPERU.js +949 -0
- package/dist/node-runtime/chunk-VRB2IYGG.js +53 -0
- package/dist/node-runtime/chunk-VSELYKWU.js +772 -0
- package/dist/node-runtime/chunk-W3CVH5RX.js +62 -0
- package/dist/node-runtime/chunk-WJVFOIB5.js +24921 -0
- package/dist/node-runtime/chunk-WOVTOV5P.js +5653 -0
- package/dist/node-runtime/chunk-XBWPBZBN.js +125 -0
- package/dist/node-runtime/chunk-XTHQ7XR7.js +509 -0
- package/dist/node-runtime/chunk-YF63P5ZT.js +864 -0
- package/dist/node-runtime/chunk-YSKSB3BJ.js +295 -0
- package/dist/node-runtime/chunk-ZCHMJ34K.js +130 -0
- package/dist/node-runtime/chunk-ZKMFUD3Q.js +2834 -0
- package/dist/node-runtime/cli-runtime.js +81 -0
- package/dist/node-runtime/clipboard-OZ63BBC6.js +12 -0
- package/dist/node-runtime/clipboard-image-7QR6GXVA.js +13 -0
- package/dist/node-runtime/command-L3LAHDIH.js +13 -0
- package/dist/node-runtime/commands-RL5YBW5I.js +291 -0
- package/dist/node-runtime/config-FMEOZSWE.js +77 -0
- package/dist/node-runtime/curator-server-XCM43VEF.js +3816 -0
- package/dist/node-runtime/customize-XEXL2DGQ.js +12 -0
- package/dist/node-runtime/direct-tool-executor-JVDXTO7A.js +188 -0
- package/dist/node-runtime/exa-LL64QZR2.js +329 -0
- package/dist/node-runtime/export-html-KR26FOUZ.js +150 -0
- package/dist/node-runtime/extension-input-RV5N6APL.js +14 -0
- package/dist/node-runtime/extension-selector-CPD5LWDD.js +14 -0
- package/dist/node-runtime/extract-XLQSJN4V.js +17 -0
- package/dist/node-runtime/file-sync-HCOP2QVF.js +117 -0
- package/dist/node-runtime/gateway-X2TI5X7F.js +2484 -0
- package/dist/node-runtime/gemini-api-QE7ANVDZ.js +29 -0
- package/dist/node-runtime/gemini-search-U7SUMPQA.js +330 -0
- package/dist/node-runtime/gemini-url-context-PXWCBQHK.js +103 -0
- package/dist/node-runtime/gemini-web-MM446SEH.js +14 -0
- package/dist/node-runtime/github-extract-F64RZOEA.js +619 -0
- package/dist/node-runtime/goal-CZQ7FFQJ.js +1831 -0
- package/dist/node-runtime/index.js +859 -0
- package/dist/node-runtime/init-NJV2T55N.js +28 -0
- package/dist/node-runtime/install-cli-TH7IJJQQ.js +308 -0
- package/dist/node-runtime/interactive-mode-KOM35YF2.js +56 -0
- package/dist/node-runtime/interactive-view-U6OILKF3.js +249 -0
- package/dist/node-runtime/lsp-manager-3ASUSO4T.js +1104 -0
- package/dist/node-runtime/lunr-cron-YJ5UHYRD.js +268 -0
- package/dist/node-runtime/main.js +54 -0
- package/dist/node-runtime/mcp-auth-flow-QIXHW6QN.js +32 -0
- package/dist/node-runtime/mcp-panel-IIGMXQGP.js +501 -0
- package/dist/node-runtime/mcp-setup-panel-FEK7663I.js +355 -0
- package/dist/node-runtime/memory-cap-3S4XRLNP.js +20 -0
- package/dist/node-runtime/model-tiers-NJLHUEGK.js +20 -0
- package/dist/node-runtime/openai-search-B3MSNCQA.js +288 -0
- package/dist/node-runtime/package-manager-cli-TZZHJCVI.js +749 -0
- package/dist/node-runtime/parallel-AI2MNSCU.js +265 -0
- package/dist/node-runtime/parser-manager-TQHWYDH7.js +152 -0
- package/dist/node-runtime/pdf-extract-IPE6H4HP.js +57 -0
- package/dist/node-runtime/perplexity-QVJW3I35.js +12 -0
- package/dist/node-runtime/pi-intercom-EEMBGQID.js +2215 -0
- package/dist/node-runtime/pi-mcp-adapter-QFB37AVN.js +422 -0
- package/dist/node-runtime/pi-ollama-cloud-4VZRMULP.js +1440 -0
- package/dist/node-runtime/pi-prompt-template-model-4QT4LLXF.js +3946 -0
- package/dist/node-runtime/pi-subagents-7XJ4H53P.js +6023 -0
- package/dist/node-runtime/pi-web-access-DPGAVKOA.js +1864 -0
- package/dist/node-runtime/print-mode-VWIRFDAC.js +12 -0
- package/dist/node-runtime/proxy-modes-HEEFK4KC.js +685 -0
- package/dist/node-runtime/rpc-entry.js +62 -0
- package/dist/node-runtime/rpc-mode-SJNSOA4G.js +13 -0
- package/dist/node-runtime/runtime-bridges-PPHNBFWL.js +14 -0
- package/dist/node-runtime/session-manager-MQNBYACL.js +35 -0
- package/dist/node-runtime/session-selector-5AZLJS6U.js +14 -0
- package/dist/node-runtime/settings-manager-5LF2VQWC.js +21 -0
- package/dist/node-runtime/src-Y7JSCK64.js +2407 -0
- package/dist/node-runtime/subagent-executor-5RNDEPIJ.js +8483 -0
- package/dist/node-runtime/summary-review-YSMXKITO.js +228 -0
- package/dist/node-runtime/tavily-WEZFVFP7.js +154 -0
- package/dist/node-runtime/timings-UAD5BEAS.js +16 -0
- package/dist/node-runtime/tool-renderer-MV5O452K.js +204 -0
- package/dist/node-runtime/update-cli-A253SZ7P.js +73 -0
- package/dist/node-runtime/v4-5MNC3H7G.js +424 -0
- package/dist/node-runtime/video-extract-OYT5WKS5.js +304 -0
- package/dist/node-runtime/workspace-index-6DBXSTJ6.js +163 -0
- package/dist/node-runtime/youtube-extract-TQYKGFGS.js +264 -0
- package/dist/startup/benchmark-request.d.ts +3 -0
- package/dist/startup/benchmark-request.d.ts.map +1 -0
- package/dist/startup/benchmark-request.js +65 -0
- package/dist/startup/benchmark-request.js.map +1 -0
- package/dist/startup/interactive-view.d.ts +55 -0
- package/dist/startup/interactive-view.d.ts.map +1 -0
- package/dist/startup/interactive-view.js +332 -0
- package/dist/startup/interactive-view.js.map +1 -0
- package/dist/startup/launch-routing.d.ts.map +1 -1
- package/dist/startup/launch-routing.js +9 -10
- package/dist/startup/launch-routing.js.map +1 -1
- package/dist/startup/startup-milestones.d.ts +1 -1
- package/dist/startup/startup-milestones.d.ts.map +1 -1
- package/dist/startup/startup-milestones.js +3 -2
- package/dist/startup/startup-milestones.js.map +1 -1
- package/dist/utils/await-with-abort.d.ts +2 -0
- package/dist/utils/await-with-abort.d.ts.map +1 -0
- package/dist/utils/await-with-abort.js +19 -0
- package/dist/utils/await-with-abort.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +10 -4
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/docs/compaction.md +5 -3
- package/docs/development.md +5 -1
- package/docs/features.md +0 -1
- package/docs/interactive-startup.md +98 -0
- package/docs/usage.md +0 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +20 -20
- package/dist/core/swarm.d.ts +0 -23
- package/dist/core/swarm.d.ts.map +0 -1
- package/dist/core/swarm.js +0 -45
- package/dist/core/swarm.js.map +0 -1
|
@@ -1,18 +1,58 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
1
2
|
import { Type } from "typebox";
|
|
2
|
-
import { showStatus, showTools, reconnectServers, authenticateServer, logoutServer, openMcpAuthPanel, openMcpPanel, openMcpSetup } from "./commands.js";
|
|
3
3
|
import { loadMcpConfig } from "./config.js";
|
|
4
|
-
import { buildProxyDescription,
|
|
5
|
-
import {
|
|
6
|
-
import { loadMetadataCache } from "./metadata-cache.js";
|
|
7
|
-
import { executeAuthComplete, executeAuthStart, executeCall, executeConnect, executeDescribe, executeList, executeSearch, executeStatus, executeUiMessages } from "./proxy-modes.js";
|
|
4
|
+
import { buildProxyDescription, getMissingConfiguredDirectToolServers, resolveDirectTools } from "./direct-tools.js";
|
|
5
|
+
import { getMetadataCachePath, loadMetadataCache } from "./metadata-cache.js";
|
|
8
6
|
import { getConfigPathFromArgv, normalizeDirectToolInputSchema, truncateAtWord } from "./utils.js";
|
|
9
|
-
import { initializeOAuth, shutdownOAuth } from "./mcp-auth-flow.js";
|
|
10
7
|
import { createMcpDirectToolCallRenderer, renderMcpProxyToolCall, renderMcpToolResult } from "./tool-result-renderer.js";
|
|
11
8
|
import { toolErrorOverride } from "./error-signal.js";
|
|
9
|
+
import { abortable, throwIfAborted } from "./abort.js";
|
|
10
|
+
function shouldBackgroundAutostart(config, cache) {
|
|
11
|
+
const serverEntries = Object.entries(config.mcpServers);
|
|
12
|
+
if (serverEntries.length === 0)
|
|
13
|
+
return false;
|
|
14
|
+
if (!existsSync(getMetadataCachePath()))
|
|
15
|
+
return true;
|
|
16
|
+
for (const [, definition] of serverEntries) {
|
|
17
|
+
const mode = definition.lifecycle ?? "lazy";
|
|
18
|
+
if (mode === "keep-alive" || mode === "eager")
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
if (process.env.MCP_DIRECT_TOOLS === "__none__")
|
|
22
|
+
return false;
|
|
23
|
+
return getMissingConfiguredDirectToolServers(config, cache).length > 0;
|
|
24
|
+
}
|
|
12
25
|
export default function mcpAdapter(pi) {
|
|
13
26
|
let state = null;
|
|
14
27
|
let initPromise = null;
|
|
15
28
|
let lifecycleGeneration = 0;
|
|
29
|
+
let sessionAbort = new AbortController();
|
|
30
|
+
const initializingStates = new Set();
|
|
31
|
+
let heavyModules = null;
|
|
32
|
+
let heavyModulesPromise = null;
|
|
33
|
+
const directExecutors = new Map();
|
|
34
|
+
function loadHeavyModules() {
|
|
35
|
+
if (heavyModules)
|
|
36
|
+
return Promise.resolve(heavyModules);
|
|
37
|
+
if (!heavyModulesPromise) {
|
|
38
|
+
heavyModulesPromise = (async () => {
|
|
39
|
+
const [init, authFlow, commands, proxyModes, directToolExecutor] = await Promise.all([
|
|
40
|
+
import("./init.js"),
|
|
41
|
+
import("./mcp-auth-flow.js"),
|
|
42
|
+
import("./commands.js"),
|
|
43
|
+
import("./proxy-modes.js"),
|
|
44
|
+
import("./direct-tool-executor.js"),
|
|
45
|
+
]);
|
|
46
|
+
const loaded = { init, authFlow, commands, proxyModes, directToolExecutor };
|
|
47
|
+
heavyModules = loaded;
|
|
48
|
+
return loaded;
|
|
49
|
+
})().catch((error) => {
|
|
50
|
+
heavyModulesPromise = null;
|
|
51
|
+
throw error;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return heavyModulesPromise;
|
|
55
|
+
}
|
|
16
56
|
async function shutdownState(currentState, reason) {
|
|
17
57
|
if (!currentState)
|
|
18
58
|
return;
|
|
@@ -22,7 +62,9 @@ export default function mcpAdapter(pi) {
|
|
|
22
62
|
}
|
|
23
63
|
let flushError;
|
|
24
64
|
try {
|
|
25
|
-
|
|
65
|
+
if (heavyModules) {
|
|
66
|
+
heavyModules.init.flushMetadataCache(currentState);
|
|
67
|
+
}
|
|
26
68
|
}
|
|
27
69
|
catch (error) {
|
|
28
70
|
flushError = error;
|
|
@@ -42,6 +84,146 @@ export default function mcpAdapter(pi) {
|
|
|
42
84
|
throw flushError;
|
|
43
85
|
}
|
|
44
86
|
}
|
|
87
|
+
async function shutdownInitializingStates() {
|
|
88
|
+
const pending = [...initializingStates];
|
|
89
|
+
initializingStates.clear();
|
|
90
|
+
await Promise.all(pending.map((entry) => shutdownState(entry, "initialization_cancelled")));
|
|
91
|
+
}
|
|
92
|
+
async function shutdownLoadedRuntime() {
|
|
93
|
+
if (!heavyModules)
|
|
94
|
+
return;
|
|
95
|
+
await heavyModules.authFlow.shutdownOAuth();
|
|
96
|
+
}
|
|
97
|
+
async function runInitialize(generation, sessionPi, ctx) {
|
|
98
|
+
const signal = sessionAbort.signal;
|
|
99
|
+
const heavy = await loadHeavyModules();
|
|
100
|
+
throwIfAborted(signal);
|
|
101
|
+
if (generation !== lifecycleGeneration) {
|
|
102
|
+
throw new Error("MCP initialization aborted (session changed)");
|
|
103
|
+
}
|
|
104
|
+
await heavy.authFlow.initializeOAuth().catch(err => {
|
|
105
|
+
console.error("MCP OAuth initialization failed:", err);
|
|
106
|
+
});
|
|
107
|
+
if (generation !== lifecycleGeneration) {
|
|
108
|
+
throw new Error("MCP initialization aborted (session changed)");
|
|
109
|
+
}
|
|
110
|
+
let partial;
|
|
111
|
+
try {
|
|
112
|
+
const initialized = await heavy.init.initializeMcp(sessionPi, ctx, {
|
|
113
|
+
signal,
|
|
114
|
+
onState: (entry) => {
|
|
115
|
+
partial = entry;
|
|
116
|
+
initializingStates.add(entry);
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
if (!partial) {
|
|
120
|
+
partial = initialized;
|
|
121
|
+
initializingStates.add(initialized);
|
|
122
|
+
}
|
|
123
|
+
throwIfAborted(signal);
|
|
124
|
+
return initialized;
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
if (partial && initializingStates.delete(partial))
|
|
128
|
+
await shutdownState(partial, "initialization_failed");
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
finally {
|
|
132
|
+
if (partial)
|
|
133
|
+
initializingStates.delete(partial);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function startSessionInit(generation, sessionPi, ctx) {
|
|
137
|
+
const promise = runInitialize(generation, sessionPi, ctx);
|
|
138
|
+
initPromise = promise;
|
|
139
|
+
promise.then(async (nextState) => {
|
|
140
|
+
if (generation !== lifecycleGeneration || initPromise !== promise) {
|
|
141
|
+
try {
|
|
142
|
+
await shutdownState(nextState, "stale_session_start");
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
console.error("MCP: failed to clean stale session state", error);
|
|
146
|
+
}
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
state = nextState;
|
|
150
|
+
if (heavyModules) {
|
|
151
|
+
heavyModules.init.updateStatusBar(nextState);
|
|
152
|
+
}
|
|
153
|
+
initPromise = null;
|
|
154
|
+
}).catch(err => {
|
|
155
|
+
if (generation !== lifecycleGeneration) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (initPromise !== promise && initPromise !== null) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
console.error("MCP initialization failed:", err);
|
|
162
|
+
initPromise = null;
|
|
163
|
+
});
|
|
164
|
+
return promise;
|
|
165
|
+
}
|
|
166
|
+
async function ensureState(sessionPi, ctx, signal) {
|
|
167
|
+
throwIfAborted(signal);
|
|
168
|
+
if (state)
|
|
169
|
+
return state;
|
|
170
|
+
const generation = lifecycleGeneration;
|
|
171
|
+
if (!initPromise) {
|
|
172
|
+
startSessionInit(generation, sessionPi, ctx);
|
|
173
|
+
}
|
|
174
|
+
const promise = initPromise;
|
|
175
|
+
if (!promise) {
|
|
176
|
+
throw new Error("MCP not initialized");
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const nextState = await abortable(promise, signal);
|
|
180
|
+
if (generation !== lifecycleGeneration) {
|
|
181
|
+
throw new Error("MCP initialization aborted (session changed)");
|
|
182
|
+
}
|
|
183
|
+
if (state)
|
|
184
|
+
return state;
|
|
185
|
+
state = nextState;
|
|
186
|
+
if (initPromise === promise) {
|
|
187
|
+
initPromise = null;
|
|
188
|
+
}
|
|
189
|
+
return state;
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
if (initPromise === promise && !signal?.aborted) {
|
|
193
|
+
initPromise = null;
|
|
194
|
+
}
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function assertCurrentState(currentState) {
|
|
199
|
+
if (currentState !== state)
|
|
200
|
+
throw new Error("MCP session changed before execution");
|
|
201
|
+
}
|
|
202
|
+
function createLazyDirectToolExecute(spec) {
|
|
203
|
+
return async function execute(toolCallId, params, incomingSignal, onUpdate, ctx) {
|
|
204
|
+
const signal = incomingSignal ? AbortSignal.any([incomingSignal, sessionAbort.signal]) : sessionAbort.signal;
|
|
205
|
+
let currentState;
|
|
206
|
+
try {
|
|
207
|
+
currentState = await ensureState(pi, ctx, signal);
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
211
|
+
return {
|
|
212
|
+
content: [{ type: "text", text: `MCP initialization failed: ${message}` }],
|
|
213
|
+
details: { error: "init_failed", message },
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
const heavy = await loadHeavyModules();
|
|
217
|
+
throwIfAborted(signal);
|
|
218
|
+
assertCurrentState(currentState);
|
|
219
|
+
let executor = directExecutors.get(spec.prefixedName);
|
|
220
|
+
if (!executor) {
|
|
221
|
+
executor = heavy.directToolExecutor.createDirectToolExecutor(() => currentState, () => null, spec);
|
|
222
|
+
directExecutors.set(spec.prefixedName, executor);
|
|
223
|
+
}
|
|
224
|
+
return executor(toolCallId, params, signal, onUpdate, ctx);
|
|
225
|
+
};
|
|
226
|
+
}
|
|
45
227
|
const earlyConfigPath = getConfigPathFromArgv();
|
|
46
228
|
const earlyConfig = loadMcpConfig(earlyConfigPath);
|
|
47
229
|
const earlyCache = loadMetadataCache();
|
|
@@ -61,7 +243,7 @@ export default function mcpAdapter(pi) {
|
|
|
61
243
|
description: spec.description || "(no description)",
|
|
62
244
|
promptSnippet: truncateAtWord(spec.description, 100) || `MCP tool from ${spec.serverName}`,
|
|
63
245
|
parameters: Type.Unsafe(normalizeDirectToolInputSchema(spec.inputSchema)),
|
|
64
|
-
execute:
|
|
246
|
+
execute: createLazyDirectToolExecute(spec),
|
|
65
247
|
renderCall: createMcpDirectToolCallRenderer(spec.prefixedName),
|
|
66
248
|
renderResult: renderMcpToolResult,
|
|
67
249
|
});
|
|
@@ -73,13 +255,17 @@ export default function mcpAdapter(pi) {
|
|
|
73
255
|
});
|
|
74
256
|
pi.on("session_start", async (_event, ctx) => {
|
|
75
257
|
const generation = ++lifecycleGeneration;
|
|
258
|
+
sessionAbort.abort(new Error("MCP session changed"));
|
|
259
|
+
sessionAbort = new AbortController();
|
|
76
260
|
const previousState = state;
|
|
77
261
|
state = null;
|
|
78
262
|
initPromise = null;
|
|
263
|
+
directExecutors.clear();
|
|
79
264
|
try {
|
|
80
265
|
await Promise.all([
|
|
81
266
|
shutdownState(previousState, "session_restart"),
|
|
82
|
-
|
|
267
|
+
shutdownInitializingStates(),
|
|
268
|
+
shutdownLoadedRuntime(),
|
|
83
269
|
]);
|
|
84
270
|
}
|
|
85
271
|
catch (error) {
|
|
@@ -88,44 +274,26 @@ export default function mcpAdapter(pi) {
|
|
|
88
274
|
if (generation !== lifecycleGeneration) {
|
|
89
275
|
return;
|
|
90
276
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
try {
|
|
99
|
-
await shutdownState(nextState, "stale_session_start");
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
console.error("MCP: failed to clean stale session state", error);
|
|
103
|
-
}
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
state = nextState;
|
|
107
|
-
updateStatusBar(nextState);
|
|
108
|
-
initPromise = null;
|
|
109
|
-
}).catch(err => {
|
|
110
|
-
if (generation !== lifecycleGeneration) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (initPromise !== promise && initPromise !== null) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
console.error("MCP initialization failed:", err);
|
|
117
|
-
initPromise = null;
|
|
118
|
-
});
|
|
277
|
+
const configPath = pi.getFlag("mcp-config") ?? earlyConfigPath;
|
|
278
|
+
const sessionConfig = loadMcpConfig(configPath, ctx.cwd);
|
|
279
|
+
const sessionCache = loadMetadataCache();
|
|
280
|
+
if (!shouldBackgroundAutostart(sessionConfig, sessionCache)) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
startSessionInit(generation, pi, ctx);
|
|
119
284
|
});
|
|
120
285
|
pi.on("session_shutdown", async () => {
|
|
121
286
|
++lifecycleGeneration;
|
|
287
|
+
sessionAbort.abort(new Error("MCP session ended"));
|
|
122
288
|
const currentState = state;
|
|
123
289
|
state = null;
|
|
124
290
|
initPromise = null;
|
|
291
|
+
directExecutors.clear();
|
|
125
292
|
try {
|
|
126
293
|
await Promise.all([
|
|
127
294
|
shutdownState(currentState, "session_shutdown"),
|
|
128
|
-
|
|
295
|
+
shutdownInitializingStates(),
|
|
296
|
+
shutdownLoadedRuntime(),
|
|
129
297
|
]);
|
|
130
298
|
}
|
|
131
299
|
catch (error) {
|
|
@@ -137,35 +305,31 @@ export default function mcpAdapter(pi) {
|
|
|
137
305
|
pi.registerCommand("mcp", {
|
|
138
306
|
description: "Show MCP server status",
|
|
139
307
|
handler: async (args, ctx) => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
catch (error) {
|
|
145
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
146
|
-
if (ctx.hasUI)
|
|
147
|
-
ctx.ui.notify(`MCP initialization failed: ${message}`, "error");
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
308
|
+
let currentState;
|
|
309
|
+
try {
|
|
310
|
+
currentState = await ensureState(pi, ctx);
|
|
150
311
|
}
|
|
151
|
-
|
|
312
|
+
catch (error) {
|
|
313
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
152
314
|
if (ctx.hasUI)
|
|
153
|
-
ctx.ui.notify(
|
|
315
|
+
ctx.ui.notify(`MCP initialization failed: ${message}`, "error");
|
|
154
316
|
return;
|
|
155
317
|
}
|
|
318
|
+
const heavy = await loadHeavyModules();
|
|
319
|
+
assertCurrentState(currentState);
|
|
156
320
|
const parts = args?.trim()?.split(/\s+/) ?? [];
|
|
157
321
|
const subcommand = parts[0] ?? "";
|
|
158
322
|
const targetServer = parts[1];
|
|
159
323
|
const rest = parts.slice(1).join(" ");
|
|
160
324
|
switch (subcommand) {
|
|
161
325
|
case "reconnect":
|
|
162
|
-
await reconnectServers(
|
|
326
|
+
await heavy.commands.reconnectServers(currentState, ctx, targetServer);
|
|
163
327
|
break;
|
|
164
328
|
case "tools":
|
|
165
|
-
await showTools(
|
|
329
|
+
await heavy.commands.showTools(currentState, ctx);
|
|
166
330
|
break;
|
|
167
331
|
case "setup": {
|
|
168
|
-
const result = await openMcpSetup(
|
|
332
|
+
const result = await heavy.commands.openMcpSetup(currentState, pi, ctx, earlyConfigPath, "setup");
|
|
169
333
|
if (result?.configChanged) {
|
|
170
334
|
await ctx.reload();
|
|
171
335
|
return;
|
|
@@ -179,21 +343,21 @@ export default function mcpAdapter(pi) {
|
|
|
179
343
|
ctx.ui.notify("Usage: /mcp logout <server>", "error");
|
|
180
344
|
return;
|
|
181
345
|
}
|
|
182
|
-
await logoutServer(serverName,
|
|
346
|
+
await heavy.commands.logoutServer(serverName, currentState, ctx);
|
|
183
347
|
break;
|
|
184
348
|
}
|
|
185
349
|
case "status":
|
|
186
350
|
case "":
|
|
187
351
|
default:
|
|
188
352
|
if (ctx.hasUI) {
|
|
189
|
-
const result = await openMcpPanel(
|
|
353
|
+
const result = await heavy.commands.openMcpPanel(currentState, pi, ctx, earlyConfigPath);
|
|
190
354
|
if (result?.configChanged) {
|
|
191
355
|
await ctx.reload();
|
|
192
356
|
return;
|
|
193
357
|
}
|
|
194
358
|
}
|
|
195
359
|
else {
|
|
196
|
-
await showStatus(
|
|
360
|
+
await heavy.commands.showStatus(currentState, ctx);
|
|
197
361
|
}
|
|
198
362
|
break;
|
|
199
363
|
}
|
|
@@ -206,27 +370,23 @@ export default function mcpAdapter(pi) {
|
|
|
206
370
|
if (!serverName && !ctx.hasUI) {
|
|
207
371
|
return;
|
|
208
372
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
catch (error) {
|
|
214
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
215
|
-
if (ctx.hasUI)
|
|
216
|
-
ctx.ui.notify(`MCP initialization failed: ${message}`, "error");
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
373
|
+
let currentState;
|
|
374
|
+
try {
|
|
375
|
+
currentState = await ensureState(pi, ctx);
|
|
219
376
|
}
|
|
220
|
-
|
|
377
|
+
catch (error) {
|
|
378
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
221
379
|
if (ctx.hasUI)
|
|
222
|
-
ctx.ui.notify(
|
|
380
|
+
ctx.ui.notify(`MCP initialization failed: ${message}`, "error");
|
|
223
381
|
return;
|
|
224
382
|
}
|
|
383
|
+
const heavy = await loadHeavyModules();
|
|
384
|
+
assertCurrentState(currentState);
|
|
225
385
|
if (!serverName) {
|
|
226
|
-
await openMcpAuthPanel(
|
|
386
|
+
await heavy.commands.openMcpAuthPanel(currentState, pi, ctx, earlyConfigPath);
|
|
227
387
|
return;
|
|
228
388
|
}
|
|
229
|
-
await authenticateServer(serverName,
|
|
389
|
+
await heavy.commands.authenticateServer(serverName, currentState.config, ctx);
|
|
230
390
|
},
|
|
231
391
|
});
|
|
232
392
|
if (shouldRegisterProxyTool) {
|
|
@@ -248,7 +408,8 @@ export default function mcpAdapter(pi) {
|
|
|
248
408
|
action: Type.Optional(Type.String({ description: "Action: 'ui-messages', 'auth-start', or 'auth-complete'" })),
|
|
249
409
|
}),
|
|
250
410
|
renderResult: renderMcpToolResult,
|
|
251
|
-
async execute(_toolCallId, params,
|
|
411
|
+
async execute(_toolCallId, params, incomingSignal, _onUpdate, ctx) {
|
|
412
|
+
const signal = incomingSignal ? AbortSignal.any([incomingSignal, sessionAbort.signal]) : sessionAbort.signal;
|
|
252
413
|
let parsedArgs;
|
|
253
414
|
if (params.args) {
|
|
254
415
|
try {
|
|
@@ -265,26 +426,22 @@ export default function mcpAdapter(pi) {
|
|
|
265
426
|
throw error;
|
|
266
427
|
}
|
|
267
428
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
catch (error) {
|
|
273
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
274
|
-
return {
|
|
275
|
-
content: [{ type: "text", text: `MCP initialization failed: ${message}` }],
|
|
276
|
-
details: { error: "init_failed", message },
|
|
277
|
-
};
|
|
278
|
-
}
|
|
429
|
+
let currentState;
|
|
430
|
+
try {
|
|
431
|
+
currentState = await ensureState(pi, ctx, signal);
|
|
279
432
|
}
|
|
280
|
-
|
|
433
|
+
catch (error) {
|
|
434
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
281
435
|
return {
|
|
282
|
-
content: [{ type: "text", text:
|
|
283
|
-
details: { error: "
|
|
436
|
+
content: [{ type: "text", text: `MCP initialization failed: ${message}` }],
|
|
437
|
+
details: { error: "init_failed", message },
|
|
284
438
|
};
|
|
285
439
|
}
|
|
440
|
+
const heavy = await loadHeavyModules();
|
|
441
|
+
throwIfAborted(signal);
|
|
442
|
+
assertCurrentState(currentState);
|
|
286
443
|
if (params.action === "ui-messages") {
|
|
287
|
-
return executeUiMessages(
|
|
444
|
+
return heavy.proxyModes.executeUiMessages(currentState);
|
|
288
445
|
}
|
|
289
446
|
if (params.action === "auth-start") {
|
|
290
447
|
if (!params.server) {
|
|
@@ -293,7 +450,7 @@ export default function mcpAdapter(pi) {
|
|
|
293
450
|
details: { mode: "auth-start", error: "missing_server" },
|
|
294
451
|
};
|
|
295
452
|
}
|
|
296
|
-
return executeAuthStart(
|
|
453
|
+
return heavy.proxyModes.executeAuthStart(currentState, params.server);
|
|
297
454
|
}
|
|
298
455
|
if (params.action === "auth-complete") {
|
|
299
456
|
if (!params.server) {
|
|
@@ -309,24 +466,24 @@ export default function mcpAdapter(pi) {
|
|
|
309
466
|
details: { mode: "auth-complete", error: "missing_input" },
|
|
310
467
|
};
|
|
311
468
|
}
|
|
312
|
-
return executeAuthComplete(
|
|
469
|
+
return heavy.proxyModes.executeAuthComplete(currentState, params.server, input);
|
|
313
470
|
}
|
|
314
471
|
if (params.tool) {
|
|
315
|
-
return executeCall(
|
|
472
|
+
return heavy.proxyModes.executeCall(currentState, params.tool, parsedArgs, params.server, getPiTools, signal);
|
|
316
473
|
}
|
|
317
474
|
if (params.connect) {
|
|
318
|
-
return executeConnect(
|
|
475
|
+
return heavy.proxyModes.executeConnect(currentState, params.connect, signal);
|
|
319
476
|
}
|
|
320
477
|
if (params.describe) {
|
|
321
|
-
return executeDescribe(
|
|
478
|
+
return heavy.proxyModes.executeDescribe(currentState, params.describe);
|
|
322
479
|
}
|
|
323
480
|
if (params.search) {
|
|
324
|
-
return executeSearch(
|
|
481
|
+
return heavy.proxyModes.executeSearch(currentState, params.search, params.regex, params.server, params.includeSchemas);
|
|
325
482
|
}
|
|
326
483
|
if (params.server) {
|
|
327
|
-
return executeList(
|
|
484
|
+
return heavy.proxyModes.executeList(currentState, params.server);
|
|
328
485
|
}
|
|
329
|
-
return executeStatus(
|
|
486
|
+
return heavy.proxyModes.executeStatus(currentState);
|
|
330
487
|
},
|
|
331
488
|
});
|
|
332
489
|
}
|