@oh-my-pi-zen/pi-coding-agent 16.3.6-zen.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13088 -0
- package/README.md +35 -0
- package/dist/cli.js +22542 -0
- package/dist/types/advisor/__tests__/advisor.test.d.ts +1 -0
- package/dist/types/advisor/__tests__/config.test.d.ts +1 -0
- package/dist/types/advisor/__tests__/emission-guard.test.d.ts +1 -0
- package/dist/types/advisor/advise-tool.d.ts +106 -0
- package/dist/types/advisor/config.d.ts +90 -0
- package/dist/types/advisor/emission-guard.d.ts +73 -0
- package/dist/types/advisor/index.d.ts +6 -0
- package/dist/types/advisor/runtime.d.ts +76 -0
- package/dist/types/advisor/transcript-recorder.d.ts +63 -0
- package/dist/types/advisor/watchdog.d.ts +38 -0
- package/dist/types/async/index.d.ts +1 -0
- package/dist/types/async/job-manager.d.ts +121 -0
- package/dist/types/auto-thinking/classifier.d.ts +37 -0
- package/dist/types/autolearn/controller.d.ts +25 -0
- package/dist/types/autolearn/managed-skills.d.ts +45 -0
- package/dist/types/autoresearch/dashboard.d.ts +4 -0
- package/dist/types/autoresearch/git.d.ts +36 -0
- package/dist/types/autoresearch/helpers.d.ts +24 -0
- package/dist/types/autoresearch/index.d.ts +2 -0
- package/dist/types/autoresearch/state.d.ts +17 -0
- package/dist/types/autoresearch/storage.d.ts +142 -0
- package/dist/types/autoresearch/tools/init-experiment.d.ts +27 -0
- package/dist/types/autoresearch/tools/log-experiment.d.ts +21 -0
- package/dist/types/autoresearch/tools/run-experiment.d.ts +7 -0
- package/dist/types/autoresearch/tools/update-notes.d.ts +11 -0
- package/dist/types/autoresearch/types.d.ts +154 -0
- package/dist/types/capability/context-file.d.ts +17 -0
- package/dist/types/capability/extension-module.d.ts +15 -0
- package/dist/types/capability/extension.d.ts +28 -0
- package/dist/types/capability/fs.d.ts +20 -0
- package/dist/types/capability/hook.d.ts +19 -0
- package/dist/types/capability/index.d.ts +80 -0
- package/dist/types/capability/instruction.d.ts +17 -0
- package/dist/types/capability/mcp.d.ts +47 -0
- package/dist/types/capability/prompt.d.ts +15 -0
- package/dist/types/capability/rule-buckets.d.ts +30 -0
- package/dist/types/capability/rule.d.ts +73 -0
- package/dist/types/capability/settings.d.ts +15 -0
- package/dist/types/capability/skill.d.ts +43 -0
- package/dist/types/capability/slash-command.d.ts +17 -0
- package/dist/types/capability/ssh.d.ts +23 -0
- package/dist/types/capability/system-prompt.d.ts +15 -0
- package/dist/types/capability/tool.d.ts +19 -0
- package/dist/types/capability/types.d.ts +154 -0
- package/dist/types/cli/agents-cli.d.ts +12 -0
- package/dist/types/cli/args.d.ts +77 -0
- package/dist/types/cli/auth-broker-cli.d.ts +25 -0
- package/dist/types/cli/auth-gateway-cli.d.ts +26 -0
- package/dist/types/cli/bench-cli.d.ts +85 -0
- package/dist/types/cli/classify-install-target.d.ts +12 -0
- package/dist/types/cli/claude-trace-cli.d.ts +54 -0
- package/dist/types/cli/commands/init-xdg.d.ts +1 -0
- package/dist/types/cli/completion-gen.d.ts +80 -0
- package/dist/types/cli/config-cli.d.ts +22 -0
- package/dist/types/cli/dry-balance-cli.d.ts +113 -0
- package/dist/types/cli/extension-flags.d.ts +36 -0
- package/dist/types/cli/file-processor.d.ts +11 -0
- package/dist/types/cli/flag-tables.d.ts +144 -0
- package/dist/types/cli/gallery-cli.d.ts +49 -0
- package/dist/types/cli/gallery-fixtures/agentic.d.ts +2 -0
- package/dist/types/cli/gallery-fixtures/codeintel.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/edit.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/fs.d.ts +2 -0
- package/dist/types/cli/gallery-fixtures/index.d.ts +4 -0
- package/dist/types/cli/gallery-fixtures/interaction.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/memory.d.ts +2 -0
- package/dist/types/cli/gallery-fixtures/misc.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/search.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/shell.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/types.d.ts +55 -0
- package/dist/types/cli/gallery-fixtures/web.d.ts +2 -0
- package/dist/types/cli/gallery-screenshot.d.ts +35 -0
- package/dist/types/cli/gc-cli.d.ts +58 -0
- package/dist/types/cli/grep-cli.d.ts +17 -0
- package/dist/types/cli/grievances-cli.d.ts +37 -0
- package/dist/types/cli/initial-message.d.ts +17 -0
- package/dist/types/cli/models-cli.d.ts +49 -0
- package/dist/types/cli/plugin-cli.d.ts +32 -0
- package/dist/types/cli/profile-alias.d.ts +29 -0
- package/dist/types/cli/profile-bootstrap.d.ts +55 -0
- package/dist/types/cli/read-cli.d.ts +4 -0
- package/dist/types/cli/session-picker.d.ts +11 -0
- package/dist/types/cli/setup-cli.d.ts +24 -0
- package/dist/types/cli/setup-model-picker.d.ts +14 -0
- package/dist/types/cli/shell-cli.d.ts +8 -0
- package/dist/types/cli/ssh-cli.d.ts +21 -0
- package/dist/types/cli/startup-cwd.d.ts +2 -0
- package/dist/types/cli/stats-cli.d.ts +17 -0
- package/dist/types/cli/tiny-models-cli.d.ts +11 -0
- package/dist/types/cli/ttsr-cli.d.ts +39 -0
- package/dist/types/cli/update-cli.d.ts +106 -0
- package/dist/types/cli/update-cli.test.d.ts +1 -0
- package/dist/types/cli/usage-cli.d.ts +95 -0
- package/dist/types/cli/web-search-cli.d.ts +20 -0
- package/dist/types/cli/worktree-cli.d.ts +26 -0
- package/dist/types/cli-commands.d.ts +33 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/collab/crypto.d.ts +7 -0
- package/dist/types/collab/display-name.d.ts +3 -0
- package/dist/types/collab/guest.d.ts +52 -0
- package/dist/types/collab/host.d.ts +43 -0
- package/dist/types/collab/protocol.d.ts +143 -0
- package/dist/types/collab/relay-client.d.ts +22 -0
- package/dist/types/collab/replication-shrink.d.ts +39 -0
- package/dist/types/commands/acp.d.ts +12 -0
- package/dist/types/commands/agents.d.ts +34 -0
- package/dist/types/commands/auth-broker.d.ts +54 -0
- package/dist/types/commands/auth-gateway.d.ts +35 -0
- package/dist/types/commands/bench.d.ts +37 -0
- package/dist/types/commands/commit.d.ts +27 -0
- package/dist/types/commands/complete.d.ts +6 -0
- package/dist/types/commands/completions.d.ts +13 -0
- package/dist/types/commands/config.d.ts +30 -0
- package/dist/types/commands/dry-balance.d.ts +31 -0
- package/dist/types/commands/gallery.d.ts +47 -0
- package/dist/types/commands/gc.d.ts +37 -0
- package/dist/types/commands/grep.d.ts +42 -0
- package/dist/types/commands/grievances.d.ts +40 -0
- package/dist/types/commands/install.d.ts +51 -0
- package/dist/types/commands/join.d.ts +12 -0
- package/dist/types/commands/launch.d.ts +148 -0
- package/dist/types/commands/models.d.ts +33 -0
- package/dist/types/commands/plugin.d.ts +52 -0
- package/dist/types/commands/read.d.ts +15 -0
- package/dist/types/commands/say.d.ts +24 -0
- package/dist/types/commands/setup.d.ts +34 -0
- package/dist/types/commands/shell.d.ts +21 -0
- package/dist/types/commands/ssh.d.ts +48 -0
- package/dist/types/commands/stats.d.ts +25 -0
- package/dist/types/commands/tiny-models.d.ts +22 -0
- package/dist/types/commands/token.d.ts +34 -0
- package/dist/types/commands/ttsr.d.ts +57 -0
- package/dist/types/commands/update.d.ts +25 -0
- package/dist/types/commands/usage.d.ts +34 -0
- package/dist/types/commands/web-search.d.ts +33 -0
- package/dist/types/commands/worktree.d.ts +31 -0
- package/dist/types/commit/agentic/agent.d.ts +31 -0
- package/dist/types/commit/agentic/fallback.d.ts +5 -0
- package/dist/types/commit/agentic/index.d.ts +2 -0
- package/dist/types/commit/agentic/state.d.ts +58 -0
- package/dist/types/commit/agentic/tools/analyze-file.d.ts +18 -0
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +9 -0
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +8 -0
- package/dist/types/commit/agentic/tools/git-overview.d.ts +8 -0
- package/dist/types/commit/agentic/tools/index.d.ts +16 -0
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +27 -0
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +15 -0
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +6 -0
- package/dist/types/commit/agentic/tools/schemas.d.ts +6 -0
- package/dist/types/commit/agentic/tools/split-commit.d.ts +32 -0
- package/dist/types/commit/agentic/topo-sort.d.ts +4 -0
- package/dist/types/commit/agentic/trivial.d.ts +7 -0
- package/dist/types/commit/agentic/validation.d.ts +20 -0
- package/dist/types/commit/analysis/conventional.d.ts +22 -0
- package/dist/types/commit/analysis/index.d.ts +4 -0
- package/dist/types/commit/analysis/scope.d.ts +6 -0
- package/dist/types/commit/analysis/summary.d.ts +19 -0
- package/dist/types/commit/analysis/validation.d.ts +8 -0
- package/dist/types/commit/changelog/detect.d.ts +2 -0
- package/dist/types/commit/changelog/generate.d.ts +29 -0
- package/dist/types/commit/changelog/index.d.ts +30 -0
- package/dist/types/commit/changelog/parse.d.ts +2 -0
- package/dist/types/commit/cli.d.ts +3 -0
- package/dist/types/commit/git/diff.d.ts +5 -0
- package/dist/types/commit/index.d.ts +4 -0
- package/dist/types/commit/map-reduce/index.d.ts +28 -0
- package/dist/types/commit/map-reduce/map-phase.d.ts +17 -0
- package/dist/types/commit/map-reduce/reduce-phase.d.ts +13 -0
- package/dist/types/commit/map-reduce/utils.d.ts +2 -0
- package/dist/types/commit/message.d.ts +2 -0
- package/dist/types/commit/model-selection.d.ts +26 -0
- package/dist/types/commit/pipeline.d.ts +5 -0
- package/dist/types/commit/shared-llm.d.ts +27 -0
- package/dist/types/commit/types.d.ts +78 -0
- package/dist/types/commit/utils/exclusions.d.ts +4 -0
- package/dist/types/commit/utils.d.ts +20 -0
- package/dist/types/config/api-key-resolver.d.ts +43 -0
- package/dist/types/config/append-only-context-mode.d.ts +9 -0
- package/dist/types/config/config-file.d.ts +62 -0
- package/dist/types/config/file-lock.d.ts +29 -0
- package/dist/types/config/inline-tool-descriptors-mode.d.ts +12 -0
- package/dist/types/config/keybindings.d.ts +362 -0
- package/dist/types/config/model-discovery.d.ts +68 -0
- package/dist/types/config/model-registry.d.ts +251 -0
- package/dist/types/config/model-resolver.d.ts +300 -0
- package/dist/types/config/model-roles.d.ts +29 -0
- package/dist/types/config/models-config-schema.d.ts +697 -0
- package/dist/types/config/models-config.d.ts +436 -0
- package/dist/types/config/prompt-templates.d.ts +32 -0
- package/dist/types/config/provider-globals.d.ts +7 -0
- package/dist/types/config/resolve-config-value.d.ts +17 -0
- package/dist/types/config/service-tier.d.ts +49 -0
- package/dist/types/config/settings-schema.d.ts +5668 -0
- package/dist/types/config/settings.d.ts +181 -0
- package/dist/types/config.d.ts +92 -0
- package/dist/types/cursor.d.ts +22 -0
- package/dist/types/dap/client.d.ts +46 -0
- package/dist/types/dap/config.d.ts +19 -0
- package/dist/types/dap/index.d.ts +4 -0
- package/dist/types/dap/session.d.ts +108 -0
- package/dist/types/dap/types.d.ts +534 -0
- package/dist/types/debug/index.d.ts +15 -0
- package/dist/types/debug/log-formatting.d.ts +4 -0
- package/dist/types/debug/log-viewer.d.ts +69 -0
- package/dist/types/debug/profiler.d.ts +24 -0
- package/dist/types/debug/protocol-probe.d.ts +38 -0
- package/dist/types/debug/raw-sse-buffer.d.ts +44 -0
- package/dist/types/debug/raw-sse.d.ts +19 -0
- package/dist/types/debug/remote-debugger.d.ts +45 -0
- package/dist/types/debug/report-bundle.d.ts +58 -0
- package/dist/types/debug/system-info.d.ts +26 -0
- package/dist/types/debug/terminal-info.d.ts +33 -0
- package/dist/types/discovery/agents-md.d.ts +1 -0
- package/dist/types/discovery/agents.d.ts +12 -0
- package/dist/types/discovery/at-imports.d.ts +15 -0
- package/dist/types/discovery/builtin-defaults.d.ts +1 -0
- package/dist/types/discovery/builtin-rules/index.d.ts +7 -0
- package/dist/types/discovery/builtin.d.ts +1 -0
- package/dist/types/discovery/claude-plugins.d.ts +1 -0
- package/dist/types/discovery/claude.d.ts +1 -0
- package/dist/types/discovery/cline.d.ts +1 -0
- package/dist/types/discovery/codex.d.ts +1 -0
- package/dist/types/discovery/cursor.d.ts +16 -0
- package/dist/types/discovery/gemini.d.ts +1 -0
- package/dist/types/discovery/github.d.ts +1 -0
- package/dist/types/discovery/helpers.d.ts +278 -0
- package/dist/types/discovery/index.d.ts +53 -0
- package/dist/types/discovery/mcp-json.d.ts +1 -0
- package/dist/types/discovery/omp-extension-roots.d.ts +43 -0
- package/dist/types/discovery/omp-plugins.d.ts +1 -0
- package/dist/types/discovery/opencode.d.ts +1 -0
- package/dist/types/discovery/plugin-dir-roots.d.ts +15 -0
- package/dist/types/discovery/ssh.d.ts +1 -0
- package/dist/types/discovery/substitute-plugin-root.d.ts +1 -0
- package/dist/types/discovery/vscode.d.ts +1 -0
- package/dist/types/discovery/windsurf.d.ts +13 -0
- package/dist/types/edit/apply-patch/index.d.ts +35 -0
- package/dist/types/edit/apply-patch/parser.d.ts +34 -0
- package/dist/types/edit/diff.d.ts +60 -0
- package/dist/types/edit/file-snapshot-store.d.ts +74 -0
- package/dist/types/edit/hashline/block-resolver.d.ts +9 -0
- package/dist/types/edit/hashline/diff.d.ts +29 -0
- package/dist/types/edit/hashline/execute.d.ts +28 -0
- package/dist/types/edit/hashline/filesystem.d.ts +43 -0
- package/dist/types/edit/hashline/index.d.ts +5 -0
- package/dist/types/edit/hashline/noop-loop-guard.d.ts +72 -0
- package/dist/types/edit/hashline/params.d.ts +4 -0
- package/dist/types/edit/index.d.ts +83 -0
- package/dist/types/edit/modes/apply-patch.d.ts +23 -0
- package/dist/types/edit/modes/patch.d.ts +101 -0
- package/dist/types/edit/modes/replace.d.ts +141 -0
- package/dist/types/edit/normalize.d.ts +31 -0
- package/dist/types/edit/notebook.d.ts +23 -0
- package/dist/types/edit/read-file.d.ts +2 -0
- package/dist/types/edit/renderer.d.ts +118 -0
- package/dist/types/edit/snapshot-details.d.ts +33 -0
- package/dist/types/edit/streaming.d.ts +105 -0
- package/dist/types/eval/__tests__/agent-bridge.test.d.ts +1 -0
- package/dist/types/eval/__tests__/bridge-timeout.test.d.ts +1 -0
- package/dist/types/eval/__tests__/budget-bridge.test.d.ts +1 -0
- package/dist/types/eval/__tests__/completion-bridge.test.d.ts +1 -0
- package/dist/types/eval/__tests__/helpers-local-roots.test.d.ts +1 -0
- package/dist/types/eval/__tests__/idle-timeout.test.d.ts +1 -0
- package/dist/types/eval/__tests__/js-context-manager.test.d.ts +1 -0
- package/dist/types/eval/__tests__/julia-prelude.test.d.ts +1 -0
- package/dist/types/eval/__tests__/kernel-spawn.test.d.ts +1 -0
- package/dist/types/eval/__tests__/prelude-agent.test.d.ts +1 -0
- package/dist/types/eval/agent-bridge.d.ts +48 -0
- package/dist/types/eval/backend-helpers.d.ts +23 -0
- package/dist/types/eval/backend.d.ts +60 -0
- package/dist/types/eval/bridge-timeout.d.ts +27 -0
- package/dist/types/eval/budget-bridge.d.ts +29 -0
- package/dist/types/eval/completion-bridge.d.ts +25 -0
- package/dist/types/eval/concurrency-bridge.d.ts +26 -0
- package/dist/types/eval/executor-base.d.ts +118 -0
- package/dist/types/eval/idle-timeout.d.ts +26 -0
- package/dist/types/eval/index.d.ts +6 -0
- package/dist/types/eval/jl/executor.d.ts +44 -0
- package/dist/types/eval/jl/index.d.ts +11 -0
- package/dist/types/eval/jl/kernel.d.ts +28 -0
- package/dist/types/eval/jl/prelude.d.ts +1 -0
- package/dist/types/eval/jl/runtime.d.ts +22 -0
- package/dist/types/eval/js/context-manager.d.ts +40 -0
- package/dist/types/eval/js/executor.d.ts +38 -0
- package/dist/types/eval/js/index.d.ts +11 -0
- package/dist/types/eval/js/shared/helpers.d.ts +32 -0
- package/dist/types/eval/js/shared/indirect-eval.d.ts +14 -0
- package/dist/types/eval/js/shared/local-module-loader.d.ts +16 -0
- package/dist/types/eval/js/shared/prelude.d.ts +1 -0
- package/dist/types/eval/js/shared/rewrite-imports.d.ts +25 -0
- package/dist/types/eval/js/shared/runtime.d.ts +59 -0
- package/dist/types/eval/js/shared/types.d.ts +24 -0
- package/dist/types/eval/js/tool-bridge.d.ts +20 -0
- package/dist/types/eval/js/worker-core.d.ts +6 -0
- package/dist/types/eval/js/worker-entry.d.ts +1 -0
- package/dist/types/eval/js/worker-protocol.d.ts +83 -0
- package/dist/types/eval/kernel-base.d.ts +105 -0
- package/dist/types/eval/py/__tests__/prelude.test.d.ts +1 -0
- package/dist/types/eval/py/__tests__/runner-shell-output.test.d.ts +1 -0
- package/dist/types/eval/py/display.d.ts +25 -0
- package/dist/types/eval/py/executor.d.ts +107 -0
- package/dist/types/eval/py/index.d.ts +11 -0
- package/dist/types/eval/py/kernel.d.ts +17 -0
- package/dist/types/eval/py/prelude.d.ts +1 -0
- package/dist/types/eval/py/runtime.d.ts +40 -0
- package/dist/types/eval/py/spawn-options.d.ts +58 -0
- package/dist/types/eval/py/tool-bridge.d.ts +16 -0
- package/dist/types/eval/rb/executor.d.ts +77 -0
- package/dist/types/eval/rb/index.d.ts +11 -0
- package/dist/types/eval/rb/kernel.d.ts +31 -0
- package/dist/types/eval/rb/prelude.d.ts +1 -0
- package/dist/types/eval/rb/runtime.d.ts +23 -0
- package/dist/types/eval/runtime-env.d.ts +24 -0
- package/dist/types/eval/session-id.d.ts +3 -0
- package/dist/types/eval/types.d.ts +52 -0
- package/dist/types/exa/index.d.ts +2 -0
- package/dist/types/exa/mcp-client.d.ts +53 -0
- package/dist/types/exa/types.d.ts +72 -0
- package/dist/types/exec/bash-executor.d.ts +45 -0
- package/dist/types/exec/exec.d.ts +25 -0
- package/dist/types/exec/non-interactive-env.d.ts +3 -0
- package/dist/types/export/custom-share.d.ts +19 -0
- package/dist/types/export/html/index.d.ts +78 -0
- package/dist/types/export/html/web-palette.d.ts +117 -0
- package/dist/types/export/share.d.ts +55 -0
- package/dist/types/export/ttsr.d.ts +67 -0
- package/dist/types/extensibility/custom-commands/bundled/ci-green/index.d.ts +9 -0
- package/dist/types/extensibility/custom-commands/bundled/review/index.d.ts +10 -0
- package/dist/types/extensibility/custom-commands/index.d.ts +2 -0
- package/dist/types/extensibility/custom-commands/loader.d.ts +29 -0
- package/dist/types/extensibility/custom-commands/types.d.ts +112 -0
- package/dist/types/extensibility/custom-tools/index.d.ts +6 -0
- package/dist/types/extensibility/custom-tools/loader.d.ts +89 -0
- package/dist/types/extensibility/custom-tools/types.d.ts +244 -0
- package/dist/types/extensibility/custom-tools/wrapper.d.ts +23 -0
- package/dist/types/extensibility/extensions/compact-handler.d.ts +26 -0
- package/dist/types/extensibility/extensions/get-commands-handler.d.ts +29 -0
- package/dist/types/extensibility/extensions/index.d.ts +8 -0
- package/dist/types/extensibility/extensions/loader.d.ts +59 -0
- package/dist/types/extensibility/extensions/model-api.d.ts +17 -0
- package/dist/types/extensibility/extensions/runner.d.ts +161 -0
- package/dist/types/extensibility/extensions/types.d.ts +962 -0
- package/dist/types/extensibility/extensions/wrapper.d.ts +54 -0
- package/dist/types/extensibility/hooks/index.d.ts +6 -0
- package/dist/types/extensibility/hooks/loader.d.ts +65 -0
- package/dist/types/extensibility/hooks/runner.d.ts +126 -0
- package/dist/types/extensibility/hooks/tool-wrapper.d.ts +25 -0
- package/dist/types/extensibility/hooks/types.d.ts +442 -0
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +35 -0
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +115 -0
- package/dist/types/extensibility/plugins/doctor.d.ts +3 -0
- package/dist/types/extensibility/plugins/git-url.d.ts +44 -0
- package/dist/types/extensibility/plugins/index.d.ts +7 -0
- package/dist/types/extensibility/plugins/installer.d.ts +5 -0
- package/dist/types/extensibility/plugins/legacy-pi-bundled-keys.d.ts +10 -0
- package/dist/types/extensibility/plugins/legacy-pi-bundled-registry.d.ts +10 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +79 -0
- package/dist/types/extensibility/plugins/loader.d.ts +59 -0
- package/dist/types/extensibility/plugins/manager.d.ts +76 -0
- package/dist/types/extensibility/plugins/marketplace/cache.d.ts +41 -0
- package/dist/types/extensibility/plugins/marketplace/fetcher.d.ts +48 -0
- package/dist/types/extensibility/plugins/marketplace/index.d.ts +6 -0
- package/dist/types/extensibility/plugins/marketplace/manager.d.ts +57 -0
- package/dist/types/extensibility/plugins/marketplace/registry.d.ts +34 -0
- package/dist/types/extensibility/plugins/marketplace/source-resolver.d.ts +28 -0
- package/dist/types/extensibility/plugins/marketplace/types.d.ts +131 -0
- package/dist/types/extensibility/plugins/marketplace-auto-update.d.ts +8 -0
- package/dist/types/extensibility/plugins/parser.d.ts +53 -0
- package/dist/types/extensibility/plugins/runtime-config.d.ts +3 -0
- package/dist/types/extensibility/plugins/types.d.ts +149 -0
- package/dist/types/extensibility/session-handler-types.d.ts +23 -0
- package/dist/types/extensibility/shared-events.d.ts +308 -0
- package/dist/types/extensibility/skills.d.ts +97 -0
- package/dist/types/extensibility/slash-commands.d.ts +38 -0
- package/dist/types/extensibility/tool-event-input.d.ts +9 -0
- package/dist/types/extensibility/tool-proxy.d.ts +4 -0
- package/dist/types/extensibility/typebox.d.ts +177 -0
- package/dist/types/extensibility/utils.d.ts +24 -0
- package/dist/types/goals/guided-setup.d.ts +18 -0
- package/dist/types/goals/index.d.ts +3 -0
- package/dist/types/goals/runtime.d.ts +69 -0
- package/dist/types/goals/state.d.ts +35 -0
- package/dist/types/goals/tools/goal-tool.d.ts +53 -0
- package/dist/types/hindsight/backend.d.ts +13 -0
- package/dist/types/hindsight/bank.d.ts +62 -0
- package/dist/types/hindsight/client.d.ts +228 -0
- package/dist/types/hindsight/client.test.d.ts +1 -0
- package/dist/types/hindsight/config.d.ts +51 -0
- package/dist/types/hindsight/content.d.ts +73 -0
- package/dist/types/hindsight/index.d.ts +8 -0
- package/dist/types/hindsight/mental-models.d.ts +134 -0
- package/dist/types/hindsight/state.d.ts +105 -0
- package/dist/types/hindsight/transcript.d.ts +28 -0
- package/dist/types/index.d.ts +43 -0
- package/dist/types/internal-urls/__tests__/ssh-protocol.test.d.ts +1 -0
- package/dist/types/internal-urls/agent-protocol.d.ts +13 -0
- package/dist/types/internal-urls/artifact-protocol.d.ts +15 -0
- package/dist/types/internal-urls/docs-index.d.ts +19 -0
- package/dist/types/internal-urls/filesystem-resource.d.ts +9 -0
- package/dist/types/internal-urls/history-protocol.d.ts +14 -0
- package/dist/types/internal-urls/index.d.ts +25 -0
- package/dist/types/internal-urls/issue-pr-protocol.d.ts +17 -0
- package/dist/types/internal-urls/json-query.d.ts +30 -0
- package/dist/types/internal-urls/local-protocol.d.ts +79 -0
- package/dist/types/internal-urls/mcp-protocol.d.ts +12 -0
- package/dist/types/internal-urls/memory-protocol.d.ts +24 -0
- package/dist/types/internal-urls/omp-protocol.d.ts +13 -0
- package/dist/types/internal-urls/parse.d.ts +19 -0
- package/dist/types/internal-urls/registry-helpers.d.ts +12 -0
- package/dist/types/internal-urls/router.d.ts +21 -0
- package/dist/types/internal-urls/rule-protocol.d.ts +7 -0
- package/dist/types/internal-urls/skill-protocol.d.ts +14 -0
- package/dist/types/internal-urls/ssh-protocol.d.ts +10 -0
- package/dist/types/internal-urls/types.d.ts +175 -0
- package/dist/types/internal-urls/vault-protocol.d.ts +93 -0
- package/dist/types/irc/bus.d.ts +86 -0
- package/dist/types/jsonrpc/message-framing.d.ts +35 -0
- package/dist/types/lib/xai-http.d.ts +40 -0
- package/dist/types/lsp/client.d.ts +84 -0
- package/dist/types/lsp/clients/biome-client.d.ts +16 -0
- package/dist/types/lsp/clients/index.d.ts +19 -0
- package/dist/types/lsp/clients/lsp-linter-client.d.ts +16 -0
- package/dist/types/lsp/clients/swiftlint-client.d.ts +20 -0
- package/dist/types/lsp/config.d.ts +69 -0
- package/dist/types/lsp/diagnostics-ledger.d.ts +10 -0
- package/dist/types/lsp/edits.d.ts +34 -0
- package/dist/types/lsp/format-options.d.ts +32 -0
- package/dist/types/lsp/index.d.ts +120 -0
- package/dist/types/lsp/lspmux.d.ts +58 -0
- package/dist/types/lsp/render.d.ts +32 -0
- package/dist/types/lsp/startup-events.d.ts +11 -0
- package/dist/types/lsp/types.d.ts +300 -0
- package/dist/types/lsp/utils.d.ts +116 -0
- package/dist/types/main.d.ts +70 -0
- package/dist/types/markit/converters/docx.d.ts +6 -0
- package/dist/types/markit/converters/epub.d.ts +15 -0
- package/dist/types/markit/converters/pdf/columns.d.ts +35 -0
- package/dist/types/markit/converters/pdf/extract.d.ts +10 -0
- package/dist/types/markit/converters/pdf/grid.d.ts +25 -0
- package/dist/types/markit/converters/pdf/headers.d.ts +24 -0
- package/dist/types/markit/converters/pdf/index.d.ts +6 -0
- package/dist/types/markit/converters/pdf/render.d.ts +24 -0
- package/dist/types/markit/converters/pdf/types.d.ts +75 -0
- package/dist/types/markit/converters/pptx.d.ts +57 -0
- package/dist/types/markit/converters/xlsx.d.ts +25 -0
- package/dist/types/markit/index.d.ts +2 -0
- package/dist/types/markit/registry.d.ts +16 -0
- package/dist/types/markit/types.d.ts +30 -0
- package/dist/types/mcp/client.d.ts +83 -0
- package/dist/types/mcp/config-writer.d.ts +101 -0
- package/dist/types/mcp/config.d.ts +75 -0
- package/dist/types/mcp/index.d.ts +18 -0
- package/dist/types/mcp/json-rpc.d.ts +32 -0
- package/dist/types/mcp/loader.d.ts +44 -0
- package/dist/types/mcp/manager.d.ts +215 -0
- package/dist/types/mcp/oauth-credentials.d.ts +17 -0
- package/dist/types/mcp/oauth-discovery.d.ts +65 -0
- package/dist/types/mcp/oauth-flow.d.ts +145 -0
- package/dist/types/mcp/render.d.ts +25 -0
- package/dist/types/mcp/smithery-auth.d.ts +16 -0
- package/dist/types/mcp/smithery-connect.d.ts +38 -0
- package/dist/types/mcp/smithery-registry.d.ts +52 -0
- package/dist/types/mcp/smithery-registry.test.d.ts +1 -0
- package/dist/types/mcp/startup-events.d.ts +28 -0
- package/dist/types/mcp/timeout.d.ts +9 -0
- package/dist/types/mcp/tool-bridge.d.ts +95 -0
- package/dist/types/mcp/tool-cache.d.ts +8 -0
- package/dist/types/mcp/transports/http.d.ts +45 -0
- package/dist/types/mcp/transports/index.d.ts +6 -0
- package/dist/types/mcp/transports/sse.d.ts +20 -0
- package/dist/types/mcp/transports/stdio.d.ts +108 -0
- package/dist/types/mcp/transports/stdio.test.d.ts +1 -0
- package/dist/types/mcp/types.d.ts +340 -0
- package/dist/types/memories/index.d.ts +54 -0
- package/dist/types/memories/storage.d.ts +110 -0
- package/dist/types/memory-backend/index.d.ts +7 -0
- package/dist/types/memory-backend/local-backend.d.ts +10 -0
- package/dist/types/memory-backend/off-backend.d.ts +7 -0
- package/dist/types/memory-backend/resolve.d.ts +16 -0
- package/dist/types/memory-backend/runtime.d.ts +4 -0
- package/dist/types/memory-backend/types.d.ts +132 -0
- package/dist/types/mnemopi/backend.d.ts +4 -0
- package/dist/types/mnemopi/config.d.ts +60 -0
- package/dist/types/mnemopi/embed-client.d.ts +53 -0
- package/dist/types/mnemopi/embed-protocol.d.ts +52 -0
- package/dist/types/mnemopi/embed-worker.d.ts +12 -0
- package/dist/types/mnemopi/index.d.ts +3 -0
- package/dist/types/mnemopi/state.d.ts +130 -0
- package/dist/types/modes/acp/acp-agent.d.ts +60 -0
- package/dist/types/modes/acp/acp-client-bridge.d.ts +9 -0
- package/dist/types/modes/acp/acp-event-mapper.d.ts +33 -0
- package/dist/types/modes/acp/acp-mode.d.ts +5 -0
- package/dist/types/modes/acp/index.d.ts +2 -0
- package/dist/types/modes/acp/terminal-auth.d.ts +6 -0
- package/dist/types/modes/components/__tests__/move-overlay.test.d.ts +1 -0
- package/dist/types/modes/components/__tests__/skill-message.test.d.ts +1 -0
- package/dist/types/modes/components/advisor-config.d.ts +59 -0
- package/dist/types/modes/components/advisor-message.d.ts +11 -0
- package/dist/types/modes/components/agent-dashboard.d.ts +22 -0
- package/dist/types/modes/components/agent-hub.d.ts +77 -0
- package/dist/types/modes/components/agent-transcript-viewer.d.ts +40 -0
- package/dist/types/modes/components/assistant-message.d.ts +58 -0
- package/dist/types/modes/components/background-tan-message.d.ts +9 -0
- package/dist/types/modes/components/bash-execution.d.ts +35 -0
- package/dist/types/modes/components/bordered-loader.d.ts +11 -0
- package/dist/types/modes/components/btw-panel.d.ts +19 -0
- package/dist/types/modes/components/cache-invalidation-marker.d.ts +52 -0
- package/dist/types/modes/components/chat-block.d.ts +64 -0
- package/dist/types/modes/components/chat-transcript-builder.d.ts +45 -0
- package/dist/types/modes/components/collab-prompt-message.d.ts +10 -0
- package/dist/types/modes/components/compaction-summary-message.d.ts +46 -0
- package/dist/types/modes/components/copy-selector.d.ts +22 -0
- package/dist/types/modes/components/countdown-timer.d.ts +14 -0
- package/dist/types/modes/components/custom-editor.d.ts +163 -0
- package/dist/types/modes/components/custom-editor.test.d.ts +1 -0
- package/dist/types/modes/components/custom-message.d.ts +15 -0
- package/dist/types/modes/components/diff.d.ts +11 -0
- package/dist/types/modes/components/dynamic-border.d.ts +14 -0
- package/dist/types/modes/components/error-banner.d.ts +11 -0
- package/dist/types/modes/components/eval-execution.d.ts +29 -0
- package/dist/types/modes/components/execution-shared.d.ts +46 -0
- package/dist/types/modes/components/extensions/extension-dashboard.d.ts +43 -0
- package/dist/types/modes/components/extensions/extension-list.d.ts +52 -0
- package/dist/types/modes/components/extensions/index.d.ts +8 -0
- package/dist/types/modes/components/extensions/inspector-panel.d.ts +8 -0
- package/dist/types/modes/components/extensions/state-manager.d.ts +50 -0
- package/dist/types/modes/components/extensions/types.d.ts +147 -0
- package/dist/types/modes/components/footer.d.ts +30 -0
- package/dist/types/modes/components/history-search.d.ts +7 -0
- package/dist/types/modes/components/hook-editor.d.ts +24 -0
- package/dist/types/modes/components/hook-input.d.ts +19 -0
- package/dist/types/modes/components/hook-message.d.ts +15 -0
- package/dist/types/modes/components/hook-selector.d.ts +68 -0
- package/dist/types/modes/components/index.d.ts +38 -0
- package/dist/types/modes/components/keybinding-hints.d.ts +40 -0
- package/dist/types/modes/components/late-diagnostics-message.d.ts +20 -0
- package/dist/types/modes/components/login-dialog.d.ts +40 -0
- package/dist/types/modes/components/logout-account-selector.d.ts +8 -0
- package/dist/types/modes/components/mcp-add-wizard.d.ts +38 -0
- package/dist/types/modes/components/message-frame.d.ts +44 -0
- package/dist/types/modes/components/model-selector.d.ts +36 -0
- package/dist/types/modes/components/move-overlay.d.ts +23 -0
- package/dist/types/modes/components/oauth-selector.d.ts +23 -0
- package/dist/types/modes/components/omfg-panel.d.ts +19 -0
- package/dist/types/modes/components/overlay-box.d.ts +17 -0
- package/dist/types/modes/components/plan-review-overlay.d.ts +61 -0
- package/dist/types/modes/components/plan-toc.d.ts +41 -0
- package/dist/types/modes/components/plugin-selector.d.ts +27 -0
- package/dist/types/modes/components/plugin-settings.d.ts +103 -0
- package/dist/types/modes/components/queue-mode-selector.d.ts +10 -0
- package/dist/types/modes/components/read-tool-group.d.ts +38 -0
- package/dist/types/modes/components/reset-usage-selector.d.ts +12 -0
- package/dist/types/modes/components/segment-track.d.ts +27 -0
- package/dist/types/modes/components/select-list-mouse-routing.d.ts +2 -0
- package/dist/types/modes/components/selector-helpers.d.ts +53 -0
- package/dist/types/modes/components/session-selector.d.ts +94 -0
- package/dist/types/modes/components/settings-defs.d.ts +60 -0
- package/dist/types/modes/components/settings-selector.d.ts +70 -0
- package/dist/types/modes/components/show-images-selector.d.ts +10 -0
- package/dist/types/modes/components/skill-message.d.ts +9 -0
- package/dist/types/modes/components/snapcompact-shape-preview.d.ts +31 -0
- package/dist/types/modes/components/status-line/component.d.ts +94 -0
- package/dist/types/modes/components/status-line/component.test.d.ts +1 -0
- package/dist/types/modes/components/status-line/context-thresholds.d.ts +10 -0
- package/dist/types/modes/components/status-line/git-utils.d.ts +22 -0
- package/dist/types/modes/components/status-line/index.d.ts +5 -0
- package/dist/types/modes/components/status-line/presets.d.ts +3 -0
- package/dist/types/modes/components/status-line/segments.d.ts +5 -0
- package/dist/types/modes/components/status-line/separators.d.ts +3 -0
- package/dist/types/modes/components/status-line/token-rate.d.ts +10 -0
- package/dist/types/modes/components/status-line/types.d.ts +150 -0
- package/dist/types/modes/components/theme-selector.d.ts +11 -0
- package/dist/types/modes/components/thinking-selector.d.ts +11 -0
- package/dist/types/modes/components/tiny-title-download-progress.d.ts +11 -0
- package/dist/types/modes/components/todo-reminder.d.ts +15 -0
- package/dist/types/modes/components/tool-execution.d.ts +117 -0
- package/dist/types/modes/components/transcript-container.d.ts +86 -0
- package/dist/types/modes/components/tree-selector.d.ts +31 -0
- package/dist/types/modes/components/ttsr-notification.d.ts +17 -0
- package/dist/types/modes/components/usage-row.d.ts +3 -0
- package/dist/types/modes/components/user-message-selector.d.ts +28 -0
- package/dist/types/modes/components/user-message.d.ts +9 -0
- package/dist/types/modes/components/visual-truncate.d.ts +19 -0
- package/dist/types/modes/components/welcome.d.ts +66 -0
- package/dist/types/modes/controllers/btw-controller.d.ts +14 -0
- package/dist/types/modes/controllers/command-controller-shared.d.ts +47 -0
- package/dist/types/modes/controllers/command-controller.d.ts +55 -0
- package/dist/types/modes/controllers/event-controller.d.ts +28 -0
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +88 -0
- package/dist/types/modes/controllers/input-controller.d.ts +71 -0
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +44 -0
- package/dist/types/modes/controllers/omfg-controller.d.ts +10 -0
- package/dist/types/modes/controllers/omfg-rule.d.ts +26 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +61 -0
- package/dist/types/modes/controllers/session-focus-controller.d.ts +31 -0
- package/dist/types/modes/controllers/ssh-command-controller.d.ts +10 -0
- package/dist/types/modes/controllers/streaming-reveal.d.ts +45 -0
- package/dist/types/modes/controllers/tan-command-controller.d.ts +6 -0
- package/dist/types/modes/controllers/todo-command-controller.d.ts +7 -0
- package/dist/types/modes/controllers/tool-args-reveal.d.ts +77 -0
- package/dist/types/modes/emoji-autocomplete.d.ts +16 -0
- package/dist/types/modes/gradient-highlight.d.ts +32 -0
- package/dist/types/modes/image-references.d.ts +28 -0
- package/dist/types/modes/index.d.ts +10 -0
- package/dist/types/modes/interactive-mode.d.ts +401 -0
- package/dist/types/modes/internal-url-autocomplete.d.ts +43 -0
- package/dist/types/modes/loop-limit.d.ts +35 -0
- package/dist/types/modes/magic-keywords.d.ts +26 -0
- package/dist/types/modes/markdown-prose.d.ts +27 -0
- package/dist/types/modes/oauth-manual-input.d.ts +15 -0
- package/dist/types/modes/orchestrate.d.ts +15 -0
- package/dist/types/modes/print-mode.d.ts +29 -0
- package/dist/types/modes/prompt-action-autocomplete.d.ts +46 -0
- package/dist/types/modes/rpc/host-tools.d.ts +16 -0
- package/dist/types/modes/rpc/host-uris.d.ts +38 -0
- package/dist/types/modes/rpc/rpc-client.d.ts +304 -0
- package/dist/types/modes/rpc/rpc-mode.d.ts +145 -0
- package/dist/types/modes/rpc/rpc-subagents.d.ts +24 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +705 -0
- package/dist/types/modes/running-subagent-badge.d.ts +6 -0
- package/dist/types/modes/runtime-init.d.ts +25 -0
- package/dist/types/modes/session-observer-registry.d.ts +35 -0
- package/dist/types/modes/session-teardown.d.ts +63 -0
- package/dist/types/modes/session-teardown.test.d.ts +1 -0
- package/dist/types/modes/setup-version.d.ts +11 -0
- package/dist/types/modes/setup-wizard/index.d.ts +22 -0
- package/dist/types/modes/setup-wizard/lazy.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/glyph.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/outro.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/providers.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/sign-in.d.ts +22 -0
- package/dist/types/modes/setup-wizard/scenes/splash.d.ts +11 -0
- package/dist/types/modes/setup-wizard/scenes/theme.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/types.d.ts +52 -0
- package/dist/types/modes/setup-wizard/scenes/web-search.d.ts +23 -0
- package/dist/types/modes/setup-wizard/startup-splash.d.ts +7 -0
- package/dist/types/modes/setup-wizard/wizard-overlay.d.ts +15 -0
- package/dist/types/modes/shared.d.ts +15 -0
- package/dist/types/modes/skill-command.d.ts +32 -0
- package/dist/types/modes/theme/defaults/index.d.ts +9436 -0
- package/dist/types/modes/theme/mermaid-cache.d.ts +26 -0
- package/dist/types/modes/theme/mermaid-rendering.test.d.ts +1 -0
- package/dist/types/modes/theme/shimmer.d.ts +40 -0
- package/dist/types/modes/theme/theme.d.ts +360 -0
- package/dist/types/modes/turn-budget.d.ts +18 -0
- package/dist/types/modes/types.d.ts +399 -0
- package/dist/types/modes/ultrathink.d.ts +15 -0
- package/dist/types/modes/utils/context-usage.d.ts +64 -0
- package/dist/types/modes/utils/copy-targets.d.ts +75 -0
- package/dist/types/modes/utils/hotkeys-markdown.d.ts +5 -0
- package/dist/types/modes/utils/interactive-context-helpers.d.ts +14 -0
- package/dist/types/modes/utils/keybinding-matchers.d.ts +32 -0
- package/dist/types/modes/utils/tools-markdown.d.ts +5 -0
- package/dist/types/modes/utils/transcript-render-helpers.d.ts +63 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +55 -0
- package/dist/types/modes/workflow.d.ts +15 -0
- package/dist/types/plan-mode/approved-plan-prompt.test.d.ts +1 -0
- package/dist/types/plan-mode/approved-plan.d.ts +68 -0
- package/dist/types/plan-mode/plan-handoff.d.ts +20 -0
- package/dist/types/plan-mode/plan-protection.d.ts +12 -0
- package/dist/types/plan-mode/state.d.ts +6 -0
- package/dist/types/registry/agent-lifecycle.d.ts +66 -0
- package/dist/types/registry/agent-registry.d.ts +97 -0
- package/dist/types/sdk.d.ts +370 -0
- package/dist/types/secrets/index.d.ts +9 -0
- package/dist/types/secrets/obfuscator.d.ts +63 -0
- package/dist/types/secrets/regex.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +1419 -0
- package/dist/types/session/agent-storage.d.ts +97 -0
- package/dist/types/session/artifacts.d.ts +61 -0
- package/dist/types/session/auth-broker-config.d.ts +45 -0
- package/dist/types/session/auth-storage.d.ts +7 -0
- package/dist/types/session/blob-store.d.ts +68 -0
- package/dist/types/session/client-bridge.d.ts +88 -0
- package/dist/types/session/codex-auto-reset.d.ts +111 -0
- package/dist/types/session/compact-modes.d.ts +60 -0
- package/dist/types/session/exit-diagnostics.d.ts +48 -0
- package/dist/types/session/history-storage.d.ts +30 -0
- package/dist/types/session/indexed-session-storage.d.ts +65 -0
- package/dist/types/session/messages.d.ts +220 -0
- package/dist/types/session/messages.test.d.ts +1 -0
- package/dist/types/session/provider-image-budget.d.ts +3 -0
- package/dist/types/session/redis-session-storage.d.ts +51 -0
- package/dist/types/session/session-context.d.ts +44 -0
- package/dist/types/session/session-dump-format.d.ts +30 -0
- package/dist/types/session/session-entries.d.ts +197 -0
- package/dist/types/session/session-history-format.d.ts +49 -0
- package/dist/types/session/session-listing.d.ts +78 -0
- package/dist/types/session/session-loader.d.ts +29 -0
- package/dist/types/session/session-manager.d.ts +306 -0
- package/dist/types/session/session-migrations.d.ts +12 -0
- package/dist/types/session/session-paths.d.ts +25 -0
- package/dist/types/session/session-persistence.d.ts +12 -0
- package/dist/types/session/session-storage.d.ts +129 -0
- package/dist/types/session/session-title-slot.d.ts +19 -0
- package/dist/types/session/settings-stream-fn.d.ts +21 -0
- package/dist/types/session/shake-types.d.ts +24 -0
- package/dist/types/session/snapcompact-inline.d.ts +145 -0
- package/dist/types/session/snapcompact-savings-journal.d.ts +46 -0
- package/dist/types/session/sql-session-storage.d.ts +72 -0
- package/dist/types/session/streaming-output.d.ts +229 -0
- package/dist/types/session/tool-choice-queue.d.ts +94 -0
- package/dist/types/session/turn-persistence.d.ts +88 -0
- package/dist/types/session/unexpected-stop-classifier.d.ts +13 -0
- package/dist/types/session/yield-queue.d.ts +37 -0
- package/dist/types/slash-commands/acp-builtins.d.ts +34 -0
- package/dist/types/slash-commands/available-commands.d.ts +34 -0
- package/dist/types/slash-commands/builtin-registry.d.ts +36 -0
- package/dist/types/slash-commands/helpers/active-oauth-account.d.ts +14 -0
- package/dist/types/slash-commands/helpers/collab-qrcode.d.ts +13 -0
- package/dist/types/slash-commands/helpers/context-report.d.ts +7 -0
- package/dist/types/slash-commands/helpers/format.d.ts +10 -0
- package/dist/types/slash-commands/helpers/logout.d.ts +15 -0
- package/dist/types/slash-commands/helpers/marketplace-manager.d.ts +8 -0
- package/dist/types/slash-commands/helpers/mcp.d.ts +3 -0
- package/dist/types/slash-commands/helpers/parse.d.ts +33 -0
- package/dist/types/slash-commands/helpers/reset-usage.d.ts +27 -0
- package/dist/types/slash-commands/helpers/ssh.d.ts +3 -0
- package/dist/types/slash-commands/helpers/stats-dashboard.d.ts +13 -0
- package/dist/types/slash-commands/helpers/todo.d.ts +3 -0
- package/dist/types/slash-commands/helpers/usage-report.d.ts +7 -0
- package/dist/types/slash-commands/marketplace-install-parser.d.ts +33 -0
- package/dist/types/slash-commands/types.d.ts +127 -0
- package/dist/types/ssh/__tests__/connection-manager-args.test.d.ts +1 -0
- package/dist/types/ssh/__tests__/connection-manager-timeout.test.d.ts +1 -0
- package/dist/types/ssh/__tests__/file-transfer-posix-guard.test.d.ts +1 -0
- package/dist/types/ssh/__tests__/sshfs-mount.test.d.ts +1 -0
- package/dist/types/ssh/config-writer.d.ts +49 -0
- package/dist/types/ssh/connection-manager.d.ts +109 -0
- package/dist/types/ssh/file-transfer.d.ts +79 -0
- package/dist/types/ssh/ssh-executor.d.ts +37 -0
- package/dist/types/ssh/sshfs-mount.d.ts +15 -0
- package/dist/types/ssh/utils.d.ts +24 -0
- package/dist/types/startup-splash.d.ts +12 -0
- package/dist/types/stt/asr-client.d.ts +68 -0
- package/dist/types/stt/asr-protocol.d.ts +97 -0
- package/dist/types/stt/asr-worker.d.ts +2 -0
- package/dist/types/stt/downloader.d.ts +47 -0
- package/dist/types/stt/endpointer.d.ts +59 -0
- package/dist/types/stt/index.d.ts +8 -0
- package/dist/types/stt/models.d.ts +120 -0
- package/dist/types/stt/recorder.d.ts +30 -0
- package/dist/types/stt/stt-controller.d.ts +24 -0
- package/dist/types/stt/submit-trigger.d.ts +30 -0
- package/dist/types/stt/transcriber.d.ts +14 -0
- package/dist/types/stt/wav.d.ts +29 -0
- package/dist/types/subprocess/worker-client.d.ts +163 -0
- package/dist/types/subprocess/worker-runtime.d.ts +118 -0
- package/dist/types/system-prompt.d.ts +128 -0
- package/dist/types/system-prompt.test.d.ts +1 -0
- package/dist/types/task/agents.d.ts +28 -0
- package/dist/types/task/commands.d.ts +35 -0
- package/dist/types/task/discovery.d.ts +20 -0
- package/dist/types/task/executor.d.ts +214 -0
- package/dist/types/task/index.d.ts +79 -0
- package/dist/types/task/isolation-runner.d.ts +128 -0
- package/dist/types/task/name-generator.d.ts +16 -0
- package/dist/types/task/omp-command.d.ts +7 -0
- package/dist/types/task/output-manager.d.ts +20 -0
- package/dist/types/task/parallel.d.ts +55 -0
- package/dist/types/task/persisted-revive.d.ts +36 -0
- package/dist/types/task/provider-concurrency.d.ts +40 -0
- package/dist/types/task/render.d.ts +34 -0
- package/dist/types/task/render.test.d.ts +1 -0
- package/dist/types/task/renderer.d.ts +14 -0
- package/dist/types/task/repair-args.d.ts +53 -0
- package/dist/types/task/spawn-policy.d.ts +17 -0
- package/dist/types/task/spawn-policy.test.d.ts +1 -0
- package/dist/types/task/subprocess-tool-registry.d.ts +72 -0
- package/dist/types/task/types.d.ts +384 -0
- package/dist/types/task/worktree.d.ts +135 -0
- package/dist/types/task/yield-assembly.d.ts +28 -0
- package/dist/types/telemetry-export.d.ts +19 -0
- package/dist/types/thinking.d.ts +96 -0
- package/dist/types/tiny/device.d.ts +78 -0
- package/dist/types/tiny/dtype.d.ts +85 -0
- package/dist/types/tiny/models.d.ts +230 -0
- package/dist/types/tiny/text.d.ts +44 -0
- package/dist/types/tiny/title-client.d.ts +68 -0
- package/dist/types/tiny/title-protocol.d.ts +78 -0
- package/dist/types/tiny/worker.d.ts +2 -0
- package/dist/types/tool-discovery/mode.d.ts +8 -0
- package/dist/types/tool-discovery/tool-index.d.ts +57 -0
- package/dist/types/tools/__tests__/eval-description.test.d.ts +1 -0
- package/dist/types/tools/__tests__/json-tree.test.d.ts +1 -0
- package/dist/types/tools/acp-bridge.d.ts +29 -0
- package/dist/types/tools/approval.d.ts +46 -0
- package/dist/types/tools/ask.d.ts +119 -0
- package/dist/types/tools/ast-edit.d.ts +84 -0
- package/dist/types/tools/ast-grep.d.ts +76 -0
- package/dist/types/tools/auto-generated-guard.d.ts +17 -0
- package/dist/types/tools/bash-command-fixup.d.ts +11 -0
- package/dist/types/tools/bash-interactive.d.ts +16 -0
- package/dist/types/tools/bash-interceptor.d.ts +24 -0
- package/dist/types/tools/bash-pty-selection.d.ts +7 -0
- package/dist/types/tools/bash-skill-urls.d.ts +31 -0
- package/dist/types/tools/bash.d.ts +173 -0
- package/dist/types/tools/browser/aria/aria-snapshot.d.ts +39 -0
- package/dist/types/tools/browser/attach.d.ts +34 -0
- package/dist/types/tools/browser/cmux/cmux-tab.d.ts +212 -0
- package/dist/types/tools/browser/cmux/rpc.d.ts +70 -0
- package/dist/types/tools/browser/cmux/socket-client.d.ts +19 -0
- package/dist/types/tools/browser/launch.d.ts +67 -0
- package/dist/types/tools/browser/readable.d.ts +17 -0
- package/dist/types/tools/browser/registry.d.ts +58 -0
- package/dist/types/tools/browser/render.d.ts +54 -0
- package/dist/types/tools/browser/run-cancellation.d.ts +4 -0
- package/dist/types/tools/browser/tab-protocol.d.ts +146 -0
- package/dist/types/tools/browser/tab-supervisor.d.ts +114 -0
- package/dist/types/tools/browser/tab-worker-entry.d.ts +1 -0
- package/dist/types/tools/browser/tab-worker.d.ts +56 -0
- package/dist/types/tools/browser.d.ts +96 -0
- package/dist/types/tools/builtin-names.d.ts +6 -0
- package/dist/types/tools/checkpoint.d.ts +72 -0
- package/dist/types/tools/conflict-detect.d.ts +221 -0
- package/dist/types/tools/context.d.ts +19 -0
- package/dist/types/tools/debug.d.ts +157 -0
- package/dist/types/tools/eval-backends.d.ts +15 -0
- package/dist/types/tools/eval-render.d.ts +58 -0
- package/dist/types/tools/eval.d.ts +66 -0
- package/dist/types/tools/fetch.d.ts +99 -0
- package/dist/types/tools/file-recorder.d.ts +13 -0
- package/dist/types/tools/fs-cache-invalidation.d.ts +15 -0
- package/dist/types/tools/gh-cache-invalidation.d.ts +6 -0
- package/dist/types/tools/gh-format.d.ts +6 -0
- package/dist/types/tools/gh-renderer.d.ts +25 -0
- package/dist/types/tools/gh.d.ts +331 -0
- package/dist/types/tools/github-cache.d.ts +123 -0
- package/dist/types/tools/glob.d.ts +96 -0
- package/dist/types/tools/grep.d.ts +99 -0
- package/dist/types/tools/grouped-file-output.d.ts +70 -0
- package/dist/types/tools/image-gen.d.ts +66 -0
- package/dist/types/tools/index.d.ts +368 -0
- package/dist/types/tools/inspect-image-renderer.d.ts +26 -0
- package/dist/types/tools/inspect-image.d.ts +32 -0
- package/dist/types/tools/irc.d.ts +112 -0
- package/dist/types/tools/job.d.ts +73 -0
- package/dist/types/tools/json-tree.d.ts +23 -0
- package/dist/types/tools/jtd-to-json-schema.d.ts +29 -0
- package/dist/types/tools/jtd-to-typescript.d.ts +26 -0
- package/dist/types/tools/jtd-utils.d.ts +42 -0
- package/dist/types/tools/learn.d.ts +44 -0
- package/dist/types/tools/list-limit.d.ts +12 -0
- package/dist/types/tools/manage-skill.d.ts +31 -0
- package/dist/types/tools/match-line-format.d.ts +11 -0
- package/dist/types/tools/memory-edit.d.ts +31 -0
- package/dist/types/tools/memory-recall.d.ts +23 -0
- package/dist/types/tools/memory-reflect.d.ts +25 -0
- package/dist/types/tools/memory-render.d.ts +63 -0
- package/dist/types/tools/memory-retain.d.ts +29 -0
- package/dist/types/tools/output-meta.d.ts +211 -0
- package/dist/types/tools/output-schema-validator.d.ts +77 -0
- package/dist/types/tools/path-utils.d.ts +267 -0
- package/dist/types/tools/plan-mode-guard.d.ts +33 -0
- package/dist/types/tools/read.d.ts +87 -0
- package/dist/types/tools/render-utils.d.ts +218 -0
- package/dist/types/tools/renderers.d.ts +49 -0
- package/dist/types/tools/report-tool-issue.d.ts +127 -0
- package/dist/types/tools/resolve.d.ts +94 -0
- package/dist/types/tools/review.d.ts +59 -0
- package/dist/types/tools/search-tool-bm25.d.ts +65 -0
- package/dist/types/tools/sqlite-reader.d.ts +114 -0
- package/dist/types/tools/ssh.d.ts +74 -0
- package/dist/types/tools/todo.d.ts +126 -0
- package/dist/types/tools/tool-errors.d.ts +33 -0
- package/dist/types/tools/tool-result.d.ts +34 -0
- package/dist/types/tools/tool-timeouts.d.ts +51 -0
- package/dist/types/tools/tts.d.ts +42 -0
- package/dist/types/tools/write.d.ts +66 -0
- package/dist/types/tools/yield.d.ts +39 -0
- package/dist/types/tts/downloader.d.ts +20 -0
- package/dist/types/tts/index.d.ts +10 -0
- package/dist/types/tts/models.d.ts +82 -0
- package/dist/types/tts/player.d.ts +32 -0
- package/dist/types/tts/runtime.d.ts +6 -0
- package/dist/types/tts/speakable.d.ts +47 -0
- package/dist/types/tts/speech-enhancer.d.ts +46 -0
- package/dist/types/tts/streaming-player.d.ts +40 -0
- package/dist/types/tts/tts-client.d.ts +69 -0
- package/dist/types/tts/tts-protocol.d.ts +102 -0
- package/dist/types/tts/tts-worker.d.ts +2 -0
- package/dist/types/tts/vocalizer.d.ts +48 -0
- package/dist/types/tts/wav.d.ts +8 -0
- package/dist/types/tui/code-cell.d.ts +47 -0
- package/dist/types/tui/file-list.d.ts +22 -0
- package/dist/types/tui/hyperlink.d.ts +61 -0
- package/dist/types/tui/index.d.ts +12 -0
- package/dist/types/tui/output-block.d.ts +59 -0
- package/dist/types/tui/status-line.d.ts +21 -0
- package/dist/types/tui/tree-list.d.ts +20 -0
- package/dist/types/tui/types.d.ts +13 -0
- package/dist/types/tui/utils.d.ts +36 -0
- package/dist/types/tui/width-aware-text.d.ts +23 -0
- package/dist/types/utils/active-repo-context.d.ts +8 -0
- package/dist/types/utils/block-context.d.ts +35 -0
- package/dist/types/utils/changelog.d.ts +33 -0
- package/dist/types/utils/clipboard.d.ts +37 -0
- package/dist/types/utils/command-args.d.ts +9 -0
- package/dist/types/utils/commit-message-generator.d.ts +7 -0
- package/dist/types/utils/edit-mode.d.ts +13 -0
- package/dist/types/utils/enhanced-paste.d.ts +20 -0
- package/dist/types/utils/event-bus.d.ts +6 -0
- package/dist/types/utils/external-editor.d.ts +27 -0
- package/dist/types/utils/fetch-timeout.d.ts +4 -0
- package/dist/types/utils/file-display-mode.d.ts +27 -0
- package/dist/types/utils/file-mentions.d.ts +13 -0
- package/dist/types/utils/git.d.ts +471 -0
- package/dist/types/utils/image-loading.d.ts +67 -0
- package/dist/types/utils/image-resize.d.ts +42 -0
- package/dist/types/utils/image-vision-fallback.d.ts +28 -0
- package/dist/types/utils/ipc.d.ts +22 -0
- package/dist/types/utils/jj.d.ts +74 -0
- package/dist/types/utils/lang-from-path.d.ts +8 -0
- package/dist/types/utils/markit-cache.d.ts +23 -0
- package/dist/types/utils/markit.d.ts +20 -0
- package/dist/types/utils/mupdf-wasm-embed.d.ts +1 -0
- package/dist/types/utils/open.d.ts +2 -0
- package/dist/types/utils/prompt-path.d.ts +1 -0
- package/dist/types/utils/qrcode.d.ts +48 -0
- package/dist/types/utils/session-color.d.ts +27 -0
- package/dist/types/utils/shell-snapshot.d.ts +15 -0
- package/dist/types/utils/sixel.d.ts +21 -0
- package/dist/types/utils/thinking-display.d.ts +7 -0
- package/dist/types/utils/title-generator.d.ts +33 -0
- package/dist/types/utils/tool-choice.d.ts +15 -0
- package/dist/types/utils/tools-manager.d.ts +12 -0
- package/dist/types/utils/turndown.d.ts +15 -0
- package/dist/types/utils/zip.d.ts +119 -0
- package/dist/types/web/kagi.d.ts +99 -0
- package/dist/types/web/parallel.d.ts +67 -0
- package/dist/types/web/scrapers/artifacthub.d.ts +6 -0
- package/dist/types/web/scrapers/arxiv.d.ts +5 -0
- package/dist/types/web/scrapers/aur.d.ts +5 -0
- package/dist/types/web/scrapers/biorxiv.d.ts +5 -0
- package/dist/types/web/scrapers/bluesky.d.ts +5 -0
- package/dist/types/web/scrapers/brew.d.ts +5 -0
- package/dist/types/web/scrapers/cheatsh.d.ts +8 -0
- package/dist/types/web/scrapers/chocolatey.d.ts +5 -0
- package/dist/types/web/scrapers/choosealicense.d.ts +2 -0
- package/dist/types/web/scrapers/cisa-kev.d.ts +5 -0
- package/dist/types/web/scrapers/clojars.d.ts +5 -0
- package/dist/types/web/scrapers/coingecko.d.ts +5 -0
- package/dist/types/web/scrapers/crates-io.d.ts +5 -0
- package/dist/types/web/scrapers/crossref.d.ts +2 -0
- package/dist/types/web/scrapers/devto.d.ts +5 -0
- package/dist/types/web/scrapers/discogs.d.ts +8 -0
- package/dist/types/web/scrapers/discourse.d.ts +5 -0
- package/dist/types/web/scrapers/dockerhub.d.ts +5 -0
- package/dist/types/web/scrapers/docs-rs.d.ts +2 -0
- package/dist/types/web/scrapers/fdroid.d.ts +5 -0
- package/dist/types/web/scrapers/firefox-addons.d.ts +2 -0
- package/dist/types/web/scrapers/flathub.d.ts +2 -0
- package/dist/types/web/scrapers/github-gist.d.ts +5 -0
- package/dist/types/web/scrapers/github.d.ts +34 -0
- package/dist/types/web/scrapers/gitlab.d.ts +5 -0
- package/dist/types/web/scrapers/go-pkg.d.ts +5 -0
- package/dist/types/web/scrapers/hackage.d.ts +5 -0
- package/dist/types/web/scrapers/hackernews.d.ts +2 -0
- package/dist/types/web/scrapers/hex.d.ts +5 -0
- package/dist/types/web/scrapers/huggingface.d.ts +2 -0
- package/dist/types/web/scrapers/iacr.d.ts +5 -0
- package/dist/types/web/scrapers/index.d.ts +84 -0
- package/dist/types/web/scrapers/jetbrains-marketplace.d.ts +2 -0
- package/dist/types/web/scrapers/lemmy.d.ts +2 -0
- package/dist/types/web/scrapers/lobsters.d.ts +5 -0
- package/dist/types/web/scrapers/mastodon.d.ts +5 -0
- package/dist/types/web/scrapers/maven.d.ts +6 -0
- package/dist/types/web/scrapers/mdn.d.ts +2 -0
- package/dist/types/web/scrapers/metacpan.d.ts +5 -0
- package/dist/types/web/scrapers/musicbrainz.d.ts +5 -0
- package/dist/types/web/scrapers/npm.d.ts +5 -0
- package/dist/types/web/scrapers/nuget.d.ts +5 -0
- package/dist/types/web/scrapers/nvd.d.ts +5 -0
- package/dist/types/web/scrapers/ollama.d.ts +2 -0
- package/dist/types/web/scrapers/open-vsx.d.ts +5 -0
- package/dist/types/web/scrapers/opencorporates.d.ts +5 -0
- package/dist/types/web/scrapers/openlibrary.d.ts +5 -0
- package/dist/types/web/scrapers/orcid.d.ts +5 -0
- package/dist/types/web/scrapers/osv.d.ts +5 -0
- package/dist/types/web/scrapers/packagist.d.ts +5 -0
- package/dist/types/web/scrapers/pub-dev.d.ts +5 -0
- package/dist/types/web/scrapers/pubmed.d.ts +5 -0
- package/dist/types/web/scrapers/pypi.d.ts +5 -0
- package/dist/types/web/scrapers/rawg.d.ts +2 -0
- package/dist/types/web/scrapers/readthedocs.d.ts +5 -0
- package/dist/types/web/scrapers/reddit.d.ts +5 -0
- package/dist/types/web/scrapers/repology.d.ts +5 -0
- package/dist/types/web/scrapers/rfc.d.ts +5 -0
- package/dist/types/web/scrapers/rubygems.d.ts +5 -0
- package/dist/types/web/scrapers/searchcode.d.ts +2 -0
- package/dist/types/web/scrapers/sec-edgar.d.ts +5 -0
- package/dist/types/web/scrapers/semantic-scholar.d.ts +2 -0
- package/dist/types/web/scrapers/snapcraft.d.ts +2 -0
- package/dist/types/web/scrapers/sourcegraph.d.ts +2 -0
- package/dist/types/web/scrapers/spdx.d.ts +5 -0
- package/dist/types/web/scrapers/spotify.d.ts +8 -0
- package/dist/types/web/scrapers/stackoverflow.d.ts +6 -0
- package/dist/types/web/scrapers/terraform.d.ts +5 -0
- package/dist/types/web/scrapers/tldr.d.ts +7 -0
- package/dist/types/web/scrapers/twitter.d.ts +5 -0
- package/dist/types/web/scrapers/types.d.ts +90 -0
- package/dist/types/web/scrapers/utils.d.ts +26 -0
- package/dist/types/web/scrapers/vimeo.d.ts +5 -0
- package/dist/types/web/scrapers/vscode-marketplace.d.ts +5 -0
- package/dist/types/web/scrapers/w3c.d.ts +2 -0
- package/dist/types/web/scrapers/wikidata.d.ts +5 -0
- package/dist/types/web/scrapers/wikipedia.d.ts +5 -0
- package/dist/types/web/scrapers/youtube.d.ts +5 -0
- package/dist/types/web/search/index.d.ts +74 -0
- package/dist/types/web/search/provider.d.ts +30 -0
- package/dist/types/web/search/providers/anthropic.d.ts +33 -0
- package/dist/types/web/search/providers/base.d.ts +84 -0
- package/dist/types/web/search/providers/brave.d.ts +28 -0
- package/dist/types/web/search/providers/codex.d.ts +36 -0
- package/dist/types/web/search/providers/duckduckgo.d.ts +14 -0
- package/dist/types/web/search/providers/exa.d.ts +70 -0
- package/dist/types/web/search/providers/firecrawl.d.ts +28 -0
- package/dist/types/web/search/providers/gemini.d.ts +63 -0
- package/dist/types/web/search/providers/jina.d.ts +31 -0
- package/dist/types/web/search/providers/kagi.d.ts +30 -0
- package/dist/types/web/search/providers/kimi.d.ts +32 -0
- package/dist/types/web/search/providers/parallel.d.ts +16 -0
- package/dist/types/web/search/providers/perplexity-auth.d.ts +37 -0
- package/dist/types/web/search/providers/perplexity.d.ts +58 -0
- package/dist/types/web/search/providers/searxng.d.ts +45 -0
- package/dist/types/web/search/providers/synthetic.d.ts +25 -0
- package/dist/types/web/search/providers/tavily.d.ts +30 -0
- package/dist/types/web/search/providers/tinyfish.d.ts +29 -0
- package/dist/types/web/search/providers/utils.d.ts +52 -0
- package/dist/types/web/search/providers/xai.d.ts +13 -0
- package/dist/types/web/search/providers/zai.d.ts +29 -0
- package/dist/types/web/search/render.d.ts +34 -0
- package/dist/types/web/search/types.d.ts +431 -0
- package/dist/types/web/search/utils.d.ts +4 -0
- package/dist/types/workspace-tree.d.ts +42 -0
- package/examples/README.md +21 -0
- package/examples/custom-tools/README.md +104 -0
- package/examples/custom-tools/hello/index.ts +20 -0
- package/examples/extensions/README.md +142 -0
- package/examples/extensions/api-demo.ts +79 -0
- package/examples/extensions/chalk-logger.ts +25 -0
- package/examples/extensions/hello.ts +31 -0
- package/examples/extensions/pirate.ts +43 -0
- package/examples/extensions/plan-mode.ts +549 -0
- package/examples/extensions/reload-runtime.ts +38 -0
- package/examples/extensions/thinking-note.ts +13 -0
- package/examples/extensions/tools.ts +145 -0
- package/examples/extensions/with-deps/index.ts +36 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +17 -0
- package/examples/hooks/README.md +56 -0
- package/examples/hooks/auto-commit-on-exit.ts +48 -0
- package/examples/hooks/confirm-destructive.ts +58 -0
- package/examples/hooks/custom-compaction.ts +115 -0
- package/examples/hooks/dirty-repo-guard.ts +51 -0
- package/examples/hooks/file-trigger.ts +40 -0
- package/examples/hooks/git-checkpoint.ts +52 -0
- package/examples/hooks/handoff.ts +149 -0
- package/examples/hooks/permission-gate.ts +33 -0
- package/examples/hooks/protected-paths.ts +29 -0
- package/examples/hooks/qna.ts +118 -0
- package/examples/hooks/status-line.ts +39 -0
- package/examples/sdk/01-minimal.ts +21 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +46 -0
- package/examples/sdk/04-skills.ts +43 -0
- package/examples/sdk/06-extensions.ts +82 -0
- package/examples/sdk/06-hooks.ts +61 -0
- package/examples/sdk/07-context-files.ts +35 -0
- package/examples/sdk/08-prompt-templates.ts +41 -0
- package/examples/sdk/08-slash-commands.ts +46 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +54 -0
- package/examples/sdk/11-sessions.ts +47 -0
- package/examples/sdk/12-redis-sessions.ts +54 -0
- package/examples/sdk/13-sql-sessions.ts +61 -0
- package/examples/sdk/README.md +172 -0
- package/package.json +594 -0
- package/scripts/bench-guard.ts +71 -0
- package/scripts/build-binary.ts +135 -0
- package/scripts/bundle-dist.ts +129 -0
- package/scripts/embed-mupdf-wasm.ts +67 -0
- package/scripts/format-prompts.ts +68 -0
- package/scripts/generate-aria-snapshot.ts +134 -0
- package/scripts/generate-docs-index.ts +148 -0
- package/scripts/generate-legacy-pi-bundled-registry.ts +420 -0
- package/scripts/generate-share-viewer.ts +36 -0
- package/scripts/measure-prompt-tokens.ts +63 -0
- package/scripts/omp +42 -0
- package/scripts/omp.ts +19 -0
- package/src/advisor/__tests__/advisor.test.ts +1662 -0
- package/src/advisor/__tests__/config.test.ts +173 -0
- package/src/advisor/__tests__/emission-guard.test.ts +147 -0
- package/src/advisor/advise-tool.ts +203 -0
- package/src/advisor/config.ts +258 -0
- package/src/advisor/emission-guard.ts +172 -0
- package/src/advisor/index.ts +6 -0
- package/src/advisor/runtime.ts +518 -0
- package/src/advisor/transcript-recorder.ts +159 -0
- package/src/advisor/watchdog.ts +135 -0
- package/src/async/index.ts +1 -0
- package/src/async/job-manager.ts +698 -0
- package/src/auto-thinking/classifier.ts +195 -0
- package/src/autolearn/controller.ts +145 -0
- package/src/autolearn/managed-skills.ts +255 -0
- package/src/autoresearch/command-resume.md +14 -0
- package/src/autoresearch/dashboard.ts +436 -0
- package/src/autoresearch/git.ts +331 -0
- package/src/autoresearch/helpers.ts +218 -0
- package/src/autoresearch/index.ts +541 -0
- package/src/autoresearch/prompt-setup.md +43 -0
- package/src/autoresearch/prompt.md +103 -0
- package/src/autoresearch/resume-message.md +10 -0
- package/src/autoresearch/state.ts +273 -0
- package/src/autoresearch/storage.ts +700 -0
- package/src/autoresearch/tools/init-experiment.ts +269 -0
- package/src/autoresearch/tools/log-experiment.ts +521 -0
- package/src/autoresearch/tools/run-experiment.ts +407 -0
- package/src/autoresearch/tools/update-notes.ts +109 -0
- package/src/autoresearch/types.ts +168 -0
- package/src/capability/context-file.ts +44 -0
- package/src/capability/extension-module.ts +34 -0
- package/src/capability/extension.ts +47 -0
- package/src/capability/fs.ts +117 -0
- package/src/capability/hook.ts +40 -0
- package/src/capability/index.ts +436 -0
- package/src/capability/instruction.ts +37 -0
- package/src/capability/mcp.ts +76 -0
- package/src/capability/prompt.ts +35 -0
- package/src/capability/rule-buckets.ts +66 -0
- package/src/capability/rule.ts +261 -0
- package/src/capability/settings.ts +34 -0
- package/src/capability/skill.ts +63 -0
- package/src/capability/slash-command.ts +40 -0
- package/src/capability/ssh.ts +41 -0
- package/src/capability/system-prompt.ts +34 -0
- package/src/capability/tool.ts +38 -0
- package/src/capability/types.ts +168 -0
- package/src/cli/agents-cli.ts +138 -0
- package/src/cli/args.ts +393 -0
- package/src/cli/auth-broker-cli.ts +921 -0
- package/src/cli/auth-gateway-cli.ts +608 -0
- package/src/cli/bench-cli.ts +623 -0
- package/src/cli/classify-install-target.ts +76 -0
- package/src/cli/claude-trace-cli.ts +795 -0
- package/src/cli/commands/init-xdg.ts +27 -0
- package/src/cli/completion-gen.ts +550 -0
- package/src/cli/config-cli.ts +422 -0
- package/src/cli/dry-balance-cli.ts +853 -0
- package/src/cli/extension-flags.ts +48 -0
- package/src/cli/file-processor.ts +133 -0
- package/src/cli/flag-tables.ts +325 -0
- package/src/cli/gallery-cli.ts +272 -0
- package/src/cli/gallery-fixtures/agentic.ts +416 -0
- package/src/cli/gallery-fixtures/codeintel.ts +187 -0
- package/src/cli/gallery-fixtures/edit.ts +254 -0
- package/src/cli/gallery-fixtures/fs.ts +220 -0
- package/src/cli/gallery-fixtures/index.ts +40 -0
- package/src/cli/gallery-fixtures/interaction.ts +46 -0
- package/src/cli/gallery-fixtures/memory.ts +81 -0
- package/src/cli/gallery-fixtures/misc.ts +250 -0
- package/src/cli/gallery-fixtures/search.ts +213 -0
- package/src/cli/gallery-fixtures/shell.ts +159 -0
- package/src/cli/gallery-fixtures/types.ts +57 -0
- package/src/cli/gallery-fixtures/web.ts +158 -0
- package/src/cli/gallery-screenshot.ts +279 -0
- package/src/cli/gc-cli.ts +946 -0
- package/src/cli/grep-cli.ts +160 -0
- package/src/cli/grievances-cli.ts +256 -0
- package/src/cli/initial-message.ts +58 -0
- package/src/cli/models-cli.ts +368 -0
- package/src/cli/plugin-cli.ts +996 -0
- package/src/cli/profile-alias.ts +369 -0
- package/src/cli/profile-bootstrap.ts +233 -0
- package/src/cli/read-cli.ts +57 -0
- package/src/cli/session-picker.ts +93 -0
- package/src/cli/setup-cli.ts +332 -0
- package/src/cli/setup-model-picker.ts +43 -0
- package/src/cli/shell-cli.ts +176 -0
- package/src/cli/ssh-cli.ts +179 -0
- package/src/cli/startup-cwd.ts +58 -0
- package/src/cli/stats-cli.ts +229 -0
- package/src/cli/tiny-models-cli.ts +153 -0
- package/src/cli/ttsr-cli.ts +995 -0
- package/src/cli/update-cli.test.ts +28 -0
- package/src/cli/update-cli.ts +944 -0
- package/src/cli/usage-cli.ts +857 -0
- package/src/cli/web-search-cli.ts +137 -0
- package/src/cli/worktree-cli.ts +294 -0
- package/src/cli-commands.ts +131 -0
- package/src/cli.ts +348 -0
- package/src/collab/crypto.ts +63 -0
- package/src/collab/display-name.ts +13 -0
- package/src/collab/guest.ts +731 -0
- package/src/collab/host.ts +690 -0
- package/src/collab/protocol.ts +296 -0
- package/src/collab/relay-client.ts +216 -0
- package/src/collab/replication-shrink.ts +111 -0
- package/src/commands/acp.ts +24 -0
- package/src/commands/agents.ts +57 -0
- package/src/commands/auth-broker.ts +99 -0
- package/src/commands/auth-gateway.ts +69 -0
- package/src/commands/bench.ts +51 -0
- package/src/commands/commit.ts +46 -0
- package/src/commands/complete.ts +66 -0
- package/src/commands/completions.ts +60 -0
- package/src/commands/config.ts +51 -0
- package/src/commands/dry-balance.ts +43 -0
- package/src/commands/gallery.ts +60 -0
- package/src/commands/gc.ts +46 -0
- package/src/commands/grep.ts +48 -0
- package/src/commands/grievances.ts +51 -0
- package/src/commands/install.ts +107 -0
- package/src/commands/join.ts +39 -0
- package/src/commands/launch.ts +182 -0
- package/src/commands/models.ts +60 -0
- package/src/commands/plugin.ts +78 -0
- package/src/commands/read.ts +38 -0
- package/src/commands/say.ts +102 -0
- package/src/commands/setup.ts +67 -0
- package/src/commands/shell.ts +29 -0
- package/src/commands/ssh.ts +60 -0
- package/src/commands/stats.ts +29 -0
- package/src/commands/tiny-models.ts +36 -0
- package/src/commands/token.ts +162 -0
- package/src/commands/ttsr.ts +125 -0
- package/src/commands/update.ts +27 -0
- package/src/commands/usage.ts +43 -0
- package/src/commands/web-search.ts +42 -0
- package/src/commands/worktree.ts +62 -0
- package/src/commit/agentic/agent.ts +318 -0
- package/src/commit/agentic/fallback.ts +96 -0
- package/src/commit/agentic/index.ts +355 -0
- package/src/commit/agentic/prompts/analyze-file.md +22 -0
- package/src/commit/agentic/prompts/session-user.md +25 -0
- package/src/commit/agentic/prompts/split-confirm.md +1 -0
- package/src/commit/agentic/prompts/system.md +38 -0
- package/src/commit/agentic/state.ts +60 -0
- package/src/commit/agentic/tools/analyze-file.ts +149 -0
- package/src/commit/agentic/tools/git-file-diff.ts +191 -0
- package/src/commit/agentic/tools/git-hunk.ts +52 -0
- package/src/commit/agentic/tools/git-overview.ts +81 -0
- package/src/commit/agentic/tools/index.ts +54 -0
- package/src/commit/agentic/tools/propose-changelog.ts +147 -0
- package/src/commit/agentic/tools/propose-commit.ts +109 -0
- package/src/commit/agentic/tools/recent-commits.ts +81 -0
- package/src/commit/agentic/tools/schemas.ts +11 -0
- package/src/commit/agentic/tools/split-commit.ts +241 -0
- package/src/commit/agentic/topo-sort.ts +44 -0
- package/src/commit/agentic/trivial.ts +51 -0
- package/src/commit/agentic/validation.ts +183 -0
- package/src/commit/analysis/conventional.ts +64 -0
- package/src/commit/analysis/index.ts +4 -0
- package/src/commit/analysis/scope.ts +242 -0
- package/src/commit/analysis/summary.ts +107 -0
- package/src/commit/analysis/validation.ts +66 -0
- package/src/commit/changelog/detect.ts +40 -0
- package/src/commit/changelog/generate.ts +101 -0
- package/src/commit/changelog/index.ts +234 -0
- package/src/commit/changelog/parse.ts +44 -0
- package/src/commit/cli.ts +85 -0
- package/src/commit/git/diff.ts +148 -0
- package/src/commit/index.ts +5 -0
- package/src/commit/map-reduce/index.ts +69 -0
- package/src/commit/map-reduce/map-phase.ts +193 -0
- package/src/commit/map-reduce/reduce-phase.ts +49 -0
- package/src/commit/map-reduce/utils.ts +9 -0
- package/src/commit/message.ts +11 -0
- package/src/commit/model-selection.ts +95 -0
- package/src/commit/pipeline.ts +243 -0
- package/src/commit/prompts/analysis-system.md +148 -0
- package/src/commit/prompts/analysis-user.md +38 -0
- package/src/commit/prompts/changelog-system.md +50 -0
- package/src/commit/prompts/changelog-user.md +18 -0
- package/src/commit/prompts/file-observer-system.md +24 -0
- package/src/commit/prompts/file-observer-user.md +8 -0
- package/src/commit/prompts/reduce-system.md +50 -0
- package/src/commit/prompts/reduce-user.md +17 -0
- package/src/commit/prompts/summary-retry.md +3 -0
- package/src/commit/prompts/summary-system.md +38 -0
- package/src/commit/prompts/summary-user.md +13 -0
- package/src/commit/prompts/types-description.md +2 -0
- package/src/commit/shared-llm.ts +70 -0
- package/src/commit/types.ts +118 -0
- package/src/commit/utils/exclusions.ts +42 -0
- package/src/commit/utils.ts +58 -0
- package/src/config/api-key-resolver.ts +67 -0
- package/src/config/append-only-context-mode.ts +76 -0
- package/src/config/config-file.ts +315 -0
- package/src/config/file-lock.ts +164 -0
- package/src/config/inline-tool-descriptors-mode.ts +26 -0
- package/src/config/keybindings.ts +636 -0
- package/src/config/mcp-schema.json +247 -0
- package/src/config/model-discovery.ts +919 -0
- package/src/config/model-registry.ts +2275 -0
- package/src/config/model-resolver.ts +1798 -0
- package/src/config/model-roles.ts +99 -0
- package/src/config/models-config-schema.ts +293 -0
- package/src/config/models-config.ts +134 -0
- package/src/config/prompt-templates.ts +205 -0
- package/src/config/provider-globals.ts +25 -0
- package/src/config/resolve-config-value.ts +94 -0
- package/src/config/service-tier.ts +116 -0
- package/src/config/settings-schema.ts +5247 -0
- package/src/config/settings.ts +1540 -0
- package/src/config.ts +242 -0
- package/src/cursor.ts +340 -0
- package/src/dap/client.ts +764 -0
- package/src/dap/config.ts +333 -0
- package/src/dap/defaults.json +212 -0
- package/src/dap/index.ts +4 -0
- package/src/dap/session.ts +1441 -0
- package/src/dap/types.ts +610 -0
- package/src/debug/index.ts +584 -0
- package/src/debug/log-formatting.ts +58 -0
- package/src/debug/log-viewer.ts +966 -0
- package/src/debug/profiler.ts +168 -0
- package/src/debug/protocol-probe.ts +267 -0
- package/src/debug/raw-sse-buffer.ts +294 -0
- package/src/debug/raw-sse.ts +312 -0
- package/src/debug/remote-debugger.ts +151 -0
- package/src/debug/report-bundle.ts +375 -0
- package/src/debug/system-info.ts +111 -0
- package/src/debug/terminal-info.ts +124 -0
- package/src/discovery/agents-md.ts +67 -0
- package/src/discovery/agents.ts +230 -0
- package/src/discovery/at-imports.ts +273 -0
- package/src/discovery/builtin-defaults.ts +39 -0
- package/src/discovery/builtin-rules/go-add-cleanup.md +32 -0
- package/src/discovery/builtin-rules/go-bench-loop.md +36 -0
- package/src/discovery/builtin-rules/go-exp-promoted.md +39 -0
- package/src/discovery/builtin-rules/go-ioutil.md +36 -0
- package/src/discovery/builtin-rules/go-join-hostport.md +29 -0
- package/src/discovery/builtin-rules/go-new-expr.md +44 -0
- package/src/discovery/builtin-rules/go-rand-v2.md +40 -0
- package/src/discovery/builtin-rules/go-range-int.md +45 -0
- package/src/discovery/builtin-rules/index.ts +72 -0
- package/src/discovery/builtin-rules/rs-box-leak.md +48 -0
- package/src/discovery/builtin-rules/rs-future-prelude.md +23 -0
- package/src/discovery/builtin-rules/rs-lazylock.md +51 -0
- package/src/discovery/builtin-rules/rs-match-ergonomics.md +67 -0
- package/src/discovery/builtin-rules/rs-parking-lot.md +44 -0
- package/src/discovery/builtin-rules/rs-result-type.md +19 -0
- package/src/discovery/builtin-rules/ts-bare-catch.md +38 -0
- package/src/discovery/builtin-rules/ts-import-type.md +42 -0
- package/src/discovery/builtin-rules/ts-no-any.md +65 -0
- package/src/discovery/builtin-rules/ts-no-deprecated-leftovers.md +44 -0
- package/src/discovery/builtin-rules/ts-no-dynamic-import.md +39 -0
- package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +55 -0
- package/src/discovery/builtin-rules/ts-no-return-type.md +44 -0
- package/src/discovery/builtin-rules/ts-no-test-timers.md +55 -0
- package/src/discovery/builtin-rules/ts-no-tiny-functions.md +51 -0
- package/src/discovery/builtin-rules/ts-promise-with-resolvers.md +65 -0
- package/src/discovery/builtin-rules/ts-redundant-clear-guard.md +75 -0
- package/src/discovery/builtin-rules/ts-set-map.md +28 -0
- package/src/discovery/builtin.ts +934 -0
- package/src/discovery/claude-plugins.ts +387 -0
- package/src/discovery/claude.ts +584 -0
- package/src/discovery/cline.ts +83 -0
- package/src/discovery/codex.ts +530 -0
- package/src/discovery/cursor.ts +220 -0
- package/src/discovery/gemini.ts +383 -0
- package/src/discovery/github.ts +337 -0
- package/src/discovery/helpers.ts +1102 -0
- package/src/discovery/index.ts +81 -0
- package/src/discovery/mcp-json.ts +172 -0
- package/src/discovery/omp-extension-roots.ts +213 -0
- package/src/discovery/omp-plugins.ts +383 -0
- package/src/discovery/opencode.ts +441 -0
- package/src/discovery/plugin-dir-roots.ts +28 -0
- package/src/discovery/ssh.ts +153 -0
- package/src/discovery/substitute-plugin-root.ts +29 -0
- package/src/discovery/vscode.ts +105 -0
- package/src/discovery/windsurf.ts +147 -0
- package/src/edit/apply-patch/index.ts +87 -0
- package/src/edit/apply-patch/parser.ts +174 -0
- package/src/edit/diff.ts +999 -0
- package/src/edit/file-snapshot-store.ts +157 -0
- package/src/edit/hashline/block-resolver.ts +33 -0
- package/src/edit/hashline/diff.ts +356 -0
- package/src/edit/hashline/execute.ts +279 -0
- package/src/edit/hashline/filesystem.ts +205 -0
- package/src/edit/hashline/index.ts +5 -0
- package/src/edit/hashline/noop-loop-guard.ts +99 -0
- package/src/edit/hashline/params.ts +12 -0
- package/src/edit/index.ts +705 -0
- package/src/edit/modes/apply-patch.lark +19 -0
- package/src/edit/modes/apply-patch.ts +53 -0
- package/src/edit/modes/patch.ts +1950 -0
- package/src/edit/modes/replace.ts +1137 -0
- package/src/edit/normalize.ts +345 -0
- package/src/edit/notebook.ts +242 -0
- package/src/edit/read-file.ts +25 -0
- package/src/edit/renderer.ts +969 -0
- package/src/edit/snapshot-details.ts +77 -0
- package/src/edit/streaming.ts +698 -0
- package/src/eval/__tests__/agent-bridge.test.ts +1399 -0
- package/src/eval/__tests__/bridge-timeout.test.ts +64 -0
- package/src/eval/__tests__/budget-bridge.test.ts +69 -0
- package/src/eval/__tests__/completion-bridge.test.ts +412 -0
- package/src/eval/__tests__/helpers-local-roots.test.ts +55 -0
- package/src/eval/__tests__/idle-timeout.test.ts +80 -0
- package/src/eval/__tests__/js-context-manager.test.ts +291 -0
- package/src/eval/__tests__/julia-prelude.test.ts +66 -0
- package/src/eval/__tests__/kernel-spawn.test.ts +103 -0
- package/src/eval/__tests__/prelude-agent.test.ts +107 -0
- package/src/eval/agent-bridge.ts +584 -0
- package/src/eval/backend-helpers.ts +48 -0
- package/src/eval/backend.ts +71 -0
- package/src/eval/bridge-timeout.ts +44 -0
- package/src/eval/budget-bridge.ts +48 -0
- package/src/eval/completion-bridge.ts +211 -0
- package/src/eval/concurrency-bridge.ts +34 -0
- package/src/eval/executor-base.ts +425 -0
- package/src/eval/idle-timeout.ts +91 -0
- package/src/eval/index.ts +6 -0
- package/src/eval/jl/executor.ts +540 -0
- package/src/eval/jl/index.ts +54 -0
- package/src/eval/jl/kernel.ts +235 -0
- package/src/eval/jl/prelude.jl +735 -0
- package/src/eval/jl/prelude.ts +3 -0
- package/src/eval/jl/runner.jl +666 -0
- package/src/eval/jl/runtime.ts +118 -0
- package/src/eval/js/context-manager.ts +621 -0
- package/src/eval/js/executor.ts +173 -0
- package/src/eval/js/index.ts +40 -0
- package/src/eval/js/shared/helpers.ts +170 -0
- package/src/eval/js/shared/indirect-eval.ts +30 -0
- package/src/eval/js/shared/local-module-loader.ts +364 -0
- package/src/eval/js/shared/prelude.ts +2 -0
- package/src/eval/js/shared/prelude.txt +293 -0
- package/src/eval/js/shared/rewrite-imports.ts +532 -0
- package/src/eval/js/shared/runtime.ts +574 -0
- package/src/eval/js/shared/types.ts +18 -0
- package/src/eval/js/tool-bridge.ts +163 -0
- package/src/eval/js/worker-core.ts +151 -0
- package/src/eval/js/worker-entry.ts +37 -0
- package/src/eval/js/worker-protocol.ts +47 -0
- package/src/eval/kernel-base.ts +569 -0
- package/src/eval/py/__tests__/prelude.test.ts +32 -0
- package/src/eval/py/__tests__/runner-shell-output.test.ts +157 -0
- package/src/eval/py/display.ts +71 -0
- package/src/eval/py/executor.ts +533 -0
- package/src/eval/py/index.ts +57 -0
- package/src/eval/py/kernel.ts +233 -0
- package/src/eval/py/prelude.py +625 -0
- package/src/eval/py/prelude.ts +3 -0
- package/src/eval/py/runner.py +1322 -0
- package/src/eval/py/runtime.ts +276 -0
- package/src/eval/py/spawn-options.ts +126 -0
- package/src/eval/py/tool-bridge.ts +182 -0
- package/src/eval/rb/executor.ts +504 -0
- package/src/eval/rb/index.ts +54 -0
- package/src/eval/rb/kernel.ts +230 -0
- package/src/eval/rb/prelude.rb +553 -0
- package/src/eval/rb/prelude.ts +3 -0
- package/src/eval/rb/runner.rb +581 -0
- package/src/eval/rb/runtime.ts +132 -0
- package/src/eval/runtime-env.ts +104 -0
- package/src/eval/session-id.ts +8 -0
- package/src/eval/types.ts +48 -0
- package/src/exa/index.ts +2 -0
- package/src/exa/mcp-client.ts +370 -0
- package/src/exa/types.ts +69 -0
- package/src/exec/bash-executor.ts +473 -0
- package/src/exec/exec.ts +53 -0
- package/src/exec/non-interactive-env.ts +119 -0
- package/src/export/custom-share.ts +65 -0
- package/src/export/html/index.ts +308 -0
- package/src/export/html/share-loader.js +102 -0
- package/src/export/html/template.css +1337 -0
- package/src/export/html/template.html +49 -0
- package/src/export/html/template.js +1634 -0
- package/src/export/html/tool-views.generated.js +37 -0
- package/src/export/html/vendor/highlight.min.js +1213 -0
- package/src/export/html/vendor/marked.min.js +6 -0
- package/src/export/html/web-palette.ts +142 -0
- package/src/export/share.ts +481 -0
- package/src/export/ttsr.ts +583 -0
- package/src/extensibility/custom-commands/bundled/ci-green/index.ts +54 -0
- package/src/extensibility/custom-commands/bundled/review/index.ts +698 -0
- package/src/extensibility/custom-commands/index.ts +2 -0
- package/src/extensibility/custom-commands/loader.ts +242 -0
- package/src/extensibility/custom-commands/types.ts +119 -0
- package/src/extensibility/custom-tools/index.ts +7 -0
- package/src/extensibility/custom-tools/loader.ts +268 -0
- package/src/extensibility/custom-tools/types.ts +280 -0
- package/src/extensibility/custom-tools/wrapper.ts +47 -0
- package/src/extensibility/extensions/compact-handler.ts +40 -0
- package/src/extensibility/extensions/get-commands-handler.ts +78 -0
- package/src/extensibility/extensions/index.ts +16 -0
- package/src/extensibility/extensions/loader.ts +596 -0
- package/src/extensibility/extensions/model-api.ts +39 -0
- package/src/extensibility/extensions/runner.ts +1039 -0
- package/src/extensibility/extensions/types.ts +1394 -0
- package/src/extensibility/extensions/wrapper.ts +266 -0
- package/src/extensibility/hooks/index.ts +6 -0
- package/src/extensibility/hooks/loader.ts +244 -0
- package/src/extensibility/hooks/runner.ts +425 -0
- package/src/extensibility/hooks/tool-wrapper.ts +117 -0
- package/src/extensibility/hooks/types.ts +613 -0
- package/src/extensibility/legacy-pi-ai-shim.ts +73 -0
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +646 -0
- package/src/extensibility/plugins/doctor.ts +65 -0
- package/src/extensibility/plugins/git-url.ts +367 -0
- package/src/extensibility/plugins/index.ts +9 -0
- package/src/extensibility/plugins/installer.ts +201 -0
- package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +1011 -0
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +3430 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +1141 -0
- package/src/extensibility/plugins/loader.ts +535 -0
- package/src/extensibility/plugins/manager.ts +1121 -0
- package/src/extensibility/plugins/marketplace/cache.ts +136 -0
- package/src/extensibility/plugins/marketplace/fetcher.ts +315 -0
- package/src/extensibility/plugins/marketplace/index.ts +6 -0
- package/src/extensibility/plugins/marketplace/manager.ts +926 -0
- package/src/extensibility/plugins/marketplace/registry.ts +196 -0
- package/src/extensibility/plugins/marketplace/source-resolver.ts +147 -0
- package/src/extensibility/plugins/marketplace/types.ts +192 -0
- package/src/extensibility/plugins/marketplace-auto-update.ts +49 -0
- package/src/extensibility/plugins/parser.ts +107 -0
- package/src/extensibility/plugins/runtime-config.ts +9 -0
- package/src/extensibility/plugins/types.ts +194 -0
- package/src/extensibility/session-handler-types.ts +21 -0
- package/src/extensibility/shared-events.ts +376 -0
- package/src/extensibility/skills.ts +508 -0
- package/src/extensibility/slash-commands.ts +131 -0
- package/src/extensibility/tool-event-input.ts +80 -0
- package/src/extensibility/tool-proxy.ts +28 -0
- package/src/extensibility/typebox.ts +945 -0
- package/src/extensibility/utils.ts +118 -0
- package/src/goals/guided-setup.ts +143 -0
- package/src/goals/index.ts +3 -0
- package/src/goals/runtime.ts +521 -0
- package/src/goals/state.ts +37 -0
- package/src/goals/tools/goal-tool.ts +251 -0
- package/src/hindsight/backend.ts +354 -0
- package/src/hindsight/bank.ts +156 -0
- package/src/hindsight/client.test.ts +33 -0
- package/src/hindsight/client.ts +643 -0
- package/src/hindsight/config.ts +175 -0
- package/src/hindsight/content.ts +266 -0
- package/src/hindsight/index.ts +8 -0
- package/src/hindsight/mental-models.ts +429 -0
- package/src/hindsight/seeds.json +32 -0
- package/src/hindsight/state.ts +492 -0
- package/src/hindsight/transcript.ts +71 -0
- package/src/index.ts +66 -0
- package/src/internal-urls/__tests__/ssh-protocol.test.ts +331 -0
- package/src/internal-urls/agent-protocol.ts +146 -0
- package/src/internal-urls/artifact-protocol.ts +151 -0
- package/src/internal-urls/docs-index.generated.txt +2 -0
- package/src/internal-urls/docs-index.ts +101 -0
- package/src/internal-urls/filesystem-resource.ts +34 -0
- package/src/internal-urls/history-protocol.ts +118 -0
- package/src/internal-urls/index.ts +26 -0
- package/src/internal-urls/issue-pr-protocol.ts +594 -0
- package/src/internal-urls/json-query.ts +126 -0
- package/src/internal-urls/local-protocol.ts +469 -0
- package/src/internal-urls/mcp-protocol.ts +151 -0
- package/src/internal-urls/memory-protocol.ts +173 -0
- package/src/internal-urls/omp-protocol.ts +94 -0
- package/src/internal-urls/parse.ts +72 -0
- package/src/internal-urls/registry-helpers.ts +40 -0
- package/src/internal-urls/router.ts +107 -0
- package/src/internal-urls/rule-protocol.ts +45 -0
- package/src/internal-urls/skill-protocol.ts +112 -0
- package/src/internal-urls/ssh-protocol.ts +367 -0
- package/src/internal-urls/types.ts +182 -0
- package/src/internal-urls/vault-protocol.ts +939 -0
- package/src/irc/bus.ts +320 -0
- package/src/jsonrpc/message-framing.ts +142 -0
- package/src/lib/xai-http.ts +124 -0
- package/src/lsp/client.ts +1249 -0
- package/src/lsp/clients/biome-client.ts +264 -0
- package/src/lsp/clients/index.ts +50 -0
- package/src/lsp/clients/lsp-linter-client.ts +85 -0
- package/src/lsp/clients/swiftlint-client.ts +120 -0
- package/src/lsp/config.ts +531 -0
- package/src/lsp/defaults.json +499 -0
- package/src/lsp/diagnostics-ledger.ts +51 -0
- package/src/lsp/edits.ts +288 -0
- package/src/lsp/format-options.ts +119 -0
- package/src/lsp/index.ts +2539 -0
- package/src/lsp/lspmux.ts +233 -0
- package/src/lsp/render.ts +668 -0
- package/src/lsp/startup-events.ts +13 -0
- package/src/lsp/types.ts +444 -0
- package/src/lsp/utils.ts +718 -0
- package/src/main.ts +1474 -0
- package/src/markit/NOTICE +32 -0
- package/src/markit/converters/docx.ts +56 -0
- package/src/markit/converters/epub.ts +136 -0
- package/src/markit/converters/mammoth.d.ts +24 -0
- package/src/markit/converters/pdf/columns.ts +103 -0
- package/src/markit/converters/pdf/extract.ts +574 -0
- package/src/markit/converters/pdf/grid.ts +780 -0
- package/src/markit/converters/pdf/headers.ts +106 -0
- package/src/markit/converters/pdf/index.ts +146 -0
- package/src/markit/converters/pdf/render.ts +501 -0
- package/src/markit/converters/pdf/types.ts +84 -0
- package/src/markit/converters/pptx.ts +325 -0
- package/src/markit/converters/xlsx.ts +173 -0
- package/src/markit/index.ts +2 -0
- package/src/markit/registry.ts +59 -0
- package/src/markit/types.ts +35 -0
- package/src/mcp/client.ts +511 -0
- package/src/mcp/config-writer.ts +350 -0
- package/src/mcp/config.ts +369 -0
- package/src/mcp/index.ts +29 -0
- package/src/mcp/json-rpc.ts +122 -0
- package/src/mcp/loader.ts +125 -0
- package/src/mcp/manager.ts +1362 -0
- package/src/mcp/oauth-credentials.ts +104 -0
- package/src/mcp/oauth-discovery.ts +560 -0
- package/src/mcp/oauth-flow.ts +787 -0
- package/src/mcp/render.ts +155 -0
- package/src/mcp/smithery-auth.ts +107 -0
- package/src/mcp/smithery-connect.ts +154 -0
- package/src/mcp/smithery-registry.test.ts +51 -0
- package/src/mcp/smithery-registry.ts +500 -0
- package/src/mcp/startup-events.ts +116 -0
- package/src/mcp/timeout.ts +59 -0
- package/src/mcp/tool-bridge.ts +484 -0
- package/src/mcp/tool-cache.ts +117 -0
- package/src/mcp/transports/http.ts +523 -0
- package/src/mcp/transports/index.ts +7 -0
- package/src/mcp/transports/sse.ts +377 -0
- package/src/mcp/transports/stdio.test.ts +95 -0
- package/src/mcp/transports/stdio.ts +663 -0
- package/src/mcp/types.ts +430 -0
- package/src/memories/index.ts +1395 -0
- package/src/memories/storage.ts +578 -0
- package/src/memory-backend/index.ts +18 -0
- package/src/memory-backend/local-backend.ts +47 -0
- package/src/memory-backend/off-backend.ts +25 -0
- package/src/memory-backend/resolve.ts +25 -0
- package/src/memory-backend/runtime.ts +66 -0
- package/src/memory-backend/types.ts +166 -0
- package/src/mnemopi/backend.ts +612 -0
- package/src/mnemopi/config.ts +267 -0
- package/src/mnemopi/embed-client.ts +246 -0
- package/src/mnemopi/embed-protocol.ts +35 -0
- package/src/mnemopi/embed-worker.ts +113 -0
- package/src/mnemopi/index.ts +3 -0
- package/src/mnemopi/state.ts +722 -0
- package/src/modes/acp/acp-agent.ts +2372 -0
- package/src/modes/acp/acp-client-bridge.ts +154 -0
- package/src/modes/acp/acp-event-mapper.ts +1002 -0
- package/src/modes/acp/acp-mode.ts +23 -0
- package/src/modes/acp/index.ts +2 -0
- package/src/modes/acp/terminal-auth.ts +37 -0
- package/src/modes/components/__tests__/move-overlay.test.ts +237 -0
- package/src/modes/components/__tests__/skill-message.test.ts +92 -0
- package/src/modes/components/advisor-config.ts +555 -0
- package/src/modes/components/advisor-message.ts +109 -0
- package/src/modes/components/agent-dashboard.ts +1183 -0
- package/src/modes/components/agent-hub.ts +586 -0
- package/src/modes/components/agent-transcript-viewer.ts +649 -0
- package/src/modes/components/assistant-message.ts +869 -0
- package/src/modes/components/background-tan-message.ts +36 -0
- package/src/modes/components/bash-execution.ts +229 -0
- package/src/modes/components/bordered-loader.ts +41 -0
- package/src/modes/components/btw-panel.ts +124 -0
- package/src/modes/components/cache-invalidation-marker.ts +110 -0
- package/src/modes/components/chat-block.ts +111 -0
- package/src/modes/components/chat-transcript-builder.ts +449 -0
- package/src/modes/components/collab-prompt-message.ts +32 -0
- package/src/modes/components/compaction-summary-message.ts +215 -0
- package/src/modes/components/copy-selector.ts +206 -0
- package/src/modes/components/countdown-timer.ts +75 -0
- package/src/modes/components/custom-editor.test.ts +283 -0
- package/src/modes/components/custom-editor.ts +835 -0
- package/src/modes/components/custom-message.ts +67 -0
- package/src/modes/components/diff.ts +254 -0
- package/src/modes/components/dynamic-border.ts +34 -0
- package/src/modes/components/error-banner.ts +33 -0
- package/src/modes/components/eval-execution.ts +167 -0
- package/src/modes/components/execution-shared.ts +101 -0
- package/src/modes/components/extensions/extension-dashboard.ts +492 -0
- package/src/modes/components/extensions/extension-list.ts +507 -0
- package/src/modes/components/extensions/index.ts +9 -0
- package/src/modes/components/extensions/inspector-panel.ts +321 -0
- package/src/modes/components/extensions/state-manager.ts +648 -0
- package/src/modes/components/extensions/types.ts +186 -0
- package/src/modes/components/footer.ts +276 -0
- package/src/modes/components/history-search.ts +268 -0
- package/src/modes/components/hook-editor.ts +183 -0
- package/src/modes/components/hook-input.ts +87 -0
- package/src/modes/components/hook-message.ts +67 -0
- package/src/modes/components/hook-selector.ts +678 -0
- package/src/modes/components/index.ts +40 -0
- package/src/modes/components/keybinding-hints.ts +65 -0
- package/src/modes/components/late-diagnostics-message.ts +60 -0
- package/src/modes/components/login-dialog.ts +178 -0
- package/src/modes/components/logout-account-selector.ts +130 -0
- package/src/modes/components/mcp-add-wizard.ts +1408 -0
- package/src/modes/components/message-frame.ts +92 -0
- package/src/modes/components/model-selector.ts +1267 -0
- package/src/modes/components/move-overlay.ts +294 -0
- package/src/modes/components/oauth-selector.ts +457 -0
- package/src/modes/components/omfg-panel.ts +141 -0
- package/src/modes/components/overlay-box.ts +109 -0
- package/src/modes/components/plan-review-overlay.ts +847 -0
- package/src/modes/components/plan-toc.ts +138 -0
- package/src/modes/components/plugin-selector.ts +100 -0
- package/src/modes/components/plugin-settings.ts +745 -0
- package/src/modes/components/queue-mode-selector.ts +61 -0
- package/src/modes/components/read-tool-group.ts +676 -0
- package/src/modes/components/reset-usage-selector.ts +161 -0
- package/src/modes/components/segment-track.ts +89 -0
- package/src/modes/components/select-list-mouse-routing.ts +35 -0
- package/src/modes/components/selector-helpers.ts +129 -0
- package/src/modes/components/session-selector.ts +744 -0
- package/src/modes/components/settings-defs.ts +238 -0
- package/src/modes/components/settings-selector.ts +1265 -0
- package/src/modes/components/show-images-selector.ts +50 -0
- package/src/modes/components/skill-message.ts +110 -0
- package/src/modes/components/snapcompact-shape-preview-doc.md +18 -0
- package/src/modes/components/snapcompact-shape-preview.ts +192 -0
- package/src/modes/components/status-line/component.test.ts +44 -0
- package/src/modes/components/status-line/component.ts +1308 -0
- package/src/modes/components/status-line/context-thresholds.ts +86 -0
- package/src/modes/components/status-line/git-utils.ts +42 -0
- package/src/modes/components/status-line/index.ts +5 -0
- package/src/modes/components/status-line/presets.ts +106 -0
- package/src/modes/components/status-line/segments.ts +663 -0
- package/src/modes/components/status-line/separators.ts +55 -0
- package/src/modes/components/status-line/token-rate.ts +66 -0
- package/src/modes/components/status-line/types.ts +147 -0
- package/src/modes/components/theme-selector.ts +68 -0
- package/src/modes/components/thinking-selector.ts +57 -0
- package/src/modes/components/tiny-title-download-progress.ts +90 -0
- package/src/modes/components/tips.txt +24 -0
- package/src/modes/components/todo-reminder.ts +43 -0
- package/src/modes/components/tool-execution.ts +1308 -0
- package/src/modes/components/transcript-container.ts +456 -0
- package/src/modes/components/tree-selector.ts +1002 -0
- package/src/modes/components/ttsr-notification.ts +123 -0
- package/src/modes/components/usage-row.ts +32 -0
- package/src/modes/components/user-message-selector.ts +227 -0
- package/src/modes/components/user-message.ts +68 -0
- package/src/modes/components/visual-truncate.ts +63 -0
- package/src/modes/components/welcome.ts +579 -0
- package/src/modes/controllers/btw-controller.ts +198 -0
- package/src/modes/controllers/command-controller-shared.ts +109 -0
- package/src/modes/controllers/command-controller.ts +1751 -0
- package/src/modes/controllers/event-controller.ts +1497 -0
- package/src/modes/controllers/extension-ui-controller.ts +977 -0
- package/src/modes/controllers/input-controller.ts +1851 -0
- package/src/modes/controllers/mcp-command-controller.ts +2364 -0
- package/src/modes/controllers/omfg-controller.ts +283 -0
- package/src/modes/controllers/omfg-rule.ts +647 -0
- package/src/modes/controllers/selector-controller.ts +1443 -0
- package/src/modes/controllers/session-focus-controller.ts +112 -0
- package/src/modes/controllers/ssh-command-controller.ts +384 -0
- package/src/modes/controllers/streaming-reveal.ts +392 -0
- package/src/modes/controllers/tan-command-controller.ts +190 -0
- package/src/modes/controllers/todo-command-controller.ts +484 -0
- package/src/modes/controllers/tool-args-reveal.ts +582 -0
- package/src/modes/data/emojis.json +1 -0
- package/src/modes/emoji-autocomplete.ts +285 -0
- package/src/modes/gradient-highlight.ts +99 -0
- package/src/modes/image-references.ts +137 -0
- package/src/modes/index.ts +17 -0
- package/src/modes/interactive-mode.ts +4223 -0
- package/src/modes/internal-url-autocomplete.ts +158 -0
- package/src/modes/loop-limit.ts +192 -0
- package/src/modes/magic-keywords.ts +42 -0
- package/src/modes/markdown-prose.ts +247 -0
- package/src/modes/oauth-manual-input.ts +69 -0
- package/src/modes/orchestrate.ts +42 -0
- package/src/modes/print-mode.ts +130 -0
- package/src/modes/prompt-action-autocomplete.ts +262 -0
- package/src/modes/rpc/host-tools.ts +186 -0
- package/src/modes/rpc/host-uris.ts +235 -0
- package/src/modes/rpc/rpc-client.ts +1033 -0
- package/src/modes/rpc/rpc-mode.ts +1311 -0
- package/src/modes/rpc/rpc-subagents.ts +265 -0
- package/src/modes/rpc/rpc-types.ts +499 -0
- package/src/modes/running-subagent-badge.ts +13 -0
- package/src/modes/runtime-init.ts +142 -0
- package/src/modes/session-observer-registry.ts +215 -0
- package/src/modes/session-teardown.test.ts +219 -0
- package/src/modes/session-teardown.ts +82 -0
- package/src/modes/setup-version.ts +11 -0
- package/src/modes/setup-wizard/index.ts +101 -0
- package/src/modes/setup-wizard/lazy.ts +16 -0
- package/src/modes/setup-wizard/scenes/glyph.ts +103 -0
- package/src/modes/setup-wizard/scenes/outro.ts +35 -0
- package/src/modes/setup-wizard/scenes/providers.ts +104 -0
- package/src/modes/setup-wizard/scenes/sign-in.ts +304 -0
- package/src/modes/setup-wizard/scenes/splash.ts +201 -0
- package/src/modes/setup-wizard/scenes/theme.ts +320 -0
- package/src/modes/setup-wizard/scenes/types.ts +57 -0
- package/src/modes/setup-wizard/scenes/web-search.ts +140 -0
- package/src/modes/setup-wizard/startup-splash.ts +107 -0
- package/src/modes/setup-wizard/wizard-overlay.ts +335 -0
- package/src/modes/shared.ts +49 -0
- package/src/modes/skill-command.ts +91 -0
- package/src/modes/theme/dark.json +95 -0
- package/src/modes/theme/defaults/alabaster.json +93 -0
- package/src/modes/theme/defaults/amethyst.json +96 -0
- package/src/modes/theme/defaults/anthracite.json +93 -0
- package/src/modes/theme/defaults/basalt.json +91 -0
- package/src/modes/theme/defaults/birch.json +95 -0
- package/src/modes/theme/defaults/dark-abyss.json +91 -0
- package/src/modes/theme/defaults/dark-arctic.json +104 -0
- package/src/modes/theme/defaults/dark-aurora.json +95 -0
- package/src/modes/theme/defaults/dark-catppuccin.json +107 -0
- package/src/modes/theme/defaults/dark-cavern.json +91 -0
- package/src/modes/theme/defaults/dark-copper.json +95 -0
- package/src/modes/theme/defaults/dark-cosmos.json +90 -0
- package/src/modes/theme/defaults/dark-cyberpunk.json +102 -0
- package/src/modes/theme/defaults/dark-dracula.json +98 -0
- package/src/modes/theme/defaults/dark-eclipse.json +91 -0
- package/src/modes/theme/defaults/dark-ember.json +95 -0
- package/src/modes/theme/defaults/dark-equinox.json +90 -0
- package/src/modes/theme/defaults/dark-forest.json +96 -0
- package/src/modes/theme/defaults/dark-github.json +105 -0
- package/src/modes/theme/defaults/dark-gruvbox.json +112 -0
- package/src/modes/theme/defaults/dark-lavender.json +95 -0
- package/src/modes/theme/defaults/dark-lunar.json +89 -0
- package/src/modes/theme/defaults/dark-midnight.json +95 -0
- package/src/modes/theme/defaults/dark-monochrome.json +94 -0
- package/src/modes/theme/defaults/dark-monokai.json +98 -0
- package/src/modes/theme/defaults/dark-nebula.json +90 -0
- package/src/modes/theme/defaults/dark-nord.json +97 -0
- package/src/modes/theme/defaults/dark-ocean.json +101 -0
- package/src/modes/theme/defaults/dark-one.json +100 -0
- package/src/modes/theme/defaults/dark-poimandres.json +142 -0
- package/src/modes/theme/defaults/dark-rainforest.json +91 -0
- package/src/modes/theme/defaults/dark-reef.json +91 -0
- package/src/modes/theme/defaults/dark-retro.json +92 -0
- package/src/modes/theme/defaults/dark-rose-pine.json +96 -0
- package/src/modes/theme/defaults/dark-sakura.json +95 -0
- package/src/modes/theme/defaults/dark-slate.json +95 -0
- package/src/modes/theme/defaults/dark-solarized.json +97 -0
- package/src/modes/theme/defaults/dark-solstice.json +90 -0
- package/src/modes/theme/defaults/dark-starfall.json +91 -0
- package/src/modes/theme/defaults/dark-sunset.json +99 -0
- package/src/modes/theme/defaults/dark-swamp.json +90 -0
- package/src/modes/theme/defaults/dark-synthwave.json +103 -0
- package/src/modes/theme/defaults/dark-taiga.json +91 -0
- package/src/modes/theme/defaults/dark-terminal.json +95 -0
- package/src/modes/theme/defaults/dark-tokyo-night.json +101 -0
- package/src/modes/theme/defaults/dark-tundra.json +91 -0
- package/src/modes/theme/defaults/dark-twilight.json +91 -0
- package/src/modes/theme/defaults/dark-volcanic.json +91 -0
- package/src/modes/theme/defaults/graphite.json +92 -0
- package/src/modes/theme/defaults/index.ts +199 -0
- package/src/modes/theme/defaults/light-arctic.json +107 -0
- package/src/modes/theme/defaults/light-aurora-day.json +91 -0
- package/src/modes/theme/defaults/light-canyon.json +91 -0
- package/src/modes/theme/defaults/light-catppuccin.json +106 -0
- package/src/modes/theme/defaults/light-cirrus.json +90 -0
- package/src/modes/theme/defaults/light-coral.json +95 -0
- package/src/modes/theme/defaults/light-cyberpunk.json +96 -0
- package/src/modes/theme/defaults/light-dawn.json +90 -0
- package/src/modes/theme/defaults/light-dunes.json +91 -0
- package/src/modes/theme/defaults/light-eucalyptus.json +95 -0
- package/src/modes/theme/defaults/light-forest.json +100 -0
- package/src/modes/theme/defaults/light-frost.json +95 -0
- package/src/modes/theme/defaults/light-github.json +115 -0
- package/src/modes/theme/defaults/light-glacier.json +91 -0
- package/src/modes/theme/defaults/light-gruvbox.json +108 -0
- package/src/modes/theme/defaults/light-haze.json +90 -0
- package/src/modes/theme/defaults/light-honeycomb.json +95 -0
- package/src/modes/theme/defaults/light-lagoon.json +91 -0
- package/src/modes/theme/defaults/light-lavender.json +95 -0
- package/src/modes/theme/defaults/light-meadow.json +91 -0
- package/src/modes/theme/defaults/light-mint.json +95 -0
- package/src/modes/theme/defaults/light-monochrome.json +101 -0
- package/src/modes/theme/defaults/light-ocean.json +99 -0
- package/src/modes/theme/defaults/light-one.json +99 -0
- package/src/modes/theme/defaults/light-opal.json +91 -0
- package/src/modes/theme/defaults/light-orchard.json +91 -0
- package/src/modes/theme/defaults/light-paper.json +95 -0
- package/src/modes/theme/defaults/light-poimandres.json +142 -0
- package/src/modes/theme/defaults/light-prism.json +90 -0
- package/src/modes/theme/defaults/light-retro.json +98 -0
- package/src/modes/theme/defaults/light-sand.json +95 -0
- package/src/modes/theme/defaults/light-savanna.json +91 -0
- package/src/modes/theme/defaults/light-solarized.json +102 -0
- package/src/modes/theme/defaults/light-soleil.json +90 -0
- package/src/modes/theme/defaults/light-sunset.json +99 -0
- package/src/modes/theme/defaults/light-synthwave.json +98 -0
- package/src/modes/theme/defaults/light-tokyo-night.json +111 -0
- package/src/modes/theme/defaults/light-wetland.json +91 -0
- package/src/modes/theme/defaults/light-zenith.json +89 -0
- package/src/modes/theme/defaults/limestone.json +94 -0
- package/src/modes/theme/defaults/mahogany.json +97 -0
- package/src/modes/theme/defaults/marble.json +93 -0
- package/src/modes/theme/defaults/obsidian.json +91 -0
- package/src/modes/theme/defaults/onyx.json +91 -0
- package/src/modes/theme/defaults/pearl.json +93 -0
- package/src/modes/theme/defaults/porcelain.json +91 -0
- package/src/modes/theme/defaults/quartz.json +96 -0
- package/src/modes/theme/defaults/sandstone.json +95 -0
- package/src/modes/theme/defaults/titanium.json +90 -0
- package/src/modes/theme/light.json +93 -0
- package/src/modes/theme/mermaid-cache.ts +92 -0
- package/src/modes/theme/mermaid-rendering.test.ts +53 -0
- package/src/modes/theme/shimmer.ts +269 -0
- package/src/modes/theme/theme-schema.json +459 -0
- package/src/modes/theme/theme.ts +3004 -0
- package/src/modes/turn-budget.ts +31 -0
- package/src/modes/types.ts +437 -0
- package/src/modes/ultrathink.ts +41 -0
- package/src/modes/utils/context-usage.ts +432 -0
- package/src/modes/utils/copy-targets.ts +378 -0
- package/src/modes/utils/hotkeys-markdown.ts +62 -0
- package/src/modes/utils/interactive-context-helpers.ts +27 -0
- package/src/modes/utils/keybinding-matchers.ts +86 -0
- package/src/modes/utils/tools-markdown.ts +27 -0
- package/src/modes/utils/transcript-render-helpers.ts +184 -0
- package/src/modes/utils/ui-helpers.ts +864 -0
- package/src/modes/workflow.ts +42 -0
- package/src/plan-mode/approved-plan-prompt.test.ts +36 -0
- package/src/plan-mode/approved-plan.ts +186 -0
- package/src/plan-mode/plan-handoff.ts +37 -0
- package/src/plan-mode/plan-protection.ts +31 -0
- package/src/plan-mode/state.ts +6 -0
- package/src/priority.json +60 -0
- package/src/prompts/advisor/active-repo-watchdog.md +6 -0
- package/src/prompts/advisor/advise-tool.md +3 -0
- package/src/prompts/advisor/context-files.md +8 -0
- package/src/prompts/advisor/system.md +89 -0
- package/src/prompts/agents/designer.md +74 -0
- package/src/prompts/agents/explore.md +58 -0
- package/src/prompts/agents/frontmatter.md +11 -0
- package/src/prompts/agents/init.md +33 -0
- package/src/prompts/agents/librarian.md +119 -0
- package/src/prompts/agents/plan.md +48 -0
- package/src/prompts/agents/reviewer.md +140 -0
- package/src/prompts/agents/task.md +17 -0
- package/src/prompts/agents/tester.md +111 -0
- package/src/prompts/bench.md +6 -0
- package/src/prompts/ci-green-request.md +36 -0
- package/src/prompts/dry-balance-bench.md +8 -0
- package/src/prompts/goals/goal-budget-limit.md +16 -0
- package/src/prompts/goals/goal-continuation.md +28 -0
- package/src/prompts/goals/goal-mode-active.md +23 -0
- package/src/prompts/goals/goal-mode-context.md +4 -0
- package/src/prompts/goals/goal-todo-context.md +20 -0
- package/src/prompts/goals/guided-goal-interview.md +8 -0
- package/src/prompts/goals/guided-goal-system.md +12 -0
- package/src/prompts/memories/consolidation.md +30 -0
- package/src/prompts/memories/consolidation_system.md +4 -0
- package/src/prompts/memories/read-path.md +17 -0
- package/src/prompts/memories/stage_one_input.md +6 -0
- package/src/prompts/memories/stage_one_system.md +21 -0
- package/src/prompts/review-custom-request.md +21 -0
- package/src/prompts/review-headless-request.md +16 -0
- package/src/prompts/review-request.md +68 -0
- package/src/prompts/skills/autoload.md +8 -0
- package/src/prompts/skills/user-invocation.md +11 -0
- package/src/prompts/steering/parent-irc.md +5 -0
- package/src/prompts/steering/user-interjection.md +9 -0
- package/src/prompts/system/active-repo-context.md +4 -0
- package/src/prompts/system/agent-creation-architect.md +50 -0
- package/src/prompts/system/agent-creation-user.md +6 -0
- package/src/prompts/system/auto-continue.md +1 -0
- package/src/prompts/system/auto-thinking-difficulty-local.md +14 -0
- package/src/prompts/system/auto-thinking-difficulty.md +12 -0
- package/src/prompts/system/autolearn-guidance-learn.md +1 -0
- package/src/prompts/system/autolearn-guidance.md +7 -0
- package/src/prompts/system/autolearn-nudge-autocontinue.md +5 -0
- package/src/prompts/system/background-tan-dispatch.md +8 -0
- package/src/prompts/system/btw-user.md +8 -0
- package/src/prompts/system/commit-message-system.md +14 -0
- package/src/prompts/system/custom-system-prompt.md +64 -0
- package/src/prompts/system/eager-task.md +7 -0
- package/src/prompts/system/eager-todo.md +18 -0
- package/src/prompts/system/empty-stop-retry.md +4 -0
- package/src/prompts/system/gemini-tool-call-reminder.md +9 -0
- package/src/prompts/system/interrupted-thinking.md +7 -0
- package/src/prompts/system/irc-autoreply.md +6 -0
- package/src/prompts/system/irc-incoming.md +9 -0
- package/src/prompts/system/manual-continue.md +7 -0
- package/src/prompts/system/memory-consolidation-system.md +8 -0
- package/src/prompts/system/memory-extraction-system.md +26 -0
- package/src/prompts/system/mid-run-todo-nudge.md +3 -0
- package/src/prompts/system/omfg-user.md +50 -0
- package/src/prompts/system/orchestrate-notice.md +40 -0
- package/src/prompts/system/personalities/default.md +18 -0
- package/src/prompts/system/personalities/friendly.md +17 -0
- package/src/prompts/system/personalities/pragmatic.md +15 -0
- package/src/prompts/system/plan-mode-active.md +118 -0
- package/src/prompts/system/plan-mode-approved.md +22 -0
- package/src/prompts/system/plan-mode-compact-instructions.md +17 -0
- package/src/prompts/system/plan-mode-reference.md +10 -0
- package/src/prompts/system/plan-mode-subagent.md +33 -0
- package/src/prompts/system/plan-mode-tool-decision-reminder.md +9 -0
- package/src/prompts/system/project-prompt.md +54 -0
- package/src/prompts/system/recap-user.md +9 -0
- package/src/prompts/system/rewind-report.md +6 -0
- package/src/prompts/system/side-channel-no-tools.md +3 -0
- package/src/prompts/system/snapcompact-context-frames-note.md +1 -0
- package/src/prompts/system/snapcompact-context-stub.md +1 -0
- package/src/prompts/system/snapcompact-system-frames-note.md +1 -0
- package/src/prompts/system/snapcompact-system-stub.md +1 -0
- package/src/prompts/system/snapcompact-toolresult-note.md +1 -0
- package/src/prompts/system/speech-rewrite.md +15 -0
- package/src/prompts/system/subagent-system-prompt.md +77 -0
- package/src/prompts/system/subagent-user-prompt.md +3 -0
- package/src/prompts/system/subagent-yield-reminder.md +13 -0
- package/src/prompts/system/system-prompt.md +248 -0
- package/src/prompts/system/thinking-loop-redirect.md +10 -0
- package/src/prompts/system/tiny-title-system.md +8 -0
- package/src/prompts/system/title-marker-instruction.md +1 -0
- package/src/prompts/system/title-system-marker.md +17 -0
- package/src/prompts/system/title-system.md +17 -0
- package/src/prompts/system/tool-call-loop-redirect.md +8 -0
- package/src/prompts/system/ttsr-interrupt.md +7 -0
- package/src/prompts/system/ttsr-tool-reminder.md +5 -0
- package/src/prompts/system/ultrathink-notice.md +3 -0
- package/src/prompts/system/unexpected-stop-classifier.md +17 -0
- package/src/prompts/system/unexpected-stop-retry.md +4 -0
- package/src/prompts/system/web-search.md +25 -0
- package/src/prompts/system/workflow-notice.md +70 -0
- package/src/prompts/tools/apply-patch.md +65 -0
- package/src/prompts/tools/ask.md +22 -0
- package/src/prompts/tools/ast-edit.md +22 -0
- package/src/prompts/tools/ast-grep.md +25 -0
- package/src/prompts/tools/async-result.md +8 -0
- package/src/prompts/tools/bash.md +57 -0
- package/src/prompts/tools/browser.md +45 -0
- package/src/prompts/tools/checkpoint.md +15 -0
- package/src/prompts/tools/debug.md +17 -0
- package/src/prompts/tools/eval.md +72 -0
- package/src/prompts/tools/github.md +17 -0
- package/src/prompts/tools/glob.md +15 -0
- package/src/prompts/tools/goal.md +11 -0
- package/src/prompts/tools/grep.md +22 -0
- package/src/prompts/tools/image-attachment-describe-system.md +8 -0
- package/src/prompts/tools/image-attachment-describe.md +10 -0
- package/src/prompts/tools/image-gen.md +7 -0
- package/src/prompts/tools/inspect-image-system.md +20 -0
- package/src/prompts/tools/inspect-image.md +22 -0
- package/src/prompts/tools/irc.md +24 -0
- package/src/prompts/tools/job.md +11 -0
- package/src/prompts/tools/learn.md +7 -0
- package/src/prompts/tools/lsp-late-diagnostic.md +8 -0
- package/src/prompts/tools/lsp.md +28 -0
- package/src/prompts/tools/manage-skill.md +9 -0
- package/src/prompts/tools/memory-edit.md +8 -0
- package/src/prompts/tools/patch.md +57 -0
- package/src/prompts/tools/read.md +77 -0
- package/src/prompts/tools/recall.md +5 -0
- package/src/prompts/tools/reflect.md +5 -0
- package/src/prompts/tools/replace.md +29 -0
- package/src/prompts/tools/resolve.md +4 -0
- package/src/prompts/tools/retain.md +6 -0
- package/src/prompts/tools/rewind.md +14 -0
- package/src/prompts/tools/search-tool-bm25.md +32 -0
- package/src/prompts/tools/ssh.md +23 -0
- package/src/prompts/tools/task-summary.md +17 -0
- package/src/prompts/tools/task.md +68 -0
- package/src/prompts/tools/todo.md +39 -0
- package/src/prompts/tools/web-search.md +6 -0
- package/src/prompts/tools/write.md +14 -0
- package/src/registry/agent-lifecycle.ts +270 -0
- package/src/registry/agent-registry.ts +190 -0
- package/src/sdk.ts +3037 -0
- package/src/secrets/index.ts +123 -0
- package/src/secrets/obfuscator.ts +441 -0
- package/src/secrets/regex.ts +21 -0
- package/src/session/agent-session.ts +15855 -0
- package/src/session/agent-storage.ts +478 -0
- package/src/session/artifacts.ts +153 -0
- package/src/session/auth-broker-config.ts +92 -0
- package/src/session/auth-storage.ts +24 -0
- package/src/session/blob-store.ts +279 -0
- package/src/session/client-bridge.ts +85 -0
- package/src/session/codex-auto-reset.ts +202 -0
- package/src/session/compact-modes.ts +105 -0
- package/src/session/exit-diagnostics.ts +202 -0
- package/src/session/history-storage.ts +360 -0
- package/src/session/indexed-session-storage.ts +537 -0
- package/src/session/messages.test.ts +125 -0
- package/src/session/messages.ts +740 -0
- package/src/session/provider-image-budget.ts +86 -0
- package/src/session/redis-session-storage.ts +217 -0
- package/src/session/session-context.ts +442 -0
- package/src/session/session-dump-format.ts +216 -0
- package/src/session/session-entries.ts +241 -0
- package/src/session/session-history-format.ts +396 -0
- package/src/session/session-listing.ts +652 -0
- package/src/session/session-loader.ts +284 -0
- package/src/session/session-manager.ts +1995 -0
- package/src/session/session-migrations.ts +78 -0
- package/src/session/session-paths.ts +193 -0
- package/src/session/session-persistence.ts +266 -0
- package/src/session/session-storage.ts +734 -0
- package/src/session/session-title-slot.ts +141 -0
- package/src/session/settings-stream-fn.ts +73 -0
- package/src/session/shake-types.ts +43 -0
- package/src/session/snapcompact-inline.ts +561 -0
- package/src/session/snapcompact-savings-journal.ts +113 -0
- package/src/session/sql-session-storage.ts +374 -0
- package/src/session/streaming-output.ts +1330 -0
- package/src/session/tool-choice-queue.ts +290 -0
- package/src/session/turn-persistence.ts +142 -0
- package/src/session/unexpected-stop-classifier.ts +129 -0
- package/src/session/yield-queue.ts +183 -0
- package/src/slash-commands/acp-builtins.ts +70 -0
- package/src/slash-commands/available-commands.ts +105 -0
- package/src/slash-commands/builtin-registry.ts +2554 -0
- package/src/slash-commands/helpers/active-oauth-account.ts +44 -0
- package/src/slash-commands/helpers/collab-qrcode.ts +28 -0
- package/src/slash-commands/helpers/context-report.ts +66 -0
- package/src/slash-commands/helpers/format.ts +46 -0
- package/src/slash-commands/helpers/logout.ts +88 -0
- package/src/slash-commands/helpers/marketplace-manager.ts +25 -0
- package/src/slash-commands/helpers/mcp.ts +533 -0
- package/src/slash-commands/helpers/parse.ts +85 -0
- package/src/slash-commands/helpers/reset-usage.ts +66 -0
- package/src/slash-commands/helpers/ssh.ts +195 -0
- package/src/slash-commands/helpers/stats-dashboard.ts +85 -0
- package/src/slash-commands/helpers/todo.ts +285 -0
- package/src/slash-commands/helpers/usage-report.ts +162 -0
- package/src/slash-commands/marketplace-install-parser.ts +99 -0
- package/src/slash-commands/types.ts +137 -0
- package/src/ssh/__tests__/connection-manager-args.test.ts +191 -0
- package/src/ssh/__tests__/connection-manager-timeout.test.ts +61 -0
- package/src/ssh/__tests__/file-transfer-posix-guard.test.ts +105 -0
- package/src/ssh/__tests__/sshfs-mount.test.ts +13 -0
- package/src/ssh/config-writer.ts +183 -0
- package/src/ssh/connection-manager.ts +667 -0
- package/src/ssh/file-transfer.ts +214 -0
- package/src/ssh/ssh-executor.ts +178 -0
- package/src/ssh/sshfs-mount.ts +163 -0
- package/src/ssh/utils.ts +51 -0
- package/src/startup-splash.ts +19 -0
- package/src/stt/asr-client.ts +401 -0
- package/src/stt/asr-protocol.ts +65 -0
- package/src/stt/asr-worker.ts +638 -0
- package/src/stt/downloader.ts +144 -0
- package/src/stt/endpointer.ts +259 -0
- package/src/stt/index.ts +8 -0
- package/src/stt/models.ts +150 -0
- package/src/stt/recorder.ts +538 -0
- package/src/stt/stt-controller.ts +409 -0
- package/src/stt/submit-trigger.ts +74 -0
- package/src/stt/transcriber.ts +60 -0
- package/src/stt/wav.ts +173 -0
- package/src/subprocess/worker-client.ts +456 -0
- package/src/subprocess/worker-runtime.ts +494 -0
- package/src/system-prompt.test.ts +158 -0
- package/src/system-prompt.ts +787 -0
- package/src/task/agents.ts +166 -0
- package/src/task/commands.ts +132 -0
- package/src/task/discovery.ts +145 -0
- package/src/task/executor.ts +2481 -0
- package/src/task/index.ts +1481 -0
- package/src/task/isolation-runner.ts +384 -0
- package/src/task/name-generator.ts +1577 -0
- package/src/task/omp-command.ts +26 -0
- package/src/task/output-manager.ts +93 -0
- package/src/task/parallel.ts +178 -0
- package/src/task/persisted-revive.ts +128 -0
- package/src/task/provider-concurrency.ts +100 -0
- package/src/task/render.test.ts +121 -0
- package/src/task/render.ts +1761 -0
- package/src/task/renderer.ts +15 -0
- package/src/task/repair-args.ts +129 -0
- package/src/task/spawn-policy.test.ts +63 -0
- package/src/task/spawn-policy.ts +58 -0
- package/src/task/subprocess-tool-registry.ts +88 -0
- package/src/task/types.ts +495 -0
- package/src/task/worktree.ts +935 -0
- package/src/task/yield-assembly.ts +198 -0
- package/src/telemetry-export.ts +144 -0
- package/src/thinking.ts +219 -0
- package/src/tiny/device.ts +111 -0
- package/src/tiny/dtype.ts +101 -0
- package/src/tiny/models.ts +268 -0
- package/src/tiny/text.ts +336 -0
- package/src/tiny/title-client.ts +438 -0
- package/src/tiny/title-protocol.ts +56 -0
- package/src/tiny/worker.ts +351 -0
- package/src/tool-discovery/mode.ts +24 -0
- package/src/tool-discovery/tool-index.ts +271 -0
- package/src/tools/__tests__/eval-description.test.ts +19 -0
- package/src/tools/__tests__/json-tree.test.ts +35 -0
- package/src/tools/acp-bridge.ts +71 -0
- package/src/tools/approval.ts +189 -0
- package/src/tools/ask.ts +1213 -0
- package/src/tools/ast-edit.ts +708 -0
- package/src/tools/ast-grep.ts +520 -0
- package/src/tools/auto-generated-guard.ts +322 -0
- package/src/tools/bash-command-fixup.ts +37 -0
- package/src/tools/bash-interactive.ts +408 -0
- package/src/tools/bash-interceptor.ts +67 -0
- package/src/tools/bash-pty-selection.ts +14 -0
- package/src/tools/bash-skill-urls.ts +248 -0
- package/src/tools/bash.ts +1421 -0
- package/src/tools/browser/aria/aria-snapshot.bundle.txt +7 -0
- package/src/tools/browser/aria/aria-snapshot.ts +103 -0
- package/src/tools/browser/attach.ts +194 -0
- package/src/tools/browser/cmux/cmux-tab.ts +1378 -0
- package/src/tools/browser/cmux/rpc.ts +156 -0
- package/src/tools/browser/cmux/socket-client.ts +309 -0
- package/src/tools/browser/launch.ts +749 -0
- package/src/tools/browser/readable.ts +112 -0
- package/src/tools/browser/registry.ts +266 -0
- package/src/tools/browser/render.ts +223 -0
- package/src/tools/browser/run-cancellation.ts +47 -0
- package/src/tools/browser/tab-protocol.ts +107 -0
- package/src/tools/browser/tab-supervisor.ts +956 -0
- package/src/tools/browser/tab-worker-entry.ts +29 -0
- package/src/tools/browser/tab-worker.ts +1433 -0
- package/src/tools/browser.ts +409 -0
- package/src/tools/builtin-names.ts +58 -0
- package/src/tools/checkpoint.ts +150 -0
- package/src/tools/conflict-detect.ts +718 -0
- package/src/tools/context.ts +39 -0
- package/src/tools/debug.ts +1088 -0
- package/src/tools/eval-backends.ts +34 -0
- package/src/tools/eval-render.ts +776 -0
- package/src/tools/eval.ts +767 -0
- package/src/tools/fetch.ts +1966 -0
- package/src/tools/file-recorder.ts +35 -0
- package/src/tools/fs-cache-invalidation.ts +28 -0
- package/src/tools/gh-cache-invalidation.ts +255 -0
- package/src/tools/gh-format.ts +12 -0
- package/src/tools/gh-renderer.ts +484 -0
- package/src/tools/gh.ts +3752 -0
- package/src/tools/github-cache.ts +663 -0
- package/src/tools/glob.ts +639 -0
- package/src/tools/grep.ts +1836 -0
- package/src/tools/grouped-file-output.ts +210 -0
- package/src/tools/image-gen.ts +1587 -0
- package/src/tools/index.ts +682 -0
- package/src/tools/inspect-image-renderer.ts +132 -0
- package/src/tools/inspect-image.ts +260 -0
- package/src/tools/irc.ts +827 -0
- package/src/tools/job.ts +612 -0
- package/src/tools/json-tree.ts +260 -0
- package/src/tools/jtd-to-json-schema.ts +219 -0
- package/src/tools/jtd-to-typescript.ts +136 -0
- package/src/tools/jtd-utils.ts +102 -0
- package/src/tools/learn.ts +141 -0
- package/src/tools/list-limit.ts +40 -0
- package/src/tools/manage-skill.ts +100 -0
- package/src/tools/match-line-format.ts +20 -0
- package/src/tools/memory-edit.ts +59 -0
- package/src/tools/memory-recall.ts +102 -0
- package/src/tools/memory-reflect.ts +88 -0
- package/src/tools/memory-render.ts +202 -0
- package/src/tools/memory-retain.ts +89 -0
- package/src/tools/output-meta.ts +818 -0
- package/src/tools/output-schema-validator.ts +307 -0
- package/src/tools/path-utils.ts +1279 -0
- package/src/tools/plan-mode-guard.ts +155 -0
- package/src/tools/puppeteer/00_stealth_tampering.txt +44 -0
- package/src/tools/puppeteer/01_stealth_activity.txt +80 -0
- package/src/tools/puppeteer/02_stealth_hairline.txt +57 -0
- package/src/tools/puppeteer/03_stealth_botd.txt +380 -0
- package/src/tools/puppeteer/04_stealth_iframe.txt +174 -0
- package/src/tools/puppeteer/05_stealth_webgl.txt +233 -0
- package/src/tools/puppeteer/06_stealth_screen.txt +260 -0
- package/src/tools/puppeteer/07_stealth_fonts.txt +99 -0
- package/src/tools/puppeteer/08_stealth_audio.txt +63 -0
- package/src/tools/puppeteer/09_stealth_locale.txt +51 -0
- package/src/tools/puppeteer/10_stealth_plugins.txt +212 -0
- package/src/tools/puppeteer/11_stealth_hardware.txt +59 -0
- package/src/tools/puppeteer/12_stealth_codecs.txt +42 -0
- package/src/tools/puppeteer/13_stealth_worker.txt +235 -0
- package/src/tools/read.ts +3522 -0
- package/src/tools/render-utils.ts +913 -0
- package/src/tools/renderers.ts +107 -0
- package/src/tools/report-tool-issue.ts +530 -0
- package/src/tools/resolve.ts +302 -0
- package/src/tools/review.ts +261 -0
- package/src/tools/search-tool-bm25.ts +351 -0
- package/src/tools/sqlite-reader.ts +884 -0
- package/src/tools/ssh.ts +397 -0
- package/src/tools/todo.ts +944 -0
- package/src/tools/tool-errors.ts +62 -0
- package/src/tools/tool-result.ts +102 -0
- package/src/tools/tool-timeouts.ts +30 -0
- package/src/tools/tts.ts +266 -0
- package/src/tools/write.ts +1219 -0
- package/src/tools/yield.ts +455 -0
- package/src/tts/downloader.ts +64 -0
- package/src/tts/index.ts +10 -0
- package/src/tts/models.ts +137 -0
- package/src/tts/player.ts +137 -0
- package/src/tts/runtime.ts +21 -0
- package/src/tts/speakable.ts +382 -0
- package/src/tts/speech-enhancer.ts +204 -0
- package/src/tts/streaming-player.ts +321 -0
- package/src/tts/tts-client.ts +475 -0
- package/src/tts/tts-protocol.ts +69 -0
- package/src/tts/tts-worker.ts +434 -0
- package/src/tts/vocalizer.ts +393 -0
- package/src/tts/wav.ts +58 -0
- package/src/tui/code-cell.ts +268 -0
- package/src/tui/file-list.ts +55 -0
- package/src/tui/hyperlink.ts +178 -0
- package/src/tui/index.ts +13 -0
- package/src/tui/output-block.ts +251 -0
- package/src/tui/status-line.ts +54 -0
- package/src/tui/tree-list.ts +133 -0
- package/src/tui/types.ts +15 -0
- package/src/tui/utils.ts +103 -0
- package/src/tui/width-aware-text.ts +58 -0
- package/src/utils/active-repo-context.ts +143 -0
- package/src/utils/block-context.ts +312 -0
- package/src/utils/changelog.ts +132 -0
- package/src/utils/clipboard.ts +356 -0
- package/src/utils/command-args.ts +76 -0
- package/src/utils/commit-message-generator.ts +146 -0
- package/src/utils/edit-mode.ts +58 -0
- package/src/utils/enhanced-paste.ts +230 -0
- package/src/utils/event-bus.ts +33 -0
- package/src/utils/external-editor.ts +78 -0
- package/src/utils/fetch-timeout.ts +10 -0
- package/src/utils/file-display-mode.ts +44 -0
- package/src/utils/file-mentions.ts +293 -0
- package/src/utils/git.ts +2181 -0
- package/src/utils/image-loading.ts +231 -0
- package/src/utils/image-resize.ts +420 -0
- package/src/utils/image-vision-fallback.ts +196 -0
- package/src/utils/ipc.ts +38 -0
- package/src/utils/jj.ts +295 -0
- package/src/utils/lang-from-path.ts +244 -0
- package/src/utils/markit-cache.ts +166 -0
- package/src/utils/markit.ts +211 -0
- package/src/utils/mupdf-wasm-embed.ts +12 -0
- package/src/utils/open.ts +100 -0
- package/src/utils/prompt-path.ts +3 -0
- package/src/utils/qrcode.ts +535 -0
- package/src/utils/session-color.ts +142 -0
- package/src/utils/shell-snapshot-fn-env.sh +60 -0
- package/src/utils/shell-snapshot.ts +306 -0
- package/src/utils/sixel.ts +69 -0
- package/src/utils/thinking-display.ts +117 -0
- package/src/utils/title-generator.ts +348 -0
- package/src/utils/tool-choice.ts +49 -0
- package/src/utils/tools-manager.ts +429 -0
- package/src/utils/turndown.ts +83 -0
- package/src/utils/zip.ts +1091 -0
- package/src/web/kagi.ts +304 -0
- package/src/web/parallel.ts +354 -0
- package/src/web/scrapers/artifacthub.ts +207 -0
- package/src/web/scrapers/arxiv.ts +83 -0
- package/src/web/scrapers/aur.ts +162 -0
- package/src/web/scrapers/biorxiv.ts +133 -0
- package/src/web/scrapers/bluesky.ts +262 -0
- package/src/web/scrapers/brew.ts +172 -0
- package/src/web/scrapers/cheatsh.ts +68 -0
- package/src/web/scrapers/chocolatey.ts +196 -0
- package/src/web/scrapers/choosealicense.ts +95 -0
- package/src/web/scrapers/cisa-kev.ts +87 -0
- package/src/web/scrapers/clojars.ts +154 -0
- package/src/web/scrapers/coingecko.ts +177 -0
- package/src/web/scrapers/crates-io.ts +97 -0
- package/src/web/scrapers/crossref.ts +136 -0
- package/src/web/scrapers/devto.ts +147 -0
- package/src/web/scrapers/discogs.ts +306 -0
- package/src/web/scrapers/discourse.ts +197 -0
- package/src/web/scrapers/dockerhub.ts +138 -0
- package/src/web/scrapers/docs-rs.ts +652 -0
- package/src/web/scrapers/fdroid.ts +134 -0
- package/src/web/scrapers/firefox-addons.ts +191 -0
- package/src/web/scrapers/flathub.ts +223 -0
- package/src/web/scrapers/github-gist.ts +58 -0
- package/src/web/scrapers/github.ts +800 -0
- package/src/web/scrapers/gitlab.ts +401 -0
- package/src/web/scrapers/go-pkg.ts +266 -0
- package/src/web/scrapers/hackage.ts +140 -0
- package/src/web/scrapers/hackernews.ts +189 -0
- package/src/web/scrapers/hex.ts +105 -0
- package/src/web/scrapers/huggingface.ts +321 -0
- package/src/web/scrapers/iacr.ts +89 -0
- package/src/web/scrapers/index.ts +252 -0
- package/src/web/scrapers/jetbrains-marketplace.ts +159 -0
- package/src/web/scrapers/lemmy.ts +203 -0
- package/src/web/scrapers/lobsters.ts +175 -0
- package/src/web/scrapers/mastodon.ts +292 -0
- package/src/web/scrapers/maven.ts +138 -0
- package/src/web/scrapers/mdn.ts +173 -0
- package/src/web/scrapers/metacpan.ts +222 -0
- package/src/web/scrapers/musicbrainz.ts +250 -0
- package/src/web/scrapers/npm.ts +98 -0
- package/src/web/scrapers/nuget.ts +183 -0
- package/src/web/scrapers/nvd.ts +222 -0
- package/src/web/scrapers/ollama.ts +239 -0
- package/src/web/scrapers/open-vsx.ts +106 -0
- package/src/web/scrapers/opencorporates.ts +292 -0
- package/src/web/scrapers/openlibrary.ts +336 -0
- package/src/web/scrapers/orcid.ts +286 -0
- package/src/web/scrapers/osv.ts +176 -0
- package/src/web/scrapers/packagist.ts +160 -0
- package/src/web/scrapers/pub-dev.ts +143 -0
- package/src/web/scrapers/pubmed.ts +211 -0
- package/src/web/scrapers/pypi.ts +112 -0
- package/src/web/scrapers/rawg.ts +110 -0
- package/src/web/scrapers/readthedocs.ts +120 -0
- package/src/web/scrapers/reddit.ts +95 -0
- package/src/web/scrapers/repology.ts +251 -0
- package/src/web/scrapers/rfc.ts +201 -0
- package/src/web/scrapers/rubygems.ts +103 -0
- package/src/web/scrapers/searchcode.ts +189 -0
- package/src/web/scrapers/sec-edgar.ts +261 -0
- package/src/web/scrapers/semantic-scholar.ts +171 -0
- package/src/web/scrapers/snapcraft.ts +187 -0
- package/src/web/scrapers/sourcegraph.ts +336 -0
- package/src/web/scrapers/spdx.ts +108 -0
- package/src/web/scrapers/spotify.ts +198 -0
- package/src/web/scrapers/stackoverflow.ts +120 -0
- package/src/web/scrapers/terraform.ts +277 -0
- package/src/web/scrapers/tldr.ts +47 -0
- package/src/web/scrapers/twitter.ts +94 -0
- package/src/web/scrapers/types.ts +354 -0
- package/src/web/scrapers/utils.ts +109 -0
- package/src/web/scrapers/vimeo.ts +133 -0
- package/src/web/scrapers/vscode-marketplace.ts +187 -0
- package/src/web/scrapers/w3c.ts +156 -0
- package/src/web/scrapers/wikidata.ts +344 -0
- package/src/web/scrapers/wikipedia.ts +84 -0
- package/src/web/scrapers/youtube.ts +325 -0
- package/src/web/search/index.ts +312 -0
- package/src/web/search/provider.ts +214 -0
- package/src/web/search/providers/anthropic.ts +343 -0
- package/src/web/search/providers/base.ts +91 -0
- package/src/web/search/providers/brave.ts +152 -0
- package/src/web/search/providers/codex.ts +593 -0
- package/src/web/search/providers/duckduckgo.ts +212 -0
- package/src/web/search/providers/exa.ts +484 -0
- package/src/web/search/providers/firecrawl.ts +144 -0
- package/src/web/search/providers/gemini.ts +618 -0
- package/src/web/search/providers/jina.ts +111 -0
- package/src/web/search/providers/kagi.ts +86 -0
- package/src/web/search/providers/kimi.ts +196 -0
- package/src/web/search/providers/parallel.ts +136 -0
- package/src/web/search/providers/perplexity-auth.ts +133 -0
- package/src/web/search/providers/perplexity.ts +878 -0
- package/src/web/search/providers/searxng.ts +325 -0
- package/src/web/search/providers/synthetic.ts +114 -0
- package/src/web/search/providers/tavily.ts +193 -0
- package/src/web/search/providers/tinyfish.ts +159 -0
- package/src/web/search/providers/utils.ts +128 -0
- package/src/web/search/providers/xai.ts +292 -0
- package/src/web/search/providers/zai.ts +419 -0
- package/src/web/search/render.ts +262 -0
- package/src/web/search/types.ts +470 -0
- package/src/web/search/utils.ts +17 -0
- package/src/workspace-tree.ts +326 -0
|
@@ -0,0 +1,1141 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import { isBuiltin } from "node:module";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import * as url from "node:url";
|
|
5
|
+
import { isCompiledBinary, stripWindowsExtendedLengthPathPrefix } from "@oh-my-pi-zen/pi-utils";
|
|
6
|
+
import { registerPluginCacheInvalidator } from "../../discovery/helpers";
|
|
7
|
+
import { BUNDLED_PI_REGISTRY_KEYS } from "./legacy-pi-bundled-keys";
|
|
8
|
+
|
|
9
|
+
const IS_COMPILED_BINARY = isCompiledBinary();
|
|
10
|
+
|
|
11
|
+
// === Bundled host-package registry (issue #3423) ===
|
|
12
|
+
//
|
|
13
|
+
// Bun 1.3.14 stopped exposing `--compile` extras through any filesystem-style
|
|
14
|
+
// API: `fs.existsSync`, `Bun.file().exists()`, `Bun.resolveSync`, and even
|
|
15
|
+
// `import("/$bunfs/...")` / `import("file:///$bunfs/...")` all fail for the
|
|
16
|
+
// embedded entries — only the main binary itself answers from
|
|
17
|
+
// `/$bunfs/root/<binary-name>`. The previous strategy of rewriting
|
|
18
|
+
// `@(scope)/pi-*` imports to a `file:///$bunfs/...` URL therefore breaks
|
|
19
|
+
// every legacy extension in compiled mode (issue #3423; see also issues
|
|
20
|
+
// #3329, #2168). Bun.plugin `onResolve` for bare specifiers also no longer
|
|
21
|
+
// fires for transitive imports inside runtime-loaded extensions, so the
|
|
22
|
+
// fallback hook in `installLegacyPiSpecifierShim()` cannot rescue them.
|
|
23
|
+
//
|
|
24
|
+
// Instead we keep a JS-heap reference to every bundled pi-* surface (the
|
|
25
|
+
// canonical host packages and the legacy shims) and re-export them through a
|
|
26
|
+
// Bun.plugin `onLoad` against a custom namespace. Extension source rewrites
|
|
27
|
+
// emit `omp-legacy-pi-bundled:<key>` specifiers that the synthetic loader
|
|
28
|
+
// resolves against the registry — no bunfs path ever leaves this module in
|
|
29
|
+
// compiled mode. Dev / source-link / installed-package modes keep the
|
|
30
|
+
// historical `file://` rewrite (the source files exist on disk and load fine
|
|
31
|
+
// through Bun's standard URL loader).
|
|
32
|
+
//
|
|
33
|
+
// The registry lives in a sibling file (`legacy-pi-bundled-registry.ts`)
|
|
34
|
+
// loaded via a conditional dynamic import: its transitive deps include the
|
|
35
|
+
// coding-agent root which pulls in generated artifacts (e.g.
|
|
36
|
+
// `export/html/tool-views.generated.js`) that only exist after a build, so a
|
|
37
|
+
// static import would crash every dev/test run that touches
|
|
38
|
+
// `legacy-pi-compat.ts`. This is the documented "conditional platform code"
|
|
39
|
+
// exception to the static-import rule.
|
|
40
|
+
const BUNDLED_VIRTUAL_SCHEME = "omp-legacy-pi-bundled:";
|
|
41
|
+
const BUNDLED_VIRTUAL_NAMESPACE = "omp-legacy-pi-bundled";
|
|
42
|
+
const BUNDLED_REGISTRY_GLOBAL = "__ompLegacyPiBundledRegistry";
|
|
43
|
+
const TYPEBOX_BUNDLED_REGISTRY_KEY = "typebox";
|
|
44
|
+
|
|
45
|
+
type BundledRegistry = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
46
|
+
|
|
47
|
+
let bundledRegistryPromise: Promise<BundledRegistry> | null = null;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Lazy-load the bundled host-package registry and stash it on `globalThis`
|
|
51
|
+
* for the synthetic loader emitted by `synthesizeBundledModuleSource`.
|
|
52
|
+
*
|
|
53
|
+
* `globalThis` is the bridge, not laziness: each synthesized
|
|
54
|
+
* `omp-legacy-pi-bundled:<key>` module is a *separate* ES module Bun compiles
|
|
55
|
+
* from a source string, so it cannot close over the registry in this file's
|
|
56
|
+
* lexical scope and the live (non-serializable) function/object exports cannot
|
|
57
|
+
* be inlined — the only runtime channel back to the host objects is a global.
|
|
58
|
+
*
|
|
59
|
+
* The dynamic import is gated by `IS_COMPILED_BINARY` so dev/test runs (where
|
|
60
|
+
* the registry's transitive deps include build-time-generated artifacts)
|
|
61
|
+
* never trigger the cascade.
|
|
62
|
+
*/
|
|
63
|
+
function ensureBundledRegistryLoaded(): Promise<BundledRegistry> {
|
|
64
|
+
if (!IS_COMPILED_BINARY) {
|
|
65
|
+
return Promise.reject(
|
|
66
|
+
new Error("omp:legacy-pi-shim: bundled registry is only available in compiled-binary mode"),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
if (!bundledRegistryPromise) {
|
|
70
|
+
bundledRegistryPromise = import("./legacy-pi-bundled-registry").then(m => {
|
|
71
|
+
(globalThis as Record<string, unknown>)[BUNDLED_REGISTRY_GLOBAL] = m.BUNDLED_PI_REGISTRY;
|
|
72
|
+
return m.BUNDLED_PI_REGISTRY;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return bundledRegistryPromise;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function bundledRegistryVirtualSpecifier(registryKey: string): string {
|
|
79
|
+
return `${BUNDLED_VIRTUAL_SCHEME}${registryKey}`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function isBundledVirtualSpecifier(value: string): boolean {
|
|
83
|
+
return value.startsWith(BUNDLED_VIRTUAL_SCHEME);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Build the synthetic ES module source for a `omp-legacy-pi-bundled:<key>`
|
|
88
|
+
* import against an explicit registry. Pure: takes the live module namespace
|
|
89
|
+
* and emits a string of ES exports rooted in `globalThis[BUNDLED_REGISTRY_GLOBAL]`.
|
|
90
|
+
* `synthesizeBundledModuleSource` wraps this with the lazy registry load —
|
|
91
|
+
* tests use this sync helper directly to assert export-shape preservation.
|
|
92
|
+
*/
|
|
93
|
+
function synthesizeBundledModuleSourceFromRegistry(registryKey: string, registry: BundledRegistry): string {
|
|
94
|
+
const mod = registry[registryKey];
|
|
95
|
+
if (!mod) {
|
|
96
|
+
throw new Error(`omp:legacy-pi-shim: no bundled module registered for ${registryKey}`);
|
|
97
|
+
}
|
|
98
|
+
const lines: string[] = [
|
|
99
|
+
`const __omp_bundled = globalThis[${JSON.stringify(BUNDLED_REGISTRY_GLOBAL)}][${JSON.stringify(registryKey)}];`,
|
|
100
|
+
];
|
|
101
|
+
let hasDefault = false;
|
|
102
|
+
for (const exportName in mod) {
|
|
103
|
+
if (exportName === "default") {
|
|
104
|
+
hasDefault = true;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
lines.push(`export const ${exportName} = __omp_bundled[${JSON.stringify(exportName)}];`);
|
|
108
|
+
}
|
|
109
|
+
if (hasDefault) {
|
|
110
|
+
lines.push("export default __omp_bundled.default;");
|
|
111
|
+
}
|
|
112
|
+
lines.push("");
|
|
113
|
+
return lines.join("\n");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Build the synthetic ES module source served for an
|
|
118
|
+
* `omp-legacy-pi-bundled:<key>` import. Enumerates the live module namespace
|
|
119
|
+
* so legacy extensions see the same named/default exports they would have
|
|
120
|
+
* gotten from a real `file://` load — without touching the inaccessible bunfs
|
|
121
|
+
* filesystem.
|
|
122
|
+
*/
|
|
123
|
+
async function synthesizeBundledModuleSource(registryKey: string): Promise<string> {
|
|
124
|
+
const registry = await ensureBundledRegistryLoaded();
|
|
125
|
+
return synthesizeBundledModuleSourceFromRegistry(registryKey, registry);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Test seam: builds the synthetic ES module source for a virtual specifier
|
|
130
|
+
* against an explicit registry. Pure (no globalThis read); the emitted source
|
|
131
|
+
* still routes runtime lookups through `globalThis[BUNDLED_REGISTRY_GLOBAL]`.
|
|
132
|
+
*/
|
|
133
|
+
export function __synthesizeLegacyPiBundledSourceWithRegistry(
|
|
134
|
+
registryKey: string,
|
|
135
|
+
registry: Readonly<Record<string, Readonly<Record<string, unknown>>>>,
|
|
136
|
+
): string {
|
|
137
|
+
return synthesizeBundledModuleSourceFromRegistry(registryKey, registry);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Test seam: returns the globalThis key the synthetic loader reads from. Tests
|
|
142
|
+
* assert that the emitted source addresses the exact stash key the install
|
|
143
|
+
* function writes to, so a rename can't break extension loads silently.
|
|
144
|
+
*/
|
|
145
|
+
export function __getLegacyPiBundledRegistryGlobal(): string {
|
|
146
|
+
return BUNDLED_REGISTRY_GLOBAL;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Canonical scope for in-process pi packages. Plugins published against any of
|
|
150
|
+
// the aliased scopes below (mariozechner's original publish, earendil-works'
|
|
151
|
+
// fork, or the canonical @oh-my-pi scope itself) are remapped to this scope and
|
|
152
|
+
// resolved against the bundled copy that ships inside the omp binary. This
|
|
153
|
+
// keeps plugins running against the exact runtime state of the host (single
|
|
154
|
+
// module registry, single tool registry, etc.) regardless of which historical
|
|
155
|
+
// scope name they happened to declare in their peerDependencies.
|
|
156
|
+
const CANONICAL_PI_SCOPE = "@oh-my-pi";
|
|
157
|
+
|
|
158
|
+
// Scopes that have historically been used to publish (or alias) the same set
|
|
159
|
+
// of internal pi-* packages. `@oh-my-pi` is intentionally included so direct
|
|
160
|
+
// canonical imports still pass through the same host-bundled package resolution
|
|
161
|
+
// path instead of pulling a duplicate copy from plugin node_modules.
|
|
162
|
+
const PI_SCOPE_ALIASES = ["oh-my-pi", "mariozechner", "earendil-works"] as const;
|
|
163
|
+
|
|
164
|
+
// Internal pi-* package basenames bundled inside the omp binary.
|
|
165
|
+
const PI_PACKAGE_NAMES = ["pi-agent-core", "pi-ai", "pi-coding-agent", "pi-natives", "pi-tui", "pi-utils"] as const;
|
|
166
|
+
|
|
167
|
+
const PI_SCOPE_ALTERNATION = PI_SCOPE_ALIASES.join("|");
|
|
168
|
+
const PI_PACKAGE_ALTERNATION = PI_PACKAGE_NAMES.join("|");
|
|
169
|
+
|
|
170
|
+
// Upstream `@mariozechner/*` packages exposed a few subpaths at the package
|
|
171
|
+
// root that we relocated under a different folder. Each entry rewrites
|
|
172
|
+
// `<pkg>/<from>` → `<pkg>/<to>` after the scope has been canonicalised, so
|
|
173
|
+
// plugins importing the upstream layout still resolve to a real file in our
|
|
174
|
+
// bundled copy. Entries ending in `/` rewrite the whole subtree; add new
|
|
175
|
+
// `pkg/from -> pkg/to` pairs whenever an upstream-only subpath breaks resolution.
|
|
176
|
+
const PI_SUBPATH_REMAPS: ReadonlyMap<string, string> = new Map<string, string>([
|
|
177
|
+
["pi-ai/utils/oauth", "pi-ai/oauth"],
|
|
178
|
+
["pi-ai/utils/oauth/", "pi-ai/oauth/"],
|
|
179
|
+
]);
|
|
180
|
+
|
|
181
|
+
function remapLegacyPiSubpath(rest: string): string {
|
|
182
|
+
const exact = PI_SUBPATH_REMAPS.get(rest);
|
|
183
|
+
if (exact) {
|
|
184
|
+
return exact;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
for (const [from, to] of PI_SUBPATH_REMAPS) {
|
|
188
|
+
if (from.endsWith("/") && rest.startsWith(from)) {
|
|
189
|
+
return `${to}${rest.slice(from.length)}`;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return rest;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const LEGACY_PI_SPECIFIER_FILTER = new RegExp(`^@(?:${PI_SCOPE_ALTERNATION})/(?:${PI_PACKAGE_ALTERNATION})(?:/.*)?$`);
|
|
197
|
+
const LEGACY_PI_IMPORT_SPECIFIER_REGEX = new RegExp(
|
|
198
|
+
`((?:from\\s+|import\\s+|import\\s*\\(\\s*)["'])(@(?:${PI_SCOPE_ALTERNATION})/(?:${PI_PACKAGE_ALTERNATION})(?:/[^"'()\\s]+)?)(["'])`,
|
|
199
|
+
"g",
|
|
200
|
+
);
|
|
201
|
+
const resolvedSpecifierFallbacks = new Map<string, string>();
|
|
202
|
+
const SOURCE_MODULE_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"] as const;
|
|
203
|
+
const SUPPORTED_PACKAGE_IMPORT_CONDITIONS = new Set(["bun", "node", "import", "default"]);
|
|
204
|
+
const packageRootCache = new Map<string, string | null>();
|
|
205
|
+
const packageImportsCache = new Map<string, Record<string, unknown> | null>();
|
|
206
|
+
const nodePackageRootCache = new Map<string, Promise<string | null>>();
|
|
207
|
+
const packageManifestCache = new Map<string, Promise<Record<string, unknown> | null>>();
|
|
208
|
+
const bareDependencyResolutionCache = new Map<string, Promise<string | null>>();
|
|
209
|
+
const realpathCache = new Map<string, Promise<string>>();
|
|
210
|
+
|
|
211
|
+
function clearLegacyPiResolutionCaches(): void {
|
|
212
|
+
resolvedSpecifierFallbacks.clear();
|
|
213
|
+
packageRootCache.clear();
|
|
214
|
+
packageImportsCache.clear();
|
|
215
|
+
nodePackageRootCache.clear();
|
|
216
|
+
packageManifestCache.clear();
|
|
217
|
+
bareDependencyResolutionCache.clear();
|
|
218
|
+
realpathCache.clear();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
registerPluginCacheInvalidator(clearLegacyPiResolutionCaches);
|
|
222
|
+
const PACKAGE_IMPORT_EXCLUDED = Symbol("packageImportExcluded");
|
|
223
|
+
|
|
224
|
+
// Extensions that imported TypeBox directly used to resolve against a real
|
|
225
|
+
// `@sinclair/typebox` or `typebox` install. The runtime dep was replaced with
|
|
226
|
+
// the Zod-backed shim under `extensibility/typebox.ts`; plugins still importing
|
|
227
|
+
// either public name are redirected to that shim so existing extensions keep
|
|
228
|
+
// working without code changes. Submodules like `@sinclair/typebox/compiler`
|
|
229
|
+
// are intentionally not remapped — those expose TypeBox-only APIs the shim does
|
|
230
|
+
// not provide and plugins relying on them must vendor TypeBox directly.
|
|
231
|
+
const TYPEBOX_SPECIFIER_FILTER = /^(?:@sinclair\/typebox|typebox)$/;
|
|
232
|
+
|
|
233
|
+
// Compat-shim path resolution. In compiled-binary mode every bundled surface
|
|
234
|
+
// is served through the `omp-legacy-pi-bundled:` virtual namespace (see the
|
|
235
|
+
// registry block above) — bunfs paths are unreachable on Bun 1.3.14+, so the
|
|
236
|
+
// pre-#3423 helpers that derived `/$bunfs/root/...` paths from
|
|
237
|
+
// `import.meta.dir` are gone. Dev / source-link / installed-package modes
|
|
238
|
+
// still need a real filesystem path for the source shims, which
|
|
239
|
+
// `sourceShimPath` computes either from the npm prebuilt `dist/cli.js`
|
|
240
|
+
// bundle (`PI_BUNDLED=true`) or directly from the monorepo source tree.
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Compute the package root for the npm prebuilt `dist/cli.js` bundle.
|
|
244
|
+
*
|
|
245
|
+
* `bundle-dist.ts` defines `process.env.PI_BUNDLED="true"`; after bundling,
|
|
246
|
+
* `import.meta.dir` points at `<package>/dist`. Do not resolve the package via
|
|
247
|
+
* bare `@oh-my-pi-zen/pi-coding-agent` here: from a global install Bun can pick an
|
|
248
|
+
* older cache entry, recreating mixed-runtime plugin loading.
|
|
249
|
+
*/
|
|
250
|
+
export function __computeBundledSelfPackageRoot(metaDir: string, pathImpl: typeof path = path): string {
|
|
251
|
+
const normalizedMetaDir = pathImpl.normalize(metaDir);
|
|
252
|
+
if (pathImpl.basename(normalizedMetaDir) === "dist") {
|
|
253
|
+
return pathImpl.resolve(metaDir, "..");
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const pluginsDirSuffix = pathImpl.join("src", "extensibility", "plugins");
|
|
257
|
+
if (normalizedMetaDir.endsWith(pluginsDirSuffix)) {
|
|
258
|
+
return pathImpl.resolve(metaDir, "..", "..", "..");
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return pathImpl.resolve(metaDir);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function resolveBundledSelfPackageRoot(): string | undefined {
|
|
265
|
+
if (!process.env.PI_BUNDLED) return undefined;
|
|
266
|
+
return __computeBundledSelfPackageRoot(import.meta.dir);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const BUNDLED_SELF_PACKAGE_ROOT = resolveBundledSelfPackageRoot();
|
|
270
|
+
|
|
271
|
+
function sourceShimPath(file: string): string {
|
|
272
|
+
return BUNDLED_SELF_PACKAGE_ROOT
|
|
273
|
+
? path.join(BUNDLED_SELF_PACKAGE_ROOT, "src", "extensibility", file)
|
|
274
|
+
: path.resolve(import.meta.dir, "..", file);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Resolve the path the TypeBox compatibility shim ships at, then drop it when
|
|
279
|
+
* the source file is missing.
|
|
280
|
+
*
|
|
281
|
+
* In compiled-binary mode the shim is served through the
|
|
282
|
+
* `omp-legacy-pi-bundled:` virtual namespace (issue #3423) — bunfs paths are
|
|
283
|
+
* unreachable on Bun 1.3.14+, so the virtual specifier is always available and
|
|
284
|
+
* needs no filesystem probe. In dev / source-link / installed-package mode the
|
|
285
|
+
* shim is an on-disk source file; validation mirrors
|
|
286
|
+
* `__validateLegacyPiPackageRootOverrides` (#2168): if the computed candidate
|
|
287
|
+
* doesn't exist (e.g. an install that dropped the source — issue #3414),
|
|
288
|
+
* `resolveTypeBoxSpecifier` returns `undefined` and
|
|
289
|
+
* `rewriteLegacyExtensionSource` leaves bare `typebox` / `@sinclair/typebox`
|
|
290
|
+
* specifiers alone, so Bun falls through to native resolution against the
|
|
291
|
+
* extension's own `node_modules`.
|
|
292
|
+
*
|
|
293
|
+
* Exported for tests; production callers use `TYPEBOX_SHIM_PATH`.
|
|
294
|
+
*/
|
|
295
|
+
export function __resolveTypeBoxShimPath(
|
|
296
|
+
isCompiled: boolean,
|
|
297
|
+
sourcePath: string,
|
|
298
|
+
pathExistsSync: (p: string) => boolean = fs.existsSync,
|
|
299
|
+
): string | null {
|
|
300
|
+
if (isCompiled) {
|
|
301
|
+
return bundledRegistryVirtualSpecifier(TYPEBOX_BUNDLED_REGISTRY_KEY);
|
|
302
|
+
}
|
|
303
|
+
return pathExistsSync(sourcePath) ? sourcePath : null;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const TYPEBOX_SHIM_PATH = __resolveTypeBoxShimPath(IS_COMPILED_BINARY, sourceShimPath("typebox.ts"));
|
|
307
|
+
|
|
308
|
+
// Legacy extensions historically imported `Type` (and `Static`/`TSchema`) from
|
|
309
|
+
// the package root of `@(scope)/pi-ai`. pi-ai 15.1.0 removed the runtime `Type`
|
|
310
|
+
// export (see `packages/ai/CHANGELOG.md`), so the bare canonical specifier no
|
|
311
|
+
// longer satisfies those imports. The override below redirects only the bare
|
|
312
|
+
// pi-ai package root onto a sibling shim that re-exports the canonical surface
|
|
313
|
+
// plus the borrowed `Type` runtime from the Zod-backed TypeBox shim. Subpath
|
|
314
|
+
// imports such as `@oh-my-pi-zen/pi-ai/oauth` continue to resolve directly
|
|
315
|
+
// against the bundled pi-ai package.
|
|
316
|
+
const LEGACY_PI_AI_SHIM_PATH = IS_COMPILED_BINARY
|
|
317
|
+
? bundledRegistryVirtualSpecifier(`${CANONICAL_PI_SCOPE}/pi-ai`)
|
|
318
|
+
: sourceShimPath("legacy-pi-ai-shim.ts");
|
|
319
|
+
|
|
320
|
+
// The coding-agent's own `./src/index.ts` cannot be listed as an extra
|
|
321
|
+
// `bun --compile` entrypoint alongside the CLI entry without breaking binary
|
|
322
|
+
// startup (issue #1474 follow-up). In compiled-binary mode the legacy
|
|
323
|
+
// `@(scope)/pi-coding-agent` root therefore resolves through the bundled
|
|
324
|
+
// registry shim; in dev / source-link / installed-package mode it points at
|
|
325
|
+
// the sibling source shim whose distinct file path avoids the #1474 collision
|
|
326
|
+
// while still re-exporting the canonical package surface.
|
|
327
|
+
const LEGACY_PI_CODING_AGENT_SHIM_PATH = IS_COMPILED_BINARY
|
|
328
|
+
? bundledRegistryVirtualSpecifier(`${CANONICAL_PI_SCOPE}/pi-coding-agent`)
|
|
329
|
+
: sourceShimPath("legacy-pi-coding-agent-shim.ts");
|
|
330
|
+
|
|
331
|
+
// Package-root overrides. Shim entries (`pi-ai`, `pi-coding-agent`) always
|
|
332
|
+
// replace the canonical surface so the legacy `Type` runtime and the legacy
|
|
333
|
+
// helpers stay reachable. The bundled host packages (`pi-agent-core`,
|
|
334
|
+
// `pi-natives`, `pi-tui`, `pi-utils`) are added only in compiled-binary mode
|
|
335
|
+
// to route extensions onto the in-process module instance — in dev /
|
|
336
|
+
// source-link / installed-package mode the canonical specifier resolves
|
|
337
|
+
// cleanly through `Bun.resolveSync` and hardcoding a source-tree path would
|
|
338
|
+
// miss installs where the bundled packages live at `node_modules/@oh-my-pi-zen/pi-*`.
|
|
339
|
+
//
|
|
340
|
+
// Compiled-binary entries are `omp-legacy-pi-bundled:<key>` specifiers handed
|
|
341
|
+
// to the synthetic onLoad in `installLegacyPiSpecifierShim()` — bunfs paths
|
|
342
|
+
// are unusable on Bun 1.3.14+ (issue #3423). Filesystem-shaped overrides are
|
|
343
|
+
// still validated against on-disk presence so a missing dev-mode shim falls
|
|
344
|
+
// through to `getResolvedSpecifier`.
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Drop overrides whose filesystem targets are missing so they can fall
|
|
348
|
+
* through to the canonical-resolution path. Virtual `omp-legacy-pi-bundled:`
|
|
349
|
+
* entries always pass — the bundled registry is the source of truth in
|
|
350
|
+
* compiled-binary mode where bunfs paths are unreachable (issue #3423).
|
|
351
|
+
*
|
|
352
|
+
* `pathExistsSync` defaults to `fs.existsSync`; tests inject a stub to
|
|
353
|
+
* simulate the missing-entrypoint failure mode without touching the real FS.
|
|
354
|
+
*/
|
|
355
|
+
export function __validateLegacyPiPackageRootOverrides(
|
|
356
|
+
candidates: Record<string, string>,
|
|
357
|
+
pathExistsSync: (p: string) => boolean = fs.existsSync,
|
|
358
|
+
): Record<string, string> {
|
|
359
|
+
return Object.fromEntries(
|
|
360
|
+
Object.entries(candidates).filter(
|
|
361
|
+
([, candidate]) => isBundledVirtualSpecifier(candidate) || pathExistsSync(candidate),
|
|
362
|
+
),
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Compute the override map keyed by every canonical specifier the host serves
|
|
368
|
+
* directly: the pi-ai / pi-coding-agent roots (compat shims that re-attach
|
|
369
|
+
* legacy helpers) plus, in compiled-binary mode, every other canonical pi-*
|
|
370
|
+
* package root AND every non-wildcard subpath registered in the bundled
|
|
371
|
+
* registry (see `legacy-pi-bundled-keys.ts`). Subpath coverage is what stops
|
|
372
|
+
* `@(scope)/pi-ai/oauth` and friends from falling through to the extension's
|
|
373
|
+
* own — possibly absent — peer install when bunfs filesystem walks fail
|
|
374
|
+
* (issue #3442 follow-up to #3423). Exported as a test seam so the
|
|
375
|
+
* compiled-binary branch is verifiable from dev tests.
|
|
376
|
+
*/
|
|
377
|
+
export function __buildLegacyPiPackageRootOverrides(isCompiled: boolean): Record<string, string> {
|
|
378
|
+
const candidates: Record<string, string> = {
|
|
379
|
+
[`${CANONICAL_PI_SCOPE}/pi-ai`]: LEGACY_PI_AI_SHIM_PATH,
|
|
380
|
+
[`${CANONICAL_PI_SCOPE}/pi-coding-agent`]: LEGACY_PI_CODING_AGENT_SHIM_PATH,
|
|
381
|
+
};
|
|
382
|
+
if (isCompiled) {
|
|
383
|
+
for (const key of BUNDLED_PI_REGISTRY_KEYS) {
|
|
384
|
+
// Shim-bearing roots above already mapped to their compat surface;
|
|
385
|
+
// the bundled typebox shim has a dedicated TYPEBOX_SHIM_PATH route.
|
|
386
|
+
if (key in candidates || key === TYPEBOX_BUNDLED_REGISTRY_KEY) continue;
|
|
387
|
+
candidates[key] = bundledRegistryVirtualSpecifier(key);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return __validateLegacyPiPackageRootOverrides(candidates);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const LEGACY_PI_PACKAGE_ROOT_OVERRIDES = __buildLegacyPiPackageRootOverrides(IS_COMPILED_BINARY);
|
|
394
|
+
|
|
395
|
+
let isLegacyPiSpecifierShimInstalled = false;
|
|
396
|
+
|
|
397
|
+
function remapLegacyPiSpecifier(specifier: string): string | null {
|
|
398
|
+
if (!LEGACY_PI_SPECIFIER_FILTER.test(specifier)) {
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
const slashIdx = specifier.indexOf("/", 1);
|
|
402
|
+
// Filter guarantees a slash exists, but guard anyway to keep the type narrow.
|
|
403
|
+
if (slashIdx === -1) {
|
|
404
|
+
return null;
|
|
405
|
+
}
|
|
406
|
+
const rest = specifier.slice(slashIdx + 1);
|
|
407
|
+
const remappedSubpath = remapLegacyPiSubpath(rest);
|
|
408
|
+
return `${CANONICAL_PI_SCOPE}/${remappedSubpath}`;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function getResolvedSpecifier(specifier: string): string {
|
|
412
|
+
const cached = resolvedSpecifierFallbacks.get(specifier);
|
|
413
|
+
if (cached) {
|
|
414
|
+
return cached;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
const resolved = Bun.resolveSync(specifier, import.meta.dir);
|
|
418
|
+
resolvedSpecifierFallbacks.set(specifier, resolved);
|
|
419
|
+
return resolved;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Resolve a canonical `@oh-my-pi-zen/*` specifier to a filesystem path, preferring
|
|
424
|
+
* a bundled compat shim when one is registered for the package root.
|
|
425
|
+
*
|
|
426
|
+
* Falls back to `getResolvedSpecifier` (which may throw under compiled binary
|
|
427
|
+
* mode); callers handle that the same way they would for non-overridden
|
|
428
|
+
* specifiers.
|
|
429
|
+
*/
|
|
430
|
+
function resolveCanonicalPiSpecifier(remappedSpecifier: string): string {
|
|
431
|
+
const override = LEGACY_PI_PACKAGE_ROOT_OVERRIDES[remappedSpecifier];
|
|
432
|
+
if (override) {
|
|
433
|
+
return override;
|
|
434
|
+
}
|
|
435
|
+
return getResolvedSpecifier(remappedSpecifier);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
function toImportSpecifier(resolvedPath: string): string {
|
|
439
|
+
// Virtual `omp-legacy-pi-bundled:` specifiers are served by the synthetic
|
|
440
|
+
// onLoad in `installLegacyPiSpecifierShim()`; wrapping them as `file://`
|
|
441
|
+
// would corrupt the scheme and bypass the bundled registry.
|
|
442
|
+
if (isBundledVirtualSpecifier(resolvedPath)) {
|
|
443
|
+
return resolvedPath;
|
|
444
|
+
}
|
|
445
|
+
return url.pathToFileURL(stripWindowsExtendedLengthPathPrefix(resolvedPath)).href;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function rewriteLegacyPiImports(source: string): string {
|
|
449
|
+
return source.replace(
|
|
450
|
+
LEGACY_PI_IMPORT_SPECIFIER_REGEX,
|
|
451
|
+
(match, prefix: string, specifier: string, suffix: string) => {
|
|
452
|
+
const remappedSpecifier = remapLegacyPiSpecifier(specifier);
|
|
453
|
+
if (!remappedSpecifier) {
|
|
454
|
+
return match;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
try {
|
|
458
|
+
return `${prefix}${toImportSpecifier(resolveCanonicalPiSpecifier(remappedSpecifier))}${suffix}`;
|
|
459
|
+
} catch {
|
|
460
|
+
// Resolution failed — typically in compiled binary mode where
|
|
461
|
+
// Bun.resolveSync cannot walk up from /$bunfs/root to find the
|
|
462
|
+
// bundled node_modules. Leave the specifier unchanged so Bun
|
|
463
|
+
// resolves it natively against the extension's own peer deps.
|
|
464
|
+
return match;
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// Match the bare TypeBox import specifiers (static + dynamic). Subpath imports
|
|
471
|
+
// like `@sinclair/typebox/compiler` are intentionally excluded — they expose
|
|
472
|
+
// TypeBox-only APIs the Zod-backed shim does not provide.
|
|
473
|
+
const TYPEBOX_IMPORT_SPECIFIER_REGEX = /((?:from\s+|import\s+|import\s*\(\s*)["'])(@sinclair\/typebox|typebox)(["'])/g;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Rewrite the extension-owned specifiers OMP must host-resolve — legacy
|
|
477
|
+
* `@(scope)/pi-*`, bare TypeBox packages, package `imports` aliases like
|
|
478
|
+
* `#src/*`, and extension-local bare dependencies — to absolute `file://` URLs
|
|
479
|
+
* or compiled-mode virtual specifiers. Relative siblings and built-in modules
|
|
480
|
+
* are left untouched so Bun resolves them from the extension's real on-disk
|
|
481
|
+
* location.
|
|
482
|
+
*/
|
|
483
|
+
async function rewriteLegacyExtensionSource(source: string, importerPath: string): Promise<string> {
|
|
484
|
+
const withPi = rewriteLegacyPiImports(source);
|
|
485
|
+
// When the TypeBox shim is missing (release build dropped the entrypoint —
|
|
486
|
+
// issue #3414), leave bare specifiers untouched so Bun resolves a real
|
|
487
|
+
// `typebox` / `@sinclair/typebox` install from the extension's own
|
|
488
|
+
// `node_modules`. `resolveTypeBoxSpecifier` mirrors the fall-through.
|
|
489
|
+
const withTypeBox = TYPEBOX_SHIM_PATH
|
|
490
|
+
? withPi.replace(
|
|
491
|
+
TYPEBOX_IMPORT_SPECIFIER_REGEX,
|
|
492
|
+
(_match, prefix: string, _specifier: string, suffix: string) =>
|
|
493
|
+
`${prefix}${toImportSpecifier(TYPEBOX_SHIM_PATH)}${suffix}`,
|
|
494
|
+
)
|
|
495
|
+
: withPi;
|
|
496
|
+
return rewriteExtensionBareImports(await rewriteExtensionPackageImports(withTypeBox, importerPath), importerPath);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/** Test seam for compiled-binary legacy extension source rewriting. */
|
|
500
|
+
export async function __rewriteLegacyExtensionSourceForTests(source: string, importerPath: string): Promise<string> {
|
|
501
|
+
return rewriteLegacyExtensionSource(source, importerPath);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
505
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
async function pathExists(p: string): Promise<boolean> {
|
|
509
|
+
try {
|
|
510
|
+
await fs.promises.stat(p);
|
|
511
|
+
return true;
|
|
512
|
+
} catch {
|
|
513
|
+
return false;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function hasSourceModuleExtension(p: string): boolean {
|
|
518
|
+
const ext = path.extname(p).toLowerCase();
|
|
519
|
+
return (SOURCE_MODULE_EXTENSIONS as readonly string[]).includes(ext);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
async function resolveSourceModuleFile(basePath: string): Promise<string | null> {
|
|
523
|
+
try {
|
|
524
|
+
const stats = await fs.promises.stat(basePath);
|
|
525
|
+
if (stats.isFile()) {
|
|
526
|
+
// Non-source files (JSON, WASM, text assets, etc.) bypass the on-load
|
|
527
|
+
// rewrite hook so Bun's native loaders handle them; our hook would
|
|
528
|
+
// otherwise pass them through `getLoader()` which falls back to `js`.
|
|
529
|
+
return hasSourceModuleExtension(basePath) ? realpathOrSelf(basePath) : null;
|
|
530
|
+
}
|
|
531
|
+
if (stats.isDirectory()) {
|
|
532
|
+
for (const extension of SOURCE_MODULE_EXTENSIONS) {
|
|
533
|
+
const resolved = await resolveSourceModuleFile(path.join(basePath, `index${extension}`));
|
|
534
|
+
if (resolved) return resolved;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
} catch {
|
|
538
|
+
// Fall through to extension candidates below.
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if (path.extname(basePath)) {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
for (const extension of SOURCE_MODULE_EXTENSIONS) {
|
|
546
|
+
const resolved = await resolveSourceModuleFile(`${basePath}${extension}`);
|
|
547
|
+
if (resolved) return resolved;
|
|
548
|
+
}
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
async function findPackageRoot(importerPath: string): Promise<string | null> {
|
|
553
|
+
let dir = path.dirname(importerPath);
|
|
554
|
+
while (true) {
|
|
555
|
+
const cached = packageRootCache.get(dir);
|
|
556
|
+
if (cached !== undefined) {
|
|
557
|
+
return cached;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
if (await pathExists(path.join(dir, "package.json"))) {
|
|
561
|
+
packageRootCache.set(path.dirname(importerPath), dir);
|
|
562
|
+
return dir;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const parent = path.dirname(dir);
|
|
566
|
+
if (parent === dir) {
|
|
567
|
+
packageRootCache.set(path.dirname(importerPath), null);
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
dir = parent;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
async function readPackageImports(packageRoot: string): Promise<Record<string, unknown> | null> {
|
|
575
|
+
const cached = packageImportsCache.get(packageRoot);
|
|
576
|
+
if (cached !== undefined) {
|
|
577
|
+
return cached;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
let imports: Record<string, unknown> | null = null;
|
|
581
|
+
try {
|
|
582
|
+
const pkg = await Bun.file(path.join(packageRoot, "package.json")).json();
|
|
583
|
+
if (isRecord(pkg) && isRecord(pkg.imports)) {
|
|
584
|
+
imports = pkg.imports;
|
|
585
|
+
}
|
|
586
|
+
} catch {
|
|
587
|
+
imports = null;
|
|
588
|
+
}
|
|
589
|
+
packageImportsCache.set(packageRoot, imports);
|
|
590
|
+
return imports;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
type PackageImportTargetSelection = string | typeof PACKAGE_IMPORT_EXCLUDED | null;
|
|
594
|
+
type ResolvedPackageImportTargetSelection = string | typeof PACKAGE_IMPORT_EXCLUDED;
|
|
595
|
+
|
|
596
|
+
function selectPackageImportTarget(entry: unknown): PackageImportTargetSelection {
|
|
597
|
+
if (entry === null) {
|
|
598
|
+
return PACKAGE_IMPORT_EXCLUDED;
|
|
599
|
+
}
|
|
600
|
+
if (typeof entry === "string") {
|
|
601
|
+
return entry;
|
|
602
|
+
}
|
|
603
|
+
if (Array.isArray(entry)) {
|
|
604
|
+
for (const item of entry) {
|
|
605
|
+
const target = selectPackageImportTarget(item);
|
|
606
|
+
if (target !== null) return target;
|
|
607
|
+
}
|
|
608
|
+
return null;
|
|
609
|
+
}
|
|
610
|
+
if (!isRecord(entry)) {
|
|
611
|
+
return null;
|
|
612
|
+
}
|
|
613
|
+
for (const [condition, value] of Object.entries(entry)) {
|
|
614
|
+
if (!SUPPORTED_PACKAGE_IMPORT_CONDITIONS.has(condition)) {
|
|
615
|
+
continue;
|
|
616
|
+
}
|
|
617
|
+
const target = selectPackageImportTarget(value);
|
|
618
|
+
if (target !== null) return target;
|
|
619
|
+
}
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
async function resolvePackageImportTarget(
|
|
624
|
+
packageRoot: string,
|
|
625
|
+
target: string,
|
|
626
|
+
wildcard: string | null,
|
|
627
|
+
): Promise<string | null> {
|
|
628
|
+
if (!target.startsWith("./")) {
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
const substituted = wildcard === null ? target : target.replaceAll("*", wildcard);
|
|
632
|
+
return resolveSourceModuleFile(path.resolve(packageRoot, substituted));
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
async function resolvePackageImportSpecifier(specifier: string, importerPath: string): Promise<string | null> {
|
|
636
|
+
if (!specifier.startsWith("#")) {
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
const packageRoot = await findPackageRoot(importerPath);
|
|
641
|
+
if (!packageRoot) {
|
|
642
|
+
return null;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
const imports = await readPackageImports(packageRoot);
|
|
646
|
+
if (!imports) {
|
|
647
|
+
return null;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
const exactTarget = selectPackageImportTarget(imports[specifier]);
|
|
651
|
+
if (exactTarget === PACKAGE_IMPORT_EXCLUDED) {
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
if (exactTarget !== null) {
|
|
655
|
+
return resolvePackageImportTarget(packageRoot, exactTarget, null);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
let bestMatch: { keyLength: number; target: ResolvedPackageImportTargetSelection; wildcard: string } | null = null;
|
|
659
|
+
for (const [key, entry] of Object.entries(imports)) {
|
|
660
|
+
const starIndex = key.indexOf("*");
|
|
661
|
+
if (starIndex === -1) continue;
|
|
662
|
+
|
|
663
|
+
const prefix = key.slice(0, starIndex);
|
|
664
|
+
const suffix = key.slice(starIndex + 1);
|
|
665
|
+
if (!specifier.startsWith(prefix) || !specifier.endsWith(suffix)) {
|
|
666
|
+
continue;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
const target = selectPackageImportTarget(entry);
|
|
670
|
+
if (target === null) {
|
|
671
|
+
continue;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
if (!bestMatch || key.length > bestMatch.keyLength) {
|
|
675
|
+
bestMatch = {
|
|
676
|
+
keyLength: key.length,
|
|
677
|
+
target,
|
|
678
|
+
wildcard: specifier.slice(prefix.length, specifier.length - suffix.length),
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if (!bestMatch || bestMatch.target === PACKAGE_IMPORT_EXCLUDED) {
|
|
684
|
+
return null;
|
|
685
|
+
}
|
|
686
|
+
return resolvePackageImportTarget(packageRoot, bestMatch.target, bestMatch.wildcard);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const PACKAGE_IMPORT_SPECIFIER_REGEX = /((?:from\s+|import\s+|import\s*\(\s*)["'])(#[^"'()\s]+)(["'])/g;
|
|
690
|
+
|
|
691
|
+
async function rewriteExtensionPackageImports(source: string, importerPath: string): Promise<string> {
|
|
692
|
+
let rewritten = "";
|
|
693
|
+
let lastIndex = 0;
|
|
694
|
+
for (const match of source.matchAll(PACKAGE_IMPORT_SPECIFIER_REGEX)) {
|
|
695
|
+
const matchIndex = match.index;
|
|
696
|
+
if (matchIndex === undefined) continue;
|
|
697
|
+
|
|
698
|
+
const [fullMatch, prefix, specifier, suffix] = match;
|
|
699
|
+
if (!prefix || !specifier || !suffix) continue;
|
|
700
|
+
|
|
701
|
+
const resolved = await resolvePackageImportSpecifier(specifier, importerPath);
|
|
702
|
+
if (!resolved) continue;
|
|
703
|
+
|
|
704
|
+
rewritten += source.slice(lastIndex, matchIndex);
|
|
705
|
+
rewritten += `${prefix}${toImportSpecifier(resolved)}${suffix}`;
|
|
706
|
+
lastIndex = matchIndex + fullMatch.length;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
if (lastIndex === 0) {
|
|
710
|
+
return source;
|
|
711
|
+
}
|
|
712
|
+
return `${rewritten}${source.slice(lastIndex)}`;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
const BARE_EXTENSION_IMPORT_SPECIFIER_REGEX = /((?:from\s+|import\s+|import\s*\(\s*)["'])([^"'()\s]+)(["'])/g;
|
|
716
|
+
|
|
717
|
+
function isBareExtensionDependencySpecifier(specifier: string): boolean {
|
|
718
|
+
if (
|
|
719
|
+
specifier.startsWith(".") ||
|
|
720
|
+
specifier.startsWith("/") ||
|
|
721
|
+
specifier.startsWith("#") ||
|
|
722
|
+
specifier.startsWith("node:") ||
|
|
723
|
+
specifier.startsWith("bun:") ||
|
|
724
|
+
/^[a-z][a-z0-9+.-]*:/i.test(specifier)
|
|
725
|
+
) {
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
const packageName = specifier.startsWith("@") ? specifier.split("/").slice(0, 2).join("/") : specifier.split("/")[0];
|
|
729
|
+
return Boolean(packageName && !isBuiltin(packageName));
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
interface BarePackageSpecifier {
|
|
733
|
+
readonly name: string;
|
|
734
|
+
readonly subpath: string | null;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
function splitBarePackageSpecifier(specifier: string): BarePackageSpecifier | null {
|
|
738
|
+
const parts = specifier.split("/");
|
|
739
|
+
if (specifier.startsWith("@")) {
|
|
740
|
+
const [scope, name, ...rest] = parts;
|
|
741
|
+
if (!scope || !name) return null;
|
|
742
|
+
return { name: `${scope}/${name}`, subpath: rest.length > 0 ? rest.join("/") : null };
|
|
743
|
+
}
|
|
744
|
+
const [name, ...rest] = parts;
|
|
745
|
+
if (!name) return null;
|
|
746
|
+
return { name, subpath: rest.length > 0 ? rest.join("/") : null };
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
async function findNodePackageRoot(packageName: string, importerPath: string): Promise<string | null> {
|
|
750
|
+
const cacheKey = `${packageName}\0${path.resolve(path.dirname(importerPath))}`;
|
|
751
|
+
const cached = nodePackageRootCache.get(cacheKey);
|
|
752
|
+
if (cached) return cached;
|
|
753
|
+
|
|
754
|
+
const promise = findNodePackageRootUncached(packageName, importerPath);
|
|
755
|
+
nodePackageRootCache.set(cacheKey, promise);
|
|
756
|
+
return promise;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
async function findNodePackageRootUncached(packageName: string, importerPath: string): Promise<string | null> {
|
|
760
|
+
let dir = path.dirname(importerPath);
|
|
761
|
+
while (true) {
|
|
762
|
+
const candidate = path.join(dir, "node_modules", packageName);
|
|
763
|
+
if (await pathExists(path.join(candidate, "package.json"))) {
|
|
764
|
+
return candidate;
|
|
765
|
+
}
|
|
766
|
+
const parent = path.dirname(dir);
|
|
767
|
+
if (parent === dir) {
|
|
768
|
+
return null;
|
|
769
|
+
}
|
|
770
|
+
dir = parent;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
async function readPackageManifest(packageRoot: string): Promise<Record<string, unknown> | null> {
|
|
775
|
+
const cached = packageManifestCache.get(packageRoot);
|
|
776
|
+
if (cached) return cached;
|
|
777
|
+
|
|
778
|
+
const promise = readPackageManifestUncached(packageRoot);
|
|
779
|
+
packageManifestCache.set(packageRoot, promise);
|
|
780
|
+
return promise;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
async function readPackageManifestUncached(packageRoot: string): Promise<Record<string, unknown> | null> {
|
|
784
|
+
try {
|
|
785
|
+
const manifest = await Bun.file(path.join(packageRoot, "package.json")).json();
|
|
786
|
+
return isRecord(manifest) ? manifest : null;
|
|
787
|
+
} catch {
|
|
788
|
+
return null;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
async function resolvePackageExportTarget(
|
|
793
|
+
packageRoot: string,
|
|
794
|
+
target: string,
|
|
795
|
+
wildcard: string | null,
|
|
796
|
+
): Promise<string | null> {
|
|
797
|
+
if (!target.startsWith("./")) {
|
|
798
|
+
return null;
|
|
799
|
+
}
|
|
800
|
+
const substituted = wildcard === null ? target : target.replaceAll("*", wildcard);
|
|
801
|
+
return resolveSourceModuleFile(path.resolve(packageRoot, substituted));
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
async function resolveNodePackageExport(
|
|
805
|
+
packageRoot: string,
|
|
806
|
+
subpath: string | null,
|
|
807
|
+
manifest: Record<string, unknown>,
|
|
808
|
+
): Promise<string | null> {
|
|
809
|
+
const exportsField = manifest.exports;
|
|
810
|
+
const rootTarget = subpath === null ? selectPackageImportTarget(exportsField) : null;
|
|
811
|
+
if (rootTarget !== null && rootTarget !== PACKAGE_IMPORT_EXCLUDED) {
|
|
812
|
+
return resolvePackageExportTarget(packageRoot, rootTarget, null);
|
|
813
|
+
}
|
|
814
|
+
if (!isRecord(exportsField)) {
|
|
815
|
+
return null;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
const exactKey = subpath === null ? "." : `./${subpath}`;
|
|
819
|
+
const exactTarget = selectPackageImportTarget(exportsField[exactKey]);
|
|
820
|
+
if (exactTarget !== null && exactTarget !== PACKAGE_IMPORT_EXCLUDED) {
|
|
821
|
+
return resolvePackageExportTarget(packageRoot, exactTarget, null);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
for (const [key, entry] of Object.entries(exportsField)) {
|
|
825
|
+
const starIndex = key.indexOf("*");
|
|
826
|
+
if (starIndex === -1 || subpath === null) continue;
|
|
827
|
+
const prefix = key.slice(2, starIndex);
|
|
828
|
+
const suffix = key.slice(starIndex + 1);
|
|
829
|
+
if (!subpath.startsWith(prefix) || !subpath.endsWith(suffix)) {
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
const target = selectPackageImportTarget(entry);
|
|
833
|
+
if (target === null || target === PACKAGE_IMPORT_EXCLUDED) {
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
return resolvePackageExportTarget(
|
|
837
|
+
packageRoot,
|
|
838
|
+
target,
|
|
839
|
+
subpath.slice(prefix.length, subpath.length - suffix.length),
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
return null;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
async function resolveNodePackageFallback(
|
|
846
|
+
packageRoot: string,
|
|
847
|
+
subpath: string | null,
|
|
848
|
+
manifest: Record<string, unknown>,
|
|
849
|
+
): Promise<string | null> {
|
|
850
|
+
if (subpath !== null) {
|
|
851
|
+
return resolveSourceModuleFile(path.join(packageRoot, subpath));
|
|
852
|
+
}
|
|
853
|
+
for (const field of ["module", "main"]) {
|
|
854
|
+
const target = manifest[field];
|
|
855
|
+
if (typeof target === "string") {
|
|
856
|
+
const resolved = await resolveSourceModuleFile(path.resolve(packageRoot, target));
|
|
857
|
+
if (resolved) return resolved;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
return resolveSourceModuleFile(path.join(packageRoot, "index"));
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
async function resolveNodePackageDependency(specifier: string, importerPath: string): Promise<string | null> {
|
|
864
|
+
const parsed = splitBarePackageSpecifier(specifier);
|
|
865
|
+
if (!parsed) return null;
|
|
866
|
+
const packageRoot = await findNodePackageRoot(parsed.name, importerPath);
|
|
867
|
+
if (!packageRoot) return null;
|
|
868
|
+
const manifest = await readPackageManifest(packageRoot);
|
|
869
|
+
if (!manifest) return null;
|
|
870
|
+
return (
|
|
871
|
+
(await resolveNodePackageExport(packageRoot, parsed.subpath, manifest)) ??
|
|
872
|
+
(await resolveNodePackageFallback(packageRoot, parsed.subpath, manifest))
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
async function resolveExtensionBareDependency(specifier: string, importerPath: string): Promise<string | null> {
|
|
877
|
+
if (!isBareExtensionDependencySpecifier(specifier)) {
|
|
878
|
+
return null;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
const cacheKey = `${specifier}\0${path.resolve(path.dirname(importerPath))}`;
|
|
882
|
+
const cached = bareDependencyResolutionCache.get(cacheKey);
|
|
883
|
+
if (cached) return cached;
|
|
884
|
+
|
|
885
|
+
const promise = resolveExtensionBareDependencyUncached(specifier, importerPath);
|
|
886
|
+
bareDependencyResolutionCache.set(cacheKey, promise);
|
|
887
|
+
return promise;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
async function resolveExtensionBareDependencyUncached(specifier: string, importerPath: string): Promise<string | null> {
|
|
891
|
+
try {
|
|
892
|
+
const resolved = Bun.resolveSync(specifier, path.dirname(importerPath));
|
|
893
|
+
if (resolved && resolved !== specifier && !resolved.startsWith("node:") && !resolved.startsWith("bun:")) {
|
|
894
|
+
return resolved;
|
|
895
|
+
}
|
|
896
|
+
} catch {
|
|
897
|
+
// Compiled binaries do not reliably resolve runtime extension node_modules.
|
|
898
|
+
}
|
|
899
|
+
return resolveNodePackageDependency(specifier, importerPath);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
async function rewriteExtensionBareImports(source: string, importerPath: string): Promise<string> {
|
|
903
|
+
let rewritten = "";
|
|
904
|
+
let lastIndex = 0;
|
|
905
|
+
for (const match of source.matchAll(BARE_EXTENSION_IMPORT_SPECIFIER_REGEX)) {
|
|
906
|
+
const matchIndex = match.index;
|
|
907
|
+
if (matchIndex === undefined) continue;
|
|
908
|
+
|
|
909
|
+
const [fullMatch, prefix, specifier, suffix] = match;
|
|
910
|
+
if (!prefix || !specifier || !suffix) continue;
|
|
911
|
+
|
|
912
|
+
const resolved = await resolveExtensionBareDependency(specifier, importerPath);
|
|
913
|
+
if (!resolved) continue;
|
|
914
|
+
|
|
915
|
+
rewritten += source.slice(lastIndex, matchIndex);
|
|
916
|
+
rewritten += `${prefix}${toImportSpecifier(resolved)}${suffix}`;
|
|
917
|
+
lastIndex = matchIndex + fullMatch.length;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
if (lastIndex === 0) {
|
|
921
|
+
return source;
|
|
922
|
+
}
|
|
923
|
+
return `${rewritten}${source.slice(lastIndex)}`;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
function escapeRegExp(value: string): string {
|
|
927
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
// Match source modules in an extension graph (relative imports and package
|
|
931
|
+
// `imports` aliases such as `#src/*`). Bare third-party dependencies remain
|
|
932
|
+
// native Bun resolutions.
|
|
933
|
+
const EXTENSION_GRAPH_SPECIFIER_REGEX = /(?:from\s+|import\s+|import\s*\(\s*)["']((?:\.\.?\/|#)[^"']+)["']/g;
|
|
934
|
+
|
|
935
|
+
// Extension entry realpaths that already have a load-time rewrite hook
|
|
936
|
+
// installed. Each `Bun.plugin()` registration is process-global and permanent,
|
|
937
|
+
// so we register at most one hook per entry.
|
|
938
|
+
const hookedExtensionEntries = new Set<string>();
|
|
939
|
+
|
|
940
|
+
/** Resolve symlinks in a path, falling back to the input if realpath fails. */
|
|
941
|
+
async function realpathOrSelf(p: string): Promise<string> {
|
|
942
|
+
const cached = realpathCache.get(p);
|
|
943
|
+
if (cached) return cached;
|
|
944
|
+
|
|
945
|
+
const promise = realpathOrSelfUncached(p);
|
|
946
|
+
realpathCache.set(p, promise);
|
|
947
|
+
return promise;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
async function realpathOrSelfUncached(p: string): Promise<string> {
|
|
951
|
+
try {
|
|
952
|
+
return await fs.promises.realpath(p);
|
|
953
|
+
} catch {
|
|
954
|
+
return p;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Walk the extension's relative-import graph starting at `entryRealPath`,
|
|
960
|
+
* returning the realpath of every reachable source module. Only relative
|
|
961
|
+
* specifiers (`./`, `../`) are followed — bare and absolute imports are left to
|
|
962
|
+
* Bun's native resolver — so the set is exactly the extension's own source,
|
|
963
|
+
* wherever it physically lives (a `../src` sibling, a symlinked sub-tree, …).
|
|
964
|
+
* This mirrors the module set the old temp-dir mirror tracked, minus the copy.
|
|
965
|
+
*/
|
|
966
|
+
async function collectExtensionModules(entryRealPath: string): Promise<Map<string, string>> {
|
|
967
|
+
const modules = new Map<string, string>();
|
|
968
|
+
const queue = [entryRealPath];
|
|
969
|
+
while (queue.length > 0) {
|
|
970
|
+
const file = queue.pop();
|
|
971
|
+
if (!file || modules.has(file)) {
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
let source: string;
|
|
975
|
+
try {
|
|
976
|
+
source = await Bun.file(file).text();
|
|
977
|
+
} catch {
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
modules.set(file, source);
|
|
981
|
+
const dir = path.dirname(file);
|
|
982
|
+
for (const match of source.matchAll(EXTENSION_GRAPH_SPECIFIER_REGEX)) {
|
|
983
|
+
const specifier = match[1];
|
|
984
|
+
if (!specifier) continue;
|
|
985
|
+
try {
|
|
986
|
+
const resolved = specifier.startsWith("#")
|
|
987
|
+
? await resolvePackageImportSpecifier(specifier, file)
|
|
988
|
+
: await realpathOrSelf(Bun.resolveSync(specifier, dir));
|
|
989
|
+
if (resolved && !modules.has(resolved)) {
|
|
990
|
+
queue.push(resolved);
|
|
991
|
+
}
|
|
992
|
+
} catch {
|
|
993
|
+
// Unresolvable relative import (e.g. a type-only path); skip it.
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return modules;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Install a `Bun.plugin()` `onLoad` hook scoped to exactly the modules in an
|
|
1002
|
+
* extension's source graph, so their legacy `@(scope)/pi-*`, bare
|
|
1003
|
+
* `@sinclair/typebox`, and local package-import aliases are rewritten at load
|
|
1004
|
+
* time. A runtime `onLoad` cannot fall through (Bun requires a result object),
|
|
1005
|
+
* so the filter is an exact-path alternation of the graph's realpaths — it
|
|
1006
|
+
* never matches the host, other extensions, `node_modules` deps, or unrelated
|
|
1007
|
+
* project source.
|
|
1008
|
+
*
|
|
1009
|
+
* Returns the collected path→source map on first install so the caller can
|
|
1010
|
+
* drop entries the initial import never consumed; `undefined` when the hook
|
|
1011
|
+
* was already installed.
|
|
1012
|
+
*/
|
|
1013
|
+
async function ensureExtensionGraphHook(entryRealPath: string): Promise<Map<string, string> | undefined> {
|
|
1014
|
+
if (hookedExtensionEntries.has(entryRealPath)) {
|
|
1015
|
+
return undefined;
|
|
1016
|
+
}
|
|
1017
|
+
hookedExtensionEntries.add(entryRealPath);
|
|
1018
|
+
|
|
1019
|
+
const modules = await collectExtensionModules(entryRealPath);
|
|
1020
|
+
const alternation = [...modules.keys()].map(escapeRegExp).join("|");
|
|
1021
|
+
const filter = new RegExp(`^(?:${alternation})$`);
|
|
1022
|
+
Bun.plugin({
|
|
1023
|
+
name: `omp:legacy-pi-ext:${Bun.hash(entryRealPath).toString(36)}`,
|
|
1024
|
+
setup(build) {
|
|
1025
|
+
build.onLoad({ filter, namespace: "file" }, async args => {
|
|
1026
|
+
const cached = modules.get(args.path);
|
|
1027
|
+
let raw: string;
|
|
1028
|
+
if (cached !== undefined) {
|
|
1029
|
+
// consume-once: preserves ?mtime edit-pickup for the re-imported entry
|
|
1030
|
+
modules.delete(args.path);
|
|
1031
|
+
raw = cached;
|
|
1032
|
+
} else {
|
|
1033
|
+
raw = await Bun.file(args.path).text();
|
|
1034
|
+
}
|
|
1035
|
+
return { contents: await rewriteLegacyExtensionSource(raw, args.path), loader: getLoader(args.path) };
|
|
1036
|
+
});
|
|
1037
|
+
},
|
|
1038
|
+
});
|
|
1039
|
+
return modules;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Load a legacy Pi extension module from its real on-disk location.
|
|
1044
|
+
*
|
|
1045
|
+
* The extension runs in place, so its `import.meta.url` is the real source file
|
|
1046
|
+
* and `__dirname`-relative `readFileSync` asset loads (HTML/CSS bundled next to
|
|
1047
|
+
* the entry) resolve exactly as they do under the original Pi runtime — no
|
|
1048
|
+
* temp-directory mirroring and no asset copying. An `onLoad` hook scoped to the
|
|
1049
|
+
* entry's source graph rewrites only host-resolved compatibility imports in the
|
|
1050
|
+
* extension's own source; everything else resolves natively.
|
|
1051
|
+
*/
|
|
1052
|
+
export async function loadLegacyPiModule(resolvedPath: string): Promise<unknown> {
|
|
1053
|
+
// Bun reports the realpath of a loaded module to `onLoad` and exposes it as
|
|
1054
|
+
// `import.meta.url`. Resolve symlinks here too (macOS `/var`→`/private/var`,
|
|
1055
|
+
// `bun link`/pnpm installs) so the rewrite filter matches the path Bun
|
|
1056
|
+
// actually hands the hook.
|
|
1057
|
+
const entryRealPath = await realpathOrSelf(path.resolve(resolvedPath));
|
|
1058
|
+
const pendingSources = await ensureExtensionGraphHook(entryRealPath);
|
|
1059
|
+
try {
|
|
1060
|
+
// `?mtime` busts Bun's module cache so repeat loads pick up edited source.
|
|
1061
|
+
return await import(`${toImportSpecifier(entryRealPath)}?mtime=${Date.now()}`);
|
|
1062
|
+
} finally {
|
|
1063
|
+
// Drop whatever the initial import didn't consume: graph modules only
|
|
1064
|
+
// reached by lazy dynamic imports must be read from disk at their actual
|
|
1065
|
+
// import time, not served from this load-time snapshot.
|
|
1066
|
+
pendingSources?.clear();
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
function getLoader(path: string): "js" | "jsx" | "ts" | "tsx" {
|
|
1071
|
+
if (path.endsWith(".tsx")) {
|
|
1072
|
+
return "tsx";
|
|
1073
|
+
}
|
|
1074
|
+
if (path.endsWith(".jsx")) {
|
|
1075
|
+
return "jsx";
|
|
1076
|
+
}
|
|
1077
|
+
if (path.endsWith(".ts") || path.endsWith(".mts") || path.endsWith(".cts")) {
|
|
1078
|
+
return "ts";
|
|
1079
|
+
}
|
|
1080
|
+
return "js";
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
function resolveLegacyPiSpecifier(args: { path: string; importer: string }): { path: string } | undefined {
|
|
1084
|
+
const remappedSpecifier = remapLegacyPiSpecifier(args.path);
|
|
1085
|
+
if (!remappedSpecifier) {
|
|
1086
|
+
return undefined;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// Primary: resolve the canonical @oh-my-pi-zen/* specifier from the host binary
|
|
1090
|
+
// location. Works in dev mode and in source-link installs.
|
|
1091
|
+
try {
|
|
1092
|
+
return { path: resolveCanonicalPiSpecifier(remappedSpecifier) };
|
|
1093
|
+
} catch {
|
|
1094
|
+
// Fallback for compiled binary mode: the bundled packages live inside
|
|
1095
|
+
// /$bunfs/root and aren't reachable by filesystem resolution. Prefer the
|
|
1096
|
+
// canonical specifier against the importing file's directory when the
|
|
1097
|
+
// plugin installed @oh-my-pi peer deps, then try the original legacy
|
|
1098
|
+
// specifier for plugins that still vendor only @mariozechner or
|
|
1099
|
+
// @earendil-works peer deps.
|
|
1100
|
+
const importerDir = path.dirname(args.importer);
|
|
1101
|
+
try {
|
|
1102
|
+
return { path: Bun.resolveSync(remappedSpecifier, importerDir) };
|
|
1103
|
+
} catch {
|
|
1104
|
+
try {
|
|
1105
|
+
return { path: Bun.resolveSync(args.path, importerDir) };
|
|
1106
|
+
} catch {
|
|
1107
|
+
return undefined;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
function resolveTypeBoxSpecifier(): { path: string } | undefined {
|
|
1114
|
+
return TYPEBOX_SHIM_PATH ? { path: TYPEBOX_SHIM_PATH } : undefined;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
export function installLegacyPiSpecifierShim(): void {
|
|
1118
|
+
if (isLegacyPiSpecifierShimInstalled) {
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
isLegacyPiSpecifierShimInstalled = true;
|
|
1122
|
+
|
|
1123
|
+
Bun.plugin({
|
|
1124
|
+
name: "omp:legacy-pi-shim",
|
|
1125
|
+
setup(build) {
|
|
1126
|
+
build.onResolve({ filter: LEGACY_PI_SPECIFIER_FILTER, namespace: "file" }, resolveLegacyPiSpecifier);
|
|
1127
|
+
build.onResolve({ filter: TYPEBOX_SPECIFIER_FILTER, namespace: "file" }, resolveTypeBoxSpecifier);
|
|
1128
|
+
// Compiled-binary mode: serve `omp-legacy-pi-bundled:<key>` imports
|
|
1129
|
+
// from the JS-heap registry. The rewrite path emits these specifiers
|
|
1130
|
+
// in place of unreachable `file:///$bunfs/...` URLs (issue #3423).
|
|
1131
|
+
build.onLoad({ filter: /.*/, namespace: BUNDLED_VIRTUAL_NAMESPACE }, async args => {
|
|
1132
|
+
return { contents: await synthesizeBundledModuleSource(args.path), loader: "js" };
|
|
1133
|
+
});
|
|
1134
|
+
},
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
/** Test seam: clears the memoized canonical specifier resolutions. */
|
|
1139
|
+
export function __resetLegacyPiResolutionCache(): void {
|
|
1140
|
+
clearLegacyPiResolutionCaches();
|
|
1141
|
+
}
|