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
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const isBunBinary: boolean;
|
|
2
|
+
export declare const isBunRuntime: boolean;
|
|
3
|
+
export declare const isBundledNode: boolean;
|
|
4
|
+
export type InstallMethod = "bun-binary" | "npm" | "pnpm" | "yarn" | "bun" | "unknown";
|
|
5
|
+
interface SelfUpdateCommandStep {
|
|
6
|
+
command: string;
|
|
7
|
+
args: string[];
|
|
8
|
+
display: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SelfUpdateCommand extends SelfUpdateCommandStep {
|
|
11
|
+
steps?: SelfUpdateCommandStep[];
|
|
12
|
+
}
|
|
13
|
+
export type SelfUpdatePackageTarget = string | {
|
|
14
|
+
packageName: string;
|
|
15
|
+
installSpec?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function detectInstallMethod(): InstallMethod;
|
|
18
|
+
export declare function getSelfUpdateCommand(packageName: string, npmCommand?: string[], updatePackageTarget?: SelfUpdatePackageTarget): SelfUpdateCommand | undefined;
|
|
19
|
+
export declare function getSelfUpdateUnavailableInstruction(packageName: string, npmCommand?: string[], updatePackageTarget?: SelfUpdatePackageTarget): string;
|
|
20
|
+
export declare function getUpdateInstruction(packageName: string): string;
|
|
21
|
+
export declare function findNodePackageDir(startDir: string): string;
|
|
22
|
+
export declare function getPackageDir(): string;
|
|
23
|
+
export declare function getThemesDir(): string;
|
|
24
|
+
export declare function getExportTemplateDir(): string;
|
|
25
|
+
export declare function getPackageJsonPath(): string;
|
|
26
|
+
export declare function getReadmePath(): string;
|
|
27
|
+
export declare function getDocsPath(): string;
|
|
28
|
+
export declare function getExamplesPath(): string;
|
|
29
|
+
export declare function getDalDocsPath(): string;
|
|
30
|
+
export declare function getOfficialExtensionsPath(): string;
|
|
31
|
+
export declare const OFFICIAL_EXTENSIONS_PACKAGE_NAME = "@deepailab/dal-official-extensions";
|
|
32
|
+
export declare function isOfficialExtensionsPackage(packageRoot: string): boolean;
|
|
33
|
+
export declare function getChangelogPath(): string;
|
|
34
|
+
export declare function getInteractiveAssetsDir(): string;
|
|
35
|
+
export declare function getBundledInteractiveAssetPath(name: string): string;
|
|
36
|
+
export declare const PACKAGE_NAME: string;
|
|
37
|
+
export declare const APP_NAME: string;
|
|
38
|
+
export declare const APP_TITLE: string;
|
|
39
|
+
export declare const CONFIG_DIR_NAME: string;
|
|
40
|
+
export declare const IS_WHITE_LABEL_BUILD: boolean;
|
|
41
|
+
export declare const SHARED_SKILL_CONFIG_DIRS: readonly string[];
|
|
42
|
+
export declare const VERSION: string;
|
|
43
|
+
export declare const UPSTREAM_PI: string | undefined;
|
|
44
|
+
export declare const DAL_UPDATE_PACKAGE = "@deepailab/dal";
|
|
45
|
+
export declare const DAL_UPDATE_SCOPE = "@deepailab";
|
|
46
|
+
export declare const DAL_RELEASE_REPO = "DeepAILab-Team/dal-dist";
|
|
47
|
+
export declare const DAL_RELEASES_URL = "https://github.com/DeepAILab-Team/dal-dist/releases";
|
|
48
|
+
export declare const DAL_UPDATE_REGISTRY = "https://git.siweibot.com/api/packages/gitea/npm";
|
|
49
|
+
export declare const ENV_AGENT_DIR: string;
|
|
50
|
+
export declare const ENV_SESSION_DIR: string;
|
|
51
|
+
export declare function expandTildePath(path: string): string;
|
|
52
|
+
export declare function getShareViewerUrl(gistId: string, gistUrl?: string): string;
|
|
53
|
+
export declare function getAgentDir(): string;
|
|
54
|
+
export declare function getCustomThemesDir(): string;
|
|
55
|
+
export declare function getModelsPath(): string;
|
|
56
|
+
export declare function getAuthPath(): string;
|
|
57
|
+
export declare function getSettingsPath(): string;
|
|
58
|
+
export declare function getToolsDir(): string;
|
|
59
|
+
export declare function getBinDir(): string;
|
|
60
|
+
export declare function getPromptsDir(): string;
|
|
61
|
+
export declare function getSessionsDir(): string;
|
|
62
|
+
export declare function getDebugLogPath(): string;
|
|
63
|
+
export {};
|
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var F=Object.defineProperty;var r=(e,t)=>F(e,"name",{value:t,configurable:!0});import{accessSync as
|
|
1
|
+
var F=Object.defineProperty;var r=(e,t)=>F(e,"name",{value:t,configurable:!0});import{accessSync as I,constants as k,existsSync as g,readFileSync as N,realpathSync as K}from"fs";import{homedir as S}from"os";import{basename as U,dirname as u,join as o,resolve as h,sep as w,win32 as H}from"path";import{fileURLToPath as V}from"url";import{spawnProcessSync as q}from"./utils/child-process.js";import{normalizePath as C}from"./utils/paths.js";import{stripBom as R}from"./utils/text.js";const J=V(import.meta.url),$=u(J),E=import.meta.url.includes("$bunfs")||import.meta.url.includes("~BUN")||import.meta.url.includes("%7EBUN"),z=!!process.versions.bun,Ee=typeof PI_BUNDLED_NODE<"u"&&PI_BUNDLED_NODE;function X(e){return e.startsWith("https://")||e.startsWith("http://")}r(X,"isUrlInstallSpec");function L(e){return typeof e=="string"?{packageName:e,installSpec:e}:{packageName:e.packageName,installSpec:e.installSpec??e.packageName}}r(L,"normalizeSelfUpdatePackageTarget");function P(e,t){return t?{...e,display:`${t.display} && ${e.display}`,steps:[t,e]}:e}r(P,"makeSelfUpdateCommand");function m(e,t){return{command:e,args:t,display:[e,...t].map(i=>/\s/.test(i)?`"${i}"`:i).join(" ")}}r(m,"makeSelfUpdateCommandStep");function A(){if(E)return"bun-binary";const e=`${$}\0${process.execPath||""}`.toLowerCase().replace(/\\/g,"/");return e.includes("/pnpm/")||e.includes("/.pnpm/")?"pnpm":e.includes("/yarn/")||e.includes("/.yarn/")?"yarn":z||e.includes("/install/global/node_modules/")?"bun":e.includes("/npm/")||e.includes("/node_modules/")?"npm":"unknown"}r(A,"detectInstallMethod");function O(){const e=a(),t=process.platform==="win32"||e.includes("\\")?H:{basename:U,dirname:u},i=t.dirname(e);let n;if(t.basename(i).startsWith("@")&&t.basename(t.dirname(i))==="node_modules"?n=t.dirname(i):t.basename(i)==="node_modules"&&(n=i),!n)return;const s=t.dirname(n);if(t.basename(s)==="lib")return{root:n,prefix:t.dirname(s)}}r(O,"getInferredNpmInstall");function y(e,t,i=t,n){const s=L(i),c=s.packageName===se&&!X(s.installSpec)?[`--${ae}:registry=${pe}/`]:[];switch(e){case"bun-binary":return;case"pnpm":{const p=_("pnpm",["root","-g"])?void 0:/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(a()),f=p?[`--config.global-bin-dir=${process.env.PNPM_HOME||u(u(p[1]))}`]:[];return P(m("pnpm",["install","-g","--ignore-scripts","--config.minimumReleaseAge=0",...f,...c,s.installSpec]),s.packageName===t?void 0:m("pnpm",["remove","-g",...f,t]))}case"yarn":return P(m("yarn",["global","add","--ignore-scripts",...c,s.installSpec]),s.packageName===t?void 0:m("yarn",["global","remove",t]));case"bun":return P(m("bun",["install","-g","--ignore-scripts","--minimum-release-age=0",...c,s.installSpec]),s.packageName===t?void 0:m("bun",["uninstall","-g",t]));case"npm":{const[p="npm",...f]=n??[],l=n?.length?void 0:O(),D=[...f,...l?["--prefix",l.prefix]:[]],j=m(p,[...D,"install","-g","--ignore-scripts","--min-release-age=0",...c,s.installSpec]),W=s.packageName===t?void 0:m(p,[...D,"uninstall","-g",t]);return P(j,W)}case"unknown":return}}r(y,"getSelfUpdateCommandForMethod");function _(e,t,i={}){const n=q(e,t,{encoding:"utf-8",stdio:["ignore","pipe","pipe"]});if(n.status===0)return n.stdout.trim()||void 0;if(i.requireSuccess){const s=n.error?.message||n.stderr.trim()||`exit code ${n.status??"unknown"}`;throw new Error(`Failed to run ${[e,...t].join(" ")}: ${s}`)}}r(_,"readCommandOutput");function Y(e,t,i){switch(e){case"npm":{const n=!!i?.length,[s="npm",...c]=i??[];if(n&&s==="bun"){const l=_(s,[...c,"pm","bin","-g"],{requireSuccess:!0}),D=[o(S(),".bun","install","global","node_modules")];return l&&D.push(o(u(l),"install","global","node_modules")),D}const p=_(s,[...c,"root","-g"],{requireSuccess:n}),f=n?void 0:O();return[p,f?.root].filter(l=>!!l)}case"pnpm":{const n=_("pnpm",["root","-g"]);if(n)return[n,u(n)];const s=/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(a());return s?[s[1]]:[]}case"yarn":{const n=_("yarn",["global","dir"]);return n?[n,o(n,"node_modules")]:[]}case"bun":{const n=_("bun",["pm","bin","-g"]),s=[o(S(),".bun","install","global","node_modules")];return n&&s.push(o(u(n),"install","global","node_modules")),s}case"bun-binary":case"unknown":return[]}}r(Y,"getGlobalPackageRoots");function T(e,t){const i=h(e);if(!g(i))return;let n=i;if(t)try{n=K(i)}catch{return}return process.platform==="win32"&&(n=n.toLowerCase()),n}r(T,"normalizeExistingPathForComparison");function v(e){return Array.from(new Set([T(e,!1),T(e,!0)].filter(t=>!!t)))}r(v,"getPathComparisonCandidates");function Q(){const e=process.argv[1];if(!e)return;let t=u(e);for(;t!==u(t);){if(g(o(t,"package.json")))return t;t=u(t)}}r(Q,"getEntrypointPackageDir");function B(){const e=a();try{return I(e,k.W_OK),I(u(e),k.W_OK),!0}catch{return!1}}r(B,"isSelfUpdatePathWritable");function G(e,t,i){const s=[a(),Q()].filter(c=>!!c).flatMap(c=>v(c));return Y(e,t,i).some(c=>v(c).some(p=>{const f=p.endsWith(w)?p:`${p}${w}`;return s.some(l=>l.startsWith(f))}))}r(G,"isManagedByGlobalPackageManager");function Pe(e,t,i=e){const n=A(),s=y(n,e,i,t);if(!(!s||!G(n,e,t)||!B()))return s}r(Pe,"getSelfUpdateCommand");function Z(e,t,i=e){const n=A(),s=L(i);if(n==="bun-binary")return`Download from: ${b==="pi"?"https://github.com/earendil-works/pi/releases/latest":ue}`;const c=y(n,e,s,t);return c?G(n,e,t)&&!B()?`This installation is managed by a global ${n} install, but the install path is not writable. Update it yourself with: ${c.display}`:`This installation is not managed by a global ${n} install. Update it with the package manager, wrapper, or source checkout that provides it.`:`Update ${s.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`}r(Z,"getSelfUpdateUnavailableInstruction");function Se(e){const t=A(),i=y(t,e);return i?`Run: ${i.display}`:Z(e)}r(Se,"getUpdateInstruction");function ee(e){let t=e;for(;t!==u(t);){if(g(o(t,"package.json"))){const i=u(t);return U(t)==="dist"&&g(o(i,"package.json"))?i:t}t=u(t)}return e}r(ee,"findNodePackageDir");function a(){const e=process.env.PI_PACKAGE_DIR;return e?C(e):E?u(process.execPath):ee($)}r(a,"getPackageDir");function Ae(){if(E)return o(a(),"theme");const e=a(),t=g(o(e,"src"))?"src":"dist";return o(e,t,"modes","interactive","theme")}r(Ae,"getThemesDir");function ye(){if(E)return o(a(),"export-html");const e=a(),t=g(o(e,"src"))?"src":"dist";return o(e,t,"core","export-html")}r(ye,"getExportTemplateDir");function te(){return o(a(),"package.json")}r(te,"getPackageJsonPath");function Ie(){return h(o(a(),"README.md"))}r(Ie,"getReadmePath");function ke(){return h(o(a(),"docs"))}r(ke,"getDocsPath");function ne(){return h(o(a(),"examples"))}r(ne,"getExamplesPath");function Ne(){return h(o(a(),"dal-docs"))}r(Ne,"getDalDocsPath");function Ue(){return h(o(ne(),"extensions","official"))}r(Ue,"getOfficialExtensionsPath");const re="@deepailab/dal-official-extensions";function we(e){try{return JSON.parse(R(N(o(e,"package.json"),"utf-8"))).name===re}catch{return!1}}r(we,"isOfficialExtensionsPackage");function Ce(){return h(o(a(),"CHANGELOG.md"))}r(Ce,"getChangelogPath");function oe(){if(E)return o(a(),"assets");const e=a(),t=g(o(e,"src"))?"src":"dist";return o(e,t,"modes","interactive","assets")}r(oe,"getInteractiveAssetsDir");function Re(e){return o(oe(),e)}r(Re,"getBundledInteractiveAssetPath");let x={};try{x=JSON.parse(R(N(te(),"utf-8")))}catch(e){if(e.code!=="ENOENT")throw e}const M=x.piConfig?.name,$e=x.name||"@earendil-works/pi-coding-agent",b=M||"pi",Le=x.piConfig?.title||(M?b:"\u03C0"),ie=x.piConfig?.configDir||".dal",Oe=b!=="pi",Te=[".agents",".claude"],ve=x.version||"0.0.0",Be=x.piConfig?.upstreamPi,se="@deepailab/dal",ae="@deepailab",ce="DeepAILab-Team/dal-dist",ue=`https://github.com/${ce}/releases`,pe="https://git.siweibot.com/api/packages/gitea/npm",le=`${b.toUpperCase()}_CODING_AGENT_DIR`,Ge=`${b.toUpperCase()}_CODING_AGENT_SESSION_DIR`;function de(e){return C(e)}r(de,"expandTildePath");function Me(e,t=`https://gist.github.com/${e}`){const i=process.env.DAL_SHARE_VIEWER_URL||process.env.PI_SHARE_VIEWER_URL;return i?`${i}#${e}`:t}r(Me,"getShareViewerUrl");function d(){const e=process.env[le];return e?de(e):o(S(),ie,"agent")}r(d,"getAgentDir");function je(){return o(d(),"themes")}r(je,"getCustomThemesDir");function We(){return o(d(),"models.json")}r(We,"getModelsPath");function Fe(){return o(d(),"auth.json")}r(Fe,"getAuthPath");function Ke(){return o(d(),"settings.json")}r(Ke,"getSettingsPath");function He(){return o(d(),"tools")}r(He,"getToolsDir");function Ve(){return o(d(),"bin")}r(Ve,"getBinDir");function qe(){return o(d(),"prompts")}r(qe,"getPromptsDir");function Je(){return o(d(),"sessions")}r(Je,"getSessionsDir");function ze(){return o(d(),`${b}-debug.log`)}r(ze,"getDebugLogPath");export{b as APP_NAME,Le as APP_TITLE,ie as CONFIG_DIR_NAME,ue as DAL_RELEASES_URL,ce as DAL_RELEASE_REPO,se as DAL_UPDATE_PACKAGE,pe as DAL_UPDATE_REGISTRY,ae as DAL_UPDATE_SCOPE,le as ENV_AGENT_DIR,Ge as ENV_SESSION_DIR,Oe as IS_WHITE_LABEL_BUILD,re as OFFICIAL_EXTENSIONS_PACKAGE_NAME,$e as PACKAGE_NAME,Te as SHARED_SKILL_CONFIG_DIRS,Be as UPSTREAM_PI,ve as VERSION,A as detectInstallMethod,de as expandTildePath,ee as findNodePackageDir,d as getAgentDir,Fe as getAuthPath,Ve as getBinDir,Re as getBundledInteractiveAssetPath,Ce as getChangelogPath,je as getCustomThemesDir,Ne as getDalDocsPath,ze as getDebugLogPath,ke as getDocsPath,ne as getExamplesPath,ye as getExportTemplateDir,oe as getInteractiveAssetsDir,We as getModelsPath,Ue as getOfficialExtensionsPath,a as getPackageDir,te as getPackageJsonPath,qe as getPromptsDir,Ie as getReadmePath,Pe as getSelfUpdateCommand,Z as getSelfUpdateUnavailableInstruction,Je as getSessionsDir,Ke as getSettingsPath,Me as getShareViewerUrl,Ae as getThemesDir,He as getToolsDir,Se as getUpdateInstruction,E as isBunBinary,z as isBunRuntime,Ee as isBundledNode,we as isOfficialExtensionsPackage};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { AgentSession } from "./agent-session.ts";
|
|
2
|
+
import type { AgentSessionRuntimeDiagnostic, AgentSessionServices } from "./agent-session-services.ts";
|
|
3
|
+
import type { ProjectTrustContext, ReplacedSessionContext, SessionStartEvent } from "./extensions/index.ts";
|
|
4
|
+
import type { CreateAgentSessionResult } from "./sdk.ts";
|
|
5
|
+
import { SessionManager } from "./session-manager.ts";
|
|
6
|
+
export interface CreateAgentSessionRuntimeResult extends CreateAgentSessionResult {
|
|
7
|
+
services: AgentSessionServices;
|
|
8
|
+
diagnostics: AgentSessionRuntimeDiagnostic[];
|
|
9
|
+
}
|
|
10
|
+
export type CreateAgentSessionRuntimeFactory = (options: {
|
|
11
|
+
cwd: string;
|
|
12
|
+
agentDir: string;
|
|
13
|
+
sessionManager: SessionManager;
|
|
14
|
+
sessionStartEvent?: SessionStartEvent;
|
|
15
|
+
projectTrustContext?: ProjectTrustContext;
|
|
16
|
+
}) => Promise<CreateAgentSessionRuntimeResult>;
|
|
17
|
+
export declare class SessionImportFileNotFoundError extends Error {
|
|
18
|
+
readonly filePath: string;
|
|
19
|
+
constructor(filePath: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class AgentSessionRuntime {
|
|
22
|
+
private rebindSession?;
|
|
23
|
+
private beforeSessionInvalidate?;
|
|
24
|
+
private _session;
|
|
25
|
+
private _services;
|
|
26
|
+
private readonly createRuntime;
|
|
27
|
+
private _diagnostics;
|
|
28
|
+
private _modelFallbackMessage?;
|
|
29
|
+
constructor(_session: AgentSession, _services: AgentSessionServices, createRuntime: CreateAgentSessionRuntimeFactory, _diagnostics?: AgentSessionRuntimeDiagnostic[], _modelFallbackMessage?: string);
|
|
30
|
+
get services(): AgentSessionServices;
|
|
31
|
+
get session(): AgentSession;
|
|
32
|
+
get cwd(): string;
|
|
33
|
+
get diagnostics(): readonly AgentSessionRuntimeDiagnostic[];
|
|
34
|
+
get modelFallbackMessage(): string | undefined;
|
|
35
|
+
setRebindSession(rebindSession?: (session: AgentSession) => Promise<void>): void;
|
|
36
|
+
setBeforeSessionInvalidate(beforeSessionInvalidate?: () => void): void;
|
|
37
|
+
private emitBeforeSwitch;
|
|
38
|
+
private emitBeforeFork;
|
|
39
|
+
private teardownCurrent;
|
|
40
|
+
private apply;
|
|
41
|
+
private finishSessionReplacement;
|
|
42
|
+
switchSession(sessionPath: string, options?: {
|
|
43
|
+
cwdOverride?: string;
|
|
44
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
45
|
+
projectTrustContextFactory?: (cwd: string) => ProjectTrustContext;
|
|
46
|
+
}): Promise<{
|
|
47
|
+
cancelled: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
newSession(options?: {
|
|
50
|
+
parentSession?: string;
|
|
51
|
+
setup?: (sessionManager: SessionManager) => Promise<void>;
|
|
52
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
53
|
+
}): Promise<{
|
|
54
|
+
cancelled: boolean;
|
|
55
|
+
}>;
|
|
56
|
+
fork(entryId: string, options?: {
|
|
57
|
+
position?: "before" | "at";
|
|
58
|
+
withSession?: (ctx: ReplacedSessionContext) => Promise<void>;
|
|
59
|
+
}): Promise<{
|
|
60
|
+
cancelled: boolean;
|
|
61
|
+
selectedText?: string;
|
|
62
|
+
}>;
|
|
63
|
+
importFromJsonl(inputPath: string, cwdOverride?: string): Promise<{
|
|
64
|
+
cancelled: boolean;
|
|
65
|
+
}>;
|
|
66
|
+
dispose(): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
export declare function createAgentSessionRuntime(createRuntime: CreateAgentSessionRuntimeFactory, options: {
|
|
69
|
+
cwd: string;
|
|
70
|
+
agentDir: string;
|
|
71
|
+
sessionManager: SessionManager;
|
|
72
|
+
sessionStartEvent?: SessionStartEvent;
|
|
73
|
+
}): Promise<AgentSessionRuntime>;
|
|
74
|
+
export { type AgentSessionRuntimeDiagnostic, type AgentSessionServices, type CreateAgentSessionFromServicesOptions, type CreateAgentSessionServicesOptions, createAgentSessionFromServices, createAgentSessionServices, } from "./agent-session-services.ts";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import type { Model } from "@earendil-works/pi-ai";
|
|
3
|
+
import type { SessionStartEvent, ToolDefinition } from "./extensions/index.ts";
|
|
4
|
+
import { ModelRuntime } from "./model-runtime.ts";
|
|
5
|
+
import { type DefaultResourceLoaderOptions, type ResourceLoader, type ResourceLoaderReloadOptions } from "./resource-loader.ts";
|
|
6
|
+
import { type CreateAgentSessionOptions, type CreateAgentSessionResult } from "./sdk.ts";
|
|
7
|
+
import type { SessionManager } from "./session-manager.ts";
|
|
8
|
+
import { SettingsManager } from "./settings-manager.ts";
|
|
9
|
+
export interface AgentSessionRuntimeDiagnostic {
|
|
10
|
+
type: "info" | "warning" | "error";
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateAgentSessionServicesOptions {
|
|
14
|
+
cwd: string;
|
|
15
|
+
agentDir?: string;
|
|
16
|
+
settingsManager?: SettingsManager;
|
|
17
|
+
modelRuntime?: ModelRuntime;
|
|
18
|
+
modelRuntimeSignal?: AbortSignal;
|
|
19
|
+
extensionFlagValues?: Map<string, boolean | string>;
|
|
20
|
+
resourceLoaderOptions?: Omit<DefaultResourceLoaderOptions, "cwd" | "agentDir" | "settingsManager">;
|
|
21
|
+
resourceLoaderReloadOptions?: ResourceLoaderReloadOptions;
|
|
22
|
+
}
|
|
23
|
+
export interface CreateAgentSessionFromServicesOptions {
|
|
24
|
+
services: AgentSessionServices;
|
|
25
|
+
sessionManager: SessionManager;
|
|
26
|
+
sessionStartEvent?: SessionStartEvent;
|
|
27
|
+
model?: Model<any>;
|
|
28
|
+
thinkingLevel?: ThinkingLevel;
|
|
29
|
+
scopedModels?: Array<{
|
|
30
|
+
model: Model<any>;
|
|
31
|
+
thinkingLevel?: ThinkingLevel;
|
|
32
|
+
}>;
|
|
33
|
+
tools?: string[];
|
|
34
|
+
excludeTools?: CreateAgentSessionOptions["excludeTools"];
|
|
35
|
+
noTools?: CreateAgentSessionOptions["noTools"];
|
|
36
|
+
customTools?: ToolDefinition[];
|
|
37
|
+
}
|
|
38
|
+
export interface AgentSessionServices {
|
|
39
|
+
cwd: string;
|
|
40
|
+
agentDir: string;
|
|
41
|
+
modelRuntime: ModelRuntime;
|
|
42
|
+
settingsManager: SettingsManager;
|
|
43
|
+
resourceLoader: ResourceLoader;
|
|
44
|
+
diagnostics: AgentSessionRuntimeDiagnostic[];
|
|
45
|
+
}
|
|
46
|
+
export declare const EXTENSION_CATALOG_MAX_STALE_MS: number;
|
|
47
|
+
export declare function createAgentSessionServices(options: CreateAgentSessionServicesOptions): Promise<AgentSessionServices>;
|
|
48
|
+
export declare function createAgentSessionFromServices(options: CreateAgentSessionFromServicesOptions): Promise<CreateAgentSessionResult>;
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import type { Agent, AgentEvent, AgentMessage, AgentState, AgentTool, ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import type { ImageContent, Model, TextContent } from "@earendil-works/pi-ai/compat";
|
|
3
|
+
import { type BashResult } from "./bash-executor.ts";
|
|
4
|
+
import type { CacheWarmer, CacheWarmingStatus } from "./cache-warmer.ts";
|
|
5
|
+
import { type CompactionResult } from "./compaction/index.ts";
|
|
6
|
+
import { type ContextUsage, type ExtensionCommandContextActions, type ExtensionErrorListener, type ExtensionMode, ExtensionRunner, type ExtensionUIContext, type InputSource, type ReplacedSessionContext, type SessionStartEvent, type ShutdownHandler, type ToolDefinition, type ToolInfo } from "./extensions/index.ts";
|
|
7
|
+
import { type CustomMessage } from "./messages.ts";
|
|
8
|
+
import type { ModelRuntime } from "./model-runtime.ts";
|
|
9
|
+
import { type PromptTemplate } from "./prompt-templates.ts";
|
|
10
|
+
import type { ResourceLoader } from "./resource-loader.ts";
|
|
11
|
+
import { type BranchSummaryEntry, type SessionEntry, SessionManager } from "./session-manager.ts";
|
|
12
|
+
import type { CacheWarmingMode, SettingsManager } from "./settings-manager.ts";
|
|
13
|
+
import { type BashOperations } from "./tools/bash.ts";
|
|
14
|
+
export interface ParsedSkillBlock {
|
|
15
|
+
name: string;
|
|
16
|
+
location: string;
|
|
17
|
+
content: string;
|
|
18
|
+
userMessage: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare function parseSkillBlock(text: string): ParsedSkillBlock | null;
|
|
21
|
+
export type AgentSessionEvent = Exclude<AgentEvent, {
|
|
22
|
+
type: "agent_end";
|
|
23
|
+
}> | {
|
|
24
|
+
type: "agent_end";
|
|
25
|
+
messages: AgentMessage[];
|
|
26
|
+
willRetry: boolean;
|
|
27
|
+
} | {
|
|
28
|
+
type: "agent_settled";
|
|
29
|
+
} | {
|
|
30
|
+
type: "queue_update";
|
|
31
|
+
steering: readonly string[];
|
|
32
|
+
followUp: readonly string[];
|
|
33
|
+
} | {
|
|
34
|
+
type: "compaction_start";
|
|
35
|
+
reason: "manual" | "threshold" | "overflow";
|
|
36
|
+
} | {
|
|
37
|
+
type: "entry_appended";
|
|
38
|
+
entry: SessionEntry;
|
|
39
|
+
} | {
|
|
40
|
+
type: "session_info_changed";
|
|
41
|
+
name: string | undefined;
|
|
42
|
+
} | {
|
|
43
|
+
type: "thinking_level_changed";
|
|
44
|
+
level: ThinkingLevel;
|
|
45
|
+
} | {
|
|
46
|
+
type: "compaction_end";
|
|
47
|
+
reason: "manual" | "threshold" | "overflow";
|
|
48
|
+
result: CompactionResult | undefined;
|
|
49
|
+
aborted: boolean;
|
|
50
|
+
willRetry: boolean;
|
|
51
|
+
errorMessage?: string;
|
|
52
|
+
} | {
|
|
53
|
+
type: "auto_retry_start";
|
|
54
|
+
attempt: number;
|
|
55
|
+
maxAttempts: number;
|
|
56
|
+
delayMs: number;
|
|
57
|
+
errorMessage: string;
|
|
58
|
+
} | {
|
|
59
|
+
type: "auto_retry_end";
|
|
60
|
+
success: boolean;
|
|
61
|
+
attempt: number;
|
|
62
|
+
finalError?: string;
|
|
63
|
+
} | {
|
|
64
|
+
type: "summarization_retry_scheduled";
|
|
65
|
+
attempt: number;
|
|
66
|
+
maxAttempts: number;
|
|
67
|
+
delayMs: number;
|
|
68
|
+
errorMessage: string;
|
|
69
|
+
} | {
|
|
70
|
+
type: "summarization_retry_attempt_start";
|
|
71
|
+
source: "branchSummary";
|
|
72
|
+
} | {
|
|
73
|
+
type: "summarization_retry_attempt_start";
|
|
74
|
+
source: "compaction";
|
|
75
|
+
reason: "manual" | "threshold" | "overflow";
|
|
76
|
+
} | {
|
|
77
|
+
type: "summarization_retry_finished";
|
|
78
|
+
} | {
|
|
79
|
+
type: "bash_execution_update";
|
|
80
|
+
id?: string;
|
|
81
|
+
delta: string;
|
|
82
|
+
};
|
|
83
|
+
export type AgentSessionEventListener = (event: AgentSessionEvent) => void;
|
|
84
|
+
export interface AgentSessionConfig {
|
|
85
|
+
agent: Agent;
|
|
86
|
+
sessionManager: SessionManager;
|
|
87
|
+
settingsManager: SettingsManager;
|
|
88
|
+
cwd: string;
|
|
89
|
+
scopedModels?: Array<{
|
|
90
|
+
model: Model<any>;
|
|
91
|
+
thinkingLevel?: ThinkingLevel;
|
|
92
|
+
}>;
|
|
93
|
+
resourceLoader: ResourceLoader;
|
|
94
|
+
customTools?: ToolDefinition[];
|
|
95
|
+
modelRuntime: ModelRuntime;
|
|
96
|
+
cacheWarmer?: Pick<CacheWarmer, "cancel" | "status" | "onAgentSettled" | "onModeChanged" | "onWarmed">;
|
|
97
|
+
initialActiveToolNames?: string[];
|
|
98
|
+
allowedToolNames?: string[];
|
|
99
|
+
excludedToolNames?: string[];
|
|
100
|
+
baseToolsOverride?: Record<string, AgentTool>;
|
|
101
|
+
extensionRunnerRef?: {
|
|
102
|
+
current?: ExtensionRunner;
|
|
103
|
+
};
|
|
104
|
+
sessionStartEvent?: SessionStartEvent;
|
|
105
|
+
desiredModel?: {
|
|
106
|
+
provider: string;
|
|
107
|
+
modelId: string;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export interface ExtensionBindings {
|
|
111
|
+
uiContext?: ExtensionUIContext;
|
|
112
|
+
mode?: ExtensionMode;
|
|
113
|
+
commandContextActions?: ExtensionCommandContextActions;
|
|
114
|
+
abortHandler?: () => void;
|
|
115
|
+
shutdownHandler?: ShutdownHandler;
|
|
116
|
+
onError?: ExtensionErrorListener;
|
|
117
|
+
}
|
|
118
|
+
export interface PromptOptions {
|
|
119
|
+
expandPromptTemplates?: boolean;
|
|
120
|
+
images?: ImageContent[];
|
|
121
|
+
streamingBehavior?: "steer" | "followUp";
|
|
122
|
+
source?: InputSource;
|
|
123
|
+
preflightResult?: (success: boolean) => void;
|
|
124
|
+
}
|
|
125
|
+
export interface ModelMutationOptions {
|
|
126
|
+
persist?: boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface ModelCycleResult {
|
|
129
|
+
model: Model<any>;
|
|
130
|
+
thinkingLevel: ThinkingLevel;
|
|
131
|
+
isScoped: boolean;
|
|
132
|
+
}
|
|
133
|
+
export interface SessionStats {
|
|
134
|
+
sessionFile: string | undefined;
|
|
135
|
+
sessionId: string;
|
|
136
|
+
userMessages: number;
|
|
137
|
+
assistantMessages: number;
|
|
138
|
+
toolCalls: number;
|
|
139
|
+
toolResults: number;
|
|
140
|
+
totalMessages: number;
|
|
141
|
+
tokens: {
|
|
142
|
+
input: number;
|
|
143
|
+
output: number;
|
|
144
|
+
cacheRead: number;
|
|
145
|
+
cacheWrite: number;
|
|
146
|
+
total: number;
|
|
147
|
+
};
|
|
148
|
+
cost: number;
|
|
149
|
+
contextUsage?: ContextUsage;
|
|
150
|
+
}
|
|
151
|
+
export declare class AgentSession {
|
|
152
|
+
readonly agent: Agent;
|
|
153
|
+
readonly sessionManager: SessionManager;
|
|
154
|
+
readonly settingsManager: SettingsManager;
|
|
155
|
+
private _scopedModels;
|
|
156
|
+
private _unsubscribeAgent?;
|
|
157
|
+
private _eventListeners;
|
|
158
|
+
private _isAgentRunActive;
|
|
159
|
+
private _agentRunAbortRequested;
|
|
160
|
+
private _idleWaitPromise;
|
|
161
|
+
private _resolveIdleWait;
|
|
162
|
+
private _steeringMessages;
|
|
163
|
+
private _followUpMessages;
|
|
164
|
+
private _pendingNextTurnMessages;
|
|
165
|
+
private _pendingCustomMessages;
|
|
166
|
+
private _compactionAbortController;
|
|
167
|
+
private _autoCompactionAbortController;
|
|
168
|
+
private _overflowRecoveryAttempted;
|
|
169
|
+
private _branchSummaryAbortController;
|
|
170
|
+
private _retryAbortController;
|
|
171
|
+
private _retryAttempt;
|
|
172
|
+
private readonly _bashAbortControllers;
|
|
173
|
+
private _pendingBashMessages;
|
|
174
|
+
private _extensionRunner;
|
|
175
|
+
private _turnIndex;
|
|
176
|
+
private readonly _entryIdsByMessage;
|
|
177
|
+
private readonly _boundaryDispatchedMessages;
|
|
178
|
+
private _lastAssistantMessage;
|
|
179
|
+
private _lastAssistantToolResults;
|
|
180
|
+
private _lastActivityOutcome;
|
|
181
|
+
private _isBeforeSettle;
|
|
182
|
+
private _abortDuringBeforeSettle;
|
|
183
|
+
private _isEmittingAgentSettled;
|
|
184
|
+
private readonly _deferredSettledActions;
|
|
185
|
+
private _resourceLoader;
|
|
186
|
+
private _customTools;
|
|
187
|
+
private _baseToolDefinitions;
|
|
188
|
+
private _cwd;
|
|
189
|
+
private _extensionRunnerRef?;
|
|
190
|
+
private _initialActiveToolNames?;
|
|
191
|
+
private _allowedToolNames?;
|
|
192
|
+
private _excludedToolNames?;
|
|
193
|
+
private _baseToolsOverride?;
|
|
194
|
+
private _sessionStartEvent;
|
|
195
|
+
private _extensionUIContext?;
|
|
196
|
+
private _extensionMode;
|
|
197
|
+
private _extensionCommandContextActions?;
|
|
198
|
+
private _extensionAbortHandler?;
|
|
199
|
+
private _extensionShutdownHandler?;
|
|
200
|
+
private _extensionErrorListener?;
|
|
201
|
+
private _extensionErrorUnsubscriber?;
|
|
202
|
+
private _modelRuntime;
|
|
203
|
+
private _desiredModel?;
|
|
204
|
+
private _cacheWarmer?;
|
|
205
|
+
private _toolRegistry;
|
|
206
|
+
private _toolDefinitions;
|
|
207
|
+
private _toolPromptSnippets;
|
|
208
|
+
private _toolPromptGuidelines;
|
|
209
|
+
private _baseSystemPromptOptions;
|
|
210
|
+
private _runSystemPromptOptions?;
|
|
211
|
+
constructor(config: AgentSessionConfig);
|
|
212
|
+
get modelRuntime(): ModelRuntime;
|
|
213
|
+
private _getRequiredRequestAuth;
|
|
214
|
+
private _getSummarizationRequestAuth;
|
|
215
|
+
private _installAgentToolHooks;
|
|
216
|
+
private _compactBeforeNextAssistantResponse;
|
|
217
|
+
private _installAgentRequestProjection;
|
|
218
|
+
private _dispatchTurnEndBoundary;
|
|
219
|
+
private _installAgentBoundaryHooks;
|
|
220
|
+
private _installAgentNextTurnRefresh;
|
|
221
|
+
private _refreshFinalizedContext;
|
|
222
|
+
private _applyBoundaryDrafts;
|
|
223
|
+
private _createBoundaryPreviewManager;
|
|
224
|
+
private _getPendingBoundaryMessages;
|
|
225
|
+
private _buildBoundaryContext;
|
|
226
|
+
private _commitBoundaryDrafts;
|
|
227
|
+
private _reportInvalidBoundaryContinuation;
|
|
228
|
+
private _emit;
|
|
229
|
+
private _emitQueueUpdate;
|
|
230
|
+
private _emitSessionCompactFailed;
|
|
231
|
+
private _getIdleWaitPromise;
|
|
232
|
+
private _resolveIdleWaitIfIdle;
|
|
233
|
+
private _emitAgentSettled;
|
|
234
|
+
private _handleAgentEvent;
|
|
235
|
+
private _willRetryAfterAgentEnd;
|
|
236
|
+
private _findPersistedMessageEntryId;
|
|
237
|
+
private _omitRecoveryAttempt;
|
|
238
|
+
private _findLastAssistantMessage;
|
|
239
|
+
private _replaceMessageInPlace;
|
|
240
|
+
private _emitExtensionEvent;
|
|
241
|
+
subscribe(listener: AgentSessionEventListener): () => void;
|
|
242
|
+
private _disconnectFromAgent;
|
|
243
|
+
dispose(): void;
|
|
244
|
+
refreshContext(): void;
|
|
245
|
+
get state(): AgentState;
|
|
246
|
+
get cacheWarmingStatus(): CacheWarmingStatus | undefined;
|
|
247
|
+
setCacheWarmingMode(mode: CacheWarmingMode): void;
|
|
248
|
+
get model(): Model<any> | undefined;
|
|
249
|
+
get thinkingLevel(): ThinkingLevel;
|
|
250
|
+
get isStreaming(): boolean;
|
|
251
|
+
get isIdle(): boolean;
|
|
252
|
+
get systemPrompt(): string;
|
|
253
|
+
get retryAttempt(): number;
|
|
254
|
+
getActiveToolNames(): string[];
|
|
255
|
+
isToolAllowed(name: string): boolean;
|
|
256
|
+
getToolAllowlist(): string[] | undefined;
|
|
257
|
+
getAllTools(): ToolInfo[];
|
|
258
|
+
getToolDefinition(name: string): ToolDefinition | undefined;
|
|
259
|
+
setActiveToolsByName(toolNames: string[]): void;
|
|
260
|
+
get isCompacting(): boolean;
|
|
261
|
+
get messages(): AgentMessage[];
|
|
262
|
+
get steeringMode(): "all" | "one-at-a-time";
|
|
263
|
+
get followUpMode(): "all" | "one-at-a-time";
|
|
264
|
+
get sessionFile(): string | undefined;
|
|
265
|
+
get sessionId(): string;
|
|
266
|
+
get sessionName(): string | undefined;
|
|
267
|
+
get scopedModels(): ReadonlyArray<{
|
|
268
|
+
model: Model<any>;
|
|
269
|
+
thinkingLevel?: ThinkingLevel;
|
|
270
|
+
}>;
|
|
271
|
+
setScopedModels(scopedModels: Array<{
|
|
272
|
+
model: Model<any>;
|
|
273
|
+
thinkingLevel?: ThinkingLevel;
|
|
274
|
+
}>): void;
|
|
275
|
+
get promptTemplates(): ReadonlyArray<PromptTemplate>;
|
|
276
|
+
private _normalizePromptSnippet;
|
|
277
|
+
private _normalizePromptGuidelines;
|
|
278
|
+
private _rebuildSystemPrompt;
|
|
279
|
+
private _preparePromptAndToolLoadout;
|
|
280
|
+
private _installAgentForcedPromptProjection;
|
|
281
|
+
private _restoreToolsFromTranscript;
|
|
282
|
+
private _runAgentPrompt;
|
|
283
|
+
private _handlePostAgentRun;
|
|
284
|
+
private _runBeforeSettleBoundary;
|
|
285
|
+
private _runInputHandlers;
|
|
286
|
+
private _normalizePromptImages;
|
|
287
|
+
prompt(text: string, options?: PromptOptions): Promise<void>;
|
|
288
|
+
private _tryExecuteExtensionCommand;
|
|
289
|
+
private _expandSkillCommand;
|
|
290
|
+
private _queueUserInput;
|
|
291
|
+
steer(text: string, images?: ImageContent[], options?: {
|
|
292
|
+
source?: InputSource;
|
|
293
|
+
}): Promise<void>;
|
|
294
|
+
followUp(text: string, images?: ImageContent[], options?: {
|
|
295
|
+
source?: InputSource;
|
|
296
|
+
}): Promise<void>;
|
|
297
|
+
private _queueSteer;
|
|
298
|
+
private _queueFollowUp;
|
|
299
|
+
private _throwIfExtensionCommand;
|
|
300
|
+
sendCustomMessage<T = unknown>(message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details">, options?: {
|
|
301
|
+
triggerTurn?: boolean;
|
|
302
|
+
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
303
|
+
}): Promise<void>;
|
|
304
|
+
private _appendCustomMessage;
|
|
305
|
+
private _flushPendingCustomMessages;
|
|
306
|
+
sendUserMessage(content: string | (TextContent | ImageContent)[], options?: {
|
|
307
|
+
deliverAs?: "steer" | "followUp";
|
|
308
|
+
expandPromptTemplates?: boolean;
|
|
309
|
+
}): Promise<void>;
|
|
310
|
+
clearQueue(): {
|
|
311
|
+
steering: string[];
|
|
312
|
+
followUp: string[];
|
|
313
|
+
};
|
|
314
|
+
get pendingMessageCount(): number;
|
|
315
|
+
getSteeringMessages(): readonly string[];
|
|
316
|
+
getFollowUpMessages(): readonly string[];
|
|
317
|
+
get resourceLoader(): ResourceLoader;
|
|
318
|
+
abort(): Promise<void>;
|
|
319
|
+
waitForIdle(): Promise<void>;
|
|
320
|
+
emitProviderAuthenticated(providerId: string, authType: "oauth" | "api_key"): Promise<void>;
|
|
321
|
+
private _emitModelSelect;
|
|
322
|
+
private _reconcileDesiredModel;
|
|
323
|
+
setModel(model: Model<any>, options?: ModelMutationOptions): Promise<void>;
|
|
324
|
+
private _addPersistedDefaultToNonEmptyScope;
|
|
325
|
+
cycleModel(direction?: "forward" | "backward", options?: ModelMutationOptions): Promise<ModelCycleResult | undefined>;
|
|
326
|
+
private _cycleScopedModel;
|
|
327
|
+
private _cycleAvailableModel;
|
|
328
|
+
setThinkingLevel(level: ThinkingLevel, options?: ModelMutationOptions): void;
|
|
329
|
+
cycleThinkingLevel(options?: ModelMutationOptions): ThinkingLevel | undefined;
|
|
330
|
+
getAvailableThinkingLevels(): ThinkingLevel[];
|
|
331
|
+
supportsThinking(): boolean;
|
|
332
|
+
getThinkingLevelForModel(model: Model<any>): ThinkingLevel;
|
|
333
|
+
private _getThinkingLevelForModelSwitch;
|
|
334
|
+
private _clampThinkingLevel;
|
|
335
|
+
private syncQueueModesFromSettings;
|
|
336
|
+
setSteeringMode(mode: "all" | "one-at-a-time"): void;
|
|
337
|
+
setFollowUpMode(mode: "all" | "one-at-a-time"): void;
|
|
338
|
+
private _runDefaultCompaction;
|
|
339
|
+
private _clearManualCompactionState;
|
|
340
|
+
compact(customInstructions?: string): Promise<CompactionResult>;
|
|
341
|
+
abortCompaction(): void;
|
|
342
|
+
abortBranchSummary(): void;
|
|
343
|
+
private _checkCompaction;
|
|
344
|
+
private _runAutoCompaction;
|
|
345
|
+
setAutoCompactionEnabled(enabled: boolean): void;
|
|
346
|
+
get autoCompactionEnabled(): boolean;
|
|
347
|
+
bindExtensions(bindings: ExtensionBindings): Promise<void>;
|
|
348
|
+
private extendResourcesFromExtensions;
|
|
349
|
+
private buildExtensionResourcePaths;
|
|
350
|
+
private getExtensionSourceLabel;
|
|
351
|
+
private _applyExtensionBindings;
|
|
352
|
+
private _refreshCurrentModelFromRegistry;
|
|
353
|
+
private _bindExtensionCore;
|
|
354
|
+
private _refreshToolRegistry;
|
|
355
|
+
private _buildRuntime;
|
|
356
|
+
reload(options?: {
|
|
357
|
+
beforeSessionStart?: () => void | Promise<void>;
|
|
358
|
+
}): Promise<void>;
|
|
359
|
+
private _isRetryableError;
|
|
360
|
+
private _summarizationRetryCallbacks;
|
|
361
|
+
private _finishCancelledRetry;
|
|
362
|
+
private _prepareRetry;
|
|
363
|
+
abortRetry(): void;
|
|
364
|
+
get isRetrying(): boolean;
|
|
365
|
+
get autoRetryEnabled(): boolean;
|
|
366
|
+
setAutoRetryEnabled(enabled: boolean): void;
|
|
367
|
+
executeBash(command: string, onChunk?: (chunk: string) => void, options?: {
|
|
368
|
+
excludeFromContext?: boolean;
|
|
369
|
+
id?: string;
|
|
370
|
+
operations?: BashOperations;
|
|
371
|
+
}): Promise<BashResult>;
|
|
372
|
+
recordBashResult(command: string, result: BashResult, options?: {
|
|
373
|
+
excludeFromContext?: boolean;
|
|
374
|
+
}): void;
|
|
375
|
+
abortBash(): void;
|
|
376
|
+
get isBashRunning(): boolean;
|
|
377
|
+
get hasPendingBashMessages(): boolean;
|
|
378
|
+
private _flushPendingBashMessages;
|
|
379
|
+
setSessionName(name: string): void;
|
|
380
|
+
navigateTree(targetId: string, options?: {
|
|
381
|
+
summarize?: boolean;
|
|
382
|
+
customInstructions?: string;
|
|
383
|
+
replaceInstructions?: boolean;
|
|
384
|
+
label?: string;
|
|
385
|
+
}): Promise<{
|
|
386
|
+
editorText?: string;
|
|
387
|
+
cancelled: boolean;
|
|
388
|
+
aborted?: boolean;
|
|
389
|
+
summaryEntry?: BranchSummaryEntry;
|
|
390
|
+
}>;
|
|
391
|
+
getUserMessagesForForking(): Array<{
|
|
392
|
+
entryId: string;
|
|
393
|
+
text: string;
|
|
394
|
+
}>;
|
|
395
|
+
getSessionStats(): SessionStats;
|
|
396
|
+
getContextUsage(): ContextUsage | undefined;
|
|
397
|
+
exportToHtml(outputPath?: string, options?: {
|
|
398
|
+
themeName?: string;
|
|
399
|
+
}): Promise<string>;
|
|
400
|
+
exportToJsonl(outputPath?: string): string;
|
|
401
|
+
summarizeForBugReport(options: {
|
|
402
|
+
hint?: string;
|
|
403
|
+
signal: AbortSignal;
|
|
404
|
+
}): Promise<string>;
|
|
405
|
+
getLastAssistantText(): string | undefined;
|
|
406
|
+
createReplacedSessionContext(): ReplacedSessionContext;
|
|
407
|
+
hasExtensionHandlers(eventType: string): boolean;
|
|
408
|
+
get extensionRunner(): ExtensionRunner;
|
|
409
|
+
}
|