@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
|
@@ -9,30 +9,19 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
9
9
|
import { Box, Text, truncateToWidth } from "@ashx-j/lunr-tui";
|
|
10
10
|
import { Type } from "typebox";
|
|
11
11
|
import { StringEnum, complete } from "@ashx-j/lunr-ai/compat";
|
|
12
|
-
import { fetchAllContent } from "./extract.js";
|
|
13
12
|
import { normalizeFetchContentParams } from "./fetch-params.js";
|
|
14
|
-
import { clearCloneCache } from "./github-extract.js";
|
|
15
|
-
import { search } from "./gemini-search.js";
|
|
16
13
|
import { getWebSearchConfigDir, getWebSearchConfigPath } from "./utils.js";
|
|
17
14
|
import { clearResults, deleteResult, generateId, getAllResults, getResult, restoreFromSession, storeResult, } from "./storage.js";
|
|
18
15
|
import { activityMonitor } from "./activity.js";
|
|
19
|
-
import { startCuratorServer } from "./curator-server.js";
|
|
20
|
-
import { buildDeterministicSummary, generateSummaryDraft, } from "./summary-review.js";
|
|
21
16
|
import { randomUUID } from "node:crypto";
|
|
22
17
|
import { execFileSync } from "node:child_process";
|
|
23
18
|
import { createRequire } from "node:module";
|
|
24
19
|
import { platform } from "node:os";
|
|
25
20
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
26
21
|
import { join } from "node:path";
|
|
27
|
-
import { isPerplexityAvailable } from "./perplexity.js";
|
|
28
|
-
import { isExaAvailable } from "./exa.js";
|
|
29
|
-
import { isGeminiApiAvailable } from "./gemini-api.js";
|
|
30
|
-
import { getActiveGoogleEmail, isGeminiWebAvailable } from "./gemini-web.js";
|
|
31
22
|
import { isBrowserCookieAccessAllowed } from "./gemini-web-config.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { isParallelAvailable } from "./parallel.js";
|
|
35
|
-
import { isTavilyAvailable } from "./tavily.js";
|
|
23
|
+
import { loadBrave, loadCuratorServer, loadExa, loadExtract, loadGeminiApi, loadGeminiSearch, loadGeminiWeb, loadOpenAISearch, loadParallel, loadPerplexity, loadSummaryReview, loadTavily, } from "./lazy.js";
|
|
24
|
+
import { runSessionCleanups } from "./session-cleanup.js";
|
|
36
25
|
import { buildSearchErrorPlan } from "./render-search-error.js";
|
|
37
26
|
import { collectFetchUrls, collectSearchQueries, formatFetchCallTitle, formatFetchChrome, formatFetchDetail, formatSearchCallTitle, formatSearchChrome, formatSearchDetail, } from "./render-search-chrome.js";
|
|
38
27
|
import { formatGroupedCall, toolGroupTree, toolStatusDotFromContext } from "../../core/tools/render-utils.js";
|
|
@@ -133,15 +122,28 @@ function getCuratorTimeoutSeconds() {
|
|
|
133
122
|
return normalizeCuratorTimeoutSeconds(source.curatorTimeoutSeconds) ?? DEFAULT_CURATOR_TIMEOUT_SECONDS;
|
|
134
123
|
}
|
|
135
124
|
async function getProviderAvailability(ctx) {
|
|
136
|
-
const
|
|
125
|
+
const [openaiMod, braveMod, parallelMod, tavilyMod, perplexityMod, exaMod, geminiApiMod,] = await Promise.all([
|
|
126
|
+
loadOpenAISearch(),
|
|
127
|
+
loadBrave(),
|
|
128
|
+
loadParallel(),
|
|
129
|
+
loadTavily(),
|
|
130
|
+
loadPerplexity(),
|
|
131
|
+
loadExa(),
|
|
132
|
+
loadGeminiApi(),
|
|
133
|
+
]);
|
|
134
|
+
let geminiWebAvail = null;
|
|
135
|
+
if (isBrowserCookieAccessAllowed()) {
|
|
136
|
+
const geminiWebMod = await loadGeminiWeb();
|
|
137
|
+
geminiWebAvail = await geminiWebMod.isGeminiWebAvailable();
|
|
138
|
+
}
|
|
137
139
|
return {
|
|
138
|
-
openai: await isOpenAISearchAvailable(ctx),
|
|
139
|
-
brave: isBraveAvailable(),
|
|
140
|
-
parallel: isParallelAvailable(),
|
|
141
|
-
tavily: isTavilyAvailable(),
|
|
142
|
-
perplexity: isPerplexityAvailable(),
|
|
143
|
-
exa: isExaAvailable(),
|
|
144
|
-
gemini: isGeminiApiAvailable() || !!geminiWebAvail,
|
|
140
|
+
openai: await openaiMod.isOpenAISearchAvailable(ctx),
|
|
141
|
+
brave: braveMod.isBraveAvailable(),
|
|
142
|
+
parallel: parallelMod.isParallelAvailable(),
|
|
143
|
+
tavily: tavilyMod.isTavilyAvailable(),
|
|
144
|
+
perplexity: perplexityMod.isPerplexityAvailable(),
|
|
145
|
+
exa: exaMod.isExaAvailable(),
|
|
146
|
+
gemini: geminiApiMod.isGeminiApiAvailable() || !!geminiWebAvail,
|
|
145
147
|
};
|
|
146
148
|
}
|
|
147
149
|
function shouldPreferOpenAI(options) {
|
|
@@ -210,6 +212,13 @@ function resolveProvider(requested, available, options) {
|
|
|
210
212
|
}
|
|
211
213
|
const pendingFetches = new Map();
|
|
212
214
|
let sessionActive = false;
|
|
215
|
+
let sessionGeneration = 0;
|
|
216
|
+
let sessionAbort = new AbortController();
|
|
217
|
+
function assertActiveRequest(generation, signal) {
|
|
218
|
+
signal?.throwIfAborted();
|
|
219
|
+
if (generation !== sessionGeneration)
|
|
220
|
+
throw new Error("Web request cancelled: session changed");
|
|
221
|
+
}
|
|
213
222
|
let widgetVisible = false;
|
|
214
223
|
let widgetUnsubscribe = null;
|
|
215
224
|
const pendingCurates = new Map();
|
|
@@ -436,9 +445,12 @@ function formatEntryLine(entry, theme) {
|
|
|
436
445
|
return `${typeStr.padEnd(4)} ${target.padEnd(32)} ${statusStr.padStart(5)} ${duration.padStart(5)} ${indicator}`;
|
|
437
446
|
}
|
|
438
447
|
function handleSessionChange(ctx) {
|
|
448
|
+
sessionGeneration++;
|
|
449
|
+
sessionAbort.abort();
|
|
450
|
+
sessionAbort = new AbortController();
|
|
439
451
|
abortPendingFetches();
|
|
440
452
|
closeCurator();
|
|
441
|
-
|
|
453
|
+
runSessionCleanups();
|
|
442
454
|
sessionActive = true;
|
|
443
455
|
restoreFromSession(ctx);
|
|
444
456
|
// Unsubscribe before clear() to avoid callback with stale ctx
|
|
@@ -455,6 +467,17 @@ export default function (pi) {
|
|
|
455
467
|
const initConfig = loadConfigForExtensionInit();
|
|
456
468
|
const curateKey = initConfig.shortcuts?.curate || DEFAULT_SHORTCUTS.curate;
|
|
457
469
|
const activityKey = initConfig.shortcuts?.activity || DEFAULT_SHORTCUTS.activity;
|
|
470
|
+
/** Populated on first summary/curator use so sync curator submit/cancel can build fallbacks. */
|
|
471
|
+
let warmSummaryReview = null;
|
|
472
|
+
async function ensureSummaryReview() {
|
|
473
|
+
if (!warmSummaryReview)
|
|
474
|
+
warmSummaryReview = await loadSummaryReview();
|
|
475
|
+
return warmSummaryReview;
|
|
476
|
+
}
|
|
477
|
+
async function runSearch(query, options) {
|
|
478
|
+
const { search } = await loadGeminiSearch();
|
|
479
|
+
return search(query, options);
|
|
480
|
+
}
|
|
458
481
|
// lunr: expose curator workflow state to core (/settings "Extensions" submenu)
|
|
459
482
|
// so the /settings toggle writes through the same web-search.json saveConfig
|
|
460
483
|
// path as /curator — single source of truth, no forked state.
|
|
@@ -472,39 +495,46 @@ export default function (pi) {
|
|
|
472
495
|
const fetchId = generateId();
|
|
473
496
|
const controller = new AbortController();
|
|
474
497
|
pendingFetches.set(fetchId, controller);
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}, { triggerTurn: true });
|
|
493
|
-
})
|
|
494
|
-
.catch((err) => {
|
|
495
|
-
if (!sessionActive || !pendingFetches.has(fetchId))
|
|
496
|
-
return;
|
|
497
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
498
|
-
const isAbort = (err instanceof Error && err.name === "AbortError") || message.toLowerCase().includes("abort");
|
|
499
|
-
if (!isAbort) {
|
|
498
|
+
void (async () => {
|
|
499
|
+
try {
|
|
500
|
+
const { fetchAllContent } = await loadExtract();
|
|
501
|
+
if (!sessionActive || !pendingFetches.has(fetchId))
|
|
502
|
+
return;
|
|
503
|
+
const fetched = await fetchAllContent(urls, controller.signal);
|
|
504
|
+
if (!sessionActive || !pendingFetches.has(fetchId))
|
|
505
|
+
return;
|
|
506
|
+
const data = {
|
|
507
|
+
id: fetchId,
|
|
508
|
+
type: "fetch",
|
|
509
|
+
timestamp: Date.now(),
|
|
510
|
+
urls: stripThumbnails(fetched),
|
|
511
|
+
};
|
|
512
|
+
storeResult(fetchId, data);
|
|
513
|
+
pi.appendEntry("web-search-results", data);
|
|
514
|
+
const ok = fetched.filter(f => !f.error).length;
|
|
500
515
|
pi.sendMessage({
|
|
501
|
-
customType: "web-search-
|
|
502
|
-
content: `Content
|
|
516
|
+
customType: "web-search-content-ready",
|
|
517
|
+
content: `Content fetched for ${ok}/${fetched.length} URLs [${fetchId}]. Full page content now available.`,
|
|
503
518
|
display: true,
|
|
504
|
-
}, { triggerTurn:
|
|
519
|
+
}, { triggerTurn: true });
|
|
505
520
|
}
|
|
506
|
-
|
|
507
|
-
|
|
521
|
+
catch (err) {
|
|
522
|
+
if (!sessionActive || !pendingFetches.has(fetchId))
|
|
523
|
+
return;
|
|
524
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
525
|
+
const isAbort = (err instanceof Error && err.name === "AbortError") || message.toLowerCase().includes("abort");
|
|
526
|
+
if (!isAbort) {
|
|
527
|
+
pi.sendMessage({
|
|
528
|
+
customType: "web-search-error",
|
|
529
|
+
content: `Content fetch failed [${fetchId}]: ${message}`,
|
|
530
|
+
display: true,
|
|
531
|
+
}, { triggerTurn: false });
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
finally {
|
|
535
|
+
pendingFetches.delete(fetchId);
|
|
536
|
+
}
|
|
537
|
+
})();
|
|
508
538
|
return fetchId;
|
|
509
539
|
}
|
|
510
540
|
function storeAndPublishSearch(results) {
|
|
@@ -618,14 +648,15 @@ export default function (pi) {
|
|
|
618
648
|
if (selectedResults.length === 0) {
|
|
619
649
|
throw new Error("No selected results available for summary generation");
|
|
620
650
|
}
|
|
651
|
+
const summaryReview = await ensureSummaryReview();
|
|
621
652
|
try {
|
|
622
|
-
return await generateSummaryDraft(selectedResults, summaryContext, signal, modelOverride, feedback);
|
|
653
|
+
return await summaryReview.generateSummaryDraft(selectedResults, summaryContext, signal, modelOverride, feedback);
|
|
623
654
|
}
|
|
624
655
|
catch (err) {
|
|
625
656
|
const isEmptyResponse = err instanceof Error && err.message.includes("Summary model returned empty response");
|
|
626
657
|
if (!isEmptyResponse)
|
|
627
658
|
throw err;
|
|
628
|
-
const deterministic = buildDeterministicSummary(selectedResults);
|
|
659
|
+
const deterministic = summaryReview.buildDeterministicSummary(selectedResults);
|
|
629
660
|
return {
|
|
630
661
|
summary: deterministic.summary,
|
|
631
662
|
meta: {
|
|
@@ -700,7 +731,11 @@ export default function (pi) {
|
|
|
700
731
|
}
|
|
701
732
|
const selected = filterByQueryIndices(payload.selectedQueryIndices, resultsByIndex).results;
|
|
702
733
|
const fallbackResults = selected.length > 0 ? selected : [...resultsByIndex.values()];
|
|
703
|
-
|
|
734
|
+
// Curator paths preload summary-review before opening; sync submit/cancel need it warm.
|
|
735
|
+
if (!warmSummaryReview) {
|
|
736
|
+
throw new Error("Summary review module is not loaded");
|
|
737
|
+
}
|
|
738
|
+
const deterministic = warmSummaryReview.buildDeterministicSummary(fallbackResults);
|
|
704
739
|
return {
|
|
705
740
|
approvedSummary: deterministic.summary,
|
|
706
741
|
summaryMeta: deterministic.meta,
|
|
@@ -833,6 +868,12 @@ export default function (pi) {
|
|
|
833
868
|
? AbortSignal.any([pc.signal, searchAbort.signal])
|
|
834
869
|
: searchAbort.signal;
|
|
835
870
|
const sessionToken = randomUUID();
|
|
871
|
+
const [{ startCuratorServer }] = await Promise.all([
|
|
872
|
+
loadCuratorServer(),
|
|
873
|
+
ensureSummaryReview(),
|
|
874
|
+
]);
|
|
875
|
+
if (pendingCurates.get(callId) !== pc)
|
|
876
|
+
return;
|
|
836
877
|
handle = await startCuratorServer({
|
|
837
878
|
queries: pc.queryList,
|
|
838
879
|
sessionToken,
|
|
@@ -943,7 +984,7 @@ export default function (pi) {
|
|
|
943
984
|
? pc.searchProvider
|
|
944
985
|
: normalizedProvider;
|
|
945
986
|
try {
|
|
946
|
-
const { answer, results, inlineContent, provider: actualProvider } = await
|
|
987
|
+
const { answer, results, inlineContent, provider: actualProvider } = await runSearch(query, {
|
|
947
988
|
provider: requestedProvider,
|
|
948
989
|
numResults: pc.numResults,
|
|
949
990
|
recencyFilter: pc.recencyFilter,
|
|
@@ -1085,10 +1126,12 @@ export default function (pi) {
|
|
|
1085
1126
|
pi.on("session_start", async (_event, ctx) => handleSessionChange(ctx));
|
|
1086
1127
|
pi.on("session_tree", async (_event, ctx) => handleSessionChange(ctx));
|
|
1087
1128
|
pi.on("session_shutdown", () => {
|
|
1129
|
+
sessionGeneration++;
|
|
1130
|
+
sessionAbort.abort();
|
|
1088
1131
|
sessionActive = false;
|
|
1089
1132
|
abortPendingFetches();
|
|
1090
1133
|
closeCurator();
|
|
1091
|
-
|
|
1134
|
+
runSessionCleanups();
|
|
1092
1135
|
clearResults();
|
|
1093
1136
|
// Unsubscribe before clear() to avoid callback with stale ctx
|
|
1094
1137
|
widgetUnsubscribe?.();
|
|
@@ -1114,7 +1157,10 @@ export default function (pi) {
|
|
|
1114
1157
|
description: "Search workflow mode: none = no curator, summary-review = open curator with auto summary draft (default), auto-summary = generate summary without opening curator",
|
|
1115
1158
|
})),
|
|
1116
1159
|
}),
|
|
1117
|
-
async execute(callId, params,
|
|
1160
|
+
async execute(callId, params, incomingSignal, onUpdate, ctx) {
|
|
1161
|
+
const generation = sessionGeneration;
|
|
1162
|
+
const signal = incomingSignal ? AbortSignal.any([incomingSignal, sessionAbort.signal]) : sessionAbort.signal;
|
|
1163
|
+
assertActiveRequest(generation, signal);
|
|
1118
1164
|
const rawQueryList = Array.isArray(params.queries)
|
|
1119
1165
|
? params.queries
|
|
1120
1166
|
: (params.query !== undefined ? [params.query] : []);
|
|
@@ -1152,6 +1198,7 @@ export default function (pi) {
|
|
|
1152
1198
|
numResults: params.numResults,
|
|
1153
1199
|
recencyFilter: params.recencyFilter,
|
|
1154
1200
|
});
|
|
1201
|
+
assertActiveRequest(generation, signal);
|
|
1155
1202
|
const availableProviders = bootstrap.availableProviders;
|
|
1156
1203
|
const defaultProvider = bootstrap.defaultProvider;
|
|
1157
1204
|
const rawSearchProvider = normalizeProviderInput(params.provider ?? loadConfig().provider ?? "auto") ?? "auto";
|
|
@@ -1165,6 +1212,7 @@ export default function (pi) {
|
|
|
1165
1212
|
isProjectTrusted: () => ctx.isProjectTrusted(),
|
|
1166
1213
|
};
|
|
1167
1214
|
const summaryModelChoices = await loadSummaryModelChoices(summaryContext);
|
|
1215
|
+
assertActiveRequest(generation, signal);
|
|
1168
1216
|
const pc = {
|
|
1169
1217
|
phase: "searching",
|
|
1170
1218
|
workflow: curatorWorkflow,
|
|
@@ -1228,7 +1276,7 @@ export default function (pi) {
|
|
|
1228
1276
|
});
|
|
1229
1277
|
const requestedProvider = pc.searchProvider;
|
|
1230
1278
|
try {
|
|
1231
|
-
const { answer, results, inlineContent, provider } = await
|
|
1279
|
+
const { answer, results, inlineContent, provider } = await runSearch(queryList[qi], {
|
|
1232
1280
|
provider: requestedProvider,
|
|
1233
1281
|
numResults: params.numResults,
|
|
1234
1282
|
recencyFilter: params.recencyFilter,
|
|
@@ -1303,13 +1351,14 @@ export default function (pi) {
|
|
|
1303
1351
|
const allInlineContent = [];
|
|
1304
1352
|
const resolvedProvider = normalizeProviderInput(params.provider ?? loadConfig().provider);
|
|
1305
1353
|
for (let i = 0; i < queryList.length; i++) {
|
|
1354
|
+
assertActiveRequest(generation, signal);
|
|
1306
1355
|
const query = queryList[i];
|
|
1307
1356
|
onUpdate?.({
|
|
1308
1357
|
content: [{ type: "text", text: `Searching ${i + 1}/${queryList.length}: "${query}"...` }],
|
|
1309
1358
|
details: { phase: "search", progress: i / queryList.length, currentQuery: query },
|
|
1310
1359
|
});
|
|
1311
1360
|
try {
|
|
1312
|
-
const { answer, results, inlineContent, provider } = await
|
|
1361
|
+
const { answer, results, inlineContent, provider } = await runSearch(query, {
|
|
1313
1362
|
provider: resolvedProvider,
|
|
1314
1363
|
numResults: params.numResults,
|
|
1315
1364
|
recencyFilter: params.recencyFilter,
|
|
@@ -1318,6 +1367,7 @@ export default function (pi) {
|
|
|
1318
1367
|
signal,
|
|
1319
1368
|
extensionContext: ctx,
|
|
1320
1369
|
});
|
|
1370
|
+
assertActiveRequest(generation, signal);
|
|
1321
1371
|
searchResults.push({ query, answer, results, error: null, provider });
|
|
1322
1372
|
for (const r of results) {
|
|
1323
1373
|
if (!allUrls.includes(r.url)) {
|
|
@@ -1328,6 +1378,7 @@ export default function (pi) {
|
|
|
1328
1378
|
allInlineContent.push(...inlineContent);
|
|
1329
1379
|
}
|
|
1330
1380
|
catch (err) {
|
|
1381
|
+
assertActiveRequest(generation, signal);
|
|
1331
1382
|
const message = err instanceof Error ? err.message : String(err);
|
|
1332
1383
|
const requestedProvider = typeof resolvedProvider === "string" && resolvedProvider !== "auto"
|
|
1333
1384
|
? resolvedProvider
|
|
@@ -1355,10 +1406,12 @@ export default function (pi) {
|
|
|
1355
1406
|
isProjectTrusted: () => ctx.isProjectTrusted(),
|
|
1356
1407
|
};
|
|
1357
1408
|
const summaryModelChoices = await loadSummaryModelChoices(summaryContext);
|
|
1358
|
-
const
|
|
1409
|
+
const summaryReview = await ensureSummaryReview();
|
|
1410
|
+
const generated = await summaryReview.generateSummaryDraft(searchResults, summaryContext, signal, summaryModelChoices.defaultSummaryModel ?? undefined);
|
|
1359
1411
|
approvedSummary = generated.summary;
|
|
1360
1412
|
summaryMeta = generated.meta;
|
|
1361
1413
|
}
|
|
1414
|
+
assertActiveRequest(generation, signal);
|
|
1362
1415
|
return buildSearchReturn({
|
|
1363
1416
|
queryList,
|
|
1364
1417
|
results: searchResults,
|
|
@@ -1479,7 +1532,10 @@ export default function (pi) {
|
|
|
1479
1532
|
description: "Override the Gemini model for video/YouTube analysis (e.g. 'gemini-2.5-flash', 'gemini-3-flash-preview'). Defaults to config or gemini-3-flash-preview.",
|
|
1480
1533
|
})),
|
|
1481
1534
|
}),
|
|
1482
|
-
async execute(_toolCallId, params,
|
|
1535
|
+
async execute(_toolCallId, params, incomingSignal, onUpdate) {
|
|
1536
|
+
const generation = sessionGeneration;
|
|
1537
|
+
const signal = incomingSignal ? AbortSignal.any([incomingSignal, sessionAbort.signal]) : sessionAbort.signal;
|
|
1538
|
+
assertActiveRequest(generation, signal);
|
|
1483
1539
|
const { urlList, options } = normalizeFetchContentParams(params);
|
|
1484
1540
|
if (urlList.length === 0) {
|
|
1485
1541
|
return {
|
|
@@ -1491,7 +1547,15 @@ export default function (pi) {
|
|
|
1491
1547
|
content: [{ type: "text", text: `Fetching ${urlList.length} URL(s)...` }],
|
|
1492
1548
|
details: { phase: "fetch", progress: 0 },
|
|
1493
1549
|
});
|
|
1550
|
+
const { fetchAllContent } = await loadExtract();
|
|
1551
|
+
if (signal?.aborted) {
|
|
1552
|
+
return {
|
|
1553
|
+
content: [{ type: "text", text: "Error: Aborted" }],
|
|
1554
|
+
details: { error: "Aborted", urls: urlList, urlCount: urlList.length, successful: 0 },
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1494
1557
|
const fetchResults = await fetchAllContent(urlList, signal, options);
|
|
1558
|
+
assertActiveRequest(generation, signal);
|
|
1495
1559
|
const successful = fetchResults.filter((r) => !r.error).length;
|
|
1496
1560
|
const totalChars = fetchResults.reduce((sum, r) => sum + r.content.length, 0);
|
|
1497
1561
|
// ALWAYS store results (even for single URL)
|
|
@@ -1776,6 +1840,8 @@ export default function (pi) {
|
|
|
1776
1840
|
pi.registerCommand("websearch", {
|
|
1777
1841
|
description: "Open web search curator",
|
|
1778
1842
|
handler: async (args, ctx) => {
|
|
1843
|
+
const generation = sessionGeneration;
|
|
1844
|
+
const sessionSignal = sessionAbort.signal;
|
|
1779
1845
|
const sessionToken = randomUUID();
|
|
1780
1846
|
const commandCallId = `cmd:${sessionToken}`;
|
|
1781
1847
|
closeCurator(commandCallId);
|
|
@@ -1788,10 +1854,14 @@ export default function (pi) {
|
|
|
1788
1854
|
bootstrap = await loadCuratorBootstrap(undefined, ctx);
|
|
1789
1855
|
}
|
|
1790
1856
|
catch (err) {
|
|
1857
|
+
if (generation !== sessionGeneration)
|
|
1858
|
+
return;
|
|
1791
1859
|
const message = err instanceof Error ? err.message : String(err);
|
|
1792
1860
|
ctx.ui.notify(`Failed to load web search config: ${message}`, "error");
|
|
1793
1861
|
return;
|
|
1794
1862
|
}
|
|
1863
|
+
if (generation !== sessionGeneration)
|
|
1864
|
+
return;
|
|
1795
1865
|
const availableProviders = bootstrap.availableProviders;
|
|
1796
1866
|
const initialProvider = bootstrap.defaultProvider;
|
|
1797
1867
|
const curatorTimeoutSeconds = bootstrap.timeoutSeconds;
|
|
@@ -1805,12 +1875,15 @@ export default function (pi) {
|
|
|
1805
1875
|
isProjectTrusted: () => ctx.isProjectTrusted(),
|
|
1806
1876
|
};
|
|
1807
1877
|
const summaryModelChoices = await loadSummaryModelChoices(summaryContext);
|
|
1878
|
+
if (generation !== sessionGeneration)
|
|
1879
|
+
return;
|
|
1808
1880
|
ctx.ui.notify("Opening web search curator...", "info");
|
|
1809
1881
|
const collected = new Map();
|
|
1810
1882
|
const searchAbort = new AbortController();
|
|
1883
|
+
const searchSignal = AbortSignal.any([searchAbort.signal, sessionSignal]);
|
|
1811
1884
|
let aborted = false;
|
|
1812
1885
|
let commandHandle = null;
|
|
1813
|
-
const isCommandActive = () => commandHandle
|
|
1886
|
+
const isCommandActive = () => generation === sessionGeneration && (commandHandle === null || activeCurators.get(commandCallId) === commandHandle);
|
|
1814
1887
|
function sendFollowUpFromReturn(payload) {
|
|
1815
1888
|
pi.sendMessage({
|
|
1816
1889
|
customType: "web-search-results",
|
|
@@ -1820,6 +1893,12 @@ export default function (pi) {
|
|
|
1820
1893
|
}, { triggerTurn: true, deliverAs: "followUp" });
|
|
1821
1894
|
}
|
|
1822
1895
|
try {
|
|
1896
|
+
const [{ startCuratorServer }] = await Promise.all([
|
|
1897
|
+
loadCuratorServer(),
|
|
1898
|
+
ensureSummaryReview(),
|
|
1899
|
+
]);
|
|
1900
|
+
if (!isCommandActive())
|
|
1901
|
+
return;
|
|
1823
1902
|
const handle = await startCuratorServer({
|
|
1824
1903
|
queries,
|
|
1825
1904
|
sessionToken,
|
|
@@ -1831,13 +1910,13 @@ export default function (pi) {
|
|
|
1831
1910
|
defaultSummaryModel: summaryModelChoices.defaultSummaryModel,
|
|
1832
1911
|
}, {
|
|
1833
1912
|
async onSummarize(selectedQueryIndices, summarizeSignal, model, feedback) {
|
|
1834
|
-
if (
|
|
1913
|
+
if (!isCommandActive()) {
|
|
1835
1914
|
throw new Error("Curator session is no longer active.");
|
|
1836
1915
|
}
|
|
1837
1916
|
return generateSummaryForSelectedIndices(selectedQueryIndices, collected, summaryContext, summarizeSignal, model, feedback);
|
|
1838
1917
|
},
|
|
1839
1918
|
onSubmit(payload) {
|
|
1840
|
-
if (
|
|
1919
|
+
if (!isCommandActive())
|
|
1841
1920
|
return;
|
|
1842
1921
|
aborted = true;
|
|
1843
1922
|
searchAbort.abort();
|
|
@@ -1862,7 +1941,7 @@ export default function (pi) {
|
|
|
1862
1941
|
closeCurator(commandCallId);
|
|
1863
1942
|
},
|
|
1864
1943
|
onCancel(reason) {
|
|
1865
|
-
if (
|
|
1944
|
+
if (!isCommandActive())
|
|
1866
1945
|
return;
|
|
1867
1946
|
aborted = true;
|
|
1868
1947
|
searchAbort.abort();
|
|
@@ -1884,7 +1963,7 @@ export default function (pi) {
|
|
|
1884
1963
|
closeCurator(commandCallId);
|
|
1885
1964
|
},
|
|
1886
1965
|
onProviderChange(provider) {
|
|
1887
|
-
if (
|
|
1966
|
+
if (!isCommandActive())
|
|
1888
1967
|
return;
|
|
1889
1968
|
const normalized = normalizeProviderInput(provider);
|
|
1890
1969
|
if (!normalized || normalized === "auto")
|
|
@@ -1900,7 +1979,7 @@ export default function (pi) {
|
|
|
1900
1979
|
}
|
|
1901
1980
|
},
|
|
1902
1981
|
async onAddSearch(query, queryIndex, provider) {
|
|
1903
|
-
if (
|
|
1982
|
+
if (!isCommandActive()) {
|
|
1904
1983
|
throw new Error("Curator session is no longer active.");
|
|
1905
1984
|
}
|
|
1906
1985
|
const normalizedProvider = normalizeProviderInput(provider);
|
|
@@ -1908,12 +1987,12 @@ export default function (pi) {
|
|
|
1908
1987
|
? currentSearchProvider
|
|
1909
1988
|
: normalizedProvider;
|
|
1910
1989
|
try {
|
|
1911
|
-
const { answer, results, provider: actualProvider } = await
|
|
1990
|
+
const { answer, results, provider: actualProvider } = await runSearch(query, {
|
|
1912
1991
|
provider: requestedProvider,
|
|
1913
|
-
signal:
|
|
1992
|
+
signal: searchSignal,
|
|
1914
1993
|
extensionContext: ctx,
|
|
1915
1994
|
});
|
|
1916
|
-
if (
|
|
1995
|
+
if (!isCommandActive()) {
|
|
1917
1996
|
throw new Error("Curator session is no longer active.");
|
|
1918
1997
|
}
|
|
1919
1998
|
collected.set(queryIndex, { query, answer, results, error: null, provider: actualProvider });
|
|
@@ -1925,22 +2004,28 @@ export default function (pi) {
|
|
|
1925
2004
|
}
|
|
1926
2005
|
catch (err) {
|
|
1927
2006
|
const message = err instanceof Error ? err.message : String(err);
|
|
1928
|
-
if (
|
|
2007
|
+
if (isCommandActive()) {
|
|
1929
2008
|
collected.set(queryIndex, { query, answer: "", results: [], error: message, provider: requestedProvider });
|
|
1930
2009
|
}
|
|
1931
2010
|
throw err;
|
|
1932
2011
|
}
|
|
1933
2012
|
},
|
|
1934
2013
|
async onRewriteQuery(query, rewriteSignal) {
|
|
1935
|
-
if (
|
|
2014
|
+
if (!isCommandActive()) {
|
|
1936
2015
|
throw new Error("Curator session is no longer active.");
|
|
1937
2016
|
}
|
|
1938
2017
|
return rewriteSearchQuery(query, summaryContext, rewriteSignal);
|
|
1939
2018
|
},
|
|
1940
2019
|
});
|
|
2020
|
+
if (!isCommandActive()) {
|
|
2021
|
+
handle.close();
|
|
2022
|
+
return;
|
|
2023
|
+
}
|
|
1941
2024
|
commandHandle = handle;
|
|
1942
2025
|
activeCurators.set(commandCallId, handle);
|
|
1943
2026
|
const open = platform() === "darwin" ? await getGlimpseOpen() : null;
|
|
2027
|
+
if (!isCommandActive())
|
|
2028
|
+
return;
|
|
1944
2029
|
let browserOpenError = null;
|
|
1945
2030
|
if (open) {
|
|
1946
2031
|
try {
|
|
@@ -1973,6 +2058,8 @@ export default function (pi) {
|
|
|
1973
2058
|
browserOpenError = browserErr instanceof Error ? browserErr.message : String(browserErr);
|
|
1974
2059
|
}
|
|
1975
2060
|
}
|
|
2061
|
+
if (!isCommandActive())
|
|
2062
|
+
return;
|
|
1976
2063
|
if (browserOpenError) {
|
|
1977
2064
|
console.error(`Failed to open curator UI: ${browserOpenError}`);
|
|
1978
2065
|
ctx.ui.notify(`Search curator is running, but the browser did not open automatically. Open manually: ${handle.url}`, "info");
|
|
@@ -1984,9 +2071,9 @@ export default function (pi) {
|
|
|
1984
2071
|
break;
|
|
1985
2072
|
const requestedProvider = currentSearchProvider;
|
|
1986
2073
|
try {
|
|
1987
|
-
const { answer, results, provider } = await
|
|
2074
|
+
const { answer, results, provider } = await runSearch(queries[qi], {
|
|
1988
2075
|
provider: requestedProvider,
|
|
1989
|
-
signal:
|
|
2076
|
+
signal: searchSignal,
|
|
1990
2077
|
extensionContext: ctx,
|
|
1991
2078
|
});
|
|
1992
2079
|
if (aborted || !isCommandActive())
|
|
@@ -2017,6 +2104,8 @@ export default function (pi) {
|
|
|
2017
2104
|
}
|
|
2018
2105
|
catch (err) {
|
|
2019
2106
|
closeCurator(commandCallId);
|
|
2107
|
+
if (generation !== sessionGeneration)
|
|
2108
|
+
return;
|
|
2020
2109
|
const message = err instanceof Error ? err.message : String(err);
|
|
2021
2110
|
ctx.ui.notify(`Failed to open curator: ${message}`, "error");
|
|
2022
2111
|
}
|
|
@@ -2077,7 +2166,8 @@ export default function (pi) {
|
|
|
2077
2166
|
}, { triggerTurn: true, deliverAs: "followUp" });
|
|
2078
2167
|
return;
|
|
2079
2168
|
}
|
|
2080
|
-
const
|
|
2169
|
+
const geminiWeb = await loadGeminiWeb();
|
|
2170
|
+
const cookies = await geminiWeb.isGeminiWebAvailable();
|
|
2081
2171
|
if (!cookies) {
|
|
2082
2172
|
pi.sendMessage({
|
|
2083
2173
|
customType: "google-account",
|
|
@@ -2087,7 +2177,7 @@ export default function (pi) {
|
|
|
2087
2177
|
}, { triggerTurn: true, deliverAs: "followUp" });
|
|
2088
2178
|
return;
|
|
2089
2179
|
}
|
|
2090
|
-
const email = await getActiveGoogleEmail(cookies);
|
|
2180
|
+
const email = await geminiWeb.getActiveGoogleEmail(cookies);
|
|
2091
2181
|
const text = email
|
|
2092
2182
|
? `Active Google account: ${email}`
|
|
2093
2183
|
: "Gemini Web is available, but the active Google account could not be determined.";
|