@ashx-j/lunr-dev 0.2.13-dev.7.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/models.json +1 -1
- package/dist/catalog/providers/amazon-bedrock.json +1 -1
- package/dist/catalog/providers/azure-openai-responses.json +1 -1
- package/dist/catalog/providers/fireworks.json +1 -1
- package/dist/catalog/providers/github-copilot.json +1 -1
- package/dist/catalog/providers/openai-codex.json +1 -1
- package/dist/catalog/providers/openai.json +1 -1
- package/dist/catalog/providers/opencode.json +1 -1
- package/dist/catalog/providers/openrouter.json +1 -1
- package/dist/catalog/providers/vercel-ai-gateway.json +1 -1
- package/dist/catalog/publication.json +131 -3
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -0
- package/dist/cli/list-models.js.map +1 -1
- 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/catalog-cache-scope.d.ts +3 -0
- package/dist/core/catalog-cache-scope.d.ts.map +1 -0
- package/dist/core/catalog-cache-scope.js +12 -0
- package/dist/core/catalog-cache-scope.js.map +1 -0
- package/dist/core/catalog-merge.d.ts +2 -0
- package/dist/core/catalog-merge.d.ts.map +1 -1
- package/dist/core/catalog-merge.js +29 -2
- package/dist/core/catalog-merge.js.map +1 -1
- package/dist/core/catalog-refresh-polling.d.ts +8 -0
- package/dist/core/catalog-refresh-polling.d.ts.map +1 -0
- package/dist/core/catalog-refresh-polling.js +30 -0
- package/dist/core/catalog-refresh-polling.js.map +1 -0
- package/dist/core/codex-catalog.d.ts +3 -0
- package/dist/core/codex-catalog.d.ts.map +1 -0
- package/dist/core/codex-catalog.js +15 -0
- package/dist/core/codex-catalog.js.map +1 -0
- 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/live-catalog.d.ts +5 -2
- package/dist/core/live-catalog.d.ts.map +1 -1
- package/dist/core/live-catalog.js +108 -27
- package/dist/core/live-catalog.js.map +1 -1
- package/dist/core/model-runtime.d.ts +8 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +64 -12
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/official-catalog.d.ts +4 -0
- package/dist/core/official-catalog.d.ts.map +1 -1
- package/dist/core/official-catalog.js +86 -21
- package/dist/core/official-catalog.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 +66 -48
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -22
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +141 -207
- 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/model-catalog.md +29 -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
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
flushRawStdout,
|
|
4
|
+
takeOverStdout,
|
|
5
|
+
waitForRawStdoutBackpressure,
|
|
6
|
+
writeRawStdout
|
|
7
|
+
} from "./chunk-OBMWP3I5.js";
|
|
8
|
+
import {
|
|
9
|
+
killTrackedDetachedChildren
|
|
10
|
+
} from "./chunk-ZCHMJ34K.js";
|
|
11
|
+
import {
|
|
12
|
+
theme
|
|
13
|
+
} from "./chunk-MX3GJNXJ.js";
|
|
14
|
+
|
|
15
|
+
// packages/coding-agent/dist/modes/rpc/rpc-mode.js
|
|
16
|
+
import * as crypto from "node:crypto";
|
|
17
|
+
|
|
18
|
+
// packages/coding-agent/dist/modes/rpc/jsonl.js
|
|
19
|
+
import { StringDecoder } from "node:string_decoder";
|
|
20
|
+
function serializeJsonLine(value) {
|
|
21
|
+
return `${JSON.stringify(value)}
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
function attachJsonlLineReader(stream, onLine) {
|
|
25
|
+
let decoder = new StringDecoder("utf8"), buffer = "", emitLine = (line) => {
|
|
26
|
+
onLine(line.endsWith("\r") ? line.slice(0, -1) : line);
|
|
27
|
+
}, onData = (chunk) => {
|
|
28
|
+
for (buffer += typeof chunk == "string" ? chunk : decoder.write(chunk); ; ) {
|
|
29
|
+
let newlineIndex = buffer.indexOf(`
|
|
30
|
+
`);
|
|
31
|
+
if (newlineIndex === -1)
|
|
32
|
+
return;
|
|
33
|
+
emitLine(buffer.slice(0, newlineIndex)), buffer = buffer.slice(newlineIndex + 1);
|
|
34
|
+
}
|
|
35
|
+
}, onEnd = () => {
|
|
36
|
+
buffer += decoder.end(), buffer.length > 0 && (emitLine(buffer), buffer = "");
|
|
37
|
+
};
|
|
38
|
+
return stream.on("data", onData), stream.on("end", onEnd), () => {
|
|
39
|
+
stream.off("data", onData), stream.off("end", onEnd);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// packages/coding-agent/dist/modes/rpc/rpc-mode.js
|
|
44
|
+
async function runRpcMode(runtimeHost) {
|
|
45
|
+
takeOverStdout();
|
|
46
|
+
let session = runtimeHost.session, unsubscribe, unsubscribeBackpressure, output = (obj) => {
|
|
47
|
+
writeRawStdout(serializeJsonLine(obj));
|
|
48
|
+
}, success = (id, command, data) => data === void 0 ? { id, type: "response", command, success: !0 } : { id, type: "response", command, success: !0, data }, error = (id, command, message) => ({ id, type: "response", command, success: !1, error: message }), pendingExtensionRequests = /* @__PURE__ */ new Map(), shutdownRequested = !1, shuttingDown = !1, signalCleanupHandlers = [];
|
|
49
|
+
function createDialogPromise(opts, defaultValue, request, parseResponse) {
|
|
50
|
+
if (opts?.signal?.aborted)
|
|
51
|
+
return Promise.resolve(defaultValue);
|
|
52
|
+
let id = crypto.randomUUID();
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
let timeoutId, cleanup = () => {
|
|
55
|
+
timeoutId && clearTimeout(timeoutId), opts?.signal?.removeEventListener("abort", onAbort), pendingExtensionRequests.delete(id);
|
|
56
|
+
}, onAbort = () => {
|
|
57
|
+
cleanup(), resolve(defaultValue);
|
|
58
|
+
};
|
|
59
|
+
opts?.signal?.addEventListener("abort", onAbort, { once: !0 }), opts?.timeout && (timeoutId = setTimeout(() => {
|
|
60
|
+
cleanup(), resolve(defaultValue);
|
|
61
|
+
}, opts.timeout)), pendingExtensionRequests.set(id, {
|
|
62
|
+
resolve: (response) => {
|
|
63
|
+
cleanup(), resolve(parseResponse(response));
|
|
64
|
+
},
|
|
65
|
+
reject
|
|
66
|
+
}), output({ type: "extension_ui_request", id, ...request });
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
let createExtensionUIContext = () => ({
|
|
70
|
+
select: (title, options, opts) => createDialogPromise(opts, void 0, { method: "select", title, options, timeout: opts?.timeout }, (r) => "cancelled" in r && r.cancelled ? void 0 : "value" in r ? r.value : void 0),
|
|
71
|
+
confirm: (title, message, opts) => createDialogPromise(opts, !1, { method: "confirm", title, message, timeout: opts?.timeout }, (r) => "cancelled" in r && r.cancelled ? !1 : "confirmed" in r ? r.confirmed : !1),
|
|
72
|
+
input: (title, placeholder, opts) => createDialogPromise(opts, void 0, { method: "input", title, placeholder, timeout: opts?.timeout }, (r) => "cancelled" in r && r.cancelled ? void 0 : "value" in r ? r.value : void 0),
|
|
73
|
+
notify(message, type) {
|
|
74
|
+
output({
|
|
75
|
+
type: "extension_ui_request",
|
|
76
|
+
id: crypto.randomUUID(),
|
|
77
|
+
method: "notify",
|
|
78
|
+
message,
|
|
79
|
+
notifyType: type
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
onTerminalInput() {
|
|
83
|
+
return () => {
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
setStatus(key, text) {
|
|
87
|
+
output({
|
|
88
|
+
type: "extension_ui_request",
|
|
89
|
+
id: crypto.randomUUID(),
|
|
90
|
+
method: "setStatus",
|
|
91
|
+
statusKey: key,
|
|
92
|
+
statusText: text
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
setWorkingMessage(_message) {
|
|
96
|
+
},
|
|
97
|
+
setWorkingVisible(_visible) {
|
|
98
|
+
},
|
|
99
|
+
setWorkingIndicator(_options) {
|
|
100
|
+
},
|
|
101
|
+
setHiddenThinkingLabel(_label) {
|
|
102
|
+
},
|
|
103
|
+
setWidget(key, content, options) {
|
|
104
|
+
(content === void 0 || Array.isArray(content)) && output({
|
|
105
|
+
type: "extension_ui_request",
|
|
106
|
+
id: crypto.randomUUID(),
|
|
107
|
+
method: "setWidget",
|
|
108
|
+
widgetKey: key,
|
|
109
|
+
widgetLines: content,
|
|
110
|
+
widgetPlacement: options?.placement
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
setFooter(_factory) {
|
|
114
|
+
},
|
|
115
|
+
setHeader(_factory) {
|
|
116
|
+
},
|
|
117
|
+
setTitle(title) {
|
|
118
|
+
output({
|
|
119
|
+
type: "extension_ui_request",
|
|
120
|
+
id: crypto.randomUUID(),
|
|
121
|
+
method: "setTitle",
|
|
122
|
+
title
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
async custom() {
|
|
126
|
+
},
|
|
127
|
+
pasteToEditor(text) {
|
|
128
|
+
this.setEditorText(text);
|
|
129
|
+
},
|
|
130
|
+
setEditorText(text) {
|
|
131
|
+
output({
|
|
132
|
+
type: "extension_ui_request",
|
|
133
|
+
id: crypto.randomUUID(),
|
|
134
|
+
method: "set_editor_text",
|
|
135
|
+
text
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
getEditorText() {
|
|
139
|
+
return "";
|
|
140
|
+
},
|
|
141
|
+
async editor(title, prefill) {
|
|
142
|
+
let id = crypto.randomUUID();
|
|
143
|
+
return new Promise((resolve, reject) => {
|
|
144
|
+
pendingExtensionRequests.set(id, {
|
|
145
|
+
resolve: (response) => {
|
|
146
|
+
"cancelled" in response && response.cancelled ? resolve(void 0) : "value" in response ? resolve(response.value) : resolve(void 0);
|
|
147
|
+
},
|
|
148
|
+
reject
|
|
149
|
+
}), output({ type: "extension_ui_request", id, method: "editor", title, prefill });
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
addAutocompleteProvider() {
|
|
153
|
+
},
|
|
154
|
+
setEditorComponent() {
|
|
155
|
+
},
|
|
156
|
+
getEditorComponent() {
|
|
157
|
+
},
|
|
158
|
+
get theme() {
|
|
159
|
+
return theme;
|
|
160
|
+
},
|
|
161
|
+
getAllThemes() {
|
|
162
|
+
return [];
|
|
163
|
+
},
|
|
164
|
+
getTheme(_name) {
|
|
165
|
+
},
|
|
166
|
+
setTheme(_theme) {
|
|
167
|
+
return { success: !1, error: "Theme switching not supported in RPC mode" };
|
|
168
|
+
},
|
|
169
|
+
getToolsExpanded() {
|
|
170
|
+
return !1;
|
|
171
|
+
},
|
|
172
|
+
setToolsExpanded(_expanded) {
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
runtimeHost.setRebindSession(async () => {
|
|
176
|
+
await rebindSession();
|
|
177
|
+
});
|
|
178
|
+
let rebindSession = async () => {
|
|
179
|
+
session = runtimeHost.session, await session.bindExtensions({
|
|
180
|
+
uiContext: createExtensionUIContext(),
|
|
181
|
+
mode: "rpc",
|
|
182
|
+
commandContextActions: {
|
|
183
|
+
waitForIdle: () => session.waitForIdle(),
|
|
184
|
+
newSession: async (options) => runtimeHost.newSession(options),
|
|
185
|
+
fork: async (entryId, forkOptions) => ({ cancelled: (await runtimeHost.fork(entryId, forkOptions)).cancelled }),
|
|
186
|
+
navigateTree: async (targetId, options) => ({ cancelled: (await session.navigateTree(targetId, {
|
|
187
|
+
summarize: options?.summarize,
|
|
188
|
+
customInstructions: options?.customInstructions,
|
|
189
|
+
replaceInstructions: options?.replaceInstructions,
|
|
190
|
+
label: options?.label
|
|
191
|
+
})).cancelled }),
|
|
192
|
+
switchSession: async (sessionPath, options) => runtimeHost.switchSession(sessionPath, options),
|
|
193
|
+
reload: async () => {
|
|
194
|
+
await session.reload();
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
shutdownHandler: () => {
|
|
198
|
+
shutdownRequested = !0;
|
|
199
|
+
},
|
|
200
|
+
onError: (err) => {
|
|
201
|
+
output({ type: "extension_error", extensionPath: err.extensionPath, event: err.event, error: err.error });
|
|
202
|
+
}
|
|
203
|
+
}), unsubscribe?.(), unsubscribeBackpressure?.(), unsubscribe = session.subscribe((event) => {
|
|
204
|
+
output(event), event.type === "agent_settled" && checkShutdownRequested();
|
|
205
|
+
}), unsubscribeBackpressure = session.agent.subscribe(async () => {
|
|
206
|
+
await waitForRawStdoutBackpressure();
|
|
207
|
+
});
|
|
208
|
+
}, registerSignalHandlers = () => {
|
|
209
|
+
let signals = ["SIGTERM"];
|
|
210
|
+
process.platform !== "win32" && signals.push("SIGHUP");
|
|
211
|
+
for (let signal of signals) {
|
|
212
|
+
let handler = () => {
|
|
213
|
+
killTrackedDetachedChildren(), shutdown(signal === "SIGHUP" ? 129 : 143, signal);
|
|
214
|
+
};
|
|
215
|
+
process.on(signal, handler), signalCleanupHandlers.push(() => process.off(signal, handler));
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
await rebindSession(), registerSignalHandlers();
|
|
219
|
+
let handleCommand = async (command) => {
|
|
220
|
+
let id = command.id;
|
|
221
|
+
switch (command.type) {
|
|
222
|
+
// =================================================================
|
|
223
|
+
// Prompting
|
|
224
|
+
// =================================================================
|
|
225
|
+
case "prompt": {
|
|
226
|
+
let preflightSucceeded = !1;
|
|
227
|
+
session.prompt(command.message, {
|
|
228
|
+
images: command.images,
|
|
229
|
+
streamingBehavior: command.streamingBehavior,
|
|
230
|
+
source: "rpc",
|
|
231
|
+
preflightResult: (didSucceed) => {
|
|
232
|
+
didSucceed && (preflightSucceeded = !0, output(success(id, "prompt")));
|
|
233
|
+
}
|
|
234
|
+
}).catch((e) => {
|
|
235
|
+
preflightSucceeded || output(error(id, "prompt", e.message));
|
|
236
|
+
});
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
case "steer":
|
|
240
|
+
return await session.steer(command.message, command.images), success(id, "steer");
|
|
241
|
+
case "follow_up":
|
|
242
|
+
return await session.followUp(command.message, command.images), success(id, "follow_up");
|
|
243
|
+
case "abort":
|
|
244
|
+
return await session.abort(), success(id, "abort");
|
|
245
|
+
case "new_session": {
|
|
246
|
+
let options = command.parentSession ? { parentSession: command.parentSession } : void 0, result = await runtimeHost.newSession(options);
|
|
247
|
+
return result.cancelled || await rebindSession(), success(id, "new_session", result);
|
|
248
|
+
}
|
|
249
|
+
// =================================================================
|
|
250
|
+
// State
|
|
251
|
+
// =================================================================
|
|
252
|
+
case "get_state": {
|
|
253
|
+
let state = {
|
|
254
|
+
model: session.model,
|
|
255
|
+
thinkingLevel: session.thinkingLevel,
|
|
256
|
+
isStreaming: session.isStreaming,
|
|
257
|
+
isCompacting: session.isCompacting,
|
|
258
|
+
steeringMode: session.steeringMode,
|
|
259
|
+
followUpMode: session.followUpMode,
|
|
260
|
+
sessionFile: session.sessionFile,
|
|
261
|
+
sessionId: session.sessionId,
|
|
262
|
+
sessionName: session.sessionName,
|
|
263
|
+
autoCompactionEnabled: session.autoCompactionEnabled,
|
|
264
|
+
messageCount: session.messages.length,
|
|
265
|
+
pendingMessageCount: session.pendingMessageCount
|
|
266
|
+
};
|
|
267
|
+
return success(id, "get_state", state);
|
|
268
|
+
}
|
|
269
|
+
// =================================================================
|
|
270
|
+
// Model
|
|
271
|
+
// =================================================================
|
|
272
|
+
case "set_model": {
|
|
273
|
+
let model = (await session.modelRuntime.getAvailable()).find((m) => m.provider === command.provider && m.id === command.modelId);
|
|
274
|
+
return model ? (await session.setModel(model), success(id, "set_model", model)) : error(id, "set_model", `Model not found: ${command.provider}/${command.modelId}`);
|
|
275
|
+
}
|
|
276
|
+
case "cycle_model": {
|
|
277
|
+
let result = await session.cycleModel();
|
|
278
|
+
return result ? success(id, "cycle_model", result) : success(id, "cycle_model", null);
|
|
279
|
+
}
|
|
280
|
+
case "get_available_models": {
|
|
281
|
+
let models = await session.modelRuntime.getAvailable();
|
|
282
|
+
return success(id, "get_available_models", { models });
|
|
283
|
+
}
|
|
284
|
+
// =================================================================
|
|
285
|
+
// Thinking
|
|
286
|
+
// =================================================================
|
|
287
|
+
case "set_thinking_level":
|
|
288
|
+
return session.setThinkingLevel(command.level), success(id, "set_thinking_level");
|
|
289
|
+
case "cycle_thinking_level": {
|
|
290
|
+
let level = session.cycleThinkingLevel();
|
|
291
|
+
return level ? success(id, "cycle_thinking_level", { level }) : success(id, "cycle_thinking_level", null);
|
|
292
|
+
}
|
|
293
|
+
// =================================================================
|
|
294
|
+
// Queue Modes
|
|
295
|
+
// =================================================================
|
|
296
|
+
case "set_steering_mode":
|
|
297
|
+
return session.setSteeringMode(command.mode), success(id, "set_steering_mode");
|
|
298
|
+
case "set_follow_up_mode":
|
|
299
|
+
return session.setFollowUpMode(command.mode), success(id, "set_follow_up_mode");
|
|
300
|
+
// =================================================================
|
|
301
|
+
// Compaction
|
|
302
|
+
// =================================================================
|
|
303
|
+
case "compact": {
|
|
304
|
+
let result = await session.compact(command.customInstructions);
|
|
305
|
+
return success(id, "compact", result);
|
|
306
|
+
}
|
|
307
|
+
case "set_auto_compaction":
|
|
308
|
+
return session.setAutoCompactionEnabled(command.enabled), success(id, "set_auto_compaction");
|
|
309
|
+
// =================================================================
|
|
310
|
+
// Retry
|
|
311
|
+
// =================================================================
|
|
312
|
+
case "set_auto_retry":
|
|
313
|
+
return session.setAutoRetryEnabled(command.enabled), success(id, "set_auto_retry");
|
|
314
|
+
case "abort_retry":
|
|
315
|
+
return session.abortRetry(), success(id, "abort_retry");
|
|
316
|
+
// =================================================================
|
|
317
|
+
// Bash
|
|
318
|
+
// =================================================================
|
|
319
|
+
case "bash": {
|
|
320
|
+
let result = await session.executeBash(command.command, void 0, {
|
|
321
|
+
excludeFromContext: command.excludeFromContext
|
|
322
|
+
});
|
|
323
|
+
return success(id, "bash", result);
|
|
324
|
+
}
|
|
325
|
+
case "abort_bash":
|
|
326
|
+
return session.abortBash(), success(id, "abort_bash");
|
|
327
|
+
// =================================================================
|
|
328
|
+
// Session
|
|
329
|
+
// =================================================================
|
|
330
|
+
case "get_session_stats": {
|
|
331
|
+
let stats = session.getSessionStats();
|
|
332
|
+
return success(id, "get_session_stats", stats);
|
|
333
|
+
}
|
|
334
|
+
case "export_html": {
|
|
335
|
+
let path = await session.exportToHtml(command.outputPath);
|
|
336
|
+
return success(id, "export_html", { path });
|
|
337
|
+
}
|
|
338
|
+
case "switch_session": {
|
|
339
|
+
let result = await runtimeHost.switchSession(command.sessionPath);
|
|
340
|
+
return result.cancelled || await rebindSession(), success(id, "switch_session", result);
|
|
341
|
+
}
|
|
342
|
+
case "fork": {
|
|
343
|
+
let result = await runtimeHost.fork(command.entryId);
|
|
344
|
+
return result.cancelled || await rebindSession(), success(id, "fork", { text: result.selectedText, cancelled: result.cancelled });
|
|
345
|
+
}
|
|
346
|
+
case "clone": {
|
|
347
|
+
let leafId = session.sessionManager.getLeafId();
|
|
348
|
+
if (!leafId)
|
|
349
|
+
return error(id, "clone", "Cannot clone session: no current entry selected");
|
|
350
|
+
let result = await runtimeHost.fork(leafId, { position: "at" });
|
|
351
|
+
return result.cancelled || await rebindSession(), success(id, "clone", { cancelled: result.cancelled });
|
|
352
|
+
}
|
|
353
|
+
case "get_fork_messages": {
|
|
354
|
+
let messages = session.getUserMessagesForForking();
|
|
355
|
+
return success(id, "get_fork_messages", { messages });
|
|
356
|
+
}
|
|
357
|
+
case "get_entries": {
|
|
358
|
+
let sessionManager = session.sessionManager, entries = sessionManager.getEntries();
|
|
359
|
+
if (command.since !== void 0) {
|
|
360
|
+
let sinceIndex = entries.findIndex((e) => e.id === command.since);
|
|
361
|
+
if (sinceIndex === -1)
|
|
362
|
+
return error(id, "get_entries", `Entry not found: ${command.since}`);
|
|
363
|
+
entries = entries.slice(sinceIndex + 1);
|
|
364
|
+
}
|
|
365
|
+
return success(id, "get_entries", { entries, leafId: sessionManager.getLeafId() });
|
|
366
|
+
}
|
|
367
|
+
case "get_tree": {
|
|
368
|
+
let sessionManager = session.sessionManager;
|
|
369
|
+
return success(id, "get_tree", { tree: sessionManager.getTree(), leafId: sessionManager.getLeafId() });
|
|
370
|
+
}
|
|
371
|
+
case "get_last_assistant_text": {
|
|
372
|
+
let text = session.getLastAssistantText();
|
|
373
|
+
return success(id, "get_last_assistant_text", { text });
|
|
374
|
+
}
|
|
375
|
+
case "set_session_name": {
|
|
376
|
+
let name = command.name.trim();
|
|
377
|
+
return name ? (session.setSessionName(name), success(id, "set_session_name")) : error(id, "set_session_name", "Session name cannot be empty");
|
|
378
|
+
}
|
|
379
|
+
// =================================================================
|
|
380
|
+
// Messages
|
|
381
|
+
// =================================================================
|
|
382
|
+
case "get_messages":
|
|
383
|
+
return success(id, "get_messages", { messages: session.messages });
|
|
384
|
+
// =================================================================
|
|
385
|
+
// Commands (available for invocation via prompt)
|
|
386
|
+
// =================================================================
|
|
387
|
+
case "get_commands": {
|
|
388
|
+
let commands = [];
|
|
389
|
+
for (let command2 of session.extensionRunner.getRegisteredCommands())
|
|
390
|
+
commands.push({
|
|
391
|
+
name: command2.invocationName,
|
|
392
|
+
description: command2.description,
|
|
393
|
+
source: "extension",
|
|
394
|
+
sourceInfo: command2.sourceInfo
|
|
395
|
+
});
|
|
396
|
+
for (let template of session.promptTemplates)
|
|
397
|
+
commands.push({
|
|
398
|
+
name: template.name,
|
|
399
|
+
description: template.description,
|
|
400
|
+
source: "prompt",
|
|
401
|
+
sourceInfo: template.sourceInfo
|
|
402
|
+
});
|
|
403
|
+
for (let skill of session.resourceLoader.getSkills().skills)
|
|
404
|
+
commands.push({
|
|
405
|
+
name: `skill:${skill.name}`,
|
|
406
|
+
description: skill.description,
|
|
407
|
+
source: "skill",
|
|
408
|
+
sourceInfo: skill.sourceInfo
|
|
409
|
+
});
|
|
410
|
+
return success(id, "get_commands", { commands });
|
|
411
|
+
}
|
|
412
|
+
default: {
|
|
413
|
+
let unknownCommand = command;
|
|
414
|
+
return error(id, unknownCommand.type, `Unknown command: ${unknownCommand.type}`);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}, detachInput = () => {
|
|
418
|
+
};
|
|
419
|
+
async function shutdown(exitCode = 0, signal) {
|
|
420
|
+
shuttingDown && process.exit(exitCode), shuttingDown = !0;
|
|
421
|
+
for (let cleanup of signalCleanupHandlers)
|
|
422
|
+
cleanup();
|
|
423
|
+
unsubscribe?.(), unsubscribeBackpressure?.(), await runtimeHost.dispose(), detachInput(), process.stdin.pause(), signal !== "SIGTERM" && await flushRawStdout(), process.exit(exitCode);
|
|
424
|
+
}
|
|
425
|
+
async function checkShutdownRequested() {
|
|
426
|
+
shutdownRequested && await shutdown();
|
|
427
|
+
}
|
|
428
|
+
let handleInputLine = async (line) => {
|
|
429
|
+
let parsed;
|
|
430
|
+
try {
|
|
431
|
+
parsed = JSON.parse(line);
|
|
432
|
+
} catch (parseError) {
|
|
433
|
+
output(error(void 0, "parse", `Failed to parse command: ${parseError instanceof Error ? parseError.message : String(parseError)}`)), await waitForRawStdoutBackpressure();
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (typeof parsed == "object" && parsed !== null && "type" in parsed && parsed.type === "extension_ui_response") {
|
|
437
|
+
let response = parsed, pending = pendingExtensionRequests.get(response.id);
|
|
438
|
+
pending && (pendingExtensionRequests.delete(response.id), pending.resolve(response));
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
let command = parsed;
|
|
442
|
+
try {
|
|
443
|
+
let response = await handleCommand(command);
|
|
444
|
+
response && (output(response), await waitForRawStdoutBackpressure()), await checkShutdownRequested();
|
|
445
|
+
} catch (commandError) {
|
|
446
|
+
output(error(command.id, command.type, commandError instanceof Error ? commandError.message : String(commandError))), await waitForRawStdoutBackpressure();
|
|
447
|
+
}
|
|
448
|
+
}, onInputEnd = () => {
|
|
449
|
+
shutdown();
|
|
450
|
+
};
|
|
451
|
+
return process.stdin.on("end", onInputEnd), detachInput = (() => {
|
|
452
|
+
let detachJsonl = attachJsonlLineReader(process.stdin, (line) => {
|
|
453
|
+
handleInputLine(line);
|
|
454
|
+
});
|
|
455
|
+
return () => {
|
|
456
|
+
detachJsonl(), process.stdin.off("end", onInputEnd);
|
|
457
|
+
};
|
|
458
|
+
})(), new Promise(() => {
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export {
|
|
463
|
+
serializeJsonLine,
|
|
464
|
+
attachJsonlLineReader,
|
|
465
|
+
runRpcMode
|
|
466
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
getWebSearchConfigPath
|
|
4
|
+
} from "./chunk-VRB2IYGG.js";
|
|
5
|
+
|
|
6
|
+
// packages/coding-agent/dist/builtin-extensions/pi-web-access/gemini-api.js
|
|
7
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
+
var DEFAULT_API_HOST = "https://generativelanguage.googleapis.com", API_VERSION = "v1beta", API_BASE = `${DEFAULT_API_HOST}/${API_VERSION}`, CONFIG_PATH = getWebSearchConfigPath(), DEFAULT_MODEL = "gemini-3-flash-preview", cachedConfig = null;
|
|
9
|
+
function loadConfig() {
|
|
10
|
+
if (cachedConfig)
|
|
11
|
+
return cachedConfig;
|
|
12
|
+
if (!existsSync(CONFIG_PATH))
|
|
13
|
+
return cachedConfig = {}, cachedConfig;
|
|
14
|
+
let raw = readFileSync(CONFIG_PATH, "utf-8");
|
|
15
|
+
try {
|
|
16
|
+
return cachedConfig = JSON.parse(raw), cachedConfig;
|
|
17
|
+
} catch (err) {
|
|
18
|
+
let message = err instanceof Error ? err.message : String(err);
|
|
19
|
+
throw new Error(`Failed to parse ${CONFIG_PATH}: ${message}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function withTimeout(signal, timeoutMs) {
|
|
23
|
+
let timeout = AbortSignal.timeout(timeoutMs);
|
|
24
|
+
return signal ? AbortSignal.any([signal, timeout]) : timeout;
|
|
25
|
+
}
|
|
26
|
+
function normalizeApiKey(value) {
|
|
27
|
+
if (typeof value != "string")
|
|
28
|
+
return null;
|
|
29
|
+
let normalized = value.trim();
|
|
30
|
+
return normalized.length > 0 ? normalized : null;
|
|
31
|
+
}
|
|
32
|
+
function normalizeBaseUrl(value) {
|
|
33
|
+
if (typeof value != "string")
|
|
34
|
+
return null;
|
|
35
|
+
let normalized = value.trim().replace(/\/+$/, "");
|
|
36
|
+
return normalized.length > 0 ? normalized : null;
|
|
37
|
+
}
|
|
38
|
+
function isCloudflareGateway() {
|
|
39
|
+
return getApiHost().includes("gateway.ai.cloudflare.com");
|
|
40
|
+
}
|
|
41
|
+
function getApiKey() {
|
|
42
|
+
return normalizeApiKey(process.env.GEMINI_API_KEY) ?? normalizeApiKey(loadConfig().geminiApiKey);
|
|
43
|
+
}
|
|
44
|
+
function getApiHost() {
|
|
45
|
+
return normalizeBaseUrl(process.env.GOOGLE_GEMINI_BASE_URL) ?? normalizeBaseUrl(loadConfig().geminiBaseUrl) ?? DEFAULT_API_HOST;
|
|
46
|
+
}
|
|
47
|
+
function getVersionedApiBase() {
|
|
48
|
+
return `${getApiHost()}/${API_VERSION}`;
|
|
49
|
+
}
|
|
50
|
+
function buildKeyParam(apiKey) {
|
|
51
|
+
return !apiKey || isCloudflareGateway() ? "" : `?key=${apiKey}`;
|
|
52
|
+
}
|
|
53
|
+
function getCloudflareApiKey() {
|
|
54
|
+
return normalizeApiKey(process.env.CLOUDFLARE_API_KEY) ?? normalizeApiKey(loadConfig().cloudflareApiKey);
|
|
55
|
+
}
|
|
56
|
+
function isGatewayConfigured() {
|
|
57
|
+
return isCloudflareGateway() && getCloudflareApiKey() !== null;
|
|
58
|
+
}
|
|
59
|
+
function buildAuthHeaders() {
|
|
60
|
+
if (!isCloudflareGateway())
|
|
61
|
+
return {};
|
|
62
|
+
let cloudflareApiKey = getCloudflareApiKey();
|
|
63
|
+
return cloudflareApiKey ? { "cf-aig-authorization": `Bearer ${cloudflareApiKey}` } : {};
|
|
64
|
+
}
|
|
65
|
+
function isGeminiApiAvailable() {
|
|
66
|
+
return getApiKey() !== null || isGatewayConfigured();
|
|
67
|
+
}
|
|
68
|
+
async function queryGeminiApiWithVideo(prompt, videoUri, options = {}) {
|
|
69
|
+
let apiKey = getApiKey();
|
|
70
|
+
if (!apiKey && !isGatewayConfigured())
|
|
71
|
+
throw new Error(`Gemini API not configured. Either:
|
|
72
|
+
1. Set GEMINI_API_KEY in ${CONFIG_PATH}
|
|
73
|
+
2. Set GOOGLE_GEMINI_BASE_URL + CLOUDFLARE_API_KEY for Cloudflare AI Gateway routing`);
|
|
74
|
+
let model = options.model ?? DEFAULT_MODEL, signal = withTimeout(options.signal, options.timeoutMs ?? 12e4), url = `${getVersionedApiBase()}/models/${model}:generateContent${buildKeyParam(apiKey)}`, fileData = { fileUri: videoUri };
|
|
75
|
+
options.mimeType && (fileData.mimeType = options.mimeType);
|
|
76
|
+
let body = {
|
|
77
|
+
contents: [
|
|
78
|
+
{
|
|
79
|
+
role: "user",
|
|
80
|
+
parts: [
|
|
81
|
+
{ fileData },
|
|
82
|
+
{ text: prompt }
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}, res = await fetch(url, {
|
|
87
|
+
method: "POST",
|
|
88
|
+
headers: { "Content-Type": "application/json", ...buildAuthHeaders() },
|
|
89
|
+
body: JSON.stringify(body),
|
|
90
|
+
signal
|
|
91
|
+
});
|
|
92
|
+
if (!res.ok) {
|
|
93
|
+
let errorText = await res.text();
|
|
94
|
+
throw new Error(`Gemini API error ${res.status}: ${errorText.slice(0, 300)}`);
|
|
95
|
+
}
|
|
96
|
+
let text = (await res.json()).candidates?.[0]?.content?.parts?.map((p) => p.text).filter(Boolean).join(`
|
|
97
|
+
`);
|
|
98
|
+
if (!text)
|
|
99
|
+
throw new Error("Gemini API returned empty response");
|
|
100
|
+
return text;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
API_BASE,
|
|
105
|
+
DEFAULT_MODEL,
|
|
106
|
+
getApiKey,
|
|
107
|
+
getApiHost,
|
|
108
|
+
getVersionedApiBase,
|
|
109
|
+
buildKeyParam,
|
|
110
|
+
getCloudflareApiKey,
|
|
111
|
+
isGatewayConfigured,
|
|
112
|
+
buildAuthHeaders,
|
|
113
|
+
isGeminiApiAvailable,
|
|
114
|
+
queryGeminiApiWithVideo
|
|
115
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/coding-agent/dist/builtin-extensions/pi-lsp-extension/src/shared/language-map.js
|
|
4
|
+
var EXT_TO_LANGUAGE = {
|
|
5
|
+
".ts": "typescript",
|
|
6
|
+
".tsx": "typescriptreact",
|
|
7
|
+
".js": "javascript",
|
|
8
|
+
".jsx": "javascriptreact",
|
|
9
|
+
".mts": "typescript",
|
|
10
|
+
".mjs": "javascript",
|
|
11
|
+
".cts": "typescript",
|
|
12
|
+
".cjs": "javascript",
|
|
13
|
+
".rs": "rust",
|
|
14
|
+
".py": "python",
|
|
15
|
+
".go": "go",
|
|
16
|
+
".java": "java",
|
|
17
|
+
".c": "c",
|
|
18
|
+
".h": "c",
|
|
19
|
+
".cpp": "cpp",
|
|
20
|
+
".cc": "cpp",
|
|
21
|
+
".hpp": "cpp",
|
|
22
|
+
".cs": "csharp",
|
|
23
|
+
".rb": "ruby",
|
|
24
|
+
".kt": "kotlin",
|
|
25
|
+
".kts": "kotlin",
|
|
26
|
+
".scala": "scala",
|
|
27
|
+
".ex": "elixir",
|
|
28
|
+
".exs": "elixir",
|
|
29
|
+
".lua": "lua",
|
|
30
|
+
".sh": "bash",
|
|
31
|
+
".bash": "bash",
|
|
32
|
+
".zsh": "bash",
|
|
33
|
+
".swift": "swift",
|
|
34
|
+
".zig": "zig",
|
|
35
|
+
".json": "json",
|
|
36
|
+
".html": "html",
|
|
37
|
+
".htm": "html",
|
|
38
|
+
".css": "css",
|
|
39
|
+
".vue": "vue",
|
|
40
|
+
".php": "php"
|
|
41
|
+
};
|
|
42
|
+
function getLanguageIdFromPath(filePath) {
|
|
43
|
+
let ext = filePath.match(/\.[^.]+$/)?.[0]?.toLowerCase();
|
|
44
|
+
return ext ? EXT_TO_LANGUAGE[ext] : void 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
getLanguageIdFromPath
|
|
49
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/coding-agent/dist/builtin-extensions/pi-mcp-adapter/agent-dir.js
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { join, resolve } from "node:path";
|
|
6
|
+
function getAgentDir() {
|
|
7
|
+
let configured = process.env.PI_CODING_AGENT_DIR?.trim();
|
|
8
|
+
return configured ? configured === "~" ? homedir() : configured.startsWith("~/") ? resolve(homedir(), configured.slice(2)) : resolve(configured) : join(homedir(), ".lunr", "agent");
|
|
9
|
+
}
|
|
10
|
+
function getAgentPath(...segments) {
|
|
11
|
+
return join(getAgentDir(), ...segments);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
getAgentPath
|
|
16
|
+
};
|