@oh-my-pi/pi-coding-agent 15.1.0 → 15.1.2
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 +12 -0
- package/dist/types/async/index.d.ts +2 -0
- package/dist/types/async/job-manager.d.ts +87 -0
- package/dist/types/async/support.d.ts +2 -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 +31 -0
- package/dist/types/autoresearch/tools/log-experiment.d.ts +23 -0
- package/dist/types/autoresearch/tools/run-experiment.d.ts +8 -0
- package/dist/types/autoresearch/tools/update-notes.d.ts +12 -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 +45 -0
- package/dist/types/capability/prompt.d.ts +15 -0
- package/dist/types/capability/rule.d.ts +61 -0
- package/dist/types/capability/settings.d.ts +15 -0
- package/dist/types/capability/skill.d.ts +36 -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 +52 -0
- package/dist/types/cli/classify-install-target.d.ts +18 -0
- package/dist/types/cli/commands/init-xdg.d.ts +1 -0
- package/dist/types/cli/config-cli.d.ts +22 -0
- package/dist/types/cli/file-processor.d.ts +11 -0
- package/dist/types/cli/grep-cli.d.ts +17 -0
- package/dist/types/cli/grievances-cli.d.ts +25 -0
- package/dist/types/cli/initial-message.d.ts +17 -0
- package/dist/types/cli/list-models.d.ts +30 -0
- package/dist/types/cli/plugin-cli.d.ts +32 -0
- package/dist/types/cli/read-cli.d.ts +4 -0
- package/dist/types/cli/session-picker.d.ts +3 -0
- package/dist/types/cli/setup-cli.d.ts +24 -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/stats-cli.d.ts +17 -0
- package/dist/types/cli/update-cli.d.ts +20 -0
- package/dist/types/cli/web-search-cli.d.ts +20 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/commands/acp.d.ts +12 -0
- package/dist/types/commands/agents.d.ts +34 -0
- package/dist/types/commands/commit.d.ts +27 -0
- package/dist/types/commands/config.d.ts +30 -0
- package/dist/types/commands/grep.d.ts +42 -0
- package/dist/types/commands/grievances.d.ts +40 -0
- package/dist/types/commands/launch.d.ts +118 -0
- package/dist/types/commands/plugin.d.ts +52 -0
- package/dist/types/commands/read.d.ts +15 -0
- package/dist/types/commands/setup.d.ts +25 -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/update.d.ts +20 -0
- package/dist/types/commands/web-search.d.ts +33 -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 +19 -0
- package/dist/types/commit/agentic/tools/git-file-diff.d.ts +10 -0
- package/dist/types/commit/agentic/tools/git-hunk.d.ts +9 -0
- package/dist/types/commit/agentic/tools/git-overview.d.ts +9 -0
- package/dist/types/commit/agentic/tools/index.d.ts +16 -0
- package/dist/types/commit/agentic/tools/propose-changelog.d.ts +28 -0
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +28 -0
- package/dist/types/commit/agentic/tools/recent-commits.d.ts +7 -0
- package/dist/types/commit/agentic/tools/schemas.d.ts +19 -0
- package/dist/types/commit/agentic/tools/split-commit.d.ts +45 -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 +30 -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 +15 -0
- package/dist/types/commit/pipeline.d.ts +5 -0
- package/dist/types/commit/shared-llm.d.ts +54 -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/config-file.d.ts +58 -0
- package/dist/types/config/file-lock.d.ts +6 -0
- package/dist/types/config/keybindings.d.ts +334 -0
- package/dist/types/config/model-equivalence.d.ts +24 -0
- package/dist/types/config/model-registry.d.ts +360 -0
- package/dist/types/config/model-resolver.d.ts +230 -0
- package/dist/types/config/models-config-schema.d.ts +502 -0
- package/dist/types/config/prompt-templates.d.ts +32 -0
- package/dist/types/config/resolve-config-value.d.ts +17 -0
- package/dist/types/config/settings-schema.d.ts +3315 -0
- package/dist/types/config/settings.d.ts +126 -0
- package/dist/types/config.d.ts +66 -0
- package/dist/types/cursor.d.ts +22 -0
- package/dist/types/dap/client.d.ts +38 -0
- package/dist/types/dap/config.d.ts +6 -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 +524 -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 +68 -0
- package/dist/types/debug/profiler.d.ts +24 -0
- package/dist/types/debug/raw-sse-buffer.d.ts +44 -0
- package/dist/types/debug/raw-sse.d.ts +16 -0
- package/dist/types/debug/report-bundle.d.ts +55 -0
- package/dist/types/debug/system-info.d.ts +26 -0
- package/dist/types/discovery/agents-md.d.ts +1 -0
- package/dist/types/discovery/agents.d.ts +1 -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 +267 -0
- package/dist/types/discovery/index.d.ts +51 -0
- package/dist/types/discovery/mcp-json.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 +5 -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 +59 -0
- package/dist/types/edit/file-read-cache.d.ts +25 -0
- package/dist/types/edit/index.d.ts +58 -0
- package/dist/types/edit/modes/apply-patch.d.ts +24 -0
- package/dist/types/edit/modes/patch.d.ts +99 -0
- package/dist/types/edit/modes/replace.d.ts +142 -0
- package/dist/types/edit/normalize.d.ts +43 -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 +107 -0
- package/dist/types/edit/streaming.d.ts +59 -0
- package/dist/types/eval/backend.d.ts +40 -0
- package/dist/types/eval/index.d.ts +6 -0
- package/dist/types/eval/js/context-manager.d.ts +24 -0
- package/dist/types/eval/js/executor.d.ts +28 -0
- package/dist/types/eval/js/index.d.ts +10 -0
- package/dist/types/eval/js/shared/helpers.d.ts +38 -0
- package/dist/types/eval/js/shared/indirect-eval.d.ts +14 -0
- package/dist/types/eval/js/shared/prelude.d.ts +1 -0
- package/dist/types/eval/js/shared/rewrite-imports.d.ts +6 -0
- package/dist/types/eval/js/shared/runtime.d.ts +47 -0
- package/dist/types/eval/js/shared/types.d.ts +24 -0
- package/dist/types/eval/js/tool-bridge.d.ts +18 -0
- package/dist/types/eval/js/worker-core.d.ts +5 -0
- package/dist/types/eval/js/worker-entry.d.ts +1 -0
- package/dist/types/eval/js/worker-protocol.d.ts +77 -0
- package/dist/types/eval/parse.d.ts +28 -0
- package/dist/types/eval/py/display.d.ts +25 -0
- package/dist/types/eval/py/executor.d.ts +83 -0
- package/dist/types/eval/py/index.d.ts +10 -0
- package/dist/types/eval/py/kernel.d.ts +55 -0
- package/dist/types/eval/py/prelude.d.ts +1 -0
- package/dist/types/eval/py/runtime.d.ts +21 -0
- package/dist/types/eval/py/tool-bridge.d.ts +20 -0
- package/dist/types/eval/sniff.d.ts +11 -0
- package/dist/types/eval/types.d.ts +52 -0
- package/dist/types/exa/factory.d.ts +13 -0
- package/dist/types/exa/index.d.ts +20 -0
- package/dist/types/exa/mcp-client.d.ts +45 -0
- package/dist/types/exa/render.d.ts +19 -0
- package/dist/types/exa/researcher.d.ts +9 -0
- package/dist/types/exa/search.d.ts +9 -0
- package/dist/types/exa/types.d.ts +155 -0
- package/dist/types/exa/websets.d.ts +9 -0
- package/dist/types/exec/bash-executor.d.ts +41 -0
- package/dist/types/exec/exec.d.ts +25 -0
- package/dist/types/exec/idle-timeout-watchdog.d.ts +18 -0
- package/dist/types/exec/non-interactive-env.d.ts +1 -0
- package/dist/types/export/custom-share.d.ts +20 -0
- package/dist/types/export/html/index.d.ts +10 -0
- package/dist/types/export/html/template.generated.d.ts +1 -0
- package/dist/types/export/html/template.macro.d.ts +5 -0
- package/dist/types/export/ttsr.d.ts +44 -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 +106 -0
- package/dist/types/extensibility/custom-tools/index.d.ts +6 -0
- package/dist/types/extensibility/custom-tools/loader.d.ts +69 -0
- package/dist/types/extensibility/custom-tools/types.d.ts +226 -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 +43 -0
- package/dist/types/extensibility/extensions/runner.d.ts +134 -0
- package/dist/types/extensibility/extensions/types.d.ts +864 -0
- package/dist/types/extensibility/extensions/wrapper.d.ts +54 -0
- package/dist/types/extensibility/hooks/index.d.ts +5 -0
- package/dist/types/extensibility/hooks/loader.d.ts +89 -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 +431 -0
- package/dist/types/extensibility/plugins/doctor.d.ts +3 -0
- package/dist/types/extensibility/plugins/git-url.d.ts +34 -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-compat.d.ts +2 -0
- package/dist/types/extensibility/plugins/loader.d.ts +31 -0
- package/dist/types/extensibility/plugins/manager.d.ts +65 -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 +130 -0
- package/dist/types/extensibility/plugins/parser.d.ts +52 -0
- package/dist/types/extensibility/plugins/types.d.ts +149 -0
- package/dist/types/extensibility/shared-events.d.ts +279 -0
- package/dist/types/extensibility/skills.d.ts +57 -0
- package/dist/types/extensibility/slash-commands.d.ts +48 -0
- package/dist/types/extensibility/tool-proxy.d.ts +4 -0
- package/dist/types/extensibility/typebox.d.ts +155 -0
- package/dist/types/extensibility/utils.d.ts +12 -0
- package/dist/types/goals/index.d.ts +3 -0
- package/dist/types/goals/runtime.d.ts +63 -0
- package/dist/types/goals/state.d.ts +35 -0
- package/dist/types/goals/tools/goal-tool.d.ts +54 -0
- package/dist/types/hashline/anchors.d.ts +20 -0
- package/dist/types/hashline/apply.d.ts +14 -0
- package/dist/types/hashline/constants.d.ts +21 -0
- package/dist/types/hashline/diff-preview.d.ts +2 -0
- package/dist/types/hashline/diff.d.ts +17 -0
- package/dist/types/hashline/execute.d.ts +4 -0
- package/dist/types/hashline/hash.d.ts +149 -0
- package/dist/types/hashline/index.d.ts +13 -0
- package/dist/types/hashline/input.d.ts +11 -0
- package/dist/types/hashline/parser.d.ts +7 -0
- package/dist/types/hashline/prefixes.d.ts +7 -0
- package/dist/types/hashline/recovery.d.ts +22 -0
- package/dist/types/hashline/stream.d.ts +2 -0
- package/dist/types/hashline/types.d.ts +77 -0
- package/dist/types/hindsight/backend.d.ts +13 -0
- package/dist/types/hindsight/bank.d.ts +54 -0
- package/dist/types/hindsight/client.d.ts +224 -0
- package/dist/types/hindsight/config.d.ts +51 -0
- package/dist/types/hindsight/content.d.ts +70 -0
- package/dist/types/hindsight/index.d.ts +8 -0
- package/dist/types/hindsight/mental-models.d.ts +125 -0
- package/dist/types/hindsight/state.d.ts +99 -0
- package/dist/types/hindsight/transcript.d.ts +28 -0
- package/dist/types/index.d.ts +34 -0
- package/dist/types/internal-urls/agent-protocol.d.ts +12 -0
- package/dist/types/internal-urls/artifact-protocol.d.ts +6 -0
- package/dist/types/internal-urls/docs-index.generated.d.ts +2 -0
- package/dist/types/internal-urls/index.d.ts +22 -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 +39 -0
- package/dist/types/internal-urls/mcp-protocol.d.ts +12 -0
- package/dist/types/internal-urls/memory-protocol.d.ts +17 -0
- package/dist/types/internal-urls/parse.d.ts +19 -0
- package/dist/types/internal-urls/pi-protocol.d.ts +12 -0
- package/dist/types/internal-urls/registry-helpers.d.ts +10 -0
- package/dist/types/internal-urls/router.d.ts +14 -0
- package/dist/types/internal-urls/rule-protocol.d.ts +6 -0
- package/dist/types/internal-urls/skill-protocol.d.ts +13 -0
- package/dist/types/internal-urls/types.d.ts +105 -0
- package/dist/types/lsp/client.d.ts +65 -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 +65 -0
- package/dist/types/lsp/edits.d.ts +16 -0
- package/dist/types/lsp/index.d.ts +130 -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 +302 -0
- package/dist/types/lsp/utils.d.ts +108 -0
- package/dist/types/main.d.ts +17 -0
- package/dist/types/mcp/client.d.ts +74 -0
- package/dist/types/mcp/config-writer.d.ts +53 -0
- package/dist/types/mcp/config.d.ts +75 -0
- package/dist/types/mcp/discoverable-tool-metadata.d.ts +7 -0
- package/dist/types/mcp/index.d.ts +18 -0
- package/dist/types/mcp/json-rpc.d.ts +22 -0
- package/dist/types/mcp/loader.d.ts +43 -0
- package/dist/types/mcp/manager.d.ts +193 -0
- package/dist/types/mcp/oauth-discovery.d.ts +40 -0
- package/dist/types/mcp/oauth-flow.d.ts +59 -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 +51 -0
- package/dist/types/mcp/tool-bridge.d.ts +86 -0
- package/dist/types/mcp/tool-cache.d.ts +8 -0
- package/dist/types/mcp/transports/http.d.ts +36 -0
- package/dist/types/mcp/transports/index.d.ts +5 -0
- package/dist/types/mcp/transports/stdio.d.ts +32 -0
- package/dist/types/mcp/types.d.ts +333 -0
- package/dist/types/memories/index.d.ts +28 -0
- package/dist/types/memories/storage.d.ts +110 -0
- package/dist/types/memory-backend/index.d.ts +4 -0
- package/dist/types/memory-backend/local-backend.d.ts +9 -0
- package/dist/types/memory-backend/off-backend.d.ts +7 -0
- package/dist/types/memory-backend/resolve.d.ts +15 -0
- package/dist/types/memory-backend/types.d.ts +61 -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 +20 -0
- package/dist/types/modes/acp/acp-mode.d.ts +3 -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/agent-dashboard.d.ts +21 -0
- package/dist/types/modes/components/assistant-message.d.ts +16 -0
- package/dist/types/modes/components/bash-execution.d.ts +29 -0
- package/dist/types/modes/components/bordered-loader.d.ts +11 -0
- package/dist/types/modes/components/branch-summary-message.d.ts +13 -0
- package/dist/types/modes/components/btw-panel.d.ts +16 -0
- package/dist/types/modes/components/compaction-summary-message.d.ts +13 -0
- package/dist/types/modes/components/countdown-timer.d.ts +14 -0
- package/dist/types/modes/components/custom-editor.d.ts +47 -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/eval-execution.d.ts +23 -0
- package/dist/types/modes/components/execution-shared.d.ts +46 -0
- package/dist/types/modes/components/extensions/extension-dashboard.d.ts +26 -0
- package/dist/types/modes/components/extensions/extension-list.d.ts +39 -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 +151 -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 +18 -0
- package/dist/types/modes/components/hook-input.d.ts +15 -0
- package/dist/types/modes/components/hook-message.d.ts +15 -0
- package/dist/types/modes/components/hook-selector.d.ts +23 -0
- package/dist/types/modes/components/index.d.ts +35 -0
- package/dist/types/modes/components/keybinding-hints.d.ts +40 -0
- package/dist/types/modes/components/login-dialog.d.ts +32 -0
- package/dist/types/modes/components/mcp-add-wizard.d.ts +25 -0
- package/dist/types/modes/components/message-frame.d.ts +42 -0
- package/dist/types/modes/components/model-selector.d.ts +26 -0
- package/dist/types/modes/components/oauth-selector.d.ts +14 -0
- package/dist/types/modes/components/plugin-selector.d.ts +26 -0
- package/dist/types/modes/components/plugin-settings.d.ts +66 -0
- package/dist/types/modes/components/queue-mode-selector.d.ts +9 -0
- package/dist/types/modes/components/read-tool-group.d.ts +30 -0
- package/dist/types/modes/components/session-observer-overlay.d.ts +11 -0
- package/dist/types/modes/components/session-selector.d.ts +30 -0
- package/dist/types/modes/components/settings-defs.d.ts +50 -0
- package/dist/types/modes/components/settings-selector.d.ts +54 -0
- package/dist/types/modes/components/show-images-selector.d.ts +9 -0
- package/dist/types/modes/components/skill-message.d.ts +9 -0
- package/dist/types/modes/components/status-line/context-thresholds.d.ts +4 -0
- package/dist/types/modes/components/status-line/git-utils.d.ts +22 -0
- package/dist/types/modes/components/status-line/index.d.ts +4 -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 +70 -0
- package/dist/types/modes/components/status-line-segment-editor.d.ts +24 -0
- package/dist/types/modes/components/status-line.d.ts +61 -0
- package/dist/types/modes/components/theme-selector.d.ts +10 -0
- package/dist/types/modes/components/thinking-selector.d.ts +10 -0
- package/dist/types/modes/components/todo-reminder.d.ts +13 -0
- package/dist/types/modes/components/tool-execution.d.ts +53 -0
- package/dist/types/modes/components/tree-selector.d.ts +31 -0
- package/dist/types/modes/components/ttsr-notification.d.ts +13 -0
- package/dist/types/modes/components/user-message-selector.d.ts +28 -0
- package/dist/types/modes/components/user-message.d.ts +8 -0
- package/dist/types/modes/components/visual-truncate.d.ts +19 -0
- package/dist/types/modes/components/welcome.d.ts +33 -0
- package/dist/types/modes/controllers/btw-controller.d.ts +10 -0
- package/dist/types/modes/controllers/command-controller-shared.d.ts +47 -0
- package/dist/types/modes/controllers/command-controller.d.ts +36 -0
- package/dist/types/modes/controllers/event-controller.d.ts +12 -0
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +80 -0
- package/dist/types/modes/controllers/input-controller.d.ts +35 -0
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +10 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +45 -0
- package/dist/types/modes/controllers/ssh-command-controller.d.ts +10 -0
- package/dist/types/modes/controllers/todo-command-controller.d.ts +7 -0
- package/dist/types/modes/index.d.ts +9 -0
- package/dist/types/modes/interactive-mode.d.ts +267 -0
- package/dist/types/modes/loop-limit.d.ts +22 -0
- package/dist/types/modes/oauth-manual-input.d.ts +8 -0
- package/dist/types/modes/print-mode.d.ts +27 -0
- package/dist/types/modes/prompt-action-autocomplete.d.ts +42 -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 +249 -0
- package/dist/types/modes/rpc/rpc-mode.d.ts +17 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +586 -0
- package/dist/types/modes/runtime-init.d.ts +21 -0
- package/dist/types/modes/session-observer-registry.d.ts +26 -0
- package/dist/types/modes/shared.d.ts +6 -0
- package/dist/types/modes/theme/defaults/index.d.ts +9436 -0
- package/dist/types/modes/theme/mermaid-cache.d.ts +9 -0
- package/dist/types/modes/theme/theme.d.ts +273 -0
- package/dist/types/modes/types.d.ts +274 -0
- package/dist/types/modes/utils/context-usage.d.ts +30 -0
- package/dist/types/modes/utils/hotkeys-markdown.d.ts +5 -0
- package/dist/types/modes/utils/keybinding-matchers.d.ts +10 -0
- package/dist/types/modes/utils/tools-markdown.d.ts +5 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +49 -0
- package/dist/types/plan-mode/approved-plan.d.ts +25 -0
- package/dist/types/plan-mode/state.d.ts +6 -0
- package/dist/types/registry/agent-registry.d.ts +62 -0
- package/dist/types/sdk.d.ts +246 -0
- package/dist/types/secrets/index.d.ts +9 -0
- package/dist/types/secrets/obfuscator.d.ts +23 -0
- package/dist/types/secrets/regex.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +898 -0
- package/dist/types/session/agent-storage.d.ts +93 -0
- package/dist/types/session/artifacts.d.ts +61 -0
- package/dist/types/session/auth-storage.d.ts +6 -0
- package/dist/types/session/blob-store.d.ts +63 -0
- package/dist/types/session/client-bridge.d.ts +84 -0
- package/dist/types/session/history-storage.d.ts +16 -0
- package/dist/types/session/messages.d.ts +162 -0
- package/dist/types/session/session-dump-format.d.ts +22 -0
- package/dist/types/session/session-manager.d.ts +539 -0
- package/dist/types/session/session-storage.d.ts +82 -0
- package/dist/types/session/streaming-output.d.ts +185 -0
- package/dist/types/session/tool-choice-queue.d.ts +78 -0
- package/dist/types/slash-commands/acp-builtins.d.ts +18 -0
- package/dist/types/slash-commands/builtin-registry.d.ts +23 -0
- package/dist/types/slash-commands/helpers/context-report.d.ts +7 -0
- package/dist/types/slash-commands/helpers/format.d.ts +7 -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/ssh.d.ts +3 -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 +119 -0
- package/dist/types/ssh/config-writer.d.ts +49 -0
- package/dist/types/ssh/connection-manager.d.ts +33 -0
- package/dist/types/ssh/ssh-executor.d.ts +37 -0
- package/dist/types/ssh/sshfs-mount.d.ts +6 -0
- package/dist/types/ssh/utils.d.ts +2 -0
- package/dist/types/stt/downloader.d.ts +9 -0
- package/dist/types/stt/index.d.ts +3 -0
- package/dist/types/stt/recorder.d.ts +13 -0
- package/dist/types/stt/setup.d.ts +18 -0
- package/dist/types/stt/stt-controller.d.ts +16 -0
- package/dist/types/stt/transcriber.d.ts +16 -0
- package/dist/types/system-prompt.d.ts +93 -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 +18 -0
- package/dist/types/task/executor.d.ts +106 -0
- package/dist/types/task/index.d.ts +38 -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 +36 -0
- package/dist/types/task/parallel.d.ts +34 -0
- package/dist/types/task/render.d.ts +22 -0
- package/dist/types/task/simple-mode.d.ts +8 -0
- package/dist/types/task/subprocess-tool-registry.d.ts +72 -0
- package/dist/types/task/types.d.ts +251 -0
- package/dist/types/task/worktree.d.ts +95 -0
- package/dist/types/thinking.d.ts +30 -0
- package/dist/types/tool-discovery/tool-index.d.ts +107 -0
- package/dist/types/tools/archive-reader.d.ts +40 -0
- package/dist/types/tools/ask.d.ts +109 -0
- package/dist/types/tools/ast-edit.d.ts +72 -0
- package/dist/types/tools/ast-grep.d.ts +64 -0
- package/dist/types/tools/auto-generated-guard.d.ts +17 -0
- package/dist/types/tools/bash-command-fixup.d.ts +16 -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 +130 -0
- package/dist/types/tools/browser/attach.d.ts +34 -0
- package/dist/types/tools/browser/launch.d.ts +60 -0
- package/dist/types/tools/browser/readable.d.ts +17 -0
- package/dist/types/tools/browser/registry.d.ts +42 -0
- package/dist/types/tools/browser/render.d.ts +50 -0
- package/dist/types/tools/browser/tab-protocol.d.ts +144 -0
- package/dist/types/tools/browser/tab-supervisor.d.ts +63 -0
- package/dist/types/tools/browser/tab-worker-entry.d.ts +1 -0
- package/dist/types/tools/browser/tab-worker.d.ts +19 -0
- package/dist/types/tools/browser.d.ts +114 -0
- package/dist/types/tools/calculator.d.ts +76 -0
- package/dist/types/tools/checkpoint.d.ts +63 -0
- package/dist/types/tools/conflict-detect.d.ts +205 -0
- package/dist/types/tools/context.d.ts +19 -0
- package/dist/types/tools/debug.d.ts +209 -0
- package/dist/types/tools/eval.d.ts +74 -0
- package/dist/types/tools/fetch.d.ts +61 -0
- package/dist/types/tools/file-recorder.d.ts +13 -0
- package/dist/types/tools/find.d.ts +88 -0
- package/dist/types/tools/fs-cache-invalidation.d.ts +15 -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 +356 -0
- package/dist/types/tools/github-cache.d.ts +103 -0
- package/dist/types/tools/grouped-file-output.d.ts +36 -0
- package/dist/types/tools/hindsight-recall.d.ts +23 -0
- package/dist/types/tools/hindsight-reflect.d.ts +25 -0
- package/dist/types/tools/hindsight-retain.d.ts +29 -0
- package/dist/types/tools/image-gen.d.ts +78 -0
- package/dist/types/tools/index.d.ts +244 -0
- package/dist/types/tools/inspect-image-renderer.d.ts +26 -0
- package/dist/types/tools/inspect-image.d.ts +31 -0
- package/dist/types/tools/irc.d.ts +73 -0
- package/dist/types/tools/job.d.ts +65 -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/list-limit.d.ts +12 -0
- package/dist/types/tools/match-line-format.d.ts +11 -0
- package/dist/types/tools/output-meta.d.ts +204 -0
- package/dist/types/tools/path-utils.d.ts +125 -0
- package/dist/types/tools/plan-mode-guard.d.ts +18 -0
- package/dist/types/tools/read.d.ts +85 -0
- package/dist/types/tools/recipe/index.d.ts +45 -0
- package/dist/types/tools/recipe/render.d.ts +36 -0
- package/dist/types/tools/recipe/runner.d.ts +60 -0
- package/dist/types/tools/recipe/runners/cargo.d.ts +16 -0
- package/dist/types/tools/recipe/runners/index.d.ts +2 -0
- package/dist/types/tools/recipe/runners/just.d.ts +2 -0
- package/dist/types/tools/recipe/runners/make.d.ts +2 -0
- package/dist/types/tools/recipe/runners/pkg.d.ts +2 -0
- package/dist/types/tools/recipe/runners/task.d.ts +2 -0
- package/dist/types/tools/render-mermaid.d.ts +37 -0
- package/dist/types/tools/render-utils.d.ts +148 -0
- package/dist/types/tools/renderers.d.ts +26 -0
- package/dist/types/tools/report-tool-issue.d.ts +6 -0
- package/dist/types/tools/resolve.d.ts +79 -0
- package/dist/types/tools/review.d.ts +50 -0
- package/dist/types/tools/search-tool-bm25.d.ts +65 -0
- package/dist/types/tools/search.d.ts +90 -0
- package/dist/types/tools/sqlite-reader.d.ts +93 -0
- package/dist/types/tools/ssh.d.ts +67 -0
- package/dist/types/tools/todo-write.d.ts +120 -0
- package/dist/types/tools/tool-errors.d.ts +33 -0
- package/dist/types/tools/tool-result.d.ts +30 -0
- package/dist/types/tools/tool-timeouts.d.ts +51 -0
- package/dist/types/tools/vim.d.ts +58 -0
- package/dist/types/tools/write.d.ts +59 -0
- package/dist/types/tools/yield.d.ts +25 -0
- package/dist/types/tui/code-cell.d.ts +32 -0
- package/dist/types/tui/file-list.d.ts +16 -0
- package/dist/types/tui/index.d.ts +10 -0
- package/dist/types/tui/output-block.d.ts +28 -0
- package/dist/types/tui/status-line.d.ts +18 -0
- package/dist/types/tui/tree-list.d.ts +19 -0
- package/dist/types/tui/types.d.ts +13 -0
- package/dist/types/tui/utils.d.ts +36 -0
- package/dist/types/utils/changelog.d.ts +20 -0
- package/dist/types/utils/clipboard.d.ts +20 -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/event-bus.d.ts +6 -0
- package/dist/types/utils/external-editor.d.ts +17 -0
- package/dist/types/utils/file-display-mode.d.ts +27 -0
- package/dist/types/utils/file-mentions.d.ts +11 -0
- package/dist/types/utils/git.d.ts +360 -0
- package/dist/types/utils/image-loading.d.ts +26 -0
- package/dist/types/utils/image-resize.d.ts +36 -0
- package/dist/types/utils/lang-from-path.d.ts +8 -0
- package/dist/types/utils/markit.d.ts +7 -0
- package/dist/types/utils/open.d.ts +2 -0
- package/dist/types/utils/session-color.d.ts +10 -0
- package/dist/types/utils/shell-snapshot.d.ts +5 -0
- package/dist/types/utils/sixel.d.ts +21 -0
- package/dist/types/utils/title-generator.d.ts +31 -0
- package/dist/types/utils/tool-choice.d.ts +6 -0
- package/dist/types/utils/tools-manager.d.ts +9 -0
- package/dist/types/vim/buffer.d.ts +41 -0
- package/dist/types/vim/commands.d.ts +6 -0
- package/dist/types/vim/engine.d.ts +47 -0
- package/dist/types/vim/parser.d.ts +3 -0
- package/dist/types/vim/render.d.ts +25 -0
- package/dist/types/vim/types.d.ts +182 -0
- package/dist/types/web/kagi.d.ts +21 -0
- package/dist/types/web/parallel.d.ts +57 -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 +12 -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 +2 -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 +77 -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 +76 -0
- package/dist/types/web/search/provider.d.ts +20 -0
- package/dist/types/web/search/providers/anthropic.d.ts +27 -0
- package/dist/types/web/search/providers/base.d.ts +35 -0
- package/dist/types/web/search/providers/brave.d.ts +20 -0
- package/dist/types/web/search/providers/codex.d.ts +31 -0
- package/dist/types/web/search/providers/exa.d.ts +43 -0
- package/dist/types/web/search/providers/gemini.d.ts +60 -0
- package/dist/types/web/search/providers/jina.d.ts +25 -0
- package/dist/types/web/search/providers/kagi.d.ts +21 -0
- package/dist/types/web/search/providers/kimi.d.ts +18 -0
- package/dist/types/web/search/providers/parallel.d.ts +14 -0
- package/dist/types/web/search/providers/perplexity.d.ts +35 -0
- package/dist/types/web/search/providers/searxng.d.ts +43 -0
- package/dist/types/web/search/providers/synthetic.d.ts +24 -0
- package/dist/types/web/search/providers/tavily.d.ts +22 -0
- package/dist/types/web/search/providers/utils.d.ts +24 -0
- package/dist/types/web/search/providers/zai.d.ts +19 -0
- package/dist/types/web/search/render.d.ts +35 -0
- package/dist/types/web/search/types.d.ts +344 -0
- package/dist/types/web/search/utils.d.ts +4 -0
- package/dist/types/workspace-tree.d.ts +42 -0
- package/package.json +124 -123
- package/src/config/mcp-schema.json +1 -1
- package/src/edit/normalize.ts +1 -1
- package/src/extensibility/typebox.ts +1 -1
- package/src/hashline/index.ts +0 -1
- package/src/hashline/input.ts +8 -11
- package/src/hashline/parser.ts +6 -8
- package/src/modes/acp/acp-agent.ts +1 -0
- package/src/modes/controllers/command-controller.ts +1 -0
- package/src/modes/controllers/ssh-command-controller.ts +2 -0
- package/src/modes/theme/theme-schema.json +1 -1
- package/src/prompts/tools/hashline.md +1 -0
- package/src/prompts/tools/read.md +1 -1
- package/src/sdk.ts +14 -0
- package/src/session/agent-session.ts +49 -0
- package/src/slash-commands/builtin-registry.ts +2 -0
- package/src/slash-commands/helpers/ssh.ts +2 -0
- package/src/ssh/connection-manager.ts +28 -7
- package/src/tools/bash-interactive.ts +1 -1
- package/src/tools/bash-pty-selection.ts +14 -0
- package/src/tools/bash.ts +5 -4
- package/src/tools/image-gen.ts +1 -1
- package/src/tools/path-utils.ts +2 -2
- package/src/tools/read.ts +7 -4
- package/src/tools/search.ts +7 -0
- package/src/tools/yield.ts +17 -5
- package/src/tui/code-cell.ts +18 -3
- package/src/web/scrapers/searchcode.ts +1 -2
- package/src/hashline/utils.ts +0 -3
|
@@ -0,0 +1,864 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension system types.
|
|
3
|
+
*
|
|
4
|
+
* Extensions are TypeScript modules that can:
|
|
5
|
+
* - Subscribe to agent lifecycle events
|
|
6
|
+
* - Register LLM-callable tools
|
|
7
|
+
* - Register commands, keyboard shortcuts, and CLI flags
|
|
8
|
+
* - Interact with the user via UI primitives
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentMessage, AgentToolResult, AgentToolUpdateCallback, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
11
|
+
import type { CompactionResult } from "@oh-my-pi/pi-agent-core/compaction";
|
|
12
|
+
import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context, ImageContent, Model, ProviderResponseMetadata, SimpleStreamOptions, Static, TextContent, TSchema } from "@oh-my-pi/pi-ai";
|
|
13
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/utils/oauth/types";
|
|
14
|
+
import type * as piCodingAgent from "@oh-my-pi/pi-coding-agent";
|
|
15
|
+
import type { AutocompleteItem, Component, EditorTheme, KeyId, TUI } from "@oh-my-pi/pi-tui";
|
|
16
|
+
import type { KeybindingsManager } from "../../config/keybindings";
|
|
17
|
+
import type { ModelRegistry } from "../../config/model-registry";
|
|
18
|
+
import type { EditToolDetails } from "../../edit";
|
|
19
|
+
import type { PythonResult } from "../../eval/py/executor";
|
|
20
|
+
import type { BashResult } from "../../exec/bash-executor";
|
|
21
|
+
import type { ExecOptions, ExecResult } from "../../exec/exec";
|
|
22
|
+
import type { CustomEditor } from "../../modes/components/custom-editor";
|
|
23
|
+
import type { Theme } from "../../modes/theme/theme";
|
|
24
|
+
import type { CustomMessage } from "../../session/messages";
|
|
25
|
+
import type { ReadonlySessionManager, SessionManager } from "../../session/session-manager";
|
|
26
|
+
import type { BashToolDetails, BashToolInput, FindToolDetails, FindToolInput, ReadToolDetails, ReadToolInput, SearchToolDetails, SearchToolInput, WriteToolInput } from "../../tools";
|
|
27
|
+
import type { EventBus } from "../../utils/event-bus";
|
|
28
|
+
import type { AgentEndEvent, AgentStartEvent, AutoCompactionEndEvent, AutoCompactionStartEvent, AutoRetryEndEvent, AutoRetryStartEvent, ContextEvent, GoalUpdatedEvent, SessionBeforeBranchEvent, SessionBeforeBranchResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBranchEvent, SessionCompactEvent, SessionCompactingEvent, SessionCompactingResult, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionSwitchEvent, SessionTreeEvent, TodoReminderEvent, ToolCallEventResult, ToolResultEventResult, TtsrTriggeredEvent, TurnEndEvent, TurnStartEvent } from "../shared-events";
|
|
29
|
+
import type { SlashCommandInfo } from "../slash-commands";
|
|
30
|
+
export type { AppKeybinding, KeybindingsManager } from "../../config/keybindings";
|
|
31
|
+
export type { ExecOptions, ExecResult } from "../../exec/exec";
|
|
32
|
+
export type { AgentToolResult, AgentToolUpdateCallback };
|
|
33
|
+
/**
|
|
34
|
+
* UI dialog options for extensions.
|
|
35
|
+
*/
|
|
36
|
+
export interface ExtensionUIDialogOptions {
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
timeout?: number;
|
|
39
|
+
/** Invoked when the UI times out while waiting for a selection/input */
|
|
40
|
+
onTimeout?: () => void;
|
|
41
|
+
/** Initial cursor position for select dialogs (0-indexed) */
|
|
42
|
+
initialIndex?: number;
|
|
43
|
+
/** Render an outlined list for select dialogs */
|
|
44
|
+
outline?: boolean;
|
|
45
|
+
/** Invoked when user presses left arrow in select dialogs */
|
|
46
|
+
onLeft?: () => void;
|
|
47
|
+
/** Invoked when user presses right arrow in select dialogs */
|
|
48
|
+
onRight?: () => void;
|
|
49
|
+
/** Invoked when user presses the external editor shortcut in select dialogs */
|
|
50
|
+
onExternalEditor?: () => void;
|
|
51
|
+
/** Optional footer hint text rendered by interactive selector */
|
|
52
|
+
helpText?: string;
|
|
53
|
+
}
|
|
54
|
+
/** Raw terminal input listener for extensions. */
|
|
55
|
+
export type TerminalInputHandler = (data: string) => {
|
|
56
|
+
consume?: boolean;
|
|
57
|
+
data?: string;
|
|
58
|
+
} | undefined;
|
|
59
|
+
export type WidgetPlacement = "aboveEditor" | "belowEditor";
|
|
60
|
+
export interface ExtensionWidgetOptions {
|
|
61
|
+
placement?: WidgetPlacement;
|
|
62
|
+
}
|
|
63
|
+
export type ExtensionUiComponent = Component & {
|
|
64
|
+
dispose?(): void;
|
|
65
|
+
};
|
|
66
|
+
export type ExtensionUiComponentFactory = (tui: TUI, theme: Theme) => ExtensionUiComponent;
|
|
67
|
+
export type ExtensionWidgetContent = string[] | ExtensionUiComponentFactory | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* UI context for extensions to request interactive UI.
|
|
70
|
+
* Each mode (interactive, RPC, print) provides its own implementation.
|
|
71
|
+
*/
|
|
72
|
+
export interface ExtensionUIContext {
|
|
73
|
+
/** Show a selector and return the user's choice. */
|
|
74
|
+
select(title: string, options: string[], dialogOptions?: ExtensionUIDialogOptions): Promise<string | undefined>;
|
|
75
|
+
/** Show a confirmation dialog. */
|
|
76
|
+
confirm(title: string, message: string, dialogOptions?: ExtensionUIDialogOptions): Promise<boolean>;
|
|
77
|
+
/** Show a text input dialog. */
|
|
78
|
+
input(title: string, placeholder?: string, dialogOptions?: ExtensionUIDialogOptions): Promise<string | undefined>;
|
|
79
|
+
/** Show a notification to the user. */
|
|
80
|
+
notify(message: string, type?: "info" | "warning" | "error"): void;
|
|
81
|
+
/** Listen to raw terminal input (interactive mode only). Returns an unsubscribe function. */
|
|
82
|
+
onTerminalInput(handler: TerminalInputHandler): () => void;
|
|
83
|
+
/** Set status text in the footer/status bar. Pass undefined to clear. */
|
|
84
|
+
setStatus(key: string, text: string | undefined): void;
|
|
85
|
+
/** Set the working/loading message shown during streaming. Call with no argument to restore default. */
|
|
86
|
+
setWorkingMessage(message?: string): void;
|
|
87
|
+
/** Set a widget to display above or below the editor. Accepts string array or component factory. */
|
|
88
|
+
setWidget(key: string, content: ExtensionWidgetContent, options?: ExtensionWidgetOptions): void;
|
|
89
|
+
/** Set a custom footer component, or undefined to restore the built-in footer. */
|
|
90
|
+
setFooter(factory: ExtensionUiComponentFactory | undefined): void;
|
|
91
|
+
/** Set a custom header component, or undefined to restore the built-in header. */
|
|
92
|
+
setHeader(factory: ExtensionUiComponentFactory | undefined): void;
|
|
93
|
+
/** Set the terminal window/tab title. */
|
|
94
|
+
setTitle(title: string): void;
|
|
95
|
+
/** Show a custom component with keyboard focus. */
|
|
96
|
+
custom<T>(factory: (tui: TUI, theme: Theme, keybindings: KeybindingsManager, done: (result: T) => void) => ExtensionUiComponent | Promise<ExtensionUiComponent>, options?: {
|
|
97
|
+
overlay?: boolean;
|
|
98
|
+
}): Promise<T>;
|
|
99
|
+
/** Set the text in the core input editor. */
|
|
100
|
+
setEditorText(text: string): void;
|
|
101
|
+
/**
|
|
102
|
+
* Paste text into the core input editor.
|
|
103
|
+
*
|
|
104
|
+
* Interactive mode should route through the editor's paste handling (e.g. large paste markers).
|
|
105
|
+
* Non-interactive modes may fall back to replacing the editor text.
|
|
106
|
+
*/
|
|
107
|
+
pasteToEditor(text: string): void;
|
|
108
|
+
/** Get the current text from the core input editor. */
|
|
109
|
+
getEditorText(): string;
|
|
110
|
+
/** Show a multi-line editor for text editing. */
|
|
111
|
+
editor(title: string, prefill?: string, dialogOptions?: ExtensionUIDialogOptions, editorOptions?: {
|
|
112
|
+
promptStyle?: boolean;
|
|
113
|
+
}): Promise<string | undefined>;
|
|
114
|
+
/**
|
|
115
|
+
* Set a custom editor component via factory function, or `undefined` to restore the default editor.
|
|
116
|
+
*
|
|
117
|
+
* The factory must return a {@link CustomEditor} subclass. Plain `EditorComponent`/`Editor`
|
|
118
|
+
* instances do not implement the action-keys, escape callbacks, and custom-key-handler surface
|
|
119
|
+
* required by interactive mode.
|
|
120
|
+
*/
|
|
121
|
+
setEditorComponent(factory: ((tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => CustomEditor) | undefined): void;
|
|
122
|
+
/** Get the current theme for styling. */
|
|
123
|
+
readonly theme: Theme;
|
|
124
|
+
/** Get all available themes with names and paths. */
|
|
125
|
+
getAllThemes(): Promise<{
|
|
126
|
+
name: string;
|
|
127
|
+
path: string | undefined;
|
|
128
|
+
}[]>;
|
|
129
|
+
/** Load a theme by name without switching to it. */
|
|
130
|
+
getTheme(name: string): Promise<Theme | undefined>;
|
|
131
|
+
/** Set the current theme by name or Theme object. */
|
|
132
|
+
setTheme(theme: string | Theme): Promise<{
|
|
133
|
+
success: boolean;
|
|
134
|
+
error?: string;
|
|
135
|
+
}>;
|
|
136
|
+
/** Get current tool output expansion state. */
|
|
137
|
+
getToolsExpanded(): boolean;
|
|
138
|
+
/** Set tool output expansion state. */
|
|
139
|
+
setToolsExpanded(expanded: boolean): void;
|
|
140
|
+
}
|
|
141
|
+
export interface ContextUsage {
|
|
142
|
+
/** Estimated context tokens, or null if unknown (e.g. right after compaction, before next LLM response). */
|
|
143
|
+
tokens: number | null;
|
|
144
|
+
contextWindow: number;
|
|
145
|
+
/** Context usage as percentage of context window, or null if tokens is unknown. */
|
|
146
|
+
percent: number | null;
|
|
147
|
+
}
|
|
148
|
+
export interface CompactOptions {
|
|
149
|
+
onComplete?: (result: CompactionResult) => void;
|
|
150
|
+
onError?: (error: Error) => void;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Context passed to extension event handlers.
|
|
154
|
+
*/
|
|
155
|
+
export interface ExtensionContext {
|
|
156
|
+
/** UI methods for user interaction */
|
|
157
|
+
ui: ExtensionUIContext;
|
|
158
|
+
/** Get current context usage for the active model. */
|
|
159
|
+
getContextUsage(): ContextUsage | undefined;
|
|
160
|
+
/** Compact the session context (interactive mode shows UI). */
|
|
161
|
+
compact(instructionsOrOptions?: string | CompactOptions): Promise<void>;
|
|
162
|
+
/** Whether UI is available (false in print/RPC mode) */
|
|
163
|
+
hasUI: boolean;
|
|
164
|
+
/** Current working directory */
|
|
165
|
+
cwd: string;
|
|
166
|
+
/** Session manager (read-only) */
|
|
167
|
+
sessionManager: ReadonlySessionManager;
|
|
168
|
+
/** Model registry for API key resolution */
|
|
169
|
+
modelRegistry: ModelRegistry;
|
|
170
|
+
/** Current model (may be undefined) */
|
|
171
|
+
model: Model | undefined;
|
|
172
|
+
/** Whether the agent is idle (not streaming) */
|
|
173
|
+
isIdle(): boolean;
|
|
174
|
+
/** Abort the current agent operation */
|
|
175
|
+
abort(): void;
|
|
176
|
+
/** Whether there are queued messages waiting */
|
|
177
|
+
hasPendingMessages(): boolean;
|
|
178
|
+
/** Gracefully shutdown and exit. */
|
|
179
|
+
shutdown(): void;
|
|
180
|
+
/** Get the current effective system prompt. */
|
|
181
|
+
getSystemPrompt(): string[];
|
|
182
|
+
/** @deprecated Use hasPendingMessages() instead */
|
|
183
|
+
hasQueuedMessages(): boolean;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Extended context for command handlers.
|
|
187
|
+
* Includes session control methods only safe in user-initiated commands.
|
|
188
|
+
*/
|
|
189
|
+
export interface ExtensionCommandContext extends ExtensionContext {
|
|
190
|
+
/** Get current context usage for the active model. */
|
|
191
|
+
getContextUsage(): ContextUsage | undefined;
|
|
192
|
+
/** Wait for the agent to finish streaming */
|
|
193
|
+
waitForIdle(): Promise<void>;
|
|
194
|
+
/** Start a new session, optionally with initialization. */
|
|
195
|
+
newSession(options?: {
|
|
196
|
+
parentSession?: string;
|
|
197
|
+
setup?: (sessionManager: SessionManager) => Promise<void>;
|
|
198
|
+
}): Promise<{
|
|
199
|
+
cancelled: boolean;
|
|
200
|
+
}>;
|
|
201
|
+
/** Branch from a specific entry, creating a new session file. */
|
|
202
|
+
branch(entryId: string): Promise<{
|
|
203
|
+
cancelled: boolean;
|
|
204
|
+
}>;
|
|
205
|
+
/** Navigate to a different point in the session tree. */
|
|
206
|
+
navigateTree(targetId: string, options?: {
|
|
207
|
+
summarize?: boolean;
|
|
208
|
+
}): Promise<{
|
|
209
|
+
cancelled: boolean;
|
|
210
|
+
}>;
|
|
211
|
+
/** Switch to a different session file. */
|
|
212
|
+
switchSession(sessionPath: string): Promise<{
|
|
213
|
+
cancelled: boolean;
|
|
214
|
+
}>;
|
|
215
|
+
/** Reload the current session/runtime state. */
|
|
216
|
+
reload(): Promise<void>;
|
|
217
|
+
/** Compact the session context (interactive mode shows UI). */
|
|
218
|
+
compact(instructionsOrOptions?: string | CompactOptions): Promise<void>;
|
|
219
|
+
}
|
|
220
|
+
/** Rendering options for tool results */
|
|
221
|
+
export interface ToolRenderResultOptions {
|
|
222
|
+
/** Whether the result view is expanded */
|
|
223
|
+
expanded: boolean;
|
|
224
|
+
/** Whether this is a partial/streaming result */
|
|
225
|
+
isPartial: boolean;
|
|
226
|
+
/** Current spinner frame index for animated elements (optional) */
|
|
227
|
+
spinnerFrame?: number;
|
|
228
|
+
}
|
|
229
|
+
/** Session event for tool onSession lifecycle */
|
|
230
|
+
export interface ToolSessionEvent {
|
|
231
|
+
/** Reason for the session event */
|
|
232
|
+
reason: "start" | "switch" | "branch" | "tree" | "shutdown";
|
|
233
|
+
/** Previous session file path, or undefined for "start" and "shutdown" */
|
|
234
|
+
previousSessionFile: string | undefined;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Tool definition for registerTool().
|
|
238
|
+
*/
|
|
239
|
+
export interface ToolDefinition<TParams extends TSchema = TSchema, TDetails = unknown> {
|
|
240
|
+
/** Tool name (used in LLM tool calls) */
|
|
241
|
+
name: string;
|
|
242
|
+
/** Human-readable label for UI */
|
|
243
|
+
label: string;
|
|
244
|
+
/** Description for LLM */
|
|
245
|
+
description: string;
|
|
246
|
+
/** Parameter schema (Zod, or TypeBox for legacy/extension compat). */
|
|
247
|
+
parameters: TParams;
|
|
248
|
+
/** If true, tool is excluded unless explicitly listed in --tools or agent's tools field */
|
|
249
|
+
hidden?: boolean;
|
|
250
|
+
/** If true, tool is registered but not auto-included in the initial active set.
|
|
251
|
+
* The registering extension is responsible for activating/deactivating it via setActiveTools(). */
|
|
252
|
+
defaultInactive?: boolean;
|
|
253
|
+
/** If true, tool may stage deferred changes that require explicit resolve/discard. */
|
|
254
|
+
deferrable?: boolean;
|
|
255
|
+
/** MCP server name for discovery/search metadata when this tool fronts an MCP server. */
|
|
256
|
+
mcpServerName?: string;
|
|
257
|
+
/** Original MCP tool name for discovery/search metadata. */
|
|
258
|
+
mcpToolName?: string;
|
|
259
|
+
/** Execute the tool. */
|
|
260
|
+
execute(toolCallId: string, params: Static<TParams>, signal: AbortSignal | undefined, onUpdate: AgentToolUpdateCallback<TDetails> | undefined, ctx: ExtensionContext): Promise<AgentToolResult<TDetails>>;
|
|
261
|
+
/** Called on session lifecycle events - use to reconstruct state or cleanup resources */
|
|
262
|
+
onSession?: (event: ToolSessionEvent, ctx: ExtensionContext) => void | Promise<void>;
|
|
263
|
+
/** Custom rendering for tool call display */
|
|
264
|
+
renderCall?: (args: Static<TParams>, options: ToolRenderResultOptions, theme: Theme) => Component;
|
|
265
|
+
/** Custom rendering for tool result display */
|
|
266
|
+
renderResult?: (result: AgentToolResult<TDetails>, options: ToolRenderResultOptions, theme: Theme, args?: Static<TParams>) => Component;
|
|
267
|
+
}
|
|
268
|
+
/** Fired after session_start to allow extensions to provide additional resource paths. */
|
|
269
|
+
export interface ResourcesDiscoverEvent {
|
|
270
|
+
type: "resources_discover";
|
|
271
|
+
cwd: string;
|
|
272
|
+
reason: "startup" | "reload";
|
|
273
|
+
}
|
|
274
|
+
/** Result from resources_discover event handler */
|
|
275
|
+
export interface ResourcesDiscoverResult {
|
|
276
|
+
skillPaths?: string[];
|
|
277
|
+
promptPaths?: string[];
|
|
278
|
+
themePaths?: string[];
|
|
279
|
+
}
|
|
280
|
+
export type { SessionBeforeBranchEvent, SessionBeforeCompactEvent, SessionBeforeSwitchEvent, SessionBeforeTreeEvent, SessionBranchEvent, SessionCompactEvent, SessionCompactingEvent, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionSwitchEvent, SessionTreeEvent, TreePreparation, } from "../shared-events";
|
|
281
|
+
export type { ContextEvent } from "../shared-events";
|
|
282
|
+
/** Fired before a provider request is sent. Can replace the payload. */
|
|
283
|
+
export interface BeforeProviderRequestEvent {
|
|
284
|
+
type: "before_provider_request";
|
|
285
|
+
payload: unknown;
|
|
286
|
+
}
|
|
287
|
+
/** Fired after a provider response is received, before its stream body is consumed. */
|
|
288
|
+
export interface AfterProviderResponseEvent extends ProviderResponseMetadata {
|
|
289
|
+
type: "after_provider_response";
|
|
290
|
+
}
|
|
291
|
+
/** Fired after user submits prompt but before agent loop. */
|
|
292
|
+
export interface BeforeAgentStartEvent {
|
|
293
|
+
type: "before_agent_start";
|
|
294
|
+
prompt: string;
|
|
295
|
+
images?: ImageContent[];
|
|
296
|
+
systemPrompt: string[];
|
|
297
|
+
}
|
|
298
|
+
export type { AgentEndEvent, AgentStartEvent, TurnEndEvent, TurnStartEvent } from "../shared-events";
|
|
299
|
+
/** Fired when a message starts (user, assistant, or toolResult) */
|
|
300
|
+
export interface MessageStartEvent {
|
|
301
|
+
type: "message_start";
|
|
302
|
+
message: AgentMessage;
|
|
303
|
+
}
|
|
304
|
+
/** Fired during assistant message streaming with token-by-token updates */
|
|
305
|
+
export interface MessageUpdateEvent {
|
|
306
|
+
type: "message_update";
|
|
307
|
+
message: AgentMessage;
|
|
308
|
+
assistantMessageEvent: AssistantMessageEvent;
|
|
309
|
+
}
|
|
310
|
+
/** Fired when a message ends */
|
|
311
|
+
export interface MessageEndEvent {
|
|
312
|
+
type: "message_end";
|
|
313
|
+
message: AgentMessage;
|
|
314
|
+
}
|
|
315
|
+
/** Fired when a tool starts executing */
|
|
316
|
+
export interface ToolExecutionStartEvent {
|
|
317
|
+
type: "tool_execution_start";
|
|
318
|
+
toolCallId: string;
|
|
319
|
+
toolName: string;
|
|
320
|
+
args: unknown;
|
|
321
|
+
intent?: string;
|
|
322
|
+
}
|
|
323
|
+
/** Fired during tool execution with partial/streaming output */
|
|
324
|
+
export interface ToolExecutionUpdateEvent {
|
|
325
|
+
type: "tool_execution_update";
|
|
326
|
+
toolCallId: string;
|
|
327
|
+
toolName: string;
|
|
328
|
+
args: unknown;
|
|
329
|
+
partialResult: unknown;
|
|
330
|
+
}
|
|
331
|
+
/** Fired when a tool finishes executing */
|
|
332
|
+
export interface ToolExecutionEndEvent {
|
|
333
|
+
type: "tool_execution_end";
|
|
334
|
+
toolCallId: string;
|
|
335
|
+
toolName: string;
|
|
336
|
+
result: unknown;
|
|
337
|
+
isError: boolean;
|
|
338
|
+
}
|
|
339
|
+
export type { AutoCompactionEndEvent, AutoCompactionStartEvent, AutoRetryEndEvent, AutoRetryStartEvent, TodoReminderEvent, TtsrTriggeredEvent, } from "../shared-events";
|
|
340
|
+
/** Fired when AuthStorage automatically soft-disables a credential (e.g. OAuth `invalid_grant`). Not fired for user-initiated `remove()` or duplicate-credential dedup. */
|
|
341
|
+
export interface CredentialDisabledEvent {
|
|
342
|
+
type: "credential_disabled";
|
|
343
|
+
/** Provider id whose credential was disabled (e.g. "anthropic"). */
|
|
344
|
+
provider: string;
|
|
345
|
+
/** Verbatim error captured for forensics (truncated upstream). */
|
|
346
|
+
disabledCause: string;
|
|
347
|
+
}
|
|
348
|
+
/** Fired when user executes a bash command via ! or !! prefix */
|
|
349
|
+
export interface UserBashEvent {
|
|
350
|
+
type: "user_bash";
|
|
351
|
+
/** The command to execute */
|
|
352
|
+
command: string;
|
|
353
|
+
/** True if !! prefix was used (excluded from LLM context) */
|
|
354
|
+
excludeFromContext: boolean;
|
|
355
|
+
/** Current working directory */
|
|
356
|
+
cwd: string;
|
|
357
|
+
}
|
|
358
|
+
/** Fired when user executes Python code via $ or $$ prefix */
|
|
359
|
+
export interface UserPythonEvent {
|
|
360
|
+
type: "user_python";
|
|
361
|
+
/** The Python code to execute */
|
|
362
|
+
code: string;
|
|
363
|
+
/** True if $$ prefix was used (excluded from LLM context) */
|
|
364
|
+
excludeFromContext: boolean;
|
|
365
|
+
/** Current working directory */
|
|
366
|
+
cwd: string;
|
|
367
|
+
}
|
|
368
|
+
/** Fired when the user submits input (interactive mode only). */
|
|
369
|
+
export interface InputEvent {
|
|
370
|
+
type: "input";
|
|
371
|
+
text: string;
|
|
372
|
+
images?: ImageContent[];
|
|
373
|
+
source: "interactive" | "rpc" | "extension";
|
|
374
|
+
}
|
|
375
|
+
interface ToolCallEventBase {
|
|
376
|
+
type: "tool_call";
|
|
377
|
+
toolCallId: string;
|
|
378
|
+
}
|
|
379
|
+
export interface BashToolCallEvent extends ToolCallEventBase {
|
|
380
|
+
toolName: "bash";
|
|
381
|
+
input: BashToolInput;
|
|
382
|
+
}
|
|
383
|
+
export interface ReadToolCallEvent extends ToolCallEventBase {
|
|
384
|
+
toolName: "read";
|
|
385
|
+
input: ReadToolInput;
|
|
386
|
+
}
|
|
387
|
+
export interface EditToolCallEvent extends ToolCallEventBase {
|
|
388
|
+
toolName: "edit";
|
|
389
|
+
input: Record<string, unknown>;
|
|
390
|
+
}
|
|
391
|
+
export interface WriteToolCallEvent extends ToolCallEventBase {
|
|
392
|
+
toolName: "write";
|
|
393
|
+
input: WriteToolInput;
|
|
394
|
+
}
|
|
395
|
+
export interface SearchToolCallEvent extends ToolCallEventBase {
|
|
396
|
+
toolName: "search";
|
|
397
|
+
input: SearchToolInput;
|
|
398
|
+
}
|
|
399
|
+
export interface FindToolCallEvent extends ToolCallEventBase {
|
|
400
|
+
toolName: "find";
|
|
401
|
+
input: FindToolInput;
|
|
402
|
+
}
|
|
403
|
+
export interface CustomToolCallEvent extends ToolCallEventBase {
|
|
404
|
+
toolName: string;
|
|
405
|
+
input: Record<string, unknown>;
|
|
406
|
+
}
|
|
407
|
+
/** Fired before a tool executes. Can block. */
|
|
408
|
+
export type ToolCallEvent = BashToolCallEvent | ReadToolCallEvent | EditToolCallEvent | WriteToolCallEvent | SearchToolCallEvent | FindToolCallEvent | CustomToolCallEvent;
|
|
409
|
+
interface ToolResultEventBase {
|
|
410
|
+
type: "tool_result";
|
|
411
|
+
toolCallId: string;
|
|
412
|
+
input: Record<string, unknown>;
|
|
413
|
+
content: (TextContent | ImageContent)[];
|
|
414
|
+
isError: boolean;
|
|
415
|
+
}
|
|
416
|
+
export interface BashToolResultEvent extends ToolResultEventBase {
|
|
417
|
+
toolName: "bash";
|
|
418
|
+
details: BashToolDetails | undefined;
|
|
419
|
+
}
|
|
420
|
+
export interface ReadToolResultEvent extends ToolResultEventBase {
|
|
421
|
+
toolName: "read";
|
|
422
|
+
details: ReadToolDetails | undefined;
|
|
423
|
+
}
|
|
424
|
+
export interface EditToolResultEvent extends ToolResultEventBase {
|
|
425
|
+
toolName: "edit";
|
|
426
|
+
details: EditToolDetails | undefined;
|
|
427
|
+
}
|
|
428
|
+
export interface WriteToolResultEvent extends ToolResultEventBase {
|
|
429
|
+
toolName: "write";
|
|
430
|
+
details: undefined;
|
|
431
|
+
}
|
|
432
|
+
export interface SearchToolResultEvent extends ToolResultEventBase {
|
|
433
|
+
toolName: "search";
|
|
434
|
+
details: SearchToolDetails | undefined;
|
|
435
|
+
}
|
|
436
|
+
export interface FindToolResultEvent extends ToolResultEventBase {
|
|
437
|
+
toolName: "find";
|
|
438
|
+
details: FindToolDetails | undefined;
|
|
439
|
+
}
|
|
440
|
+
export interface CustomToolResultEvent extends ToolResultEventBase {
|
|
441
|
+
toolName: string;
|
|
442
|
+
details: unknown;
|
|
443
|
+
}
|
|
444
|
+
/** Fired after a tool executes. Can modify result. */
|
|
445
|
+
export type ToolResultEvent = BashToolResultEvent | ReadToolResultEvent | EditToolResultEvent | WriteToolResultEvent | SearchToolResultEvent | FindToolResultEvent | CustomToolResultEvent;
|
|
446
|
+
/**
|
|
447
|
+
* Type guard for narrowing ToolCallEvent by tool name.
|
|
448
|
+
*
|
|
449
|
+
* Built-in tools narrow automatically (no type params needed):
|
|
450
|
+
* ```ts
|
|
451
|
+
* if (isToolCallEventType("bash", event)) {
|
|
452
|
+
* event.input.command; // string
|
|
453
|
+
* }
|
|
454
|
+
* ```
|
|
455
|
+
*
|
|
456
|
+
* Custom tools require explicit type parameters:
|
|
457
|
+
* ```ts
|
|
458
|
+
* if (isToolCallEventType<"my_tool", MyToolInput>("my_tool", event)) {
|
|
459
|
+
* event.input.action; // typed
|
|
460
|
+
* }
|
|
461
|
+
* ```
|
|
462
|
+
*
|
|
463
|
+
* Note: Direct narrowing via `event.toolName === "bash"` doesn't work because
|
|
464
|
+
* CustomToolCallEvent.toolName is `string` which overlaps with all literals.
|
|
465
|
+
*/
|
|
466
|
+
export declare function isToolCallEventType(toolName: "bash", event: ToolCallEvent): event is BashToolCallEvent;
|
|
467
|
+
export declare function isToolCallEventType(toolName: "read", event: ToolCallEvent): event is ReadToolCallEvent;
|
|
468
|
+
export declare function isToolCallEventType(toolName: "edit", event: ToolCallEvent): event is EditToolCallEvent;
|
|
469
|
+
export declare function isToolCallEventType(toolName: "write", event: ToolCallEvent): event is WriteToolCallEvent;
|
|
470
|
+
export declare function isToolCallEventType(toolName: "search", event: ToolCallEvent): event is SearchToolCallEvent;
|
|
471
|
+
export declare function isToolCallEventType(toolName: "find", event: ToolCallEvent): event is FindToolCallEvent;
|
|
472
|
+
export declare function isToolCallEventType<TName extends string, TInput extends Record<string, unknown>>(toolName: TName, event: ToolCallEvent): event is ToolCallEvent & {
|
|
473
|
+
toolName: TName;
|
|
474
|
+
input: TInput;
|
|
475
|
+
};
|
|
476
|
+
/** Union of all event types */
|
|
477
|
+
export type ExtensionEvent = ResourcesDiscoverEvent | SessionEvent | ContextEvent | BeforeProviderRequestEvent | AfterProviderResponseEvent | BeforeAgentStartEvent | AgentStartEvent | AgentEndEvent | TurnStartEvent | TurnEndEvent | MessageStartEvent | MessageUpdateEvent | MessageEndEvent | ToolExecutionStartEvent | ToolExecutionUpdateEvent | ToolExecutionEndEvent | AutoCompactionStartEvent | AutoCompactionEndEvent | AutoRetryStartEvent | AutoRetryEndEvent | TtsrTriggeredEvent | TodoReminderEvent | GoalUpdatedEvent | CredentialDisabledEvent | UserBashEvent | UserPythonEvent | InputEvent | ToolCallEvent | ToolResultEvent;
|
|
478
|
+
export interface ContextEventResult {
|
|
479
|
+
messages?: AgentMessage[];
|
|
480
|
+
}
|
|
481
|
+
export type BeforeProviderRequestEventResult = unknown;
|
|
482
|
+
export type { ToolCallEventResult } from "../shared-events";
|
|
483
|
+
/** Result from input event handler */
|
|
484
|
+
export interface InputEventResult {
|
|
485
|
+
/** If true, the input was handled and should not continue through normal flow */
|
|
486
|
+
handled?: boolean;
|
|
487
|
+
/** Replace the input text */
|
|
488
|
+
text?: string;
|
|
489
|
+
/** Replace any pending images */
|
|
490
|
+
images?: ImageContent[];
|
|
491
|
+
}
|
|
492
|
+
/** Result from user_bash event handler */
|
|
493
|
+
export interface UserBashEventResult {
|
|
494
|
+
/** Full replacement: extension handled execution, use this result */
|
|
495
|
+
result?: BashResult;
|
|
496
|
+
}
|
|
497
|
+
/** Result from user_python event handler */
|
|
498
|
+
export interface UserPythonEventResult {
|
|
499
|
+
/** Full replacement: extension handled execution, use this result */
|
|
500
|
+
result?: PythonResult;
|
|
501
|
+
}
|
|
502
|
+
export type { ToolResultEventResult } from "../shared-events";
|
|
503
|
+
export interface BeforeAgentStartEventResult {
|
|
504
|
+
message?: Pick<CustomMessage, "customType" | "content" | "display" | "details" | "attribution">;
|
|
505
|
+
/** Replace the system prompt for this turn. If multiple extensions return this, they are chained. */
|
|
506
|
+
systemPrompt?: string[];
|
|
507
|
+
}
|
|
508
|
+
export type { SessionBeforeBranchResult, SessionBeforeCompactResult, SessionBeforeSwitchResult, SessionBeforeTreeResult, SessionCompactingResult, } from "../shared-events";
|
|
509
|
+
export interface MessageRenderOptions {
|
|
510
|
+
expanded: boolean;
|
|
511
|
+
}
|
|
512
|
+
export type MessageRenderer<T = unknown> = (message: CustomMessage<T>, options: MessageRenderOptions, theme: Theme) => Component | undefined;
|
|
513
|
+
export interface RegisteredCommand {
|
|
514
|
+
name: string;
|
|
515
|
+
description?: string;
|
|
516
|
+
getArgumentCompletions?: (argumentPrefix: string) => AutocompleteItem[] | null;
|
|
517
|
+
handler: (args: string, ctx: ExtensionCommandContext) => Promise<void>;
|
|
518
|
+
}
|
|
519
|
+
/** Handler function type for events */
|
|
520
|
+
export type ExtensionHandler<E, R = undefined> = (event: E, ctx: ExtensionContext) => Promise<R | void> | R | void;
|
|
521
|
+
/**
|
|
522
|
+
* ExtensionAPI passed to extension factory functions.
|
|
523
|
+
*/
|
|
524
|
+
export interface ExtensionAPI {
|
|
525
|
+
/** File logger for error/warning/debug messages */
|
|
526
|
+
logger: typeof import("@oh-my-pi/pi-utils").logger;
|
|
527
|
+
/** Injected zod-backed typebox shim for legacy `Type.Object(...)` parameter authoring. */
|
|
528
|
+
typebox: typeof import("../typebox");
|
|
529
|
+
/** Injected zod module for Zod-authored extension tools (canonical going forward). */
|
|
530
|
+
zod: typeof import("zod/v4");
|
|
531
|
+
/** Injected pi-coding-agent exports for accessing SDK utilities */
|
|
532
|
+
pi: typeof piCodingAgent;
|
|
533
|
+
on(event: "resources_discover", handler: ExtensionHandler<ResourcesDiscoverEvent, ResourcesDiscoverResult>): void;
|
|
534
|
+
on(event: "session_start", handler: ExtensionHandler<SessionStartEvent>): void;
|
|
535
|
+
on(event: "session_before_switch", handler: ExtensionHandler<SessionBeforeSwitchEvent, SessionBeforeSwitchResult>): void;
|
|
536
|
+
on(event: "session_switch", handler: ExtensionHandler<SessionSwitchEvent>): void;
|
|
537
|
+
on(event: "session_before_branch", handler: ExtensionHandler<SessionBeforeBranchEvent, SessionBeforeBranchResult>): void;
|
|
538
|
+
on(event: "session_branch", handler: ExtensionHandler<SessionBranchEvent>): void;
|
|
539
|
+
on(event: "session_before_compact", handler: ExtensionHandler<SessionBeforeCompactEvent, SessionBeforeCompactResult>): void;
|
|
540
|
+
on(event: "session.compacting", handler: ExtensionHandler<SessionCompactingEvent, SessionCompactingResult>): void;
|
|
541
|
+
on(event: "session_compact", handler: ExtensionHandler<SessionCompactEvent>): void;
|
|
542
|
+
on(event: "session_shutdown", handler: ExtensionHandler<SessionShutdownEvent>): void;
|
|
543
|
+
on(event: "session_before_tree", handler: ExtensionHandler<SessionBeforeTreeEvent, SessionBeforeTreeResult>): void;
|
|
544
|
+
on(event: "session_tree", handler: ExtensionHandler<SessionTreeEvent>): void;
|
|
545
|
+
on(event: "context", handler: ExtensionHandler<ContextEvent, ContextEventResult>): void;
|
|
546
|
+
on(event: "before_provider_request", handler: ExtensionHandler<BeforeProviderRequestEvent, BeforeProviderRequestEventResult>): void;
|
|
547
|
+
on(event: "after_provider_response", handler: ExtensionHandler<AfterProviderResponseEvent>): void;
|
|
548
|
+
on(event: "before_agent_start", handler: ExtensionHandler<BeforeAgentStartEvent, BeforeAgentStartEventResult>): void;
|
|
549
|
+
on(event: "agent_start", handler: ExtensionHandler<AgentStartEvent>): void;
|
|
550
|
+
on(event: "agent_end", handler: ExtensionHandler<AgentEndEvent>): void;
|
|
551
|
+
on(event: "turn_start", handler: ExtensionHandler<TurnStartEvent>): void;
|
|
552
|
+
on(event: "turn_end", handler: ExtensionHandler<TurnEndEvent>): void;
|
|
553
|
+
on(event: "message_start", handler: ExtensionHandler<MessageStartEvent>): void;
|
|
554
|
+
on(event: "message_update", handler: ExtensionHandler<MessageUpdateEvent>): void;
|
|
555
|
+
on(event: "message_end", handler: ExtensionHandler<MessageEndEvent>): void;
|
|
556
|
+
on(event: "tool_execution_start", handler: ExtensionHandler<ToolExecutionStartEvent>): void;
|
|
557
|
+
on(event: "tool_execution_update", handler: ExtensionHandler<ToolExecutionUpdateEvent>): void;
|
|
558
|
+
on(event: "tool_execution_end", handler: ExtensionHandler<ToolExecutionEndEvent>): void;
|
|
559
|
+
on(event: "auto_compaction_start", handler: ExtensionHandler<AutoCompactionStartEvent>): void;
|
|
560
|
+
on(event: "auto_compaction_end", handler: ExtensionHandler<AutoCompactionEndEvent>): void;
|
|
561
|
+
on(event: "auto_retry_start", handler: ExtensionHandler<AutoRetryStartEvent>): void;
|
|
562
|
+
on(event: "auto_retry_end", handler: ExtensionHandler<AutoRetryEndEvent>): void;
|
|
563
|
+
on(event: "ttsr_triggered", handler: ExtensionHandler<TtsrTriggeredEvent>): void;
|
|
564
|
+
on(event: "todo_reminder", handler: ExtensionHandler<TodoReminderEvent>): void;
|
|
565
|
+
on(event: "goal_updated", handler: ExtensionHandler<GoalUpdatedEvent>): void;
|
|
566
|
+
on(event: "credential_disabled", handler: ExtensionHandler<CredentialDisabledEvent>): void;
|
|
567
|
+
on(event: "input", handler: ExtensionHandler<InputEvent, InputEventResult>): void;
|
|
568
|
+
on(event: "tool_call", handler: ExtensionHandler<ToolCallEvent, ToolCallEventResult>): void;
|
|
569
|
+
on(event: "tool_result", handler: ExtensionHandler<ToolResultEvent, ToolResultEventResult>): void;
|
|
570
|
+
on(event: "user_bash", handler: ExtensionHandler<UserBashEvent, UserBashEventResult>): void;
|
|
571
|
+
on(event: "user_python", handler: ExtensionHandler<UserPythonEvent, UserPythonEventResult>): void;
|
|
572
|
+
/** Register a tool that the LLM can call. */
|
|
573
|
+
registerTool<TParams extends TSchema = TSchema, TDetails = unknown>(tool: ToolDefinition<TParams, TDetails>): void;
|
|
574
|
+
/** Register a custom command. */
|
|
575
|
+
registerCommand(name: string, options: {
|
|
576
|
+
description?: string;
|
|
577
|
+
getArgumentCompletions?: RegisteredCommand["getArgumentCompletions"];
|
|
578
|
+
handler: RegisteredCommand["handler"];
|
|
579
|
+
}): void;
|
|
580
|
+
/** Register a keyboard shortcut. */
|
|
581
|
+
registerShortcut(shortcut: KeyId, options: {
|
|
582
|
+
description?: string;
|
|
583
|
+
handler: (ctx: ExtensionContext) => Promise<void> | void;
|
|
584
|
+
}): void;
|
|
585
|
+
/** Register a CLI flag. */
|
|
586
|
+
registerFlag(name: string, options: {
|
|
587
|
+
description?: string;
|
|
588
|
+
type: "boolean" | "string";
|
|
589
|
+
default?: boolean | string;
|
|
590
|
+
}): void;
|
|
591
|
+
/** Set the display label for this extension, or set a label on a specific entry. */
|
|
592
|
+
setLabel(entryIdOrLabel: string, label?: string | undefined): void;
|
|
593
|
+
/** Get the value of a registered CLI flag. */
|
|
594
|
+
getFlag(name: string): boolean | string | undefined;
|
|
595
|
+
/** Register a custom renderer for CustomMessageEntry. */
|
|
596
|
+
registerMessageRenderer<T = unknown>(customType: string, renderer: MessageRenderer<T>): void;
|
|
597
|
+
/**
|
|
598
|
+
* Send a custom message to the session.
|
|
599
|
+
*
|
|
600
|
+
* `deliverAs: "nextTurn"` keeps the message hidden from the editable pending-message UI.
|
|
601
|
+
* If `triggerTurn` is also true while the current turn is still unwinding, the session schedules
|
|
602
|
+
* an internal continuation that consumes the message on the next turn.
|
|
603
|
+
*/
|
|
604
|
+
sendMessage<T = unknown>(message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details" | "attribution">, options?: {
|
|
605
|
+
triggerTurn?: boolean;
|
|
606
|
+
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
607
|
+
}): void;
|
|
608
|
+
/** Send a user message to the agent. Always triggers a turn. */
|
|
609
|
+
sendUserMessage(content: string | (TextContent | ImageContent)[], options?: {
|
|
610
|
+
deliverAs?: "steer" | "followUp";
|
|
611
|
+
}): void;
|
|
612
|
+
/** Append a custom entry to the session for state persistence (not sent to LLM). */
|
|
613
|
+
appendEntry<T = unknown>(customType: string, data?: T): void;
|
|
614
|
+
/** Execute a shell command. */
|
|
615
|
+
exec(command: string, args: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
616
|
+
/** Get the list of currently active tool names. */
|
|
617
|
+
getActiveTools(): string[];
|
|
618
|
+
/** Get all configured tools (built-in + extension tools). */
|
|
619
|
+
getAllTools(): string[];
|
|
620
|
+
/** Set the active tools by name. */
|
|
621
|
+
setActiveTools(toolNames: string[]): Promise<void>;
|
|
622
|
+
/** Get available slash commands in the current session. */
|
|
623
|
+
getCommands(): SlashCommandInfo[];
|
|
624
|
+
/** Set the current model. Returns false if no API key available. */
|
|
625
|
+
setModel(model: Model): Promise<boolean>;
|
|
626
|
+
/** Get current thinking level. */
|
|
627
|
+
getThinkingLevel(): ThinkingLevel | undefined;
|
|
628
|
+
/** Set thinking level for the current session. */
|
|
629
|
+
setThinkingLevel(level: ThinkingLevel): void;
|
|
630
|
+
/** Get the current session name. */
|
|
631
|
+
getSessionName(): string | undefined;
|
|
632
|
+
/** Set the session name. Persists to the session file. */
|
|
633
|
+
setSessionName(name: string): Promise<void>;
|
|
634
|
+
/**
|
|
635
|
+
* Register or override a model provider.
|
|
636
|
+
*
|
|
637
|
+
* If `models` is provided: replaces all existing models for this provider.
|
|
638
|
+
* If only `baseUrl` is provided: overrides the URL for existing models.
|
|
639
|
+
* If `streamSimple` is provided: registers a custom API stream handler.
|
|
640
|
+
*
|
|
641
|
+
* @example
|
|
642
|
+
* // Register a new provider with custom models and streaming
|
|
643
|
+
* pi.registerProvider("google-vertex-claude", {
|
|
644
|
+
* baseUrl: "https://us-east5-aiplatform.googleapis.com",
|
|
645
|
+
* apiKey: "GOOGLE_CLOUD_PROJECT",
|
|
646
|
+
* api: "vertex-claude-api",
|
|
647
|
+
* streamSimple: myStreamFunction,
|
|
648
|
+
* models: [
|
|
649
|
+
* {
|
|
650
|
+
* id: "claude-sonnet-4@20250514",
|
|
651
|
+
* name: "Claude Sonnet 4 (Vertex)",
|
|
652
|
+
* reasoning: true,
|
|
653
|
+
* thinking: { mode: "anthropic-adaptive", minLevel: "minimal", maxLevel: "high" },
|
|
654
|
+
* input: ["text", "image"],
|
|
655
|
+
* cost: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
|
|
656
|
+
* contextWindow: 200000,
|
|
657
|
+
* maxTokens: 64000,
|
|
658
|
+
* ]
|
|
659
|
+
* });
|
|
660
|
+
*
|
|
661
|
+
* @example
|
|
662
|
+
* // Override baseUrl for an existing provider
|
|
663
|
+
* pi.registerProvider("anthropic", {
|
|
664
|
+
* baseUrl: "https://proxy.example.com"
|
|
665
|
+
* });
|
|
666
|
+
*/
|
|
667
|
+
registerProvider(name: string, config: ProviderConfig): void;
|
|
668
|
+
/** Shared event bus for extension communication. */
|
|
669
|
+
events: EventBus;
|
|
670
|
+
}
|
|
671
|
+
/** Configuration for registering a provider via pi.registerProvider(). */
|
|
672
|
+
export interface ProviderConfig {
|
|
673
|
+
/** Base URL for the API endpoint. Required when defining models. */
|
|
674
|
+
baseUrl?: string;
|
|
675
|
+
/** API key or environment variable name. Required when defining models unless oauth is provided. */
|
|
676
|
+
apiKey?: string;
|
|
677
|
+
/** API type identifier. Required when registering streamSimple or when models don't specify one. */
|
|
678
|
+
api?: Api;
|
|
679
|
+
/** Custom streaming function for non-built-in APIs. */
|
|
680
|
+
streamSimple?: (model: Model<Api>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStream;
|
|
681
|
+
/** Custom headers to include in requests. */
|
|
682
|
+
headers?: Record<string, string>;
|
|
683
|
+
/** If true, adds Authorization: Bearer header with the resolved API key. */
|
|
684
|
+
authHeader?: boolean;
|
|
685
|
+
/** Models to register. If provided, replaces all existing models for this provider. */
|
|
686
|
+
models?: ProviderModelConfig[];
|
|
687
|
+
/** OAuth provider for /login support. */
|
|
688
|
+
oauth?: {
|
|
689
|
+
/** Display name in login UI. */
|
|
690
|
+
name: string;
|
|
691
|
+
/** Run the provider login flow and return credentials (or a plain API key) to persist. */
|
|
692
|
+
login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials | string>;
|
|
693
|
+
/** Refresh expired credentials. */
|
|
694
|
+
refreshToken?(credentials: OAuthCredentials): Promise<OAuthCredentials>;
|
|
695
|
+
/** Convert credentials to an API key string for requests. */
|
|
696
|
+
getApiKey?(credentials: OAuthCredentials): string;
|
|
697
|
+
/** Optional model rewrite hook for credential-aware routing (e.g., enterprise URLs). */
|
|
698
|
+
modifyModels?(models: Model<Api>[], credentials: OAuthCredentials): Model<Api>[];
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
/** Configuration for a model within a provider. */
|
|
702
|
+
export interface ProviderModelConfig {
|
|
703
|
+
/** Model ID (e.g., "claude-sonnet-4@20250514"). */
|
|
704
|
+
id: string;
|
|
705
|
+
/** Display name (e.g., "Claude Sonnet 4 (Vertex)"). */
|
|
706
|
+
name: string;
|
|
707
|
+
/** API type override for this model. */
|
|
708
|
+
api?: Api;
|
|
709
|
+
/** Whether the model supports extended thinking at all. */
|
|
710
|
+
reasoning: boolean;
|
|
711
|
+
/** Optional canonical thinking capability metadata for per-model effort support. */
|
|
712
|
+
thinking?: Model["thinking"];
|
|
713
|
+
/** Supported input types. */
|
|
714
|
+
input: ("text" | "image")[];
|
|
715
|
+
/** Cost per million tokens. */
|
|
716
|
+
cost: {
|
|
717
|
+
input: number;
|
|
718
|
+
output: number;
|
|
719
|
+
cacheRead: number;
|
|
720
|
+
cacheWrite: number;
|
|
721
|
+
};
|
|
722
|
+
/** Premium Copilot requests charged per user-initiated request. */
|
|
723
|
+
premiumMultiplier?: number;
|
|
724
|
+
/** Maximum context window size in tokens. */
|
|
725
|
+
contextWindow: number;
|
|
726
|
+
/** Maximum output tokens. */
|
|
727
|
+
maxTokens: number;
|
|
728
|
+
/** Custom headers for this model. */
|
|
729
|
+
headers?: Record<string, string>;
|
|
730
|
+
/** OpenAI compatibility settings. */
|
|
731
|
+
compat?: Model<Api>["compat"];
|
|
732
|
+
}
|
|
733
|
+
/** Extension factory function type. Supports both sync and async initialization. */
|
|
734
|
+
export type ExtensionFactory = (pi: ExtensionAPI) => void | Promise<void>;
|
|
735
|
+
export interface RegisteredTool<TParams extends TSchema = TSchema, TDetails = unknown> {
|
|
736
|
+
definition: ToolDefinition<TParams, TDetails>;
|
|
737
|
+
extensionPath: string;
|
|
738
|
+
}
|
|
739
|
+
export interface ExtensionFlag {
|
|
740
|
+
name: string;
|
|
741
|
+
description?: string;
|
|
742
|
+
type: "boolean" | "string";
|
|
743
|
+
default?: boolean | string;
|
|
744
|
+
extensionPath: string;
|
|
745
|
+
}
|
|
746
|
+
export interface ExtensionShortcut {
|
|
747
|
+
shortcut: KeyId;
|
|
748
|
+
description?: string;
|
|
749
|
+
handler: (ctx: ExtensionContext) => Promise<void> | void;
|
|
750
|
+
extensionPath: string;
|
|
751
|
+
}
|
|
752
|
+
type HandlerFn = (...args: unknown[]) => Promise<unknown>;
|
|
753
|
+
export type SendMessageHandler = <T = unknown>(message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details" | "attribution">,
|
|
754
|
+
/**
|
|
755
|
+
* `deliverAs: "nextTurn"` queues hidden custom context for the next turn.
|
|
756
|
+
* When paired with `triggerTurn: true` during prompt teardown, the session schedules
|
|
757
|
+
* an internal continuation without surfacing the message in the editable pending queue.
|
|
758
|
+
*/
|
|
759
|
+
options?: {
|
|
760
|
+
triggerTurn?: boolean;
|
|
761
|
+
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
762
|
+
}) => void;
|
|
763
|
+
export type SendUserMessageHandler = (content: string | (TextContent | ImageContent)[], options?: {
|
|
764
|
+
deliverAs?: "steer" | "followUp";
|
|
765
|
+
}) => void;
|
|
766
|
+
export type AppendEntryHandler = <T = unknown>(customType: string, data?: T) => void;
|
|
767
|
+
export type GetActiveToolsHandler = () => string[];
|
|
768
|
+
export type GetAllToolsHandler = () => string[];
|
|
769
|
+
export type GetCommandsHandler = () => SlashCommandInfo[];
|
|
770
|
+
export type SetActiveToolsHandler = (toolNames: string[]) => Promise<void>;
|
|
771
|
+
export type SetModelHandler = (model: Model) => Promise<boolean>;
|
|
772
|
+
export type GetThinkingLevelHandler = () => ThinkingLevel | undefined;
|
|
773
|
+
export type SetThinkingLevelHandler = (level: ThinkingLevel, persist?: boolean) => void;
|
|
774
|
+
/** Shared state created by loader, used during registration and runtime. */
|
|
775
|
+
export interface ExtensionRuntimeState {
|
|
776
|
+
flagValues: Map<string, boolean | string>;
|
|
777
|
+
/** Provider registrations queued during extension loading, processed during session initialization */
|
|
778
|
+
pendingProviderRegistrations: Array<{
|
|
779
|
+
name: string;
|
|
780
|
+
config: ProviderConfig;
|
|
781
|
+
sourceId: string;
|
|
782
|
+
}>;
|
|
783
|
+
}
|
|
784
|
+
/** Action implementations for ExtensionAPI methods. */
|
|
785
|
+
export interface ExtensionActions {
|
|
786
|
+
sendMessage: SendMessageHandler;
|
|
787
|
+
sendUserMessage: SendUserMessageHandler;
|
|
788
|
+
appendEntry: AppendEntryHandler;
|
|
789
|
+
setLabel: (targetId: string, label: string | undefined) => void;
|
|
790
|
+
getActiveTools: GetActiveToolsHandler;
|
|
791
|
+
getAllTools: GetAllToolsHandler;
|
|
792
|
+
setActiveTools: SetActiveToolsHandler;
|
|
793
|
+
getCommands: GetCommandsHandler;
|
|
794
|
+
setModel: SetModelHandler;
|
|
795
|
+
getThinkingLevel: GetThinkingLevelHandler;
|
|
796
|
+
setThinkingLevel: SetThinkingLevelHandler;
|
|
797
|
+
getSessionName: () => string | undefined;
|
|
798
|
+
setSessionName: (name: string) => Promise<void>;
|
|
799
|
+
}
|
|
800
|
+
/** Actions for ExtensionContext (ctx.* in event handlers). */
|
|
801
|
+
export interface ExtensionContextActions {
|
|
802
|
+
getModel: () => Model | undefined;
|
|
803
|
+
isIdle: () => boolean;
|
|
804
|
+
abort: () => void;
|
|
805
|
+
hasPendingMessages: () => boolean;
|
|
806
|
+
shutdown: () => void;
|
|
807
|
+
getContextUsage: () => ContextUsage | undefined;
|
|
808
|
+
compact: (instructionsOrOptions?: string | CompactOptions) => Promise<void>;
|
|
809
|
+
getSystemPrompt: () => string[];
|
|
810
|
+
}
|
|
811
|
+
/** Actions for ExtensionCommandContext (ctx.* in command handlers). */
|
|
812
|
+
export interface ExtensionCommandContextActions {
|
|
813
|
+
getContextUsage: () => ContextUsage | undefined;
|
|
814
|
+
waitForIdle: () => Promise<void>;
|
|
815
|
+
newSession: (options?: {
|
|
816
|
+
parentSession?: string;
|
|
817
|
+
setup?: (sessionManager: SessionManager) => Promise<void>;
|
|
818
|
+
}) => Promise<{
|
|
819
|
+
cancelled: boolean;
|
|
820
|
+
}>;
|
|
821
|
+
branch: (entryId: string) => Promise<{
|
|
822
|
+
cancelled: boolean;
|
|
823
|
+
}>;
|
|
824
|
+
navigateTree: (targetId: string, options?: {
|
|
825
|
+
summarize?: boolean;
|
|
826
|
+
}) => Promise<{
|
|
827
|
+
cancelled: boolean;
|
|
828
|
+
}>;
|
|
829
|
+
compact: (instructionsOrOptions?: string | CompactOptions) => Promise<void>;
|
|
830
|
+
switchSession: (sessionPath: string) => Promise<{
|
|
831
|
+
cancelled: boolean;
|
|
832
|
+
}>;
|
|
833
|
+
reload: () => Promise<void>;
|
|
834
|
+
}
|
|
835
|
+
/** Full runtime = state + actions. */
|
|
836
|
+
export interface ExtensionRuntime extends ExtensionRuntimeState, ExtensionActions {
|
|
837
|
+
}
|
|
838
|
+
/** Loaded extension with all registered items. */
|
|
839
|
+
export interface Extension {
|
|
840
|
+
path: string;
|
|
841
|
+
resolvedPath: string;
|
|
842
|
+
label?: string;
|
|
843
|
+
handlers: Map<string, HandlerFn[]>;
|
|
844
|
+
tools: Map<string, RegisteredTool<any, any>>;
|
|
845
|
+
messageRenderers: Map<string, MessageRenderer>;
|
|
846
|
+
commands: Map<string, RegisteredCommand>;
|
|
847
|
+
flags: Map<string, ExtensionFlag>;
|
|
848
|
+
shortcuts: Map<KeyId, ExtensionShortcut>;
|
|
849
|
+
}
|
|
850
|
+
/** Result of loading extensions. */
|
|
851
|
+
export interface LoadExtensionsResult {
|
|
852
|
+
extensions: Extension[];
|
|
853
|
+
errors: Array<{
|
|
854
|
+
path: string;
|
|
855
|
+
error: string;
|
|
856
|
+
}>;
|
|
857
|
+
runtime: ExtensionRuntime;
|
|
858
|
+
}
|
|
859
|
+
export interface ExtensionError {
|
|
860
|
+
extensionPath: string;
|
|
861
|
+
event: string;
|
|
862
|
+
error: string;
|
|
863
|
+
stack?: string;
|
|
864
|
+
}
|