dal-code 1.0.45 → 1.0.46
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 +76 -0
- package/NOTICE +49 -1
- package/dist/bun/register-bedrock.js +1 -0
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-check.js +1 -1
- package/dist/cli/auth-command.js +6 -5
- package/dist/cli/experimental/auth.js +1 -0
- package/dist/cli/experimental/cli.js +1 -0
- package/dist/cli/experimental/command-options.js +1 -0
- package/dist/cli/experimental/command.js +1 -0
- package/dist/cli/experimental/commands/client.js +1 -0
- package/dist/cli/experimental/commands/pi.js +1 -0
- package/dist/cli/experimental/commands/server.js +1 -0
- package/dist/cli/experimental/transport-address.js +1 -0
- package/dist/cli/list-models.js +2 -2
- package/dist/cli/piped-stdin.js +2 -0
- package/dist/cli/startup-diagnostics.js +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/remote-session.js +1 -0
- package/dist/client/transcript.js +1 -0
- package/dist/core/agent-log.d.ts +6 -0
- package/dist/core/agent-log.js +3 -0
- package/dist/core/agent-session-services.d.ts +0 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session.d.ts +19 -2
- package/dist/core/agent-session.js +8 -8
- package/dist/core/client-identity.js +1 -0
- package/dist/core/compaction/branch-summarization.js +3 -3
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.js +11 -9
- package/dist/core/compaction-backoff.js +1 -0
- package/dist/core/dal-session-headers.js +1 -0
- package/dist/core/export-html/index.js +2 -2
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +6 -6
- package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +30 -29
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/runner.d.ts +6 -0
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/types.d.ts +1 -0
- package/dist/core/extensions/virtual-modules.js +1 -1
- package/dist/core/http-dispatcher.js +1 -1
- package/dist/core/model-config.d.ts +984 -0
- package/dist/core/model-config.js +5 -5
- package/dist/core/model-identity.js +2 -0
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.js +2 -2
- package/dist/core/package-manager.d.ts +2 -0
- package/dist/core/package-manager.js +2 -2
- package/dist/core/provider-attribution.js +1 -1
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.js +1 -1
- package/dist/core/sandbox/bwrap-placeholders.js +1 -1
- package/dist/core/sandbox/index.d.ts +1 -1
- package/dist/core/sandbox/index.js +1 -1
- package/dist/core/sandbox/policy.d.ts +4 -0
- package/dist/core/sandbox/policy.js +1 -1
- package/dist/core/sandbox/runtime.d.ts +2 -0
- package/dist/core/sandbox/runtime.js +1 -1
- package/dist/core/sandbox/shell-sandbox.d.ts +2 -0
- package/dist/core/sandbox/shell-sandbox.js +6 -6
- package/dist/core/sdk.js +1 -1
- package/dist/core/session-stall-monitor.d.ts +41 -0
- package/dist/core/session-stall-monitor.js +2 -0
- package/dist/core/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/settings-schema.d.ts +2 -0
- package/dist/core/settings-schema.js +1 -1
- package/dist/core/stall-watchdog.d.ts +55 -0
- package/dist/core/stall-watchdog.js +1 -0
- package/dist/core/system-prompt.js +10 -10
- package/dist/core/tools/bash.d.ts +1 -0
- package/dist/core/tools/bash.js +14 -14
- package/dist/core/tools/edit.d.ts +1 -1
- package/dist/core/tools/edit.js +3 -3
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/path-utils.d.ts +1 -0
- package/dist/core/tools/path-utils.js +1 -1
- package/dist/dal/builtins.js +2 -2
- package/dist/dal/manifest.d.ts +1 -0
- package/dist/dal/manifest.js +1 -1
- package/dist/dal/safety-net.js +3 -1
- package/dist/extensions/codemode/execute.js +22 -16
- package/dist/extensions/mcp/config.js +2 -2
- package/dist/extensions/mcp/oauth.js +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/main.js +4 -4
- package/dist/migrations.js +3 -5
- package/dist/modes/interactive/components/daxnuts.js +1 -0
- package/dist/modes/interactive/external-editor.js +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +7 -7
- package/dist/modes/interactive/interactive-mode.js +25 -25
- package/dist/modes/interactive/session-share.js +1 -1
- package/dist/modes/interactive/theme/theme-json.js +12 -0
- package/dist/modes/interactive/theme/theme-schema.json +356 -0
- package/dist/modes/print-mode.d.ts +1 -0
- package/dist/modes/print-mode.js +8 -7
- package/dist/modes/rpc/rpc-client.js +3 -3
- package/dist/modes/rpc/rpc-mode.js +1 -1
- package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-awake/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-capabilities/src/catalogue.js +1 -1
- package/dist/node_modules/@dalcode/dal-capabilities/src/index.js +10 -10
- package/dist/node_modules/@dalcode/dal-capabilities/src/match.js +1 -1
- package/dist/node_modules/@dalcode/dal-capabilities/src/state.js +3 -3
- package/dist/node_modules/@dalcode/dal-codeindex/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-codeindex/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-compat/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-dap/src/install.js +2 -2
- package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-goal/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-guard/package.json +5 -4
- package/dist/node_modules/@dalcode/dal-guard/src/credentials.js +7 -1
- package/dist/node_modules/@dalcode/dal-guard/src/edit-anchor-core.js +25 -23
- package/dist/node_modules/@dalcode/dal-guard/src/edit-anchor.js +4 -4
- package/dist/node_modules/@dalcode/dal-guard/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-guard/src/policy.js +1 -1
- package/dist/node_modules/@dalcode/dal-guard/src/session-files.js +1 -0
- package/dist/node_modules/@dalcode/dal-guard/src/suspicion.js +1 -0
- package/dist/node_modules/@dalcode/dal-guard/src/workspace.js +2 -2
- package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-learn/package.json +4 -2
- package/dist/node_modules/@dalcode/dal-learn/src/engine.js +4 -4
- package/dist/node_modules/@dalcode/dal-learn/src/index.js +15 -14
- package/dist/node_modules/@dalcode/dal-learn/src/revisions.js +3 -0
- package/dist/node_modules/@dalcode/dal-learn/src/safety.js +1 -1
- package/dist/node_modules/@dalcode/dal-learn/src/skill-evolution.js +14 -14
- package/dist/node_modules/@dalcode/dal-lsp/package.json +5 -3
- package/dist/node_modules/@dalcode/dal-lsp/src/config.js +1 -1
- package/dist/node_modules/@dalcode/dal-lsp/src/index.js +14 -13
- package/dist/node_modules/@dalcode/dal-lsp/src/managed.js +1 -0
- package/dist/node_modules/@dalcode/dal-mcp/package.json +7 -6
- package/dist/node_modules/@dalcode/dal-mcp/src/child-env.js +3 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.d.ts +1 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.js +3 -3
- package/dist/node_modules/@dalcode/dal-office/package.json +3 -2
- package/dist/node_modules/@dalcode/dal-office/src/extract/cell.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/extract/index.js +2 -2
- package/dist/node_modules/@dalcode/dal-office/src/extract/ooxml.js +4 -4
- package/dist/node_modules/@dalcode/dal-office/src/extract/pdf.js +4 -4
- package/dist/node_modules/@dalcode/dal-office/src/facts.d.ts +15 -0
- package/dist/node_modules/@dalcode/dal-office/src/facts.js +4 -0
- package/dist/node_modules/@dalcode/dal-office/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/lazy.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/{index.d.ts → office.d.ts} +2 -3
- package/dist/node_modules/@dalcode/dal-office/src/office.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/capture.d.ts +21 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/capture.js +13 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/chart.d.ts +15 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/chart.js +3 -3
- package/dist/node_modules/@dalcode/dal-office/src/render/docx.d.ts +4 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/docx.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/render/pptx.d.ts +2 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/pptx.js +4 -3
- package/dist/node_modules/@dalcode/dal-office/src/render/table-layout.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx-chart.d.ts +24 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx-chart.js +1 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx.d.ts +9 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/scratchpad.d.ts +2 -0
- package/dist/node_modules/@dalcode/dal-office/src/scratchpad.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/table-stats.js +2 -0
- package/dist/node_modules/@dalcode/dal-office/src/tools/chart-generate.js +4 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/doc-generate.js +2 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/docx-edit.js +5 -5
- package/dist/node_modules/@dalcode/dal-office/src/tools/drawio-generate.js +2 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/md-generate.js +2 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/ppt-generate.js +5 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/ppt-plan.js +4 -2
- package/dist/node_modules/@dalcode/dal-office/src/tools/pptx-edit.js +5 -5
- package/dist/node_modules/@dalcode/dal-office/src/tools/read-file.js +4 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/render-page.js +4 -0
- package/dist/node_modules/@dalcode/dal-office/src/tools/sheet-generate.js +3 -3
- package/dist/node_modules/@dalcode/dal-office/src/tools/xlsx-edit.js +3 -3
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +15 -15
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/project-size.js +1 -0
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +15 -15
- package/dist/node_modules/@dalcode/dal-pi-kit/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/project-size.js +1 -0
- package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -5
- package/dist/node_modules/@dalcode/dal-plugins/src/index.js +11 -11
- package/dist/node_modules/@dalcode/dal-plugins/src/manage.js +7 -7
- package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-recall/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-remote/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-rewind/src/commands.js +1 -1
- package/dist/node_modules/@dalcode/dal-rewind/src/core.d.ts +2 -0
- package/dist/node_modules/@dalcode/dal-rewind/src/core.js +6 -6
- package/dist/node_modules/@dalcode/dal-rewind/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-rewind/src/state.js +1 -1
- package/dist/node_modules/@dalcode/dal-router/package.json +8 -9
- package/dist/node_modules/@dalcode/dal-router/src/commands.js +8 -9
- package/dist/node_modules/@dalcode/dal-router/src/config.d.ts +3 -36
- package/dist/node_modules/@dalcode/dal-router/src/config.js +2 -2
- package/dist/node_modules/@dalcode/dal-router/src/index.js +2 -4
- package/dist/node_modules/@dalcode/dal-router/src/notice.js +1 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/deliverables.js +4 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/index.js +10 -8
- package/dist/node_modules/@dalcode/dal-router/src/roles/planner.js +4 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/prompts.js +18 -16
- package/dist/node_modules/@dalcode/dal-router/src/roles/signals.js +2 -2
- package/dist/node_modules/@dalcode/dal-router/src/runtime.d.ts +0 -13
- package/dist/node_modules/@dalcode/dal-router/src/runtime.js +1 -1
- package/dist/node_modules/@dalcode/dal-router/src/subagent.js +1 -1
- package/dist/node_modules/@dalcode/dal-router/src/task-shape.d.ts +8 -0
- package/dist/node_modules/@dalcode/dal-router/src/task-shape.js +1 -0
- package/dist/node_modules/@dalcode/dal-rtk/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-skills/package.json +4 -3
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/chart-design/SKILL.md +35 -0
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/dal-slides/SKILL.md +17 -9
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/diagram-design/SKILL.md +7 -5
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/poster-design/SKILL.md +8 -6
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/print-design/SKILL.md +21 -8
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/diagram.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/mindmap.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/event-poster.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/poster.css +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/square-card.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/wechat-cover.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/xhs-card.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/posters/xhs-cover.html +8 -5
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/letter.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/report.html +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/visual-kit/print/resume.html +7 -3
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/web-design/SKILL.md +4 -4
- package/dist/node_modules/@dalcode/dal-skills/src/bundled.js +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/catalog.js +3 -2
- package/dist/node_modules/@dalcode/dal-skills/src/hint.js +1 -0
- package/dist/node_modules/@dalcode/dal-skills/src/index.js +13 -14
- package/dist/node_modules/@dalcode/dal-skills/src/search.js +1 -1
- package/dist/node_modules/@dalcode/dal-statusline/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-structured/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-subagent/src/background.js +10 -10
- package/dist/node_modules/@dalcode/dal-subagent/src/index.js +18 -20
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-terminal/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-tool-catalog/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-usage/package.json +2 -2
- 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/announce-check.js +3 -1
- package/dist/node_modules/@dalcode/dal-workflow/src/deliverable-scope.js +1 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-workflow/src/test-proof-note.js +3 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/todo-snapshot.js +2 -2
- package/dist/node_modules/@dalcode/dal-workflow/src/todo.js +4 -4
- package/dist/node_modules/@dalcode/dal-workflow/src/truncation-check.js +1 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/working-contract.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/@earendil-works/pi-agent-core/README.md +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +2 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +3 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent.js +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +37 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +104 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js +16 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +10 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +17 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/bash.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/bounded.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/chord.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/context.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/harness.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/hooks.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/jsonl.js +4 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/collapse.js +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/entries.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/frames.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/generation.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/job.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/plugin.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/post-tools.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/task-api.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/kinds/tool.js +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/membrane.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/memory.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/scheduler.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/session.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/system.js +8 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/pico3/view.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js +3 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js +8 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.js +0 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +10 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js +2 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +12 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit-diff.js +16 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/image.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/index.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +14 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/tool-context.js +0 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +5 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/node.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/search/index.js +0 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/README.md +78 -3
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +5 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/classifier-shared.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts +6 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/llama-cpp-classify.js +5 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +6 -6
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +5 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +10 -5
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +3 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +4 -4
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/system-one-shared.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/typesafe-system-one.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/auth/oauth/oauth-page.js +74 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/cli.js +0 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/images-models.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +180 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +1 -1
- 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/cloudflare-workers-ai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.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/opencode.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/typesafe.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-images.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/telemetry.d.ts +286 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/telemetry.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/types.d.ts +20 -4
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/identity.d.ts +27 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/identity.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/transcript.d.ts +3 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/transcript.js +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +2 -0
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/README.md +167 -21
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/index.d.ts +77 -2
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/memory.d.ts +35 -2
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/memory.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/metrics.d.ts +70 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/metrics.js +1 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/noop.d.ts +5 -2
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/noop.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/render.js +2 -0
- package/dist/node_modules/@earendil-works/pi-telemetry/dist/testing/conformance.js +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +6 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +2 -2
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +8 -7
- package/dist/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/terminal.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +2 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +4 -4
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +3 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui.js +2 -2
- package/dist/node_modules/@earendil-works/pi-tui/package.json +3 -2
- package/dist/package-manager-cli.js +9 -9
- package/dist/sdk/office.d.ts +1 -1
- package/dist/sdk/office.js +1 -1
- package/dist/sdk/router.d.ts +4 -4
- package/dist/sdk/router.js +1 -1
- package/dist/server/create-harness.js +1 -0
- package/dist/utils/clipboard-command.js +1 -1
- package/dist/utils/clipboard-native.js +1 -0
- package/dist/utils/pi-user-agent.js +1 -1
- package/dist/utils/shell.js +2 -2
- package/dist/utils/tools-manager.js +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 +15 -2
- package/package.json +6 -2
- package/dist/node_modules/@dalcode/dal-guard/src/review.js +0 -3
- package/dist/node_modules/@dalcode/dal-office/src/scenes.js +0 -1
- package/dist/node_modules/@dalcode/dal-plugins/src/rank.js +0 -4
- package/dist/node_modules/@dalcode/dal-router/src/assist.js +0 -4
- package/dist/node_modules/@dalcode/dal-router/src/compact-defer.js +0 -3
- package/dist/node_modules/@dalcode/dal-router/src/jev.d.ts +0 -52
- package/dist/node_modules/@dalcode/dal-router/src/jev.js +0 -5
- package/dist/node_modules/@dalcode/dal-router/src/router.d.ts +0 -32
- package/dist/node_modules/@dalcode/dal-router/src/router.js +0 -1
- package/dist/node_modules/@dalcode/dal-router/src/services.js +0 -1
- package/dist/node_modules/@dalcode/dal-subagent/src/role-pick.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var o=(i,c)=>p(i,"name",{value:c,configurable:!0});import{ModelThinkingLevelSchema as a}from"@earendil-works/pi-ai/providers/model-schema";import{Type as e}from"typebox";import{SETTINGS_DEFAULTS as t}from"./settings-defaults.js";function n(i={}){return e.Integer({minimum:0,maximum:Number.MAX_SAFE_INTEGER,...i})}o(n,"nonNegativeSafeInteger");function r(i){return e.Union([e.Number({minimum:0}),e.Literal("disabled")],i)}o(r,"timeoutSetting");const m=e.Object({reserveTokens:e.Optional(n()),keepRecentTokens:e.Optional(n())}),u=e.Object({enabled:e.Optional(e.Boolean({default:t.compaction.enabled})),reserveTokens:e.Optional(n({default:t.compaction.reserveTokens})),keepRecentTokens:e.Optional(n({default:t.compaction.keepRecentTokens})),modelOverrides:e.Optional(e.Record(e.String(),m,{description:'Per-model overrides keyed by exact "provider/modelId" strings.'}))}),g=e.Object({reserveTokens:e.Optional(e.Number({description:"Tokens reserved for the prompt and LLM response.",default:t.branchSummary.reserveTokens})),skipPrompt:e.Optional(e.Boolean({description:'When true, skips the "Summarize branch?" prompt and defaults to no summary.',default:t.branchSummary.skipPrompt}))}),h=e.Object({timeoutMs:e.Optional(e.Number({description:"SDK or provider request timeout in milliseconds."})),maxRetries:e.Optional(e.Number({description:"SDK or provider retry attempts."})),maxRetryDelayMs:e.Optional(e.Number({description:"Maximum server-requested delay before failing.",default:t.retry.provider.maxRetryDelayMs}))}),f=e.Object({enabled:e.Optional(e.Boolean({default:t.retry.enabled})),maxRetries:e.Optional(e.Number({default:t.retry.maxRetries})),baseDelayMs:e.Optional(e.Number({description:"Exponential backoff base delay in milliseconds: 2s, 4s, 8s.",default:t.retry.baseDelayMs})),maxAgentDelayMs:e.Optional(e.Number({default:t.retry.maxAgentDelayMs})),provider:e.Optional(h),maxDelayMs:e.Optional(e.Number({description:"Legacy retry delay setting. Use provider.maxRetryDelayMs instead.",deprecated:!0}))}),O=e.Object({showImages:e.Optional(e.Boolean({description:"Show images when the terminal supports them.",default:t.terminal.showImages})),imageWidthCells:e.Optional(e.Number({description:"Preferred inline image width in terminal cells.",default:t.terminal.imageWidthCells})),clearOnShrink:e.Optional(e.Boolean({description:"Clear empty rows when content shrinks.",default:t.terminal.clearOnShrink})),showTerminalProgress:e.Optional(e.Boolean({description:"Show OSC 9;4 terminal progress indicators.",default:t.terminal.showTerminalProgress})),hyperlinks:e.Optional(e.Union([e.Boolean(),e.Literal("auto")])),images:e.Optional(e.Union([e.Literal("kitty"),e.Literal("iterm2"),e.Literal("auto"),e.Literal(!1)])),trueColor:e.Optional(e.Union([e.Boolean(),e.Literal("auto")]))}),S=e.Object({autoResize:e.Optional(e.Boolean({description:"Resize images to 2000x2000 maximum for better model compatibility.",default:t.images.autoResize})),blockImages:e.Optional(e.Boolean({description:"When true, prevents all images from being sent to LLM providers.",default:t.images.blockImages}))});function l(i){return e.Object({minimal:e.Optional(e.Number()),low:e.Optional(e.Number()),medium:e.Optional(e.Number()),high:e.Optional(e.Number())},i)}o(l,"thinkingBudgetsSettings");const U=l(),b=e.Object({codeBlockIndent:e.Optional(e.String({default:t.markdown.codeBlockIndent})),mermaid:e.Optional(e.Union([e.Literal("off"),e.Literal("final"),e.Literal("streaming")],{default:t.markdown.mermaid}))}),y=e.Object({anthropicExtraUsage:e.Optional(e.Boolean({default:t.warnings.anthropicExtraUsage}))});function s(i){return e.Union([e.Literal("on"),e.Literal("only")],i)}o(s,"codemodeMode");const B=s(),k=e.Object({mode:e.Optional(s({description:'How codemode presents tools. "on" keeps direct tools declared and annotates tools callable from scripts; codemode lists only tools without direct exposure. "only" lists every script-callable tool in codemode and does not declare active direct tools.',default:t.codemode.mode})),inlineBudget:e.Optional(e.Number({minimum:0,description:"Estimated tokens available for inline codemode tool declarations.",default:t.codemode.inlineBudget}))}),L=e.Union([e.String({description:"Load all resources from the package."}),e.Object({source:e.String(),autoload:e.Optional(e.Boolean({description:"When false, start empty and only apply explicit resource patterns."})),extensions:e.Optional(e.Array(e.String())),skills:e.Optional(e.Array(e.String())),prompts:e.Optional(e.Array(e.String())),themes:e.Optional(e.Array(e.String()))})],{description:"Package source for npm or git packages. Use the string form to load all resources or the object form to filter resources."}),d=e.Array(e.String()),w=e.Union([d,e.Object({enableSkillCommands:e.Optional(e.Boolean()),customDirectories:e.Optional(d)},{deprecated:!0})],{description:"Local skill file paths or directories."}),C=e.Object({$schema:e.Optional(e.String({description:"JSON Schema reference."})),lastChangelogVersion:e.Optional(e.String()),defaultProvider:e.Optional(e.String()),defaultModel:e.Optional(e.String()),defaultThinkingLevel:e.Optional(a),modelThinkingLevels:e.Optional(e.Record(e.String(),a,{description:'Per-model default thinking level overrides keyed by "provider/modelId".'})),transport:e.Optional(e.Union([e.Literal("auto"),e.Literal("sse"),e.Literal("websocket"),e.Literal("websocket-cached")],{default:t.transport})),sessionShareDestination:e.Optional(e.Union([e.Literal("auto"),e.Literal("gist"),e.Literal("radius")],{description:'Destination used by /share. "auto" uses Radius when authenticated and otherwise creates a GitHub gist.',default:t.sessionShareDestination})),steeringMode:e.Optional(e.Union([e.Literal("all"),e.Literal("one-at-a-time")],{default:t.steeringMode})),followUpMode:e.Optional(e.Union([e.Literal("all"),e.Literal("one-at-a-time")],{default:t.followUpMode})),theme:e.Optional(e.String()),compaction:e.Optional(u),branchSummary:e.Optional(g),retry:e.Optional(f),hideThinkingBlock:e.Optional(e.Boolean({default:t.hideThinkingBlock})),showCacheMissNotices:e.Optional(e.Boolean({description:"Show cache cost and provider recovery notices.",default:t.showCacheMissNotices})),externalEditor:e.Optional(e.String({description:"Command for Ctrl+G external editor; takes precedence over VISUAL and EDITOR."})),shellPath:e.Optional(e.String({description:"Custom shell path, for example for Cygwin on Windows, with support for leading ~ expansion."})),quietStartup:e.Optional(e.Union([e.Boolean(),e.Literal("header")],{description:'When true, hide all startup output. When "header", keep only the startup header.',default:t.quietStartup})),defaultProjectTrust:e.Optional(e.Union([e.Literal("ask"),e.Literal("always"),e.Literal("never")],{description:"Global setting only.",default:t.defaultProjectTrust})),shellCommandPrefix:e.Optional(e.String({description:"Prefix prepended to every bash command, for example to enable shell aliases."})),npmCommand:e.Optional(e.Array(e.String(),{description:'Command used for npm package lookup and installation, in argv form such as ["mise", "exec", "node@20", "--", "npm"].'})),collapseChangelog:e.Optional(e.Boolean({description:"Show the condensed changelog after update; use /changelog for the full changelog.",default:t.collapseChangelog})),enableInstallTelemetry:e.Optional(e.Boolean({description:"Send an anonymous version and update ping after changelog-detected updates.",default:t.enableInstallTelemetry})),enableAnalytics:e.Optional(e.Boolean({description:"Opt in to analytics data sharing.",default:t.enableAnalytics})),trackingId:e.Optional(e.String({description:"Analytics tracking identifier, generated when analytics is enabled."})),packages:e.Optional(e.Array(L,{description:"npm or git package sources, as strings or objects with resource filtering."})),extensions:e.Optional(e.Array(e.String(),{description:"Local extension file paths or directories."})),deviceId:e.Optional(e.String({description:"Stable installation UUID, generated when authentication first needs it. Global only."})),skills:e.Optional(w),prompts:e.Optional(e.Array(e.String(),{description:"Local prompt template file paths or directories."})),themes:e.Optional(e.Array(e.String(),{description:"Local theme file paths or directories."})),enableSkillCommands:e.Optional(e.Boolean({description:"Register skills as /skill:name commands.",default:t.enableSkillCommands})),terminal:e.Optional(O),images:e.Optional(S),enabledModels:e.Optional(e.Array(e.String(),{description:"Model patterns for cycling, in the same format as the --models CLI flag."})),defaultTools:e.Optional(e.Array(e.String(),{description:"Initial tool selection. Plain names replace the inherited selection; +name and -name entries add or remove tools."})),doubleEscapeAction:e.Optional(e.Union([e.Literal("fork"),e.Literal("tree"),e.Literal("none")],{description:"Action for double-escape with an empty editor.",default:t.doubleEscapeAction})),treeFilterMode:e.Optional(e.Union([e.Literal("default"),e.Literal("no-tools"),e.Literal("user-only"),e.Literal("labeled-only"),e.Literal("all")],{description:"Default filter when opening /tree.",default:t.treeFilterMode})),thinkingBudgets:e.Optional(l({description:"Custom token budgets for thinking levels."})),editorPaddingX:e.Optional(e.Number({description:"Horizontal padding for the input editor.",default:t.editorPaddingX})),outputPad:e.Optional(e.Union([e.Literal(0),e.Literal(1)],{description:"Horizontal padding for transcript content.",default:t.outputPad})),autocompleteMaxVisible:e.Optional(e.Number({description:"Maximum visible items in the autocomplete dropdown.",default:t.autocompleteMaxVisible})),showHardwareCursor:e.Optional(e.Boolean({description:"Show the terminal cursor while still positioning it for IME."})),markdown:e.Optional(b),warnings:e.Optional(y),codemode:e.Optional(k),sessionDir:e.Optional(e.String({description:"Custom session storage directory, in the same format as the --session-dir CLI flag."})),httpProxy:e.Optional(e.String({description:"Proxy URL applied as HTTP_PROXY and HTTPS_PROXY for Pi-managed HTTP clients."})),httpIdleTimeoutMs:e.Optional(r({description:'HTTP header or body idle timeout in milliseconds; 0 or "disabled" disables it.'})),cacheWarming:e.Optional(e.Union([e.Literal("off"),e.Literal("streaming"),e.Literal("idle")],{description:'Cache-warming profile. "idle" also warms between agent runs. Global only because each refresh costs money.',default:t.cacheWarming})),websocketConnectTimeoutMs:e.Optional(r({description:'WebSocket connect or open handshake timeout in milliseconds; 0 or "disabled" disables it.'})),tuiMode:e.Optional(e.Union([e.Literal("regular"),e.Literal("fullscreen")],{default:t.tuiMode})),fullscreenExitOutput:e.Optional(e.Union([e.Literal("transcript"),e.Literal("resume-hint")],{description:"No effect in regular TUI mode.",default:t.fullscreenExitOutput})),fullscreenScrollbar:e.Optional(e.Union([e.Literal("auto"),e.Literal("always"),e.Literal("hidden")],{description:"No effect in regular TUI mode.",default:t.fullscreenScrollbar})),fullscreenCopyOnSelect:e.Optional(e.Boolean({description:"No effect in regular TUI mode.",default:t.fullscreenCopyOnSelect})),fullscreenWheelScrollLines:e.Optional(e.Union([e.Number(),e.Literal("auto")],{description:"Lines scrolled per wheel event in fullscreen mode; numeric values are clamped from 1 to 100.",default:t.fullscreenWheelScrollLines})),queueMode:e.Optional(e.Union([e.Literal("all"),e.Literal("one-at-a-time")],{description:"Legacy setting migrated to steeringMode.",deprecated:!0})),websockets:e.Optional(e.Boolean({description:"Legacy setting migrated to transport.",deprecated:!0}))},{additionalProperties:!0});export{C as SettingsSchema};
|
|
1
|
+
var p=Object.defineProperty;var o=(i,c)=>p(i,"name",{value:c,configurable:!0});import{ModelThinkingLevelSchema as r}from"@earendil-works/pi-ai/providers/model-schema";import{Type as e}from"typebox";import{SETTINGS_DEFAULTS as t}from"./settings-defaults.js";function n(i={}){return e.Integer({minimum:0,maximum:Number.MAX_SAFE_INTEGER,...i})}o(n,"nonNegativeSafeInteger");function a(i){return e.Union([e.Number({minimum:0}),e.Literal("disabled")],i)}o(a,"timeoutSetting");const m=e.Object({reserveTokens:e.Optional(n()),keepRecentTokens:e.Optional(n())}),u=e.Object({enabled:e.Optional(e.Boolean({default:t.compaction.enabled})),reserveTokens:e.Optional(n({default:t.compaction.reserveTokens})),keepRecentTokens:e.Optional(n({default:t.compaction.keepRecentTokens})),modelOverrides:e.Optional(e.Record(e.String(),m,{description:'Per-model overrides keyed by exact "provider/modelId" strings.'}))}),g=e.Object({reserveTokens:e.Optional(e.Number({description:"Tokens reserved for the prompt and LLM response.",default:t.branchSummary.reserveTokens})),skipPrompt:e.Optional(e.Boolean({description:'When true, skips the "Summarize branch?" prompt and defaults to no summary.',default:t.branchSummary.skipPrompt}))}),h=e.Object({timeoutMs:e.Optional(e.Number({description:"SDK or provider request timeout in milliseconds."})),maxRetries:e.Optional(e.Number({description:"SDK or provider retry attempts."})),maxRetryDelayMs:e.Optional(e.Number({description:"Maximum server-requested delay before failing.",default:t.retry.provider.maxRetryDelayMs}))}),f=e.Object({enabled:e.Optional(e.Boolean({default:t.retry.enabled})),maxRetries:e.Optional(e.Number({default:t.retry.maxRetries})),baseDelayMs:e.Optional(e.Number({description:"Exponential backoff base delay in milliseconds: 2s, 4s, 8s.",default:t.retry.baseDelayMs})),maxAgentDelayMs:e.Optional(e.Number({default:t.retry.maxAgentDelayMs})),provider:e.Optional(h),maxDelayMs:e.Optional(e.Number({description:"Legacy retry delay setting. Use provider.maxRetryDelayMs instead.",deprecated:!0}))}),O=e.Object({showImages:e.Optional(e.Boolean({description:"Show images when the terminal supports them.",default:t.terminal.showImages})),imageWidthCells:e.Optional(e.Number({description:"Preferred inline image width in terminal cells.",default:t.terminal.imageWidthCells})),clearOnShrink:e.Optional(e.Boolean({description:"Clear empty rows when content shrinks.",default:t.terminal.clearOnShrink})),showTerminalProgress:e.Optional(e.Boolean({description:"Show OSC 9;4 terminal progress indicators.",default:t.terminal.showTerminalProgress})),hyperlinks:e.Optional(e.Union([e.Boolean(),e.Literal("auto")])),images:e.Optional(e.Union([e.Literal("kitty"),e.Literal("iterm2"),e.Literal("auto"),e.Literal(!1)])),trueColor:e.Optional(e.Union([e.Boolean(),e.Literal("auto")]))}),b=e.Object({autoResize:e.Optional(e.Boolean({description:"Resize images to 2000x2000 maximum for better model compatibility.",default:t.images.autoResize})),blockImages:e.Optional(e.Boolean({description:"When true, prevents all images from being sent to LLM providers.",default:t.images.blockImages}))});function l(i){return e.Object({minimal:e.Optional(e.Number()),low:e.Optional(e.Number()),medium:e.Optional(e.Number()),high:e.Optional(e.Number())},i)}o(l,"thinkingBudgetsSettings");const U=l(),S=e.Object({codeBlockIndent:e.Optional(e.String({default:t.markdown.codeBlockIndent})),mermaid:e.Optional(e.Union([e.Literal("off"),e.Literal("final"),e.Literal("streaming")],{default:t.markdown.mermaid}))}),y=e.Object({anthropicExtraUsage:e.Optional(e.Boolean({default:t.warnings.anthropicExtraUsage}))});function s(i){return e.Union([e.Literal("on"),e.Literal("only")],i)}o(s,"codemodeMode");const B=s(),k=e.Object({mode:e.Optional(s({description:'How codemode presents tools. "on" keeps direct tools declared and annotates tools callable from scripts; codemode lists only tools without direct exposure. "only" lists every script-callable tool in codemode and does not declare active direct tools.',default:t.codemode.mode})),inlineBudget:e.Optional(e.Number({minimum:0,description:"Estimated tokens available for inline codemode tool declarations.",default:t.codemode.inlineBudget}))}),L=e.Union([e.String({description:"Load all resources from the package."}),e.Object({source:e.String(),autoload:e.Optional(e.Boolean({description:"When false, start empty and only apply explicit resource patterns."})),extensions:e.Optional(e.Array(e.String())),skills:e.Optional(e.Array(e.String())),prompts:e.Optional(e.Array(e.String())),themes:e.Optional(e.Array(e.String()))})],{description:"Package source for npm or git packages. Use the string form to load all resources or the object form to filter resources."}),d=e.Array(e.String()),w=e.Union([d,e.Object({enableSkillCommands:e.Optional(e.Boolean()),customDirectories:e.Optional(d)},{deprecated:!0})],{description:"Local skill file paths or directories."}),C=e.Object({$schema:e.Optional(e.String({description:"JSON Schema reference."})),lastChangelogVersion:e.Optional(e.String()),defaultProvider:e.Optional(e.String()),defaultModel:e.Optional(e.String()),defaultThinkingLevel:e.Optional(r),modelThinkingLevels:e.Optional(e.Record(e.String(),r,{description:'Per-model default thinking level overrides keyed by "provider/modelId".'})),transport:e.Optional(e.Union([e.Literal("auto"),e.Literal("sse"),e.Literal("websocket"),e.Literal("websocket-cached")],{default:t.transport})),sessionShareDestination:e.Optional(e.Union([e.Literal("auto"),e.Literal("gist"),e.Literal("radius")],{description:'Destination used by /share. "auto" uses Radius when authenticated and otherwise creates a GitHub gist.',default:t.sessionShareDestination})),steeringMode:e.Optional(e.Union([e.Literal("all"),e.Literal("one-at-a-time")],{default:t.steeringMode})),followUpMode:e.Optional(e.Union([e.Literal("all"),e.Literal("one-at-a-time")],{default:t.followUpMode})),theme:e.Optional(e.String()),compaction:e.Optional(u),branchSummary:e.Optional(g),retry:e.Optional(f),hideThinkingBlock:e.Optional(e.Boolean({default:t.hideThinkingBlock})),showCacheMissNotices:e.Optional(e.Boolean({description:"Show cache cost and provider recovery notices.",default:t.showCacheMissNotices})),externalEditor:e.Optional(e.String({description:"Command for Ctrl+G external editor; takes precedence over VISUAL and EDITOR."})),shellPath:e.Optional(e.String({description:"Custom shell path, for example for Cygwin on Windows, with support for leading ~ expansion."})),quietStartup:e.Optional(e.Union([e.Boolean(),e.Literal("header")],{description:'When true, hide all startup output. When "header", keep only the startup header.',default:t.quietStartup})),defaultProjectTrust:e.Optional(e.Union([e.Literal("ask"),e.Literal("always"),e.Literal("never")],{description:"Global setting only.",default:t.defaultProjectTrust})),shellCommandPrefix:e.Optional(e.String({description:"Prefix prepended to every bash command, for example to enable shell aliases."})),npmCommand:e.Optional(e.Array(e.String(),{description:'Command used for npm package lookup and installation, in argv form such as ["mise", "exec", "node@20", "--", "npm"].'})),collapseChangelog:e.Optional(e.Boolean({description:"Show the condensed changelog after update; use /changelog for the full changelog.",default:t.collapseChangelog})),enableInstallTelemetry:e.Optional(e.Boolean({description:"Send an anonymous version and update ping after changelog-detected updates.",default:t.enableInstallTelemetry})),enableAnalytics:e.Optional(e.Boolean({description:"Opt in to analytics data sharing.",default:t.enableAnalytics})),trackingId:e.Optional(e.String({description:"Analytics tracking identifier, generated when analytics is enabled."})),packages:e.Optional(e.Array(L,{description:"npm or git package sources, as strings or objects with resource filtering."})),extensions:e.Optional(e.Array(e.String(),{description:"Local extension file paths or directories."})),deviceId:e.Optional(e.String({description:"Stable installation UUID, generated when authentication first needs it. Global only."})),skills:e.Optional(w),prompts:e.Optional(e.Array(e.String(),{description:"Local prompt template file paths or directories."})),themes:e.Optional(e.Array(e.String(),{description:"Local theme file paths or directories."})),enableSkillCommands:e.Optional(e.Boolean({description:"Register skills as /skill:name commands.",default:t.enableSkillCommands})),terminal:e.Optional(O),images:e.Optional(b),enabledModels:e.Optional(e.Array(e.String(),{description:"Model patterns for cycling, in the same format as the --models CLI flag."})),defaultTools:e.Optional(e.Array(e.String(),{description:"Initial tool selection. Plain names replace the inherited selection; +name and -name entries add or remove tools."})),doubleEscapeAction:e.Optional(e.Union([e.Literal("fork"),e.Literal("tree"),e.Literal("none")],{description:"Action for double-escape with an empty editor.",default:t.doubleEscapeAction})),treeFilterMode:e.Optional(e.Union([e.Literal("default"),e.Literal("no-tools"),e.Literal("user-only"),e.Literal("labeled-only"),e.Literal("all")],{description:"Default filter when opening /tree.",default:t.treeFilterMode})),thinkingBudgets:e.Optional(l({description:"Custom token budgets for thinking levels."})),editorPaddingX:e.Optional(e.Number({description:"Horizontal padding for the input editor.",default:t.editorPaddingX})),outputPad:e.Optional(e.Union([e.Literal(0),e.Literal(1)],{description:"Horizontal padding for transcript content.",default:t.outputPad})),autocompleteMaxVisible:e.Optional(e.Number({description:"Maximum visible items in the autocomplete dropdown.",default:t.autocompleteMaxVisible})),showHardwareCursor:e.Optional(e.Boolean({description:"Show the terminal cursor while still positioning it for IME."})),markdown:e.Optional(S),warnings:e.Optional(y),codemode:e.Optional(k),sessionDir:e.Optional(e.String({description:"Custom session storage directory, in the same format as the --session-dir CLI flag."})),httpProxy:e.Optional(e.String({description:"Proxy URL applied as HTTP_PROXY and HTTPS_PROXY for Pi-managed HTTP clients."})),httpIdleTimeoutMs:e.Optional(a({description:'HTTP header or body idle timeout in milliseconds; 0 or "disabled" disables it.'})),stallWatchdogMs:e.Optional(a({description:'Milliseconds a run may go without model output, tool output or a heartbeat before it reports where it is waiting (default 60000); 0 or "disabled" turns the report off.'})),firstTokenTimeoutMs:e.Optional(a({description:'Model requests with no output within this many milliseconds are cancelled and retried; 0 or "disabled" disables it. Default 45000.'})),cacheWarming:e.Optional(e.Union([e.Literal("off"),e.Literal("streaming"),e.Literal("idle")],{description:'Cache-warming profile. "idle" also warms between agent runs. Global only because each refresh costs money.',default:t.cacheWarming})),websocketConnectTimeoutMs:e.Optional(a({description:'WebSocket connect or open handshake timeout in milliseconds; 0 or "disabled" disables it.'})),tuiMode:e.Optional(e.Union([e.Literal("regular"),e.Literal("fullscreen")],{default:t.tuiMode})),fullscreenExitOutput:e.Optional(e.Union([e.Literal("transcript"),e.Literal("resume-hint")],{description:"No effect in regular TUI mode.",default:t.fullscreenExitOutput})),fullscreenScrollbar:e.Optional(e.Union([e.Literal("auto"),e.Literal("always"),e.Literal("hidden")],{description:"No effect in regular TUI mode.",default:t.fullscreenScrollbar})),fullscreenCopyOnSelect:e.Optional(e.Boolean({description:"No effect in regular TUI mode.",default:t.fullscreenCopyOnSelect})),fullscreenWheelScrollLines:e.Optional(e.Union([e.Number(),e.Literal("auto")],{description:"Lines scrolled per wheel event in fullscreen mode; numeric values are clamped from 1 to 100.",default:t.fullscreenWheelScrollLines})),queueMode:e.Optional(e.Union([e.Literal("all"),e.Literal("one-at-a-time")],{description:"Legacy setting migrated to steeringMode.",deprecated:!0})),websockets:e.Optional(e.Boolean({description:"Legacy setting migrated to transport.",deprecated:!0}))},{additionalProperties:!0});export{C as SettingsSchema};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type StallWaitKind = "model" | "tool" | "extension" | "user" | "compaction" | "retry" | "host" | "engine";
|
|
2
|
+
export interface StallStage {
|
|
3
|
+
name: string;
|
|
4
|
+
kind: StallWaitKind;
|
|
5
|
+
detail?: string;
|
|
6
|
+
enteredAt: number;
|
|
7
|
+
}
|
|
8
|
+
export interface StallReport {
|
|
9
|
+
phase: "stalled" | "recovered";
|
|
10
|
+
stage: string;
|
|
11
|
+
kind: StallWaitKind;
|
|
12
|
+
detail?: string;
|
|
13
|
+
idleMs: number;
|
|
14
|
+
stageMs: number;
|
|
15
|
+
runMs: number;
|
|
16
|
+
count: number;
|
|
17
|
+
}
|
|
18
|
+
export interface StallWatchdogOptions {
|
|
19
|
+
thresholdMs: number;
|
|
20
|
+
onReport: (report: StallReport) => void;
|
|
21
|
+
checkEveryMs?: number;
|
|
22
|
+
now?: () => number;
|
|
23
|
+
setInterval?: (fn: () => void, ms: number) => unknown;
|
|
24
|
+
clearInterval?: (handle: unknown) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const DEFAULT_STALL_WATCHDOG_MS = 60000;
|
|
27
|
+
export declare class StallWatchdog {
|
|
28
|
+
private readonly thresholdMs;
|
|
29
|
+
private readonly onReport;
|
|
30
|
+
private readonly checkEveryMs;
|
|
31
|
+
private readonly now;
|
|
32
|
+
private readonly setTimer;
|
|
33
|
+
private readonly clearTimer;
|
|
34
|
+
private readonly stages;
|
|
35
|
+
private nextId;
|
|
36
|
+
private timer;
|
|
37
|
+
private runStartedAt;
|
|
38
|
+
private lastProgressAt;
|
|
39
|
+
private reported;
|
|
40
|
+
private lastReportStage;
|
|
41
|
+
constructor(options: StallWatchdogOptions);
|
|
42
|
+
get enabled(): boolean;
|
|
43
|
+
get running(): boolean;
|
|
44
|
+
start(): void;
|
|
45
|
+
stop(): void;
|
|
46
|
+
progress(): void;
|
|
47
|
+
enter(name: string, kind: StallWaitKind, detail?: string): () => void;
|
|
48
|
+
within<T>(name: string, kind: StallWaitKind, detail: string | undefined, fn: () => Promise<T> | T): Promise<T>;
|
|
49
|
+
currentStage(): StallStage;
|
|
50
|
+
check(): void;
|
|
51
|
+
private recover;
|
|
52
|
+
}
|
|
53
|
+
export declare function formatStallDuration(ms: number, lang?: "zh" | "en"): string;
|
|
54
|
+
export declare function describeStallStage(report: Pick<StallReport, "stage" | "kind" | "detail">): string;
|
|
55
|
+
export declare function formatStallNotice(report: StallReport): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var o=(n,t)=>u(n,"name",{value:t,configurable:!0});import{fill as a,getLanguage as g,t as i}from"../dal/i18n.js";const A=6e4,f={name:"engine:between-steps",kind:"engine",enteredAt:0};class w{static{o(this,"StallWatchdog")}thresholdMs;onReport;checkEveryMs;now;setTimer;clearTimer;stages=[];nextId=1;timer;runStartedAt=0;lastProgressAt=0;reported=0;lastReportStage;constructor(t){this.thresholdMs=Math.max(0,Math.floor(t.thresholdMs)),this.onReport=t.onReport,this.checkEveryMs=Math.max(50,Math.floor(t.checkEveryMs??Math.min(5e3,Math.max(this.thresholdMs/4,50)))),this.now=t.now??Date.now,this.setTimer=t.setInterval??((e,s)=>setInterval(e,s)),this.clearTimer=t.clearInterval??(e=>clearInterval(e))}get enabled(){return this.thresholdMs>0}get running(){return this.timer!==void 0}start(){if(!this.enabled)return;const t=this.now();if(this.runStartedAt=t,this.lastProgressAt=t,this.reported=0,this.lastReportStage=void 0,this.timer===void 0){const e=this.setTimer(()=>this.check(),this.checkEveryMs);e?.unref?.(),this.timer=e}}stop(){this.timer!==void 0&&(this.clearTimer(this.timer),this.timer=void 0),this.recover(),this.stages.length=0}progress(){this.enabled&&(this.recover(),this.lastProgressAt=this.now())}enter(t,e,s){if(!this.enabled)return m;const r=this.nextId++;this.progress(),this.stages.push({id:r,name:t,kind:e,detail:s,enteredAt:this.now()});let h=!1;return()=>{if(h)return;h=!0;const d=this.stages.findIndex(c=>c.id===r);d!==-1&&this.stages.splice(d,1),this.progress()}}async within(t,e,s,r){const h=this.enter(t,e,s);try{return await r()}finally{h()}}currentStage(){return this.stages[this.stages.length-1]??{...f,enteredAt:this.lastProgressAt}}check(){if(!this.enabled||this.timer===void 0)return;const t=this.now(),e=t-this.lastProgressAt,s=Math.floor(e/this.thresholdMs);if(s<=this.reported)return;this.reported=s;const r=this.currentStage();this.lastReportStage=r,this.onReport({phase:"stalled",stage:r.name,kind:r.kind,...r.detail?{detail:r.detail}:{},idleMs:e,stageMs:t-r.enteredAt,runMs:t-this.runStartedAt,count:s})}recover(){if(this.reported===0)return;const t=this.now(),e=this.lastReportStage??this.currentStage(),s=this.reported;this.reported=0,this.lastReportStage=void 0,this.onReport({phase:"recovered",stage:e.name,kind:e.kind,...e.detail?{detail:e.detail}:{},idleMs:t-this.lastProgressAt,stageMs:t-e.enteredAt,runMs:t-this.runStartedAt,count:s})}}function m(){}o(m,"noop");function p(n,t="zh"){const e=Math.max(0,Math.round(n/1e3)),s=Math.floor(e/60),r=e%60;return t==="en"?s>0?`${s}m ${String(r).padStart(2,"0")}s`:`${r}s`:s>0?`${s} \u5206 ${String(r).padStart(2,"0")} \u79D2`:`${r} \u79D2`}o(p,"formatStallDuration");function l(n){const t=n.detail??"",[,e=""]=n.stage.split(/:(.*)/s);switch(n.kind){case"extension":return a(i("\u6269\u5C55 {name} \u7684 {event} \u5904\u7406"),{name:t||"?",event:e});case"tool":return a(i("\u5DE5\u5177\u8FD0\u884C\u4E2D\uFF0C\u6CA1\u6709\u65B0\u8F93\u51FA\uFF08{detail}\uFF09"),{detail:t||e});case"model":return t?a(i("\u7B49\u5F85\u6A21\u578B {model} \u8F93\u51FA"),{model:t}):i("\u7B49\u5F85\u6A21\u578B\u8F93\u51FA");case"user":return t?a(i("\u7B49\u4F60\u56DE\u5E94\uFF1A{title}"),{title:t}):i("\u7B49\u4F60\u56DE\u5E94");case"compaction":return i("\u538B\u7F29\u4E0A\u4E0B\u6587");case"retry":return t?a(i("\u7B49\u5F85\u7B2C {attempt} \u6B21\u91CD\u8BD5"),{attempt:t}):i("\u7B49\u5F85\u91CD\u8BD5");case"host":return i("\u7B49\u5F85\u754C\u9762\u8BFB\u53D6\u8F93\u51FA");default:return n.stage==="request:preparing"?i("\u51C6\u5907\u8BF7\u6C42"):i("\u4E24\u6B65\u4E4B\u95F4")}}o(l,"describeStallStage");function v(n){const t=p(n.idleMs,g()==="en"?"en":"zh");return n.phase==="recovered"?a(i("\u5DF2\u6062\u590D\uFF08\u505C\u4E86 {duration}\uFF0C\u5728\uFF1A{stage}\uFF09"),{duration:t,stage:l(n)}):a(i("\u5DF2 {duration} \u6CA1\u6709\u8FDB\u5C55\uFF0C\u5361\u5728\uFF1A{stage}"),{duration:t,stage:l(n)})}o(v,"formatStallNotice");export{A as DEFAULT_STALL_WATCHDOG_MS,w as StallWatchdog,l as describeStallStage,p as formatStallDuration,v as formatStallNotice};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
1
|
+
var x=Object.defineProperty;var c=(e,t)=>x(e,"name",{value:t,configurable:!0});import{join as $}from"node:path";import{getSystemMessageText as j}from"@earendil-works/pi-ai";import{APP_NAME as v,APP_TITLE as p,getDalDocsPath as E,getDocsPath as T,getExamplesPath as O,getReadmePath as _,IS_WHITE_LABEL_BUILD as I}from"../config.js";import{describeGitState as N}from"./git-state.js";import{INJECTED_CONTEXT_TAG as R}from"./messages.js";import{describeProjectFacts as A}from"./project-facts.js";import{formatSkillsForPrompt as C}from"./skills.js";const F=/^[a-z][a-z0-9_-]*$/;function M(e){return{customPrompt:e.customPrompt,forceSystemPrompt:e.forceSystemPrompt,selectedTools:[...e.selectedTools??["read","bash","edit","write"]],hiddenTools:[...e.hiddenTools??[]],toolSnippets:{...e.toolSnippets??{}},toolGuidelines:Object.fromEntries(Object.entries(e.toolGuidelines??{}).map(([t,n])=>[t,[...n]])),promptGuidelines:[...e.promptGuidelines??[]],appendSystemPrompt:e.appendSystemPrompt??"",sections:{...e.sections??{}},cwd:e.cwd,gitState:e.gitState,projectFacts:e.projectFacts,contextFiles:(e.contextFiles??[]).map(t=>({...t})),skills:(e.skills??[]).map(t=>({...t}))}}c(M,"normalizeBuildSystemPromptOptions");function D(e){return["Project-specific instructions and guidelines:",...e.map(({path:t,content:n})=>`<project_instructions path="${t}">
|
|
2
2
|
${n}
|
|
3
3
|
</project_instructions>`)].join(`
|
|
4
4
|
|
|
5
|
-
`)}c(
|
|
6
|
-
`)}c(G,"buildRules");function
|
|
7
|
-
`):"(none)";
|
|
5
|
+
`)}c(D,"renderProjectContext");function G(e,t,n){const i=[],d=new Set,o=c(l=>{const m=l.trim();!m||d.has(m)||(d.add(m),i.push(m))},"addRule"),h=e.includes("bash"),u=e.includes("powershell"),a=e.includes("grep"),f=e.includes("find"),y=e.includes("ls");(h||u)&&!a&&!f&&!y&&o(h&&u?"Use bash or PowerShell for file operations like listing, searching, and finding files":u?"Use PowerShell for file operations like listing, searching, and finding files":"Use bash for file operations like ls, rg, find");for(const l of e)for(const m of t[l]??[])o(m);for(const l of n)o(l);return e.length>0&&(o("Plan a step's lookups first, then make the independent calls (reads, searches, read-only commands) together in one response; they run in parallel"),o("Use paths relative to the working directory; do not begin commands with cd into it"),o("Finish the task in this turn; ask only to choose between approaches, or before push, deploy, delete, spend or send"),o("Reproduce a reported bug before changing code; if it does not reproduce, or the premise does not match what the code or tests show, say so plainly, give the evidence and change no product code, whatever a loaded skill assumes"),o("When a protection refuses a call, stop that step and say why; never reach the same data another way"),o(`You are ${p}: adapt instructions written for another agent, and sign commits "Co-Authored-By: ${p} <noreply@deepailab.ai>", never Claude, Codex or Copilot`)),o(`Text inside <${R} type="..."> tags comes from ${p}, not the user: follow it, but do not answer it as the user's words`),o("Reply in the language of the user's latest message, whatever language tool results, skills or injected notices use"),o("Be concise, and show file paths clearly"),i.map(l=>`- ${l}`).join(`
|
|
6
|
+
`)}c(G,"buildRules");function L(e){const t=M(e),{customPrompt:n,selectedTools:i,hiddenTools:d,toolSnippets:o,toolGuidelines:h,promptGuidelines:u,appendSystemPrompt:a,sections:f,cwd:y,contextFiles:l,skills:m}=t;for(const s of Object.keys(f))if(!F.test(s)||s==="preamble")throw new Error(`Invalid system prompt section name: ${s}`);const S=i.filter(s=>!d.includes(s)),r={};if(n)r.preamble=n;else{r.preamble=`You are an expert coding assistant operating inside ${p} (${v}). You help users by reading files, executing commands, editing code, and writing new files.`;const s=S.filter(b=>!!o[b]),g=s.length>0?s.map(b=>`- ${b}: ${o[b]}`).join(`
|
|
7
|
+
`):"(none)";r.tools=`${g}
|
|
8
8
|
|
|
9
|
-
In addition to the tools above, you may have access to other custom tools depending on the project.`,
|
|
9
|
+
In addition to the tools above, you may have access to other custom tools depending on the project.`,r.rules=G(S,h,u),r.docs=z()}a&&(r.addendum=a),l.length>0&&(r.project_context=D(l));const k=["read","bash"],w=k.find(s=>S.includes(s))??(k.some(s=>i.includes(s))?"indirect":void 0);if(f.skills)r.skills=f.skills;else if(w&&m.length>0){const s=C(m,w).trim();s&&(r.skills=s)}if(r.cwd=`Current working directory: ${y.replace(/\\/g,"/")}. Commands and relative paths start here; do not cd into it first.`,t.gitState&&!f.git_state&&(r.git=N(y)),t.projectFacts&&!f.project){const s=A(y);s&&(r.project=s)}for(const[s,g]of Object.entries(f))g&&(r[s]=g);const P={preamble:r.preamble};for(const[s,g]of Object.entries(r))s!=="preamble"&&(P[s]=`<${s}>
|
|
10
10
|
${g}
|
|
11
|
-
</${s}>`);return
|
|
12
|
-
${
|
|
11
|
+
</${s}>`);return P}c(L,"buildSystemPromptSections");const U="cwd",B="Environment of this session, part of the system prompt. Later updates to these sections arrive as system prompt updates.";function Z(e){const t=e[0];if(!t||t.role!=="system"||!t.sections)return e;const n=Object.keys(t.sections),i=n.indexOf(U);if(i===-1)return e;const d=n.slice(i).map(a=>t.sections?.[a]).filter(a=>typeof a=="string"&&a.length>0),o=Object.fromEntries(n.slice(0,i).map(a=>[a,t.sections?.[a]??null])),h={...t,sections:o};if(d.length===0)return[h,...e.slice(1)];const u={role:"user",content:[{type:"text",text:`<session_environment>
|
|
12
|
+
${B}
|
|
13
13
|
|
|
14
14
|
${d.join(`
|
|
15
15
|
|
|
16
16
|
`)}
|
|
17
|
-
</session_environment>`}],timestamp:t.timestamp};return[h,
|
|
18
|
-
- Start with: ${
|
|
17
|
+
</session_environment>`}],timestamp:t.timestamp};return[h,u,...e.slice(1)]}c(Z,"moveSessionEnvironmentOutOfSystemPrompt");function W(e){return e.forceSystemPrompt!==void 0?{content:e.forceSystemPrompt}:{content:"",sections:L(e)}}c(W,"buildSystemPromptState");function ee(e){return j({role:"system",...W(e),timestamp:0})}c(ee,"buildSystemPrompt");function te(e,t){const n={};for(const[i,d]of Object.entries(t))e[i]!==d&&(n[i]=d);for(const i of Object.keys(e))t[i]===void 0&&(n[i]=null);return Object.keys(n).length>0?n:void 0}c(te,"diffSystemPromptSections");function z(){if(I){const e=E();return`${p} documentation (read only when the user asks about ${p} itself: its commands, settings, skills, prompt templates, extensions, packages, themes or keybindings):
|
|
18
|
+
- Start with: ${$(e,"README.md")}
|
|
19
19
|
- Topics, in the same folder: skills.md, prompt-templates.md, extensions.md, packages.md, themes.md, keybindings.md, settings.md
|
|
20
20
|
- Resolve those file names under ${e}, not the current working directory
|
|
21
21
|
- Read the relevant file completely before answering or implementing, and describe the product as ${p}
|
|
@@ -26,4 +26,4 @@ ${d.join(`
|
|
|
26
26
|
- When reading these docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory
|
|
27
27
|
- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), packages (docs/packages.md), environment variables (docs/environment-variables.md), MCP servers (docs/mcp.md), codemode scripts and non-LLM models such as classifiers and image models (docs/codemode.md)
|
|
28
28
|
- When working on these topics, read the docs and examples, and follow .md cross-references before implementing
|
|
29
|
-
- Always read these .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`}c(z,"buildDocumentationSection");export{
|
|
29
|
+
- Always read these .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`}c(z,"buildDocumentationSection");export{U as SESSION_ENVIRONMENT_FIRST_SECTION,ee as buildSystemPrompt,L as buildSystemPromptSections,W as buildSystemPromptState,te as diffSystemPromptSections,Z as moveSessionEnvironmentOutOfSystemPrompt,M as normalizeBuildSystemPromptOptions};
|
|
@@ -58,6 +58,7 @@ export interface ShellExecutionRequest {
|
|
|
58
58
|
readonly command: string;
|
|
59
59
|
readonly cwd: string;
|
|
60
60
|
readonly sessionFile?: string;
|
|
61
|
+
readonly tempDir?: string;
|
|
61
62
|
}
|
|
62
63
|
export type ShellExecutionGuard = (request: ShellExecutionRequest) => Promise<string | undefined> | string | undefined;
|
|
63
64
|
export declare function registerShellExecutionGuard(guard: ShellExecutionGuard): () => void;
|
package/dist/core/tools/bash.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var $e=Object.defineProperty;var
|
|
2
|
-
Cannot execute ${t} commands.`)}const b=S.commandTransport==="stdin",c=ve(S.shell,b?S.args:[...S.args,n],{cwd:o,detached:process.platform!=="win32",env:w??ce(),stdio:[b?"pipe":"ignore","pipe","pipe"],windowsHide:!0});b&&(c.stdin?.on("error",()=>{}),c.stdin?.end(n)),c.pid&&Fe(c.pid);let
|
|
3
|
-
${x.fg("muted",` \u23BF ${e} ${o.trim()}`)}`}const w=o===null?qe(x):o?x.fg("dim",ze(o.replace(/\s+/g," ").trim(),42)):x.fg("dim","\u2026");return`${x.fg("toolTitle",x.bold(e))} ${w}${y}`}
|
|
1
|
+
var $e=Object.defineProperty;var r=(t,e)=>$e(t,"name",{value:e,configurable:!0});import{constants as Le}from"node:fs";import{access as Te}from"node:fs/promises";import{constants as Ce}from"node:os";import{ToolExecutionError as le}from"@earendil-works/pi-agent-core";import{Container as Pe,Text as W,truncateToWidth as De}from"@earendil-works/pi-tui";import{spawn as ve}from"child_process";import{Type as l}from"typebox";import{fill as G,t as P}from"../../dal/i18n.js";import{keyHint as Ie}from"../../modes/interactive/components/keybinding-hints.js";import{truncateToVisualLines as Ae}from"../../modes/interactive/components/visual-truncate.js";import{theme as x}from"../../modes/interactive/theme/theme.js";import{waitForChildProcess as ke}from"../../utils/child-process.js";import{writeOutputFile as Me}from"../../utils/output-files.js";import{getShellConfig as ue,getShellEnv as ce,killProcessTree as me,trackDetachedChildPid as Fe,untrackDetachedChildPid as Ne}from"../../utils/shell.js";import{missingManagedToolHint as Be}from"../../utils/tools-manager.js";import{describeDenialForModel as Re}from"../sandbox/denial.js";import{getProcessShellSandbox as Ue}from"../sandbox/shell-sandbox.js";import{toolDenial as Ge,withToolDenial as He}from"../tool-denial.js";import{isReadOnlyBashCommand as je}from"./bash-read-only.js";import{OutputAccumulator as We}from"./output-accumulator.js";import{condenseShellOutput as Ve,outputCondenseDisabled as Ye}from"./output-condense.js";import{countOutputLines as Xe,formatCollapsedSummary as Ke,getTextOutput as pe,invalidArgText as qe,str as fe,truncateDisplay as ze}from"./render-utils.js";import{wrapToolDefinition as Je}from"./tool-definition-wrapper.js";import{DEFAULT_MAX_BYTES as Qe,formatSize as Ze,SHELL_OUTPUT_MAX_CHARS as ee,truncateHeadTail as et}from"./truncate.js";const he=2147483647,we=1024*1024,tt=8*1024*1024,nt=he/1e3,te=12e4,ne=30;function ot(t){if(t===void 0)return te;if(!Number.isFinite(t)||t<=0)throw new Error("Invalid timeout: must be a finite number of seconds");const e=t*1e3;if(e>he)throw new Error(`Invalid timeout: maximum is ${nt} seconds`);return e}r(ot,"resolveTimeoutMs");const Se=l.Object({command:l.String({description:"Shell command to execute"}),description:l.String({description:`What it does and why, 3-10 words in the user's language, shown instead of the command: "Find hardcoded key names", not "run grep"`}),timeout:l.Optional(l.Number({description:"Seconds to wait for the command (default in the tool description). Raise it for long builds."}))}),it=l.Optional(l.Object({mode:l.Union([l.Literal("allow"),l.Literal("unsandboxed")],{description:'"allow": stay sandboxed with the domains/paths below; "unsandboxed": run outside the sandbox'}),justification:l.String({description:"Why, in one sentence for the user, who must approve it"}),allow_domains:l.Optional(l.Array(l.String(),{description:"e.g. registry.npmjs.org"})),allow_write:l.Optional(l.Array(l.String(),{description:"Paths to make writable"}))},{description:"Only after the sandbox blocked this command: the access it needs. Never pre-emptively."})),st=l.Object({...Se.properties,sandbox_escalation:it}),be={snippet:"Execute bash commands (ls, grep, find, etc.)",guidelines:["You can inspect DAL_* environment variables for current model and session details."]},rt=l.Object({output:l.String({description:"Combined stdout and stderr, possibly truncated"}),truncated:l.Boolean(),full_output_path:l.Optional(l.String({description:"Full output, when truncated"})),exit_code:l.Number({description:"-1 while the command runs in the background"}),background_id:l.Optional(l.String({description:"Background process id, when it is still running"})),wall_time_seconds:l.Number()});function at(t,e){return{exec:r(async(n,o,{onData:u,signal:i,timeout:y,env:w,yieldTo:s})=>{const $=ot(y);if(i?.aborted)throw new Error("aborted");const S=e();try{await Te(o,Le.F_OK)}catch{throw new Error(`Working directory does not exist: ${o}
|
|
2
|
+
Cannot execute ${t} commands.`)}const b=S.commandTransport==="stdin",c=ve(S.shell,b?S.args:[...S.args,n],{cwd:o,detached:process.platform!=="win32",env:w??ce(),stdio:[b?"pipe":"ignore","pipe","pipe"],windowsHide:!0});b&&(c.stdin?.on("error",()=>{}),c.stdin?.end(n)),c.pid&&Fe(c.pid);let a=!1,m=!1,h;const p=new Promise(A=>{h=r(()=>A("yielded"),"onYielded")});let f;const _=r(()=>{c.pid&&me(c.pid)},"onAbort");try{$!==void 0&&(f=setTimeout(()=>{if(s&&c.exitCode===null&&c.signalCode===null&&s(c)){m=!0,h?.();return}a=!0,c.pid&&me(c.pid)},$)),c.stdout?.on("data",u),c.stderr?.on("data",u),i&&(i.aborted?_():i.addEventListener("abort",_,{once:!0}));const A=ke(c),D=await Promise.race([A,p]);if(D==="yielded")return A.catch(()=>{}),{exitCode:null,yielded:!0};const H=D;if(i?.aborted)throw new Error("aborted");if(a)throw new Error(`timeout:${($??te)/1e3}`);const V=c.signalCode;return{exitCode:H??(V?128+(Ce.signals[V]??0):1)}}finally{c.pid&&!m&&Ne(c.pid),f&&clearTimeout(f),i&&i.removeEventListener("abort",_)}},"exec")}}r(at,"createLocalShellOperations");function dt(t){return at("bash",()=>ue(t?.shellPath))}r(dt,"createLocalBashOperations");const oe=Symbol.for("dal.shell.executionGuards"),ie=globalThis;ie[oe]instanceof Set||(ie[oe]=new Set);const se=ie[oe];function Xt(t){return se.add(t),()=>{se.delete(t)}}r(Xt,"registerShellExecutionGuard");async function lt(t){for(const e of se){let n;try{n=await e(t)}catch(o){return`Command refused: the safety check could not run (${o instanceof Error?o.message:String(o)}).`}if(n!==void 0)return n}}r(lt,"shellExecutionRefusal");const ut=["SESSION_ID","SESSION_FILE","PROVIDER","MODEL","REASONING_LEVEL"];function ct(t,e,n,o,u){const i={...ce()};if(delete i.PI_SESSION_ID,delete i.PI_SESSION_FILE,delete i.PI_PROVIDER,delete i.PI_MODEL,delete i.PI_REASONING_LEVEL,o&&u){const w=u.model;i.PI_SESSION_ID=u.sessionManager.getSessionId();const s=u.sessionManager.getSessionFile();s&&(i.PI_SESSION_FILE=s),w&&(i.PI_PROVIDER=w.provider,i.PI_MODEL=w.id),u.thinkingLevel&&(i.PI_REASONING_LEVEL=u.thinkingLevel)}for(const w of ut){delete i[`DAL_${w}`];const s=i[`PI_${w}`];s!==void 0&&(i[`DAL_${w}`]=s)}const y={command:t,cwd:e,env:i};return n?n(y):y}r(ct,"resolveSpawnContext");const mt=5,pt=100;class ft extends Pe{static{r(this,"BashResultRenderComponent")}state={cachedWidth:void 0,cachedLines:void 0,cachedSkipped:void 0}}function ht(t){const e=t/1e3;if(e<60)return`${e.toFixed(1)}s`;const n=Math.floor(e),o=Math.floor(n/60),u=n%60;return o<60?`${o}m ${u}s`:`${Math.floor(o/60)}h ${o%60}m ${u}s`}r(ht,"formatDuration");function wt(t,e,n=!1){const o=fe(t?.command),u=fe(t?.description)?.trim(),i=t?.timeout,y=i?x.fg("muted",G(P(" (\u8D85\u65F6 {seconds} \u79D2)"),{seconds:i})):"";if(u){const s=x.fg("toolTitle",x.bold(u))+y;return!n||!o?s:`${s}
|
|
3
|
+
${x.fg("muted",` \u23BF ${e} ${o.trim()}`)}`}const w=o===null?qe(x):o?x.fg("dim",ze(o.replace(/\s+/g," ").trim(),42)):x.fg("dim","\u2026");return`${x.fg("toolTitle",x.bold(e))} ${w}${y}`}r(wt,"formatShellCall");function St(t,e,n,o,u,i,y,w){const s=t.state;t.clear();const $=bt(n,u,i,w);if(!n.expanded&&!y){const a=pe(e,o),m=Xe(a),h=[];m>0&&h.push(G(P("{count} \u884C"),{count:m})),$&&h.push($);const p=Ke(x,h);p&&t.addChild(new W(p,0,0));return}let S=pe(e,o).trim();const b=e.details?.truncation,c=e.details?.fullOutputPath;if(!n.isPartial&&b?.truncated&&c&&S.endsWith("]")){const a=S.lastIndexOf(`
|
|
4
4
|
|
|
5
|
-
[`);
|
|
5
|
+
[`);a!==-1&&S.slice(a).includes(c)&&(S=S.slice(0,a).trimEnd())}if(S){const a=S.split(`
|
|
6
6
|
`).map(m=>x.fg("toolOutput",m)).join(`
|
|
7
|
-
`);n.expanded?t.addChild(new
|
|
8
|
-
${
|
|
9
|
-
${x.fg("warning",`[${
|
|
10
|
-
${x.fg("muted",$)}`,0,0))}
|
|
11
|
-
${_}`:_,
|
|
7
|
+
`);n.expanded?t.addChild(new W(`
|
|
8
|
+
${a}`,0,0)):t.addChild({render:r(m=>{if(s.cachedLines===void 0||s.cachedWidth!==m){const h=Ae(a,mt,m);s.cachedLines=h.visualLines,s.cachedSkipped=h.skippedCount,s.cachedWidth=m}if(s.cachedSkipped&&s.cachedSkipped>0){const h=x.fg("muted",G(P("... (\u524D\u9762\u8FD8\u6709 {count} \u884C\uFF0C"),{count:s.cachedSkipped}))+` ${Ie("app.tools.expand",P("\u5373\u53EF\u5C55\u5F00"))}${x.fg("muted",")")}`;return["",De(h,m,"..."),...s.cachedLines??[]]}return["",...s.cachedLines??[]]},"render"),invalidate:r(()=>{s.cachedWidth=void 0,s.cachedLines=void 0,s.cachedSkipped=void 0},"invalidate")})}if(b?.truncated||c){const a=[];c&&a.push(G(P("\u5B8C\u6574\u8F93\u51FA\uFF1A{path}"),{path:c})),b?.truncated&&(b.truncatedBy==="lines"?a.push(G(P("\u5DF2\u622A\u65AD\uFF1A\u663E\u793A {shown}/{total} \u884C"),{shown:b.outputLines,total:b.totalLines})):a.push(G(P("\u5DF2\u622A\u65AD\uFF1A\u663E\u793A\u4E86 {shown} \u884C\uFF08\u4E0A\u9650 {limit}\uFF09"),{shown:b.outputLines,limit:Ze(b.maxBytes??Qe)}))),t.addChild(new W(`
|
|
9
|
+
${x.fg("warning",`[${a.join(". ")}]`)}`,0,0))}$&&t.addChild(new W(`
|
|
10
|
+
${x.fg("muted",$)}`,0,0))}r(St,"rebuildBashResultRenderComponent");function bt(t,e,n,o){let u;if(!t.isPartial&&o!==void 0)u=o;else if(e!==void 0)u=(n??Date.now())-e;else return;if(!(!t.isPartial&&u<100))return`${t.isPartial?P("\u5DF2\u8FD0\u884C"):P("\u8017\u65F6")} ${ht(u)}`}r(bt,"bashTimingLabel");function xt(t,e,n){const o=n?.operations??e.defaultOperations?.()??dt({shellPath:n?.shellPath}),u=n?.commandPrefix,i=n?.exposeSessionEnvironment??!0,y=n?.spawnHook,w=n?.sandbox,s=n?.operations===void 0,$=w?.describeForModel(),S=n?.background;let b=!1;const c=r(a=>`Execute a ${e.shellName} command in the current working directory; returns stdout and stderr. Long output is cut to its start and end (error lines kept) and the full output saved to a file named in the result. ${a?`A command still running after \`timeout\` seconds (default ${ne}) keeps running in the background: you get its id and the output so far, then use the process tool to poll or kill it.`:`A command still running after \`timeout\` seconds (default ${te/1e3}) is killed.`}${$?` ${$}`:""}`,"describe");return{name:e.name,label:e.label,description:c(!1),prepareLoadout:S&&s?a=>(b=a.declared.some(m=>m.name==="process"),b?{descriptions:{[e.name]:c(!0)}}:void 0):void 0,promptSnippet:e.promptSnippet,promptGuidelines:i&&e.promptGuidelines?[...e.promptGuidelines]:void 0,executionMode:"sequential",executionModeFor:e.readOnlyCommand&&!u?a=>e.readOnlyCommand?.(a?.command)?"parallel":void 0:void 0,parameters:w?.active?st:Se,outputSchema:rt,constrainedSampling:{type:"json_schema",strict:"prefer"},async execute(a,m,h,p,f){const{command:_,timeout:A}=m;p&&p({content:[],details:void 0});const D=w??(s?Ue():void 0),H=await lt({toolName:e.name,command:_,cwd:f?.cwd||t,sessionFile:f?.sessionManager?.getSessionFile(),...D?.active?{tempDir:D.scratchDir()}:{}});if(H!==void 0)throw new le(H,He(void 0,Ge("dangerous-command",H)));const V=u?`${u}
|
|
11
|
+
${_}`:_,k=ct(V,f?.cwd||t,y,i,f);let L;if(D?.active){if(!e.sandboxShell)throw new Error(`Command refused: ${e.shellName} commands cannot run inside the OS sandbox yet, and the sandbox level is "${D.level}". Use the bash tool, or the user can opt out with \`dal --sandbox off\`.`);L=await D.prepare({command:k.command,cwd:k.cwd,shell:e.sandboxShell(n?.shellPath),shellKind:e.sandboxShellKind??"bash",env:k.env,toolCallId:a,toolName:e.name,escalation:m.sandbox_escalation,ctx:f,signal:h})}const C=new We({tempFilePrefix:e.tempFilePrefix,maxBytes:ee});let Y=!0,j,X=!1,re=0;const K=r(()=>{if(!p||!X)return;X=!1,re=Date.now();const d=C.snapshot({persistIfTruncated:!0});p({content:[{type:"text",text:d.content||""}],details:{truncation:d.truncation.truncated?d.truncation:void 0,fullOutputPath:d.fullOutputPath}})},"emitOutputUpdate"),q=r(()=>{j&&(clearTimeout(j),j=void 0)},"clearUpdateTimer"),xe=r(()=>{if(!p)return;X=!0;const d=pt-(Date.now()-re);if(d<=0){q(),K();return}j??=setTimeout(()=>{j=void 0,K()},d)},"scheduleOutputUpdate"),Ee=r(d=>{Y&&(C.append(d),xe())},"handleData"),_e=r(async()=>{Y=!1,C.finish(),q(),K();const d=C.snapshot({persistIfTruncated:!0});return await C.closeTempFile(),d},"finishOutput"),z=r(async(d="(no output)")=>{const O=await _e(),M=await C.readFullOutput(tt),T=Ye()?void 0:Ve(M.content),E=et(T?.text??M.content,ee);let I=O.fullOutputPath;(E.truncated||T)&&!I&&(I=await Me(e.tempFilePrefix,".log",M.content));let F=E.content||d,R;const U=O.truncation.totalLines;return E.truncated?(R={truncation:{content:E.content,truncated:!0,truncatedBy:"bytes",totalLines:U,totalBytes:O.truncation.totalBytes,outputLines:E.headLines+E.tailLines,outputBytes:Buffer.byteLength(E.content,"utf-8"),lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:U,maxBytes:ee},fullOutputPath:I},F+=`
|
|
12
12
|
|
|
13
|
-
[Truncated: first ${E.headLines} and last ${E.tailLines} of ${E.totalLines} lines shown${
|
|
13
|
+
[Truncated: first ${E.headLines} and last ${E.tailLines} of ${E.totalLines} lines shown${T?`, after condensing ${U} lines (${T.summary})`:""}; read more with read (offset/limit) or grep. Full output: ${I}]`):T&&(R={fullOutputPath:I},F+=`
|
|
14
14
|
|
|
15
|
-
[Condensed: ${
|
|
15
|
+
[Condensed: ${T.summary}. Full output: ${I}]`),{text:F,details:R,snapshot:O}},"modelOutput"),B=r((d,O)=>`${d?`${d}
|
|
16
16
|
|
|
17
|
-
`:""}${O}`,"appendStatus"),
|
|
17
|
+
`:""}${O}`,"appendStatus"),ae=performance.now();let v;const J=S&&s&&b?d=>{Y=!1;try{return v=S.adopt({child:d,command:_,cwd:k.cwd,...L?{prepared:L}:{},...C.handOff()}),!0}catch{return Y=!0,!1}}:void 0;try{let d;try{const g=await o.exec(L?.command??k.command,k.cwd,{onData:Ee,signal:h,timeout:A??(J?ne:void 0),env:k.env,...J?{yieldTo:J}:{}});if(g.yielded&&v){const{text:N,details:Z}=await z(""),Oe=A??ne,ge=v.urls.length>0?` It printed ${v.urls.join(" ")}.`:"",ye=`[Still running after ${Oe}s, now in the background as ${v.id}.${ge} For new output and the exit code call process with action "poll" and id "${v.id}"; "kill" stops it.]`,de=await C.readFullOutput(we);return{content:[{type:"text",text:B(N,ye)}],details:{...Z,background:v},structuredContent:{output:de.content,truncated:de.truncated,exit_code:-1,background_id:v.id,wall_time_seconds:Math.round((performance.now()-ae)/100)/10}}}d=g.exitCode}catch(g){const{text:N}=await z("");if(await L?.finish(null,""),g instanceof Error&&g.message==="aborted")throw new Error(B(N,"Command aborted"));if(g instanceof Error&&g.message.startsWith("timeout:")){const Z=g.message.split(":")[1];throw new Error(B(N,`Command timed out after ${Z} seconds`))}throw g}const{text:O,details:M,snapshot:T}=await z(),E=await L?.finish(d,T.content||"");if(E&&L)throw new le(`${B(O,`Command exited with code ${d??"(none)"}`)}
|
|
18
18
|
|
|
19
|
-
${Re(E)}`,{...
|
|
20
|
-
${g}`:
|
|
19
|
+
${Re(E)}`,{...M,sandbox:L.details});if(d===null)throw new Error(B(O,"Command terminated without an exit code"));const I=Math.round((performance.now()-ae)/100)/10,F=await C.readFullOutput(we),R={output:F.content,truncated:F.truncated,...F.truncated&&T.fullOutputPath?{full_output_path:T.fullOutputPath}:{},exit_code:d,wall_time_seconds:I},U=L?.details.escalation?L.details:void 0,Q=U?{...M,sandbox:U}:M;if(d!==0){const g=d===127?await Be(O):void 0,N=B(O,`Command exited with code ${d}`);return{content:[{type:"text",text:g?`${N}
|
|
20
|
+
${g}`:N}],details:Q,structuredContent:R,isError:!0}}return{content:[{type:"text",text:O}],details:Q,structuredContent:R}}finally{q()}},renderCall(a,m,h){const p=h.state;h.executionStarted&&p.startedAt===void 0&&(p.startedAt=Date.now(),p.endedAt=void 0);const f=h.lastComponent??new W("",0,0);return f.setText(wt(a,e.prompt,h.expanded===!0)),f},renderResult(a,m,h,p){const f=p.state;f.startedAt!==void 0&&m.isPartial&&!f.interval&&(f.interval=setInterval(()=>p.invalidate(),1e3)),(!m.isPartial||p.isError)&&(f.endedAt??=Date.now(),f.interval&&(clearInterval(f.interval),f.interval=void 0));const _=p.lastComponent??new ft;return St(_,a,m,p.showImages,f.startedAt,f.endedAt,p.isError,p.durationMs),_.invalidate(),_}}}r(xt,"createShellToolDefinition");const Et={name:"bash",label:"bash",shellName:"bash",prompt:"$",promptSnippet:be.snippet,promptGuidelines:be.guidelines,tempFilePrefix:"dal-bash",readOnlyCommand:je,sandboxShell:r(t=>ue(t).shell,"sandboxShell")};function _t(t,e){return xt(t,Et,e)}r(_t,"createBashToolDefinition");function Kt(t,e){const n=_t(t,e),o=Je(n);return Object.assign(o,{promptSnippet:n.promptSnippet,promptGuidelines:n.promptGuidelines}),o}r(Kt,"createBashTool");export{be as bashToolSystemPromptContribution,Kt as createBashTool,_t as createBashToolDefinition,dt as createLocalBashOperations,at as createLocalShellOperations,xt as createShellToolDefinition,Xt as registerShellExecutionGuard,it as sandboxEscalationSchema,lt as shellExecutionRefusal};
|
|
@@ -16,7 +16,7 @@ declare const editSchema: Type.TObject<{
|
|
|
16
16
|
}>;
|
|
17
17
|
export declare const editToolSystemPromptContribution: {
|
|
18
18
|
readonly snippet: "Make precise file edits with exact text replacement, including multiple disjoint edits in one call";
|
|
19
|
-
readonly guidelines: readonly ["Use edit for precise changes
|
|
19
|
+
readonly guidelines: readonly ["Use edit for precise changes: each edits[].oldText matches the original file exactly, is unique and as short as that allows; several changes to one file go in one call, without overlapping"];
|
|
20
20
|
};
|
|
21
21
|
export type EditToolInput = Static<typeof editSchema>;
|
|
22
22
|
export interface EditToolDetails {
|
package/dist/core/tools/edit.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var B=Object.defineProperty;var d=(e,t)=>B(e,"name",{value:t,configurable:!0});import{Box as
|
|
2
|
-
`))
|
|
3
|
-
`);return!c||c===o?void 0:
|
|
1
|
+
var B=Object.defineProperty;var d=(e,t)=>B(e,"name",{value:t,configurable:!0});import{Box as b,Container as W,Spacer as x,Text as E}from"@earendil-works/pi-tui";import{constants as A}from"fs";import{access as k,readFile as q,writeFile as N}from"fs/promises";import{Type as g}from"typebox";import{renderDiff as S}from"../../modes/interactive/components/diff.js";import{splitBom as z}from"../../utils/text.js";import{applyEditsToNormalizedContent as J,computeEditsDiff as M,detectLineEnding as U,generateDiffString as G,generateUnifiedPatch as H,normalizeToLF as Q,restoreLineEndings as X}from"./edit-diff.js";import{withFileMutationQueue as V}from"./file-mutation-queue.js";import{resolveToCwd as Y}from"./path-utils.js";import{renderToolPath as Z,str as P}from"./render-utils.js";import{wrapToolDefinition as ee}from"./tool-definition-wrapper.js";const te=g.Object({oldText:g.String({description:"Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call."}),newText:g.String({description:"Replacement text for this targeted edit."})},{}),re=g.Object({path:g.String({description:"Path to the file to edit (relative or absolute)"}),edits:g.Array(te,{description:"One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead."})},{}),D={snippet:"Make precise file edits with exact text replacement, including multiple disjoint edits in one call",guidelines:["Use edit for precise changes: each edits[].oldText matches the original file exactly, is unique and as short as that allows; several changes to one file go in one call, without overlapping"]};function F(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.oldText=="string"&&typeof t.newText=="string"}d(F,"isSingleEditInput");const ie={readFile:d(e=>q(e),"readFile"),writeFile:d((e,t)=>N(e,t,"utf-8"),"writeFile"),access:d(e=>k(e,A.R_OK|A.W_OK),"access")};function ne(e){if(!e||typeof e!="object")return e;const t=e;if(typeof t.edits=="string")try{const o=JSON.parse(t.edits);Array.isArray(o)?t.edits=o:F(o)&&(t.edits=[o])}catch{}else F(t.edits)&&(t.edits=[t.edits]);const i=t;if(typeof i.oldText!="string"||typeof i.newText!="string")return t;const r=Array.isArray(i.edits)?[...i.edits]:[];r.push({oldText:i.oldText,newText:i.newText});const{oldText:f,newText:a,...n}=i;return{...n,edits:r}}d(ne,"prepareEditArguments");function oe(e){if(!Array.isArray(e.edits)||e.edits.length===0)throw new Error("Edit tool input is invalid. edits must contain at least one replacement.");return{path:e.path,edits:e.edits}}d(oe,"validateEditInput");function se(){return Object.assign(new b(0,0),{preview:void 0,previewArgsKey:void 0,previewPending:!1,settledError:!1})}d(se,"createEditCallRenderComponent");function de(e,t){if(t instanceof b){const r=t;return e.callComponent=r,r}if(e.callComponent)return e.callComponent;const i=se();return e.callComponent=i,i}d(de,"getEditCallRenderComponent");function O(e){if(!e)return null;const t=typeof e.path=="string"?e.path:typeof e.file_path=="string"?e.file_path:null;return t?Array.isArray(e.edits)&&e.edits.length>0&&e.edits.every(i=>typeof i?.oldText=="string"&&typeof i?.newText=="string")?{path:t,edits:e.edits}:typeof e.oldText=="string"&&typeof e.newText=="string"?{path:t,edits:[{oldText:e.oldText,newText:e.newText}]}:null:null}d(O,"getRenderablePreviewInput");function ae(e){let t=0,i=0;for(const r of e.split(`
|
|
2
|
+
`))r.startsWith("+")&&!r.startsWith("+++")&&t++,r.startsWith("-")&&!r.startsWith("---")&&i++;return{additions:t,removals:i}}d(ae,"diffStats");function le(e,t,i){const r=Z(P(e?.file_path??e?.path),t,i);return`${t.fg("toolTitle",t.bold("edit"))} ${r}`}d(le,"formatEditCall");function fe(e,t,i,r,f){const a=P(e?.file_path??e?.path),n=t&&!("error"in t)?t.diff:void 0,o=t&&"error"in t?t.error:void 0;if(f){const c=i.content.filter(l=>l.type==="text").map(l=>l.text||"").join(`
|
|
3
|
+
`);return!c||c===o?void 0:r.fg("error",c)}const s=i.details?.diff;if(s&&s!==n)return S(s,{filePath:a??void 0})}d(fe,"formatEditResult");function ce(e,t,i){return e?"error"in e?r=>i.bg("toolErrorBg",r):r=>i.bg("toolSuccessBg",r):t?r=>i.bg("toolErrorBg",r):r=>i.bg("toolPendingBg",r)}d(ce,"getEditHeaderBg");function _(e,t,i,r,f,a){e.setPaddingX(a),e.setBgFn("error"in(e.preview??{})||e.settledError?ce(e.preview,e.settledError,i):void 0),e.clear();let n=le(t,i,r);if(!f&&e.preview&&!("error"in e.preview)){const{additions:s,removals:c}=ae(e.preview.diff);n+=i.fg("muted",` +${s} / -${c}`)}if(e.addChild(new E(n,0,0)),!e.preview||!f&&!("error"in e.preview))return e;const o="error"in e.preview?i.fg("error",e.preview.error):S(e.preview.diff);return e.addChild(new x(1)),e.addChild(new E(o,0,0)),e}d(_,"buildEditCallComponent");function I(e,t,i){const r=e.preview,f=r===void 0||("error"in r&&"error"in t?r.error!==t.error:"error"in r!="error"in t)||!("error"in r)&&!("error"in t)&&(r.diff!==t.diff||r.firstChangedLine!==t.firstChangedLine);return e.preview=t,e.previewArgsKey=i,e.previewPending=!1,f}d(I,"setEditPreview");function pe(e,t){const i=t?.operations??ie;return{name:"edit",label:"edit",description:"Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.",promptSnippet:D.snippet,promptGuidelines:[...D.guidelines],parameters:re,constrainedSampling:{type:"json_schema",strict:"prefer"},renderShell:"self",prepareArguments:ne,async execute(r,f,a,n,o){const{path:s,edits:c}=oe(f),l=Y(s,o?.cwd||e);return V(l,async()=>{const p=d(()=>{if(a?.aborted)throw new Error("Operation aborted")},"throwIfAborted");p();try{await i.access(l)}catch(y){p();const $=y instanceof Error&&"code"in y?`Error code: ${y.code}`:String(y);throw new Error(`Could not edit file: ${s}. ${$}.`)}p();const w=(await i.readFile(l)).toString("utf-8");p();const{bom:u,text:C}=z(w),K=U(C),R=Q(C),{baseContent:T,newContent:m}=J(R,c,s);p();const j=u+X(m,K);await i.writeFile(l,j),p();const v=G(T,m),L=H(s,T,m);return{content:[{type:"text",text:`Successfully replaced ${c.length} block(s) in ${s}.`}],details:{diff:v.diff,patch:L,firstChangedLine:v.firstChangedLine}}})},renderCall(r,f,a){const n=de(a.state,a.lastComponent),o=O(r),s=o?JSON.stringify({path:o.path,edits:o.edits}):void 0;if(n.previewArgsKey!==s&&(n.preview=void 0,n.previewArgsKey=s,n.previewPending=!1,n.settledError=!1),a.argsComplete&&o&&!n.preview&&!n.previewPending){n.previewPending=!0;const c=s;M(o.path,o.edits,a.cwd).then(l=>{n.previewArgsKey===c&&(I(n,l,c),a.invalidate())})}return _(n,r,f,a.cwd,a.expanded,a.outputPad)},renderResult(r,f,a,n){const o=n.state.callComponent,s=O(n.args),c=s?JSON.stringify({path:s.path,edits:s.edits}):void 0,l=r,p=n.isError?void 0:l.details?.diff;let h=!1;o&&(typeof p=="string"&&(h=I(o,{diff:p,firstChangedLine:l.details?.firstChangedLine},c)||h),o.settledError!==n.isError&&(o.settledError=n.isError,h=!0),h&&_(o,n.args,a,n.cwd,f.expanded,n.outputPad));const w=fe(n.args,o?.preview,l,a,n.isError),u=n.lastComponent??new W;return u.clear(),w&&(u.addChild(new x(1)),u.addChild(new E(w,1+n.outputPad,0))),u}}}d(pe,"createEditToolDefinition");function Ae(e,t){return ee(pe(e,t))}d(Ae,"createEditTool");export{Ae as createEditTool,pe as createEditToolDefinition,D as editToolSystemPromptContribution};
|
package/dist/core/tools/grep.js
CHANGED
|
@@ -6,7 +6,7 @@ ${C(b("... (\u8FD8\u6709 {count} \u884C\uFF0C"),{count:F})}`)} ${bt("app.tools.e
|
|
|
6
6
|
${l.fg("warning",C(b("[\u5DF2\u622A\u65AD\uFF1A{reasons}]"),{reasons:s.join(", ")}))}`}return r}i(Pt,"formatGrepResult");function Rt(n,o){const l=o?.operations;return{name:"grep",label:"grep",description:`Search file contents for a pattern. Returns matching lines with file paths and line numbers. Respects .gitignore. Output is truncated to ${ft} matches or ${z/1024}KB (whichever is hit first). Long lines are truncated to ${pt} chars.`,promptSnippet:_t.snippet,parameters:Mt,async execute(d,{pattern:m,path:p,glob:r,ignoreCase:u,literal:x,context:L,limit:s},O,U,F){return new Promise((P,$)=>{if(O?.aborted){$(new Error("Operation aborted"));return}let H=!1;const T=i(E=>{H||(H=!0,E())},"settle");(async()=>{try{const E=await yt("rg");if(!E){T(()=>$(new Error("ripgrep (rg) is not available and could not be downloaded")));return}const S=Lt(p||".",F?.cwd||n),X=l??At,J=l?void 0:st(S);if(J){T(()=>$(new Error(J)));return}let K;try{K=await X.isDirectory(S)}catch{T(()=>$(new Error(`Path not found: ${S}`)));return}const D=L&&L>0?L:0,M=Math.max(1,s??ft),V=i(e=>{if(K){const t=B.relative(S,e);if(t&&!t.startsWith(".."))return t.replace(/\\/g,"/")}return B.basename(e)},"formatPath"),W=new Map,dt=i(async e=>{let t=W.get(e);if(!t){try{t=(await X.readFile(e)).replace(/\r\n/g,`
|
|
7
7
|
`).replace(/\r/g,`
|
|
8
8
|
`).split(`
|
|
9
|
-
`)}catch{t=[]}W.set(e,t)}return t},"getFileLines"),_=["--json","--line-number","--color=never","--hidden"];u&&_.push("--ignore-case"),x&&_.push("--fixed-strings"),r&&_.push("--glob",r),_.push("--",m,S);const v=$t(E,_,{stdio:["ignore","pipe","pipe"]}),Y=wt({input:v.stdout});let j="",A=0,q=!1,R=!1,Q=!1,Z=!1;const k=[],tt=i(()=>{Y.close(),O?.removeEventListener("abort",nt)},"cleanup"),et=i((e=!1)=>{v.killed||(Z=e,v.kill())},"stopChild"),nt=i(()=>{Q=!0,et()},"onAbort");O?.addEventListener("abort",nt,{once:!0}),v.stderr?.on("data",e=>{j+=e.toString()});const mt=i(async(e,t)=>{const c=V(e),w=await dt(e);if(!w.length)return[`${c}:${t}: (unable to read file)`];const f=[],y=D>0?Math.max(1,t-D):t,h=D>0?Math.min(w.length,t+D):t;for(let g=y;g<=h;g++){const G=(w[g-1]??"").replace(/\r/g,""),N=g===t,{text:it,wasTruncated:ht}=ut(G);ht&&(R=!0),N?f.push(`${c}:${g}: ${it}`):f.push(`${c}-${g}- ${it}`)}return f},"formatBlock"),rt=[];Y.on("line",e=>{if(!e.trim()||A>=M)return;let t;try{t=JSON.parse(e)}catch{return}if(t.type==="match"){A++;const c=t.data?.path?.text,w=t.data?.line_number,f=t.data?.lines?.text;if(c&&!l&&st(B.resolve(S,c))){A--;return}c&&typeof w=="number"&&rt.push({filePath:c,lineNumber:w,lineText:f}),A>=M&&(q=!0,et(!0))}}),v.on("error",e=>{tt(),T(()=>$(new Error(`Failed to run ripgrep: ${e.message}`)))}),v.on("close",async e=>{if(tt(),Q){T(()=>$(new Error("Operation aborted")));return}if(!Z&&e!==0&&e!==1){const h=j.trim()||`ripgrep exited with code ${e}`;T(()=>$(new Error(h)));return}if(A===0){T(()=>P({content:[{type:"text",text:"No matches found"}],details:void 0}));return}for(const h of rt)if(D===0&&h.lineText!==void 0){const g=V(h.filePath),ot=h.lineText.replace(/\r\n/g,`
|
|
9
|
+
`)}catch{t=[]}W.set(e,t)}return t},"getFileLines"),_=["--no-config","--json","--line-number","--color=never","--hidden"];u&&_.push("--ignore-case"),x&&_.push("--fixed-strings"),r&&_.push("--glob",r),_.push("--",m,S);const v=$t(E,_,{stdio:["ignore","pipe","pipe"]}),Y=wt({input:v.stdout});let j="",A=0,q=!1,R=!1,Q=!1,Z=!1;const k=[],tt=i(()=>{Y.close(),O?.removeEventListener("abort",nt)},"cleanup"),et=i((e=!1)=>{v.killed||(Z=e,v.kill())},"stopChild"),nt=i(()=>{Q=!0,et()},"onAbort");O?.addEventListener("abort",nt,{once:!0}),v.stderr?.on("data",e=>{j+=e.toString()});const mt=i(async(e,t)=>{const c=V(e),w=await dt(e);if(!w.length)return[`${c}:${t}: (unable to read file)`];const f=[],y=D>0?Math.max(1,t-D):t,h=D>0?Math.min(w.length,t+D):t;for(let g=y;g<=h;g++){const G=(w[g-1]??"").replace(/\r/g,""),N=g===t,{text:it,wasTruncated:ht}=ut(G);ht&&(R=!0),N?f.push(`${c}:${g}: ${it}`):f.push(`${c}-${g}- ${it}`)}return f},"formatBlock"),rt=[];Y.on("line",e=>{if(!e.trim()||A>=M)return;let t;try{t=JSON.parse(e)}catch{return}if(t.type==="match"){A++;const c=t.data?.path?.text,w=t.data?.line_number,f=t.data?.lines?.text;if(c&&!l&&st(B.resolve(S,c))){A--;return}c&&typeof w=="number"&&rt.push({filePath:c,lineNumber:w,lineText:f}),A>=M&&(q=!0,et(!0))}}),v.on("error",e=>{tt(),T(()=>$(new Error(`Failed to run ripgrep: ${e.message}`)))}),v.on("close",async e=>{if(tt(),Q){T(()=>$(new Error("Operation aborted")));return}if(!Z&&e!==0&&e!==1){const h=j.trim()||`ripgrep exited with code ${e}`;T(()=>$(new Error(h)));return}if(A===0){T(()=>P({content:[{type:"text",text:"No matches found"}],details:void 0}));return}for(const h of rt)if(D===0&&h.lineText!==void 0){const g=V(h.filePath),ot=h.lineText.replace(/\r\n/g,`
|
|
10
10
|
`).replace(/\r/g,"").replace(/\n$/,""),{text:G,wasTruncated:N}=ut(ot);N&&(R=!0),k.push(`${g}:${h.lineNumber}: ${G}`)}else{const g=await mt(h.filePath,h.lineNumber);k.push(...g)}const t=k.join(`
|
|
11
11
|
`),c=Dt(t,{maxLines:Number.MAX_SAFE_INTEGER});let w=c.content;const f={},y=[];q&&(y.push(`${M} matches limit reached. Use limit=${M*2} for more, or refine pattern`),f.matchLimitReached=M),c.truncated&&(y.push(`${lt(z)} limit reached`),f.truncation=c),R&&(y.push(`Some lines truncated to ${pt} chars. Use read tool to see full lines`),f.linesTruncated=!0),y.length>0&&(w+=`
|
|
12
12
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
2
|
+
export declare function expandTempDirVariable(filePath: string, tempDir: string): string;
|
|
2
3
|
export declare function expandPath(filePath: string): string;
|
|
3
4
|
export declare function resolveToCwd(filePath: string, cwd: string): string;
|
|
4
5
|
export declare function resolveReadPath(filePath: string, cwd: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=Object.defineProperty;var n=(t,
|
|
1
|
+
var d=Object.defineProperty;var n=(t,e)=>d(t,"name",{value:e,configurable:!0});import{accessSync as x,constants as l}from"node:fs";import{access as P}from"node:fs/promises";import{normalizePath as V,resolvePath as h}from"../../utils/paths.js";const A="\u202F";function p(t){return t.replace(/ (AM|PM)\./gi,`${A}$1.`)}n(p,"tryMacOSScreenshotPath");function m(t){return t.normalize("NFD")}n(m,"tryNFDVariant");function f(t){return t.replace(/'/g,"\u2019")}n(f,"tryCurlyQuoteVariant");function u(t){try{return x(t,l.F_OK),!0}catch{return!1}}n(u,"fileExists");async function s(t){try{return await P(t,l.F_OK),!0}catch{return!1}}n(s,"pathExists");const R=/^(?:\$TMPDIR|\$\{TMPDIR\})(?=[\\/]|$)/;function E(t,e){const r=R.exec(t);return r?e+t.slice(r[0].length):t}n(E,"expandTempDirVariable");function M(t){return V(t,{normalizeUnicodeSpaces:!0,stripAtPrefix:!0})}n(M,"expandPath");function y(t,e){return h(t,e,{normalizeUnicodeSpaces:!0,stripAtPrefix:!0})}n(y,"resolveToCwd");function S(t,e){const r=y(t,e);if(u(r))return r;const i=p(r);if(i!==r&&u(i))return i;const a=m(r);if(a!==r&&u(a))return a;const o=f(r);if(o!==r&&u(o))return o;const c=f(a);return c!==r&&u(c)?c:r}n(S,"resolveReadPath");async function C(t,e){const r=y(t,e);if(await s(r))return r;const i=p(r);if(i!==r&&await s(i))return i;const a=m(r);if(a!==r&&await s(a))return a;const o=f(r);if(o!==r&&await s(o))return o;const c=f(a);return c!==r&&await s(c)?c:r}n(C,"resolveReadPathAsync");export{M as expandPath,E as expandTempDirVariable,s as pathExists,S as resolveReadPath,C as resolveReadPathAsync,y as resolveToCwd};
|
package/dist/dal/builtins.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=Object.defineProperty;var r=(n,e)=>a(n,"name",{value:e,configurable:!0});import{execFileSync as P}from"node:child_process";import{readFileSync as l}from"node:fs";import{createRequire as f}from"node:module";import{dirname as u,join as T}from"node:path";import{setAmbientAuthPolicy as m,setEnvApiKeyPolicy as d}from"@earendil-works/pi-ai";import{houseProvidersEnforced as E,isProviderConfigurable as y}from"../core/house-providers.js";import{BUNDLED_EXTENSION_PACKAGES as S,PROVIDER_EXTENSION_PACKAGES as x,SAFETY_CRITICAL_PACKAGES as _}from"./manifest.js";function H(){if(!E())return;const n=r(e=>y(e),"allowed");d(n),m(n)}r(H,"applyDalEnvApiKeyPolicy");import{BUNDLED_EXTENSION_PACKAGES as D,SAFETY_CRITICAL_PACKAGES as b}from"./manifest.js";function p(n=S){const e=f(import.meta.url),t=[];for(const i of n)try{const o=e.resolve(`${i}/package.json`),c=JSON.parse(l(o,"utf8"));for(const s of c.pi?.extensions??[])t.push(T(u(o),s))}catch(o){_.has(i)&&process.stderr.write(`dal: \u5B89\u5168\u6269\u5C55 ${i} \u52A0\u8F7D\u5931\u8D25\uFF0C\u5371\u9669\u547D\u4EE4\u7684\u5BA1\u6279\u95E8\u5DF2\u5931\u6548 \u2014 ${o instanceof Error?o.message:String(o)}
|
|
2
2
|
\u91CD\u65B0\u5B89\u88C5\u53EF\u6062\u590D\uFF1Anpm i -g dal-code@latest
|
|
3
|
-
`)}return
|
|
3
|
+
`)}return t}r(p,"bundledPackageExtensionPaths");function X(){return p()}r(X,"dalBuiltinExtensionPaths");function K(){return p(x)}r(K,"dalProviderExtensionPaths");function Y(){if(!(process.platform!=="darwin"||["HTTPS_PROXY","https_proxy","HTTP_PROXY","http_proxy","ALL_PROXY","all_proxy"].some(e=>process.env[e])))try{const e=P("scutil",["--proxy"],{encoding:"utf8",timeout:2e3}),t=r(s=>e.match(new RegExp(`${s}\\s*:\\s*(\\S+)`))?.[1],"get"),i=r(s=>t(`${s}Enable`)==="1","enabled"),o=i("HTTPS")?`http://${t("HTTPSProxy")}:${t("HTTPSPort")}`:i("HTTP")?`http://${t("HTTPProxy")}:${t("HTTPPort")}`:void 0;if(!o||o.includes("undefined"))return;process.env.HTTPS_PROXY=o,process.env.HTTP_PROXY=o;const c=new Set((process.env.NO_PROXY??process.env.no_proxy??"").split(",").filter(Boolean));for(const s of["localhost","127.0.0.1","::1"])c.add(s);process.env.NO_PROXY=[...c].join(",")}catch{}}r(Y,"applyDalSystemProxyFallback");export{D as BUNDLED_EXTENSION_PACKAGES,b as SAFETY_CRITICAL_PACKAGES,H as applyDalEnvApiKeyPolicy,Y as applyDalSystemProxyFallback,X as dalBuiltinExtensionPaths,K as dalProviderExtensionPaths};
|
package/dist/dal/manifest.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type BundledExtensionActivation =
|
|
|
6
6
|
| "halo-app"
|
|
7
7
|
| "tui";
|
|
8
8
|
export declare const BUNDLED_EXTENSION_PACKAGES: readonly string[];
|
|
9
|
+
export declare const PROVIDER_EXTENSION_PACKAGES: readonly string[];
|
|
9
10
|
export declare const SAFETY_CRITICAL_PACKAGES: ReadonlySet<string>;
|
|
10
11
|
export interface BundledExtensionInfo {
|
|
11
12
|
name: string;
|
package/dist/dal/manifest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var s=Object.defineProperty;var i=(e,a)=>s(e,"name",{value:a,configurable:!0});import{createRequire as u}from"node:module";import{getLanguage as r,translate as d}from"@dalcode/dal-pi-kit";const c=[{package:"@dalcode/dal-plugins",label:"\u63D2\u4EF6\u517C\u5BB9",description:"\u8BA9\u793E\u533A\u63D2\u4EF6\u5728 DAL \u4E2D\u53EF\u7528\uFF0C\u5E76\u63D0\u4F9B\u63D2\u4EF6\u641C\u7D22",activation:"always"},{package:"@dalcode/deepailab",label:"DeepAILab \u8D26\u53F7",description:"DeepAILab \u767B\u5F55\u3001\u5957\u9910\u4E0E\u6A21\u578B\u63D0\u4F9B\u65B9\uFF08/login\u3001/account\uFF09",activation:"always"},{package:"@dalcode/dal-gateway",label:"DAL \u7F51\u5173",description:"\u7ECF DAL \u7F51\u5173\u8C03\u7528\u6A21\u578B",activation:"always"},{package:"@dalcode/dal-guard",label:"\u547D\u4EE4\u5BA1\u6279",description:"\u9AD8\u98CE\u9669\u547D\u4EE4\u6267\u884C\u524D\u8BF7\u4F60\u786E\u8BA4\uFF08/guard\uFF09",activation:"always",safetyCritical:!0},{package:"@dalcode/dal-codeindex",label:"\u4EE3\u7801\u7D22\u5F15",description:"\u672C\u5730\u5E38\u9A7B\u7684\u7B26\u53F7\u4E0E\u5F15\u7528\u7D22\u5F15\uFF1A\u5927\u9879\u76EE\u91CC\u5FEB\u901F\u627E\u5B9A\u4E49\u3001\u8C03\u7528\u65B9\u3001\u6587\u4EF6\u5927\u7EB2\u548C\u76F8\u5173\u6587\u4EF6\uFF08/codeindex\uFF09",activation:"always"},{package:"@dalcode/dal-lsp",label:"\u8BED\u8A00\u670D\u52A1\u5668",description:"\u67E5\u7C7B\u578B\u9519\u8BEF\u3001\u5B9A\u4E49\u4E0E\u5F15\u7528",activation:"always"},{package:"@dalcode/dal-dap",label:"\u8C03\u8BD5\u5668",description:"\u8C03\u8BD5 Python \u548C Node.js \u7A0B\u5E8F\uFF1A\u65AD\u70B9\u3001\u5355\u6B65\u3001\u67E5\u770B\u8C03\u7528\u6808\u4E0E\u53D8\u91CF",activation:"always"},{package:"@dalcode/dal-subagent",label:"\u5B50\u52A9\u624B",description:"\u6D3E\u51FA\u5B50\u52A9\u624B\u5E76\u884C\u5904\u7406\u4EFB\u52A1",activation:"always"},{package:"@dalcode/dal-router",label:"\u667A\u80FD\u8DEF\u7531",description:"\u6309\u4EFB\u52A1\u81EA\u52A8\u6311\u9009\u6A21\u578B\uFF08/factory\uFF09",activation:"always"},{package:"@dalcode/dal-capabilities",label:"\u80FD\u529B\u4E2D\u5FC3",description:"\u6309\u4EFB\u52A1\u81EA\u52A8\u542F\u7528\u5BA1\u6838\u8FC7\u7684\u8FDE\u63A5\u5668\u3001\u6280\u80FD\u548C\u6269\u5C55\uFF0C\u9700\u8981\u65F6\u81EA\u52A8\u5B89\u88C5\uFF08/capabilities\uFF09",activation:"always"},{package:"@dalcode/dal-mcp",label:"MCP",description:"\u8FDE\u63A5 MCP \u670D\u52A1\u5668\u5E76\u4F7F\u7528\u5176\u5DE5\u5177\uFF08/mcp\uFF09",activation:"always"},{package:"@dalcode/dal-skills",label:"\u6280\u80FD",description:"\u641C\u7D22\u548C\u52A0\u8F7D\u672C\u5730\u4E0E\u4E91\u7AEF\u6280\u80FD\uFF08/skills\uFF09",activation:"always"},{package:"@dalcode/dal-office",label:"\u529E\u516C\u6587\u6863",description:"\u751F\u6210\u3001\u8BFB\u53D6\u548C\u4FEE\u6539 PPT\u3001Word\u3001Excel\u3001\u56FE\u8868",activation:"always"},{package:"@dalcode/dal-web",label:"\u8054\u7F51",description:"\u7F51\u9875\u641C\u7D22\u4E0E\u7F51\u9875\u8BFB\u53D6\uFF08/web\uFF09",activation:"always"},{package:"@dalcode/dal-workflow",label:"\u8BA1\u5212\u4E0E\u5F85\u529E",description:"\u8BA1\u5212\u6A21\u5F0F\u3001\u5F85\u529E\u6E05\u5355\u548C\u5B8C\u6210\u63D0\u9192\uFF08/plan\u3001/todos\uFF09",activation:"always"},{package:"@dalcode/dal-tool-catalog",label:"\u5DE5\u5177\u76EE\u5F55",description:"\u529E\u516C\u3001\u8054\u7F51\u7B49\u5DE5\u5177\u6309\u9700\u52A0\u8F7D\uFF0C\u8282\u7701\u4E0A\u4E0B\u6587\uFF1B\u6A21\u578B\u53D1\u6765\u7684\u5DE5\u5177\u53C2\u6570\u6709\u683C\u5F0F\u5C0F\u9519\u65F6\u5148\u81EA\u52A8\u4FEE\u6B63\u518D\u8C03\u7528",activation:"always"},{package:"@dalcode/dal-halo",label:"Halo",description:"\u5728 Halo \u7075\u52A8\u5C9B\u4E0A\u663E\u793A\u8FDB\u5EA6\u548C\u5BA1\u6279",activation:"halo-app"},{package:"@dalcode/dal-lang",label:"\u754C\u9762\u8BED\u8A00",description:"\u5207\u6362\u4E2D\u6587\u6216\u82F1\u6587\u754C\u9762\uFF08/lang\uFF09",activation:"always"},{package:"@dalcode/dal-bridge",label:"DAL Code \u6865\u63A5",description:"\u5728 DAL Code \u4E2D\u628A\u5BA1\u6279\u3001\u8BA1\u5212\u548C\u63D0\u95EE\u4EA4\u7ED9\u7F16\u8F91\u5668",activation:"dal-code"},{package:"@dalcode/dal-telemetry",label:"\u4F7F\u7528\u7EDF\u8BA1",description:"\u533F\u540D\u4F7F\u7528\u7EDF\u8BA1\uFF08/telemetry\uFF09",activation:"always"},{package:"@dalcode/dal-rewind",label:"\u68C0\u67E5\u70B9",description:"\u6BCF\u8F6E\u6539\u52A8\u81EA\u52A8\u7559\u68C0\u67E5\u70B9\uFF0C\u53EF\u56DE\u9000\uFF08/rewind\uFF09",activation:"always"},{package:"@dalcode/dal-review",label:"\u4EE3\u7801\u8BC4\u5BA1",description:"\u53EA\u8BFB\u8BC4\u5BA1\u6539\u52A8\uFF0C\u6309\u4E25\u91CD\u7A0B\u5EA6\u5217\u51FA\u95EE\u9898\uFF08/review\uFF09\uFF1B\u53EA\u63D0\u7B80\u5316\u5EFA\u8BAE\u3001\u4E0D\u6539\u4EE3\u7801\uFF08/simplify\uFF09",activation:"always"},{package:"@dalcode/dal-goal",label:"\u76EE\u6807\u6A21\u5F0F",description:"\u8BBE\u5B9A\u4E00\u4E2A\u76EE\u6807\uFF0C\u52A9\u624B\u6301\u7EED\u5DE5\u4F5C\u76F4\u5230\u9A8C\u8BC1\u5B8C\u6210\uFF0C\u6709\u7EED\u8DD1\u6B21\u6570\u548C token \u4E0A\u9650\uFF08/goal\uFF09",activation:"always"},{package:"@dalcode/dal-learn",label:"\u81EA\u6211\u8FDB\u5316",description:"\u4ECE\u8FC7\u5F80\u4F1A\u8BDD\u5B66\u7ECF\u9A8C\u3001\u8BB0\u4F4F\u9879\u76EE\u7684\u547D\u4EE4\u548C\u4F4D\u7F6E\uFF0C\u91CD\u590D\u7684\u6D41\u7A0B\u53EF\u8D77\u8349\u6210\u6280\u80FD\uFF08/lessons\uFF09",activation:"always"},{package:"@dalcode/dal-recall",label:"\u4F1A\u8BDD\u68C0\u7D22",description:"\u5728\u8FC7\u5F80\u4F1A\u8BDD\u91CC\u641C\u7D22\u4E4B\u524D\u505A\u8FC7\u7684\u51B3\u5B9A\u548C\u7EA6\u5B9A\uFF08session_search\uFF09",activation:"always"},{package:"@dalcode/dal-usage",label:"\u7528\u91CF\u7EDF\u8BA1",description:"\u8DE8\u4F1A\u8BDD\u6C47\u603B token \u548C\u8D39\u7528\uFF0C\u6309\u5929\u3001\u6A21\u578B\u3001\u9879\u76EE\u67E5\u770B\uFF08/usage\uFF09\uFF1B\u53EF\u8BBE\u8D39\u7528\u4E0A\u9650\uFF08--max-cost\u3001/budget\uFF09\u548C\u8FD0\u884C\u65F6\u957F\u4E0A\u9650\uFF08--max-time\uFF09",activation:"always"},{package:"@dalcode/dal-awake",label:"\u957F\u4EFB\u52A1\u9632\u4F11\u7720",description:"\u4EFB\u52A1\u8FD0\u884C\u8F83\u4E45\u65F6\u8BA9\u7535\u8111\u4FDD\u6301\u5524\u9192\uFF08\u5C4F\u5E55\u4ECD\u53EF\u7184\u706D\uFF09\uFF0C\u7ED3\u675F\u540E\u6062\u590D\uFF1B\u4E0D\u6253\u6270\uFF08/awake\uFF09",activation:"always"},{package:"@dalcode/dal-remote",label:"\u624B\u673A\u7AEF\u8FDC\u7A0B",description:"\u8BA9 DAL Code \u624B\u673A\u7AEF\u8FDE\u63A5\u8FD9\u53F0\u673A\u5668\uFF1Adal remote enable \u5F00\u542F\uFF0C\u9ED8\u8BA4\u5173\u95ED\uFF08/remote\uFF09",activation:"always"},{package:"@dalcode/dal-statusline",label:"\u81EA\u5B9A\u4E49\u72B6\u6001\u884C",description:"\u5728\u5E95\u90E8\u72B6\u6001\u680F\u52A0\u4E00\u884C\u81EA\u5DF1\u7684\u5185\u5BB9\uFF1A\u6A21\u677F\u6216\u547D\u4EE4\uFF08/statusline\uFF09",activation:"tui"},{package:"@dalcode/dal-advisor",label:"\u7B2C\u4E8C\u610F\u89C1",description:"\u7531\u6A21\u578B\u8C03\u7528\uFF1A\u8BF7\u53E6\u4E00\u4E2A\u5F3A\u6A21\u578B\u590D\u6838\u5F53\u524D\u65B9\u6848\u5E76\u6307\u51FA\u98CE\u9669\uFF0C\u8D39\u7528\u8BA1\u5165\u4F1A\u8BDD\uFF0C\u6BCF\u4F1A\u8BDD\u6709\u6B21\u6570\u4E0A\u9650",activation:"always"},{package:"@dalcode/dal-compat",label:"Claude Code \u517C\u5BB9",description:"\u6CBF\u7528 Claude Code \u7684\u89C4\u5219\uFF1A\u7528\u6237\u548C\u9879\u76EE .claude/rules/ \u4E0E .claude/CLAUDE.md\u3001\u8BF4\u660E\u6587\u4EF6\u91CC\u7684 @\u6587\u4EF6 \u5F15\u7528\u3001\u5B50\u76EE\u5F55\u91CC\u7684 AGENTS.md",activation:"always"},{package:"@dalcode/dal-structured",label:"\u7ED3\u6784\u5316\u8F93\u51FA",description:"dal -p --output-schema \u6309 JSON Schema \u8F93\u51FA\u6700\u7EC8\u56DE\u7B54\uFF0C\u4E0D\u7B26\u5408\u65F6\u975E\u96F6\u9000\u51FA\uFF0C\u7528\u4E8E\u811A\u672C\u548C CI",activation:"always"},{package:"@dalcode/dal-interactive",label:"\u7EC8\u7AEF\u4EA4\u4E92",description:"\u95EE\u5377\u63D0\u95EE\u3001/handoff \u4EA4\u63A5\u5230\u65B0\u4F1A\u8BDD\u3001/btw \u65C1\u8DEF\u63D0\u95EE\u3001!vim \u7B49\u4EA4\u4E92\u5F0F\u547D\u4EE4\uFF08\u7EC8\u7AEF\u754C\u9762\uFF09",activation:"tui"},{package:"@dalcode/dal-terminal",label:"\u7EC8\u7AEF\u4E0A\u4E0B\u6587",description:"\u5BBF\u4E3B\u7A0B\u5E8F\u63D0\u4F9B\u7EC8\u7AEF\u65F6\uFF0C\u52A9\u624B\u53EF\u8BFB\u53D6\u7EC8\u7AEF\u8F93\u51FA\uFF08@terminal\uFF09",activation:"host-capability"},{package:"cc-safety-net",label:"\u5371\u9669\u547D\u4EE4\u62E6\u622A",description:"\u6267\u884C\u524D\u62E6\u4E0B rm -rf\u3001\u5F3A\u5236\u63A8\u9001\u7B49\u7834\u574F\u6027\u547D\u4EE4",activation:"always",safetyCritical:!0},{package:"@dalcode/dal-rtk",label:"\u547D\u4EE4\u8F93\u51FA\u538B\u7F29\uFF08rtk\uFF09",description:"\u68C0\u6D4B\u5230\u4F60\u88C5\u4E86 rtk \u65F6\uFF0C\u52A9\u624B\u8FD0\u884C\u7684\u547D\u4EE4\u8F93\u51FA\u7ECF\u5B83\u538B\u7F29\u3001\u8282\u7701\u4E0A\u4E0B\u6587\uFF1B\u6CA1\u88C5\u5219\u4EC0\u4E48\u90FD\u4E0D\u505A\uFF08/rtk\uFF09",activation:"always"}],f=c.map(e=>e.package),v=new Set(c.filter(e=>e.safetyCritical).map(e=>e.package));function m(e){try{const l=u(import.meta.url)(`${e}/package.json`);return{version:l.version??"",extensions:[...l.pi?.extensions??[]]}}catch{return}}i(m,"installedManifest");function g(e=r()){return c.map(a=>{const l=m(a.package);return{name:a.package,label:d(a.label,e),description:d(a.description,e),enabledByDefault:!0,canDisable:!1,safetyCritical:a.safetyCritical===!0,activation:a.activation,installed:l!==void 0,version:l?.version??"",extensions:l?.extensions??[]}})}i(g,"listBundledExtensions");const o=[{name:"read",label:"\u8BFB\u53D6\u6587\u4EF6",summary:"\u8BFB\u53D6\u6587\u4EF6\u5185\u5BB9\uFF0C\u4E5F\u80FD\u770B\u56FE\u7247",source:"core",readOnly:!0,availability:"default"},{name:"bash",label:"\u8FD0\u884C\u547D\u4EE4",summary:"\u5728\u7EC8\u7AEF\u91CC\u8FD0\u884C\u547D\u4EE4",source:"core",readOnly:!1,availability:"default"},{name:"edit",label:"\u7F16\u8F91\u6587\u4EF6",summary:"\u6309\u539F\u6587\u66FF\u6362\u4FEE\u6539\u6587\u4EF6",source:"core",readOnly:!1,availability:"default"},{name:"write",label:"\u5199\u5165\u6587\u4EF6",summary:"\u65B0\u5EFA\u6216\u8986\u76D6\u6587\u4EF6",source:"core",readOnly:!1,availability:"default"},{name:"grep",label:"\u641C\u7D22\u5185\u5BB9",summary:"\u5728\u6587\u4EF6\u91CC\u641C\u7D22\u6587\u672C",source:"core",readOnly:!0,availability:"opt-in"},{name:"find",label:"\u67E5\u627E\u6587\u4EF6",summary:"\u6309\u540D\u79F0\u67E5\u627E\u6587\u4EF6",source:"core",readOnly:!0,availability:"opt-in"},{name:"ls",label:"\u5217\u51FA\u76EE\u5F55",summary:"\u5217\u51FA\u76EE\u5F55\u5185\u5BB9",source:"core",readOnly:!0,availability:"opt-in"},{name:"powershell",label:"\u8FD0\u884C PowerShell",summary:"\u5728 Windows \u4E0A\u7528 PowerShell \u8FD0\u884C\u547D\u4EE4",source:"core",readOnly:!1,availability:"opt-in"},{name:"process",label:"\u540E\u53F0\u8FDB\u7A0B",summary:"\u5728\u540E\u53F0\u8FD0\u884C\u5F00\u53D1\u670D\u52A1\u5668\u7B49\u957F\u65F6\u95F4\u547D\u4EE4\uFF0C\u968F\u65F6\u67E5\u770B\u8F93\u51FA",source:"core",readOnly:!1,availability:"default"},{name:"plugin_search",label:"\u641C\u7D22\u63D2\u4EF6",summary:"\u641C\u7D22\u53EF\u5B89\u88C5\u7684\u63D2\u4EF6",source:"@dalcode/dal-plugins",readOnly:!0,availability:"default"},{name:"code_index",label:"\u4EE3\u7801\u7D22\u5F15",summary:"\u6309\u540D\u5B57\u627E\u5B9A\u4E49\u3001\u5F15\u7528\u548C\u8C03\u7528\u65B9\uFF0C\u770B\u6587\u4EF6\u5927\u7EB2\u548C\u76F8\u5173\u6587\u4EF6\uFF0C\u6309\u529F\u80FD\u5173\u952E\u8BCD\u627E\u4EE3\u7801",source:"@dalcode/dal-codeindex",readOnly:!0,availability:"default"},{name:"lsp",label:"\u8BED\u8A00\u670D\u52A1\u5668",summary:"\u67E5\u7C7B\u578B\u9519\u8BEF\u3001\u7B26\u53F7\u3001\u5B9A\u4E49\u4E0E\u5F15\u7528",source:"@dalcode/dal-lsp",readOnly:!0,availability:"on-demand"},{name:"debug",label:"\u8C03\u8BD5\u5668",summary:"\u8BBE\u65AD\u70B9\u3001\u5355\u6B65\u8FD0\u884C\u7A0B\u5E8F\u5E76\u67E5\u770B\u53D8\u91CF",source:"@dalcode/dal-dap",readOnly:!1,availability:"on-demand"},{name:"task",label:"\u5B50\u52A9\u624B",summary:"\u6D3E\u51FA\u5B50\u52A9\u624B\u5904\u7406\u4E00\u9879\u5B50\u4EFB\u52A1",source:"@dalcode/dal-subagent",readOnly:!1,availability:"default"},{name:"mcp",label:"MCP \u5DE5\u5177",summary:"\u8C03\u7528\u5DF2\u8FDE\u63A5 MCP \u670D\u52A1\u5668\u7684\u5DE5\u5177",source:"@dalcode/dal-mcp",readOnly:!1,availability:"mcp"},{name:"skill",label:"\u6280\u80FD",summary:"\u641C\u7D22\u5E76\u52A0\u8F7D\u4E13\u9879\u4EFB\u52A1\u6307\u5F15",source:"@dalcode/dal-skills",readOnly:!0,availability:"default"},{name:"office_ppt_plan",label:"\u89C4\u5212 PPT",summary:"\u5148\u5217\u51FA PPT \u7684\u9875\u9762\u5927\u7EB2",source:"@dalcode/dal-office",readOnly:!0,availability:"on-demand"},{name:"office_ppt_generate",label:"\u751F\u6210 PPT",summary:"\u751F\u6210 PowerPoint \u6F14\u793A\u6587\u7A3F",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_doc_generate",label:"\u751F\u6210 Word",summary:"\u751F\u6210 Word \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_md_generate",label:"\u751F\u6210 Markdown",summary:"\u751F\u6210 Markdown \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_sheet_generate",label:"\u751F\u6210\u8868\u683C",summary:"\u751F\u6210 Excel \u8868\u683C",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_chart_generate",label:"\u751F\u6210\u56FE\u8868",summary:"\u751F\u6210 ECharts \u56FE\u8868",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_drawio_generate",label:"\u751F\u6210\u6D41\u7A0B\u56FE",summary:"\u751F\u6210 draw.io \u56FE",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_read_file",label:"\u8BFB\u53D6\u6587\u6863",summary:"\u8BFB\u53D6 Word\u3001PPT\u3001Excel\u3001PDF\u3001CSV",source:"@dalcode/dal-office",readOnly:!0,availability:"on-demand"},{name:"office_docx_edit",label:"\u4FEE\u6539 Word",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 Word \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_pptx_edit",label:"\u4FEE\u6539 PPT",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 PPT",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_xlsx_edit",label:"\u4FEE\u6539\u8868\u683C",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 Excel",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"web_search",label:"\u7F51\u9875\u641C\u7D22",summary:"\u8054\u7F51\u641C\u7D22\u6700\u65B0\u4FE1\u606F",source:"@dalcode/dal-web",readOnly:!0,availability:"on-demand"},{name:"web_fetch",label:"\u8BFB\u53D6\u7F51\u9875",summary:"\u8BFB\u53D6\u7F51\u9875\u6216 PDF \u94FE\u63A5\u7684\u6B63\u6587",source:"@dalcode/dal-web",readOnly:!0,availability:"on-demand"},{name:"todo",label:"\u5F85\u529E\u6E05\u5355",summary:"\u7EF4\u62A4\u672C\u6B21\u4EFB\u52A1\u7684\u5F85\u529E\u6E05\u5355",source:"@dalcode/dal-workflow",readOnly:!0,availability:"default"},{name:"tool_catalog",label:"\u5DE5\u5177\u76EE\u5F55",summary:"\u67E5\u770B\u5E76\u542F\u7528\u6309\u9700\u52A0\u8F7D\u7684\u5DE5\u5177\u5206\u7EC4",source:"@dalcode/dal-tool-catalog",readOnly:!0,availability:"default"},{name:"submit_plan",label:"\u63D0\u4EA4\u8BA1\u5212",summary:"\u628A\u8BA1\u5212\u4EA4\u7ED9\u4F60\u5BA1\u6279",source:"@dalcode/dal-bridge",readOnly:!0,availability:"dal-code"},{name:"ask_user",label:"\u8BE2\u95EE\u4F60",summary:"\u5F00\u5DE5\u524D\u7528\u5361\u7247\u786E\u8BA4\u5173\u952E\u51B3\u5B9A",source:"@dalcode/dal-bridge",readOnly:!0,availability:"dal-code"},{name:"review_report",label:"\u63D0\u4EA4\u8BC4\u5BA1\u7ED3\u679C",summary:"\u8BC4\u5BA1\u52A9\u624B\u63D0\u4EA4\u53D1\u73B0\u7684\u95EE\u9898",source:"@dalcode/dal-review",readOnly:!0,availability:"reviewer"},{name:"goal_complete",label:"\u5B8C\u6210\u76EE\u6807",summary:"\u76EE\u6807\u7ECF\u9A8C\u8BC1\u5168\u90E8\u5B8C\u6210\u65F6\u7ED3\u675F\u76EE\u6807",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"goal_blocked",label:"\u76EE\u6807\u53D7\u963B",summary:"\u76EE\u6807\u786E\u5B9E\u65E0\u6CD5\u7EE7\u7EED\u3001\u9700\u8981\u4F60\u5904\u7406\u65F6\u505C\u4E0B",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"goal_wait",label:"\u76EE\u6807\u7B49\u5F85",summary:"\u76EE\u6807\u7B49\u5F85\u5916\u90E8\u4E8B\u4EF6\u65F6\u6682\u505C\u81EA\u52A8\u7EED\u8DD1",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"session_search",label:"\u641C\u7D22\u8FC7\u5F80\u4F1A\u8BDD",summary:"\u641C\u7D22\u8FC7\u5F80\u4F1A\u8BDD\u91CC\u7684\u51B3\u5B9A\u548C\u7EA6\u5B9A",source:"@dalcode/dal-recall",readOnly:!0,availability:"default"},{name:"advisor",label:"\u7B2C\u4E8C\u610F\u89C1",summary:"\u8BF7\u53E6\u4E00\u4E2A\u5F3A\u6A21\u578B\u590D\u6838\u5F53\u524D\u65B9\u6848\u5E76\u6307\u51FA\u98CE\u9669",source:"@dalcode/dal-advisor",readOnly:!0,availability:"default"},{name:"structured_output",label:"\u7ED3\u6784\u5316\u8F93\u51FA",summary:"\u6309 --output-schema \u7ED9\u51FA JSON \u683C\u5F0F\u7684\u6700\u7EC8\u56DE\u7B54",source:"@dalcode/dal-structured",readOnly:!0,availability:"opt-in"},{name:"questionnaire",label:"\u95EE\u5377",summary:"\u7528\u9009\u62E9\u9898\u5411\u4F60\u786E\u8BA4\u9700\u6C42\u6216\u504F\u597D",source:"@dalcode/dal-interactive",readOnly:!0,availability:"tui"},{name:"terminal_read",label:"\u8BFB\u53D6\u7EC8\u7AEF",summary:"\u8BFB\u53D6\u7EC8\u7AEF\u6700\u8FD1\u7684\u8F93\u51FA",source:"@dalcode/dal-terminal",readOnly:!0,availability:"host"}],w=(()=>{const e={};for(const a of o){if(a.source==="core")continue;const l=e[a.source]??[];l.push(a.name),e[a.source]=l}return{builtin:o.filter(a=>a.source==="core").map(a=>a.name),extensions:e}})();function k(e=r()){return o.map(a=>({name:a.name,label:d(a.label,e),summary:d(a.summary,e),source:a.source,readOnly:a.readOnly,availability:a.availability}))}i(k,"listToolCatalog");function O(e,a=r()){const l=o.find(n=>n.name===e);if(l)return d(l.label,a);const t=e.match(/^mcp__(.+?)__(.+)$/);return t?`${t[1]} \xB7 ${t[2]}`:e}i(O,"toolDisplayLabel");export{f as BUNDLED_EXTENSION_PACKAGES,w as DAL_TOOL_NAMES,v as SAFETY_CRITICAL_PACKAGES,g as listBundledExtensions,k as listToolCatalog,O as toolDisplayLabel};
|
|
1
|
+
var s=Object.defineProperty;var i=(a,e)=>s(a,"name",{value:e,configurable:!0});import{createRequire as u}from"node:module";import{getLanguage as c,translate as d}from"@dalcode/dal-pi-kit";const o=[{package:"@dalcode/dal-plugins",label:"\u63D2\u4EF6\u517C\u5BB9",description:"\u8BA9\u793E\u533A\u63D2\u4EF6\u5728 DAL \u4E2D\u53EF\u7528\uFF0C\u5E76\u63D0\u4F9B\u63D2\u4EF6\u641C\u7D22",activation:"always"},{package:"@dalcode/deepailab",label:"DeepAILab \u8D26\u53F7",description:"DeepAILab \u767B\u5F55\u3001\u5957\u9910\u4E0E\u6A21\u578B\u63D0\u4F9B\u65B9\uFF08/login\u3001/account\uFF09",activation:"always",providesModels:!0},{package:"@dalcode/dal-gateway",label:"DAL \u7F51\u5173",description:"\u7ECF DAL \u7F51\u5173\u8C03\u7528\u6A21\u578B",activation:"always",providesModels:!0},{package:"@dalcode/dal-guard",label:"\u547D\u4EE4\u5BA1\u6279",description:"\u9AD8\u98CE\u9669\u547D\u4EE4\u6267\u884C\u524D\u8BF7\u4F60\u786E\u8BA4\uFF08/guard\uFF09",activation:"always",safetyCritical:!0},{package:"@dalcode/dal-codeindex",label:"\u4EE3\u7801\u7D22\u5F15",description:"\u672C\u5730\u5E38\u9A7B\u7684\u7B26\u53F7\u4E0E\u5F15\u7528\u7D22\u5F15\uFF1A\u5927\u9879\u76EE\u91CC\u5FEB\u901F\u627E\u5B9A\u4E49\u3001\u8C03\u7528\u65B9\u3001\u6587\u4EF6\u5927\u7EB2\u548C\u76F8\u5173\u6587\u4EF6\uFF08/codeindex\uFF09",activation:"always"},{package:"@dalcode/dal-lsp",label:"\u8BED\u8A00\u670D\u52A1\u5668",description:"\u67E5\u7C7B\u578B\u9519\u8BEF\u3001\u5B9A\u4E49\u4E0E\u5F15\u7528",activation:"always"},{package:"@dalcode/dal-dap",label:"\u8C03\u8BD5\u5668",description:"\u8C03\u8BD5 Python \u548C Node.js \u7A0B\u5E8F\uFF1A\u65AD\u70B9\u3001\u5355\u6B65\u3001\u67E5\u770B\u8C03\u7528\u6808\u4E0E\u53D8\u91CF",activation:"always"},{package:"@dalcode/dal-subagent",label:"\u5B50\u52A9\u624B",description:"\u6D3E\u51FA\u5B50\u52A9\u624B\u5E76\u884C\u5904\u7406\u4EFB\u52A1",activation:"always"},{package:"@dalcode/dal-router",label:"\u667A\u80FD\u8DEF\u7531",description:"\u6309\u4EFB\u52A1\u81EA\u52A8\u6311\u9009\u6A21\u578B\uFF08/factory\uFF09",activation:"always"},{package:"@dalcode/dal-capabilities",label:"\u80FD\u529B\u4E2D\u5FC3",description:"\u6309\u4EFB\u52A1\u81EA\u52A8\u542F\u7528\u5BA1\u6838\u8FC7\u7684\u8FDE\u63A5\u5668\u3001\u6280\u80FD\u548C\u6269\u5C55\uFF0C\u9700\u8981\u65F6\u81EA\u52A8\u5B89\u88C5\uFF08/capabilities\uFF09",activation:"always"},{package:"@dalcode/dal-mcp",label:"MCP",description:"\u8FDE\u63A5 MCP \u670D\u52A1\u5668\u5E76\u4F7F\u7528\u5176\u5DE5\u5177\uFF08/mcp\uFF09",activation:"always"},{package:"@dalcode/dal-skills",label:"\u6280\u80FD",description:"\u641C\u7D22\u548C\u52A0\u8F7D\u672C\u5730\u4E0E\u4E91\u7AEF\u6280\u80FD\uFF08/skills\uFF09",activation:"always"},{package:"@dalcode/dal-office",label:"\u529E\u516C\u6587\u6863",description:"\u751F\u6210\u3001\u8BFB\u53D6\u548C\u4FEE\u6539 PPT\u3001Word\u3001Excel\u3001\u56FE\u8868",activation:"always"},{package:"@dalcode/dal-web",label:"\u8054\u7F51",description:"\u7F51\u9875\u641C\u7D22\u4E0E\u7F51\u9875\u8BFB\u53D6\uFF08/web\uFF09",activation:"always"},{package:"@dalcode/dal-workflow",label:"\u8BA1\u5212\u4E0E\u5F85\u529E",description:"\u8BA1\u5212\u6A21\u5F0F\u3001\u5F85\u529E\u6E05\u5355\u548C\u5B8C\u6210\u63D0\u9192\uFF08/plan\u3001/todos\uFF09",activation:"always"},{package:"@dalcode/dal-tool-catalog",label:"\u5DE5\u5177\u76EE\u5F55",description:"\u529E\u516C\u3001\u8054\u7F51\u7B49\u5DE5\u5177\u6309\u9700\u52A0\u8F7D\uFF0C\u8282\u7701\u4E0A\u4E0B\u6587\uFF1B\u6A21\u578B\u53D1\u6765\u7684\u5DE5\u5177\u53C2\u6570\u6709\u683C\u5F0F\u5C0F\u9519\u65F6\u5148\u81EA\u52A8\u4FEE\u6B63\u518D\u8C03\u7528",activation:"always"},{package:"@dalcode/dal-halo",label:"Halo",description:"\u5728 Halo \u7075\u52A8\u5C9B\u4E0A\u663E\u793A\u8FDB\u5EA6\u548C\u5BA1\u6279",activation:"halo-app"},{package:"@dalcode/dal-lang",label:"\u754C\u9762\u8BED\u8A00",description:"\u5207\u6362\u4E2D\u6587\u6216\u82F1\u6587\u754C\u9762\uFF08/lang\uFF09",activation:"always"},{package:"@dalcode/dal-bridge",label:"DAL Code \u6865\u63A5",description:"\u5728 DAL Code \u4E2D\u628A\u5BA1\u6279\u3001\u8BA1\u5212\u548C\u63D0\u95EE\u4EA4\u7ED9\u7F16\u8F91\u5668",activation:"dal-code"},{package:"@dalcode/dal-telemetry",label:"\u4F7F\u7528\u7EDF\u8BA1",description:"\u533F\u540D\u4F7F\u7528\u7EDF\u8BA1\uFF08/telemetry\uFF09",activation:"always"},{package:"@dalcode/dal-rewind",label:"\u68C0\u67E5\u70B9",description:"\u6BCF\u8F6E\u6539\u52A8\u81EA\u52A8\u7559\u68C0\u67E5\u70B9\uFF0C\u53EF\u56DE\u9000\uFF08/rewind\uFF09",activation:"always"},{package:"@dalcode/dal-review",label:"\u4EE3\u7801\u8BC4\u5BA1",description:"\u53EA\u8BFB\u8BC4\u5BA1\u6539\u52A8\uFF0C\u6309\u4E25\u91CD\u7A0B\u5EA6\u5217\u51FA\u95EE\u9898\uFF08/review\uFF09\uFF1B\u53EA\u63D0\u7B80\u5316\u5EFA\u8BAE\u3001\u4E0D\u6539\u4EE3\u7801\uFF08/simplify\uFF09",activation:"always"},{package:"@dalcode/dal-goal",label:"\u76EE\u6807\u6A21\u5F0F",description:"\u8BBE\u5B9A\u4E00\u4E2A\u76EE\u6807\uFF0C\u52A9\u624B\u6301\u7EED\u5DE5\u4F5C\u76F4\u5230\u9A8C\u8BC1\u5B8C\u6210\uFF0C\u6709\u7EED\u8DD1\u6B21\u6570\u548C token \u4E0A\u9650\uFF08/goal\uFF09",activation:"always"},{package:"@dalcode/dal-learn",label:"\u81EA\u6211\u8FDB\u5316",description:"\u4ECE\u8FC7\u5F80\u4F1A\u8BDD\u5B66\u7ECF\u9A8C\u3001\u8BB0\u4F4F\u9879\u76EE\u7684\u547D\u4EE4\u548C\u4F4D\u7F6E\uFF0C\u91CD\u590D\u7684\u6D41\u7A0B\u53EF\u8D77\u8349\u6210\u6280\u80FD\uFF08/lessons\uFF09",activation:"always"},{package:"@dalcode/dal-recall",label:"\u4F1A\u8BDD\u68C0\u7D22",description:"\u5728\u8FC7\u5F80\u4F1A\u8BDD\u91CC\u641C\u7D22\u4E4B\u524D\u505A\u8FC7\u7684\u51B3\u5B9A\u548C\u7EA6\u5B9A\uFF08session_search\uFF09",activation:"always"},{package:"@dalcode/dal-usage",label:"\u7528\u91CF\u7EDF\u8BA1",description:"\u8DE8\u4F1A\u8BDD\u6C47\u603B token \u548C\u8D39\u7528\uFF0C\u6309\u5929\u3001\u6A21\u578B\u3001\u9879\u76EE\u67E5\u770B\uFF08/usage\uFF09\uFF1B\u53EF\u8BBE\u8D39\u7528\u4E0A\u9650\uFF08--max-cost\u3001/budget\uFF09\u548C\u8FD0\u884C\u65F6\u957F\u4E0A\u9650\uFF08--max-time\uFF09",activation:"always"},{package:"@dalcode/dal-awake",label:"\u957F\u4EFB\u52A1\u9632\u4F11\u7720",description:"\u4EFB\u52A1\u8FD0\u884C\u8F83\u4E45\u65F6\u8BA9\u7535\u8111\u4FDD\u6301\u5524\u9192\uFF08\u5C4F\u5E55\u4ECD\u53EF\u7184\u706D\uFF09\uFF0C\u7ED3\u675F\u540E\u6062\u590D\uFF1B\u4E0D\u6253\u6270\uFF08/awake\uFF09",activation:"always"},{package:"@dalcode/dal-remote",label:"\u624B\u673A\u7AEF\u8FDC\u7A0B",description:"\u8BA9 DAL Code \u624B\u673A\u7AEF\u8FDE\u63A5\u8FD9\u53F0\u673A\u5668\uFF1Adal remote enable \u5F00\u542F\uFF0C\u9ED8\u8BA4\u5173\u95ED\uFF08/remote\uFF09",activation:"always"},{package:"@dalcode/dal-statusline",label:"\u81EA\u5B9A\u4E49\u72B6\u6001\u884C",description:"\u5728\u5E95\u90E8\u72B6\u6001\u680F\u52A0\u4E00\u884C\u81EA\u5DF1\u7684\u5185\u5BB9\uFF1A\u6A21\u677F\u6216\u547D\u4EE4\uFF08/statusline\uFF09",activation:"tui"},{package:"@dalcode/dal-advisor",label:"\u7B2C\u4E8C\u610F\u89C1",description:"\u7531\u6A21\u578B\u8C03\u7528\uFF1A\u8BF7\u53E6\u4E00\u4E2A\u5F3A\u6A21\u578B\u590D\u6838\u5F53\u524D\u65B9\u6848\u5E76\u6307\u51FA\u98CE\u9669\uFF0C\u8D39\u7528\u8BA1\u5165\u4F1A\u8BDD\uFF0C\u6BCF\u4F1A\u8BDD\u6709\u6B21\u6570\u4E0A\u9650",activation:"always"},{package:"@dalcode/dal-compat",label:"Claude Code \u517C\u5BB9",description:"\u6CBF\u7528 Claude Code \u7684\u89C4\u5219\uFF1A\u7528\u6237\u548C\u9879\u76EE .claude/rules/ \u4E0E .claude/CLAUDE.md\u3001\u8BF4\u660E\u6587\u4EF6\u91CC\u7684 @\u6587\u4EF6 \u5F15\u7528\u3001\u5B50\u76EE\u5F55\u91CC\u7684 AGENTS.md",activation:"always"},{package:"@dalcode/dal-structured",label:"\u7ED3\u6784\u5316\u8F93\u51FA",description:"dal -p --output-schema \u6309 JSON Schema \u8F93\u51FA\u6700\u7EC8\u56DE\u7B54\uFF0C\u4E0D\u7B26\u5408\u65F6\u975E\u96F6\u9000\u51FA\uFF0C\u7528\u4E8E\u811A\u672C\u548C CI",activation:"always"},{package:"@dalcode/dal-interactive",label:"\u7EC8\u7AEF\u4EA4\u4E92",description:"\u95EE\u5377\u63D0\u95EE\u3001/handoff \u4EA4\u63A5\u5230\u65B0\u4F1A\u8BDD\u3001/btw \u65C1\u8DEF\u63D0\u95EE\u3001!vim \u7B49\u4EA4\u4E92\u5F0F\u547D\u4EE4\uFF08\u7EC8\u7AEF\u754C\u9762\uFF09",activation:"tui"},{package:"@dalcode/dal-terminal",label:"\u7EC8\u7AEF\u4E0A\u4E0B\u6587",description:"\u5BBF\u4E3B\u7A0B\u5E8F\u63D0\u4F9B\u7EC8\u7AEF\u65F6\uFF0C\u52A9\u624B\u53EF\u8BFB\u53D6\u7EC8\u7AEF\u8F93\u51FA\uFF08@terminal\uFF09",activation:"host-capability"},{package:"cc-safety-net",label:"\u5371\u9669\u547D\u4EE4\u62E6\u622A",description:"\u6267\u884C\u524D\u62E6\u4E0B rm -rf\u3001\u5F3A\u5236\u63A8\u9001\u7B49\u7834\u574F\u6027\u547D\u4EE4",activation:"always",safetyCritical:!0},{package:"@dalcode/dal-rtk",label:"\u547D\u4EE4\u8F93\u51FA\u538B\u7F29\uFF08rtk\uFF09",description:"\u68C0\u6D4B\u5230\u4F60\u88C5\u4E86 rtk \u65F6\uFF0C\u52A9\u624B\u8FD0\u884C\u7684\u547D\u4EE4\u8F93\u51FA\u7ECF\u5B83\u538B\u7F29\u3001\u8282\u7701\u4E0A\u4E0B\u6587\uFF1B\u6CA1\u88C5\u5219\u4EC0\u4E48\u90FD\u4E0D\u505A\uFF08/rtk\uFF09",activation:"always"}],f=o.map(a=>a.package),v=o.filter(a=>a.providesModels).map(a=>a.package),g=new Set(o.filter(a=>a.safetyCritical).map(a=>a.package));function m(a){try{const l=u(import.meta.url)(`${a}/package.json`);return{version:l.version??"",extensions:[...l.pi?.extensions??[]]}}catch{return}}i(m,"installedManifest");function w(a=c()){return o.map(e=>{const l=m(e.package);return{name:e.package,label:d(e.label,a),description:d(e.description,a),enabledByDefault:!0,canDisable:!1,safetyCritical:e.safetyCritical===!0,activation:e.activation,installed:l!==void 0,version:l?.version??"",extensions:l?.extensions??[]}})}i(w,"listBundledExtensions");const t=[{name:"read",label:"\u8BFB\u53D6\u6587\u4EF6",summary:"\u8BFB\u53D6\u6587\u4EF6\u5185\u5BB9\uFF0C\u4E5F\u80FD\u770B\u56FE\u7247",source:"core",readOnly:!0,availability:"default"},{name:"bash",label:"\u8FD0\u884C\u547D\u4EE4",summary:"\u5728\u7EC8\u7AEF\u91CC\u8FD0\u884C\u547D\u4EE4",source:"core",readOnly:!1,availability:"default"},{name:"edit",label:"\u7F16\u8F91\u6587\u4EF6",summary:"\u6309\u539F\u6587\u66FF\u6362\u4FEE\u6539\u6587\u4EF6",source:"core",readOnly:!1,availability:"default"},{name:"write",label:"\u5199\u5165\u6587\u4EF6",summary:"\u65B0\u5EFA\u6216\u8986\u76D6\u6587\u4EF6",source:"core",readOnly:!1,availability:"default"},{name:"grep",label:"\u641C\u7D22\u5185\u5BB9",summary:"\u5728\u6587\u4EF6\u91CC\u641C\u7D22\u6587\u672C",source:"core",readOnly:!0,availability:"opt-in"},{name:"find",label:"\u67E5\u627E\u6587\u4EF6",summary:"\u6309\u540D\u79F0\u67E5\u627E\u6587\u4EF6",source:"core",readOnly:!0,availability:"opt-in"},{name:"ls",label:"\u5217\u51FA\u76EE\u5F55",summary:"\u5217\u51FA\u76EE\u5F55\u5185\u5BB9",source:"core",readOnly:!0,availability:"opt-in"},{name:"powershell",label:"\u8FD0\u884C PowerShell",summary:"\u5728 Windows \u4E0A\u7528 PowerShell \u8FD0\u884C\u547D\u4EE4",source:"core",readOnly:!1,availability:"opt-in"},{name:"process",label:"\u540E\u53F0\u8FDB\u7A0B",summary:"\u5728\u540E\u53F0\u8FD0\u884C\u5F00\u53D1\u670D\u52A1\u5668\u7B49\u957F\u65F6\u95F4\u547D\u4EE4\uFF0C\u968F\u65F6\u67E5\u770B\u8F93\u51FA",source:"core",readOnly:!1,availability:"default"},{name:"plugin_search",label:"\u641C\u7D22\u63D2\u4EF6",summary:"\u641C\u7D22\u53EF\u5B89\u88C5\u7684\u63D2\u4EF6",source:"@dalcode/dal-plugins",readOnly:!0,availability:"default"},{name:"code_index",label:"\u4EE3\u7801\u7D22\u5F15",summary:"\u6309\u540D\u5B57\u627E\u5B9A\u4E49\u3001\u5F15\u7528\u548C\u8C03\u7528\u65B9\uFF0C\u770B\u6587\u4EF6\u5927\u7EB2\u548C\u76F8\u5173\u6587\u4EF6\uFF0C\u6309\u529F\u80FD\u5173\u952E\u8BCD\u627E\u4EE3\u7801",source:"@dalcode/dal-codeindex",readOnly:!0,availability:"default"},{name:"lsp",label:"\u8BED\u8A00\u670D\u52A1\u5668",summary:"\u67E5\u7C7B\u578B\u9519\u8BEF\u3001\u7B26\u53F7\u3001\u5B9A\u4E49\u4E0E\u5F15\u7528",source:"@dalcode/dal-lsp",readOnly:!0,availability:"on-demand"},{name:"debug",label:"\u8C03\u8BD5\u5668",summary:"\u8BBE\u65AD\u70B9\u3001\u5355\u6B65\u8FD0\u884C\u7A0B\u5E8F\u5E76\u67E5\u770B\u53D8\u91CF",source:"@dalcode/dal-dap",readOnly:!1,availability:"on-demand"},{name:"task",label:"\u5B50\u52A9\u624B",summary:"\u6D3E\u51FA\u5B50\u52A9\u624B\u5904\u7406\u4E00\u9879\u5B50\u4EFB\u52A1",source:"@dalcode/dal-subagent",readOnly:!1,availability:"default"},{name:"mcp",label:"MCP \u5DE5\u5177",summary:"\u8C03\u7528\u5DF2\u8FDE\u63A5 MCP \u670D\u52A1\u5668\u7684\u5DE5\u5177",source:"@dalcode/dal-mcp",readOnly:!1,availability:"mcp"},{name:"skill",label:"\u6280\u80FD",summary:"\u641C\u7D22\u5E76\u52A0\u8F7D\u4E13\u9879\u4EFB\u52A1\u6307\u5F15",source:"@dalcode/dal-skills",readOnly:!0,availability:"default"},{name:"office_ppt_plan",label:"\u89C4\u5212 PPT",summary:"\u5148\u5217\u51FA PPT \u7684\u9875\u9762\u5927\u7EB2",source:"@dalcode/dal-office",readOnly:!0,availability:"on-demand"},{name:"office_ppt_generate",label:"\u751F\u6210 PPT",summary:"\u751F\u6210 PowerPoint \u6F14\u793A\u6587\u7A3F",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_doc_generate",label:"\u751F\u6210 Word",summary:"\u751F\u6210 Word \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_md_generate",label:"\u751F\u6210 Markdown",summary:"\u751F\u6210 Markdown \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_sheet_generate",label:"\u751F\u6210\u8868\u683C",summary:"\u751F\u6210 Excel \u8868\u683C",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_chart_generate",label:"\u751F\u6210\u56FE\u8868",summary:"\u751F\u6210 ECharts \u56FE\u8868",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_drawio_generate",label:"\u751F\u6210\u6D41\u7A0B\u56FE",summary:"\u751F\u6210 draw.io \u56FE",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_read_file",label:"\u8BFB\u53D6\u6587\u6863",summary:"\u8BFB\u53D6 Word\u3001PPT\u3001Excel\u3001PDF\u3001CSV",source:"@dalcode/dal-office",readOnly:!0,availability:"on-demand"},{name:"office_docx_edit",label:"\u4FEE\u6539 Word",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 Word \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_pptx_edit",label:"\u4FEE\u6539 PPT",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 PPT",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_xlsx_edit",label:"\u4FEE\u6539\u8868\u683C",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 Excel",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_render_page",label:"\u5BFC\u51FA\u56FE\u7247/PDF",summary:"\u628A HTML \u9875\u9762\u5BFC\u51FA\u4E3A PNG \u6216 PDF",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"web_search",label:"\u7F51\u9875\u641C\u7D22",summary:"\u8054\u7F51\u641C\u7D22\u6700\u65B0\u4FE1\u606F",source:"@dalcode/dal-web",readOnly:!0,availability:"on-demand"},{name:"web_fetch",label:"\u8BFB\u53D6\u7F51\u9875",summary:"\u8BFB\u53D6\u7F51\u9875\u6216 PDF \u94FE\u63A5\u7684\u6B63\u6587",source:"@dalcode/dal-web",readOnly:!0,availability:"on-demand"},{name:"todo",label:"\u5F85\u529E\u6E05\u5355",summary:"\u7EF4\u62A4\u672C\u6B21\u4EFB\u52A1\u7684\u5F85\u529E\u6E05\u5355",source:"@dalcode/dal-workflow",readOnly:!0,availability:"default"},{name:"tool_catalog",label:"\u5DE5\u5177\u76EE\u5F55",summary:"\u67E5\u770B\u5E76\u542F\u7528\u6309\u9700\u52A0\u8F7D\u7684\u5DE5\u5177\u5206\u7EC4",source:"@dalcode/dal-tool-catalog",readOnly:!0,availability:"default"},{name:"submit_plan",label:"\u63D0\u4EA4\u8BA1\u5212",summary:"\u628A\u8BA1\u5212\u4EA4\u7ED9\u4F60\u5BA1\u6279",source:"@dalcode/dal-bridge",readOnly:!0,availability:"dal-code"},{name:"ask_user",label:"\u8BE2\u95EE\u4F60",summary:"\u5F00\u5DE5\u524D\u7528\u5361\u7247\u786E\u8BA4\u5173\u952E\u51B3\u5B9A",source:"@dalcode/dal-bridge",readOnly:!0,availability:"dal-code"},{name:"review_report",label:"\u63D0\u4EA4\u8BC4\u5BA1\u7ED3\u679C",summary:"\u8BC4\u5BA1\u52A9\u624B\u63D0\u4EA4\u53D1\u73B0\u7684\u95EE\u9898",source:"@dalcode/dal-review",readOnly:!0,availability:"reviewer"},{name:"goal_complete",label:"\u5B8C\u6210\u76EE\u6807",summary:"\u76EE\u6807\u7ECF\u9A8C\u8BC1\u5168\u90E8\u5B8C\u6210\u65F6\u7ED3\u675F\u76EE\u6807",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"goal_blocked",label:"\u76EE\u6807\u53D7\u963B",summary:"\u76EE\u6807\u786E\u5B9E\u65E0\u6CD5\u7EE7\u7EED\u3001\u9700\u8981\u4F60\u5904\u7406\u65F6\u505C\u4E0B",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"goal_wait",label:"\u76EE\u6807\u7B49\u5F85",summary:"\u76EE\u6807\u7B49\u5F85\u5916\u90E8\u4E8B\u4EF6\u65F6\u6682\u505C\u81EA\u52A8\u7EED\u8DD1",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"session_search",label:"\u641C\u7D22\u8FC7\u5F80\u4F1A\u8BDD",summary:"\u641C\u7D22\u8FC7\u5F80\u4F1A\u8BDD\u91CC\u7684\u51B3\u5B9A\u548C\u7EA6\u5B9A",source:"@dalcode/dal-recall",readOnly:!0,availability:"default"},{name:"advisor",label:"\u7B2C\u4E8C\u610F\u89C1",summary:"\u8BF7\u53E6\u4E00\u4E2A\u5F3A\u6A21\u578B\u590D\u6838\u5F53\u524D\u65B9\u6848\u5E76\u6307\u51FA\u98CE\u9669",source:"@dalcode/dal-advisor",readOnly:!0,availability:"default"},{name:"structured_output",label:"\u7ED3\u6784\u5316\u8F93\u51FA",summary:"\u6309 --output-schema \u7ED9\u51FA JSON \u683C\u5F0F\u7684\u6700\u7EC8\u56DE\u7B54",source:"@dalcode/dal-structured",readOnly:!0,availability:"opt-in"},{name:"questionnaire",label:"\u95EE\u5377",summary:"\u7528\u9009\u62E9\u9898\u5411\u4F60\u786E\u8BA4\u9700\u6C42\u6216\u504F\u597D",source:"@dalcode/dal-interactive",readOnly:!0,availability:"tui"},{name:"terminal_read",label:"\u8BFB\u53D6\u7EC8\u7AEF",summary:"\u8BFB\u53D6\u7EC8\u7AEF\u6700\u8FD1\u7684\u8F93\u51FA",source:"@dalcode/dal-terminal",readOnly:!0,availability:"host"}],k=(()=>{const a={};for(const e of t){if(e.source==="core")continue;const l=a[e.source]??[];l.push(e.name),a[e.source]=l}return{builtin:t.filter(e=>e.source==="core").map(e=>e.name),extensions:a}})();function O(a=c()){return t.map(e=>({name:e.name,label:d(e.label,a),summary:d(e.summary,a),source:e.source,readOnly:e.readOnly,availability:e.availability}))}i(O,"listToolCatalog");function _(a,e=c()){const l=t.find(n=>n.name===a);if(l)return d(l.label,e);const r=a.match(/^mcp__(.+?)__(.+)$/);return r?`${r[1]} \xB7 ${r[2]}`:a}i(_,"toolDisplayLabel");export{f as BUNDLED_EXTENSION_PACKAGES,k as DAL_TOOL_NAMES,v as PROVIDER_EXTENSION_PACKAGES,g as SAFETY_CRITICAL_PACKAGES,w as listBundledExtensions,O as listToolCatalog,_ as toolDisplayLabel};
|