dal-code 1.0.43 → 1.0.45
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 +36 -0
- package/NOTICE +17 -0
- package/PRIVACY.md +159 -102
- package/dal-docs/README.md +1 -1
- package/dal-docs/keybindings.md +1 -0
- package/dal-docs/settings.md +5 -0
- package/dist/cli/credential-print.js +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/core/agent-session-runtime.js +1 -1
- package/dist/core/agent-session.d.ts +1 -1
- package/dist/core/agent-session.js +7 -7
- package/dist/core/auth-storage.js +1 -1
- package/dist/core/background-processes.js +7 -7
- package/dist/core/export-html/template.js +34 -34
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/types.d.ts +7 -1
- package/dist/core/key-id-schema.js +1 -0
- package/dist/core/keybindings-schema.js +1 -0
- package/dist/core/keybindings.d.ts +5 -0
- package/dist/core/keybindings.js +1 -1
- package/dist/core/model-config.d.ts +818 -99
- package/dist/core/model-config.js +5 -5
- package/dist/core/model-resolver.d.ts +30 -10
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-runtime.d.ts +1 -0
- package/dist/core/model-runtime.js +2 -2
- package/dist/core/package-manager.d.ts +5 -0
- package/dist/core/package-manager.js +2 -2
- package/dist/core/permissions/shell-words.d.ts +26 -0
- package/dist/core/permissions/tool-policy.d.ts +2 -1
- package/dist/core/permissions/tool-policy.js +1 -1
- package/dist/core/project-trust.js +2 -2
- package/dist/core/prompt-templates.js +2 -2
- package/dist/core/remote-catalog-provider.js +1 -1
- package/dist/core/resource-loader.js +1 -1
- package/dist/core/sandbox/libreoffice.js +1 -0
- package/dist/core/sandbox/runtime.d.ts +1 -0
- package/dist/core/sandbox/runtime.js +1 -1
- package/dist/core/sandbox/shell-sandbox.js +6 -6
- package/dist/core/sandbox/windows.js +4 -4
- package/dist/core/session-manager.d.ts +1 -0
- package/dist/core/session-manager.js +12 -12
- package/dist/core/settings-defaults.js +1 -0
- package/dist/core/settings-manager.d.ts +5 -0
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/settings-schema.d.ts +229 -0
- package/dist/core/settings-schema.js +1 -0
- package/dist/core/tool-denial.d.ts +13 -0
- package/dist/core/tool-denial.js +1 -0
- package/dist/core/tools/bash-read-only.d.ts +1 -0
- package/dist/core/tools/bash.js +13 -13
- package/dist/core/tools/read.js +12 -12
- package/dist/core/tools/render-utils.d.ts +40 -0
- package/dist/core/tools/render-utils.js +7 -7
- package/dist/core/tools/renderers/read.js +8 -8
- package/dist/core/trust-manager.js +1 -1
- package/dist/core/workspace-lock.d.ts +6 -2
- package/dist/core/workspace-lock.js +3 -3
- package/dist/dal/extension-compat.js +4 -4
- package/dist/dal/hooks/config.d.ts +5 -1
- package/dist/dal/hooks/config.js +1 -1
- package/dist/dal/hooks/extension.js +3 -3
- package/dist/dal/hooks/index.d.ts +1 -1
- package/dist/dal/hooks/index.js +1 -1
- package/dist/dal/i18n.js +1 -1
- package/dist/dal/manifest.js +1 -1
- package/dist/extensions/codemode/execute.js +14 -13
- package/dist/extensions/codemode/index.js +1 -1
- package/dist/extensions/codemode/renderer.js +6 -6
- package/dist/extensions/codemode/tool.d.ts +2 -3
- package/dist/extensions/codemode/tool.js +9 -12
- package/dist/extensions/mcp/cli.js +4 -4
- package/dist/extensions/mcp/index.js +12 -12
- package/dist/extensions/mcp/resources.d.ts +0 -5
- package/dist/extensions/mcp/resources.js +1 -1
- package/dist/extensions/mcp/runtime.d.ts +1 -4
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/extensions/mcp/tools.js +7 -7
- package/dist/extensions/tool-search/tool.js +3 -3
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1 -1
- package/dist/main.js +3 -3
- package/dist/migrations.js +5 -5
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +1 -1
- package/dist/modes/interactive/components/status-indicator.js +1 -1
- package/dist/modes/interactive/components/tree-selector.js +1 -1
- package/dist/modes/interactive/interactive-mode.js +17 -17
- package/dist/modes/interactive/session-share.js +2 -2
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/modes/interactive/theme/theme-schema.d.ts +18 -0
- package/dist/modes/interactive/theme/theme-schema.js +12 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts +255 -0
- package/dist/modes/interactive/theme/theme-tokens.js +1 -0
- package/dist/modes/interactive/theme/theme.d.ts +7 -10
- package/dist/modes/interactive/theme/theme.js +5 -5
- package/dist/modes/rpc/rpc-client.d.ts +5 -1
- package/dist/modes/rpc/rpc-client.js +2 -2
- package/dist/modes/rpc/rpc-mode.js +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +20 -0
- package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-advisor/src/index.js +8 -8
- 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-bridge/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-capabilities/src/index.js +10 -10
- package/dist/node_modules/@dalcode/dal-codeindex/package.json +34 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/extract.js +3 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/format.js +11 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/index.js +4 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/indexer.js +1 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/languages.js +176 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/project.js +1 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/query.js +2 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/runtime.js +1 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/scan.js +1 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/semantic.js +2 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/sqlite.js +1 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/store.js +33 -0
- package/dist/node_modules/@dalcode/dal-codeindex/src/worker.js +1 -0
- 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-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 +4 -4
- package/dist/node_modules/@dalcode/dal-guard/src/index.js +4 -2
- package/dist/node_modules/@dalcode/dal-guard/src/mode.js +2 -2
- package/dist/node_modules/@dalcode/dal-guard/src/policy.js +1 -0
- 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 +2 -2
- package/dist/node_modules/@dalcode/dal-lsp/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-lsp/src/index.js +12 -10
- package/dist/node_modules/@dalcode/dal-mcp/package.json +7 -5
- package/dist/node_modules/@dalcode/dal-mcp/src/http-client.d.ts +9 -27
- package/dist/node_modules/@dalcode/dal-mcp/src/http-client.js +1 -2
- package/dist/node_modules/@dalcode/dal-mcp/src/index.js +17 -17
- package/dist/node_modules/@dalcode/dal-mcp/src/protocol-client.d.ts +38 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/protocol-client.js +1 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/proxy.js +6 -6
- package/dist/node_modules/@dalcode/dal-mcp/src/resources.js +1 -0
- package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.d.ts +9 -18
- package/dist/node_modules/@dalcode/dal-mcp/src/stdio-client.js +4 -5
- package/dist/node_modules/@dalcode/dal-mcp/src/types.d.ts +50 -5
- package/dist/node_modules/@dalcode/dal-mcp/src/types.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-office/src/index.d.ts +2 -2
- package/dist/node_modules/@dalcode/dal-office/src/index.js +1 -1
- 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 +8 -0
- package/dist/node_modules/@dalcode/dal-office/src/render/pptx.js +3 -3
- package/dist/node_modules/@dalcode/dal-office/src/render/xlsx.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/themes.d.ts +2 -0
- package/dist/node_modules/@dalcode/dal-office/src/themes.js +1 -1
- package/dist/node_modules/@dalcode/dal-office/src/tools/ppt-generate.js +3 -2
- package/dist/node_modules/@dalcode/dal-office/src/tools/ppt-plan.js +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +9 -3
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/session-scope.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 +9 -3
- package/dist/node_modules/@dalcode/dal-pi-kit/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/session-scope.js +1 -0
- package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-plugins/src/brand.js +1 -1
- package/dist/node_modules/@dalcode/dal-plugins/src/index.js +11 -11
- package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-remote/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-remote/src/cli.js +14 -9
- package/dist/node_modules/@dalcode/dal-remote/src/processes.js +2 -0
- package/dist/node_modules/@dalcode/dal-remote/src/service.js +7 -7
- package/dist/node_modules/@dalcode/dal-remote/src/spec.js +1 -1
- 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/core.d.ts +0 -1
- package/dist/node_modules/@dalcode/dal-rewind/src/core.js +8 -8
- package/dist/node_modules/@dalcode/dal-rewind/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-router/package.json +9 -5
- package/dist/node_modules/@dalcode/dal-router/src/advisor.js +1 -1
- package/dist/node_modules/@dalcode/dal-router/src/commands.js +8 -7
- package/dist/node_modules/@dalcode/dal-router/src/config.d.ts +11 -0
- package/dist/node_modules/@dalcode/dal-router/src/config.js +2 -2
- package/dist/node_modules/@dalcode/dal-router/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-router/src/roles/changes.js +5 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/index.js +13 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/models.d.ts +50 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/models.js +1 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/prompts.js +40 -0
- package/dist/node_modules/@dalcode/dal-router/src/roles/signals.js +2 -0
- package/dist/node_modules/@dalcode/dal-router/src/runtime.d.ts +3 -0
- 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-rtk/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-skills/src/bundled/dal-slides/SKILL.md +74 -0
- package/dist/node_modules/@dalcode/dal-skills/src/bundled.js +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/client.js +1 -1
- package/dist/node_modules/@dalcode/dal-skills/src/index.js +14 -14
- package/dist/node_modules/@dalcode/dal-skills/src/packages.js +3 -3
- 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 +8 -8
- package/dist/node_modules/@dalcode/dal-subagent/src/index.js +21 -21
- package/dist/node_modules/@dalcode/dal-subagent/src/progress.js +1 -1
- 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/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/LICENSE +27 -0
- package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-workflow/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-workflow/src/plan-mode.js +13 -13
- package/dist/node_modules/@dalcode/dal-workflow/src/todo-snapshot.js +2 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/todo.js +4 -4
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- 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/types.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/README.md +5 -34
- 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/google-shared.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +4 -4
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +6 -6
- package/dist/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/index.d.ts +0 -1
- 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 +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/models.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.d.ts +359 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/azure.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.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/github-copilot.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/groq.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/kimi-coding.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/moonshotai-cn.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/openai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/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/qwen-token-plan-cn.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/together.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/data/xai.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/xiaomi.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.d.ts +90 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-api.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/types.d.ts +5 -146
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-codemode/README.md +195 -11
- package/dist/node_modules/@earendil-works/pi-codemode/dist/cloudflare.js +1 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/declarations.d.ts +0 -2
- package/dist/node_modules/@earendil-works/pi-codemode/dist/declarations.js +9 -84
- package/dist/node_modules/@earendil-works/pi-codemode/dist/index.d.ts +5 -2
- package/dist/node_modules/@earendil-works/pi-codemode/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-codemode/dist/portable.js +1 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.d.ts +29 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/execution.js +1 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/host.d.ts +3 -16
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +1 -1
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.d.ts +13 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/inline.js +1 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +14 -6
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.d.ts +72 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/protocol.js +1 -1
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.d.ts +32 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/remote.js +1 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/vm.js +3 -0
- package/dist/node_modules/@earendil-works/pi-codemode/dist/runtime/worker.js +1 -3
- package/dist/node_modules/@earendil-works/pi-codemode/dist/source.js +4 -3
- package/dist/node_modules/@earendil-works/pi-codemode/dist/types.d.ts +51 -1
- package/dist/node_modules/@earendil-works/pi-codemode/package.json +14 -2
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/CHANGELOG.md +13 -0
- package/dist/node_modules/@earendil-works/pi-mcp/dist/client.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/index.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.d.ts +2 -2
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/errors.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/oauth/flow.js +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/protocol/content.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.d.ts +2 -2
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/streamable-http.js +4 -4
- package/dist/node_modules/@earendil-works/pi-mcp/dist/transports/transport.d.ts +4 -1
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/README.md +5 -3
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/editor.js +6 -6
- package/dist/node_modules/@earendil-works/pi-tui/dist/components/input.js +2 -2
- package/dist/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/keys.js +5 -5
- 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/tui-alt-screen.js +3 -3
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +4 -0
- package/dist/node_modules/@earendil-works/pi-tui/dist/tui.js +2 -2
- package/dist/node_modules/@earendil-works/pi-tui/dist/utils.js +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/rewind.d.ts +1 -1
- package/dist/sdk/rewind.js +1 -1
- package/dist/utils/clipboard.js +1 -1
- package/dist/utils/output-files.js +1 -1
- package/dist/utils/temp-files.js +1 -0
- package/docs/security.md +24 -7
- package/examples/README.md +0 -3
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/minimal-mode.ts +4 -5
- package/examples/extensions/overlay-test.ts +2 -2
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/index.ts +4 -6
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +9 -460
- package/package.json +3 -12
- package/dist/modes/interactive/theme/theme-json.d.ts +0 -75
- package/dist/modes/interactive/theme/theme-json.js +0 -12
- package/dist/modes/interactive/theme/theme-schema.json +0 -361
- package/dist/node_modules/@earendil-works/chord/README.md +0 -264
- package/dist/node_modules/@earendil-works/chord/dist/api.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/bundler.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/context/index.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/delta/diff.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/delta/draft.js +0 -0
- package/dist/node_modules/@earendil-works/chord/dist/delta/index.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/delta/revision-validator.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/delta/tracker.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/facets/host.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/index.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/json.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -2
- package/dist/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -4
- package/dist/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/node/package.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/node.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/errors.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/handle.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/instances.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/provider.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/state.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/services/wire.js +0 -1
- package/dist/node_modules/@earendil-works/chord/dist/types.js +0 -0
- package/dist/node_modules/@earendil-works/chord/package.json +0 -62
- package/dist/node_modules/@earendil-works/chord/src/delta/README.md +0 -191
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts +0 -63
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/CHANGELOG.md +0 -45
- package/dist/node_modules/@earendil-works/pi-client/LICENSE +0 -21
- package/dist/node_modules/@earendil-works/pi-client/README.md +0 -72
- package/dist/node_modules/@earendil-works/pi-client/dist/client.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/dist/connection.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/dist/errors.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/dist/index.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/dist/promise.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/dist/transport.js +0 -0
- package/dist/node_modules/@earendil-works/pi-client/dist/types.js +0 -0
- package/dist/node_modules/@earendil-works/pi-client/dist/unix.js +0 -1
- package/dist/node_modules/@earendil-works/pi-client/package.json +0 -46
- package/dist/node_modules/@earendil-works/pi-protocol/LICENSE +0 -21
- package/dist/node_modules/@earendil-works/pi-protocol/README.md +0 -41
- package/dist/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/dist/codec.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/dist/framing.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/dist/index.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/dist/protocol.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/dist/schemas.js +0 -1
- package/dist/node_modules/@earendil-works/pi-protocol/package.json +0 -39
- package/dist/node_modules/@earendil-works/pi-server/CHANGELOG.md +0 -81
- package/dist/node_modules/@earendil-works/pi-server/LICENSE +0 -21
- package/dist/node_modules/@earendil-works/pi-server/README.md +0 -63
- package/dist/node_modules/@earendil-works/pi-server/dist/connection.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/errors.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/index.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/listener.js +0 -0
- package/dist/node_modules/@earendil-works/pi-server/dist/server.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/session-router.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/testing/client.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/testing/host.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/testing/index.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/testing/server.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/address.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/index.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/listener.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/preset.js +0 -1
- package/dist/node_modules/@earendil-works/pi-server/dist/transports/unix/types.js +0 -0
- package/dist/node_modules/@earendil-works/pi-server/dist/types.js +0 -0
- package/dist/node_modules/@earendil-works/pi-server/package.json +0 -45
- package/examples/plugins/pi-example-plugin/README.md +0 -38
- package/examples/plugins/pi-example-plugin/package.json +0 -10
- package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
- package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
- package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
- /package/dist/node_modules/{@earendil-works/chord → @dalcode/dal-codeindex}/LICENSE +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,42 @@ DAL Code 的发布说明。这里只写用户看得见的变化。
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.0.45] - 2026-10-22
|
|
12
|
+
|
|
13
|
+
- 权限模式和 DAL Code 桌面一致:「每次询问」「智能自动」(默认)「完全自动」,另加「自动接受编辑」(改文件直接做,运行命令仍先问)。用 `/guard` 选择,`alt+m` 依次切换(可在快捷键设置里改),`dal --permission-mode <模式>` 以某个模式启动,加 `save` 记为以后的默认。智能自动下改文件和普通命令直接执行,删除文件、git push、改写历史等仍会先问;完全自动下 sudo、强制推送、写到项目外仍会问。以前选过"每次询问"的,现在按智能自动处理,行为与之前相同。
|
|
14
|
+
- 子助手和 `dal -p` 现在始终沿用你当前的权限模式(以前只有完全自动会传下去);没有界面时,该模式需要询问的操作会被拒绝并说明原因,不会悄悄放行。
|
|
15
|
+
- DAL 不再往你的项目里写自己的东西:回退检查点、工作区占用标记、按项目安装的扩展包都放在 DAL 自己的目录;项目里旧的 `.dal/commands` 不再被自动改名,原地照常读取。以前留在项目里的检查点、扩展包和会话记录照常可用。
|
|
16
|
+
- 在 DAL Code 里为某个项目添加的钩子现在会在引擎里生效(包括子助手);同一个项目经软链接和真实路径打开,会话记录不再分成两处。
|
|
17
|
+
- 大项目里找代码更快:DAL 在本机为项目建立符号索引(后台自动建立,之后随文件改动增量更新),能直接按名字找到定义(附代码)、调用方、实现和子类、文件大纲和相关文件,少走很多轮搜索。索引存在 DAL 自己的目录、不写进你的项目,同一仓库的多个 worktree 共用一份且互不干扰;全部本机运行,不联网、不需要 key。用 `/codeindex` 查看状态;不想要可在设置里写 `"dalCodeIndex": { "enabled": false }`。按意思找代码的语义检索默认关闭,需要时运行 `/codeindex semantic install`(一次性下载约 57 MB 的本机模型)后在设置里打开 `dalCodeIndex.semantic`。
|
|
18
|
+
- 待办清单改为整份提交:DAL 列计划、完成一步并开始下一步,各只需一次调用,同一时间只有一项「进行中」,长任务里花在记清单上的轮次更少。终端和 DAL Code 侧边的计划条显示方式不变,以前的会话照常打开。想用原来逐条修改的方式,在设置里写 `"todo": { "engine": "classic" }`。
|
|
19
|
+
- 新增可选的「自动选模型按环节分工」,默认关闭:用 `/factory roles on` 开启后,日常执行用快而便宜的模型,多步任务动手前先由更强的模型出计划,收尾前由另一家的模型审查改动、必要时打回一次,同一个检查反复失败时由强模型接手这一步、通过后交回。某个环节的模型不可用时自动换用下一个合适的模型,计划和审查的花费计入费用上限。`/factory roles` 查看各环节用的模型,`/factory roles off` 关闭。
|
|
20
|
+
- 连接器(MCP)更可靠:工具很多的服务器能列出全部工具,不再只看到前几个;返回图片或结构化结果的工具不再显示为「没有输出」;按停止时会通知服务器一起停下;服务器崩溃或断开后,下一次调用会自动重连,不再卡到超时;服务器提供的资源(文档、数据等)现在可以列出和读取。新会话的第一条消息会稍等(最多 5 秒)还没连上的连接器。
|
|
21
|
+
- 无界面运行(`dal -p`)时,如果当前权限模式会拒绝 MCP 调用,就不再自动安装或启用连接器,助手会改用内置的网页读取、搜索等工具完成任务;被拒绝时也会直接换用内置工具,不再停下来等人批准。
|
|
22
|
+
- 几个 DAL 会话同时启动同一个经 npx 安装的连接器时,不会再互相写坏安装;已经损坏的安装会自动重装一次;连接器启动失败时会显示它自己的报错,不再只有「进程退出」。
|
|
23
|
+
- `dal -p "/命令"` 不再在命令结束后偶尔报错退出。
|
|
24
|
+
- 任务运行中输入 `/plan <需求>` 不再被「正在处理」拒绝,会排在当前任务之后执行。
|
|
25
|
+
- 生成 PPT 时,按「双栏」写、内容分两列给出的页面不再变成只剩「[待填写]」的空白页;正文为空或还留着占位符的页面,生成前会逐页指出来补全,不会交出半成品。
|
|
26
|
+
- 生成的 PPT、Word、Excel 中文字体按所在系统选用:Mac 用苹方,Windows 用微软雅黑,Linux 用 Noto Sans CJK。在 Mac 的预览和 Keynote 里不再显示成宋体。
|
|
27
|
+
- 搜索技能时,DAL 自带、市场和项目里的技能排在个人目录里的技能前面,只沾一个词的结果不再列出;新增自带的「幻灯片」技能,命令行里也能用。
|
|
28
|
+
- 沙箱里可以运行 LibreOffice(`soffice`)把文档转成 PDF 了。
|
|
29
|
+
- 系统临时目录里不再越积越多 DAL 留下的文件:用完即删,退出时清理,启动时清掉已不在运行的 DAL 留下的旧文件。
|
|
30
|
+
- 恢复会话时保留会话里已启用的工具;`--tools +名称` / `-名称` 在此基础上增减。以前恢复后会丢掉中途启用的工具。
|
|
31
|
+
- 提示词模板里的空引号参数(`""`、`''`)不再被丢掉,后面的参数不会错位。
|
|
32
|
+
- 设置里 `extensions`、`skills`、`prompts`、`themes` 的 `!~/...`、`+~/...`、`-~/...` 写法现在会展开 `~`。
|
|
33
|
+
- 修复部分终端的颜色应答被拆开时,十六进制字符漏进输入框、甚至打开外部编辑器的问题;`+`、`ctrl++` 这类带上档符号的快捷键在 Kitty 键盘协议下也能识别了。
|
|
34
|
+
- 设置里开启「显示硬件光标」后只显示终端自带的光标,不再同时画一个反色光标。
|
|
35
|
+
- Windows 上读写登录信息偶尔报 `EPERM` 的问题已修复(会短暂重试)。
|
|
36
|
+
- git worktree 嵌套在主仓库里、且 AGENTS.md 是软链接时,项目说明文件能正常加载了。
|
|
37
|
+
|
|
38
|
+
## [1.0.44] - 2026-10-18
|
|
39
|
+
|
|
40
|
+
- 接入 DAL Code 的程序(包括手机端)重新打开历史对话时,能看到当时每个子助手做了多少步、最后停在哪一步、成功还是失败以及结论摘要,不再只有实时运行时才看得到子助手进度。
|
|
41
|
+
|
|
42
|
+
- 接入 DAL Code 的程序(包括手机端)重新打开一段历史对话时,能准确认出哪些操作被拒绝了、是谁拒绝的(你本人、审批规则、沙箱、危险命令拦截,还是 DAL Code 桌面应用),不再只能靠提示文字去猜。终端里的显示不变。
|
|
43
|
+
|
|
44
|
+
- `dal remote enable` 在 macOS 上不再提示“守护进程已启动,但还拿不到配对信息”:手机端后台服务改为按正常优先级运行,启动从半分钟以上缩短到一两秒,开启后当场显示配对二维码。启动较慢时会显示“正在等待守护进程就绪”的进度;服务启动失败或反复崩溃时直接说明失败,并给出日志最后几行,不再假装已经开好。
|
|
45
|
+
- `dal remote disable` 会确认手机端后台服务的所有进程都已退出,按时没退出的会被强制结束并列出;`dal remote status` 会列出不属于正在运行的服务的残留进程。
|
|
46
|
+
|
|
11
47
|
## [1.0.43] - 2026-10-18
|
|
12
48
|
|
|
13
49
|
- 不再问你一件最终一定会被拦下的事:`git clean -fd`、`rm -rf ~`、`git push --force` 这类会被危险命令拦截挡下的命令,现在直接拒绝并说明原因,不会先弹审批让你确认之后又被拦;正常需要审批的命令照旧只问一次。
|
package/NOTICE
CHANGED
|
@@ -82,6 +82,23 @@ The session search tool (@dalcode/dal-recall) is adapted from:
|
|
|
82
82
|
one data directory, results are scoped to the project and kept small,
|
|
83
83
|
node:sqlite is loaded on first use, the pattern-miner preparation is left out.
|
|
84
84
|
|
|
85
|
+
The code index (@dalcode/dal-codeindex) uses:
|
|
86
|
+
|
|
87
|
+
@vscode/tree-sitter-wasm 0.3.1 (https://github.com/microsoft/vscode-tree-sitter-wasm)
|
|
88
|
+
Copyright (c) Microsoft Corporation
|
|
89
|
+
Licensed under the MIT License; its LICENSE file ships in the package
|
|
90
|
+
directory. Prebuilt WebAssembly builds of tree-sitter 0.25 and its
|
|
91
|
+
grammars (tree-sitter-typescript, -javascript, -python, -go, -java, -rust,
|
|
92
|
+
-cpp, -c-sharp, -ruby, -php; MIT, Copyright (c) Max Brunsfeld and the
|
|
93
|
+
tree-sitter contributors).
|
|
94
|
+
|
|
95
|
+
Its definition/reference queries (packages/dal-codeindex/src/languages.ts)
|
|
96
|
+
follow the grammars' queries/tags.scm (tree-sitter-typescript 0.23.2,
|
|
97
|
+
-javascript 0.25.0, -python 0.25.0, -go 0.25.0, -java 0.23.5, -rust 0.24.0,
|
|
98
|
+
-c 0.24.1, -cpp 0.23.4; MIT, Copyright (c) Max Brunsfeld and the
|
|
99
|
+
tree-sitter contributors). Modified: widened to fields, constants, type
|
|
100
|
+
aliases, enums, namespaces, type references and imports.
|
|
101
|
+
|
|
85
102
|
The /usage command (@dalcode/dal-usage) adapts code from:
|
|
86
103
|
|
|
87
104
|
pi-usage-extension 0.9.5 (https://github.com/tmustier/pi-usage-extension)
|
package/PRIVACY.md
CHANGED
|
@@ -1,169 +1,226 @@
|
|
|
1
|
-
# DAL
|
|
1
|
+
# DAL 命令行隐私说明
|
|
2
2
|
|
|
3
|
-
适用于 `dal`
|
|
3
|
+
适用于 `dal` 命令行(DeepAILab LLC 出品)。最后更新:2026-10-20。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
本文说明 `dal` 在你电脑上做什么、什么会离开你的电脑、发到哪里、怎么关闭。它是
|
|
6
|
+
[DAL 隐私政策](https://dal.codes/privacy)(2026-10-18 版)中关于 `dal` 部分的展开;
|
|
7
|
+
两者不一致时,以线上隐私政策为准。
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
+
## 简要说明
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
- `dal` 在你自己的电脑上运行:读文件、跑命令、改代码都在本机完成,你的项目留在本机。
|
|
12
|
+
- 你交给它的任务,以及完成任务需要的内容,会经 DeepAILab 模型服务发给第三方 AI 模型服务商(第一节)。
|
|
13
|
+
- 模型服务会记录每次请求和回复,用于计费、排障、安全和防止滥用(第一节)。
|
|
14
|
+
- 匿名使用统计和失败症状**默认关闭**,你同意后才会发送;接收服务目前尚未部署,现在即使同意也不会收集(第四、五节)。
|
|
15
|
+
- 不投广告,不出售数据,不做跨应用追踪。
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
## 一、你和模型之间的内容
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
`dal` 是 AI 编程助手。使用时,下列内容会发送到 DeepAILab 模型服务,再转给运行你所选模型
|
|
20
|
+
(或"自动"选中的模型)的第三方 AI 模型服务商:
|
|
21
|
+
|
|
22
|
+
- 你的消息、附件和图片;
|
|
23
|
+
- 项目的说明文件(如 `AGENTS.md`)、你的规则和为该项目保存的记忆;
|
|
24
|
+
- 工具返回的结果:读到的文件内容、命令输出、搜索结果;
|
|
25
|
+
- 完成任务所需的环境信息:项目文件夹路径、当前 git 分支名、操作系统和工具版本。
|
|
26
|
+
|
|
27
|
+
这是产品的核心功能,不属于遥测,也不受第四、五节的开关影响。
|
|
28
|
+
|
|
29
|
+
**日志会保留。** DeepAILab 模型服务会记录每次请求和回复,用于计费、排障、保障安全和防止滥用。
|
|
30
|
+
这些记录保存到不再需要用于上述目的、或你删除账号为止(以先到者为准);你也可以随时要求提前删除(第九节)。
|
|
31
|
+
我们不用这些内容训练 AI 模型。
|
|
32
|
+
|
|
33
|
+
每次模型调用都会在你的 DeepAILab 账号里记下模型、token 数、费用和时间,用于显示用量与余额、正确扣费。
|
|
34
|
+
**计费由服务端计量,客户端不上报计费数据。**
|
|
35
|
+
|
|
36
|
+
### 在后台发送内容的功能
|
|
37
|
+
|
|
38
|
+
| 功能 | 发送什么 | 怎么关闭 |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| 自动选模型("自动") | 每次提问的部分内容(最多前 8000 字)和候选模型列表,发给第三方路由服务,用来挑选模型、调整工具与思考深度、给子助手选模型 | 第一次使用前会先征得你的同意;`/factory auto off` 关闭,关闭后不向路由服务发送任何内容 |
|
|
41
|
+
| 经验学习 | 已完成会话的摘录,供模型起草可复用的经验;经验只保存在你的电脑上 | `DAL_LEARN=0`,或在设置里设 `"dalLearn": { "enabled": false }` |
|
|
42
|
+
| 网页搜索 | 搜索词,经 DeepAILab 模型服务转给第三方搜索服务商,或发给你自己配置了密钥的服务商;打开的网页直接从对应网站获取 | 不使用该功能 |
|
|
43
|
+
|
|
44
|
+
## 二、账号与凭据
|
|
45
|
+
|
|
46
|
+
- 登录在浏览器里的 DeepAILab 登录页完成,`dal` 不会看到你的密码。
|
|
47
|
+
- 登录令牌保存在 `~/.dal/agent/auth.json`,只有你的系统用户能读(权限 0600)。
|
|
48
|
+
- `/logout` 删除电脑上的登录令牌。
|
|
49
|
+
- 网关密钥不写入日志。
|
|
50
|
+
|
|
51
|
+
## 三、只保存在你电脑上的内容
|
|
52
|
+
|
|
53
|
+
以下内容只保存在你的电脑上,除本文所述情况外,我们不会收到:
|
|
54
|
+
|
|
55
|
+
- 对话记录(`~/.dal/agent/sessions`),不会自动上传;
|
|
56
|
+
- 学到的经验(`~/.dal/agent/learned`);
|
|
57
|
+
- 设置、技能、插件、MCP 服务器配置和规则(`~/.dal`);
|
|
58
|
+
- 日志。
|
|
59
|
+
|
|
60
|
+
你可以随时删除这些文件夹。
|
|
61
|
+
|
|
62
|
+
## 四、匿名使用统计
|
|
63
|
+
|
|
64
|
+
**默认关闭,你同意后才开。** 没有选择过就等于没有同意:旧版本只"提示过一次"、你从没选择过的,
|
|
65
|
+
升级后同样视为未同意,不会发送。`dal -p` 等无人回答的运行方式一律不发送。
|
|
66
|
+
|
|
67
|
+
**目前不会收集。** 接收服务尚未部署;部署之前,`dal` 既不会问,即使你已同意也不会收集或发送。
|
|
68
|
+
部署后,`dal` 会在终端界面里问你一次:允许 / 不允许 / 以后再问(选"以后再问"三十天内不再问)。
|
|
69
|
+
|
|
70
|
+
### 收集什么
|
|
71
|
+
|
|
72
|
+
只有枚举值和计数,一共五种事件:
|
|
18
73
|
|
|
19
74
|
| 事件 | 内容 |
|
|
20
75
|
|---|---|
|
|
21
|
-
| `session_start` |
|
|
76
|
+
| `session_start` | 启动原因(`startup` / `resume` / `fork` 等固定值之一) |
|
|
22
77
|
| `session_end` | 本次会话的轮数、持续毫秒数 |
|
|
23
|
-
| `model_select` | 模型 ID
|
|
24
|
-
| `tool_end` | 工具名、是否出错
|
|
78
|
+
| `model_select` | 模型 ID(来自我们自己的模型目录)、选择来源(`set` / `cycle` / `restore`) |
|
|
79
|
+
| `tool_end` | 工具名、是否出错 |
|
|
25
80
|
| `crash` | 错误类型名、脱敏后的错误消息与调用栈 |
|
|
26
81
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### 我们不收集什么
|
|
82
|
+
随每批上报的还有:一个与账号无关的随机 ID、DAL 版本号、操作系统与处理器类型、Node 版本。
|
|
30
83
|
|
|
31
|
-
|
|
84
|
+
### 不收集什么
|
|
32
85
|
|
|
33
86
|
- 你输入的提示词、模型返回的内容
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
- MCP 服务器名称。MCP 工具名形如 `mcp__<服务器名>__<工具名>`,
|
|
39
|
-
而服务器名是你自己在 `.dal/mcp.json` 里写的,可能是内部系统的名字,
|
|
40
|
-
因此所有 `mcp__` 开头的工具一律上报为 `mcp__other`。
|
|
41
|
-
你自行安装的扩展所注册的工具,同理上报为 `extension__other`。
|
|
42
|
-
|
|
43
|
-
**计费数据不由客户端上报。** 用量由网关在服务端计量。客户端自报计费既不可信,
|
|
44
|
-
也会多出一个配额可被伪造的入口。
|
|
87
|
+
- 任何文件内容、文件路径、目录名、仓库名
|
|
88
|
+
- 环境变量、密钥
|
|
89
|
+
- 你的账号身份(随机 ID 与 DeepAILab 账号没有关联)
|
|
90
|
+
- MCP 服务器名称:所有 MCP 工具一律记为 `mcp__other`,你自行安装的扩展所注册的工具一律记为 `extension__other`
|
|
45
91
|
|
|
46
92
|
### 崩溃信息怎么脱敏
|
|
47
93
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
- 家目录先行替换,防止漏网
|
|
53
|
-
- 疑似凭据(`sk-`、`Bearer `、JWT、GitHub token)替换为 `<redacted>`
|
|
54
|
-
- 错误消息截断到 300 字符,调用栈最多 20 帧
|
|
94
|
+
- 绝对路径只保留文件名:`/Users/你/secret-project/app.ts` → `<path>/app.ts`
|
|
95
|
+
- 主目录先行替换
|
|
96
|
+
- 疑似密钥和令牌替换为 `<redacted>`
|
|
97
|
+
- 错误消息截断到 300 字符,调用栈最多 20 帧
|
|
55
98
|
|
|
56
99
|
### 怎么关闭
|
|
57
100
|
|
|
58
|
-
三种方式,任选其一:
|
|
59
|
-
|
|
60
101
|
```bash
|
|
61
|
-
/telemetry
|
|
62
|
-
/telemetry
|
|
102
|
+
/telemetry # 在 dal 里执行,查看当前状态和关闭原因
|
|
103
|
+
/telemetry on # 开启(等同于在提问时选"允许")
|
|
104
|
+
/telemetry off # 永久关闭全部上报,并立即删除尚未发出的内容
|
|
63
105
|
export DAL_TELEMETRY=0 # 环境变量
|
|
64
106
|
export DO_NOT_TRACK=1 # 跨厂商通用约定
|
|
65
107
|
```
|
|
66
108
|
|
|
67
|
-
在 CI
|
|
68
|
-
|
|
109
|
+
在 CI 环境(检测到 `CI` / `GITHUB_ACTIONS` / `GITLAB_CI` / `BUILDKITE` / `JENKINS_URL`)中,
|
|
110
|
+
即使同意过也不发送。
|
|
111
|
+
|
|
112
|
+
**你说过"不"的,环境变量无法改回"允许"。** 用 `/telemetry off` 关闭后,任何环境变量都不能重新打开它。
|
|
69
113
|
|
|
70
|
-
|
|
71
|
-
|
|
114
|
+
你的选择和随机 ID 存放在 `~/.dal/agent/telemetry.json`(权限 0600),只在你回答后才写入;
|
|
115
|
+
删除该文件等同于重置为"未同意"。
|
|
72
116
|
|
|
73
|
-
在 DAL Code
|
|
74
|
-
效果与 `/telemetry on|off` 相同,立即生效;选"不允许"时尚未发出的内容会直接丢弃。
|
|
75
|
-
桌面应用启动 `dal` 时也可以通过 `DAL_TELEMETRY_CONSENT=granted|denied`
|
|
76
|
-
(失败症状为 `DAL_FAILURE_REPORTS_CONSENT`)带上你在桌面里的选择,但这只在你还没有在 `dal` 里
|
|
77
|
-
做过选择时才会被采用:**你在 `dal` 里拒绝过的,桌面应用或环境变量都无法改回"允许"**。
|
|
117
|
+
### 在 DAL Code 桌面应用里
|
|
78
118
|
|
|
79
|
-
|
|
80
|
-
|
|
119
|
+
桌面应用在自己的窗口里问同一个问题(设置 › 通用 › 隐私),你在那里的选择会立即交给 `dal`,
|
|
120
|
+
效果与 `/telemetry on|off` 相同;选"不允许"时,尚未发出的内容直接删除。
|
|
81
121
|
|
|
82
|
-
|
|
122
|
+
由桌面应用或脚本启动 `dal` 时,也可以用 `DAL_TELEMETRY_CONSENT=granted|denied`
|
|
123
|
+
(失败症状为 `DAL_FAILURE_REPORTS_CONSENT=granted|denied`)带上一个选择。它只在你还没有在 `dal` 里
|
|
124
|
+
做过选择时才会被采用,不会改掉你已经做出的选择;`DO_NOT_TRACK`、`DAL_TELEMETRY=0` 和 CI 环境仍然优先。
|
|
83
125
|
|
|
84
|
-
|
|
85
|
-
`failure-reporting.ts`(同意与开关)。接收端契约见 `docs/evolution/collector-contract.md`。
|
|
126
|
+
## 五、失败症状上报(默认关闭)
|
|
86
127
|
|
|
87
|
-
**默认关闭。**
|
|
88
|
-
|
|
89
|
-
允许 / 不允许 /
|
|
90
|
-
不写盘、不发送。接收端尚未配置时(当前版本即如此),既不会问,也不会收集。
|
|
128
|
+
**默认关闭。** 与匿名使用统计分开询问,同意其中一项不等于同意另一项。
|
|
129
|
+
接收服务尚未部署,目前既不会问,也不会收集。部署后,`dal` 在任务第一次没做好时问一次:
|
|
130
|
+
允许 / 不允许 / 以后再问(选"以后再问"三十天内不再问)。在你回答之前,失败只在内存里判定,不写盘、不发送。
|
|
91
131
|
|
|
92
132
|
### 上报什么
|
|
93
133
|
|
|
94
|
-
每次没做好的任务最多一条"症状"
|
|
134
|
+
每次没做好的任务最多一条"症状",只有固定值、工具名和计数:
|
|
95
135
|
|
|
96
136
|
| 字段 | 内容 |
|
|
97
137
|
|---|---|
|
|
98
|
-
| 失败类别 |
|
|
99
|
-
| 工具摘要 |
|
|
100
|
-
| 工具序列 |
|
|
101
|
-
| 模型 | 我们目录里的模型 ID
|
|
102
|
-
| 其他 | DAL
|
|
103
|
-
| 标识 | 每条一个随机 ID
|
|
138
|
+
| 失败类别 | 固定列表之一:工具反复失败、编辑位置失效、同一调用原样重复、输出被截断或超出单次花费/轮数上限、上下文溢出、以错误结束、被你中途打断后纠正、下一句在纠正它、测试没过却说完成、多次被保护拦截 |
|
|
139
|
+
| 工具摘要 | 工具名(MCP 工具一律 `mcp__other`,自装扩展一律 `extension__other`)、调用次数、失败次数、错误类别(固定列表) |
|
|
140
|
+
| 工具序列 | 上面这些工具名按顺序折叠,成功/失败,最多 32 段 |
|
|
141
|
+
| 模型 | 我们目录里的模型 ID;你自己配置的模型一律记为 `custom` |
|
|
142
|
+
| 其他 | DAL 版本、操作系统、轮数、耗时(秒)、花费(美元)、压缩次数、日期(只到天) |
|
|
143
|
+
| 标识 | 每条一个随机 ID;一个每 30 天更换一次的随机上报者 ID(只用来统计"多少台机器遇到",与匿名统计 ID、账号都无关) |
|
|
104
144
|
|
|
105
145
|
### 不上报什么
|
|
106
146
|
|
|
107
147
|
提示词、模型回答、工具参数、工具输出、报错原文、代码、文件内容、文件路径、目录名、仓库名、
|
|
108
|
-
|
|
109
|
-
多出任何字段、出现路径或疑似密钥的形状,整条拒发。
|
|
148
|
+
环境变量、密钥。症状里没有可以放这些内容的地方;发送前会再检查一遍,出现多余字段、路径或疑似密钥的,整条不发。
|
|
110
149
|
|
|
111
|
-
###
|
|
150
|
+
### 附带复现材料(每次单独同意)
|
|
112
151
|
|
|
113
|
-
`/telemetry attach`
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
152
|
+
`/telemetry attach` 可以为本次会话最近一次失败附上复现材料:这次任务的请求、工具调用和截断后的
|
|
153
|
+
工具输出。它包含内容,所以每次都会先给你看要发的内容并单独询问,不会记住"总是允许"。
|
|
154
|
+
密钥会被遮盖,敏感文件(`.env`、私钥等)不含内容,绝对路径只保留文件名;
|
|
155
|
+
仍有疑似密钥或个人路径时拒绝发送。
|
|
117
156
|
|
|
118
|
-
###
|
|
157
|
+
### 离线与保存
|
|
119
158
|
|
|
120
|
-
症状先写进 `~/.dal/agent/telemetry-failures.jsonl
|
|
121
|
-
|
|
122
|
-
退出时最多等 1
|
|
159
|
+
症状先写进 `~/.dal/agent/telemetry-failures.jsonl`(权限 0600),联网时分批发送;
|
|
160
|
+
发不出去就留着稍后再试(最多 10 次、最长 14 天、最多 200 条),发送失败从不影响使用,
|
|
161
|
+
退出时最多等 1 秒。接收服务上线后,症状保存 180 天,复现材料保存 30 天。
|
|
123
162
|
|
|
124
163
|
### 怎么关
|
|
125
164
|
|
|
126
165
|
```bash
|
|
127
|
-
/telemetry failures off #
|
|
128
|
-
/telemetry off #
|
|
166
|
+
/telemetry failures off # 关闭失败症状上报,并立即删除待发送内容
|
|
167
|
+
/telemetry off # 关闭全部上报(含失败症状),同样立即删除
|
|
129
168
|
export DAL_FAILURE_REPORTS=0
|
|
130
169
|
```
|
|
131
170
|
|
|
132
171
|
`DO_NOT_TRACK=1`、`DAL_TELEMETRY=0`、CI 环境同样一律关闭。
|
|
133
|
-
`/telemetry failures show`
|
|
172
|
+
`/telemetry failures show` 原样列出待发送的内容,`/telemetry failures` 查看状态。
|
|
134
173
|
|
|
135
|
-
##
|
|
174
|
+
## 六、手机端远程(`dal remote`,默认关闭)
|
|
136
175
|
|
|
137
|
-
`dal`
|
|
138
|
-
|
|
139
|
-
这是产品的核心功能,不属于遥测,也不受上面的遥测开关影响。
|
|
176
|
+
`dal remote` 让 DAL Code 手机 App 连到这台电脑。**默认不开启**:只有你在终端运行
|
|
177
|
+
`dal remote enable` 后,才会下载并启动手机端守护进程。
|
|
140
178
|
|
|
141
|
-
|
|
179
|
+
- **下载什么。** 守护进程从 npm 软件包源(npmmirror,连不上时用 npmjs)下载,
|
|
180
|
+
版本固定,并校验与发布时一致的完整性摘要;不一致则不安装。
|
|
181
|
+
- **运行方式。** 以你的系统用户身份作为后台服务运行(macOS 为 launchd,Linux 为 systemd 用户服务),
|
|
182
|
+
它启动的是你这台电脑上同一个 `dal`,权限与你在终端里直接用 `dal` 相同。
|
|
183
|
+
- **配对。** `dal remote enable` 和 `dal remote pair` 会显示二维码和配对链接,用手机 App 扫码即可配对。
|
|
184
|
+
配对信息等同于这台电脑的访问凭据,请不要发给别人。
|
|
185
|
+
- **连接。** 手机和这台电脑之间的内容经 DeepAILab 的中转服务器(`relay.deepailab.ai`)转发,并且端到端加密:
|
|
186
|
+
中转服务器读不到、也改不了其中的内容,只能看到连接的 IP 地址、时间和数据量。
|
|
187
|
+
- **保存在本机。** 守护进程、它的密钥、配对信息和日志都在 `~/.dal/agent/remote/` 下。
|
|
188
|
+
- **关闭。** `dal remote disable` 停止并移除后台服务;配对信息仍保留,再次开启无需重新配对。
|
|
189
|
+
要彻底解除配对,关闭后删除 `~/.dal/agent/remote/` 文件夹。
|
|
142
190
|
|
|
143
|
-
##
|
|
191
|
+
## 七、更新检查与按需下载
|
|
144
192
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
193
|
+
**更新检查。** `dal` 会向 GitHub(github.com)检查新版本;GitHub 连不上时,改向 DeepAILab 自己的软件包源检查。
|
|
194
|
+
请求只包含 DAL 版本、平台、处理器类型和 Node 版本,不含账号或设备标识(如果你为 DeepAILab 软件包源配置过访问令牌,向它检查时会带上该令牌用于鉴权)。和任何网站一样,这些服务器能看到你的 IP 地址。
|
|
195
|
+
关闭:`DAL_SKIP_VERSION_CHECK=1`,或用 `--offline` 运行。
|
|
148
196
|
|
|
149
|
-
|
|
197
|
+
**按需下载的工具。** 有些能力第一次用到时才下载所需的开源组件,只下载、不发送关于你或你项目的任何内容,
|
|
198
|
+
下载后都会与固定的校验值核对,不一致则不使用:
|
|
150
199
|
|
|
151
|
-
|
|
152
|
-
|
|
200
|
+
| 组件 | 什么时候下载 | 从哪里下载(按顺序) |
|
|
201
|
+
|---|---|---|
|
|
202
|
+
| JavaScript / TypeScript 调试器(vscode-js-debug) | 第一次调试 JavaScript / TypeScript 程序时 | npmmirror、npmjs 上由 DeepAILab 原样转存的同一文件;都连不上时从 GitHub 上的官方发布下载 |
|
|
203
|
+
| Python 调试器(debugpy) | 第一次调试 Python 程序时 | 阿里云 PyPI 镜像,连不上时用 PyPI 官方(files.pythonhosted.org) |
|
|
153
204
|
|
|
154
|
-
|
|
205
|
+
只想从官方来源下载时,设置 `DALCODE_MCP_MIRROR=off`;`--offline` 运行时不下载。
|
|
155
206
|
|
|
156
|
-
|
|
157
|
-
在 DAL 中它们全部不生效,这由测试守住(`test/dal-privacy-doc.test.ts`):
|
|
207
|
+
## 八、你自己连接的服务与不向第三方上报
|
|
158
208
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
209
|
+
你连接的 MCP 服务器、聊天应用、你自己的模型服务商密钥,或让 `dal` 访问的网站和服务,
|
|
210
|
+
会按对方自己的条款收到你或 `dal` 发给它的内容。`/share` 会用你自己的 GitHub 账号把会话上传为私密 gist。
|
|
211
|
+
|
|
212
|
+
除本文列出的去向外,`dal` 不向任何第三方发送安装、使用或版本信息。
|
|
213
|
+
|
|
214
|
+
## 九、你的选择与权利
|
|
215
|
+
|
|
216
|
+
- **删除电脑上的数据。** 删除第三节列出的文件夹;`/logout` 删除登录令牌。
|
|
217
|
+
- **删除账号。** 你可以自己永久删除 DeepAILab 账号:在 DAL Code 的 设置 › 通用 › 隐私 › 删除账号,
|
|
218
|
+
或在网页 https://dal.codes/account/delete 。账户里剩余的余额会作废,删除前会显示金额并要求你确认两次。
|
|
219
|
+
税务和会计法规要求保留的账务记录,会去掉你的姓名、邮箱和登录信息后保留。
|
|
220
|
+
- **访问、更正、导出、删除等请求。** 用账号邮箱写信到 hello@dal.codes。
|
|
164
221
|
|
|
165
|
-
|
|
222
|
+
不出售数据,不用于广告,不与随机 ID 之外的身份关联。
|
|
166
223
|
|
|
167
|
-
##
|
|
224
|
+
## 十、联系
|
|
168
225
|
|
|
169
|
-
|
|
226
|
+
DeepAILab LLC —— hello@dal.codes
|
package/dal-docs/README.md
CHANGED
|
@@ -84,7 +84,7 @@ In a session:
|
|
|
84
84
|
| `/skill`, `/skills` | Manage local skills / browse DeepAILab cloud skills |
|
|
85
85
|
| `/packages`, `/install` | Recommended extensions for the account / install one |
|
|
86
86
|
| `/mcp` | Manage MCP servers |
|
|
87
|
-
| `/guard` |
|
|
87
|
+
| `/guard` | Permission mode: `default` (ask every time), `acceptEdits` (accept edits, commands still ask), `auto` (smart auto, the default: deletes, pushes and history rewrites ask), `yolo` (full auto: only sudo, `curl \| sh`, raw disk tools, force pushes and writes outside the project or to protected files ask). `/guard` alone opens a picker; add `save` to make it the default. `alt+m` (`app.permission.cycle`) cycles through them, `dal --permission-mode <mode>` starts in one (`--yolo` is full auto). Sub-agents and `dal -p` run in their parent's mode; with no UI, what the mode would ask about is refused. Destructive commands and DAL login credentials stay blocked in every mode |
|
|
88
88
|
| `/rewind` | Restore files and conversation to an earlier checkpoint |
|
|
89
89
|
| `/review` | Read-only code review: uncommitted changes (default), `--base <branch>`, `--commit <sha>`, `--pr <n>` (needs `gh`), or `--custom <what to check>`; extra words are focus instructions. Findings come back as P0–P3 with file:line and a suggested fix; ask "fix the P1s" afterwards |
|
|
90
90
|
| `/lang` | Interface language (`zh` or `en`) |
|
package/dal-docs/keybindings.md
CHANGED
|
@@ -27,6 +27,7 @@ most symbols. A value can be one key or a list.
|
|
|
27
27
|
| `app.model.cycleForward` | `ctrl+p` | Next model in the cycle list |
|
|
28
28
|
| `app.thinking.cycle` | `shift+tab` | Cycle the thinking level |
|
|
29
29
|
| `app.thinking.toggle` | `ctrl+t` | Show or hide thinking blocks |
|
|
30
|
+
| `app.permission.cycle` | `alt+m` | Switch the permission mode (ask every time → accept edits → smart auto → full auto) |
|
|
30
31
|
| `app.tools.expand` | `ctrl+o` | Expand or collapse tool output |
|
|
31
32
|
| `app.editor.external` | `ctrl+g` | Edit the prompt in `$VISUAL` / `$EDITOR` |
|
|
32
33
|
| `app.clipboard.pasteImage` | `ctrl+v` (`alt+v` on Windows/WSL) | Paste an image or text |
|
package/dal-docs/settings.md
CHANGED
|
@@ -30,6 +30,11 @@ with `ctrl+s`.
|
|
|
30
30
|
- `defaultThinkingLevel`: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`.
|
|
31
31
|
- `defaultProjectTrust` (user file only): `ask`, `always` or `never` — what to
|
|
32
32
|
do with a project's `.dal/` folder when no decision was saved with `/trust`.
|
|
33
|
+
- `todo.engine` (user file only): how the agent keeps its task list.
|
|
34
|
+
`"snapshot"` (default) sends the whole list in each call (fewer calls);
|
|
35
|
+
`"classic"` edits it one action at a time. `DAL_TODO_ENGINE` overrides it
|
|
36
|
+
for one run.
|
|
37
|
+
Either engine reopens sessions the other wrote.
|
|
33
38
|
|
|
34
39
|
## Project trust
|
|
35
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var A=Object.defineProperty;var w=(v,o)=>A(v,"name",{value:o,configurable:!0});import{resolveCliModel as y,resolveModelReference as _}from"../core/model-resolver.js";import{fill as a,t}from"../dal/i18n.js";import{AuthCommandError as d,getAuthCredential as M,validateAuthCommandArgs as P}from"./auth-command.js";const I=30*6e4;async function k(v,o,i,g,f){const{provider:n,model:h}=P(v,i),c=new Map((await o.listCredentials({signal:f})).map(e=>[e.providerId,e.type])),s=[];if(n){const e=o.getProvider(n);if(!e)throw new d(a(t("\u672A\u77E5\u7684\u63D0\u4F9B\u65B9\u300C{provider}\u300D\u3002\u53EF\u7528 --list-models \u67E5\u770B\u6709\u54EA\u4E9B\u63D0\u4F9B\u65B9\u3002"),{provider:n}));if(h){const r=y({cliProvider:e.id,cliModel:h,modelRuntime:o});if(r.error||!r.model)throw new d(r.error??t("\u65E0\u6CD5\u89E3\u6790\u6240\u8BF7\u6C42\u7684\u63D0\u4F9B\u65B9/\u6A21\u578B"));s.push({id:e.id,model:r.model})}else s.push({id:e.id})}else{const e=o.getModels();for(const r of o.getProviders()){if(!c.has(r.id))continue;const p=_({text:h,provider:r.id,thinkingSuffix:"strict",fuzzy:!0},e,()=>!0);p.status==="resolved"&&s.push({id:r.id,model:p.model})}if(s.length===0)throw new d(a(t("\u627E\u4E0D\u5230\u6A21\u578B\u300C{model}\u300D\u3002\u53EF\u7528 --list-models \u67E5\u770B\u6709\u54EA\u4E9B\u6A21\u578B\u3002"),{model:String(h)}))}const l=[];for(const e of s){const r=c.get(e.id);if(i==="api_key"&&r==="oauth"||i==="bearer_token"&&r!=="oauth")continue;const p={...i==="bearer_token"?{minOAuthValidityMs:g??I}:{},signal:f},m=e.model?await o.getAuth(e.model,p):await o.getAuth(e.id,p),u=M(m);u&&l.push({providerId:e.id,value:u})}if(l.length===1)return l[0].value;if(l.length===0){const e=s[0]?.id,r=e?c.get(e):void 0;throw n&&i==="api_key"&&r==="oauth"?new d(a(t("\u63D0\u4F9B\u65B9\u300C{provider}\u300D\u914D\u7F6E\u7684\u662F OAuth \u767B\u5F55\uFF0C\u4E0D\u662F API key"),{provider:String(e)})):n&&i==="bearer_token"&&r!=="oauth"?new d(a(t("\u63D0\u4F9B\u65B9\u300C{provider}\u300D\u6CA1\u6709\u914D\u7F6E OAuth bearer token"),{provider:String(e)})):new d(i==="api_key"?t("\u6CA1\u6709\u914D\u7F6E\u53EF\u7528\u7684 API key"):t("\u6CA1\u6709\u914D\u7F6E\u53EF\u7528\u7684 OAuth bearer token"))}throw new d(a(t("\u5339\u914D\u5230\u591A\u4E2A\u5DF2\u914D\u7F6E\u7684\u63D0\u4F9B\u65B9\uFF08{providers}\uFF09\uFF0C\u8BF7\u7528 --provider \u6307\u5B9A\u3002"),{providers:l.map(({providerId:e})=>e).join(", ")}))}w(k,"resolveCredentialForPrint");export{k as resolveCredentialForPrint};
|
package/dist/config.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export declare function getSettingsPath(): string;
|
|
|
70
70
|
export declare function getToolsDir(): string;
|
|
71
71
|
export declare function getBinDir(): string;
|
|
72
72
|
export declare function getPromptsDir(): string;
|
|
73
|
+
export declare function getProjectPromptsDir(projectConfigDir: string): string;
|
|
73
74
|
export declare function getSessionsDir(): string;
|
|
74
75
|
export declare function getDebugLogPath(): string;
|
|
75
76
|
export {};
|
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var K=Object.defineProperty;var n=(e,t)=>K(e,"name",{value:t,configurable:!0});import{accessSync as N,constants as U,existsSync as g,readFileSync as S,realpathSync as H}from"fs";import{createRequire as V}from"module";import{homedir as A}from"os";import{basename as R,dirname as u,join as i,resolve as h,sep as v,win32 as z}from"path";import{fileURLToPath as Q}from"url";import{spawnProcessSync as X}from"./utils/child-process.js";import{normalizePath as C}from"./utils/paths.js";import{stripBom as k}from"./utils/text.js";const Y=Q(import.meta.url),L=u(Y),x=import.meta.url.includes("$bunfs")||import.meta.url.includes("~BUN")||import.meta.url.includes("%7EBUN"),Z=!!process.versions.bun,ee=typeof PI_BUNDLED_NODE<"u"&&PI_BUNDLED_NODE;function te(e){return e.startsWith("https://")||e.startsWith("http://")}n(te,"isUrlInstallSpec");function O(e){return typeof e=="string"?{packageName:e,installSpec:e}:{packageName:e.packageName,installSpec:e.installSpec??e.packageName}}n(O,"normalizeSelfUpdatePackageTarget");function P(e,t){return t?{...e,display:`${t.display} && ${e.display}`,steps:[t,e]}:e}n(P,"makeSelfUpdateCommand");function m(e,t){return{command:e,args:t,display:[e,...t].map(o=>/\s/.test(o)?`"${o}"`:o).join(" ")}}n(m,"makeSelfUpdateCommandStep");function y(){if(x)return"bun-binary";const e=`${L}\0${process.execPath||""}`.toLowerCase().replace(/\\/g,"/");return e.includes("/pnpm/")||e.includes("/.pnpm/")?"pnpm":e.includes("/yarn/")||e.includes("/.yarn/")?"yarn":Z||e.includes("/install/global/node_modules/")?"bun":e.includes("/npm/")||e.includes("/node_modules/")?"npm":"unknown"}n(y,"detectInstallMethod");function $(){const e=a(),t=process.platform==="win32"||e.includes("\\")?z:{basename:R,dirname:u},o=t.dirname(e);let r;if(t.basename(o).startsWith("@")&&t.basename(t.dirname(o))==="node_modules"?r=t.dirname(o):t.basename(o)==="node_modules"&&(r=o),!r)return;const s=t.dirname(r);if(t.basename(s)==="lib")return{root:r,prefix:t.dirname(s)}}n($,"getInferredNpmInstall");function I(e,t,o=t,r){const s=O(o),c=s.packageName===me&&!te(s.installSpec)?[`--${ge}:registry=${be}/`]:[];switch(e){case"bun-binary":return;case"pnpm":{const p=_("pnpm",["root","-g"])?void 0:/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(a()),f=p?[`--config.global-bin-dir=${process.env.PNPM_HOME||u(u(p[1]))}`]:[];return P(m("pnpm",["install","-g","--ignore-scripts","--config.minimumReleaseAge=0",...f,...c,s.installSpec]),s.packageName===t?void 0:m("pnpm",["remove","-g",...f,t]))}case"yarn":return P(m("yarn",["global","add","--ignore-scripts",...c,s.installSpec]),s.packageName===t?void 0:m("yarn",["global","remove",t]));case"bun":return P(m("bun",["install","-g","--ignore-scripts","--minimum-release-age=0",...c,s.installSpec]),s.packageName===t?void 0:m("bun",["uninstall","-g",t]));case"npm":{const[p="npm",...f]=r??[],d=r?.length?void 0:$(),D=[...f,...d?["--prefix",d.prefix]:[]],J=m(p,[...D,"install","-g","--ignore-scripts","--min-release-age=0",...c,s.installSpec]),q=s.packageName===t?void 0:m(p,[...D,"uninstall","-g",t]);return P(J,q)}case"unknown":return}}n(I,"getSelfUpdateCommandForMethod");function _(e,t,o={}){const r=X(e,t,{encoding:"utf-8",stdio:["ignore","pipe","pipe"]});if(r.status===0)return r.stdout.trim()||void 0;if(o.requireSuccess){const s=r.error?.message||r.stderr.trim()||`exit code ${r.status??"unknown"}`;throw new Error(`Failed to run ${[e,...t].join(" ")}: ${s}`)}}n(_,"readCommandOutput");function ne(e,t,o){switch(e){case"npm":{const r=!!o?.length,[s="npm",...c]=o??[];if(r&&s==="bun"){const d=_(s,[...c,"pm","bin","-g"],{requireSuccess:!0}),D=[i(A(),".bun","install","global","node_modules")];return d&&D.push(i(u(d),"install","global","node_modules")),D}const p=_(s,[...c,"root","-g"],{requireSuccess:r}),f=r?void 0:$();return[p,f?.root].filter(d=>!!d)}case"pnpm":{const r=_("pnpm",["root","-g"]);if(r)return[r,u(r)];const s=/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(a());return s?[s[1]]:[]}case"yarn":{const r=_("yarn",["global","dir"]);return r?[r,i(r,"node_modules")]:[]}case"bun":{const r=_("bun",["pm","bin","-g"]),s=[i(A(),".bun","install","global","node_modules")];return r&&s.push(i(u(r),"install","global","node_modules")),s}case"bun-binary":case"unknown":return[]}}n(ne,"getGlobalPackageRoots");function T(e,t){const o=h(e);if(!g(o))return;let r=o;if(t)try{r=H(o)}catch{return}return process.platform==="win32"&&(r=r.toLowerCase()),r}n(T,"normalizeExistingPathForComparison");function W(e){return Array.from(new Set([T(e,!1),T(e,!0)].filter(t=>!!t)))}n(W,"getPathComparisonCandidates");function re(){const e=process.argv[1];if(!e)return;let t=u(e);for(;t!==u(t);){if(g(i(t,"package.json")))return t;t=u(t)}}n(re,"getEntrypointPackageDir");function B(){const e=a();try{return N(e,U.W_OK),N(u(e),U.W_OK),!0}catch{return!1}}n(B,"isSelfUpdatePathWritable");function G(e,t,o){const s=[a(),re()].filter(c=>!!c).flatMap(c=>W(c));return ne(e,t,o).some(c=>W(c).some(p=>{const f=p.endsWith(v)?p:`${p}${v}`;return s.some(d=>d.startsWith(f))}))}n(G,"isManagedByGlobalPackageManager");function Ue(e,t,o=e){const r=y(),s=I(r,e,o,t);if(!(!s||!G(r,e,t)||!B()))return s}n(Ue,"getSelfUpdateCommand");function oe(e,t,o=e){const r=y(),s=O(o);if(r==="bun-binary")return`Download from: ${E==="pi"?"https://github.com/earendil-works/pi/releases/latest":xe}`;const c=I(r,e,s,t);return c?G(r,e,t)&&!B()?`This installation is managed by a global ${r} install, but the install path is not writable. Update it yourself with: ${c.display}`:`This installation is not managed by a global ${r} install. Update it with the package manager, wrapper, or source checkout that provides it.`:`Update ${s.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`}n(oe,"getSelfUpdateUnavailableInstruction");function Re(e){const t=y(),o=I(t,e);return o?`Run: ${o.display}`:oe(e)}n(Re,"getUpdateInstruction");function ie(e){let t=e;for(;t!==u(t);){if(g(i(t,"package.json"))){const o=u(t);return R(t)==="dist"&&g(i(o,"package.json"))?o:t}t=u(t)}return e}n(ie,"findNodePackageDir");function a(){const e=process.env.PI_PACKAGE_DIR;return e?C(e):x?u(process.execPath):ie(L)}n(a,"getPackageDir");function ve(){if(x)return i(a(),"theme");const e=a(),t=g(i(e,"src"))?"src":"dist";return i(e,t,"modes","interactive","theme")}n(ve,"getThemesDir");function Ce(){if(x)return i(a(),"export-html");const e=a(),t=g(i(e,"src"))?"src":"dist";return i(e,t,"core","export-html")}n(Ce,"getExportTemplateDir");function se(){return i(a(),"package.json")}n(se,"getPackageJsonPath");function Le(){return h(i(a(),"README.md"))}n(Le,"getReadmePath");function Oe(){return h(i(a(),"docs"))}n(Oe,"getDocsPath");function ae(){return h(i(a(),"examples"))}n(ae,"getExamplesPath");function ce(){return h(i(a(),"dal-docs"))}n(ce,"getDalDocsPath");function $e(){return i(ce(),"examples","extensions")}n($e,"getDalExtensionExamplesPath");function Te(){return h(i(ae(),"extensions","official"))}n(Te,"getOfficialExtensionsPath");const ue="@deepailab/dal-official-extensions";function We(e){try{return JSON.parse(k(S(i(e,"package.json"),"utf-8"))).name===ue}catch{return!1}}n(We,"isOfficialExtensionsPackage");function Be(){return h(i(a(),"CHANGELOG.md"))}n(Be,"getChangelogPath");function pe(){if(x)return i(a(),"assets");const e=a(),t=g(i(e,"src"))?"src":"dist";return i(e,t,"modes","interactive","assets")}n(pe,"getInteractiveAssetsDir");function Ge(e){return i(pe(),e)}n(Ge,"getBundledInteractiveAssetPath");let w;function je(e){w=e}n(je,"setEmbeddedQuickJSWasmPath");function Me(){return w??=V(import.meta.url).resolve("quickjs-wasi/quickjs.wasm"),w}n(Me,"getQuickJSWasmPath");function de(e,t){if(e==="bun-binary")return"./src/extensions/codemode/worker.ts";if(e==="bundled-node")return new URL("./codemode-worker.js",t)}n(de,"resolveCodemodeWorkerSpecifier");let j;function Fe(){const e=x?"bun-binary":ee?"bundled-node":"unbundled",t=de(e,import.meta.url);return e!=="bundled-node"||!(t instanceof URL)?t:(j??=new URL(`data:text/javascript;base64,${S(t).toString("base64")}`),j)}n(Fe,"getCodemodeWorkerSpecifier");function Je(e=M){if(x||!e)return;let t;try{t=JSON.parse(k(S(e,"utf-8")))}catch(o){return o.code==="ENOENT"?{kind:"removed"}:void 0}return t.version&&t.version!==fe?{kind:"updated",version:t.version}:void 0}n(Je,"detectInstallChange");let b={},M;try{const e=se();b=JSON.parse(k(S(e,"utf-8"))),M=e}catch(e){if(e.code!=="ENOENT")throw e}const F=b.piConfig?.name,qe=b.name||"@earendil-works/pi-coding-agent",E=F||"pi",Ke=b.piConfig?.title||(F?E:"\u03C0"),le=b.piConfig?.configDir||".dal",He=E!=="pi",Ve=[".agents",".claude"],fe=b.version||"0.0.0",ze=b.piConfig?.upstreamPi,me="@deepailab/dal",ge="@deepailab",he="DeepAILab-Team/dal-dist",xe=`https://github.com/${he}/releases`,be="https://git.siweibot.com/api/packages/gitea/npm",_e=`${E.toUpperCase()}_CODING_AGENT_DIR`,Qe=`${E.toUpperCase()}_CODING_AGENT_SESSION_DIR`;function Ee(e){return C(e)}n(Ee,"expandTildePath");function Xe(e,t=`https://gist.github.com/${e}`){const o=process.env.DAL_SHARE_VIEWER_URL||process.env.PI_SHARE_VIEWER_URL;return o?`${o}#${e}`:t}n(Xe,"getShareViewerUrl");function l(){const e=process.env[_e];return e?Ee(e):i(A(),le,"agent")}n(l,"getAgentDir");function Ye(){return i(l(),"themes")}n(Ye,"getCustomThemesDir");function Ze(){return i(l(),"models.json")}n(Ze,"getModelsPath");function et(){return i(l(),"auth.json")}n(et,"getAuthPath");function tt(){return i(l(),"settings.json")}n(tt,"getSettingsPath");function nt(){return i(l(),"tools")}n(nt,"getToolsDir");function rt(){return i(l(),"bin")}n(rt,"getBinDir");function ot(){return i(l(),"prompts")}n(ot,"getPromptsDir");function it(){return i(l(),"sessions")}n(it,"getSessionsDir");function st(){return i(l(),`${E}-debug.log`)}n(st,"getDebugLogPath");export{E as APP_NAME,Ke as APP_TITLE,le as CONFIG_DIR_NAME,xe as DAL_RELEASES_URL,he as DAL_RELEASE_REPO,me as DAL_UPDATE_PACKAGE,be as DAL_UPDATE_REGISTRY,ge as DAL_UPDATE_SCOPE,_e as ENV_AGENT_DIR,Qe as ENV_SESSION_DIR,He as IS_WHITE_LABEL_BUILD,ue as OFFICIAL_EXTENSIONS_PACKAGE_NAME,qe as PACKAGE_NAME,Ve as SHARED_SKILL_CONFIG_DIRS,ze as UPSTREAM_PI,fe as VERSION,Je as detectInstallChange,y as detectInstallMethod,Ee as expandTildePath,ie as findNodePackageDir,l as getAgentDir,et as getAuthPath,rt as getBinDir,Ge as getBundledInteractiveAssetPath,Be as getChangelogPath,Fe as getCodemodeWorkerSpecifier,Ye as getCustomThemesDir,ce as getDalDocsPath,$e as getDalExtensionExamplesPath,st as getDebugLogPath,Oe as getDocsPath,ae as getExamplesPath,Ce as getExportTemplateDir,pe as getInteractiveAssetsDir,Ze as getModelsPath,Te as getOfficialExtensionsPath,a as getPackageDir,se as getPackageJsonPath,ot as getPromptsDir,Me as getQuickJSWasmPath,Le as getReadmePath,Ue as getSelfUpdateCommand,oe as getSelfUpdateUnavailableInstruction,it as getSessionsDir,tt as getSettingsPath,Xe as getShareViewerUrl,ve as getThemesDir,nt as getToolsDir,Re as getUpdateInstruction,x as isBunBinary,Z as isBunRuntime,ee as isBundledNode,We as isOfficialExtensionsPackage,de as resolveCodemodeWorkerSpecifier,je as setEmbeddedQuickJSWasmPath};
|
|
1
|
+
var K=Object.defineProperty;var n=(e,t)=>K(e,"name",{value:t,configurable:!0});import{accessSync as N,constants as U,existsSync as l,readFileSync as P,realpathSync as H}from"fs";import{createRequire as V}from"module";import{homedir as A}from"os";import{basename as R,dirname as u,join as i,resolve as h,sep as v,win32 as z}from"path";import{fileURLToPath as Q}from"url";import{spawnProcessSync as X}from"./utils/child-process.js";import{normalizePath as C}from"./utils/paths.js";import{stripBom as k}from"./utils/text.js";const Y=Q(import.meta.url),L=u(Y),x=import.meta.url.includes("$bunfs")||import.meta.url.includes("~BUN")||import.meta.url.includes("%7EBUN"),Z=!!process.versions.bun,ee=typeof PI_BUNDLED_NODE<"u"&&PI_BUNDLED_NODE;function te(e){return e.startsWith("https://")||e.startsWith("http://")}n(te,"isUrlInstallSpec");function O(e){return typeof e=="string"?{packageName:e,installSpec:e}:{packageName:e.packageName,installSpec:e.installSpec??e.packageName}}n(O,"normalizeSelfUpdatePackageTarget");function S(e,t){return t?{...e,display:`${t.display} && ${e.display}`,steps:[t,e]}:e}n(S,"makeSelfUpdateCommand");function g(e,t){return{command:e,args:t,display:[e,...t].map(o=>/\s/.test(o)?`"${o}"`:o).join(" ")}}n(g,"makeSelfUpdateCommandStep");function y(){if(x)return"bun-binary";const e=`${L}\0${process.execPath||""}`.toLowerCase().replace(/\\/g,"/");return e.includes("/pnpm/")||e.includes("/.pnpm/")?"pnpm":e.includes("/yarn/")||e.includes("/.yarn/")?"yarn":Z||e.includes("/install/global/node_modules/")?"bun":e.includes("/npm/")||e.includes("/node_modules/")?"npm":"unknown"}n(y,"detectInstallMethod");function $(){const e=a(),t=process.platform==="win32"||e.includes("\\")?z:{basename:R,dirname:u},o=t.dirname(e);let r;if(t.basename(o).startsWith("@")&&t.basename(t.dirname(o))==="node_modules"?r=t.dirname(o):t.basename(o)==="node_modules"&&(r=o),!r)return;const s=t.dirname(r);if(t.basename(s)==="lib")return{root:r,prefix:t.dirname(s)}}n($,"getInferredNpmInstall");function I(e,t,o=t,r){const s=O(o),c=s.packageName===me&&!te(s.installSpec)?[`--${ge}:registry=${be}/`]:[];switch(e){case"bun-binary":return;case"pnpm":{const p=_("pnpm",["root","-g"])?void 0:/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(a()),m=p?[`--config.global-bin-dir=${process.env.PNPM_HOME||u(u(p[1]))}`]:[];return S(g("pnpm",["install","-g","--ignore-scripts","--config.minimumReleaseAge=0",...m,...c,s.installSpec]),s.packageName===t?void 0:g("pnpm",["remove","-g",...m,t]))}case"yarn":return S(g("yarn",["global","add","--ignore-scripts",...c,s.installSpec]),s.packageName===t?void 0:g("yarn",["global","remove",t]));case"bun":return S(g("bun",["install","-g","--ignore-scripts","--minimum-release-age=0",...c,s.installSpec]),s.packageName===t?void 0:g("bun",["uninstall","-g",t]));case"npm":{const[p="npm",...m]=r??[],d=r?.length?void 0:$(),D=[...m,...d?["--prefix",d.prefix]:[]],J=g(p,[...D,"install","-g","--ignore-scripts","--min-release-age=0",...c,s.installSpec]),q=s.packageName===t?void 0:g(p,[...D,"uninstall","-g",t]);return S(J,q)}case"unknown":return}}n(I,"getSelfUpdateCommandForMethod");function _(e,t,o={}){const r=X(e,t,{encoding:"utf-8",stdio:["ignore","pipe","pipe"]});if(r.status===0)return r.stdout.trim()||void 0;if(o.requireSuccess){const s=r.error?.message||r.stderr.trim()||`exit code ${r.status??"unknown"}`;throw new Error(`Failed to run ${[e,...t].join(" ")}: ${s}`)}}n(_,"readCommandOutput");function ne(e,t,o){switch(e){case"npm":{const r=!!o?.length,[s="npm",...c]=o??[];if(r&&s==="bun"){const d=_(s,[...c,"pm","bin","-g"],{requireSuccess:!0}),D=[i(A(),".bun","install","global","node_modules")];return d&&D.push(i(u(d),"install","global","node_modules")),D}const p=_(s,[...c,"root","-g"],{requireSuccess:r}),m=r?void 0:$();return[p,m?.root].filter(d=>!!d)}case"pnpm":{const r=_("pnpm",["root","-g"]);if(r)return[r,u(r)];const s=/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(a());return s?[s[1]]:[]}case"yarn":{const r=_("yarn",["global","dir"]);return r?[r,i(r,"node_modules")]:[]}case"bun":{const r=_("bun",["pm","bin","-g"]),s=[i(A(),".bun","install","global","node_modules")];return r&&s.push(i(u(r),"install","global","node_modules")),s}case"bun-binary":case"unknown":return[]}}n(ne,"getGlobalPackageRoots");function T(e,t){const o=h(e);if(!l(o))return;let r=o;if(t)try{r=H(o)}catch{return}return process.platform==="win32"&&(r=r.toLowerCase()),r}n(T,"normalizeExistingPathForComparison");function W(e){return Array.from(new Set([T(e,!1),T(e,!0)].filter(t=>!!t)))}n(W,"getPathComparisonCandidates");function re(){const e=process.argv[1];if(!e)return;let t=u(e);for(;t!==u(t);){if(l(i(t,"package.json")))return t;t=u(t)}}n(re,"getEntrypointPackageDir");function B(){const e=a();try{return N(e,U.W_OK),N(u(e),U.W_OK),!0}catch{return!1}}n(B,"isSelfUpdatePathWritable");function G(e,t,o){const s=[a(),re()].filter(c=>!!c).flatMap(c=>W(c));return ne(e,t,o).some(c=>W(c).some(p=>{const m=p.endsWith(v)?p:`${p}${v}`;return s.some(d=>d.startsWith(m))}))}n(G,"isManagedByGlobalPackageManager");function Ue(e,t,o=e){const r=y(),s=I(r,e,o,t);if(!(!s||!G(r,e,t)||!B()))return s}n(Ue,"getSelfUpdateCommand");function oe(e,t,o=e){const r=y(),s=O(o);if(r==="bun-binary")return`Download from: ${E==="pi"?"https://github.com/earendil-works/pi/releases/latest":xe}`;const c=I(r,e,s,t);return c?G(r,e,t)&&!B()?`This installation is managed by a global ${r} install, but the install path is not writable. Update it yourself with: ${c.display}`:`This installation is not managed by a global ${r} install. Update it with the package manager, wrapper, or source checkout that provides it.`:`Update ${s.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`}n(oe,"getSelfUpdateUnavailableInstruction");function Re(e){const t=y(),o=I(t,e);return o?`Run: ${o.display}`:oe(e)}n(Re,"getUpdateInstruction");function ie(e){let t=e;for(;t!==u(t);){if(l(i(t,"package.json"))){const o=u(t);return R(t)==="dist"&&l(i(o,"package.json"))?o:t}t=u(t)}return e}n(ie,"findNodePackageDir");function a(){const e=process.env.PI_PACKAGE_DIR;return e?C(e):x?u(process.execPath):ie(L)}n(a,"getPackageDir");function ve(){if(x)return i(a(),"theme");const e=a(),t=l(i(e,"src"))?"src":"dist";return i(e,t,"modes","interactive","theme")}n(ve,"getThemesDir");function Ce(){if(x)return i(a(),"export-html");const e=a(),t=l(i(e,"src"))?"src":"dist";return i(e,t,"core","export-html")}n(Ce,"getExportTemplateDir");function se(){return i(a(),"package.json")}n(se,"getPackageJsonPath");function Le(){return h(i(a(),"README.md"))}n(Le,"getReadmePath");function Oe(){return h(i(a(),"docs"))}n(Oe,"getDocsPath");function ae(){return h(i(a(),"examples"))}n(ae,"getExamplesPath");function ce(){return h(i(a(),"dal-docs"))}n(ce,"getDalDocsPath");function $e(){return i(ce(),"examples","extensions")}n($e,"getDalExtensionExamplesPath");function Te(){return h(i(ae(),"extensions","official"))}n(Te,"getOfficialExtensionsPath");const ue="@deepailab/dal-official-extensions";function We(e){try{return JSON.parse(k(P(i(e,"package.json"),"utf-8"))).name===ue}catch{return!1}}n(We,"isOfficialExtensionsPackage");function Be(){return h(i(a(),"CHANGELOG.md"))}n(Be,"getChangelogPath");function pe(){if(x)return i(a(),"assets");const e=a(),t=l(i(e,"src"))?"src":"dist";return i(e,t,"modes","interactive","assets")}n(pe,"getInteractiveAssetsDir");function Ge(e){return i(pe(),e)}n(Ge,"getBundledInteractiveAssetPath");let w;function je(e){w=e}n(je,"setEmbeddedQuickJSWasmPath");function Me(){return w??=V(import.meta.url).resolve("quickjs-wasi/quickjs.wasm"),w}n(Me,"getQuickJSWasmPath");function de(e,t){if(e==="bun-binary")return"./src/extensions/codemode/worker.ts";if(e==="bundled-node")return new URL("./codemode-worker.js",t)}n(de,"resolveCodemodeWorkerSpecifier");let j;function Fe(){const e=x?"bun-binary":ee?"bundled-node":"unbundled",t=de(e,import.meta.url);return e!=="bundled-node"||!(t instanceof URL)?t:(j??=new URL(`data:text/javascript;base64,${P(t).toString("base64")}`),j)}n(Fe,"getCodemodeWorkerSpecifier");function Je(e=M){if(x||!e)return;let t;try{t=JSON.parse(k(P(e,"utf-8")))}catch(o){return o.code==="ENOENT"?{kind:"removed"}:void 0}return t.version&&t.version!==fe?{kind:"updated",version:t.version}:void 0}n(Je,"detectInstallChange");let b={},M;try{const e=se();b=JSON.parse(k(P(e,"utf-8"))),M=e}catch(e){if(e.code!=="ENOENT")throw e}const F=b.piConfig?.name,qe=b.name||"@earendil-works/pi-coding-agent",E=F||"pi",Ke=b.piConfig?.title||(F?E:"\u03C0"),le=b.piConfig?.configDir||".dal",He=E!=="pi",Ve=[".agents",".claude"],fe=b.version||"0.0.0",ze=b.piConfig?.upstreamPi,me="@deepailab/dal",ge="@deepailab",he="DeepAILab-Team/dal-dist",xe=`https://github.com/${he}/releases`,be="https://git.siweibot.com/api/packages/gitea/npm",_e=`${E.toUpperCase()}_CODING_AGENT_DIR`,Qe=`${E.toUpperCase()}_CODING_AGENT_SESSION_DIR`;function Ee(e){return C(e)}n(Ee,"expandTildePath");function Xe(e,t=`https://gist.github.com/${e}`){const o=process.env.DAL_SHARE_VIEWER_URL||process.env.PI_SHARE_VIEWER_URL;return o?`${o}#${e}`:t}n(Xe,"getShareViewerUrl");function f(){const e=process.env[_e];return e?Ee(e):i(A(),le,"agent")}n(f,"getAgentDir");function Ye(){return i(f(),"themes")}n(Ye,"getCustomThemesDir");function Ze(){return i(f(),"models.json")}n(Ze,"getModelsPath");function et(){return i(f(),"auth.json")}n(et,"getAuthPath");function tt(){return i(f(),"settings.json")}n(tt,"getSettingsPath");function nt(){return i(f(),"tools")}n(nt,"getToolsDir");function rt(){return i(f(),"bin")}n(rt,"getBinDir");function ot(){return i(f(),"prompts")}n(ot,"getPromptsDir");function it(e){const t=i(e,"prompts"),o=i(e,"commands");return!l(t)&&l(o)?o:t}n(it,"getProjectPromptsDir");function st(){return i(f(),"sessions")}n(st,"getSessionsDir");function at(){return i(f(),`${E}-debug.log`)}n(at,"getDebugLogPath");export{E as APP_NAME,Ke as APP_TITLE,le as CONFIG_DIR_NAME,xe as DAL_RELEASES_URL,he as DAL_RELEASE_REPO,me as DAL_UPDATE_PACKAGE,be as DAL_UPDATE_REGISTRY,ge as DAL_UPDATE_SCOPE,_e as ENV_AGENT_DIR,Qe as ENV_SESSION_DIR,He as IS_WHITE_LABEL_BUILD,ue as OFFICIAL_EXTENSIONS_PACKAGE_NAME,qe as PACKAGE_NAME,Ve as SHARED_SKILL_CONFIG_DIRS,ze as UPSTREAM_PI,fe as VERSION,Je as detectInstallChange,y as detectInstallMethod,Ee as expandTildePath,ie as findNodePackageDir,f as getAgentDir,et as getAuthPath,rt as getBinDir,Ge as getBundledInteractiveAssetPath,Be as getChangelogPath,Fe as getCodemodeWorkerSpecifier,Ye as getCustomThemesDir,ce as getDalDocsPath,$e as getDalExtensionExamplesPath,at as getDebugLogPath,Oe as getDocsPath,ae as getExamplesPath,Ce as getExportTemplateDir,pe as getInteractiveAssetsDir,Ze as getModelsPath,Te as getOfficialExtensionsPath,a as getPackageDir,se as getPackageJsonPath,it as getProjectPromptsDir,ot as getPromptsDir,Me as getQuickJSWasmPath,Le as getReadmePath,Ue as getSelfUpdateCommand,oe as getSelfUpdateUnavailableInstruction,st as getSessionsDir,tt as getSettingsPath,Xe as getShareViewerUrl,ve as getThemesDir,nt as getToolsDir,Re as getUpdateInstruction,x as isBunBinary,Z as isBunRuntime,ee as isBundledNode,We as isOfficialExtensionsPackage,de as resolveCodemodeWorkerSpecifier,je as setEmbeddedQuickJSWasmPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var v=Object.defineProperty;var w=(r,e)=>v(r,"name",{value:e,configurable:!0});import{constants as F,copyFileSync as _,existsSync as g,mkdirSync as b}from"node:fs";import{basename as R,join as p,parse as k,resolve as M}from"node:path";import{resolvePath as x}from"../utils/paths.js";import{emitSessionShutdownEvent as y}from"./extensions/runner.js";import{assertSessionCwdExists as m}from"./session-cwd.js";import{SessionManager as f}from"./session-manager.js";class D extends Error{static{w(this,"SessionImportFileNotFoundError")}filePath;constructor(e){super(`File not found: ${e}`),this.name="SessionImportFileNotFoundError",this.filePath=e}}function E(r){return typeof r=="string"?r:r.filter(e=>e.type==="text"&&typeof e.text=="string").map(e=>e.text).join("")}w(E,"extractUserMessageText");class C{static{w(this,"AgentSessionRuntime")}rebindSession;beforeSessionInvalidate;_session;_services;createRuntime;_diagnostics;_modelFallbackMessage;constructor(e,s,t,n=[],i){this._session=e,this._services=s,this.createRuntime=t,this._diagnostics=n,this._modelFallbackMessage=i}get services(){return this._services}get session(){return this._session}get cwd(){return this._services.cwd}get diagnostics(){return this._diagnostics}get modelFallbackMessage(){return this._modelFallbackMessage}setRebindSession(e){this.rebindSession=e}setBeforeSessionInvalidate(e){this.beforeSessionInvalidate=e}async emitBeforeSwitch(e,s){const t=this.session.extensionRunner;return t.hasHandlers("session_before_switch")?{cancelled:(await t.emit({type:"session_before_switch",reason:e,targetSessionFile:s}))?.cancel===!0}:{cancelled:!1}}async emitBeforeFork(e,s){const t=this.session.extensionRunner;return t.hasHandlers("session_before_fork")?{cancelled:(await t.emit({type:"session_before_fork",entryId:e,...s}))?.cancel===!0}:{cancelled:!1}}async teardownCurrent(e,s){await this.session.abort(),await y(this.session.extensionRunner,{type:"session_shutdown",reason:e,targetSessionFile:s}),this.beforeSessionInvalidate?.(),this.session.dispose()}apply(e){this._session=e.session,this._services=e.services,this._diagnostics=e.diagnostics,this._modelFallbackMessage=e.modelFallbackMessage}async finishSessionReplacement(e){this.rebindSession&&await this.rebindSession(this.session),e&&await e(this.session.createReplacedSessionContext())}async switchSession(e,s){const t=await this.emitBeforeSwitch("resume",e);if(t.cancelled)return t;const n=this.session.sessionFile,i=f.open(e,void 0,s?.cwdOverride);return m(i,this.cwd),await this.teardownCurrent("resume",i.getSessionFile()),this.apply(await this.createRuntime({cwd:i.getCwd(),agentDir:this.services.agentDir,sessionManager:i,sessionStartEvent:{type:"session_start",reason:"resume",previousSessionFile:n},projectTrustContext:s?.projectTrustContextFactory?.(i.getCwd())})),await this.finishSessionReplacement(s?.withSession),{cancelled:!1}}async newSession(e){const s=await this.emitBeforeSwitch("new");if(s.cancelled)return s;const t=this.session.sessionFile,n=this.session.sessionManager.getSessionDir(),i=this.session.sessionManager.isPersisted()?f.create(this.cwd,n):f.inMemory(this.cwd);return e?.parentSession&&i.newSession({parentSession:e.parentSession}),await this.teardownCurrent("new",i.getSessionFile()),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:i,sessionStartEvent:{type:"session_start",reason:"new",previousSessionFile:t}})),e?.setup&&(await e.setup(this.session.sessionManager),this.session.refreshContext()),await this.finishSessionReplacement(e?.withSession),{cancelled:!1}}async fork(e,s){const t=s?.position??"before";if((await this.emitBeforeFork(e,{position:t})).cancelled)return{cancelled:!0};let i,c;const o=this.session.sessionManager.getEntry(e);if(!o)throw new Error("Invalid entry ID for forking");if(t==="at")i=o.id;else{if(o.type!=="message"||o.message.role!=="user")throw new Error("Invalid entry ID for forking");i=o.parentId,c=E(o.message.content)}const l=this.session.sessionFile;if(this.session.sessionManager.isPersisted()){const h=this.session.sessionFile;if(!h)throw new Error("Persisted session is missing a session file");const u=this.session.sessionManager.getSessionDir();if(!i){const S=f.create(this.cwd,u);return S.newSession({parentSession:h}),await this.teardownCurrent("fork",S.getSessionFile()),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:S,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:l}})),await this.finishSessionReplacement(s?.withSession),{cancelled:!1,selectedText:c}}if(!g(h))throw new Error("This session has not been saved yet. Send a message before cloning or forking it.");const d=f.open(h,u);if(!d.createBranchedSession(i))throw new Error("Failed to create forked session");return await this.teardownCurrent("fork",d.getSessionFile()),this.apply(await this.createRuntime({cwd:d.getCwd(),agentDir:this.services.agentDir,sessionManager:d,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:l}})),await this.finishSessionReplacement(s?.withSession),{cancelled:!1,selectedText:c}}const a=this.session.sessionManager;return await this.teardownCurrent("fork",a.getSessionFile()),i?a.createBranchedSession(i):a.newSession({parentSession:l}),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:a,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:l}})),await this.finishSessionReplacement(s?.withSession),{cancelled:!1,selectedText:c}}async importFromJsonl(e,s){const t=x(e);if(!g(t))throw new D(t);const n=this.session.sessionManager.getSessionDir();g(n)||b(n,{recursive:!0});let i=p(n,R(t));const c=M(i)===t;if(!c){const{name:h,ext:u}=k(i);let d=1;for(;g(i);)i=p(n,`${h}-${d++}${u}`)}const o=await this.emitBeforeSwitch("resume",i);if(o.cancelled)return o;const l=this.session.sessionFile;c||_(t,i,F.COPYFILE_EXCL);const a=f.open(i,n,s);return m(a,this.cwd),await this.teardownCurrent("resume",a.getSessionFile()),this.apply(await this.createRuntime({cwd:a.getCwd(),agentDir:this.services.agentDir,sessionManager:a,sessionStartEvent:{type:"session_start",reason:"resume",previousSessionFile:l}})),await this.finishSessionReplacement(),{cancelled:!1}}async dispose(){await y(this.session.extensionRunner,{type:"session_shutdown",reason:"quit"}),this.beforeSessionInvalidate?.(),this.session.dispose()}}async function H(r,e){m(e.sessionManager,e.cwd);const s=await r(e);return new C(s.session,s.services,r,s.diagnostics,s.modelFallbackMessage)}w(H,"createAgentSessionRuntime");import{createAgentSessionFromServices as q,createAgentSessionServices as J}from"./agent-session-services.js";export{C as AgentSessionRuntime,D as SessionImportFileNotFoundError,q as createAgentSessionFromServices,H as createAgentSessionRuntime,J as createAgentSessionServices};
|
|
1
|
+
var v=Object.defineProperty;var w=(r,e)=>v(r,"name",{value:e,configurable:!0});import{constants as F,copyFileSync as _,existsSync as g,mkdirSync as b}from"node:fs";import{basename as R,join as p,parse as k,resolve as M}from"node:path";import{resolvePath as x}from"../utils/paths.js";import{emitSessionShutdownEvent as y}from"./extensions/runner.js";import{assertSessionCwdExists as m}from"./session-cwd.js";import{SessionManager as f}from"./session-manager.js";class D extends Error{static{w(this,"SessionImportFileNotFoundError")}filePath;constructor(e){super(`File not found: ${e}`),this.name="SessionImportFileNotFoundError",this.filePath=e}}function E(r){return typeof r=="string"?r:r.filter(e=>e.type==="text"&&typeof e.text=="string").map(e=>e.text).join("")}w(E,"extractUserMessageText");class C{static{w(this,"AgentSessionRuntime")}rebindSession;beforeSessionInvalidate;_session;_services;createRuntime;_diagnostics;_modelFallbackMessage;constructor(e,s,t,n=[],i){this._session=e,this._services=s,this.createRuntime=t,this._diagnostics=n,this._modelFallbackMessage=i}get services(){return this._services}get session(){return this._session}get cwd(){return this._services.cwd}get diagnostics(){return this._diagnostics}get modelFallbackMessage(){return this._modelFallbackMessage}setRebindSession(e){this.rebindSession=e}setBeforeSessionInvalidate(e){this.beforeSessionInvalidate=e}async emitBeforeSwitch(e,s){const t=this.session.extensionRunner;return t.hasHandlers("session_before_switch")?{cancelled:(await t.emit({type:"session_before_switch",reason:e,targetSessionFile:s}))?.cancel===!0}:{cancelled:!1}}async emitBeforeFork(e,s){const t=this.session.extensionRunner;return t.hasHandlers("session_before_fork")?{cancelled:(await t.emit({type:"session_before_fork",entryId:e,...s}))?.cancel===!0}:{cancelled:!1}}async teardownCurrent(e,s){await this.session.abort(),await y(this.session.extensionRunner,{type:"session_shutdown",reason:e,targetSessionFile:s}),this.beforeSessionInvalidate?.(),await this.session.dispose()}apply(e){this._session=e.session,this._services=e.services,this._diagnostics=e.diagnostics,this._modelFallbackMessage=e.modelFallbackMessage}async finishSessionReplacement(e){this.rebindSession&&await this.rebindSession(this.session),e&&await e(this.session.createReplacedSessionContext())}async switchSession(e,s){const t=await this.emitBeforeSwitch("resume",e);if(t.cancelled)return t;const n=this.session.sessionFile,i=f.open(e,void 0,s?.cwdOverride);return m(i,this.cwd),await this.teardownCurrent("resume",i.getSessionFile()),this.apply(await this.createRuntime({cwd:i.getCwd(),agentDir:this.services.agentDir,sessionManager:i,sessionStartEvent:{type:"session_start",reason:"resume",previousSessionFile:n},projectTrustContext:s?.projectTrustContextFactory?.(i.getCwd())})),await this.finishSessionReplacement(s?.withSession),{cancelled:!1}}async newSession(e){const s=await this.emitBeforeSwitch("new");if(s.cancelled)return s;const t=this.session.sessionFile,n=this.session.sessionManager.getSessionDir(),i=this.session.sessionManager.isPersisted()?f.create(this.cwd,n):f.inMemory(this.cwd);return e?.parentSession&&i.newSession({parentSession:e.parentSession}),await this.teardownCurrent("new",i.getSessionFile()),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:i,sessionStartEvent:{type:"session_start",reason:"new",previousSessionFile:t}})),e?.setup&&(await e.setup(this.session.sessionManager),this.session.refreshContext()),await this.finishSessionReplacement(e?.withSession),{cancelled:!1}}async fork(e,s){const t=s?.position??"before";if((await this.emitBeforeFork(e,{position:t})).cancelled)return{cancelled:!0};let i,c;const o=this.session.sessionManager.getEntry(e);if(!o)throw new Error("Invalid entry ID for forking");if(t==="at")i=o.id;else{if(o.type!=="message"||o.message.role!=="user")throw new Error("Invalid entry ID for forking");i=o.parentId,c=E(o.message.content)}const l=this.session.sessionFile;if(this.session.sessionManager.isPersisted()){const h=this.session.sessionFile;if(!h)throw new Error("Persisted session is missing a session file");const u=this.session.sessionManager.getSessionDir();if(!i){const S=f.create(this.cwd,u);return S.newSession({parentSession:h}),await this.teardownCurrent("fork",S.getSessionFile()),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:S,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:l}})),await this.finishSessionReplacement(s?.withSession),{cancelled:!1,selectedText:c}}if(!g(h))throw new Error("This session has not been saved yet. Send a message before cloning or forking it.");const d=f.open(h,u);if(!d.createBranchedSession(i))throw new Error("Failed to create forked session");return await this.teardownCurrent("fork",d.getSessionFile()),this.apply(await this.createRuntime({cwd:d.getCwd(),agentDir:this.services.agentDir,sessionManager:d,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:l}})),await this.finishSessionReplacement(s?.withSession),{cancelled:!1,selectedText:c}}const a=this.session.sessionManager;return await this.teardownCurrent("fork",a.getSessionFile()),i?a.createBranchedSession(i):a.newSession({parentSession:l}),this.apply(await this.createRuntime({cwd:this.cwd,agentDir:this.services.agentDir,sessionManager:a,sessionStartEvent:{type:"session_start",reason:"fork",previousSessionFile:l}})),await this.finishSessionReplacement(s?.withSession),{cancelled:!1,selectedText:c}}async importFromJsonl(e,s){const t=x(e);if(!g(t))throw new D(t);const n=this.session.sessionManager.getSessionDir();g(n)||b(n,{recursive:!0});let i=p(n,R(t));const c=M(i)===t;if(!c){const{name:h,ext:u}=k(i);let d=1;for(;g(i);)i=p(n,`${h}-${d++}${u}`)}const o=await this.emitBeforeSwitch("resume",i);if(o.cancelled)return o;const l=this.session.sessionFile;c||_(t,i,F.COPYFILE_EXCL);const a=f.open(i,n,s);return m(a,this.cwd),await this.teardownCurrent("resume",a.getSessionFile()),this.apply(await this.createRuntime({cwd:a.getCwd(),agentDir:this.services.agentDir,sessionManager:a,sessionStartEvent:{type:"session_start",reason:"resume",previousSessionFile:l}})),await this.finishSessionReplacement(),{cancelled:!1}}async dispose(){await y(this.session.extensionRunner,{type:"session_shutdown",reason:"quit"}),this.beforeSessionInvalidate?.(),await this.session.dispose()}}async function H(r,e){m(e.sessionManager,e.cwd);const s=await r(e);return new C(s.session,s.services,r,s.diagnostics,s.modelFallbackMessage)}w(H,"createAgentSessionRuntime");import{createAgentSessionFromServices as q,createAgentSessionServices as J}from"./agent-session-services.js";export{C as AgentSessionRuntime,D as SessionImportFileNotFoundError,q as createAgentSessionFromServices,H as createAgentSessionRuntime,J as createAgentSessionServices};
|
|
@@ -301,7 +301,7 @@ export declare class AgentSession {
|
|
|
301
301
|
private _emitExtensionEvent;
|
|
302
302
|
subscribe(listener: AgentSessionEventListener): () => void;
|
|
303
303
|
private _disconnectFromAgent;
|
|
304
|
-
dispose(): void
|
|
304
|
+
dispose(): Promise<void>;
|
|
305
305
|
refreshContext(): void;
|
|
306
306
|
get state(): AgentState;
|
|
307
307
|
get cacheWarmingStatus(): CacheWarmingStatus | undefined;
|