@cortex-agent/server 2026.10.25 → 2026.10.28
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/LICENSE +21 -0
- package/README.md +23 -5
- package/THIRD_PARTY_NOTICES.txt +16546 -0
- package/defaults/prompts/clean-workspace.md +21 -0
- package/dist/agent-adapter/claude/remote-mcp-proxy.js +4 -66
- package/dist/chunks/anthropic-SUZWKBRW.js +4 -0
- package/dist/chunks/anthropic-messages-M3SMXACA.js +8 -0
- package/dist/chunks/api-GM53PHIL-GFHEXXE6.js +4 -0
- package/dist/chunks/azure-openai-responses-76YWXHSB.js +4 -0
- package/dist/chunks/bedrock-converse-stream-5UPX4NTQ.js +58 -0
- package/dist/chunks/child-runner-3GHOWGZP.js +4 -0
- package/dist/chunks/chunk-23PRJECN.js +4 -0
- package/dist/chunks/chunk-2ZNLUY2U.js +128 -0
- package/dist/chunks/chunk-3F6WW7HR.js +13 -0
- package/dist/chunks/chunk-3OKHUVEM.js +7 -0
- package/dist/chunks/chunk-3TGQSGG4.js +8 -0
- package/dist/chunks/chunk-3THJYAEF.js +4 -0
- package/dist/chunks/chunk-3YHOCPQU.js +10 -0
- package/dist/chunks/chunk-4EX2JJWB.js +4 -0
- package/dist/chunks/chunk-4LLH5OWM.js +10 -0
- package/dist/chunks/chunk-4U7XXM4W.js +4 -0
- package/dist/chunks/chunk-52T37Y47.js +8 -0
- package/dist/chunks/chunk-5M4PFLRW.js +4 -0
- package/dist/chunks/chunk-5NRGVROY.js +4 -0
- package/dist/chunks/chunk-5T7IX5KN.js +4 -0
- package/dist/chunks/chunk-6AKUD3CF.js +4 -0
- package/dist/chunks/chunk-6LZK4DDH.js +4 -0
- package/dist/chunks/chunk-6R73ICDB.js +4 -0
- package/dist/chunks/chunk-7MU2AKNM.js +4 -0
- package/dist/chunks/chunk-A34TDMIC.js +7 -0
- package/dist/chunks/chunk-AAA3UBIS.js +4 -0
- package/dist/chunks/chunk-ASYQHJVQ.js +9 -0
- package/dist/chunks/chunk-AWFUHWQK.js +4 -0
- package/dist/chunks/chunk-B3XBQEFM.js +4 -0
- package/dist/chunks/chunk-BGVHA2D4.js +4 -0
- package/dist/chunks/chunk-BGYR4ID3.js +4 -0
- package/dist/chunks/chunk-BKHDWCRT.js +79 -0
- package/dist/chunks/chunk-BR7A5SWM.js +23 -0
- package/dist/chunks/chunk-CQLH4UVX.js +4 -0
- package/dist/chunks/chunk-CVC66CFV.js +33 -0
- package/dist/chunks/chunk-CXT5IR5T.js +4 -0
- package/dist/chunks/chunk-D3NXKK2L.js +4 -0
- package/dist/chunks/chunk-D6UA4BZC.js +19 -0
- package/dist/chunks/chunk-D6VMBA4C.js +4 -0
- package/dist/chunks/chunk-DGMNI4AO.js +4 -0
- package/dist/chunks/chunk-DHSA5ACV.js +125 -0
- package/dist/chunks/chunk-DPQPXBTP.js +68 -0
- package/dist/chunks/chunk-DQJ6LLAS.js +4 -0
- package/dist/chunks/chunk-DXBSQXJL.js +18 -0
- package/dist/chunks/chunk-E6BYRULL.js +4 -0
- package/dist/chunks/chunk-E7ZMYIY6.js +30 -0
- package/dist/chunks/chunk-EQIMHXC4.js +5 -0
- package/dist/chunks/chunk-EQITBTJC.js +10 -0
- package/dist/chunks/chunk-EXJA5RIX.js +357 -0
- package/dist/chunks/chunk-FF7UELTU.js +4 -0
- package/dist/chunks/chunk-FH74NME3.js +115 -0
- package/dist/chunks/chunk-FOJQXLL2.js +6 -0
- package/dist/chunks/chunk-FOQ7VLIL.js +17 -0
- package/dist/chunks/chunk-FX6MOGLR.js +11 -0
- package/dist/chunks/chunk-FXDIR3SQ.js +4 -0
- package/dist/chunks/chunk-G2V65UBA.js +4 -0
- package/dist/chunks/chunk-H2FP6DG4.js +5 -0
- package/dist/chunks/chunk-HALUQ7ZF.js +4 -0
- package/dist/chunks/chunk-HGPBHTVD.js +6 -0
- package/dist/chunks/chunk-HU6UIDEJ.js +6 -0
- package/dist/chunks/chunk-I6OPDRVF.js +4 -0
- package/dist/chunks/chunk-ILEML5IP.js +4 -0
- package/dist/chunks/chunk-IRWZ7UPF.js +77 -0
- package/dist/chunks/chunk-J5DVLUKY.js +6 -0
- package/dist/chunks/chunk-JERCOLY3.js +142 -0
- package/dist/chunks/chunk-JW2HFMTF.js +4 -0
- package/dist/chunks/chunk-JXFG66UN.js +4 -0
- package/dist/chunks/chunk-K4NTZEDJ.js +4 -0
- package/dist/chunks/chunk-KDYEGGMW.js +4 -0
- package/dist/chunks/chunk-KENCMLRE.js +4 -0
- package/dist/chunks/chunk-KGJZAYQD.js +4 -0
- package/dist/chunks/chunk-KIGMAATV.js +23 -0
- package/dist/chunks/chunk-KIU5FAPY.js +5 -0
- package/dist/chunks/chunk-KIWMQPH7.js +739 -0
- package/dist/chunks/chunk-KRXTI4JO.js +3 -0
- package/dist/chunks/chunk-L6VCIGWS.js +11 -0
- package/dist/chunks/chunk-LACGULCN.js +10 -0
- package/dist/chunks/chunk-LCKVYFMD.js +4 -0
- package/dist/chunks/chunk-LEUENXI2.js +6 -0
- package/dist/chunks/chunk-LMDWRRX4.js +4 -0
- package/dist/chunks/chunk-LMSQZ6TQ.js +4 -0
- package/dist/chunks/chunk-MEPASGPP.js +6 -0
- package/dist/chunks/chunk-MFAEUHMV.js +28 -0
- package/dist/chunks/chunk-N6BTQN7R.js +8 -0
- package/dist/chunks/chunk-NAA7GF6Q.js +5 -0
- package/dist/chunks/chunk-NHD2ESHA.js +4 -0
- package/dist/chunks/chunk-NKDMKRSB.js +68 -0
- package/dist/chunks/chunk-NKXV32S6.js +4 -0
- package/dist/chunks/chunk-NR6U3WIZ.js +4 -0
- package/dist/chunks/chunk-NT32UURL.js +4 -0
- package/dist/chunks/chunk-NVX5IPRN.js +4 -0
- package/dist/chunks/chunk-O3JW2F7D.js +8 -0
- package/dist/chunks/chunk-OE4KH3NJ.js +4 -0
- package/dist/chunks/chunk-OISO5JXB.js +4 -0
- package/dist/chunks/chunk-OKRK6JPY.js +4 -0
- package/dist/chunks/chunk-OPYXNSMY.js +4 -0
- package/dist/chunks/chunk-OSEIQ7SS.js +4 -0
- package/dist/chunks/chunk-OZGBWAT2.js +4 -0
- package/dist/chunks/chunk-P52RMIYX.js +6 -0
- package/dist/chunks/chunk-PBJ5MPPX.js +60 -0
- package/dist/chunks/chunk-PFMEUFJ7.js +4 -0
- package/dist/chunks/chunk-PMG4YGDU.js +7 -0
- package/dist/chunks/chunk-PXS5SHOV.js +4 -0
- package/dist/chunks/chunk-PZMGBKUR.js +13 -0
- package/dist/chunks/chunk-PZMXHA6X.js +9 -0
- package/dist/chunks/chunk-Q4UGYGU5.js +4 -0
- package/dist/chunks/chunk-Q7CE3UIE.js +133 -0
- package/dist/chunks/chunk-QBKCAIJG.js +4 -0
- package/dist/chunks/chunk-QEOFEETJ.js +4 -0
- package/dist/chunks/chunk-QN44UXQR.js +11 -0
- package/dist/chunks/chunk-QUUEQRIT.js +4 -0
- package/dist/chunks/chunk-QWAQHHRS.js +4 -0
- package/dist/chunks/chunk-RA6HKFBV.js +4 -0
- package/dist/chunks/chunk-REBNWCKI.js +4 -0
- package/dist/chunks/chunk-REPYBMQS.js +4 -0
- package/dist/chunks/chunk-RO4C2MJP.js +4 -0
- package/dist/chunks/chunk-SKHLZ6XY.js +9 -0
- package/dist/chunks/chunk-STUHNKQS.js +4 -0
- package/dist/chunks/chunk-SUFW24P4.js +7 -0
- package/dist/chunks/chunk-TAWLERZA.js +4 -0
- package/dist/chunks/chunk-TCAEECDI.js +4 -0
- package/dist/chunks/chunk-TJ4GQRT6.js +8 -0
- package/dist/chunks/chunk-TURBFBYN.js +4 -0
- package/dist/chunks/chunk-TWAEABGG.js +52 -0
- package/dist/chunks/chunk-TZFLHVOQ.js +7 -0
- package/dist/chunks/chunk-TZGNSHOL.js +4 -0
- package/dist/chunks/chunk-UD3NMUHR.js +12 -0
- package/dist/chunks/chunk-UNVEZI57.js +4 -0
- package/dist/chunks/chunk-USBJFDJ6.js +4 -0
- package/dist/chunks/chunk-V3AQJSWR.js +4 -0
- package/dist/chunks/chunk-VQUPKMDR.js +4 -0
- package/dist/chunks/chunk-W25TB3PU.js +4 -0
- package/dist/chunks/chunk-W5LGYSPZ.js +4 -0
- package/dist/chunks/chunk-WEZWKMYU.js +4 -0
- package/dist/chunks/chunk-WHC7AYZD.js +4 -0
- package/dist/chunks/chunk-X2GYYRVM.js +22 -0
- package/dist/chunks/chunk-XAJLZR7C.js +28 -0
- package/dist/chunks/chunk-XAXWLYH5.js +4 -0
- package/dist/chunks/chunk-XBJOYU5Y.js +4 -0
- package/dist/chunks/chunk-XH6FMP3N.js +71 -0
- package/dist/chunks/chunk-XIECJESP.js +4 -0
- package/dist/chunks/chunk-XNSSUVT6.js +4 -0
- package/dist/chunks/chunk-XSRZHN63.js +4 -0
- package/dist/chunks/chunk-Y3GFB5XM.js +8 -0
- package/dist/chunks/chunk-Y6ZEVVL5.js +4 -0
- package/dist/chunks/chunk-YAEVYJAR.js +4 -0
- package/dist/chunks/chunk-YG7OEPR2.js +6 -0
- package/dist/chunks/chunk-YHIWOGVL.js +4 -0
- package/dist/chunks/chunk-YKKEI5GI.js +4 -0
- package/dist/chunks/chunk-YPK2CAIZ.js +8 -0
- package/dist/chunks/chunk-YZSHTWNM.js +92 -0
- package/dist/chunks/chunk-Z2Q2NR46.js +34 -0
- package/dist/chunks/chunk-Z4H3VDHI.js +4 -0
- package/dist/chunks/chunk-ZFPMIQA3.js +6 -0
- package/dist/chunks/chunk-ZNZFWSPH.js +4 -0
- package/dist/chunks/chunk-ZQ7LGTSN.js +8 -0
- package/dist/chunks/chunk-ZSV6TO7Q.js +4 -0
- package/dist/chunks/cli-5DBTRMHU.js +53 -0
- package/dist/chunks/client-XOGYH5UR.js +4 -0
- package/dist/chunks/cloudflare-workers-ai-system-one-32JCFHI3.js +4 -0
- package/dist/chunks/config-DJSQI77S-335IXHSM.js +4 -0
- package/dist/chunks/context-VCQH5OB6.js +4 -0
- package/dist/chunks/cost-PGGFI7QJ.js +5 -0
- package/dist/chunks/dist-7RWW7YH4.js +11 -0
- package/dist/chunks/dist-PUKMZ7GW.js +4 -0
- package/dist/chunks/easter-egg-3d-MO4MOEVF.js +4 -0
- package/dist/chunks/es5-VNTQPCKX.js +4 -0
- package/dist/chunks/event-streams-3JSFPOTZ.js +4 -0
- package/dist/chunks/execution-repo-ZLJTBWFC.js +4 -0
- package/dist/chunks/executions-6ARGR3IO.js +9 -0
- package/dist/chunks/file-7BN7RCAY.js +4 -0
- package/dist/chunks/gateway-UCRPMR75.js +36 -0
- package/dist/chunks/github-copilot-HAI2DA62.js +4 -0
- package/dist/chunks/google-generative-ai-2VXWLHWI.js +4 -0
- package/dist/chunks/google-vertex-UA36QP2U.js +4 -0
- package/dist/chunks/init-HA7FAQ73.js +4 -0
- package/dist/chunks/install-cli-4IZCSDFZ.js +16 -0
- package/dist/chunks/interaction-ask-G5T3H3CG.js +9 -0
- package/dist/chunks/interaction-plan-E5V42MUP.js +11 -0
- package/dist/chunks/jiti-loader-WANUXUDO.js +4 -0
- package/dist/chunks/jiti-static-loader-W3QZ4GDS.js +476 -0
- package/dist/chunks/kimi-coding-HMJRKCPA.js +4 -0
- package/dist/chunks/lib-RSOU34HQ.js +11 -0
- package/dist/chunks/llama-cpp-classify-OTXZWCMW.js +24 -0
- package/dist/chunks/local-client-stop-SQRU7ZZM.js +4 -0
- package/dist/chunks/memory-cli-PYOILNN5.js +11 -0
- package/dist/chunks/meta-KY3LNFV2.js +4 -0
- package/dist/chunks/mistral-conversations-34F66L3O.js +7 -0
- package/dist/chunks/model-resolver-N3DTAQ2S.js +4 -0
- package/dist/chunks/models-L5VF4I5O-XXNJYQMQ.js +4 -0
- package/dist/chunks/multipart-parser-GEHG6YAR.js +5 -0
- package/dist/chunks/node-PTK2HCDV.js +18 -0
- package/dist/chunks/node-VLVSZ76W.js +4 -0
- package/dist/chunks/openai-chatgpt-PETGIJOZ.js +4 -0
- package/dist/chunks/openai-codex-2REL6UQU.js +4 -0
- package/dist/chunks/openai-codex-responses-ZBVHREB3.js +12 -0
- package/dist/chunks/openai-completions-VVIB26SH.js +9 -0
- package/dist/chunks/openai-decisions-2N6ZRPZC.js +7 -0
- package/dist/chunks/openai-responses-735XA2ZX.js +6 -0
- package/dist/chunks/openrouter-GDY3BLT2.js +4 -0
- package/dist/chunks/openrouter-images-3IKETHAC.js +4 -0
- package/dist/chunks/pi-messages-I3E4ZFHA.js +10 -0
- package/dist/chunks/radius-HXRZVBDB.js +4 -0
- package/dist/chunks/remote-ops-BALZYKH6.js +14 -0
- package/dist/chunks/runner-PLVZDGHB.js +4 -0
- package/dist/chunks/runtime-6YLTA2ZD.js +4 -0
- package/dist/chunks/schedule-cli-OLASBBYJ.js +4 -0
- package/dist/chunks/slack-WAGSPZUX.js +4 -0
- package/dist/chunks/src-CCI7P7AI.js +6 -0
- package/dist/chunks/start-ui-http-QALT7C3P.js +43 -0
- package/dist/chunks/subagent-E3UC7ZHC.js +4 -0
- package/dist/chunks/time-KEHDQT6K.js +4 -0
- package/dist/chunks/tool-shims-Q6P6UXVC.js +4 -0
- package/dist/chunks/typesafe-system-one-6ULACYD4.js +4 -0
- package/dist/chunks/ui-board-4GYW6KKW.js +5 -0
- package/dist/chunks/ui-decision-U2FXSEC2.js +4 -0
- package/dist/chunks/ui-file-GVH53O3X.js +5 -0
- package/dist/chunks/ui-view-O7PLANT7.js +4 -0
- package/dist/chunks/virtual-modules-IDC5YKZJ.js +4 -0
- package/dist/chunks/waitpoint-2FGQBIAC.js +5 -0
- package/dist/chunks/workers-XN4PSTH6.js +4 -0
- package/dist/chunks/xai-KEVUJTFV.js +4 -0
- package/dist/client-bundle/manifest.json +1 -1
- package/dist/core/pi-sdk.js +4 -73
- package/dist/domain/auth/cc-auth-cli.js +4 -248
- package/dist/domain/mcp/bundled-server.js +4 -146
- package/dist/entry/app.js +601 -611
- package/dist/entry/browser-cli.js +14 -316
- package/dist/entry/cli.js +4 -587
- package/dist/entry/cortex-cli.js +4 -2
- package/dist/entry/daemon.js +7 -909
- package/dist/entry/hook-cli.js +6 -401
- package/dist/entry/production-app-bootstrap.js +5 -42
- package/dist/entry/production-evidence-export-cli.js +12 -99
- package/dist/entry/signal-cli.js +6 -198
- package/dist/tui/index.js +114 -306
- package/package.json +11 -50
- package/scripts/bundle-prune-browser.mjs +52 -0
- package/scripts/postinstall-restart-trigger.mjs +8 -0
- package/vendor/aistatus/gateway-cli.js +21 -0
- package/vendor/pi/CHANGELOG.md +6365 -0
- package/vendor/pi/README.md +95 -0
- package/vendor/pi/dist/codemode-worker.js +478 -0
- package/vendor/pi/dist/core/export-html/ansi-to-html.js +249 -0
- package/vendor/pi/dist/core/export-html/index.js +228 -0
- package/vendor/pi/dist/core/export-html/template.css +1076 -0
- package/vendor/pi/dist/core/export-html/template.html +56 -0
- package/vendor/pi/dist/core/export-html/template.js +1924 -0
- package/vendor/pi/dist/core/export-html/tool-renderer.js +110 -0
- package/vendor/pi/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/vendor/pi/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/vendor/pi/dist/core/export-html/vendor/marked.min.js +79 -0
- package/vendor/pi/dist/core/extensions/loader.js +4 -0
- package/vendor/pi/dist/extensions/codemode/execute.js +507 -0
- package/vendor/pi/dist/modes/interactive/assets/clankolas.png +0 -0
- package/vendor/pi/dist/modes/interactive/theme/dark.json +78 -0
- package/vendor/pi/dist/modes/interactive/theme/light.json +78 -0
- package/vendor/pi/dist/modes/interactive/theme/system-theme.js +546 -0
- package/vendor/pi/dist/modes/interactive/theme/theme-controller.js +210 -0
- package/vendor/pi/dist/modes/interactive/theme/theme-schema.js +105 -0
- package/vendor/pi/dist/modes/interactive/theme/theme-tokens.js +94 -0
- package/vendor/pi/dist/modes/interactive/theme/theme.js +905 -0
- package/vendor/pi/dist/utils/image-resize-worker.js +4 -0
- package/vendor/pi/dist/utils/image-resize.js +4 -0
- package/vendor/pi/docs/cli-integration.md +106 -0
- package/vendor/pi/docs/cli.md +333 -0
- package/vendor/pi/docs/codemode.md +230 -0
- package/vendor/pi/docs/compaction.md +463 -0
- package/vendor/pi/docs/configuration.md +47 -0
- package/vendor/pi/docs/containerization.md +183 -0
- package/vendor/pi/docs/custom-provider.md +225 -0
- package/vendor/pi/docs/docs.json +220 -0
- package/vendor/pi/docs/environment-variables.md +101 -0
- package/vendor/pi/docs/extensions.md +400 -0
- package/vendor/pi/docs/how-pi-works.md +49 -0
- package/vendor/pi/docs/images/doom-extension.png +0 -0
- package/vendor/pi/docs/images/exy.png +0 -0
- package/vendor/pi/docs/images/interactive-mode.png +0 -0
- package/vendor/pi/docs/images/tree-view.png +0 -0
- package/vendor/pi/docs/index.md +39 -0
- package/vendor/pi/docs/json.md +226 -0
- package/vendor/pi/docs/keybindings.md +195 -0
- package/vendor/pi/docs/llama-cpp.md +121 -0
- package/vendor/pi/docs/mcp.md +272 -0
- package/vendor/pi/docs/message-types.md +279 -0
- package/vendor/pi/docs/models-configuration.md +196 -0
- package/vendor/pi/docs/models.md +225 -0
- package/vendor/pi/docs/nvidia-rtx-llama-cpp.md +96 -0
- package/vendor/pi/docs/packages.md +129 -0
- package/vendor/pi/docs/prompt-templates.md +59 -0
- package/vendor/pi/docs/providers.md +247 -0
- package/vendor/pi/docs/quickstart.md +136 -0
- package/vendor/pi/docs/rpc-commands.md +860 -0
- package/vendor/pi/docs/rpc-extension-ui.md +200 -0
- package/vendor/pi/docs/rpc.md +193 -0
- package/vendor/pi/docs/sdk.md +147 -0
- package/vendor/pi/docs/security.md +99 -0
- package/vendor/pi/docs/session-format.md +293 -0
- package/vendor/pi/docs/sessions.md +66 -0
- package/vendor/pi/docs/settings.md +172 -0
- package/vendor/pi/docs/shell-aliases.md +93 -0
- package/vendor/pi/docs/skills.md +93 -0
- package/vendor/pi/docs/slash-commands.md +60 -0
- package/vendor/pi/docs/terminal-setup.md +233 -0
- package/vendor/pi/docs/termux.md +117 -0
- package/vendor/pi/docs/themes.md +138 -0
- package/vendor/pi/docs/tmux.md +55 -0
- package/vendor/pi/docs/tui.md +195 -0
- package/vendor/pi/docs/usage.md +94 -0
- package/vendor/pi/docs/virtual-models.md +114 -0
- package/vendor/pi/docs/windows.md +81 -0
- package/vendor/pi/examples/README.md +36 -0
- package/vendor/pi/examples/extensions/README.md +214 -0
- package/vendor/pi/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/vendor/pi/examples/extensions/bash-spawn-hook.ts +30 -0
- package/vendor/pi/examples/extensions/bookmark.ts +50 -0
- package/vendor/pi/examples/extensions/border-status-editor.ts +150 -0
- package/vendor/pi/examples/extensions/built-in-tool-renderer.ts +225 -0
- package/vendor/pi/examples/extensions/claude-rules.ts +86 -0
- package/vendor/pi/examples/extensions/commands.ts +72 -0
- package/vendor/pi/examples/extensions/confirm-destructive.ts +59 -0
- package/vendor/pi/examples/extensions/custom-compaction.ts +117 -0
- package/vendor/pi/examples/extensions/custom-footer.ts +64 -0
- package/vendor/pi/examples/extensions/custom-header.ts +73 -0
- package/vendor/pi/examples/extensions/custom-provider-anthropic/index.ts +617 -0
- package/vendor/pi/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/vendor/pi/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/vendor/pi/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
- package/vendor/pi/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/vendor/pi/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/vendor/pi/examples/extensions/debug-provider.ts +90 -0
- package/vendor/pi/examples/extensions/dirty-repo-guard.ts +56 -0
- package/vendor/pi/examples/extensions/doom-overlay/README.md +46 -0
- package/vendor/pi/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/vendor/pi/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/vendor/pi/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/vendor/pi/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/vendor/pi/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/vendor/pi/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/vendor/pi/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/vendor/pi/examples/extensions/doom-overlay/index.ts +74 -0
- package/vendor/pi/examples/extensions/doom-overlay/wad-finder.ts +55 -0
- package/vendor/pi/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/vendor/pi/examples/extensions/dynamic-resources/dynamic.json +81 -0
- package/vendor/pi/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/vendor/pi/examples/extensions/dynamic-resources/index.ts +15 -0
- package/vendor/pi/examples/extensions/dynamic-tools.ts +74 -0
- package/vendor/pi/examples/extensions/entry-renderer.ts +41 -0
- package/vendor/pi/examples/extensions/event-bus.ts +43 -0
- package/vendor/pi/examples/extensions/file-trigger.ts +41 -0
- package/vendor/pi/examples/extensions/git-checkpoint.ts +53 -0
- package/vendor/pi/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/vendor/pi/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/vendor/pi/examples/extensions/gondolin/index.ts +531 -0
- package/vendor/pi/examples/extensions/gondolin/package-lock.json +185 -0
- package/vendor/pi/examples/extensions/gondolin/package.json +19 -0
- package/vendor/pi/examples/extensions/handoff.ts +190 -0
- package/vendor/pi/examples/extensions/hello.ts +26 -0
- package/vendor/pi/examples/extensions/hidden-thinking-label.ts +53 -0
- package/vendor/pi/examples/extensions/inline-bash.ts +94 -0
- package/vendor/pi/examples/extensions/input-transform-streaming.ts +39 -0
- package/vendor/pi/examples/extensions/input-transform.ts +43 -0
- package/vendor/pi/examples/extensions/interactive-shell.ts +196 -0
- package/vendor/pi/examples/extensions/jev-router.ts +113 -0
- package/vendor/pi/examples/extensions/mac-system-theme.ts +47 -0
- package/vendor/pi/examples/extensions/message-renderer.ts +59 -0
- package/vendor/pi/examples/extensions/minimal-mode.ts +353 -0
- package/vendor/pi/examples/extensions/modal-editor.ts +85 -0
- package/vendor/pi/examples/extensions/model-status.ts +31 -0
- package/vendor/pi/examples/extensions/notify.ts +57 -0
- package/vendor/pi/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/vendor/pi/examples/extensions/overlay-test.ts +153 -0
- package/vendor/pi/examples/extensions/permission-gate.ts +34 -0
- package/vendor/pi/examples/extensions/pirate.ts +47 -0
- package/vendor/pi/examples/extensions/plan-mode/README.md +66 -0
- package/vendor/pi/examples/extensions/plan-mode/index.ts +394 -0
- package/vendor/pi/examples/extensions/plan-mode/utils.ts +168 -0
- package/vendor/pi/examples/extensions/preset.ts +436 -0
- package/vendor/pi/examples/extensions/project-trust.ts +64 -0
- package/vendor/pi/examples/extensions/prompt-customizer.ts +49 -0
- package/vendor/pi/examples/extensions/protected-paths.ts +30 -0
- package/vendor/pi/examples/extensions/provider-payload.ts +18 -0
- package/vendor/pi/examples/extensions/qna.ts +118 -0
- package/vendor/pi/examples/extensions/question.ts +286 -0
- package/vendor/pi/examples/extensions/questionnaire.ts +448 -0
- package/vendor/pi/examples/extensions/rainbow-editor.ts +88 -0
- package/vendor/pi/examples/extensions/reload-runtime.ts +37 -0
- package/vendor/pi/examples/extensions/rpc-demo.ts +118 -0
- package/vendor/pi/examples/extensions/sandbox/index.ts +321 -0
- package/vendor/pi/examples/extensions/sandbox/package-lock.json +92 -0
- package/vendor/pi/examples/extensions/sandbox/package.json +19 -0
- package/vendor/pi/examples/extensions/send-user-message.ts +97 -0
- package/vendor/pi/examples/extensions/session-name.ts +27 -0
- package/vendor/pi/examples/extensions/shutdown-command.ts +63 -0
- package/vendor/pi/examples/extensions/snake.ts +343 -0
- package/vendor/pi/examples/extensions/space-invaders.ts +560 -0
- package/vendor/pi/examples/extensions/ssh.ts +220 -0
- package/vendor/pi/examples/extensions/status-line.ts +32 -0
- package/vendor/pi/examples/extensions/structured-output.ts +65 -0
- package/vendor/pi/examples/extensions/subagent/README.md +177 -0
- package/vendor/pi/examples/extensions/subagent/agents/planner.md +37 -0
- package/vendor/pi/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/vendor/pi/examples/extensions/subagent/agents/scout.md +50 -0
- package/vendor/pi/examples/extensions/subagent/agents/worker.md +24 -0
- package/vendor/pi/examples/extensions/subagent/agents.ts +157 -0
- package/vendor/pi/examples/extensions/subagent/index.ts +1036 -0
- package/vendor/pi/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/vendor/pi/examples/extensions/subagent/prompts/implement.md +10 -0
- package/vendor/pi/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/vendor/pi/examples/extensions/summarize.ts +199 -0
- package/vendor/pi/examples/extensions/system-prompt-header.ts +17 -0
- package/vendor/pi/examples/extensions/tic-tac-toe.ts +1008 -0
- package/vendor/pi/examples/extensions/timed-confirm.ts +70 -0
- package/vendor/pi/examples/extensions/titlebar-spinner.ts +58 -0
- package/vendor/pi/examples/extensions/todo.ts +297 -0
- package/vendor/pi/examples/extensions/tool-override.ts +144 -0
- package/vendor/pi/examples/extensions/tools.ts +146 -0
- package/vendor/pi/examples/extensions/trigger-compact.ts +50 -0
- package/vendor/pi/examples/extensions/truncated-tool.ts +195 -0
- package/vendor/pi/examples/extensions/widget-placement.ts +9 -0
- package/vendor/pi/examples/extensions/with-deps/index.ts +32 -0
- package/vendor/pi/examples/extensions/with-deps/package-lock.json +31 -0
- package/vendor/pi/examples/extensions/with-deps/package.json +22 -0
- package/vendor/pi/examples/extensions/working-indicator.ts +123 -0
- package/vendor/pi/examples/extensions/working-message-test.ts +25 -0
- package/vendor/pi/examples/rpc-client.ts +35 -0
- package/vendor/pi/examples/rpc-extension-ui.ts +661 -0
- package/vendor/pi/examples/sdk/01-minimal.ts +26 -0
- package/vendor/pi/examples/sdk/02-custom-model.ts +49 -0
- package/vendor/pi/examples/sdk/03-custom-prompt.ts +75 -0
- package/vendor/pi/examples/sdk/04-skills.ts +55 -0
- package/vendor/pi/examples/sdk/05-tools.ts +48 -0
- package/vendor/pi/examples/sdk/06-extensions.ts +99 -0
- package/vendor/pi/examples/sdk/07-context-files.ts +47 -0
- package/vendor/pi/examples/sdk/08-prompt-templates.ts +51 -0
- package/vendor/pi/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/vendor/pi/examples/sdk/10-settings.ts +53 -0
- package/vendor/pi/examples/sdk/11-sessions.ts +52 -0
- package/vendor/pi/examples/sdk/12-full-control.ts +74 -0
- package/vendor/pi/examples/sdk/13-session-runtime.ts +67 -0
- package/vendor/pi/examples/sdk/14-codemode-mcp.ts +61 -0
- package/vendor/pi/examples/sdk/README.md +141 -0
- package/vendor/pi/package.json +98 -0
- package/vendor/pi/schemas/keybindings.schema.json +393 -0
- package/vendor/pi/schemas/models.schema.json +1211 -0
- package/vendor/pi/schemas/settings.schema.json +783 -0
- package/vendor/pi/schemas/theme.schema.json +365 -0
- package/vendor/pi-ai/bedrock.js +4 -0
- package/vendor/pi-ai/oauth-load.js +4 -0
- package/vendor/quickjs.wasm +0 -0
- package/web/dist/assets/board-math-css-BPXakv_3.js +2 -0
- package/web/dist/assets/index-BHZpFXhc.js +525 -0
- package/web/dist/assets/index-DqWMdMkh.css +1 -0
- package/web/dist/assets/index-WCm6wwmM.js +1 -0
- package/web/dist/index.html +2 -2
- package/dist/agent-adapter/bg-wait.d.ts +0 -11
- package/dist/agent-adapter/bg-wait.js +0 -32
- package/dist/agent-adapter/capabilities.d.ts +0 -18
- package/dist/agent-adapter/capabilities.js +0 -39
- package/dist/agent-adapter/claude/active-capture-registry.d.ts +0 -7
- package/dist/agent-adapter/claude/active-capture-registry.js +0 -42
- package/dist/agent-adapter/claude/adapter.d.ts +0 -170
- package/dist/agent-adapter/claude/adapter.js +0 -459
- package/dist/agent-adapter/claude/assistant-blocks.d.ts +0 -5
- package/dist/agent-adapter/claude/assistant-blocks.js +0 -61
- package/dist/agent-adapter/claude/bg-task-tracker.d.ts +0 -105
- package/dist/agent-adapter/claude/bg-task-tracker.js +0 -168
- package/dist/agent-adapter/claude/cache-refresh.d.ts +0 -58
- package/dist/agent-adapter/claude/cache-refresh.js +0 -145
- package/dist/agent-adapter/claude/cache-touch.d.ts +0 -12
- package/dist/agent-adapter/claude/cache-touch.js +0 -75
- package/dist/agent-adapter/claude/compact-window.d.ts +0 -18
- package/dist/agent-adapter/claude/compact-window.js +0 -49
- package/dist/agent-adapter/claude/context-usage.d.ts +0 -28
- package/dist/agent-adapter/claude/context-usage.js +0 -173
- package/dist/agent-adapter/claude/defaults.d.ts +0 -42
- package/dist/agent-adapter/claude/defaults.js +0 -59
- package/dist/agent-adapter/claude/engine.d.ts +0 -75
- package/dist/agent-adapter/claude/engine.js +0 -139
- package/dist/agent-adapter/claude/event-parser.d.ts +0 -60
- package/dist/agent-adapter/claude/event-parser.js +0 -259
- package/dist/agent-adapter/claude/event-translator.d.ts +0 -45
- package/dist/agent-adapter/claude/event-translator.js +0 -98
- package/dist/agent-adapter/claude/hooks-builder.d.ts +0 -19
- package/dist/agent-adapter/claude/hooks-builder.js +0 -57
- package/dist/agent-adapter/claude/mcp-config.d.ts +0 -11
- package/dist/agent-adapter/claude/mcp-config.js +0 -142
- package/dist/agent-adapter/claude/remote-mcp-proxy.d.ts +0 -1
- package/dist/agent-adapter/claude/session-options.d.ts +0 -70
- package/dist/agent-adapter/claude/session-options.js +0 -148
- package/dist/agent-adapter/claude/spawn-args.d.ts +0 -70
- package/dist/agent-adapter/claude/spawn-args.js +0 -367
- package/dist/agent-adapter/claude/tool-summarizers.d.ts +0 -2
- package/dist/agent-adapter/claude/tool-summarizers.js +0 -20
- package/dist/agent-adapter/claude/transcript-clear.d.ts +0 -42
- package/dist/agent-adapter/claude/transcript-clear.js +0 -217
- package/dist/agent-adapter/claude/transcript-path.d.ts +0 -39
- package/dist/agent-adapter/claude/transcript-path.js +0 -114
- package/dist/agent-adapter/claude/turn-machine.d.ts +0 -220
- package/dist/agent-adapter/claude/turn-machine.js +0 -731
- package/dist/agent-adapter/claude/window-warmup.d.ts +0 -13
- package/dist/agent-adapter/claude/window-warmup.js +0 -38
- package/dist/agent-adapter/continuation-phase.d.ts +0 -131
- package/dist/agent-adapter/continuation-phase.js +0 -345
- package/dist/agent-adapter/engine-injections.d.ts +0 -47
- package/dist/agent-adapter/engine-injections.js +0 -80
- package/dist/agent-adapter/mcp-remote-fetch.d.ts +0 -1
- package/dist/agent-adapter/mcp-remote-fetch.js +0 -32
- package/dist/agent-adapter/normalize/event-types.d.ts +0 -125
- package/dist/agent-adapter/normalize/event-types.js +0 -1
- package/dist/agent-adapter/normalize/prompt-builder.d.ts +0 -22
- package/dist/agent-adapter/normalize/prompt-builder.js +0 -41
- package/dist/agent-adapter/normalize/tool-result-images.d.ts +0 -11
- package/dist/agent-adapter/normalize/tool-result-images.js +0 -32
- package/dist/agent-adapter/pi/adapter.d.ts +0 -125
- package/dist/agent-adapter/pi/adapter.js +0 -275
- package/dist/agent-adapter/pi/agent-dir.d.ts +0 -57
- package/dist/agent-adapter/pi/agent-dir.js +0 -154
- package/dist/agent-adapter/pi/background-subagent.d.ts +0 -26
- package/dist/agent-adapter/pi/background-subagent.js +0 -1
- package/dist/agent-adapter/pi/child-events.d.ts +0 -13
- package/dist/agent-adapter/pi/child-events.js +0 -96
- package/dist/agent-adapter/pi/child-runner.d.ts +0 -31
- package/dist/agent-adapter/pi/child-runner.js +0 -133
- package/dist/agent-adapter/pi/child-session.d.ts +0 -28
- package/dist/agent-adapter/pi/child-session.js +0 -70
- package/dist/agent-adapter/pi/custom-catalog.d.ts +0 -10
- package/dist/agent-adapter/pi/custom-catalog.js +0 -38
- package/dist/agent-adapter/pi/defaults.d.ts +0 -7
- package/dist/agent-adapter/pi/defaults.js +0 -11
- package/dist/agent-adapter/pi/discovery.d.ts +0 -37
- package/dist/agent-adapter/pi/discovery.js +0 -33
- package/dist/agent-adapter/pi/engine.d.ts +0 -66
- package/dist/agent-adapter/pi/engine.js +0 -180
- package/dist/agent-adapter/pi/event-parser.d.ts +0 -43
- package/dist/agent-adapter/pi/event-parser.js +0 -446
- package/dist/agent-adapter/pi/extensions.d.ts +0 -33
- package/dist/agent-adapter/pi/extensions.js +0 -58
- package/dist/agent-adapter/pi/hook-bridge.d.ts +0 -54
- package/dist/agent-adapter/pi/hook-bridge.js +0 -394
- package/dist/agent-adapter/pi/image-first.d.ts +0 -3
- package/dist/agent-adapter/pi/image-first.js +0 -31
- package/dist/agent-adapter/pi/mcp-bridge-logic.d.ts +0 -32
- package/dist/agent-adapter/pi/mcp-bridge-logic.js +0 -63
- package/dist/agent-adapter/pi/mcp-bridge.d.ts +0 -65
- package/dist/agent-adapter/pi/mcp-bridge.js +0 -389
- package/dist/agent-adapter/pi/native-tool-policy.d.ts +0 -3
- package/dist/agent-adapter/pi/native-tool-policy.js +0 -11
- package/dist/agent-adapter/pi/pi-session.d.ts +0 -185
- package/dist/agent-adapter/pi/pi-session.js +0 -656
- package/dist/agent-adapter/pi/providers-config.d.ts +0 -60
- package/dist/agent-adapter/pi/providers-config.js +0 -96
- package/dist/agent-adapter/pi/quota-probe.d.ts +0 -12
- package/dist/agent-adapter/pi/quota-probe.js +0 -33
- package/dist/agent-adapter/pi/quota-sink.d.ts +0 -33
- package/dist/agent-adapter/pi/quota-sink.js +0 -57
- package/dist/agent-adapter/pi/runtime-settings.d.ts +0 -9
- package/dist/agent-adapter/pi/runtime-settings.js +0 -53
- package/dist/agent-adapter/pi/runtime.d.ts +0 -48
- package/dist/agent-adapter/pi/runtime.js +0 -163
- package/dist/agent-adapter/pi/session-files.d.ts +0 -2
- package/dist/agent-adapter/pi/session-files.js +0 -15
- package/dist/agent-adapter/pi/session-options.d.ts +0 -86
- package/dist/agent-adapter/pi/session-options.js +0 -162
- package/dist/agent-adapter/pi/session-support.d.ts +0 -54
- package/dist/agent-adapter/pi/session-support.js +0 -101
- package/dist/agent-adapter/pi/subagent-bridge.d.ts +0 -17
- package/dist/agent-adapter/pi/subagent-bridge.js +0 -1
- package/dist/agent-adapter/pi/subagent.d.ts +0 -100
- package/dist/agent-adapter/pi/subagent.js +0 -199
- package/dist/agent-adapter/pi/tool-shims.d.ts +0 -32
- package/dist/agent-adapter/pi/tool-shims.js +0 -148
- package/dist/agent-adapter/pi/ui-context.d.ts +0 -20
- package/dist/agent-adapter/pi/ui-context.js +0 -92
- package/dist/agent-adapter/pi/web-fetch.d.ts +0 -13
- package/dist/agent-adapter/pi/web-fetch.js +0 -196
- package/dist/agent-adapter/pi/web-search.d.ts +0 -9
- package/dist/agent-adapter/pi/web-search.js +0 -517
- package/dist/agent-adapter/run-events.d.ts +0 -169
- package/dist/agent-adapter/run-events.js +0 -119
- package/dist/agent-adapter/types.d.ts +0 -330
- package/dist/agent-adapter/types.js +0 -3
- package/dist/core/agents/roles.d.ts +0 -50
- package/dist/core/agents/roles.js +0 -176
- package/dist/core/agents/subagent/attribution.d.ts +0 -15
- package/dist/core/agents/subagent/attribution.js +0 -60
- package/dist/core/agents/subagent/catalog.d.ts +0 -65
- package/dist/core/agents/subagent/catalog.js +0 -200
- package/dist/core/agents/subagent/model-spec.d.ts +0 -28
- package/dist/core/agents/subagent/model-spec.js +0 -39
- package/dist/core/agents/subagent/orchestrate.d.ts +0 -25
- package/dist/core/agents/subagent/orchestrate.js +0 -92
- package/dist/core/agents/subagent/schema.d.ts +0 -12
- package/dist/core/agents/subagent/schema.js +0 -51
- package/dist/core/agents/subagent/types.d.ts +0 -84
- package/dist/core/agents/subagent/types.js +0 -1
- package/dist/core/agents/subagent/usage.d.ts +0 -8
- package/dist/core/agents/subagent/usage.js +0 -32
- package/dist/core/anthropic-model-discovery.d.ts +0 -54
- package/dist/core/anthropic-model-discovery.js +0 -156
- package/dist/core/anthropic-models.d.ts +0 -1
- package/dist/core/anthropic-models.js +0 -13
- package/dist/core/async-mutex.d.ts +0 -6
- package/dist/core/async-mutex.js +0 -32
- package/dist/core/atomic-write.d.ts +0 -9
- package/dist/core/atomic-write.js +0 -104
- package/dist/core/auth.d.ts +0 -40
- package/dist/core/auth.js +0 -94
- package/dist/core/board-action.d.ts +0 -19
- package/dist/core/board-action.js +0 -24
- package/dist/core/builtin-layer.d.ts +0 -22
- package/dist/core/builtin-layer.js +0 -45
- package/dist/core/cached-scan.d.ts +0 -42
- package/dist/core/cached-scan.js +0 -95
- package/dist/core/calver.d.ts +0 -1
- package/dist/core/calver.js +0 -25
- package/dist/core/claude-credentials.d.ts +0 -91
- package/dist/core/claude-credentials.js +0 -242
- package/dist/core/cli-utils.d.ts +0 -56
- package/dist/core/cli-utils.js +0 -70
- package/dist/core/codex-quota.d.ts +0 -27
- package/dist/core/codex-quota.js +0 -55
- package/dist/core/codex-token.d.ts +0 -4
- package/dist/core/codex-token.js +0 -26
- package/dist/core/config-generator.d.ts +0 -17
- package/dist/core/config-generator.js +0 -181
- package/dist/core/debug-mode.d.ts +0 -15
- package/dist/core/debug-mode.js +0 -22
- package/dist/core/exec-async.d.ts +0 -28
- package/dist/core/exec-async.js +0 -48
- package/dist/core/file-lock.d.ts +0 -15
- package/dist/core/file-lock.js +0 -164
- package/dist/core/format-duration.d.ts +0 -7
- package/dist/core/format-duration.js +0 -23
- package/dist/core/gateway-generator.d.ts +0 -152
- package/dist/core/gateway-generator.js +0 -559
- package/dist/core/git-availability.d.ts +0 -2
- package/dist/core/git-availability.js +0 -43
- package/dist/core/hook-bus.d.ts +0 -25
- package/dist/core/hook-bus.js +0 -99
- package/dist/core/hook-exec.d.ts +0 -15
- package/dist/core/hook-exec.js +0 -86
- package/dist/core/hook-scripts.d.ts +0 -19
- package/dist/core/hook-scripts.js +0 -30
- package/dist/core/i18n.d.ts +0 -19
- package/dist/core/i18n.js +0 -42
- package/dist/core/icons.d.ts +0 -72
- package/dist/core/icons.js +0 -71
- package/dist/core/json-repository.d.ts +0 -78
- package/dist/core/json-repository.js +0 -154
- package/dist/core/locales/en.d.ts +0 -911
- package/dist/core/locales/en.js +0 -32
- package/dist/core/locales/slices/commands.d.ts +0 -301
- package/dist/core/locales/slices/commands.js +0 -634
- package/dist/core/locales/slices/init.d.ts +0 -153
- package/dist/core/locales/slices/init.js +0 -431
- package/dist/core/locales/slices/interactions.d.ts +0 -47
- package/dist/core/locales/slices/interactions.js +0 -99
- package/dist/core/locales/slices/lang.d.ts +0 -8
- package/dist/core/locales/slices/lang.js +0 -15
- package/dist/core/locales/slices/notices.d.ts +0 -78
- package/dist/core/locales/slices/notices.js +0 -156
- package/dist/core/locales/slices/providers.d.ts +0 -43
- package/dist/core/locales/slices/providers.js +0 -87
- package/dist/core/locales/slices/scheduling.d.ts +0 -33
- package/dist/core/locales/slices/scheduling.js +0 -65
- package/dist/core/locales/slices/startup.d.ts +0 -10
- package/dist/core/locales/slices/startup.js +0 -19
- package/dist/core/locales/slices/status.d.ts +0 -48
- package/dist/core/locales/slices/status.js +0 -109
- package/dist/core/locales/slices/tui.d.ts +0 -93
- package/dist/core/locales/slices/tui.js +0 -192
- package/dist/core/locales/slices/uiextra.d.ts +0 -49
- package/dist/core/locales/slices/uiextra.js +0 -102
- package/dist/core/locales/slices/uimsg.d.ts +0 -74
- package/dist/core/locales/slices/uimsg.js +0 -158
- package/dist/core/locales/zh.d.ts +0 -5
- package/dist/core/locales/zh.js +0 -30
- package/dist/core/log.d.ts +0 -16
- package/dist/core/log.js +0 -174
- package/dist/core/loopback-http.d.ts +0 -6
- package/dist/core/loopback-http.js +0 -43
- package/dist/core/mcp-bundles.d.ts +0 -8
- package/dist/core/mcp-bundles.js +0 -47
- package/dist/core/mcp-timeout.d.ts +0 -1
- package/dist/core/mcp-timeout.js +0 -1
- package/dist/core/mcp-tool-gate.d.ts +0 -25
- package/dist/core/mcp-tool-gate.js +0 -97
- package/dist/core/media-types.d.ts +0 -20
- package/dist/core/media-types.js +0 -63
- package/dist/core/models-generator.d.ts +0 -29
- package/dist/core/models-generator.js +0 -82
- package/dist/core/native-name.d.ts +0 -4
- package/dist/core/native-name.js +0 -57
- package/dist/core/paths.d.ts +0 -63
- package/dist/core/paths.js +0 -105
- package/dist/core/pi-sdk.d.ts +0 -38
- package/dist/core/pi-session-filename.d.ts +0 -10
- package/dist/core/pi-session-filename.js +0 -49
- package/dist/core/platform-settings-spec.d.ts +0 -47
- package/dist/core/platform-settings-spec.js +0 -28
- package/dist/core/private-dir.d.ts +0 -13
- package/dist/core/private-dir.js +0 -48
- package/dist/core/process-command-line.d.ts +0 -6
- package/dist/core/process-command-line.js +0 -39
- package/dist/core/prompt-template.d.ts +0 -14
- package/dist/core/prompt-template.js +0 -29
- package/dist/core/rebuild-progress.d.ts +0 -59
- package/dist/core/rebuild-progress.js +0 -106
- package/dist/core/resilient-watch.d.ts +0 -28
- package/dist/core/resilient-watch.js +0 -108
- package/dist/core/resume-reminder.d.ts +0 -5
- package/dist/core/resume-reminder.js +0 -12
- package/dist/core/run-registry.d.ts +0 -134
- package/dist/core/run-registry.js +0 -256
- package/dist/core/runtime-env.d.ts +0 -1
- package/dist/core/runtime-env.js +0 -11
- package/dist/core/session-holds.d.ts +0 -88
- package/dist/core/session-holds.js +0 -168
- package/dist/core/session-state.d.ts +0 -32
- package/dist/core/session-state.js +0 -39
- package/dist/core/session-todos.d.ts +0 -12
- package/dist/core/session-todos.js +0 -44
- package/dist/core/settings-migration.d.ts +0 -5
- package/dist/core/settings-migration.js +0 -128
- package/dist/core/settings-spec.d.ts +0 -301
- package/dist/core/settings-spec.js +0 -309
- package/dist/core/settings.d.ts +0 -19
- package/dist/core/settings.js +0 -492
- package/dist/core/short-session-id.d.ts +0 -2
- package/dist/core/short-session-id.js +0 -4
- package/dist/core/singleton-lock.d.ts +0 -39
- package/dist/core/singleton-lock.js +0 -127
- package/dist/core/status-format.d.ts +0 -70
- package/dist/core/status-format.js +0 -59
- package/dist/core/subagent-spawn.d.ts +0 -40
- package/dist/core/subagent-spawn.js +0 -47
- package/dist/core/team-action.d.ts +0 -28
- package/dist/core/team-action.js +0 -65
- package/dist/core/todo.d.ts +0 -18
- package/dist/core/todo.js +0 -79
- package/dist/core/tool-names.d.ts +0 -12
- package/dist/core/tool-names.js +0 -65
- package/dist/core/types/agent-types.d.ts +0 -173
- package/dist/core/types/agent-types.js +0 -1
- package/dist/core/types/environment-types.d.ts +0 -45
- package/dist/core/types/environment-types.js +0 -1
- package/dist/core/utils.d.ts +0 -72
- package/dist/core/utils.js +0 -176
- package/dist/core/version.d.ts +0 -6
- package/dist/core/version.js +0 -11
- package/dist/core/workspace-filenames.d.ts +0 -9
- package/dist/core/workspace-filenames.js +0 -61
- package/dist/domain/agents/agent-state.d.ts +0 -19
- package/dist/domain/agents/agent-state.js +0 -73
- package/dist/domain/agents/agent-switch.d.ts +0 -16
- package/dist/domain/agents/agent-switch.js +0 -30
- package/dist/domain/agents/config.d.ts +0 -20
- package/dist/domain/agents/config.js +0 -89
- package/dist/domain/agents/engine-selection.d.ts +0 -21
- package/dist/domain/agents/engine-selection.js +0 -37
- package/dist/domain/agents/environments/entities.d.ts +0 -50
- package/dist/domain/agents/environments/entities.js +0 -94
- package/dist/domain/agents/environments/file-refs.d.ts +0 -20
- package/dist/domain/agents/environments/file-refs.js +0 -51
- package/dist/domain/agents/environments/index.d.ts +0 -7
- package/dist/domain/agents/environments/index.js +0 -9
- package/dist/domain/agents/environments/paths.d.ts +0 -7
- package/dist/domain/agents/environments/paths.js +0 -9
- package/dist/domain/agents/environments/prompt-includes.d.ts +0 -1
- package/dist/domain/agents/environments/prompt-includes.js +0 -91
- package/dist/domain/agents/environments/registry.d.ts +0 -17
- package/dist/domain/agents/environments/registry.js +0 -163
- package/dist/domain/agents/environments/resolve.d.ts +0 -11
- package/dist/domain/agents/environments/resolve.js +0 -36
- package/dist/domain/agents/environments/schema.d.ts +0 -69
- package/dist/domain/agents/environments/schema.js +0 -115
- package/dist/domain/agents/environments/schema.parity.d.ts +0 -1
- package/dist/domain/agents/environments/schema.parity.js +0 -7
- package/dist/domain/agents/environments/system-prompt.d.ts +0 -37
- package/dist/domain/agents/environments/system-prompt.js +0 -110
- package/dist/domain/agents/index.d.ts +0 -6
- package/dist/domain/agents/index.js +0 -7
- package/dist/domain/agents/model-selection.d.ts +0 -30
- package/dist/domain/agents/model-selection.js +0 -111
- package/dist/domain/agents/models.d.ts +0 -12
- package/dist/domain/agents/models.js +0 -94
- package/dist/domain/agents/provider-run-lifecycle.d.ts +0 -11
- package/dist/domain/agents/provider-run-lifecycle.js +0 -17
- package/dist/domain/agents/subagent/background-spend.d.ts +0 -17
- package/dist/domain/agents/subagent/background-spend.js +0 -42
- package/dist/domain/agents/subagent/foreign.d.ts +0 -13
- package/dist/domain/agents/subagent/foreign.js +0 -30
- package/dist/domain/agents/subagent/registry.d.ts +0 -106
- package/dist/domain/agents/subagent/registry.js +0 -272
- package/dist/domain/agents/subagent/runner.d.ts +0 -61
- package/dist/domain/agents/subagent/runner.js +0 -301
- package/dist/domain/agents/subagent/service.d.ts +0 -26
- package/dist/domain/agents/subagent/service.js +0 -68
- package/dist/domain/auth/anthropic-env.d.ts +0 -20
- package/dist/domain/auth/anthropic-env.js +0 -132
- package/dist/domain/auth/auth-events.d.ts +0 -18
- package/dist/domain/auth/auth-events.js +0 -34
- package/dist/domain/auth/auth-format.d.ts +0 -2
- package/dist/domain/auth/auth-format.js +0 -53
- package/dist/domain/auth/auth-status.d.ts +0 -63
- package/dist/domain/auth/auth-status.js +0 -286
- package/dist/domain/auth/auth-watch.d.ts +0 -16
- package/dist/domain/auth/auth-watch.js +0 -166
- package/dist/domain/auth/cc-auth-cli.d.ts +0 -30
- package/dist/domain/auth/cc-login.d.ts +0 -7
- package/dist/domain/auth/cc-login.js +0 -20
- package/dist/domain/auth/cc-subscription.d.ts +0 -18
- package/dist/domain/auth/cc-subscription.js +0 -54
- package/dist/domain/auth/claude-account-credentials.d.ts +0 -13
- package/dist/domain/auth/claude-account-credentials.js +0 -22
- package/dist/domain/auth/claude-user-settings.d.ts +0 -22
- package/dist/domain/auth/claude-user-settings.js +0 -104
- package/dist/domain/auth/codex-credentials.d.ts +0 -13
- package/dist/domain/auth/codex-credentials.js +0 -25
- package/dist/domain/auth/gateway-sync.d.ts +0 -19
- package/dist/domain/auth/gateway-sync.js +0 -46
- package/dist/domain/auth/index.d.ts +0 -14
- package/dist/domain/auth/index.js +0 -14
- package/dist/domain/auth/login-flow.d.ts +0 -141
- package/dist/domain/auth/login-flow.js +0 -339
- package/dist/domain/auth/login-service.d.ts +0 -33
- package/dist/domain/auth/login-service.js +0 -65
- package/dist/domain/auth/logout.d.ts +0 -32
- package/dist/domain/auth/logout.js +0 -156
- package/dist/domain/auth/pi-login.d.ts +0 -26
- package/dist/domain/auth/pi-login.js +0 -70
- package/dist/domain/auth/pi-oauth.d.ts +0 -26
- package/dist/domain/auth/pi-oauth.js +0 -85
- package/dist/domain/auth/pi-runtime.d.ts +0 -82
- package/dist/domain/auth/pi-runtime.js +0 -40
- package/dist/domain/benchmark/accounting-reconciliation.d.ts +0 -117
- package/dist/domain/benchmark/accounting-reconciliation.js +0 -174
- package/dist/domain/benchmark/atif.d.ts +0 -42
- package/dist/domain/benchmark/atif.js +0 -263
- package/dist/domain/benchmark/attempt-record.d.ts +0 -167
- package/dist/domain/benchmark/attempt-record.js +0 -113
- package/dist/domain/benchmark/benchmark-types.d.ts +0 -17
- package/dist/domain/benchmark/benchmark-types.js +0 -1
- package/dist/domain/benchmark/composite-manifest.d.ts +0 -117
- package/dist/domain/benchmark/composite-manifest.js +0 -477
- package/dist/domain/benchmark/decimal-text.d.ts +0 -22
- package/dist/domain/benchmark/decimal-text.js +0 -42
- package/dist/domain/benchmark/identity.d.ts +0 -39
- package/dist/domain/benchmark/identity.js +0 -70
- package/dist/domain/benchmark/journal.d.ts +0 -47
- package/dist/domain/benchmark/journal.js +0 -254
- package/dist/domain/benchmark/manifest-contract.d.ts +0 -30
- package/dist/domain/benchmark/manifest-contract.js +0 -118
- package/dist/domain/benchmark/production-attempt-identity.d.ts +0 -73
- package/dist/domain/benchmark/production-attempt-identity.js +0 -372
- package/dist/domain/benchmark/production-attempt-journal.d.ts +0 -38
- package/dist/domain/benchmark/production-attempt-journal.js +0 -267
- package/dist/domain/benchmark/production-benchmark-evidence.d.ts +0 -2
- package/dist/domain/benchmark/production-benchmark-evidence.js +0 -67
- package/dist/domain/benchmark/production-evidence-export.d.ts +0 -14
- package/dist/domain/benchmark/production-evidence-export.js +0 -134
- package/dist/domain/benchmark/production-evidence-journal.d.ts +0 -11
- package/dist/domain/benchmark/production-evidence-journal.js +0 -81
- package/dist/domain/benchmark/production-evidence-projection.d.ts +0 -39
- package/dist/domain/benchmark/production-evidence-projection.js +0 -392
- package/dist/domain/benchmark/role-surface.d.ts +0 -4
- package/dist/domain/benchmark/role-surface.js +0 -117
- package/dist/domain/benchmark/session-evidence.d.ts +0 -7
- package/dist/domain/benchmark/session-evidence.js +0 -34
- package/dist/domain/boards/board-context.d.ts +0 -17
- package/dist/domain/boards/board-context.js +0 -11
- package/dist/domain/boards/board-paths.d.ts +0 -18
- package/dist/domain/boards/board-paths.js +0 -32
- package/dist/domain/boards/board-service.d.ts +0 -50
- package/dist/domain/boards/board-service.js +0 -146
- package/dist/domain/boards/board-watcher.d.ts +0 -36
- package/dist/domain/boards/board-watcher.js +0 -284
- package/dist/domain/boards/decision-projection.d.ts +0 -46
- package/dist/domain/boards/decision-projection.js +0 -44
- package/dist/domain/browser/broker.d.ts +0 -99
- package/dist/domain/browser/broker.js +0 -487
- package/dist/domain/costs/account-reset.d.ts +0 -30
- package/dist/domain/costs/account-reset.js +0 -98
- package/dist/domain/costs/aistatus-config.d.ts +0 -27
- package/dist/domain/costs/aistatus-config.js +0 -56
- package/dist/domain/costs/claude-account.d.ts +0 -34
- package/dist/domain/costs/claude-account.js +0 -170
- package/dist/domain/costs/codex-account.d.ts +0 -55
- package/dist/domain/costs/codex-account.js +0 -155
- package/dist/domain/costs/cost-tracker.d.ts +0 -181
- package/dist/domain/costs/cost-tracker.js +0 -350
- package/dist/domain/costs/gateway-manager.d.ts +0 -6
- package/dist/domain/costs/gateway-manager.js +0 -225
- package/dist/domain/costs/rate-limit-throttle.d.ts +0 -78
- package/dist/domain/costs/rate-limit-throttle.js +0 -502
- package/dist/domain/costs/reset-account.d.ts +0 -36
- package/dist/domain/costs/reset-account.js +0 -5
- package/dist/domain/costs/resume-registry.d.ts +0 -30
- package/dist/domain/costs/resume-registry.js +0 -108
- package/dist/domain/costs/usage-service.d.ts +0 -80
- package/dist/domain/costs/usage-service.js +0 -618
- package/dist/domain/costs/usage-store.d.ts +0 -83
- package/dist/domain/costs/usage-store.js +0 -104
- package/dist/domain/executions/registry.d.ts +0 -47
- package/dist/domain/executions/registry.js +0 -100
- package/dist/domain/hooks/hook-view.d.ts +0 -22
- package/dist/domain/hooks/hook-view.js +0 -34
- package/dist/domain/mcp/bundled-server.d.ts +0 -19
- package/dist/domain/mcp/feishu/client.d.ts +0 -46
- package/dist/domain/mcp/feishu/client.js +0 -91
- package/dist/domain/mcp/feishu/file.d.ts +0 -14
- package/dist/domain/mcp/feishu/file.js +0 -88
- package/dist/domain/mcp/feishu/types.d.ts +0 -31
- package/dist/domain/mcp/feishu/types.js +0 -34
- package/dist/domain/mcp/feishu/user-auth.d.ts +0 -140
- package/dist/domain/mcp/feishu/user-auth.js +0 -278
- package/dist/domain/mcp/tools/agents-md.d.ts +0 -16
- package/dist/domain/mcp/tools/agents-md.js +0 -34
- package/dist/domain/mcp/tools/catalog-owner.d.ts +0 -3
- package/dist/domain/mcp/tools/catalog-owner.js +0 -23
- package/dist/domain/mcp/tools/context.d.ts +0 -69
- package/dist/domain/mcp/tools/context.js +0 -106
- package/dist/domain/mcp/tools/cost.d.ts +0 -2
- package/dist/domain/mcp/tools/cost.js +0 -56
- package/dist/domain/mcp/tools/executions.d.ts +0 -2
- package/dist/domain/mcp/tools/executions.js +0 -71
- package/dist/domain/mcp/tools/interaction-ask.d.ts +0 -37
- package/dist/domain/mcp/tools/interaction-ask.js +0 -131
- package/dist/domain/mcp/tools/interaction-plan.d.ts +0 -34
- package/dist/domain/mcp/tools/interaction-plan.js +0 -116
- package/dist/domain/mcp/tools/remote-devices.d.ts +0 -9
- package/dist/domain/mcp/tools/remote-devices.js +0 -28
- package/dist/domain/mcp/tools/remote-file.d.ts +0 -24
- package/dist/domain/mcp/tools/remote-file.js +0 -52
- package/dist/domain/mcp/tools/remote-ops.d.ts +0 -3
- package/dist/domain/mcp/tools/remote-ops.js +0 -359
- package/dist/domain/mcp/tools/slack.d.ts +0 -23
- package/dist/domain/mcp/tools/slack.js +0 -106
- package/dist/domain/mcp/tools/subagent.d.ts +0 -23
- package/dist/domain/mcp/tools/subagent.js +0 -179
- package/dist/domain/mcp/tools/time.d.ts +0 -2
- package/dist/domain/mcp/tools/time.js +0 -62
- package/dist/domain/mcp/tools/ui-board.d.ts +0 -12
- package/dist/domain/mcp/tools/ui-board.js +0 -48
- package/dist/domain/mcp/tools/ui-decision.d.ts +0 -3
- package/dist/domain/mcp/tools/ui-decision.js +0 -37
- package/dist/domain/mcp/tools/ui-file.d.ts +0 -3
- package/dist/domain/mcp/tools/ui-file.js +0 -70
- package/dist/domain/mcp/tools/ui-view.d.ts +0 -3
- package/dist/domain/mcp/tools/ui-view.js +0 -44
- package/dist/domain/mcp/tools/waitpoint.d.ts +0 -28
- package/dist/domain/mcp/tools/waitpoint.js +0 -109
- package/dist/domain/mcp/tools/workers.d.ts +0 -5
- package/dist/domain/mcp/tools/workers.js +0 -77
- package/dist/domain/memory/agents-md-injector.d.ts +0 -25
- package/dist/domain/memory/agents-md-injector.js +0 -58
- package/dist/domain/memory/consolidate.d.ts +0 -56
- package/dist/domain/memory/consolidate.js +0 -419
- package/dist/domain/memory/index-regen.d.ts +0 -30
- package/dist/domain/memory/index-regen.js +0 -334
- package/dist/domain/memory/rules-loader.d.ts +0 -6
- package/dist/domain/memory/rules-loader.js +0 -13
- package/dist/domain/memory/user-context.d.ts +0 -5
- package/dist/domain/memory/user-context.js +0 -32
- package/dist/domain/memory/watcher.d.ts +0 -8
- package/dist/domain/memory/watcher.js +0 -135
- package/dist/domain/monitor/disk-monitor.d.ts +0 -17
- package/dist/domain/monitor/disk-monitor.js +0 -117
- package/dist/domain/monitor/event-loop-monitor.d.ts +0 -35
- package/dist/domain/monitor/event-loop-monitor.js +0 -64
- package/dist/domain/monitor/gpu-monitor.d.ts +0 -26
- package/dist/domain/monitor/gpu-monitor.js +0 -132
- package/dist/domain/pi-providers/custom-provider-model.d.ts +0 -49
- package/dist/domain/pi-providers/custom-provider-model.js +0 -116
- package/dist/domain/pi-providers/custom-provider-service.d.ts +0 -57
- package/dist/domain/pi-providers/custom-provider-service.js +0 -153
- package/dist/domain/pi-providers/gateway-route-store.d.ts +0 -23
- package/dist/domain/pi-providers/gateway-route-store.js +0 -74
- package/dist/domain/pi-providers/index.d.ts +0 -3
- package/dist/domain/pi-providers/index.js +0 -3
- package/dist/domain/pi-providers/models-json-store.d.ts +0 -6
- package/dist/domain/pi-providers/models-json-store.js +0 -73
- package/dist/domain/plugins/agent-plugins-v1.d.ts +0 -58
- package/dist/domain/plugins/agent-plugins-v1.js +0 -84
- package/dist/domain/plugins/authoring.d.ts +0 -46
- package/dist/domain/plugins/authoring.js +0 -335
- package/dist/domain/plugins/builtin.d.ts +0 -25
- package/dist/domain/plugins/builtin.js +0 -44
- package/dist/domain/plugins/catalog-types.d.ts +0 -89
- package/dist/domain/plugins/catalog-types.js +0 -39
- package/dist/domain/plugins/catalog.d.ts +0 -39
- package/dist/domain/plugins/catalog.js +0 -482
- package/dist/domain/plugins/conversation-skills.d.ts +0 -10
- package/dist/domain/plugins/conversation-skills.js +0 -22
- package/dist/domain/plugins/fs-helpers.d.ts +0 -9
- package/dist/domain/plugins/fs-helpers.js +0 -107
- package/dist/domain/plugins/mcp.d.ts +0 -6
- package/dist/domain/plugins/mcp.js +0 -223
- package/dist/domain/plugins/runtime-gc.d.ts +0 -17
- package/dist/domain/plugins/runtime-gc.js +0 -101
- package/dist/domain/plugins/runtime.d.ts +0 -21
- package/dist/domain/plugins/runtime.js +0 -555
- package/dist/domain/plugins/skill-projection.d.ts +0 -19
- package/dist/domain/plugins/skill-projection.js +0 -193
- package/dist/domain/plugins/skill.d.ts +0 -14
- package/dist/domain/plugins/skill.js +0 -145
- package/dist/domain/projects/index.d.ts +0 -3
- package/dist/domain/projects/index.js +0 -3
- package/dist/domain/projects/project-store.d.ts +0 -72
- package/dist/domain/projects/project-store.js +0 -240
- package/dist/domain/projects/project-types.d.ts +0 -11
- package/dist/domain/projects/project-types.js +0 -1
- package/dist/domain/remote/client-bootstrap.d.ts +0 -1
- package/dist/domain/remote/client-bootstrap.js +0 -126
- package/dist/domain/remote/client-hot-reload.d.ts +0 -40
- package/dist/domain/remote/client-hot-reload.js +0 -269
- package/dist/domain/remote/client-lifecycle.d.ts +0 -32
- package/dist/domain/remote/client-lifecycle.js +0 -382
- package/dist/domain/remote/client-manager.d.ts +0 -54
- package/dist/domain/remote/client-manager.js +0 -325
- package/dist/domain/remote/client-pids.d.ts +0 -13
- package/dist/domain/remote/client-pids.js +0 -43
- package/dist/domain/remote/client-protocol.d.ts +0 -1
- package/dist/domain/remote/client-protocol.js +0 -1
- package/dist/domain/remote/client-remove.d.ts +0 -61
- package/dist/domain/remote/client-remove.js +0 -129
- package/dist/domain/remote/client-ssh-tunnel.d.ts +0 -79
- package/dist/domain/remote/client-ssh-tunnel.js +0 -352
- package/dist/domain/remote/device-browser.d.ts +0 -38
- package/dist/domain/remote/device-browser.js +0 -158
- package/dist/domain/remote/device-chrome-commands.d.ts +0 -18
- package/dist/domain/remote/device-chrome-commands.js +0 -125
- package/dist/domain/remote/device-file.d.ts +0 -51
- package/dist/domain/remote/device-file.js +0 -193
- package/dist/domain/remote/device-port.d.ts +0 -23
- package/dist/domain/remote/device-port.js +0 -192
- package/dist/domain/remote/local-client-install.d.ts +0 -32
- package/dist/domain/remote/local-client-install.js +0 -168
- package/dist/domain/remote/local-client-stop.d.ts +0 -37
- package/dist/domain/remote/local-client-stop.js +0 -101
- package/dist/domain/remote/machine-registry.d.ts +0 -54
- package/dist/domain/remote/machine-registry.js +0 -184
- package/dist/domain/remote/owned-local-launch.d.ts +0 -22
- package/dist/domain/remote/owned-local-launch.js +0 -75
- package/dist/domain/remote/package-client-bundle.d.ts +0 -14
- package/dist/domain/remote/package-client-bundle.js +0 -37
- package/dist/domain/remote/reverse-stream.d.ts +0 -42
- package/dist/domain/remote/reverse-stream.js +0 -95
- package/dist/domain/remote/ssh-exec.d.ts +0 -10
- package/dist/domain/remote/ssh-exec.js +0 -25
- package/dist/domain/runs/adapters.d.ts +0 -15
- package/dist/domain/runs/adapters.js +0 -59
- package/dist/domain/runs/attempt.d.ts +0 -37
- package/dist/domain/runs/attempt.js +0 -232
- package/dist/domain/runs/builders.d.ts +0 -27
- package/dist/domain/runs/builders.js +0 -47
- package/dist/domain/runs/compact.d.ts +0 -30
- package/dist/domain/runs/compact.js +0 -43
- package/dist/domain/runs/config-resolver.d.ts +0 -26
- package/dist/domain/runs/config-resolver.js +0 -38
- package/dist/domain/runs/engine-spec.d.ts +0 -40
- package/dist/domain/runs/engine-spec.js +0 -215
- package/dist/domain/runs/engines.d.ts +0 -71
- package/dist/domain/runs/engines.js +0 -181
- package/dist/domain/runs/events.d.ts +0 -2
- package/dist/domain/runs/events.js +0 -1
- package/dist/domain/runs/fallback.d.ts +0 -11
- package/dist/domain/runs/fallback.js +0 -18
- package/dist/domain/runs/mode-env.d.ts +0 -16
- package/dist/domain/runs/mode-env.js +0 -48
- package/dist/domain/runs/notices.d.ts +0 -44
- package/dist/domain/runs/notices.js +0 -109
- package/dist/domain/runs/observers/resume-recorder.d.ts +0 -26
- package/dist/domain/runs/observers/resume-recorder.js +0 -27
- package/dist/domain/runs/prompt.d.ts +0 -78
- package/dist/domain/runs/prompt.js +0 -98
- package/dist/domain/runs/request.d.ts +0 -99
- package/dist/domain/runs/request.js +0 -1
- package/dist/domain/runs/retryable-errors.d.ts +0 -5
- package/dist/domain/runs/retryable-errors.js +0 -24
- package/dist/domain/runs/run.d.ts +0 -238
- package/dist/domain/runs/run.js +0 -574
- package/dist/domain/runs/service.d.ts +0 -3
- package/dist/domain/runs/service.js +0 -63
- package/dist/domain/runs/spec-loader.d.ts +0 -75
- package/dist/domain/runs/spec-loader.js +0 -58
- package/dist/domain/runs/spend.d.ts +0 -16
- package/dist/domain/runs/spend.js +0 -31
- package/dist/domain/scheduling/builtin-job-controller.d.ts +0 -21
- package/dist/domain/scheduling/builtin-job-controller.js +0 -106
- package/dist/domain/scheduling/builtin-job-migration.d.ts +0 -23
- package/dist/domain/scheduling/builtin-job-migration.js +0 -64
- package/dist/domain/scheduling/builtin-jobs.d.ts +0 -2
- package/dist/domain/scheduling/builtin-jobs.js +0 -44
- package/dist/domain/scheduling/job-registry.d.ts +0 -22
- package/dist/domain/scheduling/job-registry.js +0 -16
- package/dist/domain/scheduling/jobs/auth-expiry-scan.d.ts +0 -15
- package/dist/domain/scheduling/jobs/auth-expiry-scan.js +0 -75
- package/dist/domain/scheduling/jobs/scheduled-task.d.ts +0 -24
- package/dist/domain/scheduling/jobs/scheduled-task.js +0 -112
- package/dist/domain/scheduling/jobs/sync-public.d.ts +0 -4
- package/dist/domain/scheduling/jobs/sync-public.js +0 -40
- package/dist/domain/scheduling/run-guards.d.ts +0 -6
- package/dist/domain/scheduling/run-guards.js +0 -18
- package/dist/domain/scheduling/runner.d.ts +0 -17
- package/dist/domain/scheduling/runner.js +0 -22
- package/dist/domain/scheduling/schedule-ops.d.ts +0 -15
- package/dist/domain/scheduling/schedule-ops.js +0 -43
- package/dist/domain/scheduling/schedule-selection.d.ts +0 -3
- package/dist/domain/scheduling/schedule-selection.js +0 -16
- package/dist/domain/scheduling/schedule-spec.d.ts +0 -79
- package/dist/domain/scheduling/schedule-spec.js +0 -169
- package/dist/domain/scheduling/scheduler.d.ts +0 -75
- package/dist/domain/scheduling/scheduler.js +0 -312
- package/dist/domain/sessions/session-backup.d.ts +0 -44
- package/dist/domain/sessions/session-backup.js +0 -138
- package/dist/domain/sessions/session-hooks.d.ts +0 -130
- package/dist/domain/sessions/session-hooks.js +0 -347
- package/dist/domain/sessions/session-lifecycle.d.ts +0 -91
- package/dist/domain/sessions/session-lifecycle.js +0 -82
- package/dist/domain/sessions/session-retention.d.ts +0 -50
- package/dist/domain/sessions/session-retention.js +0 -466
- package/dist/domain/sessions/session-use.d.ts +0 -28
- package/dist/domain/sessions/session-use.js +0 -45
- package/dist/domain/sessions/session.d.ts +0 -3
- package/dist/domain/sessions/session.js +0 -13
- package/dist/domain/sessions/team.d.ts +0 -26
- package/dist/domain/sessions/team.js +0 -30
- package/dist/domain/system/doctor.d.ts +0 -82
- package/dist/domain/system/doctor.js +0 -484
- package/dist/domain/system/github-release.d.ts +0 -16
- package/dist/domain/system/github-release.js +0 -101
- package/dist/domain/system/install-cli.d.ts +0 -7
- package/dist/domain/system/install-cli.js +0 -107
- package/dist/domain/system/notice-history.d.ts +0 -18
- package/dist/domain/system/notice-history.js +0 -23
- package/dist/domain/system/own-bin-path.d.ts +0 -13
- package/dist/domain/system/own-bin-path.js +0 -36
- package/dist/domain/system/preferences.d.ts +0 -30
- package/dist/domain/system/preferences.js +0 -59
- package/dist/domain/system/rebuild-hold.d.ts +0 -36
- package/dist/domain/system/rebuild-hold.js +0 -83
- package/dist/domain/system/server-update-check.d.ts +0 -24
- package/dist/domain/system/server-update-check.js +0 -89
- package/dist/domain/system/server-update-coordinator.d.ts +0 -46
- package/dist/domain/system/server-update-coordinator.js +0 -155
- package/dist/domain/system/server-update-install.d.ts +0 -16
- package/dist/domain/system/server-update-install.js +0 -65
- package/dist/domain/system/system-notice.d.ts +0 -24
- package/dist/domain/system/system-notice.js +0 -31
- package/dist/domain/system/terminal-cli/index.d.ts +0 -58
- package/dist/domain/system/terminal-cli/index.js +0 -100
- package/dist/domain/system/terminal-cli/posix-profiles.d.ts +0 -23
- package/dist/domain/system/terminal-cli/posix-profiles.js +0 -74
- package/dist/domain/system/terminal-cli/registrar.d.ts +0 -12
- package/dist/domain/system/terminal-cli/registrar.js +0 -1
- package/dist/domain/system/terminal-cli/shims.d.ts +0 -27
- package/dist/domain/system/terminal-cli/shims.js +0 -108
- package/dist/domain/system/terminal-cli/state.d.ts +0 -7
- package/dist/domain/system/terminal-cli/state.js +0 -36
- package/dist/domain/system/terminal-cli/windows-user-path.d.ts +0 -13
- package/dist/domain/system/terminal-cli/windows-user-path.js +0 -67
- package/dist/domain/system/update-prompt.d.ts +0 -8
- package/dist/domain/system/update-prompt.js +0 -1
- package/dist/domain/system/update-state.d.ts +0 -9
- package/dist/domain/system/update-state.js +0 -22
- package/dist/domain/system/update-ui-state.d.ts +0 -39
- package/dist/domain/system/update-ui-state.js +0 -70
- package/dist/domain/telemetry/bus-collector.d.ts +0 -3
- package/dist/domain/telemetry/bus-collector.js +0 -22
- package/dist/domain/telemetry/child-exit.d.ts +0 -11
- package/dist/domain/telemetry/child-exit.js +0 -36
- package/dist/domain/telemetry/client-kind.d.ts +0 -4
- package/dist/domain/telemetry/client-kind.js +0 -7
- package/dist/domain/telemetry/crash-limits.d.ts +0 -15
- package/dist/domain/telemetry/crash-limits.js +0 -50
- package/dist/domain/telemetry/crash.d.ts +0 -25
- package/dist/domain/telemetry/crash.js +0 -70
- package/dist/domain/telemetry/daily-upload.d.ts +0 -5
- package/dist/domain/telemetry/daily-upload.js +0 -20
- package/dist/domain/telemetry/daily.d.ts +0 -5
- package/dist/domain/telemetry/daily.js +0 -104
- package/dist/domain/telemetry/endpoint.d.ts +0 -7
- package/dist/domain/telemetry/endpoint.js +0 -40
- package/dist/domain/telemetry/envelope.d.ts +0 -6
- package/dist/domain/telemetry/envelope.js +0 -35
- package/dist/domain/telemetry/error-digest.d.ts +0 -7
- package/dist/domain/telemetry/error-digest.js +0 -43
- package/dist/domain/telemetry/funnel.d.ts +0 -6
- package/dist/domain/telemetry/funnel.js +0 -22
- package/dist/domain/telemetry/gate.d.ts +0 -19
- package/dist/domain/telemetry/gate.js +0 -67
- package/dist/domain/telemetry/heartbeat.d.ts +0 -17
- package/dist/domain/telemetry/heartbeat.js +0 -49
- package/dist/domain/telemetry/info.d.ts +0 -9
- package/dist/domain/telemetry/info.js +0 -12
- package/dist/domain/telemetry/init-answer.d.ts +0 -12
- package/dist/domain/telemetry/init-answer.js +0 -42
- package/dist/domain/telemetry/install-id.d.ts +0 -5
- package/dist/domain/telemetry/install-id.js +0 -42
- package/dist/domain/telemetry/normalize.d.ts +0 -33
- package/dist/domain/telemetry/normalize.js +0 -88
- package/dist/domain/telemetry/outbox.d.ts +0 -18
- package/dist/domain/telemetry/outbox.js +0 -93
- package/dist/domain/telemetry/panic-group.d.ts +0 -4
- package/dist/domain/telemetry/panic-group.js +0 -51
- package/dist/domain/telemetry/paths.d.ts +0 -7
- package/dist/domain/telemetry/paths.js +0 -11
- package/dist/domain/telemetry/redact.d.ts +0 -18
- package/dist/domain/telemetry/redact.js +0 -109
- package/dist/domain/telemetry/rollup-types.d.ts +0 -81
- package/dist/domain/telemetry/rollup-types.js +0 -31
- package/dist/domain/telemetry/rollup.d.ts +0 -16
- package/dist/domain/telemetry/rollup.js +0 -102
- package/dist/domain/telemetry/schema.d.ts +0 -931
- package/dist/domain/telemetry/schema.js +0 -275
- package/dist/domain/telemetry/service.d.ts +0 -34
- package/dist/domain/telemetry/service.js +0 -146
- package/dist/domain/telemetry/state.d.ts +0 -17
- package/dist/domain/telemetry/state.js +0 -29
- package/dist/domain/telemetry/turns.d.ts +0 -17
- package/dist/domain/telemetry/turns.js +0 -176
- package/dist/domain/telemetry/upgrade.d.ts +0 -14
- package/dist/domain/telemetry/upgrade.js +0 -87
- package/dist/domain/telemetry/uploader.d.ts +0 -21
- package/dist/domain/telemetry/uploader.js +0 -82
- package/dist/domain/telemetry/usage.d.ts +0 -25
- package/dist/domain/telemetry/usage.js +0 -153
- package/dist/domain/telemetry/web-report.d.ts +0 -8
- package/dist/domain/telemetry/web-report.js +0 -15
- package/dist/domain/tui-session/index.d.ts +0 -2
- package/dist/domain/tui-session/index.js +0 -1
- package/dist/domain/tui-session/tui-session-service.d.ts +0 -2
- package/dist/domain/tui-session/tui-session-service.js +0 -85
- package/dist/domain/tui-session/types.d.ts +0 -40
- package/dist/domain/tui-session/types.js +0 -1
- package/dist/domain/ui-service/app-router.d.ts +0 -1180
- package/dist/domain/ui-service/app-router.js +0 -312
- package/dist/domain/ui-service/assistant-snapshots.d.ts +0 -10
- package/dist/domain/ui-service/assistant-snapshots.js +0 -45
- package/dist/domain/ui-service/contract.parity.d.ts +0 -19
- package/dist/domain/ui-service/contract.parity.js +0 -1
- package/dist/domain/ui-service/index.d.ts +0 -4
- package/dist/domain/ui-service/index.js +0 -1
- package/dist/domain/ui-service/inline-media-types.d.ts +0 -18
- package/dist/domain/ui-service/inline-media-types.js +0 -1
- package/dist/domain/ui-service/input-schemas.d.ts +0 -1132
- package/dist/domain/ui-service/input-schemas.js +0 -710
- package/dist/domain/ui-service/mutate/approvals.d.ts +0 -33
- package/dist/domain/ui-service/mutate/approvals.js +0 -134
- package/dist/domain/ui-service/mutate/auth.d.ts +0 -15
- package/dist/domain/ui-service/mutate/auth.js +0 -103
- package/dist/domain/ui-service/mutate/config.d.ts +0 -18
- package/dist/domain/ui-service/mutate/config.js +0 -108
- package/dist/domain/ui-service/mutate/custom-providers.d.ts +0 -8
- package/dist/domain/ui-service/mutate/custom-providers.js +0 -33
- package/dist/domain/ui-service/mutate/environments.d.ts +0 -27
- package/dist/domain/ui-service/mutate/environments.js +0 -66
- package/dist/domain/ui-service/mutate/errors.d.ts +0 -7
- package/dist/domain/ui-service/mutate/errors.js +0 -14
- package/dist/domain/ui-service/mutate/executions.d.ts +0 -4
- package/dist/domain/ui-service/mutate/executions.js +0 -15
- package/dist/domain/ui-service/mutate/hooks.d.ts +0 -12
- package/dist/domain/ui-service/mutate/hooks.js +0 -110
- package/dist/domain/ui-service/mutate/issues.d.ts +0 -18
- package/dist/domain/ui-service/mutate/issues.js +0 -100
- package/dist/domain/ui-service/mutate/models.d.ts +0 -13
- package/dist/domain/ui-service/mutate/models.js +0 -137
- package/dist/domain/ui-service/mutate/notes.d.ts +0 -6
- package/dist/domain/ui-service/mutate/notes.js +0 -32
- package/dist/domain/ui-service/mutate/platform-settings.d.ts +0 -6
- package/dist/domain/ui-service/mutate/platform-settings.js +0 -17
- package/dist/domain/ui-service/mutate/plugin-packages.d.ts +0 -10
- package/dist/domain/ui-service/mutate/plugin-packages.js +0 -152
- package/dist/domain/ui-service/mutate/plugins.d.ts +0 -2
- package/dist/domain/ui-service/mutate/plugins.js +0 -38
- package/dist/domain/ui-service/mutate/projects.d.ts +0 -4
- package/dist/domain/ui-service/mutate/projects.js +0 -7
- package/dist/domain/ui-service/mutate/resolve-media.d.ts +0 -4
- package/dist/domain/ui-service/mutate/resolve-media.js +0 -17
- package/dist/domain/ui-service/mutate/schedules.d.ts +0 -12
- package/dist/domain/ui-service/mutate/schedules.js +0 -75
- package/dist/domain/ui-service/mutate/session-metadata.d.ts +0 -3
- package/dist/domain/ui-service/mutate/session-metadata.js +0 -22
- package/dist/domain/ui-service/mutate/sessions.d.ts +0 -19
- package/dist/domain/ui-service/mutate/sessions.js +0 -307
- package/dist/domain/ui-service/mutate/system.d.ts +0 -10
- package/dist/domain/ui-service/mutate/system.js +0 -120
- package/dist/domain/ui-service/mutate/telemetry.d.ts +0 -5
- package/dist/domain/ui-service/mutate/telemetry.js +0 -6
- package/dist/domain/ui-service/mutate/usage-sharing.d.ts +0 -8
- package/dist/domain/ui-service/mutate/usage-sharing.js +0 -16
- package/dist/domain/ui-service/mutate/waitpoints.d.ts +0 -2
- package/dist/domain/ui-service/mutate/waitpoints.js +0 -13
- package/dist/domain/ui-service/platform-settings.d.ts +0 -5
- package/dist/domain/ui-service/platform-settings.js +0 -72
- package/dist/domain/ui-service/plugins-shared.d.ts +0 -29
- package/dist/domain/ui-service/plugins-shared.js +0 -176
- package/dist/domain/ui-service/query/approvals.d.ts +0 -10
- package/dist/domain/ui-service/query/approvals.js +0 -119
- package/dist/domain/ui-service/query/auth.d.ts +0 -6
- package/dist/domain/ui-service/query/auth.js +0 -8
- package/dist/domain/ui-service/query/boards.d.ts +0 -14
- package/dist/domain/ui-service/query/boards.js +0 -111
- package/dist/domain/ui-service/query/config.d.ts +0 -9
- package/dist/domain/ui-service/query/config.js +0 -167
- package/dist/domain/ui-service/query/cost.d.ts +0 -3
- package/dist/domain/ui-service/query/cost.js +0 -3
- package/dist/domain/ui-service/query/custom-providers.d.ts +0 -8
- package/dist/domain/ui-service/query/custom-providers.js +0 -9
- package/dist/domain/ui-service/query/environments.d.ts +0 -12
- package/dist/domain/ui-service/query/environments.js +0 -73
- package/dist/domain/ui-service/query/executions.d.ts +0 -3
- package/dist/domain/ui-service/query/executions.js +0 -61
- package/dist/domain/ui-service/query/hooks.d.ts +0 -9
- package/dist/domain/ui-service/query/hooks.js +0 -92
- package/dist/domain/ui-service/query/issues.d.ts +0 -14
- package/dist/domain/ui-service/query/issues.js +0 -78
- package/dist/domain/ui-service/query/machine-detail.d.ts +0 -2
- package/dist/domain/ui-service/query/machine-detail.js +0 -30
- package/dist/domain/ui-service/query/machine-probe.d.ts +0 -18
- package/dist/domain/ui-service/query/machine-probe.js +0 -133
- package/dist/domain/ui-service/query/machines.d.ts +0 -2
- package/dist/domain/ui-service/query/machines.js +0 -21
- package/dist/domain/ui-service/query/memory.d.ts +0 -7
- package/dist/domain/ui-service/query/memory.js +0 -191
- package/dist/domain/ui-service/query/models.d.ts +0 -27
- package/dist/domain/ui-service/query/models.js +0 -125
- package/dist/domain/ui-service/query/notes.d.ts +0 -3
- package/dist/domain/ui-service/query/notes.js +0 -15
- package/dist/domain/ui-service/query/plugin-source.d.ts +0 -4
- package/dist/domain/ui-service/query/plugin-source.js +0 -58
- package/dist/domain/ui-service/query/plugins.d.ts +0 -2
- package/dist/domain/ui-service/query/plugins.js +0 -28
- package/dist/domain/ui-service/query/projects.d.ts +0 -2
- package/dist/domain/ui-service/query/projects.js +0 -27
- package/dist/domain/ui-service/query/schedules.d.ts +0 -5
- package/dist/domain/ui-service/query/schedules.js +0 -28
- package/dist/domain/ui-service/query/sessions.d.ts +0 -6
- package/dist/domain/ui-service/query/sessions.js +0 -430
- package/dist/domain/ui-service/query/skills.d.ts +0 -5
- package/dist/domain/ui-service/query/skills.js +0 -16
- package/dist/domain/ui-service/query/system.d.ts +0 -6
- package/dist/domain/ui-service/query/system.js +0 -120
- package/dist/domain/ui-service/query/telemetry.d.ts +0 -3
- package/dist/domain/ui-service/query/telemetry.js +0 -4
- package/dist/domain/ui-service/query/usage-sharing.d.ts +0 -4
- package/dist/domain/ui-service/query/usage-sharing.js +0 -5
- package/dist/domain/ui-service/query/waitpoints.d.ts +0 -10
- package/dist/domain/ui-service/query/waitpoints.js +0 -37
- package/dist/domain/ui-service/query-input-schemas.d.ts +0 -73
- package/dist/domain/ui-service/query-input-schemas.js +0 -70
- package/dist/domain/ui-service/session-metadata-schemas.d.ts +0 -13
- package/dist/domain/ui-service/session-metadata-schemas.js +0 -9
- package/dist/domain/ui-service/subscribe.d.ts +0 -6
- package/dist/domain/ui-service/subscribe.js +0 -125
- package/dist/domain/ui-service/trpc.d.ts +0 -52
- package/dist/domain/ui-service/trpc.js +0 -43
- package/dist/domain/ui-service/types.d.ts +0 -1808
- package/dist/domain/ui-service/types.js +0 -1
- package/dist/domain/ui-service/ui-service.d.ts +0 -541
- package/dist/domain/ui-service/ui-service.js +0 -235
- package/dist/domain/waitpoints/notices.d.ts +0 -25
- package/dist/domain/waitpoints/notices.js +0 -125
- package/dist/domain/waitpoints/service.d.ts +0 -107
- package/dist/domain/waitpoints/service.js +0 -276
- package/dist/domain/waitpoints/view.d.ts +0 -29
- package/dist/domain/waitpoints/view.js +0 -97
- package/dist/entry/admin-channel-hot-reload.d.ts +0 -4
- package/dist/entry/admin-channel-hot-reload.js +0 -17
- package/dist/entry/app.d.ts +0 -1
- package/dist/entry/auth-cli.d.ts +0 -9
- package/dist/entry/auth-cli.js +0 -55
- package/dist/entry/auth-login-cli.d.ts +0 -20
- package/dist/entry/auth-login-cli.js +0 -153
- package/dist/entry/auth-login-terminal.d.ts +0 -16
- package/dist/entry/auth-login-terminal.js +0 -59
- package/dist/entry/boot-jobs.d.ts +0 -7
- package/dist/entry/boot-jobs.js +0 -16
- package/dist/entry/browser-cli.d.ts +0 -39
- package/dist/entry/cli-help.d.ts +0 -10
- package/dist/entry/cli-help.js +0 -290
- package/dist/entry/cli.d.ts +0 -19
- package/dist/entry/client-cli.d.ts +0 -4
- package/dist/entry/client-cli.js +0 -62
- package/dist/entry/cortex-cli.d.ts +0 -1
- package/dist/entry/daemon-notice.d.ts +0 -26
- package/dist/entry/daemon-notice.js +0 -38
- package/dist/entry/daemon.d.ts +0 -120
- package/dist/entry/doctor-cli.d.ts +0 -8
- package/dist/entry/doctor-cli.js +0 -70
- package/dist/entry/draft-attachments.d.ts +0 -8
- package/dist/entry/draft-attachments.js +0 -79
- package/dist/entry/fast-install.d.ts +0 -49
- package/dist/entry/fast-install.js +0 -192
- package/dist/entry/feishu-login.d.ts +0 -21
- package/dist/entry/feishu-login.js +0 -209
- package/dist/entry/hook-cli.d.ts +0 -14
- package/dist/entry/init-auth.d.ts +0 -4
- package/dist/entry/init-auth.js +0 -42
- package/dist/entry/init-git.d.ts +0 -6
- package/dist/entry/init-git.js +0 -36
- package/dist/entry/init-local-client.d.ts +0 -11
- package/dist/entry/init-local-client.js +0 -34
- package/dist/entry/init.d.ts +0 -151
- package/dist/entry/init.js +0 -1292
- package/dist/entry/local-ui.d.ts +0 -38
- package/dist/entry/local-ui.js +0 -107
- package/dist/entry/memory-cli.d.ts +0 -3
- package/dist/entry/memory-cli.js +0 -79
- package/dist/entry/path-cli.d.ts +0 -4
- package/dist/entry/path-cli.js +0 -65
- package/dist/entry/platform-connect.d.ts +0 -23
- package/dist/entry/platform-connect.js +0 -94
- package/dist/entry/production-app-bootstrap.d.ts +0 -1
- package/dist/entry/production-evidence-export-cli.d.ts +0 -13
- package/dist/entry/provider-cli.d.ts +0 -12
- package/dist/entry/provider-cli.js +0 -199
- package/dist/entry/schedule-cli.d.ts +0 -10
- package/dist/entry/schedule-cli.js +0 -166
- package/dist/entry/shutdown.d.ts +0 -32
- package/dist/entry/shutdown.js +0 -84
- package/dist/entry/signal-cli.d.ts +0 -25
- package/dist/entry/start-ui-http.d.ts +0 -24
- package/dist/entry/start-ui-http.js +0 -188
- package/dist/entry/startup-helpers.d.ts +0 -2
- package/dist/entry/startup-helpers.js +0 -15
- package/dist/entry/startup-notify.d.ts +0 -6
- package/dist/entry/startup-notify.js +0 -18
- package/dist/entry/telemetry-wiring.d.ts +0 -12
- package/dist/entry/telemetry-wiring.js +0 -56
- package/dist/entry/ui-cli.d.ts +0 -2
- package/dist/entry/ui-cli.js +0 -87
- package/dist/entry/ui-http-gate.d.ts +0 -17
- package/dist/entry/ui-http-gate.js +0 -17
- package/dist/entry/ui-service-wiring.d.ts +0 -12
- package/dist/entry/ui-service-wiring.js +0 -144
- package/dist/events/event-bus.d.ts +0 -47
- package/dist/events/event-bus.js +0 -83
- package/dist/events/event-logger.d.ts +0 -12
- package/dist/events/event-logger.js +0 -144
- package/dist/events/event-types.d.ts +0 -259
- package/dist/events/event-types.js +0 -1
- package/dist/events/index.d.ts +0 -5
- package/dist/events/index.js +0 -2
- package/dist/orchestration/agent-decision-send.d.ts +0 -42
- package/dist/orchestration/agent-decision-send.js +0 -62
- package/dist/orchestration/agent-file-send.d.ts +0 -58
- package/dist/orchestration/agent-file-send.js +0 -69
- package/dist/orchestration/agent-runner.d.ts +0 -52
- package/dist/orchestration/agent-runner.js +0 -230
- package/dist/orchestration/agent-view-send.d.ts +0 -66
- package/dist/orchestration/agent-view-send.js +0 -103
- package/dist/orchestration/attachments-store.d.ts +0 -31
- package/dist/orchestration/attachments-store.js +0 -156
- package/dist/orchestration/benchmark-session-webhook.d.ts +0 -19
- package/dist/orchestration/benchmark-session-webhook.js +0 -142
- package/dist/orchestration/board-webhook.d.ts +0 -7
- package/dist/orchestration/board-webhook.js +0 -38
- package/dist/orchestration/browser-webhook.d.ts +0 -11
- package/dist/orchestration/browser-webhook.js +0 -28
- package/dist/orchestration/busy-tracker.d.ts +0 -15
- package/dist/orchestration/busy-tracker.js +0 -38
- package/dist/orchestration/cache-keep-warm.d.ts +0 -77
- package/dist/orchestration/cache-keep-warm.js +0 -213
- package/dist/orchestration/claude-window-warmup.d.ts +0 -40
- package/dist/orchestration/claude-window-warmup.js +0 -126
- package/dist/orchestration/conduit-queue.d.ts +0 -14
- package/dist/orchestration/conduit-queue.js +0 -53
- package/dist/orchestration/conversation-request.d.ts +0 -163
- package/dist/orchestration/conversation-request.js +0 -276
- package/dist/orchestration/delta-coalescer.d.ts +0 -69
- package/dist/orchestration/delta-coalescer.js +0 -120
- package/dist/orchestration/durable-helpers.d.ts +0 -3
- package/dist/orchestration/durable-helpers.js +0 -38
- package/dist/orchestration/edit-retry.d.ts +0 -35
- package/dist/orchestration/edit-retry.js +0 -127
- package/dist/orchestration/injection-ledger.d.ts +0 -56
- package/dist/orchestration/injection-ledger.js +0 -270
- package/dist/orchestration/inline-media-eager.d.ts +0 -13
- package/dist/orchestration/inline-media-eager.js +0 -58
- package/dist/orchestration/inline-media.d.ts +0 -22
- package/dist/orchestration/inline-media.js +0 -151
- package/dist/orchestration/interactions/answer-question.d.ts +0 -16
- package/dist/orchestration/interactions/answer-question.js +0 -38
- package/dist/orchestration/interactions/ask-user-question.d.ts +0 -34
- package/dist/orchestration/interactions/ask-user-question.js +0 -179
- package/dist/orchestration/interactions/ask-user-resume.d.ts +0 -11
- package/dist/orchestration/interactions/ask-user-resume.js +0 -57
- package/dist/orchestration/interactions/command-action-router.d.ts +0 -31
- package/dist/orchestration/interactions/command-action-router.js +0 -48
- package/dist/orchestration/interactions/interaction-handlers.d.ts +0 -5
- package/dist/orchestration/interactions/interaction-handlers.js +0 -288
- package/dist/orchestration/interactions/interaction-records.d.ts +0 -57
- package/dist/orchestration/interactions/interaction-records.js +0 -142
- package/dist/orchestration/interactions/plan-approvals.d.ts +0 -38
- package/dist/orchestration/interactions/plan-approvals.js +0 -73
- package/dist/orchestration/interactions/plan-handler.d.ts +0 -3
- package/dist/orchestration/interactions/plan-handler.js +0 -13
- package/dist/orchestration/interactions/plan-response.d.ts +0 -9
- package/dist/orchestration/interactions/plan-response.js +0 -23
- package/dist/orchestration/interactions/ui-update-prompt.d.ts +0 -8
- package/dist/orchestration/interactions/ui-update-prompt.js +0 -39
- package/dist/orchestration/interactions/update-prompt.d.ts +0 -6
- package/dist/orchestration/interactions/update-prompt.js +0 -150
- package/dist/orchestration/mid-turn-inject.d.ts +0 -64
- package/dist/orchestration/mid-turn-inject.js +0 -103
- package/dist/orchestration/orchestrator.d.ts +0 -23
- package/dist/orchestration/orchestrator.js +0 -12
- package/dist/orchestration/outputs-store.d.ts +0 -40
- package/dist/orchestration/outputs-store.js +0 -83
- package/dist/orchestration/pending-injection-recovery.d.ts +0 -36
- package/dist/orchestration/pending-injection-recovery.js +0 -88
- package/dist/orchestration/pi-background-subagent.d.ts +0 -15
- package/dist/orchestration/pi-background-subagent.js +0 -34
- package/dist/orchestration/resume-dispatcher.d.ts +0 -20
- package/dist/orchestration/resume-dispatcher.js +0 -97
- package/dist/orchestration/resume-target-sink.d.ts +0 -37
- package/dist/orchestration/resume-target-sink.js +0 -68
- package/dist/orchestration/routing/commands/cancel.d.ts +0 -58
- package/dist/orchestration/routing/commands/cancel.js +0 -212
- package/dist/orchestration/routing/commands/channel.d.ts +0 -7
- package/dist/orchestration/routing/commands/channel.js +0 -229
- package/dist/orchestration/routing/commands/command-context.d.ts +0 -14
- package/dist/orchestration/routing/commands/command-context.js +0 -1
- package/dist/orchestration/routing/commands/compact.d.ts +0 -6
- package/dist/orchestration/routing/commands/compact.js +0 -22
- package/dist/orchestration/routing/commands/cost.d.ts +0 -11
- package/dist/orchestration/routing/commands/cost.js +0 -101
- package/dist/orchestration/routing/commands/device.d.ts +0 -4
- package/dist/orchestration/routing/commands/device.js +0 -70
- package/dist/orchestration/routing/commands/index.d.ts +0 -22
- package/dist/orchestration/routing/commands/index.js +0 -160
- package/dist/orchestration/routing/commands/lang.d.ts +0 -9
- package/dist/orchestration/routing/commands/lang.js +0 -34
- package/dist/orchestration/routing/commands/login-custom.d.ts +0 -26
- package/dist/orchestration/routing/commands/login-custom.js +0 -85
- package/dist/orchestration/routing/commands/login-notice.d.ts +0 -23
- package/dist/orchestration/routing/commands/login-notice.js +0 -84
- package/dist/orchestration/routing/commands/login.d.ts +0 -12
- package/dist/orchestration/routing/commands/login.js +0 -560
- package/dist/orchestration/routing/commands/mode.d.ts +0 -10
- package/dist/orchestration/routing/commands/mode.js +0 -302
- package/dist/orchestration/routing/commands/nvtop.d.ts +0 -3
- package/dist/orchestration/routing/commands/nvtop.js +0 -107
- package/dist/orchestration/routing/commands/orient.d.ts +0 -2
- package/dist/orchestration/routing/commands/orient.js +0 -5
- package/dist/orchestration/routing/commands/restart.d.ts +0 -18
- package/dist/orchestration/routing/commands/restart.js +0 -31
- package/dist/orchestration/routing/commands/schedule.d.ts +0 -6
- package/dist/orchestration/routing/commands/schedule.js +0 -206
- package/dist/orchestration/routing/commands/sendfile.d.ts +0 -2
- package/dist/orchestration/routing/commands/sendfile.js +0 -97
- package/dist/orchestration/routing/commands/session.d.ts +0 -18
- package/dist/orchestration/routing/commands/session.js +0 -131
- package/dist/orchestration/routing/commands/status.d.ts +0 -5
- package/dist/orchestration/routing/commands/status.js +0 -165
- package/dist/orchestration/routing/commands/tail.d.ts +0 -2
- package/dist/orchestration/routing/commands/tail.js +0 -79
- package/dist/orchestration/routing/commands/time-ago.d.ts +0 -2
- package/dist/orchestration/routing/commands/time-ago.js +0 -14
- package/dist/orchestration/routing/commands/usage-format.d.ts +0 -5
- package/dist/orchestration/routing/commands/usage-format.js +0 -107
- package/dist/orchestration/routing/commands/usage-reset.d.ts +0 -20
- package/dist/orchestration/routing/commands/usage-reset.js +0 -123
- package/dist/orchestration/routing/commands/usage.d.ts +0 -10
- package/dist/orchestration/routing/commands/usage.js +0 -54
- package/dist/orchestration/routing/edit-handler.d.ts +0 -27
- package/dist/orchestration/routing/edit-handler.js +0 -205
- package/dist/orchestration/routing/file-handler.d.ts +0 -15
- package/dist/orchestration/routing/file-handler.js +0 -39
- package/dist/orchestration/routing/hook-bridge-subscribers.d.ts +0 -14
- package/dist/orchestration/routing/hook-bridge-subscribers.js +0 -174
- package/dist/orchestration/routing/hook-bridge.d.ts +0 -28
- package/dist/orchestration/routing/hook-bridge.js +0 -104
- package/dist/orchestration/routing/message-router.d.ts +0 -6
- package/dist/orchestration/routing/message-router.js +0 -62
- package/dist/orchestration/routing/webhook.d.ts +0 -10
- package/dist/orchestration/routing/webhook.js +0 -434
- package/dist/orchestration/runtime.d.ts +0 -30
- package/dist/orchestration/runtime.js +0 -37
- package/dist/orchestration/session-compact.d.ts +0 -50
- package/dist/orchestration/session-compact.js +0 -84
- package/dist/orchestration/session-events.d.ts +0 -173
- package/dist/orchestration/session-events.js +0 -140
- package/dist/orchestration/session-gateway.d.ts +0 -52
- package/dist/orchestration/session-gateway.js +0 -87
- package/dist/orchestration/session-retention-controller.d.ts +0 -14
- package/dist/orchestration/session-retention-controller.js +0 -88
- package/dist/orchestration/session-retention-liveness.d.ts +0 -13
- package/dist/orchestration/session-retention-liveness.js +0 -31
- package/dist/orchestration/session-rewind.d.ts +0 -79
- package/dist/orchestration/session-rewind.js +0 -147
- package/dist/orchestration/status-helpers.d.ts +0 -40
- package/dist/orchestration/status-helpers.js +0 -177
- package/dist/orchestration/subagent-adopt.d.ts +0 -20
- package/dist/orchestration/subagent-adopt.js +0 -43
- package/dist/orchestration/subagent-attribution.d.ts +0 -42
- package/dist/orchestration/subagent-attribution.js +0 -130
- package/dist/orchestration/subagent-delivery.d.ts +0 -43
- package/dist/orchestration/subagent-delivery.js +0 -112
- package/dist/orchestration/subagent-rows.d.ts +0 -11
- package/dist/orchestration/subagent-rows.js +0 -16
- package/dist/orchestration/subagent-webhook.d.ts +0 -6
- package/dist/orchestration/subagent-webhook.js +0 -89
- package/dist/orchestration/team-delivery.d.ts +0 -81
- package/dist/orchestration/team-delivery.js +0 -284
- package/dist/orchestration/team-inbox.d.ts +0 -18
- package/dist/orchestration/team-inbox.js +0 -49
- package/dist/orchestration/team-state.d.ts +0 -74
- package/dist/orchestration/team-state.js +0 -219
- package/dist/orchestration/team-webhook.d.ts +0 -57
- package/dist/orchestration/team-webhook.js +0 -293
- package/dist/orchestration/transcript-sink.d.ts +0 -83
- package/dist/orchestration/transcript-sink.js +0 -267
- package/dist/orchestration/turn/active-turns.d.ts +0 -49
- package/dist/orchestration/turn/active-turns.js +0 -76
- package/dist/orchestration/turn/background-hold.d.ts +0 -158
- package/dist/orchestration/turn/background-hold.js +0 -240
- package/dist/orchestration/turn/hold-render-platform.d.ts +0 -35
- package/dist/orchestration/turn/hold-render-platform.js +0 -105
- package/dist/orchestration/turn/hold-render-web.d.ts +0 -17
- package/dist/orchestration/turn/hold-render-web.js +0 -51
- package/dist/orchestration/turn/terminal.d.ts +0 -105
- package/dist/orchestration/turn/terminal.js +0 -194
- package/dist/orchestration/turn/turn-prep.d.ts +0 -33
- package/dist/orchestration/turn/turn-prep.js +0 -44
- package/dist/orchestration/turn/turn-tracking.d.ts +0 -22
- package/dist/orchestration/turn/turn-tracking.js +0 -89
- package/dist/orchestration/turn/turn.d.ts +0 -199
- package/dist/orchestration/turn/turn.js +0 -586
- package/dist/orchestration/turn-mutation-lock.d.ts +0 -3
- package/dist/orchestration/turn-mutation-lock.js +0 -32
- package/dist/orchestration/turn-notify.d.ts +0 -22
- package/dist/orchestration/turn-notify.js +0 -50
- package/dist/orchestration/waitpoint-ingress.d.ts +0 -36
- package/dist/orchestration/waitpoint-ingress.js +0 -183
- package/dist/orchestration/waitpoint-notifier.d.ts +0 -32
- package/dist/orchestration/waitpoint-notifier.js +0 -140
- package/dist/orchestration/waitpoint-remote-drain.d.ts +0 -22
- package/dist/orchestration/waitpoint-remote-drain.js +0 -134
- package/dist/orchestration/waitpoint-sweep.d.ts +0 -43
- package/dist/orchestration/waitpoint-sweep.js +0 -84
- package/dist/platform/adapter.d.ts +0 -48
- package/dist/platform/adapter.js +0 -1
- package/dist/platform/adapters/chunked-output-stream.d.ts +0 -71
- package/dist/platform/adapters/chunked-output-stream.js +0 -382
- package/dist/platform/adapters/composite-adapter.d.ts +0 -99
- package/dist/platform/adapters/composite-adapter.js +0 -369
- package/dist/platform/adapters/feishu-http.d.ts +0 -46
- package/dist/platform/adapters/feishu-http.js +0 -108
- package/dist/platform/adapters/feishu-image.d.ts +0 -19
- package/dist/platform/adapters/feishu-image.js +0 -64
- package/dist/platform/adapters/feishu-output-stream.d.ts +0 -11
- package/dist/platform/adapters/feishu-output-stream.js +0 -29
- package/dist/platform/adapters/feishu.d.ts +0 -167
- package/dist/platform/adapters/feishu.js +0 -1059
- package/dist/platform/adapters/index.d.ts +0 -19
- package/dist/platform/adapters/index.js +0 -108
- package/dist/platform/adapters/project-conduits.d.ts +0 -9
- package/dist/platform/adapters/project-conduits.js +0 -36
- package/dist/platform/adapters/slack-output-stream.d.ts +0 -15
- package/dist/platform/adapters/slack-output-stream.js +0 -33
- package/dist/platform/adapters/slack.d.ts +0 -106
- package/dist/platform/adapters/slack.js +0 -733
- package/dist/platform/adapters/tui/index.d.ts +0 -2
- package/dist/platform/adapters/tui/index.js +0 -2
- package/dist/platform/adapters/tui/ports.d.ts +0 -46
- package/dist/platform/adapters/tui/ports.js +0 -1
- package/dist/platform/adapters/tui/tui-connection.d.ts +0 -20
- package/dist/platform/adapters/tui/tui-connection.js +0 -44
- package/dist/platform/adapters/tui/tui-gateway.d.ts +0 -90
- package/dist/platform/adapters/tui/tui-gateway.js +0 -884
- package/dist/platform/adapters/tui/tui-output-stream.d.ts +0 -35
- package/dist/platform/adapters/tui/tui-output-stream.js +0 -94
- package/dist/platform/adapters/tui/tui-transcript.d.ts +0 -8
- package/dist/platform/adapters/tui/tui-transcript.js +0 -42
- package/dist/platform/browser/agent-browser.d.ts +0 -50
- package/dist/platform/browser/agent-browser.js +0 -165
- package/dist/platform/browser/display.d.ts +0 -48
- package/dist/platform/browser/display.js +0 -188
- package/dist/platform/browser/managed-browser.d.ts +0 -23
- package/dist/platform/browser/managed-browser.js +0 -357
- package/dist/platform/index.d.ts +0 -10
- package/dist/platform/index.js +0 -6
- package/dist/platform/interactive-builder.d.ts +0 -34
- package/dist/platform/interactive-builder.js +0 -138
- package/dist/platform/output-stream-chunk.d.ts +0 -6
- package/dist/platform/output-stream-chunk.js +0 -42
- package/dist/platform/output-stream-helpers.d.ts +0 -8
- package/dist/platform/output-stream-helpers.js +0 -19
- package/dist/platform/output-stream.d.ts +0 -35
- package/dist/platform/output-stream.js +0 -1
- package/dist/platform/testing.d.ts +0 -136
- package/dist/platform/testing.js +0 -286
- package/dist/platform/tool-trace.d.ts +0 -35
- package/dist/platform/tool-trace.js +0 -287
- package/dist/platform/tui/protocol.d.ts +0 -352
- package/dist/platform/tui/protocol.js +0 -146
- package/dist/platform/types.d.ts +0 -223
- package/dist/platform/types.js +0 -22
- package/dist/platform/ui-http/access-jwt.d.ts +0 -28
- package/dist/platform/ui-http/access-jwt.js +0 -53
- package/dist/platform/ui-http/app-update.d.ts +0 -69
- package/dist/platform/ui-http/app-update.js +0 -143
- package/dist/platform/ui-http/browser-stream.d.ts +0 -110
- package/dist/platform/ui-http/browser-stream.js +0 -447
- package/dist/platform/ui-http/device-ports.d.ts +0 -34
- package/dist/platform/ui-http/device-ports.js +0 -102
- package/dist/platform/ui-http/file-routes.d.ts +0 -23
- package/dist/platform/ui-http/file-routes.js +0 -224
- package/dist/platform/ui-http/http-json.d.ts +0 -24
- package/dist/platform/ui-http/http-json.js +0 -109
- package/dist/platform/ui-http/listening-ports.d.ts +0 -98
- package/dist/platform/ui-http/listening-ports.js +0 -239
- package/dist/platform/ui-http/port-forward.d.ts +0 -40
- package/dist/platform/ui-http/port-forward.js +0 -130
- package/dist/platform/ui-http/ui-auth-routes.d.ts +0 -51
- package/dist/platform/ui-http/ui-auth-routes.js +0 -120
- package/dist/platform/ui-http/ui-device-routes.d.ts +0 -13
- package/dist/platform/ui-http/ui-device-routes.js +0 -81
- package/dist/platform/ui-http/ui-devices.d.ts +0 -24
- package/dist/platform/ui-http/ui-devices.js +0 -107
- package/dist/platform/ui-http/ui-http-server.d.ts +0 -100
- package/dist/platform/ui-http/ui-http-server.js +0 -310
- package/dist/platform/ui-http/ui-ota.d.ts +0 -22
- package/dist/platform/ui-http/ui-ota.js +0 -151
- package/dist/platform/ui-http/ui-pairing.d.ts +0 -25
- package/dist/platform/ui-http/ui-pairing.js +0 -98
- package/dist/platform/ui-http/ui-session.d.ts +0 -33
- package/dist/platform/ui-http/ui-session.js +0 -124
- package/dist/platform/ui-http/zip-writer.d.ts +0 -13
- package/dist/platform/ui-http/zip-writer.js +0 -93
- package/dist/platform/utils/rate-limiter.d.ts +0 -90
- package/dist/platform/utils/rate-limiter.js +0 -203
- package/dist/platform/utils/reaction-diagnostics.d.ts +0 -9
- package/dist/platform/utils/reaction-diagnostics.js +0 -19
- package/dist/platform/utils/readable-file.d.ts +0 -9
- package/dist/platform/utils/readable-file.js +0 -18
- package/dist/store/board-migration.d.ts +0 -21
- package/dist/store/board-migration.js +0 -217
- package/dist/store/board-repo.d.ts +0 -35
- package/dist/store/board-repo.js +0 -62
- package/dist/store/builtin-overlay-migration.d.ts +0 -11
- package/dist/store/builtin-overlay-migration.js +0 -308
- package/dist/store/claude-transcript-migration.d.ts +0 -32
- package/dist/store/claude-transcript-migration.js +0 -119
- package/dist/store/conversation-display-projection.d.ts +0 -36
- package/dist/store/conversation-display-projection.js +0 -180
- package/dist/store/conversation-history-reader.d.ts +0 -30
- package/dist/store/conversation-history-reader.js +0 -440
- package/dist/store/conversation-history-repo.d.ts +0 -449
- package/dist/store/conversation-history-repo.js +0 -632
- package/dist/store/conversation-ledger-repo.d.ts +0 -76
- package/dist/store/conversation-ledger-repo.js +0 -219
- package/dist/store/cost-repo.d.ts +0 -88
- package/dist/store/cost-repo.js +0 -233
- package/dist/store/execution-repo.d.ts +0 -169
- package/dist/store/execution-repo.js +0 -329
- package/dist/store/gitignore-migration.d.ts +0 -2
- package/dist/store/gitignore-migration.js +0 -16
- package/dist/store/hook-registry.d.ts +0 -101
- package/dist/store/hook-registry.js +0 -319
- package/dist/store/hook-writer.d.ts +0 -43
- package/dist/store/hook-writer.js +0 -133
- package/dist/store/models-repo.d.ts +0 -18
- package/dist/store/models-repo.js +0 -74
- package/dist/store/outbound-queue.d.ts +0 -67
- package/dist/store/outbound-queue.js +0 -284
- package/dist/store/pending-injection-repo.d.ts +0 -29
- package/dist/store/pending-injection-repo.js +0 -52
- package/dist/store/project-dir-repo.d.ts +0 -17
- package/dist/store/project-dir-repo.js +0 -44
- package/dist/store/project-notes-repo.d.ts +0 -27
- package/dist/store/project-notes-repo.js +0 -219
- package/dist/store/prompt-migration-replacements.d.ts +0 -3
- package/dist/store/prompt-migration-replacements.js +0 -96
- package/dist/store/provider-state-repo.d.ts +0 -22
- package/dist/store/provider-state-repo.js +0 -115
- package/dist/store/retention-candidate-repo.d.ts +0 -12
- package/dist/store/retention-candidate-repo.js +0 -47
- package/dist/store/retire-profiles-migration.d.ts +0 -28
- package/dist/store/retire-profiles-migration.js +0 -335
- package/dist/store/schedule-repo.d.ts +0 -53
- package/dist/store/schedule-repo.js +0 -121
- package/dist/store/session-registry-import.d.ts +0 -34
- package/dist/store/session-registry-import.js +0 -173
- package/dist/store/session-registry-journal.d.ts +0 -195
- package/dist/store/session-registry-journal.js +0 -871
- package/dist/store/session-registry-repo.d.ts +0 -169
- package/dist/store/session-registry-repo.js +0 -530
- package/dist/store/session-totals-repo.d.ts +0 -45
- package/dist/store/session-totals-repo.js +0 -104
- package/dist/store/session-totals.d.ts +0 -69
- package/dist/store/session-totals.js +0 -93
- package/dist/store/team-inbox-repo.d.ts +0 -34
- package/dist/store/team-inbox-repo.js +0 -72
- package/dist/store/team-outbox-repo.d.ts +0 -20
- package/dist/store/team-outbox-repo.js +0 -39
- package/dist/store/tool-image-files.d.ts +0 -12
- package/dist/store/tool-image-files.js +0 -40
- package/dist/store/version-migrations.d.ts +0 -120
- package/dist/store/version-migrations.js +0 -1408
- package/dist/store/waitpoint-repo.d.ts +0 -111
- package/dist/store/waitpoint-repo.js +0 -83
- package/dist/tui/App.d.ts +0 -27
- package/dist/tui/App.js +0 -406
- package/dist/tui/components/AskUserModal.d.ts +0 -10
- package/dist/tui/components/AskUserModal.js +0 -362
- package/dist/tui/components/ConfirmModal.d.ts +0 -12
- package/dist/tui/components/ConfirmModal.js +0 -29
- package/dist/tui/components/Dashboard.d.ts +0 -24
- package/dist/tui/components/Dashboard.js +0 -89
- package/dist/tui/components/DashboardCostTab.d.ts +0 -7
- package/dist/tui/components/DashboardCostTab.js +0 -32
- package/dist/tui/components/DashboardExecutionsTab.d.ts +0 -11
- package/dist/tui/components/DashboardExecutionsTab.js +0 -112
- package/dist/tui/components/DashboardSchedulesTab.d.ts +0 -11
- package/dist/tui/components/DashboardSchedulesTab.js +0 -132
- package/dist/tui/components/InputBox.d.ts +0 -26
- package/dist/tui/components/InputBox.js +0 -266
- package/dist/tui/components/Notifications.d.ts +0 -12
- package/dist/tui/components/Notifications.js +0 -59
- package/dist/tui/components/ProjectSwitcher.d.ts +0 -17
- package/dist/tui/components/ProjectSwitcher.js +0 -40
- package/dist/tui/components/SessionPicker.d.ts +0 -13
- package/dist/tui/components/SessionPicker.js +0 -42
- package/dist/tui/components/SidePanel.d.ts +0 -19
- package/dist/tui/components/SidePanel.js +0 -8
- package/dist/tui/components/SlashMenu.d.ts +0 -8
- package/dist/tui/components/SlashMenu.js +0 -15
- package/dist/tui/components/StatusLine.d.ts +0 -19
- package/dist/tui/components/StatusLine.js +0 -39
- package/dist/tui/components/Transcript.d.ts +0 -21
- package/dist/tui/components/Transcript.js +0 -150
- package/dist/tui/components/dashboard-constants.d.ts +0 -1
- package/dist/tui/components/dashboard-constants.js +0 -1
- package/dist/tui/hooks/useDashboardData.d.ts +0 -24
- package/dist/tui/hooks/useDashboardData.js +0 -75
- package/dist/tui/hooks/useKeybindings.d.ts +0 -19
- package/dist/tui/hooks/useKeybindings.js +0 -75
- package/dist/tui/hooks/useMouseHandler.d.ts +0 -15
- package/dist/tui/hooks/useMouseHandler.js +0 -90
- package/dist/tui/hooks/useMutate.d.ts +0 -22
- package/dist/tui/hooks/useMutate.js +0 -54
- package/dist/tui/hooks/useNotifications.d.ts +0 -26
- package/dist/tui/hooks/useNotifications.js +0 -60
- package/dist/tui/hooks/useTranscript.d.ts +0 -42
- package/dist/tui/hooks/useTranscript.js +0 -277
- package/dist/tui/index.d.ts +0 -2
- package/dist/tui/logic.d.ts +0 -144
- package/dist/tui/logic.js +0 -388
- package/dist/tui/raf-batch.d.ts +0 -31
- package/dist/tui/raf-batch.js +0 -89
- package/dist/tui/render/inline-markdown.d.ts +0 -22
- package/dist/tui/render/inline-markdown.js +0 -99
- package/dist/tui/render/markdown.d.ts +0 -10
- package/dist/tui/render/markdown.js +0 -35
- package/dist/tui/render-output.d.ts +0 -42
- package/dist/tui/render-output.js +0 -81
- package/dist/tui/slash-commands.d.ts +0 -21
- package/dist/tui/slash-commands.js +0 -71
- package/dist/tui/turn-status.d.ts +0 -10
- package/dist/tui/turn-status.js +0 -48
- package/dist/tui/ws-client.d.ts +0 -39
- package/dist/tui/ws-client.js +0 -139
- package/scripts/install-bundled-dependencies.mjs +0 -54
- package/web/dist/assets/board-math-css-spk7yR6n.js +0 -2
- package/web/dist/assets/index-BQ69u-92.css +0 -1
- package/web/dist/assets/index-CKNLatCd.js +0 -1
- package/web/dist/assets/index-CkzWfC98.js +0 -525
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import{parentPort as M,workerData as he}from"node:worker_threads";function $(i){return typeof i=="object"&&i!==null&&i.type==="result"}function J(i){return{clock_time_get(o,a,l){let u=i(),c=new DataView(u.buffer);if(o===0||o===1){let p=BigInt(Date.now())*1000000n;return c.setBigUint64(l,p,!0),0}return 52},fd_write(o,a,l,u){let c=i(),p=new DataView(c.buffer),h=new Uint8Array(c.buffer),g=0;if(o!==1&&o!==2)return 8;for(let d=0;d<l;d++){let w=p.getUint32(a+d*8,!0),P=p.getUint32(a+d*8+4,!0),S=h.slice(w,w+P),y=new TextDecoder().decode(S);o===1?typeof process<"u"&&process.stdout?process.stdout.write(y):console.log(y):typeof process<"u"&&process.stderr?process.stderr.write(y):console.error(y),g+=P}return p.setUint32(u,g,!0),0},fd_close(o){return 52},fd_fdstat_get(o,a){let l=i(),u=new DataView(l.buffer);return o===1||o===2?(u.setUint8(a,2),u.setUint16(a+2,0,!0),u.setBigUint64(a+8,0n,!0),u.setBigUint64(a+16,0n,!0),0):8},fd_seek(o,a,l,u){return 52},random_get(o,a){let l=i(),u=new Uint8Array(l.buffer,o,a);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(u);else for(let c=0;c<a;c++)u[c]=Math.floor(Math.random()*256);return 0}}}var ee=new TextDecoder;function te(i,e){let t=new Uint8Array(i.buffer),r=e;for(;t[r]!==0;)r++;if(r===e)return{};let s=ee.decode(t.slice(e,r)),n={};for(let o of s.split(`
|
|
2
|
+
`)){let a=o.indexOf("=");a>0&&(n[o.slice(0,a)]=o.slice(a+1))}return n}function re(i,e){let t=`qjs_ext_${i.name.replace(/-/g,"_")}_versions`,r=i.instance.exports[t];if(typeof r!="function")return;let s=r();if(s!==0)return te(e,s)}function O(i,e){let t=0,r=0;for(;e.value<i.length;){let s=i[e.value++];if(t|=(s&127)<<r,(s&128)===0)break;r+=7}return t}function se(i){let e=WebAssembly.Module.customSections(i,"dylink.0");if(e.length===0)return null;let t=new Uint8Array(e[0]),r={value:0},s={memorySize:0,memoryAlignment:0,tableSize:0,tableAlignment:0,needed:[]};for(;r.value<t.length;){let n=O(t,r),o=O(t,r),a=r.value+o;if(n===1)s.memorySize=O(t,r),s.memoryAlignment=O(t,r),s.tableSize=O(t,r),s.tableAlignment=O(t,r);else if(n===2){let l=O(t,r);for(let u=0;u<l;u++){let c=O(t,r),p=new TextDecoder().decode(t.slice(r.value,r.value+c));r.value+=c,s.needed.push(p)}}r.value=a}return s}async function I(i,e,t,r,s,n){let o;i.wasm instanceof WebAssembly.Module?o=i.wasm:o=await WebAssembly.compile(i.wasm);let a=se(o);if(!a)throw new Error(`Extension "${i.name}" is not a WASM shared library (missing dylink.0 section)`);let l=e.memory,u=e.__indirect_function_table,c=e.__stack_pointer,p=e.malloc;if(!l)throw new Error("Main module does not export memory");if(!u)throw new Error("Main module does not export __indirect_function_table");if(!p)throw new Error("Main module does not export malloc");let h,g;if(n)h=n.memoryBase,g=n.tableBase;else if(a.memorySize>0){if(h=p(a.memorySize),h===0)throw new Error(`Failed to allocate ${a.memorySize} bytes for extension "${i.name}"`);new Uint8Array(l.buffer,h,a.memorySize).fill(0)}else h=0;n?(g=n.tableBase,g+a.tableSize>u.length&&u.grow(g+a.tableSize-u.length)):(g=u.length,a.tableSize>0&&u.grow(a.tableSize));let d=WebAssembly.Module.imports(o),w={env:{},"GOT.mem":{},"GOT.func":{}};if(d.some(f=>f.module==="wasi_snapshot_preview1")){let f=i.wasi&&s?i.wasi(s):void 0;w.wasi_snapshot_preview1={...t,...f,...r}}let S=new Set(WebAssembly.Module.exports(o).filter(f=>f.kind==="function").map(f=>f.name)),y=new Set;for(let f of d)if(f.module==="env"){if(f.name==="memory"&&f.kind==="memory")w.env.memory=l;else if(f.name==="__indirect_function_table"&&f.kind==="table")w.env.__indirect_function_table=u;else if(f.name==="__memory_base"&&f.kind==="global")w.env.__memory_base=new WebAssembly.Global({value:"i32",mutable:!1},h);else if(f.name==="__table_base"&&f.kind==="global")w.env.__table_base=new WebAssembly.Global({value:"i32",mutable:!1},g);else if(f.name==="__stack_pointer"&&f.kind==="global")w.env.__stack_pointer=c;else if(f.kind==="function"){let E=e[f.name];E&&typeof E=="function"?w.env[f.name]=E:(y.add(f.name),w.env[f.name]=()=>{throw new Error(`Extension "${i.name}" called unresolved symbol: env.${f.name}`)})}else if(f.kind==="global"){let E=e[f.name];E instanceof WebAssembly.Global?w.env[f.name]=E:w.env[f.name]=new WebAssembly.Global({value:"i32",mutable:!0},0)}}else if(f.module==="GOT.mem"&&f.kind==="global")w["GOT.mem"][f.name]=new WebAssembly.Global({value:"i32",mutable:!0},0);else if(f.module==="GOT.func"&&f.kind==="global"){let E=e[f.name];if(E&&typeof E=="function"){let U=u.length;u.grow(1),u.set(U,E),w["GOT.func"][f.name]=new WebAssembly.Global({value:"i32",mutable:!0},U)}else w["GOT.func"][f.name]=new WebAssembly.Global({value:"i32",mutable:!0},0)}let _=[...y].filter(f=>S.has(f)),x={};for(let f of _){let E={target:null};x[f]=E,w.env[f]=(...U)=>{if(!E.target)throw new Error(`Extension "${i.name}" called unresolved symbol during init: env.${f}`);return E.target(...U)}}let j=await WebAssembly.instantiate(o,w),b=j.exports;for(let f of _){let E=b[f];typeof E=="function"&&(x[f].target=E)}typeof b.__wasm_apply_data_relocs=="function"&&b.__wasm_apply_data_relocs(),typeof b.__wasm_call_ctors=="function"&&b.__wasm_call_ctors();let k=i.initFn??`qjs_ext_${i.name.replace(/-/g,"_")}_init`,v={name:i.name,module:o,instance:j,dylink:a,memoryBase:h,tableBase:g,initFn:k};return v.versions=re(v,l),v}function W(i,e){let t=i.instance.exports[i.initFn];if(typeof t!="function")throw new Error(`Extension "${i.name}" does not export init function "${i.initFn}"`);let r=e.qjs_get_context_ptr(),s=e.qjs_get_runtime_ptr(),n=t(r,s);if(n!==0)throw new Error(`Extension "${i.name}" init function returned error code ${n}`)}async function V(i,e,t,r,s,n){let o=[];for(let a of e){let l=i.find(c=>c.name===a.name);if(!l)throw new Error(`Extension "${a.name}" required by snapshot but not provided`);let u=await I(l,t,r,s,n,{memoryBase:a.memoryBase,tableBase:a.tableBase});u.initFn=a.initFn,o.push(u)}return o}var G="3.6.2";var N=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},A=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r}),R=512*1024;var L={DATE:1,EVAL:2,REGEXP:4,JSON:8,PROXY:16,MAP_SET:32,TYPED_ARRAYS:64,PROMISE:128,BIG_INT:256,WEAK_REF:512,PERFORMANCE:1024,DOM_EXCEPTION:2048,ATOB_BTOA:4096,ALL:4294967295},z=1363825491,F=2,C=24,D=class i{exports;module;instance;encoder=new TextEncoder;decoder=new TextDecoder;disposed=!1;hostCallbacks=new Map;nextInternalId=1;interruptHandler=null;unhandledRejectionHandler=null;moduleNormalizeHandler=null;moduleLoadHandler=null;timezoneOffsetHandler=null;_global=null;_versions=null;_undefined=null;_null=null;_true=null;_false=null;_ownedHandles=new Set;_activeScope=null;loadedExtensions=[];constructor(e){this.module=e,this.instance=null,this.exports=null}setInstance(e){this.instance=e,this.exports=e.exports}get versions(){if(this.assertNotDisposed(),!this._versions){let e={"quickjs-wasi":G,quickjs:this.readCString(this.exports.qjs_get_quickjs_version())};for(let t of this.loadedExtensions)t.versions&&Object.assign(e,t.versions);this._versions=e}return this._versions}get global(){return this._global||(this._global=new m(this,this.exports.qjs_get_global(),!0)),this._global}get undefined(){return this._undefined||(this._undefined=new m(this,this.exports.qjs_get_undefined(),!0)),this._undefined}get null(){return this._null||(this._null=new m(this,this.exports.qjs_get_null(),!0)),this._null}get true(){return this._true||(this._true=new m(this,this.exports.qjs_get_true(),!0)),this._true}get false(){return this._false||(this._false=new m(this,this.exports.qjs_get_false(),!0)),this._false}static async create(e){let t=i.normalizeOptions(e),r=await i.resolveModule(t.wasm),s=new i(r),{instance:n,wasiBuiltins:o,wasiUserOverrides:a,memoryProxy:l}=await i.instantiate(r,s,t.wasi);if(s.setInstance(n),s.exports._initialize(),(t.intrinsics!==void 0?s.exports.qjs_init2(t.intrinsics):s.exports.qjs_init())!==0)throw new Error("Failed to initialize QuickJS runtime");if(t.extensions){let c=n.exports;for(let p of t.extensions){let h=await I(p,c,o,a,l);s.loadedExtensions.push(h),W(h,c)}}return i.applyLimits(s,t),s}static async restore(e,t){let r=i.normalizeOptions(t),s=await i.resolveModule(r.wasm),n=new i(s),{instance:o,wasiBuiltins:a,wasiUserOverrides:l,memoryProxy:u}=await i.instantiate(s,n,r.wasi);n.setInstance(o);let c=o.exports,p=n.exports.memory,h=p.buffer.byteLength/65536,g=Math.ceil(e.memory.byteLength/65536);if(g>h&&p.grow(g-h),e.extensions.length>0){let w=r.extensions??[];n.loadedExtensions=await V(w,e.extensions,c,a,l,u)}return new Uint8Array(p.buffer).set(e.memory),n.exports.qjs_set_runtime_and_context(e.runtimePtr,e.contextPtr),n.exports.__stack_pointer.value=e.stackPointer,i.applyLimits(n,r),n}static serializeSnapshot(e){let t=new TextEncoder,r=4,s=[],n=[];for(let p of e.extensions){let h=t.encode(p.name),g=t.encode(p.initFn);s.push(h),n.push(g),r+=4+h.length+4+4+4+g.length}let o=C+r+e.memory.byteLength,a=new ArrayBuffer(o),l=new DataView(a),u=new Uint8Array(a);l.setUint32(0,z,!1),l.setUint8(4,F),l.setUint32(8,e.memory.byteLength,!0),l.setUint32(12,e.stackPointer,!0),l.setUint32(16,e.runtimePtr,!0),l.setUint32(20,e.contextPtr,!0);let c=C;l.setUint32(c,e.extensions.length,!0),c+=4;for(let p=0;p<e.extensions.length;p++){let h=e.extensions[p],g=s[p],d=n[p];l.setUint32(c,g.length,!0),c+=4,u.set(g,c),c+=g.length,l.setUint32(c,h.memoryBase,!0),c+=4,l.setUint32(c,h.tableBase,!0),c+=4,l.setUint32(c,d.length,!0),c+=4,u.set(d,c),c+=d.length}return u.set(e.memory,c),u}static deserializeSnapshot(e){if(e.length<C)throw new Error("Invalid snapshot: too small");let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getUint32(0,!1);if(r!==z)throw new Error(`Invalid snapshot: bad magic (expected 0x${z.toString(16)}, got 0x${r.toString(16)})`);let s=t.getUint8(4);if(s!==F&&s!==1)throw new Error(`Unsupported snapshot version: ${s} (expected ${F})`);let n=t.getUint32(8,!0),o=t.getUint32(12,!0),a=t.getUint32(16,!0),l=t.getUint32(20,!0),u=[],c=C;if(s>=2){let g=t.getUint32(24,!0),d=28,w=new TextDecoder;for(let P=0;P<g;P++){let S=t.getUint32(d,!0);d+=4;let y=w.decode(e.slice(d,d+S));d+=S;let _=t.getUint32(d,!0);d+=4;let x=t.getUint32(d,!0);d+=4;let j=t.getUint32(d,!0);d+=4;let b=w.decode(e.slice(d,d+j));d+=j,u.push({name:y,memoryBase:_,tableBase:x,initFn:b})}c=d}let p=c+n;if(e.length<p)throw new Error(`Invalid snapshot: expected ${p} bytes, got ${e.length}`);return{memory:e.slice(c,c+n),stackPointer:o,runtimePtr:a,contextPtr:l,extensions:u}}static normalizeOptions(e){if(!e)return{wasm:void 0};if(e instanceof WebAssembly.Module)return{wasm:e};if(typeof e=="object"&&("wasm"in e||"wasi"in e||"memoryLimit"in e||"maxStackSize"in e||"interruptHandler"in e||"onUnhandledRejection"in e||"moduleLoader"in e||"intrinsics"in e||"extensions"in e||"timezoneOffset"in e)){let t=e;if(t.maxStackSize!==void 0&&(!Number.isInteger(t.maxStackSize)||t.maxStackSize<0||t.maxStackSize>R))throw new RangeError(`maxStackSize must be an integer between 0 and ${R}`);return t}return{wasm:e}}static applyLimits(e,t){t.memoryLimit!==void 0&&e.exports.qjs_set_memory_limit(t.memoryLimit),t.maxStackSize!==void 0&&e.exports.qjs_set_max_stack_size(t.maxStackSize),t.interruptHandler&&(e.interruptHandler=t.interruptHandler,e.exports.qjs_set_interrupt_handler(1)),t.onUnhandledRejection&&(e.unhandledRejectionHandler=t.onUnhandledRejection,e.exports.qjs_set_promise_rejection_handler(1)),t.moduleLoader&&(e.moduleLoadHandler=t.moduleLoader.load,e.moduleNormalizeHandler=t.moduleLoader.normalize??null,e.exports.qjs_set_module_loader(1));let r=t.timezoneOffset;if(typeof r=="function")e.timezoneOffsetHandler=s=>-r(s)*60;else if(typeof r=="number"){let s=-r*60;e.timezoneOffsetHandler=()=>s}else e.timezoneOffsetHandler=s=>-new Date(s*1e3).getTimezoneOffset()*60}static async resolveModule(e){if(e instanceof WebAssembly.Module)return e;if(e)return WebAssembly.compile(e);throw new TypeError("QuickJS: `wasm` option is required. Provide WASM bytes or a compiled `WebAssembly.Module`. The binary is shipped at `quickjs-wasi/quickjs.wasm` and can be loaded via your environment's preferred mechanism (e.g. `fetch()`, `node:fs/promises`, or a bundler import like Vite's `?url`).")}static async instantiate(e,t,r){let s=null,n=new Proxy({},{get(y,_){return s[_]}}),o=J(()=>s),a=r?r(n):void 0,l={...o,...a},u=(y,_,x,j,b)=>t.handleHostCall(y,_,x,j,b),c=()=>t.interruptHandler&&t.interruptHandler()?1:0,p=(y,_,x)=>{if(!t.unhandledRejectionHandler){t.exports.qjs_free_value(y),t.exports.qjs_free_value(_);return}let j=new m(t,y),b=new m(t,_);try{t.unhandledRejectionHandler(j,b,x!==0)}finally{j.dispose(),b.dispose()}},h=y=>{let _=t.newError(y instanceof Error?y:String(y));t.exports.qjs_throw(_.ptr),_.dispose()},g=(y,_)=>{if(typeof y=="string")return y;let x=y!==null&&typeof y=="object"&&typeof y.then=="function"?"a Promise":`type ${typeof y}`;throw new TypeError(`moduleLoader.${_} must synchronously return a string (got ${x}). Async module loading is not supported. Pre-fetch module sources instead (see the "ES Modules" section of the quickjs-wasi README).`)},d=(y,_)=>{if(!t.moduleNormalizeHandler){let b=t.readCString(_);return t.writeString(b).ptr}let x=t.readCString(y),j=t.readCString(_);try{let b=g(t.moduleNormalizeHandler(x,j),"normalize");return t.writeString(b).ptr}catch(b){return h(b),0}},w=(y,_)=>{if(!t.moduleLoadHandler)return 0;let x=t.readCString(y);try{let j=g(t.moduleLoadHandler(x),"load"),{ptr:b,len:k}=t.writeString(j);return new Uint32Array(t.exports.memory.buffer,_,1)[0]=k,b}catch(j){return h(j),0}},P=(y,_)=>{let x=Number(BigInt(y)<<32n|BigInt(_>>>0));return t.timezoneOffsetHandler?t.timezoneOffsetHandler(x):0},S=await WebAssembly.instantiate(e,{env:{host_call:u,host_interrupt:c,host_promise_rejection:p,host_module_normalize:d,host_module_load:w,host_get_timezone_offset:P},wasi_snapshot_preview1:l});return s=S.exports.memory,{instance:S,wasiBuiltins:o,wasiUserOverrides:a,memoryProxy:n}}handleHostCall(e,t,r,s,n){let o=this.decoder.decode(new Uint8Array(this.exports.memory.buffer,e,t)),a=this.hostCallbacks.get(o);if(!a){let c=this.newError(`Host callback "${o}" is not registered: it was unregistered, its ephemeral function handle was disposed, or it was never re-registered after a snapshot restore.`);return this.exports.qjs_throw(c.ptr),c.dispose(),0}let l=new m(this,r,!1,!0),u=[];if(s>0&&n!==0){let c=new DataView(this.exports.memory.buffer);for(let p=0;p<s;p++){let h=c.getUint32(n+p*4,!0);u.push(new m(this,h,!1,!0))}}try{let c=a.call(l,...u);return this.exports.qjs_dup_value(c.ptr)}catch(c){let p=this.newError(c instanceof Error?c:String(c));return this.exports.qjs_throw(p.ptr),p.dispose(),0}}writeString(e){let t=ie(e),r=this.exports.wasm_malloc(t.length+1);if(r===0)throw new Error("wasm_malloc failed");let s=new Uint8Array(this.exports.memory.buffer);return s.set(t,r),s[r+t.length]=0,{ptr:r,len:t.length}}readCString(e){let t=new Uint8Array(this.exports.memory.buffer),r=e;for(;t[r]!==0;)r++;return this.decoder.decode(t.slice(e,r))}throwIfException(e){if(this.exports.qjs_is_exception(e.ptr)!==0){let t=this.getException();throw e.dispose(),this._ownedHandles.add(t),new q(t)}return e}evalCode(e,t="<eval>",r=0){this.assertNotDisposed();let s=this.writeString(e),n=this.writeString(t),o=this.exports.qjs_eval(s.ptr,s.len,n.ptr,r);return this.exports.wasm_free(s.ptr),this.exports.wasm_free(n.ptr),this.throwIfException(new m(this,o))}compile(e,t="<compile>",r=0,s=0){this.assertNotDisposed();let n=this.writeString(e),o=this.writeString(t),a=this.exports.wasm_malloc(4),l=this.exports.qjs_compile(n.ptr,n.len,o.ptr,r,s,a);if(this.exports.wasm_free(n.ptr),this.exports.wasm_free(o.ptr),l===0){this.exports.wasm_free(a);let p=this.getException();throw new Error(`Compilation error: ${p.toString()}`)}let u=new Uint32Array(this.exports.memory.buffer,a,1)[0];this.exports.wasm_free(a);let c=new Uint8Array(this.exports.memory.buffer,l,u).slice();return this.exports.wasm_free(l),c}evalBytecode(e){this.assertNotDisposed();let t=this.exports.wasm_malloc(e.byteLength);new Uint8Array(this.exports.memory.buffer,t,e.byteLength).set(e);let r=this.exports.qjs_eval_bytecode(t,e.byteLength);return this.exports.wasm_free(t),this.throwIfException(new m(this,r))}executePendingJobs(){this.assertNotDisposed();let e=0;for(;this.exports.qjs_is_job_pending();){if(this.exports.qjs_execute_pending_job()<0){let r=this.getException();throw new Error(`Job execution error: ${r.toString()}`)}e++}return e}runGC(){this.assertNotDisposed(),this.exports.qjs_run_gc()}get gcThreshold(){return this.assertNotDisposed(),this.exports.qjs_get_gc_threshold()}set gcThreshold(e){this.assertNotDisposed(),this.exports.qjs_set_gc_threshold(e)}getMemoryUsage(){this.assertNotDisposed();let e=this.exports.wasm_malloc(208);this.exports.qjs_compute_memory_usage(e);let t=new BigInt64Array(this.exports.memory.buffer,e,26),r={mallocSize:Number(t[0]),mallocLimit:Number(t[1]),memoryUsedSize:Number(t[2]),mallocCount:Number(t[3]),memoryUsedCount:Number(t[4]),atomCount:Number(t[5]),atomSize:Number(t[6]),strCount:Number(t[7]),strSize:Number(t[8]),objCount:Number(t[9]),objSize:Number(t[10]),propCount:Number(t[11]),propSize:Number(t[12]),shapeCount:Number(t[13]),shapeSize:Number(t[14]),jsFuncCount:Number(t[15]),jsFuncSize:Number(t[16]),jsFuncCodeSize:Number(t[17]),jsFuncPc2lineCount:Number(t[18]),jsFuncPc2lineSize:Number(t[19]),cFuncCount:Number(t[20]),arrayCount:Number(t[21]),fastArrayCount:Number(t[22]),fastArrayElements:Number(t[23]),binaryObjectCount:Number(t[24]),binaryObjectSize:Number(t[25])};return this.exports.wasm_free(e),r}getGlobal(){return this.assertNotDisposed(),new m(this,this.exports.qjs_get_global())}newString(e){this.assertNotDisposed();let{ptr:t,len:r}=this.writeString(e),s=this.exports.qjs_new_string(t,r);return this.exports.wasm_free(t),new m(this,s)}newNumber(e){return this.assertNotDisposed(),new m(this,this.exports.qjs_new_number(e))}newBigInt(e){this.assertNotDisposed();let t=Number(e&0xffffffffn),r=Number(e>>32n&0xffffffffn);return new m(this,this.exports.qjs_new_big_int64(t,r))}newObject(){return this.assertNotDisposed(),new m(this,this.exports.qjs_new_object())}newArray(){return this.assertNotDisposed(),new m(this,this.exports.qjs_new_array())}newSymbolFor(e){this.assertNotDisposed();let{ptr:t,len:r}=this.writeString(e),s=new m(this,this.exports.qjs_new_symbol(t,r,1));return this.exports.wasm_free(t),s}newArrayBuffer(e){this.assertNotDisposed();let t=e instanceof ArrayBuffer?new Uint8Array(e):e,r=this.exports.wasm_malloc(t.length);if(r===0)throw new Error("wasm_malloc failed");new Uint8Array(this.exports.memory.buffer).set(t,r);let s=new m(this,this.exports.qjs_new_array_buffer(r,t.length));return this.exports.wasm_free(r),s}newUint8Array(e){this.assertNotDisposed();let t=this.exports.wasm_malloc(e.length);if(t===0)throw new Error("wasm_malloc failed");new Uint8Array(this.exports.memory.buffer).set(e,t);let r=new m(this,this.exports.qjs_new_uint8_array(t,e.length));return this.exports.wasm_free(t),r}getUndefined(){return this.assertNotDisposed(),new m(this,this.exports.qjs_get_undefined())}getNull(){return this.assertNotDisposed(),new m(this,this.exports.qjs_get_null())}getTrue(){return this.assertNotDisposed(),new m(this,this.exports.qjs_get_true())}getFalse(){return this.assertNotDisposed(),new m(this,this.exports.qjs_get_false())}newFunction(e,t){if(this.assertNotDisposed(),this.hostCallbacks.has(e))throw new Error(`Host callback with name "${e}" is already registered`);this.hostCallbacks.set(e,t);let{ptr:r,len:s}=this.writeString(e),n=this.exports.qjs_new_host_function(r,s,0);return this.exports.wasm_free(r),new m(this,n)}withScope(e){this.assertNotDisposed();let t=this._activeScope,r=new Set;this._activeScope=r;let s={escape:n=>(r.delete(n),t?.add(n),n)};try{return e(s)}finally{this._activeScope=t;for(let n of r)n.dispose()}}exportHandle(e){if(this.assertNotDisposed(),e.vm!==this)throw new Error("exportHandle: handle belongs to a different VM");if(e.disposed)throw new Error("exportHandle: handle is disposed");if(e._isBorrowed)throw new Error("exportHandle: cannot export a borrowed handle (host-callback this/argument); its box is freed when the callback returns. dup() it and export the duplicate.");return e.ptr}importHandle(e){if(this.assertNotDisposed(),!Number.isInteger(e)||e<=0||e>=this.exports.memory.buffer.byteLength)throw new Error(`importHandle: invalid token ${e}`);return new m(this,this.exports.qjs_dup_value(e))}newEphemeralFunction(e){this.assertNotDisposed();let t=`__ephemeral:${this.nextInternalId++}`;this.hostCallbacks.set(t,e);let{ptr:r,len:s}=this.writeString(t),n=this.exports.qjs_new_host_function(r,s,0);this.exports.wasm_free(r);let o=new m(this,n);return o._onDispose=()=>{this.hostCallbacks.delete(t)},o}unregisterHostCallback(e){return this.hostCallbacks.delete(e)}newInternalFunction(e,t){this.hostCallbacks.set(e,t);let{ptr:r,len:s}=this.writeString(e),n=this.exports.qjs_new_host_function(r,s,0);return this.exports.wasm_free(r),new m(this,n)}newPromise(){this.assertNotDisposed();let e=this.exports.wasm_malloc(4),t=this.exports.wasm_malloc(4),r=this.exports.qjs_new_promise(e,t),s=new DataView(this.exports.memory.buffer),n=s.getUint32(e,!0),o=s.getUint32(t,!0);this.exports.wasm_free(e),this.exports.wasm_free(t);let a=new m(this,r),l=new m(this,n),u=new m(this,o),c=this;c._ownedHandles.add(l),c._ownedHandles.add(u);let p=null;return{handle:a,get settled(){if(!p){let h;p=new Promise(w=>{h=w});let g=`__settle:${c.nextInternalId++}`,d=c.newInternalFunction(g,()=>(h(),c.hostCallbacks.delete(g),c.undefined));c.promiseThenRaw(a,d,d).dispose(),d.dispose()}return p},resolve(h){c.callFunctionRaw(l,c.undefined,h).dispose(),c._ownedHandles.delete(l),l.dispose()},reject(h){c.callFunctionRaw(u,c.undefined,h).dispose(),c._ownedHandles.delete(u),u.dispose()}}}resolvePromise(e){if(this.assertNotDisposed(),!this.exports.qjs_is_promise(e.ptr))return Promise.resolve({value:e.dup()});let t=this.exports.qjs_promise_state(e.ptr);return t===1?Promise.resolve({value:new m(this,this.exports.qjs_promise_result(e.ptr))}):t===2?Promise.resolve({error:new m(this,this.exports.qjs_promise_result(e.ptr))}):new Promise(r=>{let s=this.nextInternalId++,n=`__onFulfilled:${s}`,o=`__onRejected:${s}`,a=this.newInternalFunction(n,(...u)=>{let c=u[0]?.dup()??this.undefined;return this.hostCallbacks.delete(n),this.hostCallbacks.delete(o),r({value:c}),this.undefined}),l=this.newInternalFunction(o,(...u)=>{let c=u[0]?.dup()??this.undefined;return this.hostCallbacks.delete(n),this.hostCallbacks.delete(o),r({error:c}),this.undefined});this.promiseThenRaw(e,a,l).dispose(),a.dispose(),l.dispose()})}promiseThenRaw(e,t,r){return new m(this,this.exports.qjs_promise_then(e.ptr,t.ptr,r.ptr))}markPromiseHandled(e){this.assertNotDisposed(),this.exports.qjs_promise_mark_as_handled(e.ptr)}callFunction(e,t,...r){return this.throwIfException(this.callFunctionRaw(e,t,...r))}construct(e,...t){this.assertNotDisposed();let r=t.length,s=0;if(r>0){s=this.exports.wasm_malloc(r*4);let o=new DataView(this.exports.memory.buffer);for(let a=0;a<r;a++)o.setUint32(s+a*4,t[a].ptr,!0)}let n=this.exports.qjs_call_constructor(e.ptr,r,s);return s&&this.exports.wasm_free(s),this.throwIfException(new m(this,n))}callFunctionRaw(e,t,...r){this.assertNotDisposed();let s=r.length,n=0;if(s>0){n=this.exports.wasm_malloc(s*4);let a=new DataView(this.exports.memory.buffer);for(let l=0;l<s;l++)a.setUint32(n+l*4,r[l].ptr,!0)}let o=this.exports.qjs_call(e.ptr,t.ptr,s,n);return n&&this.exports.wasm_free(n),new m(this,o)}setProp(e,t,r){if(this.assertNotDisposed(),typeof t=="string"){let{ptr:s}=this.writeString(t);this.exports.qjs_set_prop_string(e.ptr,s,r.ptr),this.exports.wasm_free(s)}else this.exports.qjs_set_prop_value(e.ptr,t.ptr,r.ptr)}defineProp(e,t,r,s){this.assertNotDisposed();let n=0;if(s?.configurable&&(n|=1),s?.writable&&(n|=2),s?.enumerable&&(n|=4),typeof t=="string"){let{ptr:o}=this.writeString(t);this.exports.qjs_define_prop_string(e.ptr,o,r.ptr,n),this.exports.wasm_free(o)}else this.exports.qjs_define_prop_value(e.ptr,t.ptr,r.ptr,n)}getProp(e,t){return this.assertNotDisposed(),new m(this,this.exports.qjs_get_prop_value(e.ptr,t.ptr))}getException(){return this.assertNotDisposed(),new m(this,this.exports.qjs_get_exception())}newError(e){this.assertNotDisposed();let t=this.exports.qjs_new_error(),r=new m(this,t);if(typeof e=="string"){let s=this.newString(e);r.setProp("message",s),s.dispose()}else{let s=this.newString(e.message);if(r.setProp("message",s),s.dispose(),e.name){let n=this.newString(e.name);r.setProp("name",n),n.dispose()}if(e.stack){let n=this.newString(e.stack);r.setProp("stack",n),n.dispose()}}return r}typeof(e){this.assertNotDisposed();let t=this.exports;return t.qjs_is_undefined(e.ptr)?"undefined":t.qjs_is_null(e.ptr)?"object":t.qjs_is_bool(e.ptr)?"boolean":t.qjs_is_number(e.ptr)?"number":t.qjs_is_big_int(e.ptr)?"bigint":t.qjs_is_string(e.ptr)?"string":t.qjs_is_symbol(e.ptr)?"symbol":t.qjs_is_function(e.ptr)?"function":t.qjs_is_object(e.ptr)?"object":"unknown"}dump(e){return this.assertNotDisposed(),this._dump(e,new Map)}_dump(e,t){let r=this.exports;if(!r.qjs_is_undefined(e.ptr)){if(r.qjs_is_null(e.ptr))return null;if(r.qjs_is_bool(e.ptr))return r.qjs_get_bool(e.ptr)!==0;if(r.qjs_is_number(e.ptr))return r.qjs_get_float64(e.ptr);if(r.qjs_is_string(e.ptr))return e.toString();if(r.qjs_is_big_int(e.ptr))return e.toBigInt();if(r.qjs_is_symbol(e.ptr)){let s=r.wasm_malloc(4),n=r.qjs_get_symbol_description(e.ptr,s),a=new DataView(r.memory.buffer).getUint32(s,!0);if(r.wasm_free(s),n===1){let l=new m(this,a),u=l.toString();return l.dispose(),Symbol.for(u)}else if(n===2){new m(this,a).dispose();return}return}if(r.qjs_is_array_buffer(e.ptr))return e.toArrayBuffer();if(r.qjs_is_exception(e.ptr)){let s=this.getException(),n=s.toString();return s.dispose(),new Error(n)}if(!r.qjs_is_function(e.ptr)){if(r.qjs_is_object(e.ptr)){let s=r.qjs_get_value_ptr(e.ptr);if(s){let n=t.get(s);if(n!==void 0)return n}}if(r.qjs_is_object(e.ptr)){let s=r.wasm_malloc(4),n=r.wasm_malloc(4),o=r.wasm_malloc(4),a=r.qjs_get_typed_array_buffer(e.ptr,s,n,o),l=new m(this,a);if(r.qjs_is_exception(l.ptr)===0){let u=new DataView(r.memory.buffer),c=u.getUint32(s,!0),p=u.getUint32(n,!0),h=u.getUint32(o,!0);r.wasm_free(s),r.wasm_free(n),r.wasm_free(o);let g=r.wasm_malloc(4),d=r.qjs_get_array_buffer(l.ptr,g);if(r.wasm_free(g),l.dispose(),d!==0){let w=new Uint8Array(r.memory.buffer,d+c,p).slice();switch(h){case 1:return w;case 2:return new Uint16Array(w.buffer);case 4:return new Uint32Array(w.buffer);case 8:return new Float64Array(w.buffer);default:return w}}}else l.dispose(),r.wasm_free(s),r.wasm_free(n),r.wasm_free(o)}if(r.qjs_is_array(e.ptr)){let s=e.getProp("length"),n=r.qjs_get_float64(s.ptr);s.dispose();let o=[],a=r.qjs_get_value_ptr(e.ptr);a&&t.set(a,o);for(let l=0;l<n;l++){let u=r.qjs_get_prop_uint32(e.ptr,l),c=new m(this,u);o.push(this._dump(c,t)),c.dispose()}return o}if(r.qjs_is_error(e.ptr)){let s=e.getProp("name"),n=e.getProp("message"),o=e.getProp("stack"),a=s.isUndefined?"Error":s.toString(),l=n.isUndefined?"":n.toString(),u=o.isUndefined?void 0:o.toString();s.dispose(),n.dispose(),o.dispose();let c=new Error(l);return c.name=a,u!==void 0&&(c.stack=u),c}if(r.qjs_is_object(e.ptr)){let s=r.qjs_get_own_property_names(e.ptr),n=new m(this,s);if(r.qjs_is_exception(n.ptr)!==0)return n.dispose(),{};let o=n.getProp("length"),a=r.qjs_get_float64(o.ptr);o.dispose();let l={},u=r.qjs_get_value_ptr(e.ptr);u&&t.set(u,l);for(let c=0;c<a;c++){let p=r.qjs_get_prop_uint32(n.ptr,c),h=new m(this,p),g=h.toString();h.dispose();let d=e.getProp(g);l[g]=this._dump(d,t),d.dispose()}return n.dispose(),l}}}}hostToHandle(e){if(this.assertNotDisposed(),e===void 0)return this.undefined;if(e===null)return this.null;if(e===!0)return this.true;if(e===!1)return this.false;if(typeof e=="number")return this.newNumber(e);if(typeof e=="string")return this.newString(e);if(typeof e=="bigint")return this.newBigInt(e);if(typeof e=="symbol"){let t=Symbol.keyFor(e);if(t!==void 0)return this.newSymbolFor(t);throw new Error("Cannot convert local symbol to QuickJS handle. Use Symbol.for() for cross-boundary symbols.")}if(e instanceof Promise){let t=this.newPromise();return e.then(r=>{t.resolve(this.hostToHandle(r)),this.executePendingJobs()},r=>{t.reject(this.hostToHandle(r)),this.executePendingJobs()}),t.handle}if(e instanceof Error)return this.newError(e);if(e instanceof ArrayBuffer)return this.newArrayBuffer(e);if(e instanceof Uint8Array)return this.newUint8Array(e);if(ArrayBuffer.isView(e))return this.newArrayBuffer(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));if(Array.isArray(e)){let t=this.newArray();for(let r=0;r<e.length;r++){let s=this.hostToHandle(e[r]);this.exports.qjs_set_prop_uint32(t.ptr,r,s.ptr),s.dispose()}return t}if(typeof e=="object"&&e!==null){let t=this.newObject();for(let[r,s]of Object.entries(e)){let n=this.hostToHandle(s);t.setProp(r,n),n.dispose()}return t}return this.undefined}snapshot(){return this.assertNotDisposed(),{memory:new Uint8Array(this.exports.memory.buffer).slice(),stackPointer:this.exports.__stack_pointer.value,runtimePtr:this.exports.qjs_get_runtime_ptr(),contextPtr:this.exports.qjs_get_context_ptr(),extensions:this.loadedExtensions.map(e=>({name:e.name,memoryBase:e.memoryBase,tableBase:e.tableBase,initFn:e.initFn}))}}registerHostCallback(e,t){this.hostCallbacks.set(e,t)}dispose(){this.disposed||(this.disposed=!0,this._global=null,this._undefined=null,this._null=null,this._true=null,this._false=null,this._ownedHandles.clear(),this.hostCallbacks.clear(),this._activeScope=null,this.exports=null,this.instance=null,this.module=null)}[Symbol.dispose](){this.dispose()}assertNotDisposed(){if(this.disposed)throw new Error("QuickJS instance has been disposed")}_getExports(){return this.exports}_getMemory(){return this.exports.memory}_writeString(e){return this.writeString(e)}_readCString(e){return this.readCString(e)}};function T(i){return i.includes("\0")||X.test(i)}var ne=new TextDecoder,oe=new TextEncoder,X=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF]))|(?:(?<![\uD800-\uDBFF])[\uDC00-\uDFFF])/;function ie(i){if(!X.test(i))return oe.encode(i);let e=[];for(let t=0;t<i.length;t++){let r=i.charCodeAt(t);if(r<128)e.push(r);else if(r<2048)e.push(192|r>>6,128|r&63);else if(r>=55296&&r<=56319&&t+1<i.length){let s=i.charCodeAt(t+1);if(s>=56320&&s<=57343){let n=65536+(r-55296<<10)+(s-56320);e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|n&63),t++;continue}e.push(224|r>>12,128|r>>6&63,128|r&63)}else e.push(224|r>>12,128|r>>6&63,128|r&63)}return new Uint8Array(e)}function ae(i){let e=!1;for(let s=0;s<i.length-1;s++)if(i[s]===237&&i[s+1]>=160&&i[s+1]<=191){e=!0;break}if(!e)return ne.decode(i);let t="",r=0;for(;r<i.length;){let s=i[r];if(s<128)t+=String.fromCharCode(s),r+=1;else if(s<224)t+=String.fromCharCode((s&31)<<6|i[r+1]&63),r+=2;else if(s<240)t+=String.fromCharCode((s&15)<<12|(i[r+1]&63)<<6|i[r+2]&63),r+=3;else{let n=(s&7)<<18|(i[r+1]&63)<<12|(i[r+2]&63)<<6|i[r+3]&63;t+=String.fromCodePoint(n),r+=4}}return t}var q=class extends Error{handle;#e;#t;#r;constructor(e){let t={stack:[],error:void 0,hasError:!1};try{super(),this.handle=e,delete this.stack;let r=N(t,e.getProp("message"),!1);this.#e=e.getProp("name").consume(s=>s.isUndefined?"Error":s.toString()),this.#t=r.isUndefined?e.toString():r.toString(),this.#r=e.getProp("stack").consume(s=>s.isUndefined?void 0:s.toString())}catch(r){t.error=r,t.hasError=!0}finally{A(t)}}get name(){return this.#e}set name(e){this.#e=e}get message(){return this.#t}set message(e){this.#t=e}get stack(){return this.#r}set stack(e){this.#r=e}dispose(){this.handle.dispose()}[Symbol.dispose](){this.handle.dispose()}},m=class i{vm;ptr;disposed_=!1;singleton;borrowed;_onDispose;constructor(e,t,r=!1,s=!1){this.vm=e,this.ptr=t,this.singleton=r,this.borrowed=s,!r&&!s&&e._activeScope?.add(this)}get _isBorrowed(){return this.borrowed}get disposed(){return this.disposed_}get isUndefined(){return this.vm._getExports().qjs_is_undefined(this.ptr)!==0}get isNull(){return this.vm._getExports().qjs_is_null(this.ptr)!==0}get isBool(){return this.vm._getExports().qjs_is_bool(this.ptr)!==0}get isNumber(){return this.vm._getExports().qjs_is_number(this.ptr)!==0}get isString(){return this.vm._getExports().qjs_is_string(this.ptr)!==0}get isSymbol(){return this.vm._getExports().qjs_is_symbol(this.ptr)!==0}get isBigInt(){return this.vm._getExports().qjs_is_big_int(this.ptr)!==0}get isObject(){return this.vm._getExports().qjs_is_object(this.ptr)!==0}get isArray(){return this.vm._getExports().qjs_is_array(this.ptr)!==0}get isFunction(){return this.vm._getExports().qjs_is_function(this.ptr)!==0}get isError(){return this.vm._getExports().qjs_is_error(this.ptr)!==0}get isPromise(){return this.vm._getExports().qjs_is_promise(this.ptr)!==0}get isArrayBuffer(){return this.vm._getExports().qjs_is_array_buffer(this.ptr)!==0}get isProxy(){return this.vm._getExports().qjs_is_proxy(this.ptr)!==0}get isMap(){return this.vm._getExports().qjs_is_map(this.ptr)!==0}get isSet(){return this.vm._getExports().qjs_is_set(this.ptr)!==0}get isDate(){return this.vm._getExports().qjs_is_date(this.ptr)!==0}get isRegExp(){return this.vm._getExports().qjs_is_regexp(this.ptr)!==0}get isWeakRef(){return this.vm._getExports().qjs_is_weak_ref(this.ptr)!==0}get isWeakMap(){return this.vm._getExports().qjs_is_weak_map(this.ptr)!==0}get isWeakSet(){return this.vm._getExports().qjs_is_weak_set(this.ptr)!==0}get isDataView(){return this.vm._getExports().qjs_is_data_view(this.ptr)!==0}get identity(){return this.vm._getExports().qjs_get_value_ptr(this.ptr)}toBoolean(){return this.vm._getExports().qjs_get_bool(this.ptr)!==0}get classId(){return this.vm._getExports().qjs_get_class_id(this.ptr)}get className(){let e=new i(this.vm,this.vm._getExports().qjs_get_class_name(this.ptr));if(this.vm._getExports().qjs_is_exception(e.ptr)!==0)throw e.dispose(),new q(this.vm.getException());try{return e.isUndefined?void 0:e.toString()}finally{e.dispose()}}get promiseState(){return this.vm._getExports().qjs_promise_state(this.ptr)}get typeof(){return this.vm.typeof(this)}get length(){let e=this.getProp("length"),t=e.toNumber();return e.dispose(),t}get constructorName(){let e=this.getProp("constructor");if(e.isUndefined||e.isNull){e.dispose();return}let t=e.getProp("name");if(e.dispose(),t.isUndefined||t.isNull){t.dispose();return}let r=t.toString();return t.dispose(),r}keys(){let e=this.vm._getExports(),t=e.qjs_get_own_property_names(this.ptr),r=new i(this.vm,t);if(e.qjs_is_exception(r.ptr)!==0)return r.dispose(),[];let s=r.getProp("length"),n=e.qjs_get_float64(s.ptr);s.dispose();let o=[];for(let a=0;a<n;a++){let l=e.qjs_get_prop_uint32(r.ptr,a),u=new i(this.vm,l);o.push(u.toString()),u.dispose()}return r.dispose(),o}getOwnPropertyNames(){let e=this.vm._getExports(),t=e.qjs_get_own_property_names_all(this.ptr),r=new i(this.vm,t);if(e.qjs_is_exception(r.ptr)!==0)return r.dispose(),[];let s=r.getProp("length"),n=e.qjs_get_float64(s.ptr);s.dispose();let o=[];for(let a=0;a<n;a++){let l=e.qjs_get_prop_uint32(r.ptr,a),u=new i(this.vm,l);o.push(u.toString()),u.dispose()}return r.dispose(),o}getOwnPropertyKeys(){let e=this.vm._getExports(),t=e.qjs_get_own_property_keys(this.ptr),r=new i(this.vm,t);if(e.qjs_is_exception(r.ptr)!==0)return r.dispose(),[];let s=r.getProp("length"),n=e.qjs_get_float64(s.ptr);s.dispose();let o=[];for(let a=0;a<n;a++){let l=e.qjs_get_prop_uint32(r.ptr,a),u=new i(this.vm,l);u.isSymbol?o.push(u):(o.push(u.toString()),u.dispose())}return r.dispose(),o}getOwnPropertyDescriptor(e){let t={stack:[],error:void 0,hasError:!1};try{let r=this.vm._getExports(),s,n;typeof e=="string"?(s=this.vm.newString(e),n=s.ptr):n=e.ptr;let o=r.qjs_get_own_property_descriptor(this.ptr,n);if(s?.dispose(),o===0)return;let a=N(t,new i(this.vm,o),!1);if(r.qjs_is_exception(a.ptr)!==0)throw new q(this.vm.getException());let l=a.getProp("enumerable").consume(c=>r.qjs_get_bool(c.ptr)!==0),u=a.getProp("configurable").consume(c=>r.qjs_get_bool(c.ptr)!==0);return a.hasOwnProperty("value")?{value:a.getProp("value"),writable:a.getProp("writable").consume(c=>r.qjs_get_bool(c.ptr)!==0),enumerable:l,configurable:u}:{get:a.getProp("get"),set:a.getProp("set"),enumerable:l,configurable:u}}catch(r){t.error=r,t.hasError=!0}finally{A(t)}}hasOwnProperty(e){if(T(e)){let s={stack:[],error:void 0,hasError:!1};try{let n=N(s,this.vm.newString(e),!1);return this.vm._getExports().qjs_has_own_property_value(this.ptr,n.ptr)===1}catch(n){s.error=n,s.hasError=!0}finally{A(s)}}let{ptr:t}=this.vm._writeString(e),r=this.vm._getExports().qjs_has_own_property(this.ptr,t);return this.vm._getExports().wasm_free(t),r===1}propertyIsEnumerable(e){if(T(e)){let s={stack:[],error:void 0,hasError:!1};try{let n=N(s,this.vm.newString(e),!1);return this.vm._getExports().qjs_property_is_enumerable_value(this.ptr,n.ptr)===1}catch(n){s.error=n,s.hasError=!0}finally{A(s)}}let{ptr:t}=this.vm._writeString(e),r=this.vm._getExports().qjs_property_is_enumerable(this.ptr,t);return this.vm._getExports().wasm_free(t),r===1}getPrototypeOf(){let e=this.vm._getExports().qjs_get_prototype_of(this.ptr);return new i(this.vm,e)}getProxyTarget(){let e=this.vm._getExports().qjs_get_proxy_target(this.ptr),t=new i(this.vm,e);if(this.vm._getExports().qjs_is_exception(t.ptr)!==0)throw t.dispose(),new q(this.vm.getException());return t}getProxyHandler(){let e=this.vm._getExports().qjs_get_proxy_handler(this.ptr),t=new i(this.vm,e);if(this.vm._getExports().qjs_is_exception(t.ptr)!==0)throw t.dispose(),new q(this.vm.getException());return t}getProp(e){if(T(e)){let s={stack:[],error:void 0,hasError:!1};try{let n=N(s,this.vm.newString(e),!1);return this.vm.getProp(this,n)}catch(n){s.error=n,s.hasError=!0}finally{A(s)}}let{ptr:t}=this.vm._writeString(e),r=this.vm._getExports().qjs_get_prop_string(this.ptr,t);return this.vm._getExports().wasm_free(t),new i(this.vm,r)}setProp(e,t){if(T(e)){let s={stack:[],error:void 0,hasError:!1};try{let n=N(s,this.vm.newString(e),!1);this.vm.setProp(this,n,t);return}catch(n){s.error=n,s.hasError=!0}finally{A(s)}}let{ptr:r}=this.vm._writeString(e);this.vm._getExports().qjs_set_prop_string(this.ptr,r,t.ptr),this.vm._getExports().wasm_free(r)}defineProp(e,t,r){let s=0;if(r?.configurable&&(s|=1),r?.writable&&(s|=2),r?.enumerable&&(s|=4),typeof e=="string"){if(T(e)){let o={stack:[],error:void 0,hasError:!1};try{let a=N(o,this.vm.newString(e),!1);this.vm._getExports().qjs_define_prop_value(this.ptr,a.ptr,t.ptr,s);return}catch(a){o.error=a,o.hasError=!0}finally{A(o)}}let{ptr:n}=this.vm._writeString(e);this.vm._getExports().qjs_define_prop_string(this.ptr,n,t.ptr,s),this.vm._getExports().wasm_free(n)}else this.vm._getExports().qjs_define_prop_value(this.ptr,e.ptr,t.ptr,s)}toNumber(){return this.vm._getExports().qjs_get_float64(this.ptr)}toBigInt(){let e=this.vm._getExports(),t=e.wasm_malloc(4),r=e.wasm_malloc(4);if(e.qjs_get_big_int64(this.ptr,t,r)!==0)throw e.wasm_free(t),e.wasm_free(r),new Error("Failed to convert value to BigInt");let n=new DataView(e.memory.buffer),o=n.getUint32(t,!0),a=n.getInt32(r,!0);return e.wasm_free(t),e.wasm_free(r),BigInt(a)<<32n|BigInt(o)}toArrayBuffer(){let e=this.vm._getExports(),t=e.wasm_malloc(4);if(e.qjs_is_array_buffer(this.ptr)){let g=e.qjs_get_array_buffer(this.ptr,t);if(g===0)throw e.wasm_free(t),new Error("Failed to get ArrayBuffer data");let w=new DataView(e.memory.buffer).getUint32(t,!0);return e.wasm_free(t),new Uint8Array(e.memory.buffer,g,w).slice().buffer}e.wasm_free(t);let r=e.wasm_malloc(4),s=e.wasm_malloc(4),n=e.wasm_malloc(4),o=e.qjs_get_typed_array_buffer(this.ptr,r,s,n),a=new i(this.vm,o);if(this.vm._getExports().qjs_is_exception(a.ptr)!==0)throw a.dispose(),e.wasm_free(r),e.wasm_free(s),e.wasm_free(n),new Error("Value is not an ArrayBuffer or typed array");let l=new DataView(e.memory.buffer),u=l.getUint32(r,!0),c=l.getUint32(s,!0);e.wasm_free(r),e.wasm_free(s),e.wasm_free(n);let p=e.wasm_malloc(4),h=e.qjs_get_array_buffer(a.ptr,p);if(e.wasm_free(p),a.dispose(),h===0)throw new Error("Failed to get ArrayBuffer data from typed array");return new Uint8Array(e.memory.buffer,h+u,c).slice().buffer}toUint8Array(){return new Uint8Array(this.toArrayBuffer())}toString(){let e=this.vm._getExports(),t=e.wasm_malloc(4);if(t===0)throw new Error("wasm_malloc failed");try{let r=e.qjs_get_string_len(this.ptr,t);if(r===0)return"<null>";let s=new DataView(e.memory.buffer).getUint32(t,!0),n=new Uint8Array(e.memory.buffer,r,s),o=ae(n);return e.qjs_free_cstring(r),o}finally{e.wasm_free(t)}}consume(e){try{return e(this)}finally{this.dispose()}}dup(){return new i(this.vm,this.vm._getExports().qjs_dup_value(this.ptr))}dispose(){if(!(this.singleton||this.borrowed)&&!this.disposed_){this.disposed_=!0,this._onDispose?.(),this._onDispose=void 0;let e=this.vm._getExports();e&&e.qjs_free_value(this.ptr)}}[Symbol.dispose](){this.dispose()}};var H='image expects a non-empty image URL string, an object with image_url, or an image block { type: "image", data, mimeType }',B=`(function (bridge, toolsJson, globalsJson, storeJson) {
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
// Freeze every object reachable from the built-in globals, plus the intrinsics that are only
|
|
6
|
+
// reachable from instances (iterator and generator prototypes, %TypedArray%).
|
|
7
|
+
//
|
|
8
|
+
// Freezing alone breaks ordinary code through the "override mistake": a data property that is
|
|
9
|
+
// read-only on a prototype cannot be assigned on an instance either, so
|
|
10
|
+
// this.name = "MyError" in an Error subclass would throw. Commonly overridden properties
|
|
11
|
+
// become accessors whose setter defines an own property on the instance instead.
|
|
12
|
+
(function lockdown() {
|
|
13
|
+
const OVERRIDABLE = new Set(["constructor", "name", "message", "toString", "toLocaleString", "valueOf", "toJSON"]);
|
|
14
|
+
const seen = new Set([globalThis]);
|
|
15
|
+
const queue = [];
|
|
16
|
+
const add = (value) => {
|
|
17
|
+
if ((typeof value === "object" && value !== null) || typeof value === "function") {
|
|
18
|
+
if (!seen.has(value)) {
|
|
19
|
+
seen.add(value);
|
|
20
|
+
queue.push(value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Accessors from an object literal have no own prototype object, unlike function expressions,
|
|
26
|
+
// whose prototype.constructor would be converted again without end.
|
|
27
|
+
function allowOverride(object, key, value, enumerable) {
|
|
28
|
+
const { get, set } = Object.getOwnPropertyDescriptor(
|
|
29
|
+
{
|
|
30
|
+
get accessor() {
|
|
31
|
+
return value;
|
|
32
|
+
},
|
|
33
|
+
set accessor(next) {
|
|
34
|
+
if (this === object) {
|
|
35
|
+
throw new TypeError("Cannot assign to read only property '" + String(key) + "' of a built-in");
|
|
36
|
+
}
|
|
37
|
+
if ((typeof this !== "object" || this === null) && typeof this !== "function") return;
|
|
38
|
+
Object.defineProperty(this, key, { value: next, writable: true, enumerable: true, configurable: true });
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
"accessor",
|
|
42
|
+
);
|
|
43
|
+
Object.defineProperty(object, key, { get, set, enumerable, configurable: false });
|
|
44
|
+
add(get);
|
|
45
|
+
add(set);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
for (const key of Reflect.ownKeys(globalThis)) {
|
|
49
|
+
const descriptor = Object.getOwnPropertyDescriptor(globalThis, key);
|
|
50
|
+
add(descriptor.value);
|
|
51
|
+
add(descriptor.get);
|
|
52
|
+
add(descriptor.set);
|
|
53
|
+
if ("value" in descriptor && descriptor.configurable) {
|
|
54
|
+
Object.defineProperty(globalThis, key, { writable: false, configurable: false });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
add(Object.getPrototypeOf(function* () {}));
|
|
58
|
+
add(Object.getPrototypeOf(async function () {}));
|
|
59
|
+
add(Object.getPrototypeOf(async function* () {}));
|
|
60
|
+
add(Object.getPrototypeOf(Int8Array));
|
|
61
|
+
add(Object.getPrototypeOf([][Symbol.iterator]()));
|
|
62
|
+
add(Object.getPrototypeOf(new Map()[Symbol.iterator]()));
|
|
63
|
+
add(Object.getPrototypeOf(new Set()[Symbol.iterator]()));
|
|
64
|
+
add(Object.getPrototypeOf(""[Symbol.iterator]()));
|
|
65
|
+
add(Object.getPrototypeOf(/a/[Symbol.matchAll]("")));
|
|
66
|
+
if (typeof Iterator === "function") {
|
|
67
|
+
if (typeof Iterator.prototype.map === "function") add(Object.getPrototypeOf([].values().map((x) => x)));
|
|
68
|
+
if (typeof Iterator.from === "function") add(Object.getPrototypeOf(Iterator.from({ next() {} })));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
while (queue.length > 0) {
|
|
72
|
+
const object = queue.pop();
|
|
73
|
+
add(Object.getPrototypeOf(object));
|
|
74
|
+
const descriptors = Object.getOwnPropertyDescriptors(object);
|
|
75
|
+
for (const key of Reflect.ownKeys(descriptors)) {
|
|
76
|
+
const descriptor = descriptors[key];
|
|
77
|
+
if ("value" in descriptor) {
|
|
78
|
+
add(descriptor.value);
|
|
79
|
+
if (
|
|
80
|
+
descriptor.writable &&
|
|
81
|
+
descriptor.configurable &&
|
|
82
|
+
(object === Object.prototype || OVERRIDABLE.has(key))
|
|
83
|
+
) {
|
|
84
|
+
allowOverride(object, key, descriptor.value, descriptor.enumerable);
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
add(descriptor.get);
|
|
88
|
+
add(descriptor.set);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
Object.freeze(object);
|
|
92
|
+
}
|
|
93
|
+
})();
|
|
94
|
+
const stringify = JSON.stringify;
|
|
95
|
+
const parse = JSON.parse;
|
|
96
|
+
const promiseThen = Promise.prototype.then;
|
|
97
|
+
const ErrorCtor = Error;
|
|
98
|
+
const TypeErrorCtor = TypeError;
|
|
99
|
+
const RangeErrorCtor = RangeError;
|
|
100
|
+
const pending = new Map();
|
|
101
|
+
let nextId = 1;
|
|
102
|
+
let finished = false;
|
|
103
|
+
// Thrown by exit() to unwind the script after it already reported success.
|
|
104
|
+
const EXIT = Object.freeze({});
|
|
105
|
+
|
|
106
|
+
function done(ok, payload, writes) {
|
|
107
|
+
if (finished) return;
|
|
108
|
+
finished = true;
|
|
109
|
+
bridge("done", ok, payload, writes);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function serialize(value) {
|
|
113
|
+
return value === undefined ? undefined : stringify(value);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// QuickJS stacks list frames only. Prefix "Name: message" like V8 so the
|
|
117
|
+
// text reads the same as a Node error, and drop this prelude's frames.
|
|
118
|
+
function errorText(error) {
|
|
119
|
+
const head = error.message ? error.name + ": " + error.message : String(error.name);
|
|
120
|
+
const frames =
|
|
121
|
+
typeof error.stack === "string"
|
|
122
|
+
? error.stack.split("\\n").filter((line) => line.trim() && !line.includes("codemode-prelude.js"))
|
|
123
|
+
: [];
|
|
124
|
+
return [head, ...frames].join("\\n");
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function format(value) {
|
|
128
|
+
if (typeof value === "string") return value;
|
|
129
|
+
if (value instanceof ErrorCtor) return errorText(value);
|
|
130
|
+
try {
|
|
131
|
+
const json = stringify(value);
|
|
132
|
+
return json === undefined ? String(value) : json;
|
|
133
|
+
} catch {
|
|
134
|
+
return String(value);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// The host requires string fields. A script can set an error's name or message to anything, so
|
|
139
|
+
// they are coerced, and a value whose coercion throws gets a placeholder.
|
|
140
|
+
function describeError(error) {
|
|
141
|
+
try {
|
|
142
|
+
if (error instanceof ErrorCtor) {
|
|
143
|
+
return stringify({ name: String(error.name), message: String(error.message), stack: errorText(error) });
|
|
144
|
+
}
|
|
145
|
+
return stringify({ message: String(format(error)) });
|
|
146
|
+
} catch {
|
|
147
|
+
return stringify({ message: "The script threw a value that cannot be described" });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function caller(kind, name, spread) {
|
|
152
|
+
return (...args) =>
|
|
153
|
+
new Promise((resolve, reject) => {
|
|
154
|
+
let json;
|
|
155
|
+
try {
|
|
156
|
+
json = serialize(spread ? args : args[0]);
|
|
157
|
+
} catch (error) {
|
|
158
|
+
reject(error);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const id = nextId++;
|
|
162
|
+
pending.set(id, { resolve, reject });
|
|
163
|
+
bridge(kind, id, name, json);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const tools = Object.create(null);
|
|
168
|
+
const allTools = [];
|
|
169
|
+
for (const { name, jsName, description } of parse(toolsJson)) {
|
|
170
|
+
const fn = caller("call", name);
|
|
171
|
+
// The first tool wins when two names normalize to the same identifier.
|
|
172
|
+
if (!(jsName in tools)) {
|
|
173
|
+
tools[jsName] = fn;
|
|
174
|
+
allTools.push(Object.freeze({ name: jsName, description }));
|
|
175
|
+
}
|
|
176
|
+
if (!(name in tools)) tools[name] = fn;
|
|
177
|
+
}
|
|
178
|
+
Object.freeze(tools);
|
|
179
|
+
Object.freeze(allTools);
|
|
180
|
+
|
|
181
|
+
// Reading a member that does not exist throws an error that names the close matches, instead of
|
|
182
|
+
// a later "not a function". \`in\` checks still work.
|
|
183
|
+
const comparable = (name) => name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
184
|
+
function guard(target, label, names, hint) {
|
|
185
|
+
return new Proxy(target, {
|
|
186
|
+
get(object, property, receiver) {
|
|
187
|
+
if (typeof property !== "string" || property in object || property in Object.prototype || property === "then" || property === "toJSON") {
|
|
188
|
+
return Reflect.get(object, property, receiver);
|
|
189
|
+
}
|
|
190
|
+
const wanted = comparable(property);
|
|
191
|
+
const exact = names.filter((name) => comparable(name) === wanted);
|
|
192
|
+
const close = exact.length > 0 ? exact : names.filter((name) => wanted && (comparable(name).includes(wanted) || wanted.includes(comparable(name))));
|
|
193
|
+
let message = label + "." + property + " does not exist.";
|
|
194
|
+
if (close.length > 0) message += " Did you mean " + close.slice(0, 5).map((name) => label + "." + name).join(", ") + "?";
|
|
195
|
+
else if (names.length <= 20) message += " Available: " + names.join(", ") + ".";
|
|
196
|
+
if (hint) message += " " + hint;
|
|
197
|
+
message += ' Check for a member with "' + property + '" in ' + label + ".";
|
|
198
|
+
throw new TypeErrorCtor(message);
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
const toolsProxy = guard(
|
|
203
|
+
tools,
|
|
204
|
+
"tools",
|
|
205
|
+
allTools.map((tool) => tool.name),
|
|
206
|
+
"ALL_TOOLS lists every tool; searchTools(query) finds tools by topic.",
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
const namespaces = new Map();
|
|
210
|
+
for (const { name, spread } of parse(globalsJson)) {
|
|
211
|
+
const fn = caller("global", name, spread);
|
|
212
|
+
const dot = name.indexOf(".");
|
|
213
|
+
if (dot === -1) {
|
|
214
|
+
Object.defineProperty(globalThis, name, { value: fn, enumerable: true });
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
const namespace = name.slice(0, dot);
|
|
218
|
+
if (!namespaces.has(namespace)) namespaces.set(namespace, Object.create(null));
|
|
219
|
+
namespaces.get(namespace)[name.slice(dot + 1)] = fn;
|
|
220
|
+
}
|
|
221
|
+
for (const [namespace, members] of namespaces) {
|
|
222
|
+
Object.freeze(members);
|
|
223
|
+
const value = guard(members, namespace, Object.keys(members));
|
|
224
|
+
Object.defineProperty(globalThis, namespace, { value, enumerable: true });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// key -> JSON text. Sizes count key and JSON characters.
|
|
228
|
+
const stored = new Map(Object.entries(parse(storeJson)));
|
|
229
|
+
const writes = new Map();
|
|
230
|
+
let storedChars = 0;
|
|
231
|
+
for (const [key, json] of stored) storedChars += key.length + json.length;
|
|
232
|
+
|
|
233
|
+
const STORE_HINT =
|
|
234
|
+
"store() is for small state such as IDs or summaries. Show images with image(), keep large data in variables, or write it to a file with a tool.";
|
|
235
|
+
|
|
236
|
+
function checkKey(name, key) {
|
|
237
|
+
if (typeof key !== "string") throw new TypeError(name + "() key must be a string");
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function store(key, value) {
|
|
241
|
+
checkKey("store", key);
|
|
242
|
+
const previous = stored.has(key) ? key.length + stored.get(key).length : 0;
|
|
243
|
+
if (value === undefined) {
|
|
244
|
+
stored.delete(key);
|
|
245
|
+
storedChars -= previous;
|
|
246
|
+
writes.set(key, undefined);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
let json;
|
|
250
|
+
try {
|
|
251
|
+
json = stringify(value);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
throw new TypeError("store(" + stringify(key) + ") value is not JSON-serializable: " + format(error));
|
|
254
|
+
}
|
|
255
|
+
if (json === undefined) {
|
|
256
|
+
throw new TypeError("store(" + stringify(key) + ") value is not JSON-serializable");
|
|
257
|
+
}
|
|
258
|
+
if (json.length > 262144) {
|
|
259
|
+
throw new RangeError(
|
|
260
|
+
"store(" + stringify(key) + ") value has " + json.length + " characters of JSON, more than the limit of 262144. " +
|
|
261
|
+
STORE_HINT,
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
const next = storedChars - previous + key.length + json.length;
|
|
265
|
+
if (next > 1048576) {
|
|
266
|
+
throw new RangeError(
|
|
267
|
+
"store is full: stored values would exceed 1048576 characters of JSON. Delete keys with store(key, undefined). " +
|
|
268
|
+
STORE_HINT,
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
stored.set(key, json);
|
|
272
|
+
storedChars = next;
|
|
273
|
+
writes.set(key, json);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function load(key) {
|
|
277
|
+
checkKey("load", key);
|
|
278
|
+
const json = stored.get(key);
|
|
279
|
+
return json === undefined ? undefined : parse(json);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function serializeWrites() {
|
|
283
|
+
const entries = [];
|
|
284
|
+
for (const [key, json] of writes) entries.push(json === undefined ? [key] : [key, json]);
|
|
285
|
+
return stringify(entries);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
Object.defineProperty(globalThis, "store", { value: store, enumerable: true });
|
|
289
|
+
Object.defineProperty(globalThis, "load", { value: load, enumerable: true });
|
|
290
|
+
|
|
291
|
+
let outputChars = 0;
|
|
292
|
+
let outputItems = 0;
|
|
293
|
+
|
|
294
|
+
// Past the output limits the script fails: done() reports the error, so catching it does not
|
|
295
|
+
// resume output, and the host ends the script.
|
|
296
|
+
function output(kind, data, mimeType) {
|
|
297
|
+
if (finished) return;
|
|
298
|
+
outputChars += data.length;
|
|
299
|
+
outputItems++;
|
|
300
|
+
if (outputChars > 16777216 || outputItems > 100000) {
|
|
301
|
+
const error = new RangeErrorCtor(
|
|
302
|
+
"script output exceeded the limit of 16777216 characters or 100000 text(), image(), and console calls. " +
|
|
303
|
+
"Print a summary instead, or write large data to a file with a tool.",
|
|
304
|
+
);
|
|
305
|
+
done(false, describeError(error));
|
|
306
|
+
throw error;
|
|
307
|
+
}
|
|
308
|
+
bridge("output", kind, data, mimeType);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Primitives become their string form, everything else JSON.
|
|
312
|
+
function outputText(value) {
|
|
313
|
+
if (value === undefined || value === null || typeof value !== "object" && typeof value !== "function") {
|
|
314
|
+
return String(value);
|
|
315
|
+
}
|
|
316
|
+
const json = stringify(value);
|
|
317
|
+
return json === undefined ? String(value) : json;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function text(value) {
|
|
321
|
+
let rendered;
|
|
322
|
+
try {
|
|
323
|
+
rendered = outputText(value);
|
|
324
|
+
} catch (error) {
|
|
325
|
+
throw new TypeErrorCtor(error instanceof ErrorCtor ? error.message : String(error));
|
|
326
|
+
}
|
|
327
|
+
output("text", rendered);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function imageUrl(value) {
|
|
331
|
+
if (typeof value === "string") return value;
|
|
332
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
333
|
+
throw new TypeErrorCtor(${JSON.stringify(H)});
|
|
334
|
+
}
|
|
335
|
+
if (value.image_url !== undefined) {
|
|
336
|
+
if (typeof value.image_url !== "string") throw new TypeErrorCtor(${JSON.stringify(H)});
|
|
337
|
+
return value.image_url;
|
|
338
|
+
}
|
|
339
|
+
if (typeof value.type !== "string") throw new TypeErrorCtor(${JSON.stringify(H)});
|
|
340
|
+
if (value.type !== "image") {
|
|
341
|
+
throw new TypeErrorCtor('image only accepts image blocks, got "' + value.type + '"');
|
|
342
|
+
}
|
|
343
|
+
if (typeof value.data !== "string" || value.data === "") throw new TypeErrorCtor("image expected image block data");
|
|
344
|
+
if (value.data.toLowerCase().startsWith("data:")) return value.data;
|
|
345
|
+
return "data:;base64," + value.data;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// Base64 of the signatures of the formats providers accept inline (PNG, JPEG except
|
|
349
|
+
// JPEG-LS, GIF, "RIFF....WEBP"). Signatures start at byte 0, so their encodings are prefixes.
|
|
350
|
+
const IMAGE_SIGNATURES = [
|
|
351
|
+
["image/png", /^iVBORw0KGg/],
|
|
352
|
+
["image/jpeg", /^[/]9j[/](?!9)/],
|
|
353
|
+
["image/gif", /^R0lGOD[dl]h/],
|
|
354
|
+
["image/webp", /^UklG.{8}RUJQ/],
|
|
355
|
+
];
|
|
356
|
+
|
|
357
|
+
function image(value) {
|
|
358
|
+
const url = imageUrl(value);
|
|
359
|
+
if (url === "") throw new TypeErrorCtor(${JSON.stringify(H)});
|
|
360
|
+
const colon = url.indexOf(":");
|
|
361
|
+
const scheme = colon === -1 ? "" : url.slice(0, colon).toLowerCase();
|
|
362
|
+
if (scheme === "http" || scheme === "https") {
|
|
363
|
+
throw new TypeErrorCtor("remote image URLs are not supported in tool outputs. Pass a base64 data URI instead");
|
|
364
|
+
}
|
|
365
|
+
const comma = url.indexOf(",");
|
|
366
|
+
const header = comma === -1 ? [] : url.slice(colon + 1, comma).split(";");
|
|
367
|
+
if (scheme !== "data" || comma === -1 || header.slice(1).every((part) => part.toLowerCase() !== "base64")) {
|
|
368
|
+
throw new TypeErrorCtor("invalid image output. Pass a base64 data URI instead");
|
|
369
|
+
}
|
|
370
|
+
// Providers reject the whole request on a bad image, and a persisted image block would be
|
|
371
|
+
// resent on every later turn. Line breaks from wrapped base64 are dropped. The declared type
|
|
372
|
+
// is ignored in favor of the detected one, as providers also reject mismatches.
|
|
373
|
+
const data = url.slice(comma + 1).replace(/\\s+/g, "");
|
|
374
|
+
if (data.length % 4 !== 0 || !/^[A-Za-z0-9+/]+={0,2}$/.test(data)) {
|
|
375
|
+
throw new TypeErrorCtor("invalid image output. The image data is not valid base64 (truncated or corrupted?)");
|
|
376
|
+
}
|
|
377
|
+
const head = data.slice(0, 16);
|
|
378
|
+
const signature = IMAGE_SIGNATURES.find(([, pattern]) => pattern.test(head));
|
|
379
|
+
if (!signature) {
|
|
380
|
+
throw new TypeErrorCtor("invalid image output. The image data is not a PNG, JPEG, GIF, or WebP image");
|
|
381
|
+
}
|
|
382
|
+
output("image", data, signature[0]);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function exit() {
|
|
386
|
+
let writesJson;
|
|
387
|
+
try {
|
|
388
|
+
writesJson = serializeWrites();
|
|
389
|
+
} catch (error) {
|
|
390
|
+
done(false, describeError(error));
|
|
391
|
+
throw EXIT;
|
|
392
|
+
}
|
|
393
|
+
done(true, undefined, writesJson);
|
|
394
|
+
throw EXIT;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const console = {};
|
|
398
|
+
for (const level of ["log", "info", "warn", "error", "debug"]) {
|
|
399
|
+
console[level] = (...args) => {
|
|
400
|
+
output("console", args.map(format).join(" "));
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
Object.freeze(console);
|
|
404
|
+
|
|
405
|
+
Object.defineProperty(globalThis, "tools", { value: toolsProxy, enumerable: true });
|
|
406
|
+
Object.defineProperty(globalThis, "ALL_TOOLS", { value: allTools, enumerable: true });
|
|
407
|
+
Object.defineProperty(globalThis, "console", { value: console, enumerable: true });
|
|
408
|
+
Object.defineProperty(globalThis, "text", { value: text, enumerable: true });
|
|
409
|
+
Object.defineProperty(globalThis, "image", { value: image, enumerable: true });
|
|
410
|
+
Object.defineProperty(globalThis, "exit", { value: exit, enumerable: true });
|
|
411
|
+
|
|
412
|
+
return {
|
|
413
|
+
settle(id, ok, payload, propertiesJson) {
|
|
414
|
+
const entry = pending.get(id);
|
|
415
|
+
if (!entry) return;
|
|
416
|
+
pending.delete(id);
|
|
417
|
+
if (!ok) {
|
|
418
|
+
const error = new ErrorCtor(payload);
|
|
419
|
+
if (propertiesJson !== undefined) {
|
|
420
|
+
const properties = parse(propertiesJson);
|
|
421
|
+
for (const key of Object.keys(properties)) {
|
|
422
|
+
if (key === "name" || key === "message" || key === "stack") continue;
|
|
423
|
+
Object.defineProperty(error, key, { value: properties[key], writable: true, enumerable: true, configurable: true });
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
entry.reject(error);
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
let value;
|
|
430
|
+
try {
|
|
431
|
+
value = payload === undefined ? undefined : parse(payload);
|
|
432
|
+
} catch (error) {
|
|
433
|
+
entry.reject(error);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
entry.resolve(value);
|
|
437
|
+
},
|
|
438
|
+
run(fn) {
|
|
439
|
+
let promise;
|
|
440
|
+
try {
|
|
441
|
+
promise = fn(toolsProxy, console);
|
|
442
|
+
} catch (error) {
|
|
443
|
+
done(false, describeError(error));
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
promiseThen.call(
|
|
447
|
+
promise,
|
|
448
|
+
(value) => {
|
|
449
|
+
let json;
|
|
450
|
+
try {
|
|
451
|
+
json = serialize(value);
|
|
452
|
+
} catch (error) {
|
|
453
|
+
done(false, describeError(error));
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
done(true, json, serializeWrites());
|
|
457
|
+
},
|
|
458
|
+
(error) => {
|
|
459
|
+
done(false, describeError(error));
|
|
460
|
+
},
|
|
461
|
+
);
|
|
462
|
+
},
|
|
463
|
+
stalled() {
|
|
464
|
+
if (finished || pending.size > 0) return false;
|
|
465
|
+
done(
|
|
466
|
+
false,
|
|
467
|
+
stringify({
|
|
468
|
+
name: "Error",
|
|
469
|
+
message:
|
|
470
|
+
"The script is waiting on a promise that can never settle: no tool call is pending, and timers do not exist here.",
|
|
471
|
+
}),
|
|
472
|
+
);
|
|
473
|
+
return true;
|
|
474
|
+
},
|
|
475
|
+
};
|
|
476
|
+
})`;var le=1;function ce(i){let e=2166136261;for(let t=0;t<i.length;t++)e^=i.charCodeAt(t),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}var ue=ce(B);function pe(i){let e=i>>>0;return()=>{e=e+1831565813>>>0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,(t^t>>>14)>>>0}}function fe(i){let e=pe(i.seed^2654435769);return t=>({...Y(t),clock_time_get(r,s,n){let o;return i.creating?o=r===0?BigInt(i.seed+1)*1000n:0n:r===0?o=BigInt(Math.round(i.now))*1000000n:o=BigInt(Math.round(i.now-i.startedAt))*1000000n,new DataView(t.buffer).setBigUint64(n,o,!0),0},random_get(r,s){let n=new Uint8Array(t.buffer,r,s);for(let o=0;o<s;o+=4){let a=e();for(let l=0;l<4&&o+l<s;l++)n[o+l]=a>>>l*8}return 0}})}function Y(i){return{fd_write(e,t,r,s){let n=new DataView(i.buffer),o=0;for(let a=0;a<r;a++)o+=n.getUint32(t+a*8+4,!0);return n.setUint32(s,o,!0),0}}}function de(i){let e=i.message?`${i.name}: ${i.message}`:i.name,t=i.stack?.trimEnd();return JSON.stringify({name:i.name,message:i.message,stack:t?`${e}
|
|
477
|
+
${t}`:e})}var me=50;function K(i){return{type:"crash",message:i instanceof Error?`${i.name}: ${i.message}`:String(i)}}async function Q(i){let{data:e,post:t}=i,r=i.maxStackSize??R,s=e.deterministic,n=s&&{creating:!0,startedAt:s.startedAt,now:s.startedAt,seed:s.seed>>>0},o=await D.create({wasm:i.wasm,memoryLimit:e.memoryLimitBytes,maxStackSize:r,interruptHandler:i.shouldInterrupt,wasi:n?fe(n):Y,...n?{timezoneOffset:0,intrinsics:L.ALL&~L.WEAK_REF}:{}});n&&(n.creating=!1);let a=!1,l=0,u=1,c=0,p=new Map,h=_=>{o.withScope(()=>{o.callFunction(w,d,o.newNumber(_.id),_.ok?o.true:o.false,_.payload===void 0?o.undefined:o.newString(_.payload),_.properties===void 0?o.undefined:o.newString(_.properties))}),y()},g={deliver(_){if(!a)try{if(!n){h(_);return}let{seq:x}=_;if(x===void 0||!Number.isInteger(x)||x<u||p.has(x))throw new Error(`Result ${_.id} has sequence number ${x}, expected ${u} or later, once`);p.set(x,_);for(let j=p.get(u);j!==void 0;j=p.get(u))p.delete(u),j.now!==void 0&&Number.isFinite(j.now)&&(n.now=Math.max(n.now,j.now)),c=u,h(j),t({type:"idle",seq:u,issued:l}),u++}catch(x){t(K(x))}},dispose(){a||(a=!0,o.dispose())}},d,w,P,S=o._getExports(),y=()=>{let _=0;for(;S.qjs_is_job_pending();){if(S.qjs_execute_pending_job()<0)throw new Error("Promise job failed");if(++_%me===0&&i.shouldInterrupt())throw new Error("Execution interrupted")}o.callFunction(P,d).dispose()};try{let _=o.newFunction("bridge",(b,k,v,f)=>{switch(b.toString()){case"call":case"global":l++,t({type:"call",id:k.toNumber(),target:b.toString()==="call"?"tool":"global",name:v.toString(),args:f===void 0||f.isUndefined?void 0:f.toString()});break;case"output":t({type:"output",item:k.toString()==="image"?{type:"image",data:v.toString(),mimeType:f.toString()}:k.toString()==="console"?{type:"text",text:v.toString(),console:!0}:{type:"text",text:v.toString()}});break;case"done":{let E=n?{during:{seq:c,issued:l}}:{};k.toBoolean()?t({type:"done",ok:!0,value:v===void 0||v.isUndefined?void 0:v.toString(),writes:f.toString(),...E}):t({type:"done",ok:!1,error:v.toString(),...E});break}}return o.undefined});d=o.withScope(b=>b.escape(o.callFunction(o.evalCode(B,"codemode-prelude.js"),o.undefined,_,o.newString(JSON.stringify(e.tools)),o.newString(JSON.stringify(e.globals)),o.newString(JSON.stringify(e.store))))),w=d.getProp("settle");let x=d.getProp("run");if(P=d.getProp("stalled"),n){let b=o.versions,k=i.interruptBudget??"none";t({type:"started",fingerprint:`quickjs-wasi ${b["quickjs-wasi"]}, quickjs ${b.quickjs}, prelude ${ue}, deterministic ${le}, stack ${r}, heap ${e.memoryLimitBytes??"none"}, budget ${k}`})}let j;try{j=o.evalCode(`(async (tools, console) => {${e.code}
|
|
478
|
+
})`,"codemode.js")}catch(b){if(!(b instanceof q))throw b;return t({type:"done",ok:!1,error:de(b)}),g}o.callFunction(x,d,j).dispose(),j.dispose(),y(),n&&t({type:"idle",seq:0,issued:l})}catch(_){t(K(_))}return g}function Z(i){M?.postMessage(i)}async function _e(i){let e=new Int32Array(i.interrupt),t=await Q({data:i,wasm:i.wasm,post:Z,shouldInterrupt:()=>Atomics.load(e,0)!==0});M?.on("message",r=>{$(r)&&t.deliver(r)})}M&&_e(he).catch(i=>{Z({type:"crash",message:i instanceof Error?`${i.name}: ${i.message}`:String(i)})});
|