@ashx-j/lunr-dev 0.2.13-dev.8.1 → 0.2.19-dev.10.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 +60 -1
- package/README.md +7 -1
- package/dist/builtin-extensions/ashxj-thinking.d.ts +1 -0
- package/dist/builtin-extensions/ashxj-thinking.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-thinking.js +44 -19
- package/dist/builtin-extensions/ashxj-thinking.js.map +1 -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 +8 -21
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-computer-use.d.ts +3 -0
- package/dist/builtin-extensions/lunr-computer-use.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-computer-use.js +157 -0
- package/dist/builtin-extensions/lunr-computer-use.js.map +1 -0
- 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 +172 -171
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +50 -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 +131 -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 +276 -109
- 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-mcp-adapter/server-manager.d.ts +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.js +33 -8
- package/dist/builtin-extensions/pi-mcp-adapter/server-manager.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 +68 -15
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +6 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +5 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts +10 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js +38 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/request-params.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +3 -16
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/child-tools.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 +2 -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 +72 -31
- 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 +259 -168
- 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-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session-services.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/computer-use/adapter.d.ts +23 -0
- package/dist/core/computer-use/adapter.d.ts.map +1 -0
- package/dist/core/computer-use/adapter.js +116 -0
- package/dist/core/computer-use/adapter.js.map +1 -0
- package/dist/core/computer-use/lease.d.ts +18 -0
- package/dist/core/computer-use/lease.d.ts.map +1 -0
- package/dist/core/computer-use/lease.js +129 -0
- package/dist/core/computer-use/lease.js.map +1 -0
- package/dist/core/computer-use/macos-runtime.d.ts +14 -0
- package/dist/core/computer-use/macos-runtime.d.ts.map +1 -0
- package/dist/core/computer-use/macos-runtime.js +148 -0
- package/dist/core/computer-use/macos-runtime.js.map +1 -0
- package/dist/core/computer-use/policy.d.ts +19 -0
- package/dist/core/computer-use/policy.d.ts.map +1 -0
- package/dist/core/computer-use/policy.js +66 -0
- package/dist/core/computer-use/policy.js.map +1 -0
- package/dist/core/computer-use/release.generated.d.ts +31 -0
- package/dist/core/computer-use/release.generated.d.ts.map +1 -0
- package/dist/core/computer-use/release.generated.js +36 -0
- package/dist/core/computer-use/release.generated.js.map +1 -0
- package/dist/core/computer-use/runtime.d.ts +13 -0
- package/dist/core/computer-use/runtime.d.ts.map +1 -0
- package/dist/core/computer-use/runtime.js +158 -0
- package/dist/core/computer-use/runtime.js.map +1 -0
- package/dist/core/computer-use/schemas.d.ts +88 -0
- package/dist/core/computer-use/schemas.d.ts.map +1 -0
- package/dist/core/computer-use/schemas.js +80 -0
- package/dist/core/computer-use/schemas.js.map +1 -0
- package/dist/core/computer-use/windows-desktop.d.ts +3 -0
- package/dist/core/computer-use/windows-desktop.d.ts.map +1 -0
- package/dist/core/computer-use/windows-desktop.js +48 -0
- package/dist/core/computer-use/windows-desktop.js.map +1 -0
- package/dist/core/computer-use/workflow.d.ts +24 -0
- package/dist/core/computer-use/workflow.d.ts.map +1 -0
- package/dist/core/computer-use/workflow.js +330 -0
- package/dist/core/computer-use/workflow.js.map +1 -0
- 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/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +1 -10
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/permissions.d.ts +1 -3
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +33 -25
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +9 -0
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/rollback.d.ts.map +1 -1
- package/dist/core/rollback.js +13 -90
- package/dist/core/rollback.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/session-manager.d.ts +0 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +21 -79
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +19 -0
- package/dist/core/settings-manager.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/dev-cli.js +0 -0
- package/dist/gateway/agent-bridge.d.ts +6 -1
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +23 -6
- package/dist/gateway/agent-bridge.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/gateway/cron.d.ts +1 -1
- package/dist/gateway/cron.d.ts.map +1 -1
- package/dist/gateway/cron.js +23 -7
- package/dist/gateway/cron.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/components/footer.d.ts +4 -2
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +23 -32
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/processes-selector.d.ts +2 -3
- package/dist/modes/interactive/components/processes-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/processes-selector.js +5 -10
- package/dist/modes/interactive/components/processes-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +4 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -0
- package/dist/modes/interactive/components/settings-selector.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 +138 -152
- 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/modes/interactive/thinking-level-slash.d.ts +4 -0
- package/dist/modes/interactive/thinking-level-slash.d.ts.map +1 -0
- package/dist/modes/interactive/thinking-level-slash.js +23 -0
- package/dist/modes/interactive/thinking-level-slash.js.map +1 -0
- package/dist/node-runtime/adapter-AZMY335J.js +279 -0
- package/dist/node-runtime/agent-session-services-RSGP5GDN.js +39 -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-7STLFW3A.js +29 -0
- package/dist/node-runtime/chunk-2IDTZAG5.js +1415 -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-4SJWFTUP.js +24 -0
- package/dist/node-runtime/chunk-4ZWGEEAS.js +69 -0
- package/dist/node-runtime/chunk-53YJI7JU.js +137 -0
- package/dist/node-runtime/chunk-5NWQCSKR.js +19218 -0
- package/dist/node-runtime/chunk-5OLJGVCB.js +68 -0
- package/dist/node-runtime/chunk-5Q45AVQG.js +108 -0
- package/dist/node-runtime/chunk-5SQDLSZJ.js +949 -0
- package/dist/node-runtime/chunk-6SPPH4FY.js +1269 -0
- package/dist/node-runtime/chunk-6UB6NKA3.js +860 -0
- package/dist/node-runtime/chunk-7AFOFSDY.js +105 -0
- package/dist/node-runtime/chunk-7N3YHTYF.js +26 -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-BKAZ6BKX.js +2185 -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-CGBXPL3E.js +1171 -0
- package/dist/node-runtime/chunk-CH6OL6P2.js +295 -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-EH2LJQPM.js +64 -0
- package/dist/node-runtime/chunk-EHMBW7FA.js +772 -0
- package/dist/node-runtime/chunk-FLYMHKCS.js +966 -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-HRS4HMDX.js +610 -0
- package/dist/node-runtime/chunk-HYHJIRDW.js +19 -0
- package/dist/node-runtime/chunk-I6R76AG7.js +22 -0
- package/dist/node-runtime/chunk-ISQDQIZN.js +296 -0
- package/dist/node-runtime/chunk-J7QGQD45.js +24921 -0
- package/dist/node-runtime/chunk-JHYKXIMM.js +378 -0
- package/dist/node-runtime/chunk-JT6YCS5B.js +5648 -0
- package/dist/node-runtime/chunk-JZHEUQRL.js +180 -0
- package/dist/node-runtime/chunk-K72NVGUB.js +2834 -0
- package/dist/node-runtime/chunk-KKSIVROT.js +88 -0
- package/dist/node-runtime/chunk-LCACDWHJ.js +1743 -0
- package/dist/node-runtime/chunk-LTXUQJI4.js +173 -0
- package/dist/node-runtime/chunk-LWJXTA6Z.js +6814 -0
- package/dist/node-runtime/chunk-M3LZLQW2.js +98 -0
- package/dist/node-runtime/chunk-MGSB2C3M.js +46 -0
- package/dist/node-runtime/chunk-MGWCVY6Y.js +47 -0
- package/dist/node-runtime/chunk-MJQDX3BA.js +72 -0
- package/dist/node-runtime/chunk-MUMMMTW4.js +8392 -0
- package/dist/node-runtime/chunk-MX3GJNXJ.js +986 -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-OTT6JMPU.js +807 -0
- package/dist/node-runtime/chunk-PCIGF2XK.js +250 -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-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-T5GM5BFH.js +7558 -0
- package/dist/node-runtime/chunk-TAP7QTUT.js +1346 -0
- package/dist/node-runtime/chunk-U6C7VTR5.js +2033 -0
- package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
- package/dist/node-runtime/chunk-VRB2IYGG.js +53 -0
- package/dist/node-runtime/chunk-W3CVH5RX.js +62 -0
- package/dist/node-runtime/chunk-W7S2REEG.js +9478 -0
- package/dist/node-runtime/chunk-XBWPBZBN.js +125 -0
- package/dist/node-runtime/chunk-XTHQ7XR7.js +509 -0
- package/dist/node-runtime/chunk-ZCHMJ34K.js +130 -0
- package/dist/node-runtime/chunk-ZRDIMBEQ.js +651 -0
- package/dist/node-runtime/chunk-ZSEZY3II.js +247 -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-6UXQ6XZN.js +13 -0
- package/dist/node-runtime/commands-LGR5VT5X.js +293 -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-TDJS7TBD.js +191 -0
- package/dist/node-runtime/exa-LL64QZR2.js +329 -0
- package/dist/node-runtime/export-html-E4DT6ZJQ.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-IUCVZCWC.js +17 -0
- package/dist/node-runtime/file-sync-HCOP2QVF.js +117 -0
- package/dist/node-runtime/gateway-3OLC4GQN.js +2139 -0
- package/dist/node-runtime/gemini-api-QE7ANVDZ.js +29 -0
- package/dist/node-runtime/gemini-search-NCIDF7NE.js +330 -0
- package/dist/node-runtime/gemini-url-context-OKIN7AIP.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/image-resize-6ZPBFMWW.js +11 -0
- package/dist/node-runtime/index.js +863 -0
- package/dist/node-runtime/init-EKE277AG.js +30 -0
- package/dist/node-runtime/install-cli-TH7IJJQQ.js +308 -0
- package/dist/node-runtime/interactive-mode-S5M26CQ7.js +59 -0
- package/dist/node-runtime/interactive-view-N6F4KUIT.js +247 -0
- package/dist/node-runtime/lsp-manager-3ASUSO4T.js +1104 -0
- package/dist/node-runtime/lunr-computer-use-4X3KUNF4.js +206 -0
- package/dist/node-runtime/lunr-cron-KKBOGAEF.js +274 -0
- package/dist/node-runtime/main.js +57 -0
- package/dist/node-runtime/mcp-auth-flow-YL6RWPYG.js +33 -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-C4EJOO5Q.js +751 -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-DPTJGAAL.js +428 -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-VKCLYIBY.js +6050 -0
- package/dist/node-runtime/pi-web-access-BV6DSZOP.js +1867 -0
- package/dist/node-runtime/print-mode-VWIRFDAC.js +12 -0
- package/dist/node-runtime/proxy-modes-R64LU6WZ.js +688 -0
- package/dist/node-runtime/rpc-entry.js +65 -0
- package/dist/node-runtime/rpc-mode-SJNSOA4G.js +13 -0
- package/dist/node-runtime/runtime-3SB5ATHQ.js +21 -0
- package/dist/node-runtime/runtime-bridges-UJ5WJJLN.js +14 -0
- package/dist/node-runtime/session-manager-QEMZBMTM.js +33 -0
- package/dist/node-runtime/session-selector-URVJLOTK.js +14 -0
- package/dist/node-runtime/settings-manager-K6IPIQTI.js +23 -0
- package/dist/node-runtime/src-GPFAU3N6.js +2427 -0
- package/dist/node-runtime/subagent-executor-EFLTO32A.js +8501 -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-I6OVDRPL.js +75 -0
- package/dist/node-runtime/v4-5MNC3H7G.js +424 -0
- package/dist/node-runtime/video-extract-ETA5RA7U.js +304 -0
- package/dist/node-runtime/workflow-SA34S4VX.js +325 -0
- package/dist/node-runtime/workspace-index-6DBXSTJ6.js +163 -0
- package/dist/node-runtime/youtube-extract-SRVGNN26.js +264 -0
- package/dist/rpc.d.ts +3 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +18 -0
- package/dist/rpc.js.map +1 -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-shell.d.ts → interactive-view.d.ts} +18 -18
- package/dist/startup/interactive-view.d.ts.map +1 -0
- package/dist/startup/{interactive-shell.js → interactive-view.js} +119 -52
- 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/computer-use.md +277 -0
- package/docs/development.md +5 -33
- package/docs/features.md +2 -3
- package/docs/interactive-startup.md +105 -0
- package/docs/keybindings.md +2 -2
- package/docs/terminal-setup.md +1 -1
- package/docs/usage.md +1 -2
- 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/hidden-thinking-label.ts +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/install-lock/package-lock.json +3827 -0
- package/install-lock/package.json +18 -0
- package/native/computer-use/LICENSE.md +21 -0
- package/npm-shrinkwrap.json +3808 -0
- package/package.json +30 -24
- 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
- package/dist/startup/interactive-shell.d.ts.map +0 -1
- package/dist/startup/interactive-shell.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
API_BASE,
|
|
4
|
+
DEFAULT_MODEL,
|
|
5
|
+
buildAuthHeaders,
|
|
6
|
+
buildKeyParam,
|
|
7
|
+
getApiHost,
|
|
8
|
+
getApiKey,
|
|
9
|
+
getCloudflareApiKey,
|
|
10
|
+
getVersionedApiBase,
|
|
11
|
+
isGatewayConfigured,
|
|
12
|
+
isGeminiApiAvailable,
|
|
13
|
+
queryGeminiApiWithVideo
|
|
14
|
+
} from "./chunk-3WFAEVKS.js";
|
|
15
|
+
import "./chunk-VRB2IYGG.js";
|
|
16
|
+
import "./chunk-BRJX2PRC.js";
|
|
17
|
+
export {
|
|
18
|
+
API_BASE,
|
|
19
|
+
DEFAULT_MODEL,
|
|
20
|
+
buildAuthHeaders,
|
|
21
|
+
buildKeyParam,
|
|
22
|
+
getApiHost,
|
|
23
|
+
getApiKey,
|
|
24
|
+
getCloudflareApiKey,
|
|
25
|
+
getVersionedApiBase,
|
|
26
|
+
isGatewayConfigured,
|
|
27
|
+
isGeminiApiAvailable,
|
|
28
|
+
queryGeminiApiWithVideo
|
|
29
|
+
};
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
loadBrave,
|
|
4
|
+
loadExa,
|
|
5
|
+
loadGeminiApi,
|
|
6
|
+
loadGeminiWeb,
|
|
7
|
+
loadOpenAISearch,
|
|
8
|
+
loadParallel,
|
|
9
|
+
loadPerplexity,
|
|
10
|
+
loadTavily
|
|
11
|
+
} from "./chunk-4SJWFTUP.js";
|
|
12
|
+
import {
|
|
13
|
+
activityMonitor
|
|
14
|
+
} from "./chunk-DAPBPCBP.js";
|
|
15
|
+
import {
|
|
16
|
+
getWebSearchConfigPath
|
|
17
|
+
} from "./chunk-VRB2IYGG.js";
|
|
18
|
+
import "./chunk-BRJX2PRC.js";
|
|
19
|
+
|
|
20
|
+
// packages/coding-agent/dist/builtin-extensions/pi-web-access/gemini-search.js
|
|
21
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
22
|
+
var CONFIG_PATH = getWebSearchConfigPath(), cachedSearchConfig = null;
|
|
23
|
+
function getSearchConfig() {
|
|
24
|
+
if (cachedSearchConfig)
|
|
25
|
+
return cachedSearchConfig;
|
|
26
|
+
if (!existsSync(CONFIG_PATH))
|
|
27
|
+
return cachedSearchConfig = { searchProvider: "auto", searchModel: void 0 }, cachedSearchConfig;
|
|
28
|
+
let rawText = readFileSync(CONFIG_PATH, "utf-8"), raw;
|
|
29
|
+
try {
|
|
30
|
+
raw = JSON.parse(rawText);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
let message = err instanceof Error ? err.message : String(err);
|
|
33
|
+
throw new Error(`Failed to parse ${CONFIG_PATH}: ${message}`);
|
|
34
|
+
}
|
|
35
|
+
return cachedSearchConfig = {
|
|
36
|
+
searchProvider: normalizeSearchProvider(raw.searchProvider ?? raw.provider),
|
|
37
|
+
searchModel: normalizeSearchModel(raw.searchModel)
|
|
38
|
+
}, cachedSearchConfig;
|
|
39
|
+
}
|
|
40
|
+
function normalizeSearchModel(value) {
|
|
41
|
+
if (typeof value != "string")
|
|
42
|
+
return;
|
|
43
|
+
let normalized = value.trim();
|
|
44
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
45
|
+
}
|
|
46
|
+
function normalizeSearchProvider(value) {
|
|
47
|
+
let normalized = typeof value == "string" ? value.trim().toLowerCase() : "";
|
|
48
|
+
return ["auto", "openai", "brave", "parallel", "tavily", "perplexity", "gemini", "exa"].includes(normalized) ? normalized : "auto";
|
|
49
|
+
}
|
|
50
|
+
function errorMessage(err) {
|
|
51
|
+
return err instanceof Error ? err.message : String(err);
|
|
52
|
+
}
|
|
53
|
+
function isAbortError(err) {
|
|
54
|
+
return errorMessage(err).toLowerCase().includes("abort");
|
|
55
|
+
}
|
|
56
|
+
function shouldTryOpenAIInAuto(options) {
|
|
57
|
+
return !(options.recencyFilter || typeof options.numResults == "number" && Number.isFinite(options.numResults) && Math.floor(options.numResults) !== 5);
|
|
58
|
+
}
|
|
59
|
+
async function searchWithGemini(query, options, strictErrors) {
|
|
60
|
+
let errors = [];
|
|
61
|
+
try {
|
|
62
|
+
let apiResult = await searchWithGeminiApi(query, options);
|
|
63
|
+
if (apiResult)
|
|
64
|
+
return apiResult;
|
|
65
|
+
} catch (err) {
|
|
66
|
+
if (isAbortError(err))
|
|
67
|
+
throw err;
|
|
68
|
+
errors.push(`Gemini API: ${errorMessage(err)}`);
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
let webResult = await searchWithGeminiWeb(query, options);
|
|
72
|
+
if (webResult)
|
|
73
|
+
return webResult;
|
|
74
|
+
} catch (err) {
|
|
75
|
+
if (isAbortError(err))
|
|
76
|
+
throw err;
|
|
77
|
+
errors.push(`Gemini Web: ${errorMessage(err)}`);
|
|
78
|
+
}
|
|
79
|
+
if (strictErrors && errors.length > 0)
|
|
80
|
+
throw new Error(`Gemini search failed:
|
|
81
|
+
- ${errors.join(`
|
|
82
|
+
- `)}`);
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
async function search(query, options = {}) {
|
|
86
|
+
let config = getSearchConfig(), provider = options.provider ?? config.searchProvider;
|
|
87
|
+
if (provider === "openai") {
|
|
88
|
+
let { searchWithOpenAI } = await loadOpenAISearch();
|
|
89
|
+
return { ...await searchWithOpenAI(query, options, options.extensionContext), provider: "openai" };
|
|
90
|
+
}
|
|
91
|
+
if (provider === "brave") {
|
|
92
|
+
let { searchWithBrave } = await loadBrave();
|
|
93
|
+
return { ...await searchWithBrave(query, options), provider: "brave" };
|
|
94
|
+
}
|
|
95
|
+
if (provider === "parallel") {
|
|
96
|
+
let { searchWithParallel } = await loadParallel();
|
|
97
|
+
return { ...await searchWithParallel(query, options), provider: "parallel" };
|
|
98
|
+
}
|
|
99
|
+
if (provider === "tavily") {
|
|
100
|
+
let { searchWithTavily } = await loadTavily();
|
|
101
|
+
return { ...await searchWithTavily(query, options), provider: "tavily" };
|
|
102
|
+
}
|
|
103
|
+
if (provider === "perplexity") {
|
|
104
|
+
let { searchWithPerplexity } = await loadPerplexity();
|
|
105
|
+
return { ...await searchWithPerplexity(query, options), provider: "perplexity" };
|
|
106
|
+
}
|
|
107
|
+
if (provider === "gemini") {
|
|
108
|
+
let result = await searchWithGemini(query, options, !0);
|
|
109
|
+
if (result)
|
|
110
|
+
return { ...result, provider: "gemini" };
|
|
111
|
+
throw new Error(`Gemini search unavailable. Either:
|
|
112
|
+
1. Set GEMINI_API_KEY in ${CONFIG_PATH}
|
|
113
|
+
2. Set GOOGLE_GEMINI_BASE_URL + CLOUDFLARE_API_KEY for Cloudflare AI Gateway routing
|
|
114
|
+
3. Sign into gemini.google.com in a supported Chromium-based browser`);
|
|
115
|
+
}
|
|
116
|
+
if (provider === "exa") {
|
|
117
|
+
let exa = await loadExa(), exaApiKeyConfigured = exa.hasExaApiKey();
|
|
118
|
+
try {
|
|
119
|
+
let result = await exa.searchWithExa(query, options);
|
|
120
|
+
if (result)
|
|
121
|
+
return { ...result, provider: "exa" };
|
|
122
|
+
if (exaApiKeyConfigured)
|
|
123
|
+
throw new Error("Exa search returned no results.");
|
|
124
|
+
} catch (err) {
|
|
125
|
+
if ((err instanceof Error ? err.message : String(err)).toLowerCase().includes("abort") || exaApiKeyConfigured)
|
|
126
|
+
throw err;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
let fallbackErrors = [];
|
|
130
|
+
if (shouldTryOpenAIInAuto(options))
|
|
131
|
+
try {
|
|
132
|
+
let openai = await loadOpenAISearch();
|
|
133
|
+
if (await openai.isOpenAISearchAvailable(options.extensionContext))
|
|
134
|
+
return { ...await openai.searchWithOpenAI(query, options, options.extensionContext), provider: "openai" };
|
|
135
|
+
} catch (err) {
|
|
136
|
+
if (isAbortError(err))
|
|
137
|
+
throw err;
|
|
138
|
+
fallbackErrors.push(`OpenAI: ${errorMessage(err)}`);
|
|
139
|
+
}
|
|
140
|
+
if (provider !== "exa") {
|
|
141
|
+
let exa = await loadExa();
|
|
142
|
+
if (exa.isExaAvailable())
|
|
143
|
+
try {
|
|
144
|
+
let result = await exa.searchWithExa(query, options);
|
|
145
|
+
if (result)
|
|
146
|
+
return { ...result, provider: "exa" };
|
|
147
|
+
} catch (err) {
|
|
148
|
+
if (isAbortError(err))
|
|
149
|
+
throw err;
|
|
150
|
+
fallbackErrors.push(`Exa: ${errorMessage(err)}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
{
|
|
154
|
+
let brave = await loadBrave();
|
|
155
|
+
if (brave.isBraveAvailable())
|
|
156
|
+
try {
|
|
157
|
+
return { ...await brave.searchWithBrave(query, options), provider: "brave" };
|
|
158
|
+
} catch (err) {
|
|
159
|
+
if (isAbortError(err))
|
|
160
|
+
throw err;
|
|
161
|
+
fallbackErrors.push(`Brave: ${errorMessage(err)}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
{
|
|
165
|
+
let parallel = await loadParallel();
|
|
166
|
+
if (parallel.isParallelAvailable())
|
|
167
|
+
try {
|
|
168
|
+
return { ...await parallel.searchWithParallel(query, options), provider: "parallel" };
|
|
169
|
+
} catch (err) {
|
|
170
|
+
if (isAbortError(err))
|
|
171
|
+
throw err;
|
|
172
|
+
fallbackErrors.push(`Parallel: ${errorMessage(err)}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
{
|
|
176
|
+
let tavily = await loadTavily();
|
|
177
|
+
if (tavily.isTavilyAvailable())
|
|
178
|
+
try {
|
|
179
|
+
return { ...await tavily.searchWithTavily(query, options), provider: "tavily" };
|
|
180
|
+
} catch (err) {
|
|
181
|
+
if (isAbortError(err))
|
|
182
|
+
throw err;
|
|
183
|
+
fallbackErrors.push(`Tavily: ${errorMessage(err)}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
{
|
|
187
|
+
let perplexity = await loadPerplexity();
|
|
188
|
+
if (perplexity.isPerplexityAvailable())
|
|
189
|
+
try {
|
|
190
|
+
return { ...await perplexity.searchWithPerplexity(query, options), provider: "perplexity" };
|
|
191
|
+
} catch (err) {
|
|
192
|
+
if (isAbortError(err))
|
|
193
|
+
throw err;
|
|
194
|
+
fallbackErrors.push(`Perplexity: ${errorMessage(err)}`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
let geminiResult = await searchWithGemini(query, options, !1);
|
|
199
|
+
if (geminiResult)
|
|
200
|
+
return { ...geminiResult, provider: "gemini" };
|
|
201
|
+
} catch (err) {
|
|
202
|
+
if (isAbortError(err))
|
|
203
|
+
throw err;
|
|
204
|
+
fallbackErrors.push(`Gemini: ${errorMessage(err)}`);
|
|
205
|
+
}
|
|
206
|
+
throw fallbackErrors.length > 0 ? new Error(`Auto provider search failed:
|
|
207
|
+
- ${fallbackErrors.join(`
|
|
208
|
+
- `)}`) : new Error(`No search provider available. Either:
|
|
209
|
+
1. Use /login to sign in with a Codex subscription for OpenAI web search
|
|
210
|
+
2. Set openaiApiKey, braveApiKey, parallelApiKey, tavilyApiKey, perplexityApiKey, exaApiKey, geminiApiKey, or cloudflareApiKey in ${CONFIG_PATH}
|
|
211
|
+
3. Set OPENAI_API_KEY, BRAVE_API_KEY, PARALLEL_API_KEY, TAVILY_API_KEY, EXA_API_KEY, PERPLEXITY_API_KEY, GEMINI_API_KEY, or CLOUDFLARE_API_KEY env vars
|
|
212
|
+
4. Set GOOGLE_GEMINI_BASE_URL with CLOUDFLARE_API_KEY for Cloudflare AI Gateway routing
|
|
213
|
+
5. Sign into gemini.google.com in a supported Chromium-based browser`);
|
|
214
|
+
}
|
|
215
|
+
async function searchWithGeminiApi(query, options = {}) {
|
|
216
|
+
let geminiApi = await loadGeminiApi(), apiKey = geminiApi.getApiKey();
|
|
217
|
+
if (!apiKey && !geminiApi.isGatewayConfigured())
|
|
218
|
+
return null;
|
|
219
|
+
let activityId = activityMonitor.logStart({ type: "api", query });
|
|
220
|
+
try {
|
|
221
|
+
let model = getSearchConfig().searchModel ?? geminiApi.DEFAULT_MODEL, body = {
|
|
222
|
+
contents: [{ role: "user", parts: [{ text: query }] }],
|
|
223
|
+
tools: [{ google_search: {} }]
|
|
224
|
+
}, res = await fetch(`${geminiApi.getVersionedApiBase()}/models/${model}:generateContent${geminiApi.buildKeyParam(apiKey)}`, {
|
|
225
|
+
method: "POST",
|
|
226
|
+
headers: { "Content-Type": "application/json", ...geminiApi.buildAuthHeaders() },
|
|
227
|
+
body: JSON.stringify(body),
|
|
228
|
+
signal: AbortSignal.any([
|
|
229
|
+
AbortSignal.timeout(6e4),
|
|
230
|
+
...options.signal ? [options.signal] : []
|
|
231
|
+
])
|
|
232
|
+
});
|
|
233
|
+
if (!res.ok) {
|
|
234
|
+
let errorText = await res.text();
|
|
235
|
+
throw new Error(`Gemini API error ${res.status}: ${errorText.slice(0, 300)}`);
|
|
236
|
+
}
|
|
237
|
+
let data = await res.json();
|
|
238
|
+
activityMonitor.logComplete(activityId, res.status);
|
|
239
|
+
let answer = data.candidates?.[0]?.content?.parts?.map((p) => p.text).filter(Boolean).join(`
|
|
240
|
+
`) ?? "", metadata = data.candidates?.[0]?.groundingMetadata, results = await resolveGroundingChunks(metadata?.groundingChunks, options.signal);
|
|
241
|
+
return !answer && results.length === 0 ? null : { answer, results };
|
|
242
|
+
} catch (err) {
|
|
243
|
+
let message = err instanceof Error ? err.message : String(err);
|
|
244
|
+
throw message.toLowerCase().includes("abort") ? activityMonitor.logComplete(activityId, 0) : activityMonitor.logError(activityId, message), err;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
async function searchWithGeminiWeb(query, options = {}) {
|
|
248
|
+
let geminiWeb = await loadGeminiWeb(), cookies = await geminiWeb.isGeminiWebAvailable();
|
|
249
|
+
if (!cookies)
|
|
250
|
+
return null;
|
|
251
|
+
let prompt = buildSearchPrompt(query, options), activityId = activityMonitor.logStart({ type: "api", query });
|
|
252
|
+
try {
|
|
253
|
+
let text = await geminiWeb.queryWithCookies(prompt, cookies, {
|
|
254
|
+
model: "gemini-3-flash-preview",
|
|
255
|
+
signal: options.signal,
|
|
256
|
+
timeoutMs: 6e4
|
|
257
|
+
});
|
|
258
|
+
activityMonitor.logComplete(activityId, 200);
|
|
259
|
+
let results = extractSourceUrls(text);
|
|
260
|
+
return { answer: text, results };
|
|
261
|
+
} catch (err) {
|
|
262
|
+
let message = err instanceof Error ? err.message : String(err);
|
|
263
|
+
throw message.toLowerCase().includes("abort") ? activityMonitor.logComplete(activityId, 0) : activityMonitor.logError(activityId, message), err;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function buildSearchPrompt(query, options) {
|
|
267
|
+
let prompt = `Search the web and answer the following question. Include source URLs for your claims.
|
|
268
|
+
Format your response as:
|
|
269
|
+
1. A direct answer to the question
|
|
270
|
+
2. Cited sources as markdown links
|
|
271
|
+
|
|
272
|
+
Question: ${query}`;
|
|
273
|
+
if (options.recencyFilter && (prompt += `
|
|
274
|
+
|
|
275
|
+
Only include results from the ${{
|
|
276
|
+
day: "past 24 hours",
|
|
277
|
+
week: "past week",
|
|
278
|
+
month: "past month",
|
|
279
|
+
year: "past year"
|
|
280
|
+
}[options.recencyFilter]}.`), options.domainFilter?.length) {
|
|
281
|
+
let includes = options.domainFilter.filter((d) => !d.startsWith("-")), excludes = options.domainFilter.filter((d) => d.startsWith("-")).map((d) => d.slice(1));
|
|
282
|
+
includes.length && (prompt += `
|
|
283
|
+
|
|
284
|
+
Only cite sources from: ${includes.join(", ")}`), excludes.length && (prompt += `
|
|
285
|
+
|
|
286
|
+
Do not cite sources from: ${excludes.join(", ")}`);
|
|
287
|
+
}
|
|
288
|
+
return prompt;
|
|
289
|
+
}
|
|
290
|
+
function extractSourceUrls(markdown) {
|
|
291
|
+
let results = [], seen = /* @__PURE__ */ new Set(), linkRegex = /\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g;
|
|
292
|
+
for (let match of markdown.matchAll(linkRegex)) {
|
|
293
|
+
let url = match[2];
|
|
294
|
+
seen.has(url) || (seen.add(url), results.push({ title: match[1], url, snippet: "" }));
|
|
295
|
+
}
|
|
296
|
+
return results;
|
|
297
|
+
}
|
|
298
|
+
async function resolveGroundingChunks(chunks, signal) {
|
|
299
|
+
if (!chunks?.length)
|
|
300
|
+
return [];
|
|
301
|
+
let results = [];
|
|
302
|
+
for (let chunk of chunks) {
|
|
303
|
+
if (!chunk.web)
|
|
304
|
+
continue;
|
|
305
|
+
let title = chunk.web.title || "", url = chunk.web.uri || "";
|
|
306
|
+
if (url.includes("vertexaisearch.cloud.google.com/grounding-api-redirect")) {
|
|
307
|
+
let resolved = await resolveRedirect(url, signal);
|
|
308
|
+
resolved && (url = resolved);
|
|
309
|
+
}
|
|
310
|
+
url && results.push({ title, url, snippet: "" });
|
|
311
|
+
}
|
|
312
|
+
return results;
|
|
313
|
+
}
|
|
314
|
+
async function resolveRedirect(proxyUrl, signal) {
|
|
315
|
+
try {
|
|
316
|
+
return (await fetch(proxyUrl, {
|
|
317
|
+
method: "HEAD",
|
|
318
|
+
redirect: "manual",
|
|
319
|
+
signal: AbortSignal.any([
|
|
320
|
+
AbortSignal.timeout(5e3),
|
|
321
|
+
...signal ? [signal] : []
|
|
322
|
+
])
|
|
323
|
+
})).headers.get("location") || null;
|
|
324
|
+
} catch {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
export {
|
|
329
|
+
search
|
|
330
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
isGeminiWebAvailable,
|
|
4
|
+
queryWithCookies
|
|
5
|
+
} from "./chunk-XTHQ7XR7.js";
|
|
6
|
+
import "./chunk-DMMTJQMQ.js";
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_MODEL,
|
|
9
|
+
buildAuthHeaders,
|
|
10
|
+
buildKeyParam,
|
|
11
|
+
getApiKey,
|
|
12
|
+
getVersionedApiBase,
|
|
13
|
+
isGatewayConfigured
|
|
14
|
+
} from "./chunk-3WFAEVKS.js";
|
|
15
|
+
import {
|
|
16
|
+
extractHeadingTitle
|
|
17
|
+
} from "./chunk-J7QGQD45.js";
|
|
18
|
+
import "./chunk-4SJWFTUP.js";
|
|
19
|
+
import {
|
|
20
|
+
activityMonitor
|
|
21
|
+
} from "./chunk-DAPBPCBP.js";
|
|
22
|
+
import "./chunk-VRB2IYGG.js";
|
|
23
|
+
import "./chunk-BRJX2PRC.js";
|
|
24
|
+
|
|
25
|
+
// packages/coding-agent/dist/builtin-extensions/pi-web-access/gemini-url-context.js
|
|
26
|
+
var EXTRACTION_PROMPT = `Extract the complete readable content from this URL as clean markdown.
|
|
27
|
+
Include the page title, all text content, code blocks, and tables.
|
|
28
|
+
Do not summarize \u2014 extract the full content.
|
|
29
|
+
|
|
30
|
+
URL: `;
|
|
31
|
+
function shouldRethrow(err) {
|
|
32
|
+
return (err instanceof Error ? err.message : String(err)).startsWith("Failed to parse ");
|
|
33
|
+
}
|
|
34
|
+
async function extractWithUrlContext(url, signal) {
|
|
35
|
+
let apiKey = getApiKey();
|
|
36
|
+
if (!apiKey && !isGatewayConfigured())
|
|
37
|
+
return null;
|
|
38
|
+
let activityId = activityMonitor.logStart({ type: "api", query: `url_context: ${url}` });
|
|
39
|
+
try {
|
|
40
|
+
let model = DEFAULT_MODEL, body = {
|
|
41
|
+
contents: [{ role: "user", parts: [{ text: EXTRACTION_PROMPT + url }] }],
|
|
42
|
+
tools: [{ url_context: {} }]
|
|
43
|
+
}, res = await fetch(`${getVersionedApiBase()}/models/${model}:generateContent${buildKeyParam(apiKey)}`, {
|
|
44
|
+
method: "POST",
|
|
45
|
+
headers: { "Content-Type": "application/json", ...buildAuthHeaders() },
|
|
46
|
+
body: JSON.stringify(body),
|
|
47
|
+
signal: AbortSignal.any([
|
|
48
|
+
AbortSignal.timeout(6e4),
|
|
49
|
+
...signal ? [signal] : []
|
|
50
|
+
])
|
|
51
|
+
});
|
|
52
|
+
if (!res.ok)
|
|
53
|
+
return activityMonitor.logComplete(activityId, res.status), null;
|
|
54
|
+
let data = await res.json();
|
|
55
|
+
activityMonitor.logComplete(activityId, res.status);
|
|
56
|
+
let metadata = data.candidates?.[0]?.url_context_metadata;
|
|
57
|
+
if (metadata?.url_metadata?.length) {
|
|
58
|
+
let status = metadata.url_metadata[0].url_retrieval_status;
|
|
59
|
+
if (status === "URL_RETRIEVAL_STATUS_UNSAFE" || status === "URL_RETRIEVAL_STATUS_ERROR")
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
let content = data.candidates?.[0]?.content?.parts?.map((p) => p.text).filter(Boolean).join(`
|
|
63
|
+
`) ?? "";
|
|
64
|
+
if (!content || content.length < 50)
|
|
65
|
+
return null;
|
|
66
|
+
let title = extractTitleFromContent(content, url);
|
|
67
|
+
return { url, title, content, error: null };
|
|
68
|
+
} catch (err) {
|
|
69
|
+
if (shouldRethrow(err))
|
|
70
|
+
throw err;
|
|
71
|
+
let message = err instanceof Error ? err.message : String(err);
|
|
72
|
+
return message.toLowerCase().includes("abort") ? activityMonitor.logComplete(activityId, 0) : activityMonitor.logError(activityId, message), null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function extractWithGeminiWeb(url, signal) {
|
|
76
|
+
let cookies = await isGeminiWebAvailable();
|
|
77
|
+
if (!cookies)
|
|
78
|
+
return null;
|
|
79
|
+
let activityId = activityMonitor.logStart({ type: "api", query: `gemini_web: ${url}` });
|
|
80
|
+
try {
|
|
81
|
+
let text = await queryWithCookies(EXTRACTION_PROMPT + url, cookies, {
|
|
82
|
+
model: "gemini-3-flash-preview",
|
|
83
|
+
signal,
|
|
84
|
+
timeoutMs: 6e4
|
|
85
|
+
});
|
|
86
|
+
if (activityMonitor.logComplete(activityId, 200), !text || text.length < 50)
|
|
87
|
+
return null;
|
|
88
|
+
let title = extractTitleFromContent(text, url);
|
|
89
|
+
return { url, title, content: text, error: null };
|
|
90
|
+
} catch (err) {
|
|
91
|
+
if (shouldRethrow(err))
|
|
92
|
+
throw err;
|
|
93
|
+
let message = err instanceof Error ? err.message : String(err);
|
|
94
|
+
return message.toLowerCase().includes("abort") ? activityMonitor.logComplete(activityId, 0) : activityMonitor.logError(activityId, message), null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function extractTitleFromContent(text, url) {
|
|
98
|
+
return extractHeadingTitle(text) ?? (new URL(url).pathname.split("/").pop() || url);
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
extractWithGeminiWeb,
|
|
102
|
+
extractWithUrlContext
|
|
103
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
getActiveGoogleEmail,
|
|
4
|
+
isGeminiWebAvailable,
|
|
5
|
+
queryWithCookies
|
|
6
|
+
} from "./chunk-XTHQ7XR7.js";
|
|
7
|
+
import "./chunk-DMMTJQMQ.js";
|
|
8
|
+
import "./chunk-VRB2IYGG.js";
|
|
9
|
+
import "./chunk-BRJX2PRC.js";
|
|
10
|
+
export {
|
|
11
|
+
getActiveGoogleEmail,
|
|
12
|
+
isGeminiWebAvailable,
|
|
13
|
+
queryWithCookies
|
|
14
|
+
};
|