@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,378 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
CustomEditor
|
|
4
|
+
} from "./chunk-H2EOZYMP.js";
|
|
5
|
+
|
|
6
|
+
// packages/coding-agent/dist/builtin-extensions/ashxj-tui.js
|
|
7
|
+
var CUSTOMIZE_BRIDGE = /* @__PURE__ */ Symbol.for("@lunr/customize"), PERMISSION_MODE_BRIDGE = /* @__PURE__ */ Symbol.for("@lunr/permission-mode");
|
|
8
|
+
function lunrCustomizeBridge() {
|
|
9
|
+
return globalThis[CUSTOMIZE_BRIDGE];
|
|
10
|
+
}
|
|
11
|
+
function lunrPermissionModeBridge() {
|
|
12
|
+
return globalThis[PERMISSION_MODE_BRIDGE];
|
|
13
|
+
}
|
|
14
|
+
function lunrFooterToggles() {
|
|
15
|
+
let bridge = lunrCustomizeBridge();
|
|
16
|
+
return {
|
|
17
|
+
mcp: bridge?.getFooterMcp?.() ?? !0,
|
|
18
|
+
lsp: bridge?.getFooterLsp?.() ?? !1,
|
|
19
|
+
context: bridge?.getFooterContext?.() ?? !0,
|
|
20
|
+
tokens: bridge?.getFooterTokens?.() ?? !0,
|
|
21
|
+
cacheHitRate: bridge?.getFooterCacheHitRate?.() ?? !0,
|
|
22
|
+
tps: bridge?.getFooterTps?.() ?? !0,
|
|
23
|
+
statuses: bridge?.getFooterStatuses?.() ?? !0,
|
|
24
|
+
git: bridge?.getFooterGit?.() ?? !0,
|
|
25
|
+
plan: bridge?.getFooterPlan?.() ?? !0,
|
|
26
|
+
planBar: bridge?.getFooterPlanBar?.() ?? !0
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
var USAGE_SERVICE_BRIDGE = /* @__PURE__ */ Symbol.for("@lunr/usage-service");
|
|
30
|
+
function lunrUsageBridge() {
|
|
31
|
+
return globalThis[USAGE_SERVICE_BRIDGE];
|
|
32
|
+
}
|
|
33
|
+
function compactPlanBar(percent, theme) {
|
|
34
|
+
let clamped = Math.max(0, Math.min(100, percent)), filled = Math.round(clamped / 100 * 8), token = clamped > 90 ? "error" : clamped > 70 ? "warning" : "success", fill = filled > 0 ? color(theme, token, "\u2588".repeat(filled)) : "", rest = filled < 8 ? color(theme, "dim", "\u2591".repeat(8 - filled)) : "";
|
|
35
|
+
return fill + rest;
|
|
36
|
+
}
|
|
37
|
+
function lunrPermissionMode() {
|
|
38
|
+
return lunrPermissionModeBridge()?.getMode();
|
|
39
|
+
}
|
|
40
|
+
function lunrPromptGlyph(theme) {
|
|
41
|
+
let arrow = theme?.glyph?.("promptArrow") ?? ">";
|
|
42
|
+
return arrow ? `${arrow} ` : "";
|
|
43
|
+
}
|
|
44
|
+
function thinkingThemeToken(level) {
|
|
45
|
+
switch (level) {
|
|
46
|
+
case "off":
|
|
47
|
+
return "thinkingOff";
|
|
48
|
+
case "minimal":
|
|
49
|
+
return "thinkingMinimal";
|
|
50
|
+
case "low":
|
|
51
|
+
return "thinkingLow";
|
|
52
|
+
case "medium":
|
|
53
|
+
return "thinkingMedium";
|
|
54
|
+
case "high":
|
|
55
|
+
return "thinkingHigh";
|
|
56
|
+
case "xhigh":
|
|
57
|
+
return "thinkingXhigh";
|
|
58
|
+
case "max":
|
|
59
|
+
return "thinkingMax";
|
|
60
|
+
default:
|
|
61
|
+
return "thinkingOff";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function skipAnsi(str, pos) {
|
|
65
|
+
if (str.charCodeAt(pos) !== 27)
|
|
66
|
+
return 0;
|
|
67
|
+
let next = str.charCodeAt(pos + 1);
|
|
68
|
+
if (next === 91) {
|
|
69
|
+
let j = pos + 2;
|
|
70
|
+
for (; j < str.length; ) {
|
|
71
|
+
let c = str.charCodeAt(j);
|
|
72
|
+
if (c >= 64 && c <= 126)
|
|
73
|
+
return j + 1 - pos;
|
|
74
|
+
j++;
|
|
75
|
+
}
|
|
76
|
+
return str.length - pos;
|
|
77
|
+
}
|
|
78
|
+
if (next === 93 || next === 80 || next === 95 || next === 94 || next === 88) {
|
|
79
|
+
let j = pos + 2;
|
|
80
|
+
for (; j < str.length; ) {
|
|
81
|
+
let c = str.charCodeAt(j);
|
|
82
|
+
if (c === 7)
|
|
83
|
+
return j + 1 - pos;
|
|
84
|
+
if (c === 27 && str.charCodeAt(j + 1) === 92)
|
|
85
|
+
return j + 2 - pos;
|
|
86
|
+
j++;
|
|
87
|
+
}
|
|
88
|
+
return str.length - pos;
|
|
89
|
+
}
|
|
90
|
+
return Number.isNaN(next) ? 1 : 2;
|
|
91
|
+
}
|
|
92
|
+
function isWide(cp) {
|
|
93
|
+
return cp >= 4352 && cp <= 4447 || cp >= 11904 && cp <= 12350 || cp >= 12353 && cp <= 13311 || cp >= 13312 && cp <= 19903 || cp >= 19968 && cp <= 40959 || cp >= 40960 && cp <= 42191 || cp >= 44032 && cp <= 55203 || cp >= 63744 && cp <= 64255 || cp >= 65072 && cp <= 65103 || cp >= 65280 && cp <= 65376 || cp >= 65504 && cp <= 65510 || cp >= 127744 && cp <= 129791 || cp >= 131072 && cp <= 262141;
|
|
94
|
+
}
|
|
95
|
+
function charWidth(cp) {
|
|
96
|
+
return cp >= 32 && cp < 127 ? 1 : cp >= 768 && cp <= 879 || cp >= 65024 && cp <= 65039 || cp === 8205 ? 0 : isWide(cp) ? 2 : 1;
|
|
97
|
+
}
|
|
98
|
+
function displayWidth(str) {
|
|
99
|
+
let w = 0, i = 0;
|
|
100
|
+
for (; i < str.length; ) {
|
|
101
|
+
let skip = skipAnsi(str, i);
|
|
102
|
+
if (skip > 0) {
|
|
103
|
+
i += skip;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
let cp = str.codePointAt(i) ?? 0;
|
|
107
|
+
w += charWidth(cp), i += cp > 65535 ? 2 : 1;
|
|
108
|
+
}
|
|
109
|
+
return w;
|
|
110
|
+
}
|
|
111
|
+
function padRight(line, width) {
|
|
112
|
+
let w = displayWidth(line);
|
|
113
|
+
return w >= width ? line : line + " ".repeat(width - w);
|
|
114
|
+
}
|
|
115
|
+
function truncatePlain(text, maxWidth) {
|
|
116
|
+
if (maxWidth <= 0)
|
|
117
|
+
return "";
|
|
118
|
+
if (displayWidth(text) <= maxWidth)
|
|
119
|
+
return text;
|
|
120
|
+
let out = "", w = 0, i = 0;
|
|
121
|
+
for (; i < text.length; ) {
|
|
122
|
+
let code = text.codePointAt(i) ?? 0, cw = charWidth(code);
|
|
123
|
+
if (w + cw > maxWidth)
|
|
124
|
+
break;
|
|
125
|
+
out += String.fromCodePoint(code), w += cw, i += code > 65535 ? 2 : 1;
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
function truncateToWidth(text, maxWidth, ellipsis = "") {
|
|
130
|
+
if (maxWidth <= 0)
|
|
131
|
+
return "";
|
|
132
|
+
if (displayWidth(text) <= maxWidth)
|
|
133
|
+
return text;
|
|
134
|
+
let target = Math.max(0, maxWidth - displayWidth(ellipsis)), out = "", w = 0, i = 0;
|
|
135
|
+
for (; i < text.length && w < target; ) {
|
|
136
|
+
let skip = skipAnsi(text, i);
|
|
137
|
+
if (skip > 0) {
|
|
138
|
+
out += text.slice(i, i + skip), i += skip;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
let code = text.codePointAt(i) ?? 0, cw = charWidth(code);
|
|
142
|
+
if (w + cw > target)
|
|
143
|
+
break;
|
|
144
|
+
out += String.fromCodePoint(code), w += cw, i += code > 65535 ? 2 : 1;
|
|
145
|
+
}
|
|
146
|
+
return out += "\x1B[0m", out + ellipsis;
|
|
147
|
+
}
|
|
148
|
+
function clampLines(lines, width) {
|
|
149
|
+
return lines.map((l) => displayWidth(l) > width ? truncateToWidth(l, width, "") : l);
|
|
150
|
+
}
|
|
151
|
+
function color(theme, token, text) {
|
|
152
|
+
try {
|
|
153
|
+
return theme?.fg?.(token, text) ?? text;
|
|
154
|
+
} catch {
|
|
155
|
+
return text;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function stripAnsi(s) {
|
|
159
|
+
return s.replace(/\x1b\[[0-9;]*m/g, "");
|
|
160
|
+
}
|
|
161
|
+
function formatCount(count) {
|
|
162
|
+
return count < 1e3 ? count.toString() : count < 1e4 ? `${(count / 1e3).toFixed(1)}k` : count < 1e6 ? `${Math.round(count / 1e3)}k` : count < 1e7 ? `${(count / 1e6).toFixed(1)}M` : `${Math.round(count / 1e6)}M`;
|
|
163
|
+
}
|
|
164
|
+
function getUsageTotals(ctx) {
|
|
165
|
+
let input = 0, output = 0, cacheRead = 0, cacheWrite = 0, latestCacheHitRate, entries = ctx.sessionManager.getEntries?.() ?? ctx.sessionManager.getBranch?.() ?? [];
|
|
166
|
+
for (let entry of entries) {
|
|
167
|
+
if (entry.type !== "message")
|
|
168
|
+
continue;
|
|
169
|
+
let m = entry.message;
|
|
170
|
+
if (!m || m.role !== "assistant")
|
|
171
|
+
continue;
|
|
172
|
+
let u = m.usage;
|
|
173
|
+
if (!u)
|
|
174
|
+
continue;
|
|
175
|
+
let usageInput = u.input ?? 0, usageCacheRead = u.cacheRead ?? 0, usageCacheWrite = u.cacheWrite ?? 0;
|
|
176
|
+
input += usageInput, output += u.output ?? 0, cacheRead += usageCacheRead, cacheWrite += usageCacheWrite;
|
|
177
|
+
let promptTokens = usageInput + usageCacheRead + usageCacheWrite;
|
|
178
|
+
latestCacheHitRate = promptTokens > 0 ? usageCacheRead / promptTokens * 100 : void 0;
|
|
179
|
+
}
|
|
180
|
+
return { input, output, cacheActivity: cacheRead > 0 || cacheWrite > 0, latestCacheHitRate };
|
|
181
|
+
}
|
|
182
|
+
function formatProviderLabel(provider) {
|
|
183
|
+
return provider ? {
|
|
184
|
+
anthropic: "Anthropic",
|
|
185
|
+
gemini: "Google",
|
|
186
|
+
google: "Google",
|
|
187
|
+
ollama: "Ollama",
|
|
188
|
+
"ollama-cloud": "Ollama Cloud",
|
|
189
|
+
openai: "OpenAI",
|
|
190
|
+
"openai-codex": "OpenAI",
|
|
191
|
+
mistral: "Mistral"
|
|
192
|
+
}[provider] ?? provider.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()) : "Unknown";
|
|
193
|
+
}
|
|
194
|
+
function colorEffort(theme, level, text) {
|
|
195
|
+
let token = thinkingThemeToken(level), painted = color(theme, token, text);
|
|
196
|
+
return token === "thinkingMax" && painted === text ? color(theme, "thinkingXhigh", text) : painted;
|
|
197
|
+
}
|
|
198
|
+
function buildChip(ctx, pi) {
|
|
199
|
+
let modelId = ctx.model?.id ?? "no-model", provider = ctx.model?.provider, providerLabel = formatProviderLabel(provider), fast = provider === "openai-codex" && lunrCustomizeBridge()?.getOpenAIFastMode?.() ? " \xB7 fast" : "", level = pi.getThinkingLevel(), effort = level;
|
|
200
|
+
return { left: `${modelId}${fast} \xB7 ${providerLabel} \xB7 `, effort, level };
|
|
201
|
+
}
|
|
202
|
+
var ChatboxEditor = class extends CustomEditor {
|
|
203
|
+
ctx;
|
|
204
|
+
pi;
|
|
205
|
+
bind(ctx, pi) {
|
|
206
|
+
this.ctx = ctx, this.pi = pi;
|
|
207
|
+
}
|
|
208
|
+
/** Keep the displayed values while /new or /resume replaces the old runtime. */
|
|
209
|
+
unbind() {
|
|
210
|
+
let level = this.pi.getThinkingLevel();
|
|
211
|
+
this.bind({
|
|
212
|
+
mode: "tui",
|
|
213
|
+
hasUI: !0,
|
|
214
|
+
model: this.ctx.model,
|
|
215
|
+
sessionManager: { getEntries: () => [] },
|
|
216
|
+
getContextUsage: () => {
|
|
217
|
+
},
|
|
218
|
+
ui: { theme: this.ctx.ui?.theme, setEditorComponent() {
|
|
219
|
+
}, setFooter() {
|
|
220
|
+
} }
|
|
221
|
+
}, { getThinkingLevel: () => level, on() {
|
|
222
|
+
} });
|
|
223
|
+
}
|
|
224
|
+
constructor(tui, theme, keybindings, ctx, pi) {
|
|
225
|
+
super(tui, theme, keybindings, {
|
|
226
|
+
paddingX: 0
|
|
227
|
+
}), this.ctx = ctx, this.pi = pi;
|
|
228
|
+
}
|
|
229
|
+
color(token, text) {
|
|
230
|
+
return color(this.ctx.ui?.theme, token, text);
|
|
231
|
+
}
|
|
232
|
+
render(width) {
|
|
233
|
+
if (width <= 4)
|
|
234
|
+
return clampLines(super.render(width), width);
|
|
235
|
+
let glyph = lunrPromptGlyph(this.ctx.ui?.theme), glyphW = displayWidth(glyph), innerWidth = Math.max(1, width - 4 - glyphW), base = super.render(innerWidth), showing = this.isShowingAutocomplete(), acList = this.autocompleteList, acCount = 0;
|
|
236
|
+
if (showing && acList && typeof acList.render == "function")
|
|
237
|
+
try {
|
|
238
|
+
acCount = acList.render(innerWidth).length;
|
|
239
|
+
} catch {
|
|
240
|
+
acCount = 0;
|
|
241
|
+
}
|
|
242
|
+
let frame = base, acLines = [];
|
|
243
|
+
acCount > 0 && acCount < frame.length && (acLines = frame.slice(frame.length - acCount), frame = frame.slice(0, frame.length - acCount));
|
|
244
|
+
let inner = frame.length >= 2 ? frame.slice(1, frame.length - 1) : frame, body = inner.length > 0 ? inner : [""], border = (s) => this.borderColor(s), top = border("\u256D" + "\u2500".repeat(width - 2) + "\u256E"), gutter = glyphW > 0 ? " ".repeat(glyphW) : "", bodyLines = body.map((ln, i) => {
|
|
245
|
+
let prefix = i === 0 && glyphW > 0 ? this.color("dim", glyph) : gutter;
|
|
246
|
+
return border("\u2502 ") + prefix + padRight(ln, innerWidth) + border(" \u2502");
|
|
247
|
+
}), bottom = this.renderBottomBorder(width);
|
|
248
|
+
return [top, ...bodyLines, bottom, ...acLines];
|
|
249
|
+
}
|
|
250
|
+
renderBottomBorder(width) {
|
|
251
|
+
let border = (s) => this.borderColor(s), parts = buildChip(this.ctx, this.pi), plain = parts.left + parts.effort, overhead = 4, maxChip = Math.max(0, width - overhead), truncated = displayWidth(plain) > maxChip, chipPlain = truncated ? truncatePlain(plain, maxChip) : plain, chipW = displayWidth(chipPlain), dashTotal = Math.max(0, width - overhead - chipW), rightDashes = Math.min(dashTotal, 1), leftDashes = dashTotal - rightDashes, left = "\u2570" + "\u2500".repeat(leftDashes) + " ", right = " " + "\u2500".repeat(rightDashes) + "\u256F", theme = this.ctx.ui?.theme, chip = truncated ? this.color("white", chipPlain) : this.color("white", parts.left) + colorEffort(theme, parts.level, parts.effort);
|
|
252
|
+
return border(left) + chip + border(right);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
function renderStatsLine(width, ctx, theme, footerData) {
|
|
256
|
+
let sep = color(theme, "accent2", " | "), parts = [], modeZone = [], mode = lunrPermissionMode();
|
|
257
|
+
mode === "yolo" || mode === "auto" ? modeZone.push(color(theme, "warning", mode)) : (mode === "manual" || mode === "plan") && modeZone.push(color(theme, "white", mode));
|
|
258
|
+
let footerToggles = lunrFooterToggles(), statuses = footerData.getExtensionStatuses?.();
|
|
259
|
+
if (statuses && statuses.size > 0) {
|
|
260
|
+
let modeKeys = footerToggles.statuses ? ["plan", "goal"] : [];
|
|
261
|
+
for (let key of modeKeys) {
|
|
262
|
+
let v = statuses.get(key);
|
|
263
|
+
v && modeZone.push(color(theme, "white", stripAnsi(v)));
|
|
264
|
+
}
|
|
265
|
+
let pipedKeys = [];
|
|
266
|
+
footerToggles.tps && pipedKeys.push("tps"), footerToggles.mcp && pipedKeys.push("mcp", "mcp-auth"), footerToggles.lsp && pipedKeys.push("lsp");
|
|
267
|
+
for (let key of pipedKeys) {
|
|
268
|
+
let v = statuses.get(key);
|
|
269
|
+
v && parts.push(color(theme, "white", stripAnsi(v)));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (modeZone.length > 0 && parts.unshift(modeZone.join(color(theme, "dim", " \xB7 "))), footerToggles.git) {
|
|
273
|
+
let branch = footerData.getGitBranch?.();
|
|
274
|
+
if (branch) {
|
|
275
|
+
let diff = footerData.getGitDiffstat?.(), gitSeg = color(theme, "white", branch);
|
|
276
|
+
diff && (diff.added !== 0 || diff.removed !== 0) && (gitSeg += ` ${color(theme, "success", `+${diff.added}`)} ${color(theme, "error", `-${diff.removed}`)}`), parts.push(gitSeg);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (footerToggles.plan) {
|
|
280
|
+
let provider = ctx.model?.provider;
|
|
281
|
+
if (provider) {
|
|
282
|
+
let usage = lunrUsageBridge();
|
|
283
|
+
usage?.prefetch?.(provider);
|
|
284
|
+
let seg = usage?.pickForFooter?.(provider);
|
|
285
|
+
if (seg) {
|
|
286
|
+
let pct = `${Math.round(seg.usedPercent)}%`, barColor = seg.usedPercent > 90 ? "error" : seg.usedPercent > 70 ? "warning" : "success", bar = footerToggles.planBar ? `${compactPlanBar(seg.usedPercent, theme)} ` : "";
|
|
287
|
+
parts.push(color(theme, "white", seg.label) + " " + bar + color(theme, barColor, pct));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (footerToggles.context) {
|
|
292
|
+
let usage = ctx.getContextUsage(), win = ctx.model?.contextWindow ?? usage?.contextWindow ?? 0, ctxSeg = `${usage?.percent == null ? "?" : `${Math.round(usage.percent)}%`}/${formatCount(win)}`, pv = usage?.percent ?? 0;
|
|
293
|
+
pv > 90 ? parts.push(color(theme, "error", ctxSeg)) : pv > 70 ? parts.push(color(theme, "warning", ctxSeg)) : parts.push(color(theme, "white", ctxSeg));
|
|
294
|
+
}
|
|
295
|
+
let totals = getUsageTotals(ctx);
|
|
296
|
+
footerToggles.tokens && parts.push(color(theme, "white", `\u2191${formatCount(totals.input)} \u2193${formatCount(totals.output)}`)), footerToggles.cacheHitRate && totals.cacheActivity && totals.latestCacheHitRate !== void 0 && parts.push(color(theme, "white", `CH${totals.latestCacheHitRate.toFixed(1)}%`));
|
|
297
|
+
let line = parts.join(sep);
|
|
298
|
+
return displayWidth(line) > width && (line = truncateToWidth(line, width, "")), [line];
|
|
299
|
+
}
|
|
300
|
+
var chatboxEditors = /* @__PURE__ */ new WeakMap();
|
|
301
|
+
function getChatboxEditor(tui, theme, keybindings, ctx, pi) {
|
|
302
|
+
let editor = chatboxEditors.get(tui);
|
|
303
|
+
return editor ? editor.bind(ctx, pi) : (editor = new ChatboxEditor(tui, theme, keybindings, ctx, pi), chatboxEditors.set(tui, editor)), editor;
|
|
304
|
+
}
|
|
305
|
+
function installEditor(ctx, pi, setRequestor) {
|
|
306
|
+
if (typeof ctx.ui.setEditorComponent != "function")
|
|
307
|
+
return;
|
|
308
|
+
let editor, factory = (tui, _theme, _keybindings) => (setRequestor(() => {
|
|
309
|
+
try {
|
|
310
|
+
tui.requestRender();
|
|
311
|
+
} catch {
|
|
312
|
+
}
|
|
313
|
+
}), editor = getChatboxEditor(tui, _theme, _keybindings, ctx, pi), editor);
|
|
314
|
+
return ctx.ui.setEditorComponent(factory), () => editor?.unbind();
|
|
315
|
+
}
|
|
316
|
+
function installFooter(ctx, setRequestor) {
|
|
317
|
+
if (typeof ctx.ui.setFooter != "function")
|
|
318
|
+
return;
|
|
319
|
+
let disposed = !1, factory = (tui, _theme, _footerData) => (setRequestor(() => {
|
|
320
|
+
try {
|
|
321
|
+
tui.requestRender();
|
|
322
|
+
} catch {
|
|
323
|
+
}
|
|
324
|
+
}), {
|
|
325
|
+
invalidate() {
|
|
326
|
+
},
|
|
327
|
+
dispose() {
|
|
328
|
+
disposed = !0;
|
|
329
|
+
},
|
|
330
|
+
render(width) {
|
|
331
|
+
return disposed ? [] : renderStatsLine(width, ctx, _theme, _footerData);
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
ctx.ui.setFooter(factory);
|
|
335
|
+
}
|
|
336
|
+
function ashxj_tui_default(pi) {
|
|
337
|
+
let unbindEditor, renderRequestor, requestRender = () => {
|
|
338
|
+
try {
|
|
339
|
+
renderRequestor?.();
|
|
340
|
+
} catch {
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
pi.on("session_start", (_event, ctx) => {
|
|
344
|
+
!ctx.hasUI || ctx.mode !== "tui" || (unbindEditor = installEditor(ctx, pi, (r) => {
|
|
345
|
+
renderRequestor = r;
|
|
346
|
+
}), installFooter(ctx, (r) => {
|
|
347
|
+
renderRequestor || (renderRequestor = r);
|
|
348
|
+
}));
|
|
349
|
+
}), pi.on("session_shutdown", (_event, ctx) => {
|
|
350
|
+
unbindEditor?.(), unbindEditor = void 0;
|
|
351
|
+
try {
|
|
352
|
+
typeof ctx.ui?.setEditorComponent == "function" && ctx.ui.setEditorComponent(void 0);
|
|
353
|
+
} catch {
|
|
354
|
+
}
|
|
355
|
+
try {
|
|
356
|
+
typeof ctx.ui?.setFooter == "function" && ctx.ui.setFooter(void 0);
|
|
357
|
+
} catch {
|
|
358
|
+
}
|
|
359
|
+
renderRequestor = void 0;
|
|
360
|
+
});
|
|
361
|
+
let reRenderEvents = [
|
|
362
|
+
"model_select",
|
|
363
|
+
"thinking_level_select",
|
|
364
|
+
"agent_end",
|
|
365
|
+
"message_end",
|
|
366
|
+
"tool_execution_end",
|
|
367
|
+
"session_compact"
|
|
368
|
+
];
|
|
369
|
+
for (let ev of reRenderEvents)
|
|
370
|
+
pi.on(ev, () => requestRender());
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export {
|
|
374
|
+
thinkingThemeToken,
|
|
375
|
+
renderStatsLine,
|
|
376
|
+
getChatboxEditor,
|
|
377
|
+
ashxj_tui_default
|
|
378
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
flushRawStdout,
|
|
4
|
+
writeRawStdout
|
|
5
|
+
} from "./chunk-OBMWP3I5.js";
|
|
6
|
+
import {
|
|
7
|
+
killTrackedDetachedChildren
|
|
8
|
+
} from "./chunk-ZCHMJ34K.js";
|
|
9
|
+
|
|
10
|
+
// packages/coding-agent/dist/modes/print-mode.js
|
|
11
|
+
async function runPrintMode(runtimeHost, options) {
|
|
12
|
+
let { mode, messages = [], initialMessage, initialImages } = options, exitCode = 0, session = runtimeHost.session, unsubscribe, disposed = !1, signalCleanupHandlers = [], disposeRuntime = async () => {
|
|
13
|
+
disposed || (disposed = !0, unsubscribe?.(), await runtimeHost.dispose());
|
|
14
|
+
};
|
|
15
|
+
(() => {
|
|
16
|
+
let signals = ["SIGTERM"];
|
|
17
|
+
process.platform !== "win32" && signals.push("SIGHUP");
|
|
18
|
+
for (let signal of signals) {
|
|
19
|
+
let handler = () => {
|
|
20
|
+
killTrackedDetachedChildren(), disposeRuntime().finally(() => {
|
|
21
|
+
process.exit(signal === "SIGHUP" ? 129 : 143);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
process.on(signal, handler), signalCleanupHandlers.push(() => process.off(signal, handler));
|
|
25
|
+
}
|
|
26
|
+
})(), runtimeHost.setRebindSession(async () => {
|
|
27
|
+
await rebindSession();
|
|
28
|
+
});
|
|
29
|
+
let rebindSession = async () => {
|
|
30
|
+
session = runtimeHost.session, await session.bindExtensions({
|
|
31
|
+
mode: mode === "json" ? "json" : "print",
|
|
32
|
+
commandContextActions: {
|
|
33
|
+
waitForIdle: () => session.waitForIdle(),
|
|
34
|
+
newSession: async (newSessionOptions) => runtimeHost.newSession(newSessionOptions),
|
|
35
|
+
fork: async (entryId, forkOptions) => ({ cancelled: (await runtimeHost.fork(entryId, forkOptions)).cancelled }),
|
|
36
|
+
navigateTree: async (targetId, navigateOptions) => ({ cancelled: (await session.navigateTree(targetId, {
|
|
37
|
+
summarize: navigateOptions?.summarize,
|
|
38
|
+
customInstructions: navigateOptions?.customInstructions,
|
|
39
|
+
replaceInstructions: navigateOptions?.replaceInstructions,
|
|
40
|
+
label: navigateOptions?.label
|
|
41
|
+
})).cancelled }),
|
|
42
|
+
switchSession: async (sessionPath, switchOptions) => runtimeHost.switchSession(sessionPath, switchOptions),
|
|
43
|
+
reload: async () => {
|
|
44
|
+
await session.reload();
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
onError: (err) => {
|
|
48
|
+
console.error(`Extension error (${err.extensionPath}): ${err.error}`);
|
|
49
|
+
}
|
|
50
|
+
}), unsubscribe?.(), unsubscribe = session.subscribe((event) => {
|
|
51
|
+
mode === "json" && writeRawStdout(`${JSON.stringify(event)}
|
|
52
|
+
`);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
if (mode === "json") {
|
|
57
|
+
let header = session.sessionManager.getHeader();
|
|
58
|
+
header && writeRawStdout(`${JSON.stringify(header)}
|
|
59
|
+
`);
|
|
60
|
+
}
|
|
61
|
+
await rebindSession(), initialMessage && await session.prompt(initialMessage, { images: initialImages });
|
|
62
|
+
for (let message of messages)
|
|
63
|
+
await session.prompt(message);
|
|
64
|
+
if (mode === "text") {
|
|
65
|
+
let state = session.state, lastMessage = state.messages[state.messages.length - 1];
|
|
66
|
+
if (lastMessage?.role === "assistant") {
|
|
67
|
+
let assistantMsg = lastMessage;
|
|
68
|
+
if (assistantMsg.stopReason === "error" || assistantMsg.stopReason === "aborted")
|
|
69
|
+
console.error(assistantMsg.errorMessage || `Request ${assistantMsg.stopReason}`), exitCode = 1;
|
|
70
|
+
else
|
|
71
|
+
for (let content of assistantMsg.content)
|
|
72
|
+
content.type === "text" && writeRawStdout(`${content.text}
|
|
73
|
+
`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return exitCode;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
return console.error(error instanceof Error ? error.message : String(error)), 1;
|
|
79
|
+
} finally {
|
|
80
|
+
for (let cleanup of signalCleanupHandlers)
|
|
81
|
+
cleanup();
|
|
82
|
+
await disposeRuntime(), await flushRawStdout();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
runPrintMode
|
|
88
|
+
};
|