@celljs/ta 0.0.0-stage → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -2
- package/bin/ta.mjs +10 -0
- package/dist/cli.mjs +517 -0
- package/dist/pi/CHANGELOG.md +32 -0
- package/dist/pi/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +6 -0
- package/dist/pi/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/pi/dist/bundle/chunks/azure-openai-responses-FSC6BAW3.js +2 -0
- package/dist/pi/dist/bundle/chunks/bedrock-converse-stream.js +89 -0
- package/dist/pi/dist/bundle/chunks/chunk-36QC74V4.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-3TGLJEWK.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-44DLKSKE.js +1232 -0
- package/dist/pi/dist/bundle/chunks/chunk-4EYXVSA5.js +129 -0
- package/dist/pi/dist/bundle/chunks/chunk-5AGIVGSV.js +6 -0
- package/dist/pi/dist/bundle/chunks/chunk-62VOPMLK.js +65 -0
- package/dist/pi/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
- package/dist/pi/dist/bundle/chunks/chunk-7CBJINYJ.js +20 -0
- package/dist/pi/dist/bundle/chunks/chunk-7DDKXS2Q.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-7O7QKK6A.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-B46VJEHW.js +44 -0
- package/dist/pi/dist/bundle/chunks/chunk-C2WU32PX.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-CF5GWZHW.js +31 -0
- package/dist/pi/dist/bundle/chunks/chunk-CHWNPHIS.js +82 -0
- package/dist/pi/dist/bundle/chunks/chunk-EBFHJFEE.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-EOO47QGR.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-FFMDRXC4.js +10 -0
- package/dist/pi/dist/bundle/chunks/chunk-GN3QYODH.js +16 -0
- package/dist/pi/dist/bundle/chunks/chunk-JXWJOIH4.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-LVVZS2NO.js +12 -0
- package/dist/pi/dist/bundle/chunks/chunk-NL4X6LBY.js +4 -0
- package/dist/pi/dist/bundle/chunks/chunk-NZY7EIPA.js +4 -0
- package/dist/pi/dist/bundle/chunks/chunk-P7FPUEYA.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-PMRZO46Y.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-R2EGYMOO.js +7 -0
- package/dist/pi/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-TMTOQ7H7.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-UKVNB6C4.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-V6KH5QG4.js +9 -0
- package/dist/pi/dist/bundle/chunks/chunk-VOLAXWGI.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-YZKQS34S.js +9 -0
- package/dist/pi/dist/bundle/chunks/cli-MCOUW5WS.js +53 -0
- package/dist/pi/dist/bundle/chunks/cloudflare-workers-ai-system-one-WLAFJSP6.js +2 -0
- package/dist/pi/dist/bundle/chunks/codemode-worker.js +478 -0
- package/dist/pi/dist/bundle/chunks/easter-egg-3d-WMBNSJ4M.js +2 -0
- package/dist/pi/dist/bundle/chunks/execute-4CEBORGZ.js +505 -0
- package/dist/pi/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/pi/dist/bundle/chunks/google-generative-ai-INGKNW72.js +2 -0
- package/dist/pi/dist/bundle/chunks/google-vertex-IBTX6MBF.js +2 -0
- package/dist/pi/dist/bundle/chunks/https-proxy-agent-LVOO5TPL.js +13 -0
- package/dist/pi/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/pi/dist/bundle/chunks/jiti-loader-GL4HJFAD.js +21 -0
- package/dist/pi/dist/bundle/chunks/jiti-static-loader-2RCDI6B4.js +2 -0
- package/dist/pi/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/pi/dist/bundle/chunks/lib-4AVRLBHM.js +9 -0
- package/dist/pi/dist/bundle/chunks/llama-cpp-classify-V5U3QKXI.js +22 -0
- package/dist/pi/dist/bundle/chunks/meta.js +2 -0
- package/dist/pi/dist/bundle/chunks/mistral-conversations-S4OWXIXQ.js +5 -0
- package/dist/pi/dist/bundle/chunks/multipart-parser-FMGQ7342.js +3 -0
- package/dist/pi/dist/bundle/chunks/node-AUOGOBCN.js +2 -0
- package/dist/pi/dist/bundle/chunks/node-KCMANYC2.js +16 -0
- package/dist/pi/dist/bundle/chunks/openai-chatgpt.js +75 -0
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +10 -0
- package/dist/pi/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/pi/dist/bundle/chunks/openai-completions-EJNYB6IX.js +7 -0
- package/dist/pi/dist/bundle/chunks/openai-decisions-IXI34BYG.js +5 -0
- package/dist/pi/dist/bundle/chunks/openai-responses-MD3562FB.js +4 -0
- package/dist/pi/dist/bundle/chunks/openrouter-images-PISKSFMS.js +2 -0
- package/dist/pi/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/pi/dist/bundle/chunks/pi-messages-NORUKF4E.js +8 -0
- package/dist/pi/dist/bundle/chunks/radius.js +75 -0
- package/dist/pi/dist/bundle/chunks/runtime-FQB7RU7U.js +2 -0
- package/dist/pi/dist/bundle/chunks/src-QKGKDFSU.js +4 -0
- package/dist/pi/dist/bundle/chunks/typesafe-system-one-CHVC2UUI.js +2 -0
- package/dist/pi/dist/bundle/chunks/virtual-modules-O76XM3OB.js +2 -0
- package/dist/pi/dist/bundle/chunks/xai.js +2 -0
- package/dist/pi/dist/bundle/cli-runtime.js +3 -0
- package/dist/pi/dist/bundle/cli.js +5 -0
- package/dist/pi/dist/bundle/index.js +2 -0
- package/dist/pi/dist/bundle/rpc-entry.js +3 -0
- package/dist/pi/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/pi/dist/core/export-html/index.js +228 -0
- package/dist/pi/dist/core/export-html/template.css +1085 -0
- package/dist/pi/dist/core/export-html/template.html +56 -0
- package/dist/pi/dist/core/export-html/template.js +2044 -0
- package/dist/pi/dist/core/export-html/tool-renderer.js +113 -0
- package/dist/pi/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/pi/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/pi/dist/core/export-html/vendor/marked.min.js +79 -0
- package/dist/pi/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/pi/dist/modes/interactive/theme/dark.json +78 -0
- package/dist/pi/dist/modes/interactive/theme/light.json +78 -0
- package/dist/pi/docs/cli-integration.md +106 -0
- package/dist/pi/docs/cli.md +343 -0
- package/dist/pi/docs/codemode.md +230 -0
- package/dist/pi/docs/compaction.md +463 -0
- package/dist/pi/docs/configuration.md +47 -0
- package/dist/pi/docs/containerization.md +183 -0
- package/dist/pi/docs/custom-provider.md +227 -0
- package/dist/pi/docs/docs.json +220 -0
- package/dist/pi/docs/environment-variables.md +103 -0
- package/dist/pi/docs/extensions.md +3347 -0
- package/dist/pi/docs/how-pi-works.md +49 -0
- package/dist/pi/docs/images/doom-extension.png +0 -0
- package/dist/pi/docs/images/exy.png +0 -0
- package/dist/pi/docs/images/interactive-mode.png +0 -0
- package/dist/pi/docs/images/tree-view.png +0 -0
- package/dist/pi/docs/index.md +39 -0
- package/dist/pi/docs/json.md +226 -0
- package/dist/pi/docs/keybindings.md +195 -0
- package/dist/pi/docs/llama-cpp.md +132 -0
- package/dist/pi/docs/mcp.md +274 -0
- package/dist/pi/docs/message-types.md +279 -0
- package/dist/pi/docs/models-configuration.md +196 -0
- package/dist/pi/docs/models.md +225 -0
- package/dist/pi/docs/nvidia-rtx-llama-cpp.md +96 -0
- package/dist/pi/docs/packages.md +153 -0
- package/dist/pi/docs/prompt-templates.md +59 -0
- package/dist/pi/docs/providers.md +247 -0
- package/dist/pi/docs/quickstart.md +140 -0
- package/dist/pi/docs/rpc-commands.md +860 -0
- package/dist/pi/docs/rpc-extension-ui.md +200 -0
- package/dist/pi/docs/rpc.md +193 -0
- package/dist/pi/docs/sdk.md +147 -0
- package/dist/pi/docs/security.md +99 -0
- package/dist/pi/docs/session-format.md +293 -0
- package/dist/pi/docs/sessions.md +74 -0
- package/dist/pi/docs/settings.md +173 -0
- package/dist/pi/docs/shell-aliases.md +93 -0
- package/dist/pi/docs/skills.md +93 -0
- package/dist/pi/docs/slash-commands.md +61 -0
- package/dist/pi/docs/terminal-setup.md +235 -0
- package/dist/pi/docs/termux.md +117 -0
- package/dist/pi/docs/themes.md +138 -0
- package/dist/pi/docs/tmux.md +61 -0
- package/dist/pi/docs/tui.md +197 -0
- package/dist/pi/docs/usage.md +94 -0
- package/dist/pi/docs/virtual-models.md +114 -0
- package/dist/pi/docs/windows.md +108 -0
- package/dist/pi/examples/README.md +36 -0
- package/dist/pi/examples/extensions/README.md +215 -0
- package/dist/pi/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/dist/pi/examples/extensions/bash-spawn-hook.ts +30 -0
- package/dist/pi/examples/extensions/bookmark.ts +50 -0
- package/dist/pi/examples/extensions/border-status-editor.ts +150 -0
- package/dist/pi/examples/extensions/built-in-tool-renderer.ts +225 -0
- package/dist/pi/examples/extensions/claude-rules.ts +86 -0
- package/dist/pi/examples/extensions/commands.ts +72 -0
- package/dist/pi/examples/extensions/confirm-destructive.ts +59 -0
- package/dist/pi/examples/extensions/custom-compaction.ts +117 -0
- package/dist/pi/examples/extensions/custom-footer.ts +64 -0
- package/dist/pi/examples/extensions/custom-header.ts +73 -0
- package/dist/pi/examples/extensions/custom-provider-anthropic/index.ts +613 -0
- package/dist/pi/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/dist/pi/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/dist/pi/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
- package/dist/pi/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/dist/pi/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/dist/pi/examples/extensions/debug-provider.ts +90 -0
- package/dist/pi/examples/extensions/dirty-repo-guard.ts +56 -0
- package/dist/pi/examples/extensions/doom-overlay/README.md +46 -0
- package/dist/pi/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/dist/pi/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/dist/pi/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/dist/pi/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/dist/pi/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/dist/pi/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/dist/pi/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/dist/pi/examples/extensions/doom-overlay/index.ts +74 -0
- package/dist/pi/examples/extensions/doom-overlay/wad-finder.ts +55 -0
- package/dist/pi/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/dist/pi/examples/extensions/dynamic-resources/dynamic.json +81 -0
- package/dist/pi/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/dist/pi/examples/extensions/dynamic-resources/index.ts +15 -0
- package/dist/pi/examples/extensions/dynamic-tools.ts +74 -0
- package/dist/pi/examples/extensions/entry-renderer.ts +41 -0
- package/dist/pi/examples/extensions/event-bus.ts +43 -0
- package/dist/pi/examples/extensions/file-trigger.ts +41 -0
- package/dist/pi/examples/extensions/git-checkpoint.ts +53 -0
- package/dist/pi/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/dist/pi/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/dist/pi/examples/extensions/gondolin/index.ts +531 -0
- package/dist/pi/examples/extensions/gondolin/package-lock.json +175 -0
- package/dist/pi/examples/extensions/gondolin/package.json +19 -0
- package/dist/pi/examples/extensions/handoff.ts +190 -0
- package/dist/pi/examples/extensions/hello.ts +26 -0
- package/dist/pi/examples/extensions/hidden-thinking-label.ts +53 -0
- package/dist/pi/examples/extensions/inline-bash.ts +94 -0
- package/dist/pi/examples/extensions/input-transform-streaming.ts +39 -0
- package/dist/pi/examples/extensions/input-transform.ts +43 -0
- package/dist/pi/examples/extensions/interactive-shell.ts +196 -0
- package/dist/pi/examples/extensions/jev-router.ts +113 -0
- package/dist/pi/examples/extensions/mac-system-theme.ts +47 -0
- package/dist/pi/examples/extensions/message-renderer.ts +59 -0
- package/dist/pi/examples/extensions/minimal-mode.ts +353 -0
- package/dist/pi/examples/extensions/modal-editor.ts +85 -0
- package/dist/pi/examples/extensions/model-status.ts +31 -0
- package/dist/pi/examples/extensions/notify.ts +57 -0
- package/dist/pi/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/dist/pi/examples/extensions/overlay-test.ts +153 -0
- package/dist/pi/examples/extensions/permission-gate.ts +34 -0
- package/dist/pi/examples/extensions/pirate.ts +47 -0
- package/dist/pi/examples/extensions/plan-mode/README.md +66 -0
- package/dist/pi/examples/extensions/plan-mode/index.ts +394 -0
- package/dist/pi/examples/extensions/plan-mode/utils.ts +168 -0
- package/dist/pi/examples/extensions/preset.ts +438 -0
- package/dist/pi/examples/extensions/project-trust.ts +64 -0
- package/dist/pi/examples/extensions/prompt-customizer.ts +49 -0
- package/dist/pi/examples/extensions/protected-paths.ts +30 -0
- package/dist/pi/examples/extensions/provider-payload.ts +18 -0
- package/dist/pi/examples/extensions/qna.ts +118 -0
- package/dist/pi/examples/extensions/question.ts +286 -0
- package/dist/pi/examples/extensions/questionnaire.ts +448 -0
- package/dist/pi/examples/extensions/rainbow-editor.ts +88 -0
- package/dist/pi/examples/extensions/reload-runtime.ts +49 -0
- package/dist/pi/examples/extensions/rpc-demo.ts +118 -0
- package/dist/pi/examples/extensions/send-user-message.ts +97 -0
- package/dist/pi/examples/extensions/session-name.ts +27 -0
- package/dist/pi/examples/extensions/shutdown-command.ts +63 -0
- package/dist/pi/examples/extensions/snake.ts +343 -0
- package/dist/pi/examples/extensions/space-invaders.ts +560 -0
- package/dist/pi/examples/extensions/ssh.ts +220 -0
- package/dist/pi/examples/extensions/status-line.ts +32 -0
- package/dist/pi/examples/extensions/structured-output.ts +65 -0
- package/dist/pi/examples/extensions/subagent/README.md +177 -0
- package/dist/pi/examples/extensions/subagent/agents/planner.md +37 -0
- package/dist/pi/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/dist/pi/examples/extensions/subagent/agents/scout.md +50 -0
- package/dist/pi/examples/extensions/subagent/agents/worker.md +24 -0
- package/dist/pi/examples/extensions/subagent/agents.ts +157 -0
- package/dist/pi/examples/extensions/subagent/index.ts +1036 -0
- package/dist/pi/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/dist/pi/examples/extensions/subagent/prompts/implement.md +10 -0
- package/dist/pi/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/dist/pi/examples/extensions/summarize.ts +199 -0
- package/dist/pi/examples/extensions/system-prompt-header.ts +17 -0
- package/dist/pi/examples/extensions/tic-tac-toe.ts +1008 -0
- package/dist/pi/examples/extensions/timed-confirm.ts +70 -0
- package/dist/pi/examples/extensions/titlebar-spinner.ts +58 -0
- package/dist/pi/examples/extensions/todo.ts +304 -0
- package/dist/pi/examples/extensions/tool-override.ts +144 -0
- package/dist/pi/examples/extensions/tools.ts +148 -0
- package/dist/pi/examples/extensions/trigger-compact.ts +50 -0
- package/dist/pi/examples/extensions/truncated-tool.ts +195 -0
- package/dist/pi/examples/extensions/widget-placement.ts +9 -0
- package/dist/pi/examples/extensions/with-deps/index.ts +32 -0
- package/dist/pi/examples/extensions/with-deps/package-lock.json +31 -0
- package/dist/pi/examples/extensions/with-deps/package.json +22 -0
- package/dist/pi/examples/extensions/working-indicator.ts +123 -0
- package/dist/pi/examples/extensions/working-message-test.ts +25 -0
- package/dist/pi/examples/rpc-client.ts +35 -0
- package/dist/pi/examples/rpc-extension-ui.ts +661 -0
- package/dist/pi/examples/sdk/01-minimal.ts +26 -0
- package/dist/pi/examples/sdk/02-custom-model.ts +49 -0
- package/dist/pi/examples/sdk/03-custom-prompt.ts +75 -0
- package/dist/pi/examples/sdk/04-skills.ts +55 -0
- package/dist/pi/examples/sdk/05-tools.ts +48 -0
- package/dist/pi/examples/sdk/06-extensions.ts +99 -0
- package/dist/pi/examples/sdk/07-context-files.ts +47 -0
- package/dist/pi/examples/sdk/08-prompt-templates.ts +51 -0
- package/dist/pi/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/dist/pi/examples/sdk/10-settings.ts +53 -0
- package/dist/pi/examples/sdk/11-sessions.ts +52 -0
- package/dist/pi/examples/sdk/12-full-control.ts +74 -0
- package/dist/pi/examples/sdk/13-session-runtime.ts +67 -0
- package/dist/pi/examples/sdk/14-codemode-mcp.ts +61 -0
- package/dist/pi/examples/sdk/README.md +141 -0
- package/dist/pi/examples/tsconfig.json +180 -0
- package/dist/pi/node_modules/@silvia-odwyer/photon-node/LICENSE.md +201 -0
- package/dist/pi/node_modules/@silvia-odwyer/photon-node/README.md +158 -0
- package/dist/pi/node_modules/@silvia-odwyer/photon-node/package.json +23 -0
- package/dist/pi/node_modules/@silvia-odwyer/photon-node/photon_rs.d.ts +3226 -0
- package/dist/pi/node_modules/@silvia-odwyer/photon-node/photon_rs.js +4521 -0
- package/dist/pi/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js +4270 -0
- package/dist/pi/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm +0 -0
- package/dist/pi/node_modules/jiti/LICENSE +21 -0
- package/dist/pi/node_modules/jiti/README.md +258 -0
- package/dist/pi/node_modules/jiti/dist/babel.cjs +257 -0
- package/dist/pi/node_modules/jiti/dist/jiti.cjs +1 -0
- package/dist/pi/node_modules/jiti/lib/jiti-cli.mjs +34 -0
- package/dist/pi/node_modules/jiti/lib/jiti-hooks.mjs +124 -0
- package/dist/pi/node_modules/jiti/lib/jiti-native.mjs +121 -0
- package/dist/pi/node_modules/jiti/lib/jiti-register.d.mts +1 -0
- package/dist/pi/node_modules/jiti/lib/jiti-register.mjs +4 -0
- package/dist/pi/node_modules/jiti/lib/jiti-static.mjs +23 -0
- package/dist/pi/node_modules/jiti/lib/jiti.cjs +30 -0
- package/dist/pi/node_modules/jiti/lib/jiti.d.cts +8 -0
- package/dist/pi/node_modules/jiti/lib/jiti.d.mts +8 -0
- package/dist/pi/node_modules/jiti/lib/jiti.mjs +29 -0
- package/dist/pi/node_modules/jiti/lib/types.d.ts +420 -0
- package/dist/pi/node_modules/jiti/package.json +146 -0
- package/dist/pi/node_modules/quickjs-wasi/LICENSE +21 -0
- package/dist/pi/node_modules/quickjs-wasi/README.md +852 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/extensions.d.ts +110 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/extensions.d.ts.map +1 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/extensions.js +372 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/extensions.js.map +1 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/index.d.ts +1263 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/index.d.ts.map +1 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/index.js +2787 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/index.js.map +1 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/version.d.ts +2 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/version.d.ts.map +1 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/version.js +3 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/version.js.map +1 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/wasi-shim.d.ts +61 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/wasi-shim.d.ts.map +1 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/wasi-shim.js +103 -0
- package/dist/pi/node_modules/quickjs-wasi/dist/wasi-shim.js.map +1 -0
- package/dist/pi/node_modules/quickjs-wasi/extensions/crypto/crypto.so +0 -0
- package/dist/pi/node_modules/quickjs-wasi/extensions/encoding/encoding.so +0 -0
- package/dist/pi/node_modules/quickjs-wasi/extensions/headers/headers.so +0 -0
- package/dist/pi/node_modules/quickjs-wasi/extensions/structured-clone/structured-clone.so +0 -0
- package/dist/pi/node_modules/quickjs-wasi/extensions/url/url.so +0 -0
- package/dist/pi/node_modules/quickjs-wasi/package.json +69 -0
- package/dist/pi/node_modules/quickjs-wasi/quickjs.wasm +0 -0
- package/dist/pi/package.json +9 -0
- package/dist/serve/index.mjs +16495 -0
- package/package.json +52 -4
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool HTML renderer for custom tools in HTML export.
|
|
3
|
+
*
|
|
4
|
+
* Renders custom tool calls and results to HTML by invoking their TUI renderers
|
|
5
|
+
* and converting the ANSI output to HTML.
|
|
6
|
+
*/
|
|
7
|
+
import { keyHint, keyText } from "../../modes/interactive/components/keybinding-hints.js";
|
|
8
|
+
import { ansiLinesToHtml } from "./ansi-to-html.js";
|
|
9
|
+
/**
|
|
10
|
+
* Create a tool HTML renderer.
|
|
11
|
+
*
|
|
12
|
+
* The renderer looks up tool definitions and invokes their renderCall/renderResult
|
|
13
|
+
* methods, converting the resulting TUI Component output (ANSI) to HTML.
|
|
14
|
+
*/
|
|
15
|
+
const ANSI_ESCAPE_REGEX = /\x1b\[[\d;]*m/g;
|
|
16
|
+
function isBlankRenderedLine(line) {
|
|
17
|
+
return line.replace(ANSI_ESCAPE_REGEX, "").trim().length === 0;
|
|
18
|
+
}
|
|
19
|
+
function trimRenderedResultLines(lines) {
|
|
20
|
+
let start = 0;
|
|
21
|
+
let end = lines.length;
|
|
22
|
+
while (start < end && isBlankRenderedLine(lines[start]))
|
|
23
|
+
start++;
|
|
24
|
+
while (end > start && isBlankRenderedLine(lines[end - 1]))
|
|
25
|
+
end--;
|
|
26
|
+
return lines.slice(start, end);
|
|
27
|
+
}
|
|
28
|
+
export function createToolHtmlRenderer(deps) {
|
|
29
|
+
const { getToolRenderers, theme, cwd, width = 100 } = deps;
|
|
30
|
+
const renderedCallComponents = new Map();
|
|
31
|
+
const renderedResultComponents = new Map();
|
|
32
|
+
const renderedStates = new Map();
|
|
33
|
+
const renderedArgs = new Map();
|
|
34
|
+
const getState = (toolCallId) => {
|
|
35
|
+
let state = renderedStates.get(toolCallId);
|
|
36
|
+
if (!state) {
|
|
37
|
+
state = {};
|
|
38
|
+
renderedStates.set(toolCallId, state);
|
|
39
|
+
}
|
|
40
|
+
return state;
|
|
41
|
+
};
|
|
42
|
+
const createRenderContext = (toolCallId, lastComponent, expanded, isPartial, isError) => {
|
|
43
|
+
return {
|
|
44
|
+
args: renderedArgs.get(toolCallId),
|
|
45
|
+
toolCallId,
|
|
46
|
+
invalidate: () => { },
|
|
47
|
+
lastComponent,
|
|
48
|
+
state: getState(toolCallId),
|
|
49
|
+
cwd,
|
|
50
|
+
executionStarted: true,
|
|
51
|
+
argsComplete: true,
|
|
52
|
+
isPartial,
|
|
53
|
+
expanded,
|
|
54
|
+
showImages: false,
|
|
55
|
+
isError,
|
|
56
|
+
durationMs: undefined,
|
|
57
|
+
outputPad: 1,
|
|
58
|
+
keyText,
|
|
59
|
+
keyHint,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
renderCall(toolCallId, toolName, args) {
|
|
64
|
+
try {
|
|
65
|
+
renderedArgs.set(toolCallId, args);
|
|
66
|
+
const toolDef = getToolRenderers(toolName);
|
|
67
|
+
if (!toolDef?.renderCall) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const component = toolDef.renderCall(args, theme, createRenderContext(toolCallId, renderedCallComponents.get(toolCallId), false, true, false));
|
|
71
|
+
renderedCallComponents.set(toolCallId, component);
|
|
72
|
+
const lines = component.render(width);
|
|
73
|
+
return ansiLinesToHtml(lines);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// On error, return undefined so HTML export can fall back to structured result rendering
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
renderResult(toolCallId, toolName, result, details, isError) {
|
|
81
|
+
try {
|
|
82
|
+
const toolDef = getToolRenderers(toolName);
|
|
83
|
+
if (!toolDef?.renderResult) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
// Build AgentToolResult from content array
|
|
87
|
+
// Cast content since session storage uses generic object types
|
|
88
|
+
const agentToolResult = {
|
|
89
|
+
content: result,
|
|
90
|
+
details,
|
|
91
|
+
isError,
|
|
92
|
+
};
|
|
93
|
+
// Render collapsed
|
|
94
|
+
const collapsedComponent = toolDef.renderResult(agentToolResult, { expanded: false, isPartial: false }, theme, createRenderContext(toolCallId, renderedResultComponents.get(toolCallId), false, false, isError));
|
|
95
|
+
renderedResultComponents.set(toolCallId, collapsedComponent);
|
|
96
|
+
const collapsed = ansiLinesToHtml(trimRenderedResultLines(collapsedComponent.render(width)));
|
|
97
|
+
// Render expanded
|
|
98
|
+
const expandedComponent = toolDef.renderResult(agentToolResult, { expanded: true, isPartial: false }, theme, createRenderContext(toolCallId, renderedResultComponents.get(toolCallId), true, false, isError));
|
|
99
|
+
renderedResultComponents.set(toolCallId, expandedComponent);
|
|
100
|
+
const expanded = ansiLinesToHtml(trimRenderedResultLines(expandedComponent.render(width)));
|
|
101
|
+
return {
|
|
102
|
+
...(collapsed && collapsed !== expanded ? { collapsed } : {}),
|
|
103
|
+
expanded,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// On error, return undefined so HTML export can fall back to structured result rendering
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=tool-renderer.js.map
|