@ashx-j/lunr-dev 0.2.13-dev.7.1 → 0.2.16-dev.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/dist/builtin-extensions/ashxj-tui.d.ts +14 -0
- package/dist/builtin-extensions/ashxj-tui.d.ts.map +1 -1
- package/dist/builtin-extensions/ashxj-tui.js +37 -3
- package/dist/builtin-extensions/ashxj-tui.js.map +1 -1
- package/dist/builtin-extensions/index.d.ts +1 -15
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +7 -21
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.d.ts.map +1 -1
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js +6 -2
- package/dist/builtin-extensions/narumiruna-pi-goal/src/goal.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts +4 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js +163 -169
- package/dist/builtin-extensions/pi-lsp-extension/src/index.js.map +1 -1
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts +46 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js +109 -0
- package/dist/builtin-extensions/pi-lsp-extension/src/runtime.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts +7 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js +211 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tool-executor.js.map +1 -0
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts +0 -5
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js +0 -202
- package/dist/builtin-extensions/pi-mcp-adapter/direct-tools.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/index.js +251 -94
- package/dist/builtin-extensions/pi-mcp-adapter/index.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts +4 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/init.js +10 -3
- package/dist/builtin-extensions/pi-mcp-adapter/init.js.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js +6 -1
- package/dist/builtin-extensions/pi-mcp-adapter/metadata-cache.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js +2 -1
- package/dist/builtin-extensions/pi-prompt-template-model/prompt-loader.js.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js +1 -1
- package/dist/builtin-extensions/pi-prompt-template-model/tool-manager.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +38 -14
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/fork-context.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/watchdog/review.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/extract.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/extract.js +105 -54
- package/dist/builtin-extensions/pi-web-access/extract.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/gemini-search.js +82 -65
- package/dist/builtin-extensions/pi-web-access/gemini-search.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/github-extract.js +2 -0
- package/dist/builtin-extensions/pi-web-access/github-extract.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +167 -77
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/lazy.d.ts +18 -0
- package/dist/builtin-extensions/pi-web-access/lazy.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/lazy.js +19 -0
- package/dist/builtin-extensions/pi-web-access/lazy.js.map +1 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts +6 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.js +17 -0
- package/dist/builtin-extensions/pi-web-access/session-cleanup.js.map +1 -0
- package/dist/catalog/models.json +1 -1
- package/dist/catalog/providers/amazon-bedrock.json +1 -1
- package/dist/catalog/providers/azure-openai-responses.json +1 -1
- package/dist/catalog/providers/fireworks.json +1 -1
- package/dist/catalog/providers/github-copilot.json +1 -1
- package/dist/catalog/providers/openai-codex.json +1 -1
- package/dist/catalog/providers/openai.json +1 -1
- package/dist/catalog/providers/opencode.json +1 -1
- package/dist/catalog/providers/openrouter.json +1 -1
- package/dist/catalog/providers/vercel-ai-gateway.json +1 -1
- package/dist/catalog/publication.json +131 -3
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -0
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli-runtime.d.ts +3 -0
- package/dist/cli-runtime.d.ts.map +1 -0
- package/dist/cli-runtime.js +73 -0
- package/dist/cli-runtime.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -53
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +56 -12
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/catalog-cache-scope.d.ts +3 -0
- package/dist/core/catalog-cache-scope.d.ts.map +1 -0
- package/dist/core/catalog-cache-scope.js +12 -0
- package/dist/core/catalog-cache-scope.js.map +1 -0
- package/dist/core/catalog-merge.d.ts +2 -0
- package/dist/core/catalog-merge.d.ts.map +1 -1
- package/dist/core/catalog-merge.js +29 -2
- package/dist/core/catalog-merge.js.map +1 -1
- package/dist/core/catalog-refresh-polling.d.ts +8 -0
- package/dist/core/catalog-refresh-polling.d.ts.map +1 -0
- package/dist/core/catalog-refresh-polling.js +30 -0
- package/dist/core/catalog-refresh-polling.js.map +1 -0
- package/dist/core/codex-catalog.d.ts +3 -0
- package/dist/core/codex-catalog.d.ts.map +1 -0
- package/dist/core/codex-catalog.js +15 -0
- package/dist/core/codex-catalog.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +10 -5
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/host-static.d.ts.map +1 -1
- package/dist/core/extensions/host-static.js +34 -12
- package/dist/core/extensions/host-static.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -2
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +10 -64
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +2 -0
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/live-catalog.d.ts +5 -2
- package/dist/core/live-catalog.d.ts.map +1 -1
- package/dist/core/live-catalog.js +108 -27
- package/dist/core/live-catalog.js.map +1 -1
- package/dist/core/model-runtime.d.ts +8 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +64 -12
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/official-catalog.d.ts +4 -0
- package/dist/core/official-catalog.d.ts.map +1 -1
- package/dist/core/official-catalog.js +86 -21
- package/dist/core/official-catalog.js.map +1 -1
- package/dist/core/permissions.d.ts +0 -2
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +10 -18
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +0 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/timings.d.ts +2 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +17 -2
- package/dist/core/timings.js.map +1 -1
- package/dist/gateway/commands.d.ts +1 -1
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +1 -18
- package/dist/gateway/commands.js.map +1 -1
- package/dist/main.d.ts +2 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +66 -48
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -22
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +141 -207
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +95 -84
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/node-runtime/agent-session-services-IFJMSX7Z.js +36 -0
- package/dist/node-runtime/benchmark-request-UC7PD3V3.js +57 -0
- package/dist/node-runtime/brave-UWDA3I22.js +143 -0
- package/dist/node-runtime/builtin-extensions-LYZ3BFWQ.js +28 -0
- package/dist/node-runtime/chunk-2QKLKMKC.js +173 -0
- package/dist/node-runtime/chunk-3GHXVUAK.js +21 -0
- package/dist/node-runtime/chunk-3RCWXWAY.js +466 -0
- package/dist/node-runtime/chunk-3WFAEVKS.js +115 -0
- package/dist/node-runtime/chunk-3X3KZKMI.js +49 -0
- package/dist/node-runtime/chunk-4HXHDDCF.js +16 -0
- package/dist/node-runtime/chunk-4TLO4PO2.js +3427 -0
- package/dist/node-runtime/chunk-4ZWGEEAS.js +69 -0
- package/dist/node-runtime/chunk-53YJI7JU.js +137 -0
- package/dist/node-runtime/chunk-5P7PZMRU.js +610 -0
- package/dist/node-runtime/chunk-7N3YHTYF.js +26 -0
- package/dist/node-runtime/chunk-7NBZ5P7I.js +24 -0
- package/dist/node-runtime/chunk-A2KQXUJD.js +105 -0
- package/dist/node-runtime/chunk-AD6VXAO7.js +342 -0
- package/dist/node-runtime/chunk-AHSTJBIB.js +64 -0
- package/dist/node-runtime/chunk-AJX357CL.js +20211 -0
- package/dist/node-runtime/chunk-ARC4KOTI.js +11178 -0
- package/dist/node-runtime/chunk-AUXVGBO4.js +19 -0
- package/dist/node-runtime/chunk-AY6CAJSL.js +30 -0
- package/dist/node-runtime/chunk-BHO7O6E5.js +296 -0
- package/dist/node-runtime/chunk-BI3DHYCN.js +8845 -0
- package/dist/node-runtime/chunk-BR7YDUKA.js +109 -0
- package/dist/node-runtime/chunk-BRJX2PRC.js +53 -0
- package/dist/node-runtime/chunk-C4O2RSQQ.js +37 -0
- package/dist/node-runtime/chunk-CCZJ3PYY.js +17 -0
- package/dist/node-runtime/chunk-CDFZEWPU.js +8388 -0
- package/dist/node-runtime/chunk-CGBXPL3E.js +1171 -0
- package/dist/node-runtime/chunk-CJECDQKP.js +19 -0
- package/dist/node-runtime/chunk-DAPBPCBP.js +53 -0
- package/dist/node-runtime/chunk-DDGMHUOW.js +305 -0
- package/dist/node-runtime/chunk-DMMTJQMQ.js +43 -0
- package/dist/node-runtime/chunk-DVGWF6A2.js +1180 -0
- package/dist/node-runtime/chunk-ECD5L7YI.js +1369 -0
- package/dist/node-runtime/chunk-EDBJNRSM.js +46 -0
- package/dist/node-runtime/chunk-F4VQFJI2.js +1269 -0
- package/dist/node-runtime/chunk-FVDOXRUD.js +96 -0
- package/dist/node-runtime/chunk-GZQHMEWL.js +126 -0
- package/dist/node-runtime/chunk-H2EOZYMP.js +57 -0
- package/dist/node-runtime/chunk-HQCKFM2O.js +56 -0
- package/dist/node-runtime/chunk-HYHJIRDW.js +19 -0
- package/dist/node-runtime/chunk-I6R76AG7.js +22 -0
- package/dist/node-runtime/chunk-IPA627GP.js +296 -0
- package/dist/node-runtime/chunk-JHYKXIMM.js +378 -0
- package/dist/node-runtime/chunk-KKSIVROT.js +88 -0
- package/dist/node-runtime/chunk-LZAW4ZX3.js +633 -0
- package/dist/node-runtime/chunk-M3LZLQW2.js +98 -0
- package/dist/node-runtime/chunk-MGWCVY6Y.js +47 -0
- package/dist/node-runtime/chunk-MJQDX3BA.js +72 -0
- package/dist/node-runtime/chunk-MKKH27PH.js +8956 -0
- package/dist/node-runtime/chunk-MX3GJNXJ.js +986 -0
- package/dist/node-runtime/chunk-N77MY65L.js +966 -0
- package/dist/node-runtime/chunk-NUIFPZWX.js +209 -0
- package/dist/node-runtime/chunk-OBMWP3I5.js +68 -0
- package/dist/node-runtime/chunk-OR4L3IB2.js +42 -0
- package/dist/node-runtime/chunk-PBC2Y6GS.js +903 -0
- package/dist/node-runtime/chunk-PCGNAY2O.js +1324 -0
- package/dist/node-runtime/chunk-PCIGF2XK.js +250 -0
- package/dist/node-runtime/chunk-PGAJ5MO5.js +7558 -0
- package/dist/node-runtime/chunk-PL6JKXWI.js +3622 -0
- package/dist/node-runtime/chunk-PVCDKGR6.js +55 -0
- package/dist/node-runtime/chunk-Q4Q6D4IY.js +364 -0
- package/dist/node-runtime/chunk-Q5ZU2VRT.js +83 -0
- package/dist/node-runtime/chunk-QFWG2RVL.js +5477 -0
- package/dist/node-runtime/chunk-QH42CDX3.js +9451 -0
- package/dist/node-runtime/chunk-RQ2Q5IYR.js +72 -0
- package/dist/node-runtime/chunk-RQ5DNUNG.js +429 -0
- package/dist/node-runtime/chunk-RRIZE6QQ.js +17 -0
- package/dist/node-runtime/chunk-SN6G4OU6.js +4753 -0
- package/dist/node-runtime/chunk-SWSN6HAB.js +53 -0
- package/dist/node-runtime/chunk-TQNSPERU.js +949 -0
- package/dist/node-runtime/chunk-VRB2IYGG.js +53 -0
- package/dist/node-runtime/chunk-VSELYKWU.js +772 -0
- package/dist/node-runtime/chunk-W3CVH5RX.js +62 -0
- package/dist/node-runtime/chunk-WJVFOIB5.js +24921 -0
- package/dist/node-runtime/chunk-WOVTOV5P.js +5653 -0
- package/dist/node-runtime/chunk-XBWPBZBN.js +125 -0
- package/dist/node-runtime/chunk-XTHQ7XR7.js +509 -0
- package/dist/node-runtime/chunk-YF63P5ZT.js +864 -0
- package/dist/node-runtime/chunk-YSKSB3BJ.js +295 -0
- package/dist/node-runtime/chunk-ZCHMJ34K.js +130 -0
- package/dist/node-runtime/chunk-ZKMFUD3Q.js +2834 -0
- package/dist/node-runtime/cli-runtime.js +81 -0
- package/dist/node-runtime/clipboard-OZ63BBC6.js +12 -0
- package/dist/node-runtime/clipboard-image-7QR6GXVA.js +13 -0
- package/dist/node-runtime/command-L3LAHDIH.js +13 -0
- package/dist/node-runtime/commands-RL5YBW5I.js +291 -0
- package/dist/node-runtime/config-FMEOZSWE.js +77 -0
- package/dist/node-runtime/curator-server-XCM43VEF.js +3816 -0
- package/dist/node-runtime/customize-XEXL2DGQ.js +12 -0
- package/dist/node-runtime/direct-tool-executor-JVDXTO7A.js +188 -0
- package/dist/node-runtime/exa-LL64QZR2.js +329 -0
- package/dist/node-runtime/export-html-KR26FOUZ.js +150 -0
- package/dist/node-runtime/extension-input-RV5N6APL.js +14 -0
- package/dist/node-runtime/extension-selector-CPD5LWDD.js +14 -0
- package/dist/node-runtime/extract-XLQSJN4V.js +17 -0
- package/dist/node-runtime/file-sync-HCOP2QVF.js +117 -0
- package/dist/node-runtime/gateway-X2TI5X7F.js +2484 -0
- package/dist/node-runtime/gemini-api-QE7ANVDZ.js +29 -0
- package/dist/node-runtime/gemini-search-U7SUMPQA.js +330 -0
- package/dist/node-runtime/gemini-url-context-PXWCBQHK.js +103 -0
- package/dist/node-runtime/gemini-web-MM446SEH.js +14 -0
- package/dist/node-runtime/github-extract-F64RZOEA.js +619 -0
- package/dist/node-runtime/goal-CZQ7FFQJ.js +1831 -0
- package/dist/node-runtime/index.js +859 -0
- package/dist/node-runtime/init-NJV2T55N.js +28 -0
- package/dist/node-runtime/install-cli-TH7IJJQQ.js +308 -0
- package/dist/node-runtime/interactive-mode-KOM35YF2.js +56 -0
- package/dist/node-runtime/interactive-view-U6OILKF3.js +249 -0
- package/dist/node-runtime/lsp-manager-3ASUSO4T.js +1104 -0
- package/dist/node-runtime/lunr-cron-YJ5UHYRD.js +268 -0
- package/dist/node-runtime/main.js +54 -0
- package/dist/node-runtime/mcp-auth-flow-QIXHW6QN.js +32 -0
- package/dist/node-runtime/mcp-panel-IIGMXQGP.js +501 -0
- package/dist/node-runtime/mcp-setup-panel-FEK7663I.js +355 -0
- package/dist/node-runtime/memory-cap-3S4XRLNP.js +20 -0
- package/dist/node-runtime/model-tiers-NJLHUEGK.js +20 -0
- package/dist/node-runtime/openai-search-B3MSNCQA.js +288 -0
- package/dist/node-runtime/package-manager-cli-TZZHJCVI.js +749 -0
- package/dist/node-runtime/parallel-AI2MNSCU.js +265 -0
- package/dist/node-runtime/parser-manager-TQHWYDH7.js +152 -0
- package/dist/node-runtime/pdf-extract-IPE6H4HP.js +57 -0
- package/dist/node-runtime/perplexity-QVJW3I35.js +12 -0
- package/dist/node-runtime/pi-intercom-EEMBGQID.js +2215 -0
- package/dist/node-runtime/pi-mcp-adapter-QFB37AVN.js +422 -0
- package/dist/node-runtime/pi-ollama-cloud-4VZRMULP.js +1440 -0
- package/dist/node-runtime/pi-prompt-template-model-4QT4LLXF.js +3946 -0
- package/dist/node-runtime/pi-subagents-7XJ4H53P.js +6023 -0
- package/dist/node-runtime/pi-web-access-DPGAVKOA.js +1864 -0
- package/dist/node-runtime/print-mode-VWIRFDAC.js +12 -0
- package/dist/node-runtime/proxy-modes-HEEFK4KC.js +685 -0
- package/dist/node-runtime/rpc-entry.js +62 -0
- package/dist/node-runtime/rpc-mode-SJNSOA4G.js +13 -0
- package/dist/node-runtime/runtime-bridges-PPHNBFWL.js +14 -0
- package/dist/node-runtime/session-manager-MQNBYACL.js +35 -0
- package/dist/node-runtime/session-selector-5AZLJS6U.js +14 -0
- package/dist/node-runtime/settings-manager-5LF2VQWC.js +21 -0
- package/dist/node-runtime/src-Y7JSCK64.js +2407 -0
- package/dist/node-runtime/subagent-executor-5RNDEPIJ.js +8483 -0
- package/dist/node-runtime/summary-review-YSMXKITO.js +228 -0
- package/dist/node-runtime/tavily-WEZFVFP7.js +154 -0
- package/dist/node-runtime/timings-UAD5BEAS.js +16 -0
- package/dist/node-runtime/tool-renderer-MV5O452K.js +204 -0
- package/dist/node-runtime/update-cli-A253SZ7P.js +73 -0
- package/dist/node-runtime/v4-5MNC3H7G.js +424 -0
- package/dist/node-runtime/video-extract-OYT5WKS5.js +304 -0
- package/dist/node-runtime/workspace-index-6DBXSTJ6.js +163 -0
- package/dist/node-runtime/youtube-extract-TQYKGFGS.js +264 -0
- package/dist/startup/benchmark-request.d.ts +3 -0
- package/dist/startup/benchmark-request.d.ts.map +1 -0
- package/dist/startup/benchmark-request.js +65 -0
- package/dist/startup/benchmark-request.js.map +1 -0
- package/dist/startup/interactive-view.d.ts +55 -0
- package/dist/startup/interactive-view.d.ts.map +1 -0
- package/dist/startup/interactive-view.js +332 -0
- package/dist/startup/interactive-view.js.map +1 -0
- package/dist/startup/launch-routing.d.ts.map +1 -1
- package/dist/startup/launch-routing.js +9 -10
- package/dist/startup/launch-routing.js.map +1 -1
- package/dist/startup/startup-milestones.d.ts +1 -1
- package/dist/startup/startup-milestones.d.ts.map +1 -1
- package/dist/startup/startup-milestones.js +3 -2
- package/dist/startup/startup-milestones.js.map +1 -1
- package/dist/utils/await-with-abort.d.ts +2 -0
- package/dist/utils/await-with-abort.d.ts.map +1 -0
- package/dist/utils/await-with-abort.js +19 -0
- package/dist/utils/await-with-abort.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +10 -4
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/docs/compaction.md +5 -3
- package/docs/development.md +5 -1
- package/docs/features.md +0 -1
- package/docs/interactive-startup.md +98 -0
- package/docs/model-catalog.md +29 -0
- package/docs/usage.md +0 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +20 -20
- package/dist/core/swarm.d.ts +0 -23
- package/dist/core/swarm.d.ts.map +0 -1
- package/dist/core/swarm.js +0 -45
- package/dist/core/swarm.js.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
estimateTokens
|
|
4
|
+
} from "./chunk-TQNSPERU.js";
|
|
5
|
+
|
|
6
|
+
// packages/coding-agent/dist/core/context-breakdown.js
|
|
7
|
+
var CHARS_PER_TOKEN = 4, PROJECT_CONTEXT_RE = /<project_context>[\s\S]*?<\/project_context>/, PROJECT_INSTRUCTIONS_RE = /<project_instructions(?:\s+path="([^"]*)")?>([\s\S]*?)<\/project_instructions>/g, SKILLS_BLOCK_RE = /\n\nThe following skills provide specialized instructions for specific tasks\.[\s\S]*<\/available_skills>/;
|
|
8
|
+
function estimateChars(text) {
|
|
9
|
+
return text.length === 0 ? 0 : Math.ceil(text.length / CHARS_PER_TOKEN);
|
|
10
|
+
}
|
|
11
|
+
function contextFileLabel(filePath, globalAgentsPath, modelAgentsPath) {
|
|
12
|
+
if (!filePath)
|
|
13
|
+
return "AGENTS.md";
|
|
14
|
+
let normalized = filePath.replace(/\\/g, "/");
|
|
15
|
+
if (globalAgentsPath && normalized.toLowerCase() === globalAgentsPath.replace(/\\/g, "/").toLowerCase())
|
|
16
|
+
return "Global AGENTS.md";
|
|
17
|
+
if (modelAgentsPath && normalized.toLowerCase() === modelAgentsPath.replace(/\\/g, "/").toLowerCase())
|
|
18
|
+
return `${normalized.split("/").at(-2) ?? "Model"} AGENTS.md`;
|
|
19
|
+
let slash = normalized.lastIndexOf("/");
|
|
20
|
+
return slash === -1 ? normalized : normalized.slice(slash + 1);
|
|
21
|
+
}
|
|
22
|
+
function splitSystemPromptSections(systemPrompt) {
|
|
23
|
+
let remaining = systemPrompt, contextFiles = [], contextMatch = remaining.match(PROJECT_CONTEXT_RE);
|
|
24
|
+
if (contextMatch) {
|
|
25
|
+
let block = contextMatch[0];
|
|
26
|
+
PROJECT_INSTRUCTIONS_RE.lastIndex = 0;
|
|
27
|
+
for (let match of block.matchAll(PROJECT_INSTRUCTIONS_RE))
|
|
28
|
+
contextFiles.push({
|
|
29
|
+
path: match[1],
|
|
30
|
+
content: match[2] ?? ""
|
|
31
|
+
});
|
|
32
|
+
remaining = remaining.replace(block, "");
|
|
33
|
+
}
|
|
34
|
+
let skills = "", skillsMatch = remaining.match(SKILLS_BLOCK_RE);
|
|
35
|
+
return skillsMatch && (skills = skillsMatch[0], remaining = remaining.replace(skills, "")), { base: remaining, contextFiles, skills };
|
|
36
|
+
}
|
|
37
|
+
function estimateToolDefinitionTokens(tools) {
|
|
38
|
+
let chars = 0;
|
|
39
|
+
for (let tool of tools) {
|
|
40
|
+
chars += tool.name.length + tool.description.length;
|
|
41
|
+
try {
|
|
42
|
+
let schema = JSON.stringify(tool.parameters);
|
|
43
|
+
schema && (chars += schema.length);
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return Math.ceil(chars / CHARS_PER_TOKEN);
|
|
48
|
+
}
|
|
49
|
+
function computeContextBreakdown(input) {
|
|
50
|
+
let sections = splitSystemPromptSections(input.systemPrompt), systemPrompt = estimateChars(sections.base), contextFiles = sections.contextFiles.map((file) => ({
|
|
51
|
+
label: contextFileLabel(file.path, input.globalAgentsPath, input.modelAgentsPath),
|
|
52
|
+
path: file.path,
|
|
53
|
+
tokens: estimateChars(file.content)
|
|
54
|
+
})), skills = estimateChars(sections.skills), toolDefinitions = estimateToolDefinitionTokens(input.tools), user = 0, assistantText = 0, thinking = 0, toolCalls = 0, toolResults = 0, summaries = 0, counts = {
|
|
55
|
+
user: 0,
|
|
56
|
+
assistantText: 0,
|
|
57
|
+
thinking: 0,
|
|
58
|
+
toolCalls: 0,
|
|
59
|
+
toolResults: 0,
|
|
60
|
+
summaries: 0
|
|
61
|
+
};
|
|
62
|
+
for (let message of input.messages)
|
|
63
|
+
switch (message.role) {
|
|
64
|
+
case "assistant": {
|
|
65
|
+
let textChars = 0, thinkingChars = 0, toolCallChars = 0;
|
|
66
|
+
for (let block of message.content)
|
|
67
|
+
block.type === "text" ? textChars += block.text.length : block.type === "thinking" ? thinkingChars += block.thinking.length : block.type === "toolCall" && (toolCallChars += block.name.length + JSON.stringify(block.arguments).length);
|
|
68
|
+
assistantText += Math.ceil(textChars / CHARS_PER_TOKEN), thinking += Math.ceil(thinkingChars / CHARS_PER_TOKEN), toolCalls += Math.ceil(toolCallChars / CHARS_PER_TOKEN), textChars > 0 && counts.assistantText++, thinkingChars > 0 && counts.thinking++, toolCallChars > 0 && counts.toolCalls++;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case "user":
|
|
72
|
+
case "custom":
|
|
73
|
+
user += estimateTokens(message), counts.user++;
|
|
74
|
+
break;
|
|
75
|
+
case "toolResult":
|
|
76
|
+
case "bashExecution":
|
|
77
|
+
toolResults += estimateTokens(message), counts.toolResults++;
|
|
78
|
+
break;
|
|
79
|
+
case "branchSummary":
|
|
80
|
+
case "compactionSummary":
|
|
81
|
+
summaries += estimateTokens(message), counts.summaries++;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
let contextFileTokens = contextFiles.reduce((sum, file) => sum + file.tokens, 0), total = systemPrompt + contextFileTokens + skills + toolDefinitions + user + assistantText + thinking + toolCalls + toolResults + summaries;
|
|
85
|
+
return {
|
|
86
|
+
systemPrompt,
|
|
87
|
+
contextFiles,
|
|
88
|
+
skills,
|
|
89
|
+
toolDefinitions,
|
|
90
|
+
user,
|
|
91
|
+
assistantText,
|
|
92
|
+
thinking,
|
|
93
|
+
toolCalls,
|
|
94
|
+
toolResults,
|
|
95
|
+
summaries,
|
|
96
|
+
total,
|
|
97
|
+
contextWindow: input.contextWindow,
|
|
98
|
+
free: Math.max(0, input.contextWindow - total),
|
|
99
|
+
counts
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
computeContextBreakdown
|
|
105
|
+
};
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
loadPhoton
|
|
4
|
+
} from "./chunk-RQ2Q5IYR.js";
|
|
5
|
+
|
|
6
|
+
// packages/coding-agent/dist/utils/exif-orientation.js
|
|
7
|
+
function readOrientationFromTiff(bytes, tiffStart) {
|
|
8
|
+
if (tiffStart + 8 > bytes.length)
|
|
9
|
+
return 1;
|
|
10
|
+
let le = (bytes[tiffStart] << 8 | bytes[tiffStart + 1]) === 18761, read16 = (pos) => le ? bytes[pos] | bytes[pos + 1] << 8 : bytes[pos] << 8 | bytes[pos + 1], ifdOffset = ((pos) => le ? bytes[pos] | bytes[pos + 1] << 8 | bytes[pos + 2] << 16 | bytes[pos + 3] << 24 : (bytes[pos] << 24 | bytes[pos + 1] << 16 | bytes[pos + 2] << 8 | bytes[pos + 3]) >>> 0)(tiffStart + 4), ifdStart = tiffStart + ifdOffset;
|
|
11
|
+
if (ifdStart + 2 > bytes.length)
|
|
12
|
+
return 1;
|
|
13
|
+
let entryCount = read16(ifdStart);
|
|
14
|
+
for (let i = 0; i < entryCount; i++) {
|
|
15
|
+
let entryPos = ifdStart + 2 + i * 12;
|
|
16
|
+
if (entryPos + 12 > bytes.length)
|
|
17
|
+
return 1;
|
|
18
|
+
if (read16(entryPos) === 274) {
|
|
19
|
+
let value = read16(entryPos + 8);
|
|
20
|
+
return value >= 1 && value <= 8 ? value : 1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return 1;
|
|
24
|
+
}
|
|
25
|
+
function findJpegTiffOffset(bytes) {
|
|
26
|
+
let offset = 2;
|
|
27
|
+
for (; offset < bytes.length - 1; ) {
|
|
28
|
+
if (bytes[offset] !== 255)
|
|
29
|
+
return -1;
|
|
30
|
+
let marker = bytes[offset + 1];
|
|
31
|
+
if (marker === 255) {
|
|
32
|
+
offset++;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (marker === 225) {
|
|
36
|
+
if (offset + 4 >= bytes.length)
|
|
37
|
+
return -1;
|
|
38
|
+
let segmentStart = offset + 4;
|
|
39
|
+
return segmentStart + 6 > bytes.length || !hasExifHeader(bytes, segmentStart) ? -1 : segmentStart + 6;
|
|
40
|
+
}
|
|
41
|
+
if (offset + 4 > bytes.length)
|
|
42
|
+
return -1;
|
|
43
|
+
let length = bytes[offset + 2] << 8 | bytes[offset + 3];
|
|
44
|
+
offset += 2 + length;
|
|
45
|
+
}
|
|
46
|
+
return -1;
|
|
47
|
+
}
|
|
48
|
+
function findWebpTiffOffset(bytes) {
|
|
49
|
+
let offset = 12;
|
|
50
|
+
for (; offset + 8 <= bytes.length; ) {
|
|
51
|
+
let chunkId = String.fromCharCode(bytes[offset], bytes[offset + 1], bytes[offset + 2], bytes[offset + 3]), chunkSize = bytes[offset + 4] | bytes[offset + 5] << 8 | bytes[offset + 6] << 16 | bytes[offset + 7] << 24, dataStart = offset + 8;
|
|
52
|
+
if (chunkId === "EXIF")
|
|
53
|
+
return dataStart + chunkSize > bytes.length ? -1 : chunkSize >= 6 && hasExifHeader(bytes, dataStart) ? dataStart + 6 : dataStart;
|
|
54
|
+
offset = dataStart + chunkSize + chunkSize % 2;
|
|
55
|
+
}
|
|
56
|
+
return -1;
|
|
57
|
+
}
|
|
58
|
+
function hasExifHeader(bytes, offset) {
|
|
59
|
+
return bytes[offset] === 69 && bytes[offset + 1] === 120 && bytes[offset + 2] === 105 && bytes[offset + 3] === 102 && bytes[offset + 4] === 0 && bytes[offset + 5] === 0;
|
|
60
|
+
}
|
|
61
|
+
function getExifOrientation(bytes) {
|
|
62
|
+
let tiffOffset = -1;
|
|
63
|
+
return bytes.length >= 2 && bytes[0] === 255 && bytes[1] === 216 ? tiffOffset = findJpegTiffOffset(bytes) : bytes.length >= 12 && bytes[0] === 82 && bytes[1] === 73 && bytes[2] === 70 && bytes[3] === 70 && bytes[8] === 87 && bytes[9] === 69 && bytes[10] === 66 && bytes[11] === 80 && (tiffOffset = findWebpTiffOffset(bytes)), tiffOffset === -1 ? 1 : readOrientationFromTiff(bytes, tiffOffset);
|
|
64
|
+
}
|
|
65
|
+
function rotate90(photon, image, dstIndex) {
|
|
66
|
+
let w = image.get_width(), h = image.get_height(), src = image.get_raw_pixels(), dst = new Uint8Array(src.length);
|
|
67
|
+
for (let y = 0; y < h; y++)
|
|
68
|
+
for (let x = 0; x < w; x++) {
|
|
69
|
+
let srcIdx = (y * w + x) * 4, dstIdx = dstIndex(x, y, w, h) * 4;
|
|
70
|
+
dst[dstIdx] = src[srcIdx], dst[dstIdx + 1] = src[srcIdx + 1], dst[dstIdx + 2] = src[srcIdx + 2], dst[dstIdx + 3] = src[srcIdx + 3];
|
|
71
|
+
}
|
|
72
|
+
return new photon.PhotonImage(dst, h, w);
|
|
73
|
+
}
|
|
74
|
+
function applyExifOrientation(photon, image, originalBytes) {
|
|
75
|
+
let orientation = getExifOrientation(originalBytes);
|
|
76
|
+
if (orientation === 1)
|
|
77
|
+
return image;
|
|
78
|
+
switch (orientation) {
|
|
79
|
+
case 2:
|
|
80
|
+
return photon.fliph(image), image;
|
|
81
|
+
case 3:
|
|
82
|
+
return photon.fliph(image), photon.flipv(image), image;
|
|
83
|
+
case 4:
|
|
84
|
+
return photon.flipv(image), image;
|
|
85
|
+
case 5: {
|
|
86
|
+
let rotated = rotate90(photon, image, (x, y, _w, h) => x * h + (h - 1 - y));
|
|
87
|
+
return photon.fliph(rotated), rotated;
|
|
88
|
+
}
|
|
89
|
+
case 6:
|
|
90
|
+
return rotate90(photon, image, (x, y, _w, h) => x * h + (h - 1 - y));
|
|
91
|
+
case 7: {
|
|
92
|
+
let rotated = rotate90(photon, image, (x, y, w, h) => (w - 1 - x) * h + y);
|
|
93
|
+
return photon.fliph(rotated), rotated;
|
|
94
|
+
}
|
|
95
|
+
case 8:
|
|
96
|
+
return rotate90(photon, image, (x, y, w, h) => (w - 1 - x) * h + y);
|
|
97
|
+
default:
|
|
98
|
+
return image;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// packages/coding-agent/dist/utils/image-convert.js
|
|
103
|
+
async function convertImageBytesToPng(bytes) {
|
|
104
|
+
let photon = await loadPhoton();
|
|
105
|
+
if (!photon)
|
|
106
|
+
return null;
|
|
107
|
+
try {
|
|
108
|
+
let rawImage = photon.PhotonImage.new_from_byteslice(bytes), image = applyExifOrientation(photon, rawImage, bytes);
|
|
109
|
+
image !== rawImage && rawImage.free();
|
|
110
|
+
try {
|
|
111
|
+
return new Uint8Array(image.get_bytes());
|
|
112
|
+
} finally {
|
|
113
|
+
image.free();
|
|
114
|
+
}
|
|
115
|
+
} catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function convertToPng(base64Data, mimeType) {
|
|
120
|
+
if (mimeType === "image/png")
|
|
121
|
+
return { data: base64Data, mimeType };
|
|
122
|
+
let bytes = new Uint8Array(Buffer.from(base64Data, "base64")), pngBytes = await convertImageBytesToPng(bytes);
|
|
123
|
+
return pngBytes ? {
|
|
124
|
+
data: Buffer.from(pngBytes).toString("base64"),
|
|
125
|
+
mimeType: "image/png"
|
|
126
|
+
} : null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// packages/coding-agent/dist/utils/image-resize.js
|
|
130
|
+
import { Worker } from "node:worker_threads";
|
|
131
|
+
|
|
132
|
+
// packages/coding-agent/dist/utils/image-resize-core.js
|
|
133
|
+
var DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024, DEFAULT_OPTIONS = {
|
|
134
|
+
maxWidth: 2e3,
|
|
135
|
+
maxHeight: 2e3,
|
|
136
|
+
maxBytes: DEFAULT_MAX_BYTES,
|
|
137
|
+
jpegQuality: 80
|
|
138
|
+
};
|
|
139
|
+
function encodeCandidate(buffer, mimeType) {
|
|
140
|
+
let data = Buffer.from(buffer).toString("base64");
|
|
141
|
+
return {
|
|
142
|
+
data,
|
|
143
|
+
encodedSize: Buffer.byteLength(data, "utf-8"),
|
|
144
|
+
mimeType
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
async function resizeImageInProcess(inputBytes, mimeType, options) {
|
|
148
|
+
let opts = { ...DEFAULT_OPTIONS, ...options }, inputBase64Size = Math.ceil(inputBytes.byteLength / 3) * 4, photon = await loadPhoton();
|
|
149
|
+
if (!photon)
|
|
150
|
+
return null;
|
|
151
|
+
let image;
|
|
152
|
+
try {
|
|
153
|
+
let tryEncodings = function(width, height, jpegQualities) {
|
|
154
|
+
let resized = photon.resize(image, width, height, photon.SamplingFilter.Lanczos3);
|
|
155
|
+
try {
|
|
156
|
+
let candidates = [encodeCandidate(resized.get_bytes(), "image/png")];
|
|
157
|
+
for (let quality of jpegQualities)
|
|
158
|
+
candidates.push(encodeCandidate(resized.get_bytes_jpeg(quality), "image/jpeg"));
|
|
159
|
+
return candidates;
|
|
160
|
+
} finally {
|
|
161
|
+
resized.free();
|
|
162
|
+
}
|
|
163
|
+
}, rawImage = photon.PhotonImage.new_from_byteslice(inputBytes);
|
|
164
|
+
image = applyExifOrientation(photon, rawImage, inputBytes), image !== rawImage && rawImage.free();
|
|
165
|
+
let originalWidth = image.get_width(), originalHeight = image.get_height(), format = mimeType.split("/")[1] ?? "png";
|
|
166
|
+
if (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && inputBase64Size < opts.maxBytes)
|
|
167
|
+
return {
|
|
168
|
+
data: Buffer.from(inputBytes).toString("base64"),
|
|
169
|
+
mimeType: mimeType || `image/${format}`,
|
|
170
|
+
originalWidth,
|
|
171
|
+
originalHeight,
|
|
172
|
+
width: originalWidth,
|
|
173
|
+
height: originalHeight,
|
|
174
|
+
wasResized: !1
|
|
175
|
+
};
|
|
176
|
+
let targetWidth = originalWidth, targetHeight = originalHeight;
|
|
177
|
+
targetWidth > opts.maxWidth && (targetHeight = Math.round(targetHeight * opts.maxWidth / targetWidth), targetWidth = opts.maxWidth), targetHeight > opts.maxHeight && (targetWidth = Math.round(targetWidth * opts.maxHeight / targetHeight), targetHeight = opts.maxHeight);
|
|
178
|
+
let qualitySteps = Array.from(/* @__PURE__ */ new Set([opts.jpegQuality, 85, 70, 55, 40])), currentWidth = targetWidth, currentHeight = targetHeight;
|
|
179
|
+
for (; ; ) {
|
|
180
|
+
let candidates = tryEncodings(currentWidth, currentHeight, qualitySteps);
|
|
181
|
+
for (let candidate of candidates)
|
|
182
|
+
if (candidate.encodedSize < opts.maxBytes)
|
|
183
|
+
return {
|
|
184
|
+
data: candidate.data,
|
|
185
|
+
mimeType: candidate.mimeType,
|
|
186
|
+
originalWidth,
|
|
187
|
+
originalHeight,
|
|
188
|
+
width: currentWidth,
|
|
189
|
+
height: currentHeight,
|
|
190
|
+
wasResized: !0
|
|
191
|
+
};
|
|
192
|
+
if (currentWidth === 1 && currentHeight === 1)
|
|
193
|
+
break;
|
|
194
|
+
let nextWidth = currentWidth === 1 ? 1 : Math.max(1, Math.floor(currentWidth * 0.75)), nextHeight = currentHeight === 1 ? 1 : Math.max(1, Math.floor(currentHeight * 0.75));
|
|
195
|
+
if (nextWidth === currentWidth && nextHeight === currentHeight)
|
|
196
|
+
break;
|
|
197
|
+
currentWidth = nextWidth, currentHeight = nextHeight;
|
|
198
|
+
}
|
|
199
|
+
return null;
|
|
200
|
+
} catch {
|
|
201
|
+
return null;
|
|
202
|
+
} finally {
|
|
203
|
+
image && image.free();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// packages/coding-agent/dist/utils/image-resize.js
|
|
208
|
+
function toTransferableBytes(input) {
|
|
209
|
+
return new Uint8Array(input);
|
|
210
|
+
}
|
|
211
|
+
function isResizeImageWorkerResponse(value) {
|
|
212
|
+
return value !== null && typeof value == "object";
|
|
213
|
+
}
|
|
214
|
+
function createResizeWorker(workerSpecifier) {
|
|
215
|
+
return new Worker(workerSpecifier);
|
|
216
|
+
}
|
|
217
|
+
async function resizeImageInWorker(workerSpecifier, inputBytes, mimeType, options) {
|
|
218
|
+
let worker = createResizeWorker(workerSpecifier);
|
|
219
|
+
try {
|
|
220
|
+
let inputBytesForWorker = toTransferableBytes(inputBytes);
|
|
221
|
+
return await new Promise((resolve, reject) => {
|
|
222
|
+
let settled = !1, settle = (result) => {
|
|
223
|
+
settled || (settled = !0, resolve(result));
|
|
224
|
+
}, fail = (error) => {
|
|
225
|
+
settled || (settled = !0, reject(error));
|
|
226
|
+
};
|
|
227
|
+
worker.once("message", (message) => {
|
|
228
|
+
if (!isResizeImageWorkerResponse(message)) {
|
|
229
|
+
fail(new Error("Invalid image resize worker response"));
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (message.error) {
|
|
233
|
+
fail(new Error(message.error));
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
settle(message.result ?? null);
|
|
237
|
+
}), worker.once("error", fail), worker.once("exit", (code) => {
|
|
238
|
+
settled || fail(new Error(`Image resize worker exited with code ${code}`));
|
|
239
|
+
}), worker.postMessage({
|
|
240
|
+
inputBytes: inputBytesForWorker,
|
|
241
|
+
mimeType,
|
|
242
|
+
options
|
|
243
|
+
}, [inputBytesForWorker.buffer]);
|
|
244
|
+
});
|
|
245
|
+
} finally {
|
|
246
|
+
worker.terminate().catch(() => {
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
async function resizeImage(inputBytes, mimeType, options) {
|
|
251
|
+
let isTypeScriptRuntime = new URL("../utils/image-resize.js", import.meta.url).href.endsWith(".ts"), workerUrl = new URL(isTypeScriptRuntime ? "./image-resize-worker.ts" : "./image-resize-worker.js", new URL("../utils/image-resize.js", import.meta.url).href);
|
|
252
|
+
if (typeof process.versions.bun == "string")
|
|
253
|
+
try {
|
|
254
|
+
return await resizeImageInWorker("./src/utils/image-resize-worker.ts", inputBytes, mimeType, options);
|
|
255
|
+
} catch {
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
return await resizeImageInWorker(workerUrl, inputBytes, mimeType, options);
|
|
259
|
+
} catch {
|
|
260
|
+
return resizeImageInProcess(inputBytes, mimeType, options);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function formatDimensionNote(result) {
|
|
264
|
+
if (!result.wasResized)
|
|
265
|
+
return;
|
|
266
|
+
let scale = result.originalWidth / result.width;
|
|
267
|
+
return `[Image: original ${result.originalWidth}x${result.originalHeight}, displayed at ${result.width}x${result.height}. Multiply coordinates by ${scale.toFixed(2)} to map to original image.]`;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// packages/coding-agent/dist/utils/image-process.js
|
|
271
|
+
function baseMimeType(mimeType) {
|
|
272
|
+
return mimeType.split(";")[0]?.trim().toLowerCase() ?? mimeType.toLowerCase();
|
|
273
|
+
}
|
|
274
|
+
function normalizeSupportedImageMimeType(mimeType) {
|
|
275
|
+
switch (baseMimeType(mimeType)) {
|
|
276
|
+
case "image/png":
|
|
277
|
+
return "image/png";
|
|
278
|
+
case "image/jpeg":
|
|
279
|
+
case "image/jpg":
|
|
280
|
+
return "image/jpeg";
|
|
281
|
+
case "image/gif":
|
|
282
|
+
return "image/gif";
|
|
283
|
+
case "image/webp":
|
|
284
|
+
return "image/webp";
|
|
285
|
+
default:
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
async function normalizeImage(bytes, mimeType) {
|
|
290
|
+
let normalizedMimeType = normalizeSupportedImageMimeType(mimeType);
|
|
291
|
+
if (normalizedMimeType)
|
|
292
|
+
return { bytes, mimeType: normalizedMimeType };
|
|
293
|
+
let pngBytes = await convertImageBytesToPng(bytes);
|
|
294
|
+
return pngBytes ? {
|
|
295
|
+
bytes: pngBytes,
|
|
296
|
+
mimeType: "image/png",
|
|
297
|
+
convertedFrom: baseMimeType(mimeType)
|
|
298
|
+
} : null;
|
|
299
|
+
}
|
|
300
|
+
function conversionHint(from, to) {
|
|
301
|
+
if (!(!from || from === to))
|
|
302
|
+
return `[Image converted from ${from} to ${to}.]`;
|
|
303
|
+
}
|
|
304
|
+
async function processImage(bytes, mimeType, options) {
|
|
305
|
+
let autoResizeImages = options?.autoResizeImages ?? !0, normalized = await normalizeImage(bytes, mimeType);
|
|
306
|
+
if (!normalized)
|
|
307
|
+
return {
|
|
308
|
+
ok: !1,
|
|
309
|
+
message: "[Image omitted: could not be converted to a supported inline image format.]"
|
|
310
|
+
};
|
|
311
|
+
if (autoResizeImages) {
|
|
312
|
+
let resized = await resizeImage(normalized.bytes, normalized.mimeType, options?.resizeOptions);
|
|
313
|
+
if (!resized)
|
|
314
|
+
return {
|
|
315
|
+
ok: !1,
|
|
316
|
+
message: "[Image omitted: could not be resized below the inline image size limit.]"
|
|
317
|
+
};
|
|
318
|
+
let hints2 = [], convertedHint2 = conversionHint(normalized.convertedFrom, resized.mimeType);
|
|
319
|
+
convertedHint2 && hints2.push(convertedHint2);
|
|
320
|
+
let dimensionNote = formatDimensionNote(resized);
|
|
321
|
+
return dimensionNote && hints2.push(dimensionNote), {
|
|
322
|
+
ok: !0,
|
|
323
|
+
data: resized.data,
|
|
324
|
+
mimeType: resized.mimeType,
|
|
325
|
+
hints: hints2
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
let hints = [], convertedHint = conversionHint(normalized.convertedFrom, normalized.mimeType);
|
|
329
|
+
return convertedHint && hints.push(convertedHint), {
|
|
330
|
+
ok: !0,
|
|
331
|
+
data: Buffer.from(normalized.bytes).toString("base64"),
|
|
332
|
+
mimeType: normalized.mimeType,
|
|
333
|
+
hints
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export {
|
|
338
|
+
convertToPng,
|
|
339
|
+
resizeImage,
|
|
340
|
+
formatDimensionNote,
|
|
341
|
+
processImage
|
|
342
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
getModelTiersBridge,
|
|
4
|
+
registerModelTierBridge
|
|
5
|
+
} from "./chunk-W3CVH5RX.js";
|
|
6
|
+
import {
|
|
7
|
+
isRollbackSessionForceEnabled,
|
|
8
|
+
registerUsageServiceBridge
|
|
9
|
+
} from "./chunk-YF63P5ZT.js";
|
|
10
|
+
import {
|
|
11
|
+
registerCustomizeBridge
|
|
12
|
+
} from "./chunk-HQCKFM2O.js";
|
|
13
|
+
import {
|
|
14
|
+
registerMemoryCapBridge
|
|
15
|
+
} from "./chunk-AY6CAJSL.js";
|
|
16
|
+
|
|
17
|
+
// packages/coding-agent/dist/core/settings-tools-bridge.js
|
|
18
|
+
var SETTINGS_TOOLS_BRIDGE_SYMBOL = /* @__PURE__ */ Symbol.for("@lunr/settings-tools"), activeSettingsManager, sessionIdProvider;
|
|
19
|
+
function manager() {
|
|
20
|
+
if (!activeSettingsManager)
|
|
21
|
+
throw new Error("Settings are unavailable in this runtime. Reload lunR and try again.");
|
|
22
|
+
return activeSettingsManager;
|
|
23
|
+
}
|
|
24
|
+
var bridge = {
|
|
25
|
+
getModelTiers: () => manager().getModelTiers(),
|
|
26
|
+
setModelTiers(update) {
|
|
27
|
+
let settings = manager();
|
|
28
|
+
update.enabled !== void 0 && settings.setModelTiersEnabled(update.enabled);
|
|
29
|
+
for (let tier of ["light", "standard", "heavy"]) {
|
|
30
|
+
let model = update[tier];
|
|
31
|
+
model !== void 0 && settings.setTierModel(tier, model);
|
|
32
|
+
let key = `${tier}Thinking`;
|
|
33
|
+
update[key] !== void 0 && settings.setTierThinking(tier, update[key] ?? void 0);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
getAutoManageSubscriptions: () => manager().getAutoManageSubscriptions(),
|
|
37
|
+
setAutoManageSubscriptions: (enabled) => manager().setAutoManageSubscriptions(enabled),
|
|
38
|
+
getRollback: () => ({
|
|
39
|
+
enabled: manager().getRollbackEnabled(),
|
|
40
|
+
turns: manager().getRollbackTurns(),
|
|
41
|
+
capture: manager().getRollbackCapture(),
|
|
42
|
+
scope: manager().getRollbackScope(),
|
|
43
|
+
forcedByAuto: isRollbackSessionForceEnabled(sessionIdProvider?.())
|
|
44
|
+
}),
|
|
45
|
+
setRollback(update) {
|
|
46
|
+
let settings = manager();
|
|
47
|
+
update.enabled !== void 0 && settings.setRollbackEnabled(update.enabled), update.turns !== void 0 && settings.setRollbackTurns(update.turns), update.capture !== void 0 && settings.setRollbackCapture(update.capture), update.scope !== void 0 && settings.setRollbackScope(update.scope);
|
|
48
|
+
},
|
|
49
|
+
getSessionRetentionDays: () => manager().getSessionRetentionDays(),
|
|
50
|
+
setSessionRetentionDays: (days) => manager().setSessionRetentionDays(days)
|
|
51
|
+
};
|
|
52
|
+
function registerSettingsToolsBridge(settingsManager, getSessionId) {
|
|
53
|
+
activeSettingsManager = settingsManager, sessionIdProvider = getSessionId, globalThis[SETTINGS_TOOLS_BRIDGE_SYMBOL] = bridge;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// packages/coding-agent/dist/core/runtime-bridges.js
|
|
57
|
+
function bindRuntimeBridges({ session, services }) {
|
|
58
|
+
let { settingsManager, modelRuntime } = services;
|
|
59
|
+
registerModelTierBridge(settingsManager), getModelTiersBridge()?.setParentThinkingProvider(() => session.thinkingLevel), registerMemoryCapBridge(settingsManager), registerCustomizeBridge(settingsManager), registerUsageServiceBridge(modelRuntime, settingsManager), registerSettingsToolsBridge(settingsManager, () => session.sessionId);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
bindRuntimeBridges
|
|
64
|
+
};
|