dal-code 1.0.23 → 1.0.25
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 +26 -0
- package/dal-docs/README.md +96 -0
- package/dal-docs/extensions.md +98 -0
- package/dal-docs/keybindings.md +40 -0
- package/dal-docs/packages.md +62 -0
- package/dal-docs/prompt-templates.md +42 -0
- package/dal-docs/settings.md +86 -0
- package/dal-docs/skills.md +65 -0
- package/dal-docs/themes.md +44 -0
- package/dist/cli/args.d.ts +56 -0
- package/dist/config.d.ts +63 -0
- package/dist/config.js +1 -1
- package/dist/core/agent-session-runtime.d.ts +74 -0
- package/dist/core/agent-session-services.d.ts +48 -0
- package/dist/core/agent-session.d.ts +409 -0
- package/dist/core/agent-session.js +6 -6
- package/dist/core/auth-storage.d.ts +56 -0
- package/dist/core/bash-executor.d.ts +13 -0
- package/dist/core/cache-warmer.d.ts +60 -0
- package/dist/core/compaction/branch-summarization.d.ts +43 -0
- package/dist/core/compaction/compaction.d.ts +62 -0
- package/dist/core/compaction/index.d.ts +3 -0
- package/dist/core/compaction/utils.d.ts +16 -0
- package/dist/core/diagnostics.d.ts +14 -0
- package/dist/core/event-bus.d.ts +8 -0
- package/dist/core/exec.d.ts +12 -0
- package/dist/core/extensions/index.d.ts +8 -0
- package/dist/core/extensions/loader.d.ts +13 -0
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/permission-surface.js +1 -1
- package/dist/core/extensions/runner.d.ts +165 -0
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/types.d.ts +1000 -0
- package/dist/core/extensions/wrapper.d.ts +5 -0
- package/dist/core/footer-data-provider.d.ts +46 -0
- package/dist/core/keybindings.d.ts +525 -0
- package/dist/core/keybindings.js +1 -1
- package/dist/core/messages.d.ts +50 -0
- package/dist/core/model-config.d.ts +1212 -0
- package/dist/core/model-registry.d.ts +41 -0
- package/dist/core/model-resolver.d.ts +67 -0
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-runtime.d.ts +101 -0
- package/dist/core/model-runtime.js +2 -2
- package/dist/core/package-manager.d.ts +213 -0
- package/dist/core/package-manager.js +2 -2
- package/dist/core/project-map.d.ts +18 -0
- package/dist/core/prompt-templates.d.ts +24 -0
- package/dist/core/provider-composer.d.ts +55 -0
- package/dist/core/remote-catalog-provider.js +1 -1
- package/dist/core/resolve-config-value.d.ts +11 -0
- package/dist/core/resource-loader.d.ts +220 -0
- package/dist/core/resource-loader.js +1 -1
- package/dist/core/sdk.d.ts +40 -0
- package/dist/core/session-manager.d.ts +208 -0
- package/dist/core/settings-manager.d.ts +348 -0
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/skills.d.ts +33 -0
- package/dist/core/slash-commands.d.ts +14 -0
- package/dist/core/source-info.d.ts +17 -0
- package/dist/core/system-prompt.d.ts +39 -0
- package/dist/core/system-prompt.js +15 -11
- package/dist/core/tools/bash.d.ts +75 -0
- package/dist/core/tools/bash.js +14 -14
- package/dist/core/tools/edit-diff.d.ts +44 -0
- package/dist/core/tools/edit.d.ts +48 -0
- package/dist/core/tools/file-mutation-queue.d.ts +1 -0
- package/dist/core/tools/find.d.ts +34 -0
- package/dist/core/tools/grep.d.ts +34 -0
- package/dist/core/tools/index.d.ts +42 -0
- package/dist/core/tools/index.js +1 -1
- package/dist/core/tools/ls.d.ts +33 -0
- package/dist/core/tools/powershell.d.ts +17 -0
- package/dist/core/tools/read.d.ts +33 -0
- package/dist/core/tools/read.js +2 -2
- package/dist/core/tools/renderers/bash.d.ts +3 -0
- package/dist/core/tools/renderers/edit.d.ts +15 -0
- package/dist/core/tools/renderers/find.d.ts +2 -0
- package/dist/core/tools/renderers/grep.d.ts +2 -0
- package/dist/core/tools/renderers/index.d.ts +13 -0
- package/dist/core/tools/renderers/ls.d.ts +2 -0
- package/dist/core/tools/renderers/read.d.ts +3 -0
- package/dist/core/tools/renderers/read.js +8 -8
- package/dist/core/tools/renderers/write.d.ts +2 -0
- package/dist/core/tools/truncate.d.ts +27 -0
- package/dist/core/tools/write.d.ts +24 -0
- package/dist/core/trust-manager.d.ts +28 -0
- package/dist/core/trust-manager.js +2 -2
- package/dist/dal/child-env.d.ts +12 -0
- package/dist/dal/child-env.js +1 -0
- package/dist/dal/hooks/activity.d.ts +17 -0
- package/dist/dal/hooks/activity.js +1 -0
- package/dist/dal/hooks/config.d.ts +47 -0
- package/dist/dal/hooks/config.js +1 -0
- package/dist/dal/hooks/events.d.ts +43 -0
- package/dist/dal/hooks/events.js +4 -0
- package/dist/dal/hooks/extension.d.ts +3 -0
- package/dist/dal/hooks/extension.js +4 -0
- package/dist/dal/hooks/index.d.ts +5 -0
- package/dist/dal/hooks/index.js +1 -0
- package/dist/dal/hooks/runner.d.ts +57 -0
- package/dist/dal/hooks/runner.js +1 -0
- package/dist/dal/safety-net.js +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +1 -1
- package/dist/main.d.ts +9 -0
- package/dist/main.js +2 -2
- package/dist/modes/acp/acp-mode.d.ts +2 -0
- package/dist/modes/index.d.ts +7 -0
- package/dist/modes/interactive/components/armin.d.ts +30 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +26 -0
- package/dist/modes/interactive/components/assistant-message.js +2 -2
- package/dist/modes/interactive/components/bash-execution.d.ts +22 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +14 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +11 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +11 -0
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/modes/interactive/components/custom-message.d.ts +17 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +17 -0
- package/dist/modes/interactive/components/diff.d.ts +4 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +12 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +19 -0
- package/dist/modes/interactive/components/extension-input.d.ts +21 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +22 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +23 -0
- package/dist/modes/interactive/components/footer.d.ts +18 -0
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/index.d.ts +33 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +9 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +27 -0
- package/dist/modes/interactive/components/model-selector.d.ts +81 -0
- package/dist/modes/interactive/components/model-selector.js +2 -2
- package/dist/modes/interactive/components/oauth-selector.d.ts +29 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +39 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +20 -0
- package/dist/modes/interactive/components/session-selector.d.ts +88 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +92 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +6 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +11 -0
- package/dist/modes/interactive/components/status-indicator.d.ts +44 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +7 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +19 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +76 -0
- package/dist/modes/interactive/components/tool-execution.js +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +65 -0
- package/dist/modes/interactive/components/trust-selector.d.ts +22 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +23 -0
- package/dist/modes/interactive/components/user-message.d.ts +14 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +5 -0
- package/dist/modes/interactive/interactive-mode.d.ts +326 -0
- package/dist/modes/interactive/interactive-mode.js +48 -48
- package/dist/modes/interactive/theme/theme-json.d.ts +257 -0
- package/dist/modes/interactive/theme/theme.d.ts +106 -0
- package/dist/modes/interactive/tui-renderer.d.ts +18 -0
- package/dist/modes/json-event.d.ts +26 -0
- package/dist/modes/print-mode.d.ts +9 -0
- package/dist/modes/rpc/rpc-client.d.ts +119 -0
- package/dist/modes/rpc/rpc-client.js +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +3 -0
- package/dist/modes/rpc/rpc-types.d.ts +483 -0
- package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/src/ask-user.js +12 -0
- package/dist/node_modules/@dalcode/dal-bridge/src/client.js +1 -1
- package/dist/node_modules/@dalcode/dal-bridge/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-gateway/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-guard/package.json +5 -4
- package/dist/node_modules/@dalcode/dal-guard/src/hooks.js +1 -0
- package/dist/node_modules/@dalcode/dal-guard/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-lsp/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-lsp/src/client.js +3 -3
- package/dist/node_modules/@dalcode/dal-mcp/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-mcp/src/command-parser.d.ts +19 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/config-edit.d.ts +19 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/config.d.ts +9 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/http-client.d.ts +16 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.d.ts +22 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.js +2 -2
- package/dist/node_modules/@dalcode/dal-mcp/src/types.d.ts +30 -0
- package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-office/src/extract/csv.d.ts +3 -0
- package/dist/node_modules/@dalcode/dal-office/src/extract/csv.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/extract/ooxml.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/index.d.ts +11 -0
- package/dist/node_modules/@dalcode/dal-office/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/paths.d.ts +3 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/chart.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/render/docx.d.ts +19 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/pptx.d.ts +40 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/pptx.js +2 -2
- package/dist/node_modules/@dalcode/dal-office/src/render/thumbnails.d.ts +19 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/thumbnails.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx.d.ts +14 -0
- package/dist/node_modules/@dalcode/dal-office/src/scratchpad.d.ts +16 -0
- package/dist/node_modules/@dalcode/dal-office/src/themes.d.ts +13 -0
- package/dist/node_modules/@dalcode/dal-office/src/tools/docx-edit.js +10 -0
- package/dist/node_modules/@dalcode/dal-office/src/tools/edit-shared.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/tools/pptx-edit.js +9 -0
- package/dist/node_modules/@dalcode/dal-office/src/tools/read-file.js +4 -2
- package/dist/node_modules/@dalcode/dal-office/src/tools/xlsx-edit.js +5 -0
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +2 -2
- package/dist/node_modules/@dalcode/dal-plugins/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-rewind/src/core.d.ts +61 -0
- package/dist/node_modules/@dalcode/dal-router/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-router/src/commands.js +6 -6
- package/dist/node_modules/@dalcode/dal-router/src/config.d.ts +50 -0
- package/dist/node_modules/@dalcode/dal-router/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-router/src/jev.d.ts +51 -0
- package/dist/node_modules/@dalcode/dal-router/src/pool.d.ts +6 -0
- package/dist/node_modules/@dalcode/dal-router/src/router.d.ts +32 -0
- package/dist/node_modules/@dalcode/dal-router/src/runtime.d.ts +37 -0
- package/dist/node_modules/@dalcode/dal-router/src/runtime.js +1 -1
- package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-skills/src/discover.js +4 -4
- package/dist/node_modules/@dalcode/dal-skills/src/index.js +9 -9
- package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-subagent/src/index.js +14 -8
- package/dist/node_modules/@dalcode/dal-subagent/src/process-runner.js +3 -3
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-tool-catalog/src/groups.js +1 -1
- package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-workflow/src/plan-mode.js +1 -1
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- package/dist/node_modules/@dalcode/deepailab/src/index.js +3 -3
- package/dist/node_modules/@dalcode/deepailab/src/model-defaults.js +1 -1
- package/dist/node_modules/@earendil-works/chord/dist/api.d.ts +21 -0
- package/dist/node_modules/@earendil-works/chord/dist/context/index.d.ts +12 -0
- package/dist/node_modules/@earendil-works/chord/dist/delta/index.d.ts +127 -0
- package/dist/node_modules/@earendil-works/chord/dist/index.d.ts +8 -0
- package/dist/node_modules/@earendil-works/chord/dist/json.d.ts +2 -0
- package/dist/node_modules/@earendil-works/chord/dist/services/errors.d.ts +16 -0
- package/dist/node_modules/@earendil-works/chord/dist/services/provider.d.ts +32 -0
- package/dist/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +12 -0
- package/dist/node_modules/@earendil-works/chord/dist/services/wire.d.ts +59 -0
- package/dist/node_modules/@earendil-works/chord/dist/state/draft.d.ts +13 -0
- package/dist/node_modules/@earendil-works/chord/dist/types.d.ts +188 -0
- package/dist/node_modules/@earendil-works/chord/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +7 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +80 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +711 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts +44 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +80 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts +15 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts +6 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts +22 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts +17 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts +34 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +50 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts +28 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts +132 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts +56 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts +94 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts +99 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts +52 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts +19 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +13 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts +10 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts +33 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts +37 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts +36 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts +46 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts +6 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +75 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts +473 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts +94 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +26 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts +1495 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts +26 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.d.ts +18 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/index.d.ts +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts +32 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/tool-context.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.d.ts +10 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +185 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts +22 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +22 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts +28 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +27 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +61 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts +28 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/stream-fn.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +150 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +18 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +13 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts +18 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts +12 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts +24 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts +14 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts +8 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts +15 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +30 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +24 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts +10 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts +85 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.lazy.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/context.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.d.ts +10 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/helpers.d.ts +8 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +20 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +127 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/cli.js +0 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts +34 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +47 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts +9 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/image-models.d.ts +9 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +829 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts +13 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/images-models.d.ts +37 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/images.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/index.d.ts +38 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/legacy-api-aliases.d.ts +25 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/model-catalog.d.ts +16 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts +21 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.d.ts +97 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +84 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts +18 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/baseten.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts +100 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/google.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/meta.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-cn.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan-individual.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/qwen-token-plan.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts +7 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/radius.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/session-resources.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/types.d.ts +502 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts +63 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.d.ts +19 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +19 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +16 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/text.d.ts +6 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/transcript.d.ts +29 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.d.ts +5 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/validation.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-client/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-coding-agent/LICENSE +21 -0
- package/dist/node_modules/@earendil-works/pi-coding-agent/index.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-coding-agent/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +15 -0
- package/dist/node_modules/@earendil-works/pi-protocol/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-server/package.json +5 -5
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/index.d.ts +200 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/memory.d.ts +20 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/noop.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +55 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +20 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +9 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +151 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts +6 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +25 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +43 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +28 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +61 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts +10 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +61 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +52 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +50 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +8 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts +35 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +15 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +9 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts +7 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +17 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +6 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/index.d.ts +32 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +329 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +101 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/latex.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts +41 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts +13 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +30 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal-colors.d.ts +9 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +82 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +76 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +138 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts +32 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +252 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +38 -0
- package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/dist/package-manager-cli.js +32 -32
- package/dist/sdk/index.d.ts +14 -0
- package/dist/sdk/index.js +1 -0
- package/dist/sdk/mcp.d.ts +8 -0
- package/dist/sdk/mcp.js +1 -0
- package/dist/sdk/office.d.ts +1 -0
- package/dist/sdk/office.js +1 -0
- package/dist/sdk/rewind.d.ts +1 -0
- package/dist/sdk/rewind.js +1 -0
- package/dist/sdk/router.d.ts +6 -0
- package/dist/sdk/router.js +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/frontmatter.d.ts +7 -0
- package/dist/utils/image-convert.d.ts +5 -0
- package/dist/utils/image-resize-core.d.ts +16 -0
- package/dist/utils/image-resize.d.ts +4 -0
- package/dist/utils/mime.d.ts +2 -0
- package/dist/utils/shell.d.ts +20 -0
- package/dist/utils/shell.js +3 -3
- package/dist/utils/version-check.d.ts +20 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +22 -1
- package/dist/bun/register-bedrock.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -5
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +0 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +0 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +0 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/dist/session-handle.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/dist/state.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/cli.js +0 -16
- package/dist/node_modules/@earendil-works/pi-server/dist/config.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/handler.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/ipc/client.js +0 -2
- package/dist/node_modules/@earendil-works/pi-server/dist/ipc/protocol.js +0 -2
- package/dist/node_modules/@earendil-works/pi-server/dist/ipc/server.js +0 -3
- package/dist/node_modules/@earendil-works/pi-server/dist/protocol.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/radius.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/rpc-process.js +0 -4
- package/dist/node_modules/@earendil-works/pi-server/dist/serve.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/sessions.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/snapshots.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/storage.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/supervisor.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/testing/service.js +0 -1
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/branch-cache.js +0 -7
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/search-backend.js +0 -36
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/branch-entries.js +0 -25
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/branch-tips.js +0 -2
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/entries.js +0 -7
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/facts.js +0 -20
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/lanes.js +0 -26
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/records.js +0 -9
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/session-sequences.js +0 -1
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/session-stats.js +0 -10
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/sessions.js +0 -29
- package/dist/node_modules/@earendil-works/pi-session-backend-sqlite-node/dist/sqlite/storage/writer-leases.js +0 -14
- package/dist/server/create-harness.js +0 -1
- package/dist/utils/clipboard-native.js +0 -1
|
@@ -0,0 +1,1000 @@
|
|
|
1
|
+
import type { AgentMessage, AgentToolResult, AgentToolUpdateCallback, ThinkingLevel, ToolExecutionMode } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import type { Api, AssistantMessageEvent, AssistantMessageEventStream, ConstrainedSamplingConfig, ImageContent, Message, Model, OAuthCredentials, OAuthLoginCallbacks, Provider, ProviderHeaders, RefreshModelsContext, SimpleStreamOptions, TextContent, ToolResultMessage, TranscriptContext, Usage } from "@earendil-works/pi-ai";
|
|
3
|
+
import type { AutocompleteItem, AutocompleteProvider, Component, EditorComponent, EditorTheme, KeyId, OverlayHandle, OverlayOptions, TUI } from "@earendil-works/pi-tui";
|
|
4
|
+
import type { Static, TSchema } from "typebox";
|
|
5
|
+
import type { Theme } from "../../modes/interactive/theme/theme.ts";
|
|
6
|
+
import type { BashResult } from "../bash-executor.ts";
|
|
7
|
+
import type { CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult } from "../cache-warmer.ts";
|
|
8
|
+
import type { CompactionPreparation, CompactionResult } from "../compaction/index.ts";
|
|
9
|
+
import type { EventBus } from "../event-bus.ts";
|
|
10
|
+
import type { ExecOptions, ExecResult } from "../exec.ts";
|
|
11
|
+
import type { ReadonlyFooterDataProvider } from "../footer-data-provider.ts";
|
|
12
|
+
import type { KeybindingsManager } from "../keybindings.ts";
|
|
13
|
+
import type { CustomMessage } from "../messages.ts";
|
|
14
|
+
import type { ModelRegistry } from "../model-registry.ts";
|
|
15
|
+
import type { ScopedModel } from "../model-resolver.ts";
|
|
16
|
+
import type { BranchSummaryEntry, CompactionEntry, ContextEditEntry, CustomEntry, ProjectedSessionEntry, ReadonlySessionManager, SessionEntry, SessionManager } from "../session-manager.ts";
|
|
17
|
+
import type { SlashCommandInfo } from "../slash-commands.ts";
|
|
18
|
+
import type { SourceInfo } from "../source-info.ts";
|
|
19
|
+
import type { BuildSystemPromptOptions, NormalizedBuildSystemPromptOptions } from "../system-prompt.ts";
|
|
20
|
+
import type { BashOperations } from "../tools/bash.ts";
|
|
21
|
+
import type { EditToolDetails } from "../tools/edit.ts";
|
|
22
|
+
import type { BashToolDetails, BashToolInput, EditToolInput, FindToolDetails, FindToolInput, GrepToolDetails, GrepToolInput, LsToolDetails, LsToolInput, PowerShellToolDetails, PowerShellToolInput, ReadToolDetails, ReadToolInput, WriteToolInput } from "../tools/index.ts";
|
|
23
|
+
export type { ExecOptions, ExecResult } from "../exec.ts";
|
|
24
|
+
export type { BuildSystemPromptOptions, NormalizedBuildSystemPromptOptions } from "../system-prompt.ts";
|
|
25
|
+
export type { AgentToolResult, AgentToolUpdateCallback, ToolExecutionMode };
|
|
26
|
+
export type { AppKeybinding, KeybindingsManager } from "../keybindings.ts";
|
|
27
|
+
export interface ExtensionUIDialogOptions {
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
timeout?: number;
|
|
30
|
+
}
|
|
31
|
+
export type WidgetPlacement = "aboveEditor" | "belowEditor";
|
|
32
|
+
export interface ExtensionWidgetOptions {
|
|
33
|
+
placement?: WidgetPlacement;
|
|
34
|
+
}
|
|
35
|
+
export type TerminalInputHandler = (data: string) => {
|
|
36
|
+
consume?: boolean;
|
|
37
|
+
data?: string;
|
|
38
|
+
} | undefined;
|
|
39
|
+
export interface WorkingIndicatorOptions {
|
|
40
|
+
frames?: string[];
|
|
41
|
+
intervalMs?: number;
|
|
42
|
+
}
|
|
43
|
+
export type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;
|
|
44
|
+
export type EditorFactory = (tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent;
|
|
45
|
+
export interface ExtensionUIContext {
|
|
46
|
+
select(title: string, options: string[], opts?: ExtensionUIDialogOptions): Promise<string | undefined>;
|
|
47
|
+
confirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;
|
|
48
|
+
input(title: string, placeholder?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;
|
|
49
|
+
notify(message: string, type?: "info" | "warning" | "error"): void;
|
|
50
|
+
notify(notice: {
|
|
51
|
+
level?: "info" | "warning" | "error";
|
|
52
|
+
message: string;
|
|
53
|
+
}): void;
|
|
54
|
+
setPanel(id: string, panel?: {
|
|
55
|
+
title?: string;
|
|
56
|
+
lines?: string[];
|
|
57
|
+
placement?: "aux" | "status";
|
|
58
|
+
}): void;
|
|
59
|
+
requestInput(options: {
|
|
60
|
+
title: string;
|
|
61
|
+
placeholder?: string;
|
|
62
|
+
} & ExtensionUIDialogOptions): Promise<string | undefined>;
|
|
63
|
+
requestChoice(options: {
|
|
64
|
+
title: string;
|
|
65
|
+
items: Array<{
|
|
66
|
+
id: string;
|
|
67
|
+
label: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
}>;
|
|
70
|
+
} & ExtensionUIDialogOptions): Promise<string | undefined>;
|
|
71
|
+
onTerminalInput(handler: TerminalInputHandler): () => void;
|
|
72
|
+
setStatus(key: string, text: string | undefined): void;
|
|
73
|
+
setWorkingMessage(message?: string): void;
|
|
74
|
+
setWorkingVisible(visible: boolean): void;
|
|
75
|
+
setWorkingIndicator(options?: WorkingIndicatorOptions): void;
|
|
76
|
+
setHiddenThinkingLabel(label?: string): void;
|
|
77
|
+
setWidget(key: string, content: string[] | undefined, options?: ExtensionWidgetOptions): void;
|
|
78
|
+
setWidget(key: string, content: ((tui: TUI, theme: Theme) => Component & {
|
|
79
|
+
dispose?(): void;
|
|
80
|
+
}) | undefined, options?: ExtensionWidgetOptions): void;
|
|
81
|
+
setFooter(factory: ((tui: TUI, theme: Theme, footerData: ReadonlyFooterDataProvider) => Component & {
|
|
82
|
+
dispose?(): void;
|
|
83
|
+
}) | undefined): void;
|
|
84
|
+
setHeader(factory: ((tui: TUI, theme: Theme) => Component & {
|
|
85
|
+
dispose?(): void;
|
|
86
|
+
}) | undefined): void;
|
|
87
|
+
setTitle(title: string): void;
|
|
88
|
+
custom<T>(factory: (tui: TUI, theme: Theme, keybindings: KeybindingsManager, done: (result: T) => void) => (Component & {
|
|
89
|
+
dispose?(): void;
|
|
90
|
+
}) | Promise<Component & {
|
|
91
|
+
dispose?(): void;
|
|
92
|
+
}>, options?: {
|
|
93
|
+
overlay?: boolean;
|
|
94
|
+
overlayOptions?: OverlayOptions | (() => OverlayOptions);
|
|
95
|
+
onHandle?: (handle: OverlayHandle) => void;
|
|
96
|
+
}): Promise<T>;
|
|
97
|
+
pasteToEditor(text: string): void;
|
|
98
|
+
setEditorText(text: string): void;
|
|
99
|
+
getEditorText(): string;
|
|
100
|
+
editor(title: string, prefill?: string): Promise<string | undefined>;
|
|
101
|
+
addAutocompleteProvider(factory: AutocompleteProviderFactory): void;
|
|
102
|
+
setEditorComponent(factory: EditorFactory | undefined): void;
|
|
103
|
+
getEditorComponent(): EditorFactory | undefined;
|
|
104
|
+
readonly theme: Theme;
|
|
105
|
+
getAllThemes(): {
|
|
106
|
+
name: string;
|
|
107
|
+
path: string | undefined;
|
|
108
|
+
}[];
|
|
109
|
+
getTheme(name: string): Theme | undefined;
|
|
110
|
+
setTheme(theme: string | Theme): {
|
|
111
|
+
success: boolean;
|
|
112
|
+
error?: string;
|
|
113
|
+
};
|
|
114
|
+
getToolsExpanded(): boolean;
|
|
115
|
+
setToolsExpanded(expanded: boolean): void;
|
|
116
|
+
}
|
|
117
|
+
export declare function resolveExtensionNotify(message: string | {
|
|
118
|
+
level?: "info" | "warning" | "error";
|
|
119
|
+
message: string;
|
|
120
|
+
}, type?: "info" | "warning" | "error"): {
|
|
121
|
+
message: string;
|
|
122
|
+
type: "info" | "warning" | "error" | undefined;
|
|
123
|
+
};
|
|
124
|
+
export declare function extensionPanelLines(panel?: {
|
|
125
|
+
title?: string;
|
|
126
|
+
lines?: string[];
|
|
127
|
+
}): string[] | undefined;
|
|
128
|
+
export interface ContextUsage {
|
|
129
|
+
tokens: number | null;
|
|
130
|
+
contextWindow: number;
|
|
131
|
+
percent: number | null;
|
|
132
|
+
}
|
|
133
|
+
export interface CompactOptions {
|
|
134
|
+
customInstructions?: string;
|
|
135
|
+
onComplete?: (result: CompactionResult) => void;
|
|
136
|
+
onError?: (error: Error) => void;
|
|
137
|
+
}
|
|
138
|
+
export type ExtensionMode = "tui" | "rpc" | "json" | "print";
|
|
139
|
+
export interface ExtensionContext {
|
|
140
|
+
ui: ExtensionUIContext;
|
|
141
|
+
mode: ExtensionMode;
|
|
142
|
+
hasUI: boolean;
|
|
143
|
+
cwd: string;
|
|
144
|
+
sessionManager: ReadonlySessionManager;
|
|
145
|
+
modelRegistry: ModelRegistry;
|
|
146
|
+
model: Model<any> | undefined;
|
|
147
|
+
scopedModels: readonly ScopedModel[];
|
|
148
|
+
thinkingLevel?: ThinkingLevel;
|
|
149
|
+
isIdle(): boolean;
|
|
150
|
+
isProjectTrusted(): boolean;
|
|
151
|
+
signal: AbortSignal | undefined;
|
|
152
|
+
abort(): void;
|
|
153
|
+
hasPendingMessages(): boolean;
|
|
154
|
+
shutdown(): void;
|
|
155
|
+
getContextUsage(): ContextUsage | undefined;
|
|
156
|
+
compact(options?: CompactOptions): void;
|
|
157
|
+
getSystemPrompt(): string;
|
|
158
|
+
}
|
|
159
|
+
export interface ExtensionCommandContext extends ExtensionContext {
|
|
160
|
+
getSystemPromptOptions(): BuildSystemPromptOptions;
|
|
161
|
+
waitForIdle(): Promise<void>;
|
|
162
|
+
newSession(options?: {
|
|
163
|
+
parentSession?: string;
|
|
164
|
+
setup?: (sessionManager: SessionManager) => Promise<void>;
|
|
165
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
166
|
+
}): Promise<{
|
|
167
|
+
cancelled: boolean;
|
|
168
|
+
}>;
|
|
169
|
+
fork(entryId: string, options?: {
|
|
170
|
+
position?: "before" | "at";
|
|
171
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
172
|
+
}): Promise<{
|
|
173
|
+
cancelled: boolean;
|
|
174
|
+
}>;
|
|
175
|
+
navigateTree(targetId: string, options?: {
|
|
176
|
+
summarize?: boolean;
|
|
177
|
+
customInstructions?: string;
|
|
178
|
+
replaceInstructions?: boolean;
|
|
179
|
+
label?: string;
|
|
180
|
+
}): Promise<{
|
|
181
|
+
cancelled: boolean;
|
|
182
|
+
}>;
|
|
183
|
+
switchSession(sessionPath: string, options?: {
|
|
184
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
185
|
+
}): Promise<{
|
|
186
|
+
cancelled: boolean;
|
|
187
|
+
}>;
|
|
188
|
+
reload(): Promise<void>;
|
|
189
|
+
}
|
|
190
|
+
export interface ReplacedSessionContext extends ExtensionCommandContext {
|
|
191
|
+
sendMessage<T = unknown>(message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details">, options?: {
|
|
192
|
+
triggerTurn?: boolean;
|
|
193
|
+
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
194
|
+
}): Promise<void>;
|
|
195
|
+
sendUserMessage(content: string | (TextContent | ImageContent)[], options?: {
|
|
196
|
+
deliverAs?: "steer" | "followUp";
|
|
197
|
+
expandPromptTemplates?: boolean;
|
|
198
|
+
}): Promise<void>;
|
|
199
|
+
}
|
|
200
|
+
export interface ToolRenderResultOptions {
|
|
201
|
+
expanded: boolean;
|
|
202
|
+
isPartial: boolean;
|
|
203
|
+
}
|
|
204
|
+
export interface ToolRenderContext<TState = any, TArgs = any> {
|
|
205
|
+
args: TArgs;
|
|
206
|
+
toolCallId: string;
|
|
207
|
+
invalidate: () => void;
|
|
208
|
+
lastComponent: Component | undefined;
|
|
209
|
+
state: TState;
|
|
210
|
+
cwd: string;
|
|
211
|
+
executionStarted: boolean;
|
|
212
|
+
argsComplete: boolean;
|
|
213
|
+
isPartial: boolean;
|
|
214
|
+
expanded: boolean;
|
|
215
|
+
showImages: boolean;
|
|
216
|
+
isError: boolean;
|
|
217
|
+
}
|
|
218
|
+
export interface ToolDefinition<TParams extends TSchema = TSchema, TDetails = unknown, TState = any> {
|
|
219
|
+
name: string;
|
|
220
|
+
label: string;
|
|
221
|
+
description: string;
|
|
222
|
+
promptSnippet?: string;
|
|
223
|
+
promptGuidelines?: string[];
|
|
224
|
+
parameters: TParams;
|
|
225
|
+
constrainedSampling?: false | ConstrainedSamplingConfig;
|
|
226
|
+
renderShell?: "default" | "self";
|
|
227
|
+
prepareArguments?: (args: unknown) => Static<TParams>;
|
|
228
|
+
executionMode?: ToolExecutionMode;
|
|
229
|
+
executionModeFor?: (args: unknown) => ToolExecutionMode | undefined;
|
|
230
|
+
execute(toolCallId: string, params: Static<TParams>, signal: AbortSignal | undefined, onUpdate: AgentToolUpdateCallback<TDetails> | undefined, ctx: ExtensionContext): Promise<AgentToolResult<TDetails>>;
|
|
231
|
+
renderCall?: (args: Static<TParams>, theme: Theme, context: ToolRenderContext<TState, Static<TParams>>) => Component;
|
|
232
|
+
renderResult?: (result: AgentToolResult<TDetails>, options: ToolRenderResultOptions, theme: Theme, context: ToolRenderContext<TState, Static<TParams>>) => Component;
|
|
233
|
+
}
|
|
234
|
+
type AnyToolDefinition = ToolDefinition<any, any, any>;
|
|
235
|
+
export declare function defineTool<TParams extends TSchema, TDetails = unknown, TState = any>(tool: ToolDefinition<TParams, TDetails, TState>): ToolDefinition<TParams, TDetails, TState> & AnyToolDefinition;
|
|
236
|
+
export interface ProjectTrustEvent {
|
|
237
|
+
type: "project_trust";
|
|
238
|
+
cwd: string;
|
|
239
|
+
}
|
|
240
|
+
export type ProjectTrustEventDecision = "yes" | "no" | "undecided";
|
|
241
|
+
export interface ProjectTrustEventResult {
|
|
242
|
+
trusted: ProjectTrustEventDecision;
|
|
243
|
+
remember?: boolean;
|
|
244
|
+
}
|
|
245
|
+
export interface ProjectTrustContext {
|
|
246
|
+
cwd: string;
|
|
247
|
+
mode: ExtensionMode;
|
|
248
|
+
hasUI: boolean;
|
|
249
|
+
ui: Pick<ExtensionUIContext, "select" | "confirm" | "input" | "notify">;
|
|
250
|
+
}
|
|
251
|
+
export type ProjectTrustHandler = (event: ProjectTrustEvent, ctx: ProjectTrustContext) => Promise<ProjectTrustEventResult> | ProjectTrustEventResult;
|
|
252
|
+
export interface ResourcesDiscoverEvent {
|
|
253
|
+
type: "resources_discover";
|
|
254
|
+
cwd: string;
|
|
255
|
+
reason: "startup" | "reload";
|
|
256
|
+
}
|
|
257
|
+
export interface ResourcesDiscoverResult {
|
|
258
|
+
skillPaths?: string[];
|
|
259
|
+
promptPaths?: string[];
|
|
260
|
+
themePaths?: string[];
|
|
261
|
+
}
|
|
262
|
+
export interface SessionStartEvent {
|
|
263
|
+
type: "session_start";
|
|
264
|
+
reason: "startup" | "reload" | "new" | "resume" | "fork";
|
|
265
|
+
previousSessionFile?: string;
|
|
266
|
+
}
|
|
267
|
+
export interface ProviderAuthenticatedEvent {
|
|
268
|
+
type: "provider_authenticated";
|
|
269
|
+
providerId: string;
|
|
270
|
+
authType: "oauth" | "api_key";
|
|
271
|
+
}
|
|
272
|
+
export interface SessionInfoChangedEvent {
|
|
273
|
+
type: "session_info_changed";
|
|
274
|
+
name: string | undefined;
|
|
275
|
+
}
|
|
276
|
+
export interface SessionBeforeSwitchEvent {
|
|
277
|
+
type: "session_before_switch";
|
|
278
|
+
reason: "new" | "resume";
|
|
279
|
+
targetSessionFile?: string;
|
|
280
|
+
}
|
|
281
|
+
export interface SessionBeforeForkEvent {
|
|
282
|
+
type: "session_before_fork";
|
|
283
|
+
entryId: string;
|
|
284
|
+
position: "before" | "at";
|
|
285
|
+
}
|
|
286
|
+
export interface SessionBeforeCompactEvent {
|
|
287
|
+
type: "session_before_compact";
|
|
288
|
+
preparation: CompactionPreparation;
|
|
289
|
+
branchEntries: SessionEntry[];
|
|
290
|
+
customInstructions?: string;
|
|
291
|
+
reason: "manual" | "threshold" | "overflow";
|
|
292
|
+
willRetry: boolean;
|
|
293
|
+
signal: AbortSignal;
|
|
294
|
+
}
|
|
295
|
+
export interface SessionCompactEvent {
|
|
296
|
+
type: "session_compact";
|
|
297
|
+
compactionEntry: CompactionEntry;
|
|
298
|
+
fromExtension: boolean;
|
|
299
|
+
reason: "manual" | "threshold" | "overflow";
|
|
300
|
+
willRetry: boolean;
|
|
301
|
+
}
|
|
302
|
+
export interface SessionCompactFailedEvent {
|
|
303
|
+
type: "session_compact_failed";
|
|
304
|
+
reason: "manual" | "threshold" | "overflow";
|
|
305
|
+
errorMessage?: string;
|
|
306
|
+
aborted: boolean;
|
|
307
|
+
willRetry: boolean;
|
|
308
|
+
fromExtension: boolean;
|
|
309
|
+
}
|
|
310
|
+
export interface SessionShutdownEvent {
|
|
311
|
+
type: "session_shutdown";
|
|
312
|
+
reason: "quit" | "reload" | "new" | "resume" | "fork";
|
|
313
|
+
targetSessionFile?: string;
|
|
314
|
+
}
|
|
315
|
+
export interface TreePreparation {
|
|
316
|
+
targetId: string;
|
|
317
|
+
oldLeafId: string | null;
|
|
318
|
+
commonAncestorId: string | null;
|
|
319
|
+
entriesToSummarize: SessionEntry[];
|
|
320
|
+
userWantsSummary: boolean;
|
|
321
|
+
customInstructions?: string;
|
|
322
|
+
replaceInstructions?: boolean;
|
|
323
|
+
label?: string;
|
|
324
|
+
}
|
|
325
|
+
export interface SessionBeforeTreeEvent {
|
|
326
|
+
type: "session_before_tree";
|
|
327
|
+
preparation: TreePreparation;
|
|
328
|
+
signal: AbortSignal;
|
|
329
|
+
}
|
|
330
|
+
export interface SessionTreeEvent {
|
|
331
|
+
type: "session_tree";
|
|
332
|
+
newLeafId: string | null;
|
|
333
|
+
oldLeafId: string | null;
|
|
334
|
+
summaryEntry?: BranchSummaryEntry;
|
|
335
|
+
fromExtension?: boolean;
|
|
336
|
+
}
|
|
337
|
+
export type SessionEvent = SessionStartEvent | SessionInfoChangedEvent | ProviderAuthenticatedEvent | SessionBeforeSwitchEvent | SessionBeforeForkEvent | SessionBeforeCompactEvent | SessionCompactEvent | SessionCompactFailedEvent | SessionShutdownEvent | SessionBeforeTreeEvent | SessionTreeEvent;
|
|
338
|
+
export interface ContextEvent {
|
|
339
|
+
type: "context";
|
|
340
|
+
messages: AgentMessage[];
|
|
341
|
+
}
|
|
342
|
+
export interface ContextWithSystemEvent {
|
|
343
|
+
type: "context_with_system";
|
|
344
|
+
messages: AgentMessage[];
|
|
345
|
+
}
|
|
346
|
+
export interface BeforeProviderRequestEvent {
|
|
347
|
+
type: "before_provider_request";
|
|
348
|
+
payload: unknown;
|
|
349
|
+
}
|
|
350
|
+
export interface BeforeProviderHeadersEvent {
|
|
351
|
+
type: "before_provider_headers";
|
|
352
|
+
headers: ProviderHeaders;
|
|
353
|
+
}
|
|
354
|
+
export interface AfterProviderResponseEvent {
|
|
355
|
+
type: "after_provider_response";
|
|
356
|
+
status: number;
|
|
357
|
+
headers: Record<string, string>;
|
|
358
|
+
}
|
|
359
|
+
export interface BeforeAgentStartEvent {
|
|
360
|
+
type: "before_agent_start";
|
|
361
|
+
prompt: string;
|
|
362
|
+
images?: ImageContent[];
|
|
363
|
+
readonly systemPrompt: string;
|
|
364
|
+
systemPromptOptions: NormalizedBuildSystemPromptOptions;
|
|
365
|
+
}
|
|
366
|
+
export interface AgentStartEvent {
|
|
367
|
+
type: "agent_start";
|
|
368
|
+
}
|
|
369
|
+
export interface AgentEndEvent {
|
|
370
|
+
type: "agent_end";
|
|
371
|
+
messages: AgentMessage[];
|
|
372
|
+
}
|
|
373
|
+
export type AgentActivityOutcome = "completed" | "aborted" | "error";
|
|
374
|
+
export interface CustomEntryDraft {
|
|
375
|
+
type: "custom";
|
|
376
|
+
customType: string;
|
|
377
|
+
data?: unknown;
|
|
378
|
+
}
|
|
379
|
+
export interface CustomMessageEntryDraft {
|
|
380
|
+
type: "custom_message";
|
|
381
|
+
customType: string;
|
|
382
|
+
content: string | (TextContent | ImageContent)[];
|
|
383
|
+
display: boolean;
|
|
384
|
+
details?: unknown;
|
|
385
|
+
}
|
|
386
|
+
export interface ContextEditEntryDraft {
|
|
387
|
+
type: "context_edit";
|
|
388
|
+
targetId: string;
|
|
389
|
+
replacement: ContextEditEntry["replacement"];
|
|
390
|
+
}
|
|
391
|
+
export interface CompactionEntryDraft {
|
|
392
|
+
type: "compaction";
|
|
393
|
+
summary: string;
|
|
394
|
+
firstKeptEntryId: string | null;
|
|
395
|
+
details?: unknown;
|
|
396
|
+
usage?: Usage;
|
|
397
|
+
}
|
|
398
|
+
export type SessionBoundaryDraft = CustomEntryDraft | CustomMessageEntryDraft | ContextEditEntryDraft | CompactionEntryDraft;
|
|
399
|
+
export interface BoundaryContextPreview {
|
|
400
|
+
contextEntries: ProjectedSessionEntry[];
|
|
401
|
+
contextMessages: AgentMessage[];
|
|
402
|
+
llmMessages: Message[];
|
|
403
|
+
pendingMessages: AgentMessage[];
|
|
404
|
+
canContinue: boolean;
|
|
405
|
+
}
|
|
406
|
+
export interface BoundaryState {
|
|
407
|
+
entries: SessionBoundaryDraft[];
|
|
408
|
+
continue: boolean;
|
|
409
|
+
context: BoundaryContextPreview;
|
|
410
|
+
outcome: AgentActivityOutcome;
|
|
411
|
+
}
|
|
412
|
+
export interface BoundaryResult {
|
|
413
|
+
entries?: SessionBoundaryDraft[];
|
|
414
|
+
continue?: boolean;
|
|
415
|
+
}
|
|
416
|
+
export interface AgentBeforeSettleEvent extends BoundaryState {
|
|
417
|
+
type: "agent_before_settle";
|
|
418
|
+
}
|
|
419
|
+
export interface AgentSettledEvent {
|
|
420
|
+
type: "agent_settled";
|
|
421
|
+
}
|
|
422
|
+
export type UIPromptKind = "select" | "confirm" | "input" | "editor" | "custom";
|
|
423
|
+
export interface UIPromptStartEvent {
|
|
424
|
+
type: "ui_prompt_start";
|
|
425
|
+
reason: "ui_prompt";
|
|
426
|
+
kind: UIPromptKind;
|
|
427
|
+
title?: string;
|
|
428
|
+
}
|
|
429
|
+
export interface UIPromptEndEvent {
|
|
430
|
+
type: "ui_prompt_end";
|
|
431
|
+
reason: "ui_prompt";
|
|
432
|
+
kind: UIPromptKind;
|
|
433
|
+
title?: string;
|
|
434
|
+
}
|
|
435
|
+
export interface TurnStartEvent {
|
|
436
|
+
type: "turn_start";
|
|
437
|
+
turnIndex: number;
|
|
438
|
+
timestamp: number;
|
|
439
|
+
}
|
|
440
|
+
export interface TurnEndEvent extends BoundaryState {
|
|
441
|
+
type: "turn_end";
|
|
442
|
+
turnIndex: number;
|
|
443
|
+
message: AgentMessage;
|
|
444
|
+
toolResults: ToolResultMessage[];
|
|
445
|
+
messageEntryId: string;
|
|
446
|
+
toolResultEntryIds: string[];
|
|
447
|
+
}
|
|
448
|
+
export interface MessageStartEvent {
|
|
449
|
+
type: "message_start";
|
|
450
|
+
message: AgentMessage;
|
|
451
|
+
}
|
|
452
|
+
export interface MessageUpdateEvent {
|
|
453
|
+
type: "message_update";
|
|
454
|
+
message: AgentMessage;
|
|
455
|
+
assistantMessageEvent: AssistantMessageEvent;
|
|
456
|
+
}
|
|
457
|
+
export interface MessageEndEvent {
|
|
458
|
+
type: "message_end";
|
|
459
|
+
message: AgentMessage;
|
|
460
|
+
}
|
|
461
|
+
export interface ToolExecutionStartEvent {
|
|
462
|
+
type: "tool_execution_start";
|
|
463
|
+
toolCallId: string;
|
|
464
|
+
toolName: string;
|
|
465
|
+
args: any;
|
|
466
|
+
}
|
|
467
|
+
export interface ToolExecutionUpdateEvent {
|
|
468
|
+
type: "tool_execution_update";
|
|
469
|
+
toolCallId: string;
|
|
470
|
+
toolName: string;
|
|
471
|
+
args: any;
|
|
472
|
+
partialResult: any;
|
|
473
|
+
}
|
|
474
|
+
export interface ToolExecutionEndEvent {
|
|
475
|
+
type: "tool_execution_end";
|
|
476
|
+
toolCallId: string;
|
|
477
|
+
toolName: string;
|
|
478
|
+
result: any;
|
|
479
|
+
isError: boolean;
|
|
480
|
+
}
|
|
481
|
+
export type ModelSelectSource = "set" | "cycle" | "restore";
|
|
482
|
+
export interface ModelSelectEvent {
|
|
483
|
+
type: "model_select";
|
|
484
|
+
model: Model<any>;
|
|
485
|
+
previousModel: Model<any> | undefined;
|
|
486
|
+
source: ModelSelectSource;
|
|
487
|
+
}
|
|
488
|
+
export interface ThinkingLevelSelectEvent {
|
|
489
|
+
type: "thinking_level_select";
|
|
490
|
+
level: ThinkingLevel;
|
|
491
|
+
previousLevel: ThinkingLevel;
|
|
492
|
+
}
|
|
493
|
+
export interface UserBashEvent {
|
|
494
|
+
type: "user_bash";
|
|
495
|
+
command: string;
|
|
496
|
+
excludeFromContext: boolean;
|
|
497
|
+
cwd: string;
|
|
498
|
+
}
|
|
499
|
+
export type InputSource = "interactive" | "rpc" | "extension";
|
|
500
|
+
export interface InputEvent {
|
|
501
|
+
type: "input";
|
|
502
|
+
text: string;
|
|
503
|
+
images?: ImageContent[];
|
|
504
|
+
source: InputSource;
|
|
505
|
+
streamingBehavior?: "steer" | "followUp";
|
|
506
|
+
}
|
|
507
|
+
export type InputEventResult = {
|
|
508
|
+
action: "continue";
|
|
509
|
+
} | {
|
|
510
|
+
action: "transform";
|
|
511
|
+
text: string;
|
|
512
|
+
images?: ImageContent[];
|
|
513
|
+
} | {
|
|
514
|
+
action: "handled";
|
|
515
|
+
};
|
|
516
|
+
interface ToolCallEventBase {
|
|
517
|
+
type: "tool_call";
|
|
518
|
+
toolCallId: string;
|
|
519
|
+
}
|
|
520
|
+
export interface BashToolCallEvent extends ToolCallEventBase {
|
|
521
|
+
toolName: "bash";
|
|
522
|
+
input: BashToolInput;
|
|
523
|
+
}
|
|
524
|
+
export interface PowerShellToolCallEvent extends ToolCallEventBase {
|
|
525
|
+
toolName: "powershell";
|
|
526
|
+
input: PowerShellToolInput;
|
|
527
|
+
}
|
|
528
|
+
export interface ReadToolCallEvent extends ToolCallEventBase {
|
|
529
|
+
toolName: "read";
|
|
530
|
+
input: ReadToolInput;
|
|
531
|
+
}
|
|
532
|
+
export interface EditToolCallEvent extends ToolCallEventBase {
|
|
533
|
+
toolName: "edit";
|
|
534
|
+
input: EditToolInput;
|
|
535
|
+
}
|
|
536
|
+
export interface WriteToolCallEvent extends ToolCallEventBase {
|
|
537
|
+
toolName: "write";
|
|
538
|
+
input: WriteToolInput;
|
|
539
|
+
}
|
|
540
|
+
export interface GrepToolCallEvent extends ToolCallEventBase {
|
|
541
|
+
toolName: "grep";
|
|
542
|
+
input: GrepToolInput;
|
|
543
|
+
}
|
|
544
|
+
export interface FindToolCallEvent extends ToolCallEventBase {
|
|
545
|
+
toolName: "find";
|
|
546
|
+
input: FindToolInput;
|
|
547
|
+
}
|
|
548
|
+
export interface LsToolCallEvent extends ToolCallEventBase {
|
|
549
|
+
toolName: "ls";
|
|
550
|
+
input: LsToolInput;
|
|
551
|
+
}
|
|
552
|
+
export interface CustomToolCallEvent extends ToolCallEventBase {
|
|
553
|
+
toolName: string;
|
|
554
|
+
input: Record<string, unknown>;
|
|
555
|
+
}
|
|
556
|
+
export type ToolCallEvent = BashToolCallEvent | PowerShellToolCallEvent | ReadToolCallEvent | EditToolCallEvent | WriteToolCallEvent | GrepToolCallEvent | FindToolCallEvent | LsToolCallEvent | CustomToolCallEvent;
|
|
557
|
+
interface ToolResultEventBase {
|
|
558
|
+
type: "tool_result";
|
|
559
|
+
toolCallId: string;
|
|
560
|
+
input: Record<string, unknown>;
|
|
561
|
+
content: (TextContent | ImageContent)[];
|
|
562
|
+
isError: boolean;
|
|
563
|
+
usage?: Usage;
|
|
564
|
+
}
|
|
565
|
+
export interface BashToolResultEvent extends ToolResultEventBase {
|
|
566
|
+
toolName: "bash";
|
|
567
|
+
details: BashToolDetails | undefined;
|
|
568
|
+
}
|
|
569
|
+
export interface PowerShellToolResultEvent extends ToolResultEventBase {
|
|
570
|
+
toolName: "powershell";
|
|
571
|
+
details: PowerShellToolDetails | undefined;
|
|
572
|
+
}
|
|
573
|
+
export interface ReadToolResultEvent extends ToolResultEventBase {
|
|
574
|
+
toolName: "read";
|
|
575
|
+
details: ReadToolDetails | undefined;
|
|
576
|
+
}
|
|
577
|
+
export interface EditToolResultEvent extends ToolResultEventBase {
|
|
578
|
+
toolName: "edit";
|
|
579
|
+
details: EditToolDetails | undefined;
|
|
580
|
+
}
|
|
581
|
+
export interface WriteToolResultEvent extends ToolResultEventBase {
|
|
582
|
+
toolName: "write";
|
|
583
|
+
details: undefined;
|
|
584
|
+
}
|
|
585
|
+
export interface GrepToolResultEvent extends ToolResultEventBase {
|
|
586
|
+
toolName: "grep";
|
|
587
|
+
details: GrepToolDetails | undefined;
|
|
588
|
+
}
|
|
589
|
+
export interface FindToolResultEvent extends ToolResultEventBase {
|
|
590
|
+
toolName: "find";
|
|
591
|
+
details: FindToolDetails | undefined;
|
|
592
|
+
}
|
|
593
|
+
export interface LsToolResultEvent extends ToolResultEventBase {
|
|
594
|
+
toolName: "ls";
|
|
595
|
+
details: LsToolDetails | undefined;
|
|
596
|
+
}
|
|
597
|
+
export interface CustomToolResultEvent extends ToolResultEventBase {
|
|
598
|
+
toolName: string;
|
|
599
|
+
details: unknown;
|
|
600
|
+
}
|
|
601
|
+
export type ToolResultEvent = BashToolResultEvent | PowerShellToolResultEvent | ReadToolResultEvent | EditToolResultEvent | WriteToolResultEvent | GrepToolResultEvent | FindToolResultEvent | LsToolResultEvent | CustomToolResultEvent;
|
|
602
|
+
export declare function isBashToolResult(e: ToolResultEvent): e is BashToolResultEvent;
|
|
603
|
+
export declare function isPowerShellToolResult(e: ToolResultEvent): e is PowerShellToolResultEvent;
|
|
604
|
+
export declare function isReadToolResult(e: ToolResultEvent): e is ReadToolResultEvent;
|
|
605
|
+
export declare function isEditToolResult(e: ToolResultEvent): e is EditToolResultEvent;
|
|
606
|
+
export declare function isWriteToolResult(e: ToolResultEvent): e is WriteToolResultEvent;
|
|
607
|
+
export declare function isGrepToolResult(e: ToolResultEvent): e is GrepToolResultEvent;
|
|
608
|
+
export declare function isFindToolResult(e: ToolResultEvent): e is FindToolResultEvent;
|
|
609
|
+
export declare function isLsToolResult(e: ToolResultEvent): e is LsToolResultEvent;
|
|
610
|
+
export declare function isToolCallEventType(toolName: "bash", event: ToolCallEvent): event is BashToolCallEvent;
|
|
611
|
+
export declare function isToolCallEventType(toolName: "powershell", event: ToolCallEvent): event is PowerShellToolCallEvent;
|
|
612
|
+
export declare function isToolCallEventType(toolName: "read", event: ToolCallEvent): event is ReadToolCallEvent;
|
|
613
|
+
export declare function isToolCallEventType(toolName: "edit", event: ToolCallEvent): event is EditToolCallEvent;
|
|
614
|
+
export declare function isToolCallEventType(toolName: "write", event: ToolCallEvent): event is WriteToolCallEvent;
|
|
615
|
+
export declare function isToolCallEventType(toolName: "grep", event: ToolCallEvent): event is GrepToolCallEvent;
|
|
616
|
+
export declare function isToolCallEventType(toolName: "find", event: ToolCallEvent): event is FindToolCallEvent;
|
|
617
|
+
export declare function isToolCallEventType(toolName: "ls", event: ToolCallEvent): event is LsToolCallEvent;
|
|
618
|
+
export declare function isToolCallEventType<TName extends string, TInput extends Record<string, unknown>>(toolName: TName, event: ToolCallEvent): event is ToolCallEvent & {
|
|
619
|
+
toolName: TName;
|
|
620
|
+
input: TInput;
|
|
621
|
+
};
|
|
622
|
+
export type ExtensionEvent = ProjectTrustEvent | ResourcesDiscoverEvent | SessionEvent | ContextEvent | ContextWithSystemEvent | CacheWarmingDecisionEvent | BeforeProviderRequestEvent | BeforeProviderHeadersEvent | AfterProviderResponseEvent | BeforeAgentStartEvent | AgentStartEvent | AgentEndEvent | AgentBeforeSettleEvent | AgentSettledEvent | UIPromptStartEvent | UIPromptEndEvent | TurnStartEvent | TurnEndEvent | MessageStartEvent | MessageUpdateEvent | MessageEndEvent | ToolExecutionStartEvent | ToolExecutionUpdateEvent | ToolExecutionEndEvent | ModelSelectEvent | ThinkingLevelSelectEvent | UserBashEvent | InputEvent | ToolCallEvent | ToolResultEvent;
|
|
623
|
+
export interface ContextEventResult {
|
|
624
|
+
messages?: AgentMessage[];
|
|
625
|
+
}
|
|
626
|
+
export type TurnEndEventResult = BoundaryResult;
|
|
627
|
+
export type AgentBeforeSettleEventResult = BoundaryResult;
|
|
628
|
+
export type BeforeProviderRequestEventResult = unknown;
|
|
629
|
+
export type { CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult } from "../cache-warmer.ts";
|
|
630
|
+
export interface ToolCallEventResult {
|
|
631
|
+
block?: boolean;
|
|
632
|
+
reason?: string;
|
|
633
|
+
terminate?: boolean;
|
|
634
|
+
}
|
|
635
|
+
export type UserBashEventResult = {
|
|
636
|
+
operations: BashOperations;
|
|
637
|
+
result?: never;
|
|
638
|
+
} | {
|
|
639
|
+
operations?: never;
|
|
640
|
+
result: BashResult;
|
|
641
|
+
};
|
|
642
|
+
export interface ToolResultEventResult {
|
|
643
|
+
content?: (TextContent | ImageContent)[];
|
|
644
|
+
details?: unknown;
|
|
645
|
+
isError?: boolean;
|
|
646
|
+
usage?: Usage;
|
|
647
|
+
}
|
|
648
|
+
export interface MessageEndEventResult {
|
|
649
|
+
message?: AgentMessage;
|
|
650
|
+
}
|
|
651
|
+
export interface BeforeAgentStartEventResult {
|
|
652
|
+
message?: Pick<CustomMessage, "customType" | "content" | "display" | "details">;
|
|
653
|
+
systemPrompt?: string;
|
|
654
|
+
}
|
|
655
|
+
export interface SessionBeforeSwitchResult {
|
|
656
|
+
cancel?: boolean;
|
|
657
|
+
}
|
|
658
|
+
export interface SessionBeforeForkResult {
|
|
659
|
+
cancel?: boolean;
|
|
660
|
+
skipConversationRestore?: boolean;
|
|
661
|
+
}
|
|
662
|
+
export interface SessionBeforeCompactResult {
|
|
663
|
+
cancel?: boolean;
|
|
664
|
+
compaction?: CompactionResult;
|
|
665
|
+
}
|
|
666
|
+
export interface SessionBeforeTreeResult {
|
|
667
|
+
cancel?: boolean;
|
|
668
|
+
summary?: {
|
|
669
|
+
summary: string;
|
|
670
|
+
details?: unknown;
|
|
671
|
+
usage?: Usage;
|
|
672
|
+
};
|
|
673
|
+
customInstructions?: string;
|
|
674
|
+
replaceInstructions?: boolean;
|
|
675
|
+
label?: string;
|
|
676
|
+
}
|
|
677
|
+
export interface MessageRenderOptions {
|
|
678
|
+
expanded: boolean;
|
|
679
|
+
outputPad: number;
|
|
680
|
+
}
|
|
681
|
+
export interface MarkdownTransformContext {
|
|
682
|
+
messageType: "user" | "assistant" | "assistant-thinking";
|
|
683
|
+
isStreaming: boolean;
|
|
684
|
+
availableWidth: number;
|
|
685
|
+
}
|
|
686
|
+
export type MarkdownTransformer = (markdown: string, context: MarkdownTransformContext) => string;
|
|
687
|
+
export interface EntryRenderOptions {
|
|
688
|
+
expanded: boolean;
|
|
689
|
+
}
|
|
690
|
+
export type MessageRenderer<T = unknown> = (message: CustomMessage<T>, options: MessageRenderOptions, theme: Theme) => Component | undefined;
|
|
691
|
+
export type EntryRenderer<T = unknown> = (entry: CustomEntry<T>, options: EntryRenderOptions, theme: Theme) => Component | undefined;
|
|
692
|
+
export interface RegisteredCommand {
|
|
693
|
+
name: string;
|
|
694
|
+
sourceInfo: SourceInfo;
|
|
695
|
+
description?: string;
|
|
696
|
+
getArgumentCompletions?: (argumentPrefix: string) => AutocompleteItem[] | null | Promise<AutocompleteItem[] | null>;
|
|
697
|
+
handler: (args: string, ctx: ExtensionCommandContext) => Promise<void>;
|
|
698
|
+
}
|
|
699
|
+
export interface ResolvedCommand extends RegisteredCommand {
|
|
700
|
+
invocationName: string;
|
|
701
|
+
}
|
|
702
|
+
export interface ModelPickerEntryState {
|
|
703
|
+
label: string;
|
|
704
|
+
description?: string;
|
|
705
|
+
current: boolean;
|
|
706
|
+
}
|
|
707
|
+
export interface ModelPickerEntry {
|
|
708
|
+
getState: () => ModelPickerEntryState | undefined;
|
|
709
|
+
onSelect: (ctx: ExtensionCommandContext) => Promise<void> | void;
|
|
710
|
+
onModelChosen?: (model: Model<any>, ctx: ExtensionCommandContext) => Promise<void> | void;
|
|
711
|
+
}
|
|
712
|
+
export interface RegisteredModelPickerEntry extends ModelPickerEntry {
|
|
713
|
+
id: string;
|
|
714
|
+
extensionPath: string;
|
|
715
|
+
}
|
|
716
|
+
export type ExtensionHandler<E, R = undefined> = (event: E, ctx: ExtensionContext) => Promise<R | void> | R | void;
|
|
717
|
+
export interface ExtensionAPI {
|
|
718
|
+
on(event: "project_trust", handler: ProjectTrustHandler): () => void;
|
|
719
|
+
on(event: "resources_discover", handler: ExtensionHandler<ResourcesDiscoverEvent, ResourcesDiscoverResult>): () => void;
|
|
720
|
+
on(event: "session_start", handler: ExtensionHandler<SessionStartEvent>): () => void;
|
|
721
|
+
on(event: "session_info_changed", handler: ExtensionHandler<SessionInfoChangedEvent>): () => void;
|
|
722
|
+
on(event: "provider_authenticated", handler: ExtensionHandler<ProviderAuthenticatedEvent>): () => void;
|
|
723
|
+
on(event: "session_before_switch", handler: ExtensionHandler<SessionBeforeSwitchEvent, SessionBeforeSwitchResult>): () => void;
|
|
724
|
+
on(event: "session_before_fork", handler: ExtensionHandler<SessionBeforeForkEvent, SessionBeforeForkResult>): () => void;
|
|
725
|
+
on(event: "session_before_compact", handler: ExtensionHandler<SessionBeforeCompactEvent, SessionBeforeCompactResult>): () => void;
|
|
726
|
+
on(event: "session_compact", handler: ExtensionHandler<SessionCompactEvent>): () => void;
|
|
727
|
+
on(event: "session_compact_failed", handler: ExtensionHandler<SessionCompactFailedEvent>): () => void;
|
|
728
|
+
on(event: "session_shutdown", handler: ExtensionHandler<SessionShutdownEvent>): () => void;
|
|
729
|
+
on(event: "session_before_tree", handler: ExtensionHandler<SessionBeforeTreeEvent, SessionBeforeTreeResult>): () => void;
|
|
730
|
+
on(event: "session_tree", handler: ExtensionHandler<SessionTreeEvent>): () => void;
|
|
731
|
+
on(event: "context", handler: ExtensionHandler<ContextEvent, ContextEventResult>): () => void;
|
|
732
|
+
on(event: "context_with_system", handler: ExtensionHandler<ContextWithSystemEvent, ContextEventResult>): () => void;
|
|
733
|
+
on(event: "cache_warming_decision", handler: ExtensionHandler<CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult>): () => void;
|
|
734
|
+
on(event: "before_provider_request", handler: ExtensionHandler<BeforeProviderRequestEvent, BeforeProviderRequestEventResult>): () => void;
|
|
735
|
+
on(event: "before_provider_headers", handler: ExtensionHandler<BeforeProviderHeadersEvent>): () => void;
|
|
736
|
+
on(event: "after_provider_response", handler: ExtensionHandler<AfterProviderResponseEvent>): () => void;
|
|
737
|
+
on(event: "before_agent_start", handler: ExtensionHandler<BeforeAgentStartEvent, BeforeAgentStartEventResult>): () => void;
|
|
738
|
+
on(event: "agent_start", handler: ExtensionHandler<AgentStartEvent>): () => void;
|
|
739
|
+
on(event: "agent_end", handler: ExtensionHandler<AgentEndEvent>): () => void;
|
|
740
|
+
on(event: "agent_before_settle", handler: ExtensionHandler<AgentBeforeSettleEvent, AgentBeforeSettleEventResult>): () => void;
|
|
741
|
+
on(event: "agent_settled", handler: ExtensionHandler<AgentSettledEvent>): () => void;
|
|
742
|
+
on(event: "ui_prompt_start", handler: ExtensionHandler<UIPromptStartEvent>): () => void;
|
|
743
|
+
on(event: "ui_prompt_end", handler: ExtensionHandler<UIPromptEndEvent>): () => void;
|
|
744
|
+
on(event: "turn_start", handler: ExtensionHandler<TurnStartEvent>): () => void;
|
|
745
|
+
on(event: "turn_end", handler: ExtensionHandler<TurnEndEvent, TurnEndEventResult>): () => void;
|
|
746
|
+
on(event: "message_start", handler: ExtensionHandler<MessageStartEvent>): () => void;
|
|
747
|
+
on(event: "message_update", handler: ExtensionHandler<MessageUpdateEvent>): () => void;
|
|
748
|
+
on(event: "message_end", handler: ExtensionHandler<MessageEndEvent, MessageEndEventResult>): () => void;
|
|
749
|
+
on(event: "tool_execution_start", handler: ExtensionHandler<ToolExecutionStartEvent>): () => void;
|
|
750
|
+
on(event: "tool_execution_update", handler: ExtensionHandler<ToolExecutionUpdateEvent>): () => void;
|
|
751
|
+
on(event: "tool_execution_end", handler: ExtensionHandler<ToolExecutionEndEvent>): () => void;
|
|
752
|
+
on(event: "model_select", handler: ExtensionHandler<ModelSelectEvent>): () => void;
|
|
753
|
+
on(event: "thinking_level_select", handler: ExtensionHandler<ThinkingLevelSelectEvent>): () => void;
|
|
754
|
+
on(event: "tool_call", handler: ExtensionHandler<ToolCallEvent, ToolCallEventResult>): () => void;
|
|
755
|
+
on(event: "tool_result", handler: ExtensionHandler<ToolResultEvent, ToolResultEventResult>): () => void;
|
|
756
|
+
on(event: "user_bash", handler: ExtensionHandler<UserBashEvent, UserBashEventResult>): () => void;
|
|
757
|
+
on(event: "input", handler: ExtensionHandler<InputEvent, InputEventResult>): () => void;
|
|
758
|
+
registerTool<TParams extends TSchema = TSchema, TDetails = unknown, TState = any>(tool: ToolDefinition<TParams, TDetails, TState>): void;
|
|
759
|
+
registerCommand(name: string, options: Omit<RegisteredCommand, "name" | "sourceInfo">): void;
|
|
760
|
+
registerShortcut(shortcut: KeyId, options: {
|
|
761
|
+
description?: string;
|
|
762
|
+
handler: (ctx: ExtensionContext) => Promise<void> | void;
|
|
763
|
+
}): void;
|
|
764
|
+
registerFlag(name: string, options: {
|
|
765
|
+
description?: string;
|
|
766
|
+
type: "boolean";
|
|
767
|
+
default?: boolean;
|
|
768
|
+
} | {
|
|
769
|
+
description?: string;
|
|
770
|
+
type: "string";
|
|
771
|
+
default?: string;
|
|
772
|
+
}): void;
|
|
773
|
+
getFlag(name: string): boolean | string | undefined;
|
|
774
|
+
registerMessageRenderer<T = unknown>(customType: string, renderer: MessageRenderer<T>): void;
|
|
775
|
+
registerMarkdownTransformer(transformer: MarkdownTransformer): void;
|
|
776
|
+
registerEntryRenderer<T = unknown>(customType: string, renderer: EntryRenderer<T>): void;
|
|
777
|
+
sendMessage<T = unknown>(message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details">, options?: {
|
|
778
|
+
triggerTurn?: boolean;
|
|
779
|
+
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
780
|
+
}): Promise<void>;
|
|
781
|
+
sendUserMessage(content: string | (TextContent | ImageContent)[], options?: {
|
|
782
|
+
deliverAs?: "steer" | "followUp";
|
|
783
|
+
expandPromptTemplates?: boolean;
|
|
784
|
+
}): Promise<void>;
|
|
785
|
+
appendEntry<T = unknown>(customType: string, data?: T): void;
|
|
786
|
+
setSessionName(name: string): void;
|
|
787
|
+
getSessionName(): string | undefined;
|
|
788
|
+
setLabel(entryId: string, label: string | undefined): void;
|
|
789
|
+
exec(command: string, args: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
790
|
+
getActiveTools(): string[];
|
|
791
|
+
getAllTools(): ToolInfo[];
|
|
792
|
+
setActiveTools(toolNames: string[]): void;
|
|
793
|
+
isToolAllowed(name: string): boolean;
|
|
794
|
+
getToolAllowlist(): string[] | undefined;
|
|
795
|
+
getCommands(): SlashCommandInfo[];
|
|
796
|
+
setModel(model: Model<any>): Promise<boolean>;
|
|
797
|
+
getThinkingLevel(): ThinkingLevel;
|
|
798
|
+
setThinkingLevel(level: ThinkingLevel): void;
|
|
799
|
+
registerModelPickerEntry(id: string, entry: ModelPickerEntry): void;
|
|
800
|
+
registerProvider(provider: Provider): void;
|
|
801
|
+
registerProvider(name: string, config: ProviderConfig): void;
|
|
802
|
+
unregisterProvider(name: string): void;
|
|
803
|
+
events: EventBus;
|
|
804
|
+
}
|
|
805
|
+
export interface ProviderConfig {
|
|
806
|
+
name?: string;
|
|
807
|
+
baseUrl?: string;
|
|
808
|
+
apiKey?: string;
|
|
809
|
+
api?: Api;
|
|
810
|
+
streamSimple?: (model: Model<Api>, context: TranscriptContext, options?: SimpleStreamOptions) => AssistantMessageEventStream;
|
|
811
|
+
headers?: Record<string, string>;
|
|
812
|
+
authHeader?: boolean;
|
|
813
|
+
models?: ProviderModelConfig[];
|
|
814
|
+
refreshModels?(context: RefreshModelsContext): Promise<ProviderModelConfig[]>;
|
|
815
|
+
oauth?: {
|
|
816
|
+
name: string;
|
|
817
|
+
isSubscription?: boolean;
|
|
818
|
+
usesCallbackServer?: boolean;
|
|
819
|
+
login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials>;
|
|
820
|
+
refreshToken(credentials: OAuthCredentials, signal: AbortSignal): Promise<OAuthCredentials>;
|
|
821
|
+
getApiKey(credentials: OAuthCredentials): string;
|
|
822
|
+
modifyModels?(models: Model<Api>[], credentials: OAuthCredentials): Model<Api>[];
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
export interface ProviderModelConfig {
|
|
826
|
+
id: string;
|
|
827
|
+
name: string;
|
|
828
|
+
api?: Api;
|
|
829
|
+
baseUrl?: string;
|
|
830
|
+
reasoning: boolean;
|
|
831
|
+
thinkingLevelMap?: Model<Api>["thinkingLevelMap"];
|
|
832
|
+
input: ("text" | "image")[];
|
|
833
|
+
inputLimits?: Model<Api>["inputLimits"];
|
|
834
|
+
cost: Model<Api>["cost"];
|
|
835
|
+
promptCache?: Model<Api>["promptCache"];
|
|
836
|
+
contextWindow: number;
|
|
837
|
+
maxTokens: number;
|
|
838
|
+
headers?: Record<string, string>;
|
|
839
|
+
compat?: Model<Api>["compat"];
|
|
840
|
+
}
|
|
841
|
+
export type ExtensionFactory = (pi: ExtensionAPI) => void | Promise<void>;
|
|
842
|
+
export type InlineExtension = ExtensionFactory | {
|
|
843
|
+
name: string;
|
|
844
|
+
factory: ExtensionFactory;
|
|
845
|
+
hidden?: boolean;
|
|
846
|
+
};
|
|
847
|
+
export interface RegisteredTool {
|
|
848
|
+
definition: ToolDefinition;
|
|
849
|
+
sourceInfo: SourceInfo;
|
|
850
|
+
}
|
|
851
|
+
export interface ExtensionFlag {
|
|
852
|
+
name: string;
|
|
853
|
+
description?: string;
|
|
854
|
+
type: "boolean" | "string";
|
|
855
|
+
default?: boolean | string;
|
|
856
|
+
extensionPath: string;
|
|
857
|
+
}
|
|
858
|
+
export interface ExtensionShortcut {
|
|
859
|
+
shortcut: KeyId;
|
|
860
|
+
description?: string;
|
|
861
|
+
handler: (ctx: ExtensionContext) => Promise<void> | void;
|
|
862
|
+
extensionPath: string;
|
|
863
|
+
}
|
|
864
|
+
type HandlerFn = (...args: unknown[]) => Promise<unknown>;
|
|
865
|
+
export type SendMessageHandler = <T = unknown>(message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details">, options?: {
|
|
866
|
+
triggerTurn?: boolean;
|
|
867
|
+
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
868
|
+
}) => void;
|
|
869
|
+
export type SendUserMessageHandler = (content: string | (TextContent | ImageContent)[], options?: {
|
|
870
|
+
deliverAs?: "steer" | "followUp";
|
|
871
|
+
expandPromptTemplates?: boolean;
|
|
872
|
+
}) => void;
|
|
873
|
+
export type AppendEntryHandler = <T = unknown>(customType: string, data?: T) => void;
|
|
874
|
+
export type SetSessionNameHandler = (name: string) => void;
|
|
875
|
+
export type GetSessionNameHandler = () => string | undefined;
|
|
876
|
+
export type GetActiveToolsHandler = () => string[];
|
|
877
|
+
export type ToolInfo = Pick<ToolDefinition, "name" | "description" | "parameters" | "promptGuidelines"> & {
|
|
878
|
+
sourceInfo: SourceInfo;
|
|
879
|
+
};
|
|
880
|
+
export type GetAllToolsHandler = () => ToolInfo[];
|
|
881
|
+
export type GetCommandsHandler = () => SlashCommandInfo[];
|
|
882
|
+
export type SetActiveToolsHandler = (toolNames: string[]) => void;
|
|
883
|
+
export type IsToolAllowedHandler = (name: string) => boolean;
|
|
884
|
+
export type GetToolAllowlistHandler = () => string[] | undefined;
|
|
885
|
+
export type RefreshToolsHandler = () => void;
|
|
886
|
+
export type SetModelHandler = (model: Model<any>) => Promise<boolean>;
|
|
887
|
+
export type GetThinkingLevelHandler = () => ThinkingLevel;
|
|
888
|
+
export type SetThinkingLevelHandler = (level: ThinkingLevel) => void;
|
|
889
|
+
export type SetLabelHandler = (entryId: string, label: string | undefined) => void;
|
|
890
|
+
export interface ExtensionRuntimeState {
|
|
891
|
+
flagValues: Map<string, boolean | string>;
|
|
892
|
+
pendingProviderRegistrations: Array<{
|
|
893
|
+
name: string;
|
|
894
|
+
config: ProviderConfig;
|
|
895
|
+
extensionPath: string;
|
|
896
|
+
}>;
|
|
897
|
+
pendingNativeProviderRegistrations: Array<{
|
|
898
|
+
provider: Provider;
|
|
899
|
+
extensionPath: string;
|
|
900
|
+
}>;
|
|
901
|
+
assertActive: () => void;
|
|
902
|
+
invalidate: (message?: string) => void;
|
|
903
|
+
trackEventBusSubscription: (unsubscribe: () => void) => () => void;
|
|
904
|
+
registerProvider: (name: string, config: ProviderConfig, extensionPath?: string) => void;
|
|
905
|
+
registerNativeProvider: (provider: Provider, extensionPath?: string) => void;
|
|
906
|
+
unregisterProvider: (name: string, extensionPath?: string) => void;
|
|
907
|
+
}
|
|
908
|
+
export interface ExtensionActions {
|
|
909
|
+
sendMessage: SendMessageHandler;
|
|
910
|
+
sendUserMessage: SendUserMessageHandler;
|
|
911
|
+
appendEntry: AppendEntryHandler;
|
|
912
|
+
setSessionName: SetSessionNameHandler;
|
|
913
|
+
getSessionName: GetSessionNameHandler;
|
|
914
|
+
setLabel: SetLabelHandler;
|
|
915
|
+
getActiveTools: GetActiveToolsHandler;
|
|
916
|
+
getAllTools: GetAllToolsHandler;
|
|
917
|
+
setActiveTools: SetActiveToolsHandler;
|
|
918
|
+
isToolAllowed: IsToolAllowedHandler;
|
|
919
|
+
getToolAllowlist: GetToolAllowlistHandler;
|
|
920
|
+
refreshTools: RefreshToolsHandler;
|
|
921
|
+
getCommands: GetCommandsHandler;
|
|
922
|
+
setModel: SetModelHandler;
|
|
923
|
+
getThinkingLevel: GetThinkingLevelHandler;
|
|
924
|
+
setThinkingLevel: SetThinkingLevelHandler;
|
|
925
|
+
}
|
|
926
|
+
export interface ExtensionContextActions {
|
|
927
|
+
getModel: () => Model<any> | undefined;
|
|
928
|
+
getScopedModels: () => readonly ScopedModel[];
|
|
929
|
+
isIdle: () => boolean;
|
|
930
|
+
isProjectTrusted: () => boolean;
|
|
931
|
+
getSignal: () => AbortSignal | undefined;
|
|
932
|
+
abort: () => void;
|
|
933
|
+
hasPendingMessages: () => boolean;
|
|
934
|
+
shutdown: () => void;
|
|
935
|
+
getContextUsage: () => ContextUsage | undefined;
|
|
936
|
+
compact: (options?: CompactOptions) => void;
|
|
937
|
+
getSystemPrompt: () => string;
|
|
938
|
+
getSystemPromptOptions?: () => BuildSystemPromptOptions;
|
|
939
|
+
}
|
|
940
|
+
export interface ExtensionCommandContextActions {
|
|
941
|
+
waitForIdle: () => Promise<void>;
|
|
942
|
+
newSession: (options?: {
|
|
943
|
+
parentSession?: string;
|
|
944
|
+
setup?: (sessionManager: SessionManager) => Promise<void>;
|
|
945
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
946
|
+
}) => Promise<{
|
|
947
|
+
cancelled: boolean;
|
|
948
|
+
}>;
|
|
949
|
+
fork: (entryId: string, options?: {
|
|
950
|
+
position?: "before" | "at";
|
|
951
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
952
|
+
}) => Promise<{
|
|
953
|
+
cancelled: boolean;
|
|
954
|
+
}>;
|
|
955
|
+
navigateTree: (targetId: string, options?: {
|
|
956
|
+
summarize?: boolean;
|
|
957
|
+
customInstructions?: string;
|
|
958
|
+
replaceInstructions?: boolean;
|
|
959
|
+
label?: string;
|
|
960
|
+
}) => Promise<{
|
|
961
|
+
cancelled: boolean;
|
|
962
|
+
}>;
|
|
963
|
+
switchSession: (sessionPath: string, options?: {
|
|
964
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
965
|
+
}) => Promise<{
|
|
966
|
+
cancelled: boolean;
|
|
967
|
+
}>;
|
|
968
|
+
reload: () => Promise<void>;
|
|
969
|
+
}
|
|
970
|
+
export interface ExtensionRuntime extends ExtensionRuntimeState, ExtensionActions {
|
|
971
|
+
}
|
|
972
|
+
export interface Extension {
|
|
973
|
+
path: string;
|
|
974
|
+
resolvedPath: string;
|
|
975
|
+
hidden?: boolean;
|
|
976
|
+
sourceInfo: SourceInfo;
|
|
977
|
+
handlers: Map<string, HandlerFn[]>;
|
|
978
|
+
tools: Map<string, RegisteredTool>;
|
|
979
|
+
messageRenderers: Map<string, MessageRenderer>;
|
|
980
|
+
markdownTransformer?: MarkdownTransformer;
|
|
981
|
+
entryRenderers?: Map<string, EntryRenderer>;
|
|
982
|
+
modelPickerEntries?: Map<string, RegisteredModelPickerEntry>;
|
|
983
|
+
commands: Map<string, RegisteredCommand>;
|
|
984
|
+
flags: Map<string, ExtensionFlag>;
|
|
985
|
+
shortcuts: Map<KeyId, ExtensionShortcut>;
|
|
986
|
+
}
|
|
987
|
+
export interface LoadExtensionsResult {
|
|
988
|
+
extensions: Extension[];
|
|
989
|
+
errors: Array<{
|
|
990
|
+
path: string;
|
|
991
|
+
error: string;
|
|
992
|
+
}>;
|
|
993
|
+
runtime: ExtensionRuntime;
|
|
994
|
+
}
|
|
995
|
+
export interface ExtensionError {
|
|
996
|
+
extensionPath: string;
|
|
997
|
+
event: string;
|
|
998
|
+
error: string;
|
|
999
|
+
stack?: string;
|
|
1000
|
+
}
|