@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,124 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
import { isBuiltin } from "node:module";
|
|
6
|
+
import { createJiti } from "./jiti.mjs";
|
|
7
|
+
|
|
8
|
+
let jiti;
|
|
9
|
+
|
|
10
|
+
// https://nodejs.org/api/module.html#initialize
|
|
11
|
+
export async function initialize() {
|
|
12
|
+
jiti = createJiti();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// https://nodejs.org/api/module.html#resolvespecifier-context-nextresolve
|
|
16
|
+
export async function resolve(specifier, context, nextResolve) {
|
|
17
|
+
if (_shouldSkip(specifier)) {
|
|
18
|
+
return nextResolve(specifier, context);
|
|
19
|
+
}
|
|
20
|
+
const resolvedPath = jiti.esmResolve(specifier, {
|
|
21
|
+
parentURL: context?.parentURL,
|
|
22
|
+
conditions: context?.conditions,
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
url: resolvedPath,
|
|
26
|
+
shortCircuit: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// https://nodejs.org/api/module.html#loadurl-context-nextload
|
|
31
|
+
export async function load(url, context, nextLoad) {
|
|
32
|
+
if (_shouldSkip(url)) {
|
|
33
|
+
return nextLoad(url, context);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const filename = fileURLToPath(url);
|
|
37
|
+
|
|
38
|
+
if (url.endsWith(".js")) {
|
|
39
|
+
const pkg = await _findClosestPackageJson(dirname(filename));
|
|
40
|
+
if (pkg && pkg.type === "module") {
|
|
41
|
+
return nextLoad(url, context);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const rawSource = await readFile(filename, "utf8");
|
|
46
|
+
|
|
47
|
+
if (url.endsWith(".json")) {
|
|
48
|
+
const pkg = await _findClosestPackageJson(dirname(filename));
|
|
49
|
+
return pkg && pkg.type === "module"
|
|
50
|
+
? {
|
|
51
|
+
source: `export default ${rawSource}`,
|
|
52
|
+
format: "module",
|
|
53
|
+
shortCircuit: true,
|
|
54
|
+
}
|
|
55
|
+
: {
|
|
56
|
+
source: `module.exports = ${rawSource}`,
|
|
57
|
+
format: "commonjs",
|
|
58
|
+
shortCircuit: true,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const transpiledSource = jiti.transform({
|
|
63
|
+
source: rawSource,
|
|
64
|
+
filename: filename,
|
|
65
|
+
ts: url.endsWith("ts"),
|
|
66
|
+
retainLines: true,
|
|
67
|
+
async: true,
|
|
68
|
+
jsx: jiti.options.jsx,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (url.endsWith(".js") && !transpiledSource.includes("jitiImport")) {
|
|
72
|
+
return {
|
|
73
|
+
source: transpiledSource,
|
|
74
|
+
format: "commonjs",
|
|
75
|
+
shortCircuit: true,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
source: _wrapSource(transpiledSource, filename),
|
|
81
|
+
format: "module",
|
|
82
|
+
shortCircuit: true,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function _wrapSource(source, filename) {
|
|
87
|
+
const _jitiPath = new URL("jiti.mjs", import.meta.url).href;
|
|
88
|
+
return /*js*/ `import { createJiti as __createJiti__ } from ${JSON.stringify(_jitiPath)};async function _module(exports, require, module, __filename, __dirname, jitiImport) { ${source}\n};
|
|
89
|
+
// GENERATED BY JITI ESM LOADER
|
|
90
|
+
const filename = ${JSON.stringify(filename)};
|
|
91
|
+
const dirname = ${JSON.stringify(dirname(filename))};
|
|
92
|
+
const jiti = __createJiti__(filename);
|
|
93
|
+
const module = { exports: Object.create(null) };
|
|
94
|
+
await _module(module.exports, jiti, module, filename, dirname, jiti.import);
|
|
95
|
+
if (module.exports && module.exports.__JITI_ERROR__) {
|
|
96
|
+
const { filename, line, column, code, message } =
|
|
97
|
+
module.exports.__JITI_ERROR__;
|
|
98
|
+
const loc = [filename, line, column].join(':');
|
|
99
|
+
const err = new Error(code + ": " + message + " " + loc);
|
|
100
|
+
Error.captureStackTrace(err, _module);
|
|
101
|
+
throw err;
|
|
102
|
+
}
|
|
103
|
+
export default module.exports;
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function _shouldSkip(url) {
|
|
108
|
+
return (
|
|
109
|
+
!jiti ||
|
|
110
|
+
url.endsWith(".mjs") ||
|
|
111
|
+
url.endsWith(".cjs") ||
|
|
112
|
+
(!url.startsWith("./") && !url.startsWith("file://")) ||
|
|
113
|
+
isBuiltin(url)
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async function _findClosestPackageJson(dir) {
|
|
118
|
+
if (dir === "/") return null;
|
|
119
|
+
const packageJsonPath = join(dir, "package.json");
|
|
120
|
+
if (existsSync(packageJsonPath)) {
|
|
121
|
+
return JSON.parse(await readFile(packageJsonPath, "utf8"));
|
|
122
|
+
}
|
|
123
|
+
return _findClosestPackageJson(dirname(dir));
|
|
124
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./types').Jiti} Jiti
|
|
3
|
+
* @typedef {import('./types').JitiOptions} JitiOptions
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const isDeno = "Deno" in globalThis;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {string|URL} [parentURL]
|
|
10
|
+
* @param {JitiOptions} [jitiOptions]
|
|
11
|
+
* @returns {Jiti}
|
|
12
|
+
*/
|
|
13
|
+
export function createJiti(parentURL, jitiOptions) {
|
|
14
|
+
parentURL = normalizeParentURL(parentURL);
|
|
15
|
+
|
|
16
|
+
/** @type {Jiti} */
|
|
17
|
+
function jiti() {
|
|
18
|
+
throw unsupportedError(
|
|
19
|
+
"`jiti()` is not supported in native mode, use `jiti.import()` instead.",
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
jiti.resolve = () => {
|
|
24
|
+
throw unsupportedError("`jiti.resolve()` is not supported in native mode.");
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
jiti.esmResolve = (id, opts) => {
|
|
28
|
+
try {
|
|
29
|
+
const importMeta = jitiOptions?.importMeta || import.meta;
|
|
30
|
+
if (isDeno) {
|
|
31
|
+
// Deno throws TypeError: Invalid arguments when passing parentURL
|
|
32
|
+
return importMeta.resolve(id);
|
|
33
|
+
}
|
|
34
|
+
const parent = normalizeParentURL(opts?.parentURL || parentURL);
|
|
35
|
+
return importMeta.resolve(id, parent);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
if (opts?.try) {
|
|
38
|
+
return undefined;
|
|
39
|
+
} else {
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
jiti.import = async function (id, opts) {
|
|
46
|
+
for (const suffix of ["", "/index"]) {
|
|
47
|
+
// prettier-ignore
|
|
48
|
+
for (const ext of ["", ".js", ".mjs", ".cjs", ".ts", ".tsx", ".mts", ".cts"]) {
|
|
49
|
+
try {
|
|
50
|
+
const resolved = this.esmResolve(id + suffix + ext, opts);
|
|
51
|
+
if (!resolved) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
let importAttrs = undefined
|
|
55
|
+
if (resolved.endsWith('.json')) {
|
|
56
|
+
importAttrs = { with: { type: 'json'}}
|
|
57
|
+
}
|
|
58
|
+
return await import(resolved, importAttrs);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
if (error.code === 'ERR_MODULE_NOT_FOUND' || error.code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
|
|
61
|
+
continue
|
|
62
|
+
}
|
|
63
|
+
if (opts?.try) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (!opts?.try) {
|
|
71
|
+
const parent = normalizeParentURL(opts?.parentURL || parentURL);
|
|
72
|
+
const error = new Error(
|
|
73
|
+
`[jiti] [ERR_MODULE_NOT_FOUND] Cannot import '${id}' from '${parent}'.`,
|
|
74
|
+
);
|
|
75
|
+
error.code = "ERR_MODULE_NOT_FOUND";
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
jiti.transform = () => {
|
|
81
|
+
throw unsupportedError(
|
|
82
|
+
"`jiti.transform()` is not supported in native mode.",
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
jiti.evalModule = () => {
|
|
87
|
+
throw unsupportedError(
|
|
88
|
+
"`jiti.evalModule()` is not supported in native mode.",
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
jiti.main = undefined;
|
|
93
|
+
jiti.extensions = Object.create(null);
|
|
94
|
+
jiti.cache = Object.create(null);
|
|
95
|
+
|
|
96
|
+
return jiti;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default createJiti;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @param {string} message
|
|
103
|
+
*/
|
|
104
|
+
function unsupportedError(message) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`[jiti] ${message} (import or require 'jiti' instead of 'jiti/native' for more features).`,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function normalizeParentURL(input) {
|
|
111
|
+
if (!input) {
|
|
112
|
+
return "file:///";
|
|
113
|
+
}
|
|
114
|
+
if (typeof filename !== "string" || input.startsWith("file://")) {
|
|
115
|
+
return input;
|
|
116
|
+
}
|
|
117
|
+
if (input.endsWith("/")) {
|
|
118
|
+
input += "_"; // append a dummy filename
|
|
119
|
+
}
|
|
120
|
+
return `file://${input}`;
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// eslint-disable-next-line unicorn/no-empty-file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import _createJiti from "../dist/jiti.cjs";
|
|
3
|
+
// Static import so Bun bundles babel.cjs into compiled binaries
|
|
4
|
+
import _babelTransform from "../dist/babel.cjs";
|
|
5
|
+
|
|
6
|
+
function onError(err) {
|
|
7
|
+
throw err; /* ↓ Check stack trace ↓ */
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const nativeImport = (id) => import(id);
|
|
11
|
+
|
|
12
|
+
export function createJiti(id, opts = {}) {
|
|
13
|
+
if (!opts.transform) {
|
|
14
|
+
opts = { ...opts, transform: _babelTransform };
|
|
15
|
+
}
|
|
16
|
+
return _createJiti(id, opts, {
|
|
17
|
+
onError,
|
|
18
|
+
nativeImport,
|
|
19
|
+
createRequire,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default createJiti;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const { createRequire } = require("node:module");
|
|
2
|
+
const _createJiti = require("../dist/jiti.cjs");
|
|
3
|
+
|
|
4
|
+
function onError(err) {
|
|
5
|
+
throw err; /* ↓ Check stack trace ↓ */
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const nativeImport = (id) => import(id);
|
|
9
|
+
|
|
10
|
+
let _transform;
|
|
11
|
+
function lazyTransform(...args) {
|
|
12
|
+
if (!_transform) {
|
|
13
|
+
_transform = require("../dist/babel.cjs");
|
|
14
|
+
}
|
|
15
|
+
return _transform(...args);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function createJiti(id, opts = {}) {
|
|
19
|
+
if (!opts.transform) {
|
|
20
|
+
opts = { ...opts, transform: lazyTransform };
|
|
21
|
+
}
|
|
22
|
+
return _createJiti(id, opts, {
|
|
23
|
+
onError,
|
|
24
|
+
nativeImport,
|
|
25
|
+
createRequire,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = createJiti;
|
|
30
|
+
module.exports.createJiti = createJiti;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as types from "./types.js";
|
|
2
|
+
declare const allExports: typeof types & {
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Please use `const { createJiti } = require("jiti")` or use ESM import.
|
|
5
|
+
*/
|
|
6
|
+
(...args: Parameters<typeof types.createJiti>): types.Jiti;
|
|
7
|
+
};
|
|
8
|
+
export = allExports;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import _createJiti from "../dist/jiti.cjs";
|
|
3
|
+
|
|
4
|
+
function onError(err) {
|
|
5
|
+
throw err; /* ↓ Check stack trace ↓ */
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const nativeImport = (id) => import(id);
|
|
9
|
+
|
|
10
|
+
let _transform;
|
|
11
|
+
function lazyTransform(...args) {
|
|
12
|
+
if (!_transform) {
|
|
13
|
+
_transform = createRequire(import.meta.url)("../dist/babel.cjs");
|
|
14
|
+
}
|
|
15
|
+
return _transform(...args);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function createJiti(id, opts = {}) {
|
|
19
|
+
if (!opts.transform) {
|
|
20
|
+
opts = { ...opts, transform: lazyTransform };
|
|
21
|
+
}
|
|
22
|
+
return _createJiti(id, opts, {
|
|
23
|
+
onError,
|
|
24
|
+
nativeImport,
|
|
25
|
+
createRequire,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default createJiti;
|