dal-code 0.1.10 → 1.0.0

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.
Files changed (28) hide show
  1. package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
  2. package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
  3. package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
  4. package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
  5. package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
  6. package/dist/node_modules/@dalcode/dal-lsp/package.json +3 -3
  7. package/dist/node_modules/@dalcode/dal-mcp/package.json +5 -5
  8. package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.d.ts.map +1 -1
  9. package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +5 -0
  10. package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js.map +1 -1
  11. package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
  12. package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.ts +5 -0
  13. package/dist/node_modules/@dalcode/dal-skills/package.json +5 -4
  14. package/dist/node_modules/@dalcode/dal-skills/src/index.ts +38 -1
  15. package/dist/node_modules/@dalcode/dal-skills/src/packages.ts +92 -0
  16. package/dist/node_modules/@dalcode/dal-subagent/package.json +3 -3
  17. package/dist/node_modules/@dalcode/dal-telemetry/package.json +2 -2
  18. package/dist/node_modules/@dalcode/deepailab/package.json +2 -2
  19. package/dist/node_modules/@earendil-works/pi-agent-core/package.json +1 -1
  20. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  21. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  22. package/dist/node_modules/@earendil-works/pi-ai/package.json +1 -1
  23. package/dist/node_modules/@earendil-works/pi-client/package.json +1 -1
  24. package/dist/node_modules/@earendil-works/pi-protocol/package.json +1 -1
  25. package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  26. package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
  27. package/npm-shrinkwrap.json +2 -2
  28. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-bridge",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -18,7 +18,7 @@
18
18
  ]
19
19
  },
20
20
  "dependencies": {
21
- "@dalcode/dal-pi-kit": "0.1.10",
21
+ "@dalcode/dal-pi-kit": "1.0.0",
22
22
  "typebox": "1.3.7"
23
23
  },
24
24
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-gateway",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -17,7 +17,7 @@
17
17
  ]
18
18
  },
19
19
  "dependencies": {
20
- "@dalcode/deepailab": "0.1.10"
20
+ "@dalcode/deepailab": "1.0.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@earendil-works/pi-coding-agent": "^0.1.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-guard",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -17,9 +17,9 @@
17
17
  ]
18
18
  },
19
19
  "dependencies": {
20
- "@dalcode/dal-pi-kit": "0.1.10",
21
- "@dalcode/dal-bridge": "0.1.10",
22
- "@dalcode/dal-halo": "0.1.10"
20
+ "@dalcode/dal-pi-kit": "1.0.0",
21
+ "@dalcode/dal-bridge": "1.0.0",
22
+ "@dalcode/dal-halo": "1.0.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@earendil-works/pi-coding-agent": "^0.1.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-halo",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-lang",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -17,8 +17,8 @@
17
17
  ]
18
18
  },
19
19
  "dependencies": {
20
- "@dalcode/dal-pi-kit": "0.1.10",
21
- "@dalcode/dal-bridge": "0.1.10"
20
+ "@dalcode/dal-pi-kit": "1.0.0",
21
+ "@dalcode/dal-bridge": "1.0.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@earendil-works/pi-coding-agent": "^0.1.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-lsp",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -19,8 +19,8 @@
19
19
  ]
20
20
  },
21
21
  "dependencies": {
22
- "@dalcode/dal-bridge": "0.1.10",
23
- "@dalcode/dal-pi-kit": "0.1.10",
22
+ "@dalcode/dal-bridge": "1.0.0",
23
+ "@dalcode/dal-pi-kit": "1.0.0",
24
24
  "cross-spawn": "7.0.6",
25
25
  "typebox": "1.3.7"
26
26
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-mcp",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -21,10 +21,10 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@dalcode/dal-bridge": "0.1.10",
25
- "@dalcode/dal-guard": "0.1.10",
26
- "@dalcode/dal-pi-kit": "0.1.10",
27
- "@dalcode/deepailab": "0.1.10"
24
+ "@dalcode/dal-bridge": "1.0.0",
25
+ "@dalcode/dal-guard": "1.0.0",
26
+ "@dalcode/dal-pi-kit": "1.0.0",
27
+ "@dalcode/deepailab": "1.0.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@earendil-works/pi-coding-agent": "^0.1.2"
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAqUtC,wEAAwE;AACxE,wBAAgB,iBAAiB,IAAI,OAAO,CAO3C;AAED,wBAAgB,WAAW,IAAI,WAAW,CAEzC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAS1D;AAED,iFAAiF;AACjF,wBAAgB,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGpC","sourcesContent":["/**\n * Lightweight bilingual layer for dal.\n *\n * Keys are the Chinese source strings (the product's first language), values\n * are English translations. t() is identity for zh; for en it looks up the\n * catalog and falls back to the Chinese source when a translation is missing,\n * so partial coverage never breaks the UI.\n *\n * Language resolution: ~/.dal/language file > DAL_LANG env > system LANG.\n */\n\nimport { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nexport type DalLanguage = \"zh\" | \"en\";\n\nconst EN_CATALOG: Record<string, string> = {\n\t// model switch\n\t\"默认模型:\": \"Default model: \",\n\t\"模型:\": \"Model: \",\n\t\" 思考级别用 /thinking 调整\": \" Use /thinking to set the reasoning level\",\n\t// interactive status / error messages\n\t\"已有 bash 命令在运行,请先按 Esc 取消。\": \"A bash command is already running. Press Esc to cancel it first.\",\n\t已经在这个位置: \"Already at this point\",\n\t已取消自动压缩: \"Auto-compaction cancelled\",\n\t已取消分支摘要: \"Branch summarization cancelled\",\n\t已克隆到新会话: \"Cloned to new session\",\n\t\"切换 TUI 模式前请先关闭浮层\": \"Close active overlays before changing TUI mode\",\n\t已取消压缩: \"Compaction cancelled\",\n\t已复制最后一条回复到剪贴板: \"Copied last agent message to clipboard\",\n\t已复制所选消息到剪贴板: \"Copied selected message to clipboard\",\n\t当前模型不支持思考模式: \"Current model does not support thinking\",\n\t\"无法从 gh 的输出中解析 gist ID\": \"Failed to parse gist ID from gh output\",\n\t已分叉到新会话: \"Forked to new session\",\n\t\"未安装 GitHub CLI(gh),请从 https://cli.github.com/ 安装。\":\n\t\t\"GitHub CLI (gh) is not installed. Install it from https://cli.github.com/\",\n\t\"GitHub CLI 尚未登录,请先运行 gh auth login。\": \"GitHub CLI is not logged in. Run 'gh auth login' first.\",\n\t已取消导入: \"Import cancelled\",\n\t\"模型刷新超时,改为搜索已缓存的模型。\": \"Model refresh timed out; searching cached models.\",\n\t模型选择已保存到设置: \"Model selection saved to settings\",\n\t已跳转到所选位置: \"Navigated to selected point\",\n\t已取消跳转: \"Navigation cancelled\",\n\t\"还没有可复制的回复。\": \"No agent messages to copy yet.\",\n\t会话中没有条目: \"No entries in session\",\n\t\"没有可用的登录方式。\": \"No login methods available.\",\n\t没有可用于分叉的消息: \"No messages to fork from\",\n\t没有可恢复的排队消息: \"No queued messages to restore\",\n\t还没有可克隆的内容: \"Nothing to clone yet\",\n\t\"消息已排队,将在压缩完成后发送\": \"Queued message for after compaction\",\n\t已取消恢复: \"Resume cancelled\",\n\t已恢复会话: \"Resumed session\",\n\t已在当前目录恢复会话: \"Resumed session in current cwd\",\n\t所选条目没有可复制的文本: \"Selected entry has no text to copy\",\n\t已取消分享: \"Share cancelled\",\n\t启动仍在进行中: \"Startup is still in progress\",\n\t\"Windows 不支持挂起到后台\": \"Suspend to background is not supported on Windows\",\n\t\"用法:/import <path.jsonl>\": \"Usage: /import <path.jsonl>\",\n\t\"用法:/name <名称>\": \"Usage: /name <name>\",\n\t\"请等待压缩完成后再重新加载。\": \"Wait for compaction to finish before reloading.\",\n\t\"请等待当前回复完成后再重新加载。\": \"Wait for the current response to finish before reloading.\",\n\t// model selector / catalog\n\t\"仅显示已配置提供方的模型。用 /login 添加提供方。\":\n\t\t\"Only showing models from configured providers. Use /login to add providers.\",\n\t没有匹配的模型: \"No matching models\",\n\t\"正在刷新模型目录…\": \"Refreshing model catalogs…\",\n\t\"模型目录已刷新。\": \"Model catalogs refreshed.\",\n\t// dal-telemetry\n\t\"查看或切换匿名遥测(on | off)\": \"Show or toggle anonymous telemetry (on | off)\",\n\t\"匿名遥测已开启,重启后生效。\": \"Anonymous telemetry is on. Takes effect after restart.\",\n\t\"匿名遥测已关闭,重启后生效。\": \"Anonymous telemetry is off. Takes effect after restart.\",\n\t你已关闭: \"you turned it off\",\n\t\"DO_NOT_TRACK 已设置\": \"DO_NOT_TRACK is set\",\n\t\"DAL_TELEMETRY 已设置为关闭\": \"DAL_TELEMETRY is set to off\",\n\t\"检测到 CI 环境\": \"running in CI\",\n\t配置无法写入: \"the config file could not be written\",\n\t\"匿名遥测:开启\": \"Anonymous telemetry: on\",\n\t\"匿名遥测:关闭\": \"Anonymous telemetry: off\",\n\t\" 用 /telemetry on|off 切换\": \" Use /telemetry on|off to change this\",\n\t\"DAL 会发送匿名使用统计(不含代码、提示词和文件路径)以改进产品。/telemetry off 可关闭。\":\n\t\t\"DAL sends anonymous usage stats (never your code, prompts, or file paths) to improve the product. Run /telemetry off to opt out.\",\n\t\"DAL Code\": \"DAL Code\",\n\t\"输入 /login 登录 DeepAILab 账号即可开始使用。\":\n\t\t\"Run /login to sign in with your DeepAILab account and get started.\",\n\t\"当前没有可用模型。\": \"No models available. \",\n\t\"尚未选择模型。\": \"No model selected.\",\n\t\"然后用 /model 选择一个模型。\": \"Then use /model to select a model.\",\n\t所选模型: \"the selected model\",\n\t\"没有找到「{provider}」的 API 密钥。\": \"No API key found for {provider}. \",\n\t\"dal-bridge:无法联系 DAL Code 取得授权,已拒绝执行。\":\n\t\t\"dal-bridge: could not reach DAL Code for approval, so the action was refused.\",\n\t\"dal-bridge:用户已拒绝该操作。\": \"dal-bridge: the user rejected this action.\",\n\t\"submit_plan - 多步骤任务动手前先提交计划待用户审批\":\n\t\t\"submit_plan - submit a plan for approval before starting multi-step work\",\n\t提交计划待审批: \"Submit plan for approval\",\n\t\"在动手改动之前,把计划提交给用户审批。返回是否继续执行,以及用户给出的反馈。\":\n\t\t\"Submit a plan for the user to approve before making changes. Returns whether to proceed, plus any feedback.\",\n\t\"当任务是多步骤的、或会改动多个文件时使用。\": \"Use this when the task is multi-step or touches several files.\",\n\t\"这个计划要达成什么,一句话说明\": \"One sentence on what this plan achieves\",\n\t为什么选这个方案: \"Why this approach\",\n\t按顺序排列的执行步骤: \"The steps to carry out, in order\",\n\t这一步做什么: \"What this step does\",\n\t这一步的细节: \"Details for this step\",\n\t\"请在浏览器中确认登录请求,以连接 DeepAILab。\": \"Confirm the sign-in request in your browser to connect DeepAILab.\",\n\t\"警告:未签发刷新令牌 — 请检查 offline_access 授权范围。\":\n\t\t\"Warning: no refresh token was issued - check the offline_access scope.\",\n\t\"正在开通 DeepAILab 访问密钥…\": \"Provisioning your DeepAILab access key...\",\n\t\"访问密钥开通失败(\": \"Could not provision the access key (\",\n\t\"),下次使用时将自动重试。\": \"). It will be retried automatically next time.\",\n\t\"查看 DeepAILab 会员和套餐状态\": \"Show DeepAILab membership and plan status\",\n\t\"尚未登录。请运行 /login 并选择 DeepAILab。\": \"Not signed in. Run /login and choose DeepAILab.\",\n\t无法获取模型列表: \"Could not load the model list\",\n\t网关拒绝了请求: \"the gateway rejected the request\",\n\t请求超时: \"the request timed out\",\n\t\"无法连接 DeepAILab 网关\": \"could not reach the DeepAILab gateway\",\n\t\"MCP 配置有问题:\": \"MCP config problem: \",\n\t\"lsp: 正在启动语言服务器:\": \"lsp: starting the language server: \",\n\t\"lsp: line 必须从 1 开始。\": \"lsp: line is 1-based and must be at least 1.\",\n\t\"lsp: character 必须从 1 开始。\": \"lsp: character is 1-based and must be at least 1.\",\n\t\"lsp: filePath 必须是绝对路径。\": \"lsp: filePath must be absolute.\",\n\t\"未找到语言服务器命令:\": \"Language server command not found: \",\n\t\"。请安装:\": \". Install it with: \",\n\t\"没有为该文件类型配置语言服务器。请在 .dal/lsp.json 的 lspServers 中配置。\":\n\t\t\"No language server is configured for this file type. Add one under lspServers in .dal/lsp.json.\",\n\t\"lsp: 本地语言服务器查询失败:\": \"lsp: the local language server query failed: \",\n\t\"要加载的技能名称,取自本工具描述中列出的清单\":\n\t\t\"Name of the skill to load, from the list in this tool's description\",\n\t\"可用技能:\": \"Available skills:\",\n\t\"加载一个 DeepAILab 技能:针对特定任务的专门指引。当手头任务与下列某条描述相符时调用本工具,然后按返回的指引执行。\":\n\t\t\"Load a DeepAILab skill: specialised instructions for a particular kind of task. Call this when the work at hand matches one of the descriptions below, then follow what it returns.\",\n\t无法获取云端技能列表: \"Could not load the cloud skill list\",\n\t技能: \"Skill\",\n\t\"skill - 加载 DeepAILab 云端技能(专项任务指引)\":\n\t\t\"skill - load a DeepAILab cloud skill (task-specific instructions)\",\n\t\"没有这个技能:\": \"No such skill: \",\n\t\"可用:\": \"Available: \",\n\t\"加载技能失败:\": \"Could not load skill: \",\n\t\"查看可用的 DeepAILab 云端技能\": \"List the available DeepAILab cloud skills\",\n\t\"服务端返回了意外的 304\": \"the service answered 304 unexpectedly\",\n\t\"已拒绝账号下发的 MCP 条目(只接受 https 远程服务器):\":\n\t\t\"Refused an MCP entry from the account (hosted https servers only): \",\n\t\"无法获取账号的 MCP 配置:\": \"Could not load the account's MCP configuration: \",\n\t\"当前没有可用的云端技能(未登录,或服务端目录为空)。\":\n\t\t\"No cloud skills are available (not signed in, or the catalogue is empty).\",\n\t云端技能: \"Cloud skills\",\n\t已激活: \"active\",\n\t未激活: \"inactive\",\n\t至: \"until\",\n\t\"无法加载会员信息:\": \"Could not load membership information: \",\n\t\"登录状态已失效,请运行 /login 重新登录 DeepAILab。\":\n\t\t\"Your session has expired. Run /login to sign in to DeepAILab again.\",\n\t\"账户缺少访问密钥(上次开通未成功)。运行 /login 重新登录即可补发。\":\n\t\t\"Your account has no access key — the last provisioning attempt did not complete. Run /login to issue one.\",\n\t\"账户额度已用完。运行 /account 查看套餐,或前往 deepailab.ai 充值后继续。\":\n\t\t\"Your account is out of credit. Run /account to see your plan, or top up at deepailab.ai to continue.\",\n\t\"请求太频繁,网关正在限流。请稍等几秒再试。\":\n\t\t\"Too many requests - the gateway is rate limiting. Wait a few seconds and try again.\",\n\t\"当前模型在网关上不可用(可能未绑定密钥)。用 /model 换一个模型试试。\":\n\t\t\"This model is not available on the gateway (it may have no key bound). Try another with /model.\",\n\t\"DeepAILab 网关暂时不可用(服务端错误),请稍后重试。\":\n\t\t\"The DeepAILab gateway is temporarily unavailable (server error). Please try again shortly.\",\n\t要查询的文件的绝对路径: \"Absolute path of the file to query\",\n\t\"查询类型:definition(定义)、references(引用)、hover(悬停文档)\":\n\t\t\"Query kind: definition, references, or hover\",\n\t\"符号所在行号(1 起算)\": \"Line the symbol is on (1-based)\",\n\t\"符号所在列号(1 起算,缺省为 1)\": \"Column the symbol is on (1-based, defaults to 1)\",\n\t\"语言服务器查询 (LSP)\": \"Language server query (LSP)\",\n\t\"通过语言服务器获取权威的类型信息:符号定义(definition)、全部引用位置(references)、悬停文档(hover)。\":\n\t\t\"Get authoritative type information from the language server: a symbol's definition, all of its references, or its hover documentation. \",\n\t\"支持已配置语言服务器的语言(TypeScript/JavaScript 开箱即用)。\":\n\t\t\"Works for any language with a configured server (TypeScript/JavaScript out of the box).\",\n\t\"lsp - 用语言服务器查询权威类型信息(definition / references / hover)\":\n\t\t\"lsp - authoritative type info from the language server (definition / references / hover)\",\n\t\"lsp: 无法联系 DAL Code 的 LSP 桥接,查询失败。改用 read/grep 继续。\":\n\t\t\"lsp: could not reach DAL Code's LSP bridge, so the query failed. Fall back to read/grep.\",\n\t\"… (结果过长,已截断)\": \"... (result too long, truncated)\",\n\t\"DeepAILab · 终端智能体\": \"DeepAILab · Terminal Agent\",\n\n\t中断: \"interrupt\",\n\t清屏: \"clear\",\n\t退出: \"exit\",\n\t\"退出(空输入时)\": \"exit (on empty input)\",\n\t挂起: \"suspend\",\n\t删除到行尾: \"delete to end of line\",\n\t切换思考深度: \"cycle thinking level\",\n\t切换模型: \"cycle models\",\n\t选择模型: \"select model\",\n\t展开工具输出: \"expand tool output\",\n\t展开思考过程: \"expand thinking\",\n\t外部编辑器: \"external editor\",\n\t命令菜单: \"command menu\",\n\t\"运行 bash\": \"run bash\",\n\t\"运行 bash(不进上下文)\": \"run bash (outside context)\",\n\t追加排队消息: \"queue follow-up message\",\n\t编辑排队消息: \"edit queued message\",\n\t粘贴图片: \"paste image\",\n\t拖入附件: \"drop files to attach\",\n\t\"清屏/退出\": \"clear/exit\",\n\t命令: \"commands\",\n\t更多: \"more\",\n\t\"按 ctrl+o 查看完整快捷键和已加载资源。\": \"Press ctrl+o for all shortcuts and loaded resources.\",\n\t\"遇到不会的直接问 dal——它能解释自己的功能和用法。首次使用请输入 /login 登录。\":\n\t\t\"Not sure how something works? Just ask dal — it can explain itself. Run /login to sign in first.\",\n\t会员: \"sub\",\n\t未登录: \"not signed in\",\n\t\"Enter 发送\": \"Enter to send\",\n\t\"ctrl+j 换行\": \"ctrl+j newline\",\n\t\"ctrl+v 贴图\": \"ctrl+v paste image\",\n\t\"ctrl+shift+s 截图\": \"ctrl+shift+s screenshot\",\n\t换行: \"newline\",\n\t贴图: \"paste image\",\n\t截图: \"screenshot\",\n\t附件: \"attach file\",\n\t\"@附件\": \"@ file\",\n\t个工具: \"tools\",\n\t\"拖选区域截图,取消则跳过\": \"Drag to capture a region. Cancel to skip.\",\n\t已取消截图: \"Screenshot cancelled\",\n\t\"截图后用 ctrl+v 粘贴\": \"Capture a screenshot, then paste with ctrl+v\",\n\t已选择: \"Selected\",\n\t上下文: \"context\",\n\t自动压缩: \"auto-compact\",\n\t思考关: \"thinking off\",\n\t思考: \"thinking\",\n\t\"发现新版本 \": \"New version \",\n\t\",运行 \": \" available. Run \",\n\t\"更新日志: \": \"Changelog: \",\n\t登录: \"Sign in\",\n\t快捷键: \"Shortcuts\",\n\t语言: \"Language\",\n\t终端智能体: \"Terminal Agent\",\n\n\t\"子任务的简短标题(3-5 个字,用于展示进度)\": \"Short task title (3-5 words, shown as progress label)\",\n\t\"交给子 agent 的完整任务说明,需自包含(子 agent 看不到父对话历史)\":\n\t\t\"Full task description for the sub-agent, must be self-contained (the sub-agent cannot see the parent conversation)\",\n\t\"true 时子 agent 只拥有只读工具(read/grep/find/ls),不能写文件或跑 bash\":\n\t\t\"When true, the sub-agent only gets read-only tools (read/grep/find/ls) and cannot write files or run bash\",\n\t\"子 agent 运行出错:\": \"Sub-agent failed: \",\n\t\"子 agent 没有产生任何输出。\": \"The sub-agent produced no output.\",\n\t\"dal-guard:子 agent 的\": \"dal-guard: sub-agent's\",\n\t\"调用被拒绝。\": \"call was rejected.\",\n\t\"没有可用的当前模型,无法派发子 agent。\": \"No current model available, cannot dispatch a sub-agent.\",\n\t\"你是一个专注的子 agent,负责完成父任务派发给你的一个独立子任务。\":\n\t\t\"You are a focused sub-agent responsible for completing one independent subtask dispatched by the parent task.\",\n\t\"完成后用简洁的中文文字给出最终结果,不要反问,不要征求确认。\":\n\t\t\"When done, give a concise final answer in English. Do not ask clarifying questions or seek confirmation.\",\n\t派发子任务: \"Dispatch subtask\",\n\t\"派发一个独立子 agent 去完成指定子任务,可在同一轮多次调用以并行处理互不依赖的子任务\":\n\t\t\"Dispatches an independent sub-agent to complete a given subtask; can be called multiple times in the same turn to parallelize independent subtasks\",\n\t\"(实际并发上限 \": \" (actual concurrency capped at \",\n\t\")。子 agent 默认使用当前模型和完整工具集,\":\n\t\t\"). The sub-agent uses the current model and the full toolset by default, \",\n\t\"其每次工具调用同样经过 dal-guard 审批(无 UI 场景一律拒绝风险操作)。子 agent 看不到父对话历史,\":\n\t\t\"and every tool call it makes is also approved by dal-guard (risky actions are always rejected with no UI). The sub-agent cannot see the parent conversation, \",\n\t\"prompt 必须自包含所有必要上下文。\": \"so the prompt must be self-contained with all necessary context.\",\n\t\"task - 派发子 agent 并行处理独立子任务\": \"task - dispatch sub-agents to handle independent subtasks in parallel\",\n\n\t\"dal-bridge:请求失败后不允许自动换模型。\":\n\t\t\"dal-bridge: automatic model swap after a failed request is not allowed.\",\n\t'dal-mcp:连接 MCP 服务器 \"': 'dal-mcp: failed to connect to MCP server \"',\n\t'\" 失败:': '\": ',\n\t'dal-guard:MCP 工具 \"': 'dal-guard: MCP tool \"',\n\t'\" 调用被拒绝。': '\" call was denied.',\n\t'MCP 工具 \"': 'MCP tool \"',\n\t'\" 执行失败。': '\" execution failed.',\n\t\"查看/管理 MCP 服务器连接(list | status <server> | reconnect <server>)\":\n\t\t\"View/manage MCP server connections (list | status <server> | reconnect <server>)\",\n\t\"用法:/mcp list | /mcp status <server> | /mcp reconnect <server>\":\n\t\t\"Usage: /mcp list | /mcp status <server> | /mcp reconnect <server>\",\n\t\"用法:/mcp status <server>\": \"Usage: /mcp status <server>\",\n\t\"用法:/mcp reconnect <server>\": \"Usage: /mcp reconnect <server>\",\n\t\"未配置 MCP 服务器。在 .dal/mcp.json 或 ~/.dal/agent/mcp.json 中添加。\":\n\t\t\"No MCP servers configured. Add one to .dal/mcp.json or ~/.dal/agent/mcp.json.\",\n\t\"未找到 MCP 服务器:\": \"MCP server not found: \",\n\t已连接: \"connected\",\n\t连接失败: \"failed\",\n\t已断开: \"disconnected\",\n\t\"(\": \" (\",\n\t\" 个工具)\": \" tools)\",\n\t\"命令:\": \"Command: \",\n\t\"工具:\": \"Tools: \",\n\t\"(无)\": \"(none)\",\n\t\"最近错误:\": \"Last error: \",\n\t\"已重新连接:\": \"Reconnected: \",\n\t\"重连失败:\": \"Reconnect failed: \",\n\n\t// dal-guard: interactive approval gate for risky tool calls.\n\t\"特权执行(sudo/doas)\": \"Privileged execution (sudo/doas)\",\n\t强制推送将改写远程历史: \"Force push will rewrite remote history\",\n\t硬重置会丢弃本地改动: \"Hard reset will discard local changes\",\n\t\"git clean 会删除未跟踪文件\": \"git clean will delete untracked files\",\n\t将下载内容直接管道执行: \"Piping a download straight into a shell\",\n\t执行下载的脚本: \"Executing a downloaded script\",\n\t\"递归修改权限/属主\": \"Recursive permission/ownership change\",\n\t发布软件包: \"Publishing a package\",\n\t按名称结束进程: \"Killing processes by name\",\n\t底层磁盘操作: \"Low-level disk operation\",\n\t\"第三方 MCP 工具调用(\": \"Third-party MCP tool call (\",\n\t\")\": \")\",\n\t项目目录之外的文件改动: \"File change outside the project directory\",\n\t仅本次允许: \"Allow once\",\n\t\"本次会话内允许(同类操作)\": \"Allow for this session (same kind)\",\n\t拒绝: \"Deny\",\n\t\"需要审批:\": \"Approval required: \",\n\t'dal-guard:\"': 'dal-guard: \"',\n\t'\"需要交互式审批(': '\" requires interactive approval (',\n\t\")。请在交互模式下重试,或用 /guard yolo 关闭审批门。\":\n\t\t\"). Retry in interactive mode, or run /guard yolo to turn off the approval gate.\",\n\t\"dal-guard:用户已拒绝(\": \"dal-guard: user denied (\",\n\t\")。\": \").\",\n\t\"查看或切换 dal-guard 审批门(default | yolo)\": \"View or toggle the dal-guard approval gate (default | yolo)\",\n\t\"dal-guard 模式:\": \"dal-guard mode: \",\n\t\" · 本次会话已允许:\": \" · Allowed this session: \",\n};\n\nlet currentLanguage: DalLanguage = resolveLanguage();\n\n/** Same location as pi `getAgentDir()/language`, without importing the host package. */\nfunction languageFilePath(): string {\n\tconst envDir = process.env.DAL_CODING_AGENT_DIR;\n\tconst agentDir = envDir && envDir.length > 0 ? envDir : join(homedir(), \".dal\", \"agent\");\n\treturn join(agentDir, \"language\");\n}\n\nfunction resolveLanguage(): DalLanguage {\n\ttry {\n\t\tconst saved = readFileSync(languageFilePath(), \"utf8\").trim();\n\t\tif (saved === \"zh\" || saved === \"en\") return saved;\n\t} catch {\n\t\t// Not chosen yet — fall through to environment detection.\n\t}\n\tconst env = process.env.DAL_LANG || process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || \"\";\n\t// An unset locale used to mean Chinese. It is characteristic of Docker\n\t// images, CI runners and stripped-down SSH sessions rather than of Chinese\n\t// users — and those are exactly the environments that never see the language\n\t// picker, which only opens in a TUI (dal-lang/src/index.ts). A Chinese user\n\t// in a terminal is asked on first run and their answer is remembered; an\n\t// English user in a container had no way out of a Chinese interface.\n\treturn /^(zh|cmn)/i.test(env) ? \"zh\" : \"en\";\n}\n\n/** Whether the user has made an explicit, persisted language choice. */\nexport function hasChosenLanguage(): boolean {\n\ttry {\n\t\tconst saved = readFileSync(languageFilePath(), \"utf8\").trim();\n\t\treturn saved === \"zh\" || saved === \"en\";\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getLanguage(): DalLanguage {\n\treturn currentLanguage;\n}\n\n/**\n * Applies the language and persists the choice.\n *\n * Returns whether it was persisted. Callers must not claim success on a false:\n * the one-time picker used to say \"Restart dal to apply everywhere\" after a\n * failed write, so the user restarted into the old language and got asked again.\n */\nexport function setLanguage(language: DalLanguage): boolean {\n\tcurrentLanguage = language;\n\ttry {\n\t\tmkdirSync(dirname(languageFilePath()), { recursive: true });\n\t\twriteFileSync(languageFilePath(), language);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/** Translate a Chinese source string. Identity for zh; catalog lookup for en. */\nexport function t(zh: string): string {\n\tif (currentLanguage === \"zh\") return zh;\n\treturn EN_CATALOG[zh] ?? zh;\n}\n"]}
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AA0UtC,wEAAwE;AACxE,wBAAgB,iBAAiB,IAAI,OAAO,CAO3C;AAED,wBAAgB,WAAW,IAAI,WAAW,CAEzC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAS1D;AAED,iFAAiF;AACjF,wBAAgB,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGpC","sourcesContent":["/**\n * Lightweight bilingual layer for dal.\n *\n * Keys are the Chinese source strings (the product's first language), values\n * are English translations. t() is identity for zh; for en it looks up the\n * catalog and falls back to the Chinese source when a translation is missing,\n * so partial coverage never breaks the UI.\n *\n * Language resolution: ~/.dal/language file > DAL_LANG env > system LANG.\n */\n\nimport { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nexport type DalLanguage = \"zh\" | \"en\";\n\nconst EN_CATALOG: Record<string, string> = {\n\t// model switch\n\t\"默认模型:\": \"Default model: \",\n\t\"模型:\": \"Model: \",\n\t\" 思考级别用 /thinking 调整\": \" Use /thinking to set the reasoning level\",\n\t// interactive status / error messages\n\t\"已有 bash 命令在运行,请先按 Esc 取消。\": \"A bash command is already running. Press Esc to cancel it first.\",\n\t已经在这个位置: \"Already at this point\",\n\t已取消自动压缩: \"Auto-compaction cancelled\",\n\t已取消分支摘要: \"Branch summarization cancelled\",\n\t已克隆到新会话: \"Cloned to new session\",\n\t\"切换 TUI 模式前请先关闭浮层\": \"Close active overlays before changing TUI mode\",\n\t已取消压缩: \"Compaction cancelled\",\n\t已复制最后一条回复到剪贴板: \"Copied last agent message to clipboard\",\n\t已复制所选消息到剪贴板: \"Copied selected message to clipboard\",\n\t当前模型不支持思考模式: \"Current model does not support thinking\",\n\t\"无法从 gh 的输出中解析 gist ID\": \"Failed to parse gist ID from gh output\",\n\t已分叉到新会话: \"Forked to new session\",\n\t\"未安装 GitHub CLI(gh),请从 https://cli.github.com/ 安装。\":\n\t\t\"GitHub CLI (gh) is not installed. Install it from https://cli.github.com/\",\n\t\"GitHub CLI 尚未登录,请先运行 gh auth login。\": \"GitHub CLI is not logged in. Run 'gh auth login' first.\",\n\t已取消导入: \"Import cancelled\",\n\t\"模型刷新超时,改为搜索已缓存的模型。\": \"Model refresh timed out; searching cached models.\",\n\t模型选择已保存到设置: \"Model selection saved to settings\",\n\t已跳转到所选位置: \"Navigated to selected point\",\n\t已取消跳转: \"Navigation cancelled\",\n\t\"还没有可复制的回复。\": \"No agent messages to copy yet.\",\n\t会话中没有条目: \"No entries in session\",\n\t\"没有可用的登录方式。\": \"No login methods available.\",\n\t没有可用于分叉的消息: \"No messages to fork from\",\n\t没有可恢复的排队消息: \"No queued messages to restore\",\n\t还没有可克隆的内容: \"Nothing to clone yet\",\n\t\"消息已排队,将在压缩完成后发送\": \"Queued message for after compaction\",\n\t已取消恢复: \"Resume cancelled\",\n\t已恢复会话: \"Resumed session\",\n\t已在当前目录恢复会话: \"Resumed session in current cwd\",\n\t所选条目没有可复制的文本: \"Selected entry has no text to copy\",\n\t已取消分享: \"Share cancelled\",\n\t启动仍在进行中: \"Startup is still in progress\",\n\t\"Windows 不支持挂起到后台\": \"Suspend to background is not supported on Windows\",\n\t\"用法:/import <path.jsonl>\": \"Usage: /import <path.jsonl>\",\n\t\"用法:/name <名称>\": \"Usage: /name <name>\",\n\t\"请等待压缩完成后再重新加载。\": \"Wait for compaction to finish before reloading.\",\n\t\"请等待当前回复完成后再重新加载。\": \"Wait for the current response to finish before reloading.\",\n\t// model selector / catalog\n\t\"仅显示已配置提供方的模型。用 /login 添加提供方。\":\n\t\t\"Only showing models from configured providers. Use /login to add providers.\",\n\t没有匹配的模型: \"No matching models\",\n\t\"正在刷新模型目录…\": \"Refreshing model catalogs…\",\n\t\"模型目录已刷新。\": \"Model catalogs refreshed.\",\n\t// dal-telemetry\n\t\"查看或切换匿名遥测(on | off)\": \"Show or toggle anonymous telemetry (on | off)\",\n\t\"匿名遥测已开启,重启后生效。\": \"Anonymous telemetry is on. Takes effect after restart.\",\n\t\"匿名遥测已关闭,重启后生效。\": \"Anonymous telemetry is off. Takes effect after restart.\",\n\t你已关闭: \"you turned it off\",\n\t\"DO_NOT_TRACK 已设置\": \"DO_NOT_TRACK is set\",\n\t\"DAL_TELEMETRY 已设置为关闭\": \"DAL_TELEMETRY is set to off\",\n\t\"检测到 CI 环境\": \"running in CI\",\n\t配置无法写入: \"the config file could not be written\",\n\t\"匿名遥测:开启\": \"Anonymous telemetry: on\",\n\t\"匿名遥测:关闭\": \"Anonymous telemetry: off\",\n\t\" 用 /telemetry on|off 切换\": \" Use /telemetry on|off to change this\",\n\t\"DAL 会发送匿名使用统计(不含代码、提示词和文件路径)以改进产品。/telemetry off 可关闭。\":\n\t\t\"DAL sends anonymous usage stats (never your code, prompts, or file paths) to improve the product. Run /telemetry off to opt out.\",\n\t\"DAL Code\": \"DAL Code\",\n\t\"输入 /login 登录 DeepAILab 账号即可开始使用。\":\n\t\t\"Run /login to sign in with your DeepAILab account and get started.\",\n\t\"当前没有可用模型。\": \"No models available. \",\n\t\"尚未选择模型。\": \"No model selected.\",\n\t\"然后用 /model 选择一个模型。\": \"Then use /model to select a model.\",\n\t所选模型: \"the selected model\",\n\t\"没有找到「{provider}」的 API 密钥。\": \"No API key found for {provider}. \",\n\t\"dal-bridge:无法联系 DAL Code 取得授权,已拒绝执行。\":\n\t\t\"dal-bridge: could not reach DAL Code for approval, so the action was refused.\",\n\t\"dal-bridge:用户已拒绝该操作。\": \"dal-bridge: the user rejected this action.\",\n\t\"submit_plan - 多步骤任务动手前先提交计划待用户审批\":\n\t\t\"submit_plan - submit a plan for approval before starting multi-step work\",\n\t提交计划待审批: \"Submit plan for approval\",\n\t\"在动手改动之前,把计划提交给用户审批。返回是否继续执行,以及用户给出的反馈。\":\n\t\t\"Submit a plan for the user to approve before making changes. Returns whether to proceed, plus any feedback.\",\n\t\"当任务是多步骤的、或会改动多个文件时使用。\": \"Use this when the task is multi-step or touches several files.\",\n\t\"这个计划要达成什么,一句话说明\": \"One sentence on what this plan achieves\",\n\t为什么选这个方案: \"Why this approach\",\n\t按顺序排列的执行步骤: \"The steps to carry out, in order\",\n\t这一步做什么: \"What this step does\",\n\t这一步的细节: \"Details for this step\",\n\t\"请在浏览器中确认登录请求,以连接 DeepAILab。\": \"Confirm the sign-in request in your browser to connect DeepAILab.\",\n\t\"警告:未签发刷新令牌 — 请检查 offline_access 授权范围。\":\n\t\t\"Warning: no refresh token was issued - check the offline_access scope.\",\n\t\"正在开通 DeepAILab 访问密钥…\": \"Provisioning your DeepAILab access key...\",\n\t\"访问密钥开通失败(\": \"Could not provision the access key (\",\n\t\"),下次使用时将自动重试。\": \"). It will be retried automatically next time.\",\n\t\"查看 DeepAILab 会员和套餐状态\": \"Show DeepAILab membership and plan status\",\n\t\"尚未登录。请运行 /login 并选择 DeepAILab。\": \"Not signed in. Run /login and choose DeepAILab.\",\n\t无法获取模型列表: \"Could not load the model list\",\n\t网关拒绝了请求: \"the gateway rejected the request\",\n\t请求超时: \"the request timed out\",\n\t\"无法连接 DeepAILab 网关\": \"could not reach the DeepAILab gateway\",\n\t\"MCP 配置有问题:\": \"MCP config problem: \",\n\t\"lsp: 正在启动语言服务器:\": \"lsp: starting the language server: \",\n\t\"lsp: line 必须从 1 开始。\": \"lsp: line is 1-based and must be at least 1.\",\n\t\"lsp: character 必须从 1 开始。\": \"lsp: character is 1-based and must be at least 1.\",\n\t\"lsp: filePath 必须是绝对路径。\": \"lsp: filePath must be absolute.\",\n\t\"未找到语言服务器命令:\": \"Language server command not found: \",\n\t\"。请安装:\": \". Install it with: \",\n\t\"没有为该文件类型配置语言服务器。请在 .dal/lsp.json 的 lspServers 中配置。\":\n\t\t\"No language server is configured for this file type. Add one under lspServers in .dal/lsp.json.\",\n\t\"lsp: 本地语言服务器查询失败:\": \"lsp: the local language server query failed: \",\n\t\"要加载的技能名称,取自本工具描述中列出的清单\":\n\t\t\"Name of the skill to load, from the list in this tool's description\",\n\t\"可用技能:\": \"Available skills:\",\n\t\"加载一个 DeepAILab 技能:针对特定任务的专门指引。当手头任务与下列某条描述相符时调用本工具,然后按返回的指引执行。\":\n\t\t\"Load a DeepAILab skill: specialised instructions for a particular kind of task. Call this when the work at hand matches one of the descriptions below, then follow what it returns.\",\n\t无法获取云端技能列表: \"Could not load the cloud skill list\",\n\t技能: \"Skill\",\n\t\"skill - 加载 DeepAILab 云端技能(专项任务指引)\":\n\t\t\"skill - load a DeepAILab cloud skill (task-specific instructions)\",\n\t\"没有这个技能:\": \"No such skill: \",\n\t\"可用:\": \"Available: \",\n\t\"加载技能失败:\": \"Could not load skill: \",\n\t\"查看可用的 DeepAILab 云端技能\": \"List the available DeepAILab cloud skills\",\n\t\"服务端返回了意外的 304\": \"the service answered 304 unexpectedly\",\n\t账号里有: \"Your account has \",\n\t\" 个扩展本机还没装,用 /packages 查看。\": \" extension(s) not installed here — run /packages to see them.\",\n\t查看账号推荐的扩展: \"List the extensions recommended on your account\",\n\t\"账号里的扩展都已安装。\": \"Every extension on your account is already installed.\",\n\t\"账号推荐、本机尚未安装的扩展:\": \"Recommended on your account, not installed here:\",\n\t\"已拒绝账号下发的 MCP 条目(只接受 https 远程服务器):\":\n\t\t\"Refused an MCP entry from the account (hosted https servers only): \",\n\t\"无法获取账号的 MCP 配置:\": \"Could not load the account's MCP configuration: \",\n\t\"当前没有可用的云端技能(未登录,或服务端目录为空)。\":\n\t\t\"No cloud skills are available (not signed in, or the catalogue is empty).\",\n\t云端技能: \"Cloud skills\",\n\t已激活: \"active\",\n\t未激活: \"inactive\",\n\t至: \"until\",\n\t\"无法加载会员信息:\": \"Could not load membership information: \",\n\t\"登录状态已失效,请运行 /login 重新登录 DeepAILab。\":\n\t\t\"Your session has expired. Run /login to sign in to DeepAILab again.\",\n\t\"账户缺少访问密钥(上次开通未成功)。运行 /login 重新登录即可补发。\":\n\t\t\"Your account has no access key — the last provisioning attempt did not complete. Run /login to issue one.\",\n\t\"账户额度已用完。运行 /account 查看套餐,或前往 deepailab.ai 充值后继续。\":\n\t\t\"Your account is out of credit. Run /account to see your plan, or top up at deepailab.ai to continue.\",\n\t\"请求太频繁,网关正在限流。请稍等几秒再试。\":\n\t\t\"Too many requests - the gateway is rate limiting. Wait a few seconds and try again.\",\n\t\"当前模型在网关上不可用(可能未绑定密钥)。用 /model 换一个模型试试。\":\n\t\t\"This model is not available on the gateway (it may have no key bound). Try another with /model.\",\n\t\"DeepAILab 网关暂时不可用(服务端错误),请稍后重试。\":\n\t\t\"The DeepAILab gateway is temporarily unavailable (server error). Please try again shortly.\",\n\t要查询的文件的绝对路径: \"Absolute path of the file to query\",\n\t\"查询类型:definition(定义)、references(引用)、hover(悬停文档)\":\n\t\t\"Query kind: definition, references, or hover\",\n\t\"符号所在行号(1 起算)\": \"Line the symbol is on (1-based)\",\n\t\"符号所在列号(1 起算,缺省为 1)\": \"Column the symbol is on (1-based, defaults to 1)\",\n\t\"语言服务器查询 (LSP)\": \"Language server query (LSP)\",\n\t\"通过语言服务器获取权威的类型信息:符号定义(definition)、全部引用位置(references)、悬停文档(hover)。\":\n\t\t\"Get authoritative type information from the language server: a symbol's definition, all of its references, or its hover documentation. \",\n\t\"支持已配置语言服务器的语言(TypeScript/JavaScript 开箱即用)。\":\n\t\t\"Works for any language with a configured server (TypeScript/JavaScript out of the box).\",\n\t\"lsp - 用语言服务器查询权威类型信息(definition / references / hover)\":\n\t\t\"lsp - authoritative type info from the language server (definition / references / hover)\",\n\t\"lsp: 无法联系 DAL Code 的 LSP 桥接,查询失败。改用 read/grep 继续。\":\n\t\t\"lsp: could not reach DAL Code's LSP bridge, so the query failed. Fall back to read/grep.\",\n\t\"… (结果过长,已截断)\": \"... (result too long, truncated)\",\n\t\"DeepAILab · 终端智能体\": \"DeepAILab · Terminal Agent\",\n\n\t中断: \"interrupt\",\n\t清屏: \"clear\",\n\t退出: \"exit\",\n\t\"退出(空输入时)\": \"exit (on empty input)\",\n\t挂起: \"suspend\",\n\t删除到行尾: \"delete to end of line\",\n\t切换思考深度: \"cycle thinking level\",\n\t切换模型: \"cycle models\",\n\t选择模型: \"select model\",\n\t展开工具输出: \"expand tool output\",\n\t展开思考过程: \"expand thinking\",\n\t外部编辑器: \"external editor\",\n\t命令菜单: \"command menu\",\n\t\"运行 bash\": \"run bash\",\n\t\"运行 bash(不进上下文)\": \"run bash (outside context)\",\n\t追加排队消息: \"queue follow-up message\",\n\t编辑排队消息: \"edit queued message\",\n\t粘贴图片: \"paste image\",\n\t拖入附件: \"drop files to attach\",\n\t\"清屏/退出\": \"clear/exit\",\n\t命令: \"commands\",\n\t更多: \"more\",\n\t\"按 ctrl+o 查看完整快捷键和已加载资源。\": \"Press ctrl+o for all shortcuts and loaded resources.\",\n\t\"遇到不会的直接问 dal——它能解释自己的功能和用法。首次使用请输入 /login 登录。\":\n\t\t\"Not sure how something works? Just ask dal — it can explain itself. Run /login to sign in first.\",\n\t会员: \"sub\",\n\t未登录: \"not signed in\",\n\t\"Enter 发送\": \"Enter to send\",\n\t\"ctrl+j 换行\": \"ctrl+j newline\",\n\t\"ctrl+v 贴图\": \"ctrl+v paste image\",\n\t\"ctrl+shift+s 截图\": \"ctrl+shift+s screenshot\",\n\t换行: \"newline\",\n\t贴图: \"paste image\",\n\t截图: \"screenshot\",\n\t附件: \"attach file\",\n\t\"@附件\": \"@ file\",\n\t个工具: \"tools\",\n\t\"拖选区域截图,取消则跳过\": \"Drag to capture a region. Cancel to skip.\",\n\t已取消截图: \"Screenshot cancelled\",\n\t\"截图后用 ctrl+v 粘贴\": \"Capture a screenshot, then paste with ctrl+v\",\n\t已选择: \"Selected\",\n\t上下文: \"context\",\n\t自动压缩: \"auto-compact\",\n\t思考关: \"thinking off\",\n\t思考: \"thinking\",\n\t\"发现新版本 \": \"New version \",\n\t\",运行 \": \" available. Run \",\n\t\"更新日志: \": \"Changelog: \",\n\t登录: \"Sign in\",\n\t快捷键: \"Shortcuts\",\n\t语言: \"Language\",\n\t终端智能体: \"Terminal Agent\",\n\n\t\"子任务的简短标题(3-5 个字,用于展示进度)\": \"Short task title (3-5 words, shown as progress label)\",\n\t\"交给子 agent 的完整任务说明,需自包含(子 agent 看不到父对话历史)\":\n\t\t\"Full task description for the sub-agent, must be self-contained (the sub-agent cannot see the parent conversation)\",\n\t\"true 时子 agent 只拥有只读工具(read/grep/find/ls),不能写文件或跑 bash\":\n\t\t\"When true, the sub-agent only gets read-only tools (read/grep/find/ls) and cannot write files or run bash\",\n\t\"子 agent 运行出错:\": \"Sub-agent failed: \",\n\t\"子 agent 没有产生任何输出。\": \"The sub-agent produced no output.\",\n\t\"dal-guard:子 agent 的\": \"dal-guard: sub-agent's\",\n\t\"调用被拒绝。\": \"call was rejected.\",\n\t\"没有可用的当前模型,无法派发子 agent。\": \"No current model available, cannot dispatch a sub-agent.\",\n\t\"你是一个专注的子 agent,负责完成父任务派发给你的一个独立子任务。\":\n\t\t\"You are a focused sub-agent responsible for completing one independent subtask dispatched by the parent task.\",\n\t\"完成后用简洁的中文文字给出最终结果,不要反问,不要征求确认。\":\n\t\t\"When done, give a concise final answer in English. Do not ask clarifying questions or seek confirmation.\",\n\t派发子任务: \"Dispatch subtask\",\n\t\"派发一个独立子 agent 去完成指定子任务,可在同一轮多次调用以并行处理互不依赖的子任务\":\n\t\t\"Dispatches an independent sub-agent to complete a given subtask; can be called multiple times in the same turn to parallelize independent subtasks\",\n\t\"(实际并发上限 \": \" (actual concurrency capped at \",\n\t\")。子 agent 默认使用当前模型和完整工具集,\":\n\t\t\"). The sub-agent uses the current model and the full toolset by default, \",\n\t\"其每次工具调用同样经过 dal-guard 审批(无 UI 场景一律拒绝风险操作)。子 agent 看不到父对话历史,\":\n\t\t\"and every tool call it makes is also approved by dal-guard (risky actions are always rejected with no UI). The sub-agent cannot see the parent conversation, \",\n\t\"prompt 必须自包含所有必要上下文。\": \"so the prompt must be self-contained with all necessary context.\",\n\t\"task - 派发子 agent 并行处理独立子任务\": \"task - dispatch sub-agents to handle independent subtasks in parallel\",\n\n\t\"dal-bridge:请求失败后不允许自动换模型。\":\n\t\t\"dal-bridge: automatic model swap after a failed request is not allowed.\",\n\t'dal-mcp:连接 MCP 服务器 \"': 'dal-mcp: failed to connect to MCP server \"',\n\t'\" 失败:': '\": ',\n\t'dal-guard:MCP 工具 \"': 'dal-guard: MCP tool \"',\n\t'\" 调用被拒绝。': '\" call was denied.',\n\t'MCP 工具 \"': 'MCP tool \"',\n\t'\" 执行失败。': '\" execution failed.',\n\t\"查看/管理 MCP 服务器连接(list | status <server> | reconnect <server>)\":\n\t\t\"View/manage MCP server connections (list | status <server> | reconnect <server>)\",\n\t\"用法:/mcp list | /mcp status <server> | /mcp reconnect <server>\":\n\t\t\"Usage: /mcp list | /mcp status <server> | /mcp reconnect <server>\",\n\t\"用法:/mcp status <server>\": \"Usage: /mcp status <server>\",\n\t\"用法:/mcp reconnect <server>\": \"Usage: /mcp reconnect <server>\",\n\t\"未配置 MCP 服务器。在 .dal/mcp.json 或 ~/.dal/agent/mcp.json 中添加。\":\n\t\t\"No MCP servers configured. Add one to .dal/mcp.json or ~/.dal/agent/mcp.json.\",\n\t\"未找到 MCP 服务器:\": \"MCP server not found: \",\n\t已连接: \"connected\",\n\t连接失败: \"failed\",\n\t已断开: \"disconnected\",\n\t\"(\": \" (\",\n\t\" 个工具)\": \" tools)\",\n\t\"命令:\": \"Command: \",\n\t\"工具:\": \"Tools: \",\n\t\"(无)\": \"(none)\",\n\t\"最近错误:\": \"Last error: \",\n\t\"已重新连接:\": \"Reconnected: \",\n\t\"重连失败:\": \"Reconnect failed: \",\n\n\t// dal-guard: interactive approval gate for risky tool calls.\n\t\"特权执行(sudo/doas)\": \"Privileged execution (sudo/doas)\",\n\t强制推送将改写远程历史: \"Force push will rewrite remote history\",\n\t硬重置会丢弃本地改动: \"Hard reset will discard local changes\",\n\t\"git clean 会删除未跟踪文件\": \"git clean will delete untracked files\",\n\t将下载内容直接管道执行: \"Piping a download straight into a shell\",\n\t执行下载的脚本: \"Executing a downloaded script\",\n\t\"递归修改权限/属主\": \"Recursive permission/ownership change\",\n\t发布软件包: \"Publishing a package\",\n\t按名称结束进程: \"Killing processes by name\",\n\t底层磁盘操作: \"Low-level disk operation\",\n\t\"第三方 MCP 工具调用(\": \"Third-party MCP tool call (\",\n\t\")\": \")\",\n\t项目目录之外的文件改动: \"File change outside the project directory\",\n\t仅本次允许: \"Allow once\",\n\t\"本次会话内允许(同类操作)\": \"Allow for this session (same kind)\",\n\t拒绝: \"Deny\",\n\t\"需要审批:\": \"Approval required: \",\n\t'dal-guard:\"': 'dal-guard: \"',\n\t'\"需要交互式审批(': '\" requires interactive approval (',\n\t\")。请在交互模式下重试,或用 /guard yolo 关闭审批门。\":\n\t\t\"). Retry in interactive mode, or run /guard yolo to turn off the approval gate.\",\n\t\"dal-guard:用户已拒绝(\": \"dal-guard: user denied (\",\n\t\")。\": \").\",\n\t\"查看或切换 dal-guard 审批门(default | yolo)\": \"View or toggle the dal-guard approval gate (default | yolo)\",\n\t\"dal-guard 模式:\": \"dal-guard mode: \",\n\t\" · 本次会话已允许:\": \" · Allowed this session: \",\n};\n\nlet currentLanguage: DalLanguage = resolveLanguage();\n\n/** Same location as pi `getAgentDir()/language`, without importing the host package. */\nfunction languageFilePath(): string {\n\tconst envDir = process.env.DAL_CODING_AGENT_DIR;\n\tconst agentDir = envDir && envDir.length > 0 ? envDir : join(homedir(), \".dal\", \"agent\");\n\treturn join(agentDir, \"language\");\n}\n\nfunction resolveLanguage(): DalLanguage {\n\ttry {\n\t\tconst saved = readFileSync(languageFilePath(), \"utf8\").trim();\n\t\tif (saved === \"zh\" || saved === \"en\") return saved;\n\t} catch {\n\t\t// Not chosen yet — fall through to environment detection.\n\t}\n\tconst env = process.env.DAL_LANG || process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || \"\";\n\t// An unset locale used to mean Chinese. It is characteristic of Docker\n\t// images, CI runners and stripped-down SSH sessions rather than of Chinese\n\t// users — and those are exactly the environments that never see the language\n\t// picker, which only opens in a TUI (dal-lang/src/index.ts). A Chinese user\n\t// in a terminal is asked on first run and their answer is remembered; an\n\t// English user in a container had no way out of a Chinese interface.\n\treturn /^(zh|cmn)/i.test(env) ? \"zh\" : \"en\";\n}\n\n/** Whether the user has made an explicit, persisted language choice. */\nexport function hasChosenLanguage(): boolean {\n\ttry {\n\t\tconst saved = readFileSync(languageFilePath(), \"utf8\").trim();\n\t\treturn saved === \"zh\" || saved === \"en\";\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getLanguage(): DalLanguage {\n\treturn currentLanguage;\n}\n\n/**\n * Applies the language and persists the choice.\n *\n * Returns whether it was persisted. Callers must not claim success on a false:\n * the one-time picker used to say \"Restart dal to apply everywhere\" after a\n * failed write, so the user restarted into the old language and got asked again.\n */\nexport function setLanguage(language: DalLanguage): boolean {\n\tcurrentLanguage = language;\n\ttry {\n\t\tmkdirSync(dirname(languageFilePath()), { recursive: true });\n\t\twriteFileSync(languageFilePath(), language);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/** Translate a Chinese source string. Identity for zh; catalog lookup for en. */\nexport function t(zh: string): string {\n\tif (currentLanguage === \"zh\") return zh;\n\treturn EN_CATALOG[zh] ?? zh;\n}\n"]}
@@ -121,6 +121,11 @@ const EN_CATALOG = {
121
121
  "加载技能失败:": "Could not load skill: ",
122
122
  "查看可用的 DeepAILab 云端技能": "List the available DeepAILab cloud skills",
123
123
  "服务端返回了意外的 304": "the service answered 304 unexpectedly",
124
+ 账号里有: "Your account has ",
125
+ " 个扩展本机还没装,用 /packages 查看。": " extension(s) not installed here — run /packages to see them.",
126
+ 查看账号推荐的扩展: "List the extensions recommended on your account",
127
+ "账号里的扩展都已安装。": "Every extension on your account is already installed.",
128
+ "账号推荐、本机尚未安装的扩展:": "Recommended on your account, not installed here:",
124
129
  "已拒绝账号下发的 MCP 条目(只接受 https 远程服务器):": "Refused an MCP entry from the account (hosted https servers only): ",
125
130
  "无法获取账号的 MCP 配置:": "Could not load the account's MCP configuration: ",
126
131
  "当前没有可用的云端技能(未登录,或服务端目录为空)。": "No cloud skills are available (not signed in, or the catalogue is empty).",
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;A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AI,EAAE,CAAC,CAAC;QAC5D,aAAa,CAAC,gBAAgB,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AAAA,CACD;AAED,iFAAiF;AACjF,MAAM,UAAU,CAAC,CAAC,EAAU,EAAU;IACrC,IAAI,eAAe,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IACxC,OAAO,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,CAC5B","sourcesContent":["/**\n * Lightweight bilingual layer for dal.\n *\n * Keys are the Chinese source strings (the product's first language), values\n * are English translations. t() is identity for zh; for en it looks up the\n * catalog and falls back to the Chinese source when a translation is missing,\n * so partial coverage never breaks the UI.\n *\n * Language resolution: ~/.dal/language file > DAL_LANG env > system LANG.\n */\n\nimport { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nexport type DalLanguage = \"zh\" | \"en\";\n\nconst EN_CATALOG: Record<string, string> = {\n\t// model switch\n\t\"默认模型:\": \"Default model: \",\n\t\"模型:\": \"Model: \",\n\t\" 思考级别用 /thinking 调整\": \" Use /thinking to set the reasoning level\",\n\t// interactive status / error messages\n\t\"已有 bash 命令在运行,请先按 Esc 取消。\": \"A bash command is already running. Press Esc to cancel it first.\",\n\t已经在这个位置: \"Already at this point\",\n\t已取消自动压缩: \"Auto-compaction cancelled\",\n\t已取消分支摘要: \"Branch summarization cancelled\",\n\t已克隆到新会话: \"Cloned to new session\",\n\t\"切换 TUI 模式前请先关闭浮层\": \"Close active overlays before changing TUI mode\",\n\t已取消压缩: \"Compaction cancelled\",\n\t已复制最后一条回复到剪贴板: \"Copied last agent message to clipboard\",\n\t已复制所选消息到剪贴板: \"Copied selected message to clipboard\",\n\t当前模型不支持思考模式: \"Current model does not support thinking\",\n\t\"无法从 gh 的输出中解析 gist ID\": \"Failed to parse gist ID from gh output\",\n\t已分叉到新会话: \"Forked to new session\",\n\t\"未安装 GitHub CLI(gh),请从 https://cli.github.com/ 安装。\":\n\t\t\"GitHub CLI (gh) is not installed. Install it from https://cli.github.com/\",\n\t\"GitHub CLI 尚未登录,请先运行 gh auth login。\": \"GitHub CLI is not logged in. Run 'gh auth login' first.\",\n\t已取消导入: \"Import cancelled\",\n\t\"模型刷新超时,改为搜索已缓存的模型。\": \"Model refresh timed out; searching cached models.\",\n\t模型选择已保存到设置: \"Model selection saved to settings\",\n\t已跳转到所选位置: \"Navigated to selected point\",\n\t已取消跳转: \"Navigation cancelled\",\n\t\"还没有可复制的回复。\": \"No agent messages to copy yet.\",\n\t会话中没有条目: \"No entries in session\",\n\t\"没有可用的登录方式。\": \"No login methods available.\",\n\t没有可用于分叉的消息: \"No messages to fork from\",\n\t没有可恢复的排队消息: \"No queued messages to restore\",\n\t还没有可克隆的内容: \"Nothing to clone yet\",\n\t\"消息已排队,将在压缩完成后发送\": \"Queued message for after compaction\",\n\t已取消恢复: \"Resume cancelled\",\n\t已恢复会话: \"Resumed session\",\n\t已在当前目录恢复会话: \"Resumed session in current cwd\",\n\t所选条目没有可复制的文本: \"Selected entry has no text to copy\",\n\t已取消分享: \"Share cancelled\",\n\t启动仍在进行中: \"Startup is still in progress\",\n\t\"Windows 不支持挂起到后台\": \"Suspend to background is not supported on Windows\",\n\t\"用法:/import <path.jsonl>\": \"Usage: /import <path.jsonl>\",\n\t\"用法:/name <名称>\": \"Usage: /name <name>\",\n\t\"请等待压缩完成后再重新加载。\": \"Wait for compaction to finish before reloading.\",\n\t\"请等待当前回复完成后再重新加载。\": \"Wait for the current response to finish before reloading.\",\n\t// model selector / catalog\n\t\"仅显示已配置提供方的模型。用 /login 添加提供方。\":\n\t\t\"Only showing models from configured providers. Use /login to add providers.\",\n\t没有匹配的模型: \"No matching models\",\n\t\"正在刷新模型目录…\": \"Refreshing model catalogs…\",\n\t\"模型目录已刷新。\": \"Model catalogs refreshed.\",\n\t// dal-telemetry\n\t\"查看或切换匿名遥测(on | off)\": \"Show or toggle anonymous telemetry (on | off)\",\n\t\"匿名遥测已开启,重启后生效。\": \"Anonymous telemetry is on. Takes effect after restart.\",\n\t\"匿名遥测已关闭,重启后生效。\": \"Anonymous telemetry is off. Takes effect after restart.\",\n\t你已关闭: \"you turned it off\",\n\t\"DO_NOT_TRACK 已设置\": \"DO_NOT_TRACK is set\",\n\t\"DAL_TELEMETRY 已设置为关闭\": \"DAL_TELEMETRY is set to off\",\n\t\"检测到 CI 环境\": \"running in CI\",\n\t配置无法写入: \"the config file could not be written\",\n\t\"匿名遥测:开启\": \"Anonymous telemetry: on\",\n\t\"匿名遥测:关闭\": \"Anonymous telemetry: off\",\n\t\" 用 /telemetry on|off 切换\": \" Use /telemetry on|off to change this\",\n\t\"DAL 会发送匿名使用统计(不含代码、提示词和文件路径)以改进产品。/telemetry off 可关闭。\":\n\t\t\"DAL sends anonymous usage stats (never your code, prompts, or file paths) to improve the product. Run /telemetry off to opt out.\",\n\t\"DAL Code\": \"DAL Code\",\n\t\"输入 /login 登录 DeepAILab 账号即可开始使用。\":\n\t\t\"Run /login to sign in with your DeepAILab account and get started.\",\n\t\"当前没有可用模型。\": \"No models available. \",\n\t\"尚未选择模型。\": \"No model selected.\",\n\t\"然后用 /model 选择一个模型。\": \"Then use /model to select a model.\",\n\t所选模型: \"the selected model\",\n\t\"没有找到「{provider}」的 API 密钥。\": \"No API key found for {provider}. \",\n\t\"dal-bridge:无法联系 DAL Code 取得授权,已拒绝执行。\":\n\t\t\"dal-bridge: could not reach DAL Code for approval, so the action was refused.\",\n\t\"dal-bridge:用户已拒绝该操作。\": \"dal-bridge: the user rejected this action.\",\n\t\"submit_plan - 多步骤任务动手前先提交计划待用户审批\":\n\t\t\"submit_plan - submit a plan for approval before starting multi-step work\",\n\t提交计划待审批: \"Submit plan for approval\",\n\t\"在动手改动之前,把计划提交给用户审批。返回是否继续执行,以及用户给出的反馈。\":\n\t\t\"Submit a plan for the user to approve before making changes. Returns whether to proceed, plus any feedback.\",\n\t\"当任务是多步骤的、或会改动多个文件时使用。\": \"Use this when the task is multi-step or touches several files.\",\n\t\"这个计划要达成什么,一句话说明\": \"One sentence on what this plan achieves\",\n\t为什么选这个方案: \"Why this approach\",\n\t按顺序排列的执行步骤: \"The steps to carry out, in order\",\n\t这一步做什么: \"What this step does\",\n\t这一步的细节: \"Details for this step\",\n\t\"请在浏览器中确认登录请求,以连接 DeepAILab。\": \"Confirm the sign-in request in your browser to connect DeepAILab.\",\n\t\"警告:未签发刷新令牌 — 请检查 offline_access 授权范围。\":\n\t\t\"Warning: no refresh token was issued - check the offline_access scope.\",\n\t\"正在开通 DeepAILab 访问密钥…\": \"Provisioning your DeepAILab access key...\",\n\t\"访问密钥开通失败(\": \"Could not provision the access key (\",\n\t\"),下次使用时将自动重试。\": \"). It will be retried automatically next time.\",\n\t\"查看 DeepAILab 会员和套餐状态\": \"Show DeepAILab membership and plan status\",\n\t\"尚未登录。请运行 /login 并选择 DeepAILab。\": \"Not signed in. Run /login and choose DeepAILab.\",\n\t无法获取模型列表: \"Could not load the model list\",\n\t网关拒绝了请求: \"the gateway rejected the request\",\n\t请求超时: \"the request timed out\",\n\t\"无法连接 DeepAILab 网关\": \"could not reach the DeepAILab gateway\",\n\t\"MCP 配置有问题:\": \"MCP config problem: \",\n\t\"lsp: 正在启动语言服务器:\": \"lsp: starting the language server: \",\n\t\"lsp: line 必须从 1 开始。\": \"lsp: line is 1-based and must be at least 1.\",\n\t\"lsp: character 必须从 1 开始。\": \"lsp: character is 1-based and must be at least 1.\",\n\t\"lsp: filePath 必须是绝对路径。\": \"lsp: filePath must be absolute.\",\n\t\"未找到语言服务器命令:\": \"Language server command not found: \",\n\t\"。请安装:\": \". Install it with: \",\n\t\"没有为该文件类型配置语言服务器。请在 .dal/lsp.json 的 lspServers 中配置。\":\n\t\t\"No language server is configured for this file type. Add one under lspServers in .dal/lsp.json.\",\n\t\"lsp: 本地语言服务器查询失败:\": \"lsp: the local language server query failed: \",\n\t\"要加载的技能名称,取自本工具描述中列出的清单\":\n\t\t\"Name of the skill to load, from the list in this tool's description\",\n\t\"可用技能:\": \"Available skills:\",\n\t\"加载一个 DeepAILab 技能:针对特定任务的专门指引。当手头任务与下列某条描述相符时调用本工具,然后按返回的指引执行。\":\n\t\t\"Load a DeepAILab skill: specialised instructions for a particular kind of task. Call this when the work at hand matches one of the descriptions below, then follow what it returns.\",\n\t无法获取云端技能列表: \"Could not load the cloud skill list\",\n\t技能: \"Skill\",\n\t\"skill - 加载 DeepAILab 云端技能(专项任务指引)\":\n\t\t\"skill - load a DeepAILab cloud skill (task-specific instructions)\",\n\t\"没有这个技能:\": \"No such skill: \",\n\t\"可用:\": \"Available: \",\n\t\"加载技能失败:\": \"Could not load skill: \",\n\t\"查看可用的 DeepAILab 云端技能\": \"List the available DeepAILab cloud skills\",\n\t\"服务端返回了意外的 304\": \"the service answered 304 unexpectedly\",\n\t\"已拒绝账号下发的 MCP 条目(只接受 https 远程服务器):\":\n\t\t\"Refused an MCP entry from the account (hosted https servers only): \",\n\t\"无法获取账号的 MCP 配置:\": \"Could not load the account's MCP configuration: \",\n\t\"当前没有可用的云端技能(未登录,或服务端目录为空)。\":\n\t\t\"No cloud skills are available (not signed in, or the catalogue is empty).\",\n\t云端技能: \"Cloud skills\",\n\t已激活: \"active\",\n\t未激活: \"inactive\",\n\t至: \"until\",\n\t\"无法加载会员信息:\": \"Could not load membership information: \",\n\t\"登录状态已失效,请运行 /login 重新登录 DeepAILab。\":\n\t\t\"Your session has expired. Run /login to sign in to DeepAILab again.\",\n\t\"账户缺少访问密钥(上次开通未成功)。运行 /login 重新登录即可补发。\":\n\t\t\"Your account has no access key — the last provisioning attempt did not complete. Run /login to issue one.\",\n\t\"账户额度已用完。运行 /account 查看套餐,或前往 deepailab.ai 充值后继续。\":\n\t\t\"Your account is out of credit. Run /account to see your plan, or top up at deepailab.ai to continue.\",\n\t\"请求太频繁,网关正在限流。请稍等几秒再试。\":\n\t\t\"Too many requests - the gateway is rate limiting. Wait a few seconds and try again.\",\n\t\"当前模型在网关上不可用(可能未绑定密钥)。用 /model 换一个模型试试。\":\n\t\t\"This model is not available on the gateway (it may have no key bound). Try another with /model.\",\n\t\"DeepAILab 网关暂时不可用(服务端错误),请稍后重试。\":\n\t\t\"The DeepAILab gateway is temporarily unavailable (server error). Please try again shortly.\",\n\t要查询的文件的绝对路径: \"Absolute path of the file to query\",\n\t\"查询类型:definition(定义)、references(引用)、hover(悬停文档)\":\n\t\t\"Query kind: definition, references, or hover\",\n\t\"符号所在行号(1 起算)\": \"Line the symbol is on (1-based)\",\n\t\"符号所在列号(1 起算,缺省为 1)\": \"Column the symbol is on (1-based, defaults to 1)\",\n\t\"语言服务器查询 (LSP)\": \"Language server query (LSP)\",\n\t\"通过语言服务器获取权威的类型信息:符号定义(definition)、全部引用位置(references)、悬停文档(hover)。\":\n\t\t\"Get authoritative type information from the language server: a symbol's definition, all of its references, or its hover documentation. \",\n\t\"支持已配置语言服务器的语言(TypeScript/JavaScript 开箱即用)。\":\n\t\t\"Works for any language with a configured server (TypeScript/JavaScript out of the box).\",\n\t\"lsp - 用语言服务器查询权威类型信息(definition / references / hover)\":\n\t\t\"lsp - authoritative type info from the language server (definition / references / hover)\",\n\t\"lsp: 无法联系 DAL Code 的 LSP 桥接,查询失败。改用 read/grep 继续。\":\n\t\t\"lsp: could not reach DAL Code's LSP bridge, so the query failed. Fall back to read/grep.\",\n\t\"… (结果过长,已截断)\": \"... (result too long, truncated)\",\n\t\"DeepAILab · 终端智能体\": \"DeepAILab · Terminal Agent\",\n\n\t中断: \"interrupt\",\n\t清屏: \"clear\",\n\t退出: \"exit\",\n\t\"退出(空输入时)\": \"exit (on empty input)\",\n\t挂起: \"suspend\",\n\t删除到行尾: \"delete to end of line\",\n\t切换思考深度: \"cycle thinking level\",\n\t切换模型: \"cycle models\",\n\t选择模型: \"select model\",\n\t展开工具输出: \"expand tool output\",\n\t展开思考过程: \"expand thinking\",\n\t外部编辑器: \"external editor\",\n\t命令菜单: \"command menu\",\n\t\"运行 bash\": \"run bash\",\n\t\"运行 bash(不进上下文)\": \"run bash (outside context)\",\n\t追加排队消息: \"queue follow-up message\",\n\t编辑排队消息: \"edit queued message\",\n\t粘贴图片: \"paste image\",\n\t拖入附件: \"drop files to attach\",\n\t\"清屏/退出\": \"clear/exit\",\n\t命令: \"commands\",\n\t更多: \"more\",\n\t\"按 ctrl+o 查看完整快捷键和已加载资源。\": \"Press ctrl+o for all shortcuts and loaded resources.\",\n\t\"遇到不会的直接问 dal——它能解释自己的功能和用法。首次使用请输入 /login 登录。\":\n\t\t\"Not sure how something works? Just ask dal — it can explain itself. Run /login to sign in first.\",\n\t会员: \"sub\",\n\t未登录: \"not signed in\",\n\t\"Enter 发送\": \"Enter to send\",\n\t\"ctrl+j 换行\": \"ctrl+j newline\",\n\t\"ctrl+v 贴图\": \"ctrl+v paste image\",\n\t\"ctrl+shift+s 截图\": \"ctrl+shift+s screenshot\",\n\t换行: \"newline\",\n\t贴图: \"paste image\",\n\t截图: \"screenshot\",\n\t附件: \"attach file\",\n\t\"@附件\": \"@ file\",\n\t个工具: \"tools\",\n\t\"拖选区域截图,取消则跳过\": \"Drag to capture a region. Cancel to skip.\",\n\t已取消截图: \"Screenshot cancelled\",\n\t\"截图后用 ctrl+v 粘贴\": \"Capture a screenshot, then paste with ctrl+v\",\n\t已选择: \"Selected\",\n\t上下文: \"context\",\n\t自动压缩: \"auto-compact\",\n\t思考关: \"thinking off\",\n\t思考: \"thinking\",\n\t\"发现新版本 \": \"New version \",\n\t\",运行 \": \" available. Run \",\n\t\"更新日志: \": \"Changelog: \",\n\t登录: \"Sign in\",\n\t快捷键: \"Shortcuts\",\n\t语言: \"Language\",\n\t终端智能体: \"Terminal Agent\",\n\n\t\"子任务的简短标题(3-5 个字,用于展示进度)\": \"Short task title (3-5 words, shown as progress label)\",\n\t\"交给子 agent 的完整任务说明,需自包含(子 agent 看不到父对话历史)\":\n\t\t\"Full task description for the sub-agent, must be self-contained (the sub-agent cannot see the parent conversation)\",\n\t\"true 时子 agent 只拥有只读工具(read/grep/find/ls),不能写文件或跑 bash\":\n\t\t\"When true, the sub-agent only gets read-only tools (read/grep/find/ls) and cannot write files or run bash\",\n\t\"子 agent 运行出错:\": \"Sub-agent failed: \",\n\t\"子 agent 没有产生任何输出。\": \"The sub-agent produced no output.\",\n\t\"dal-guard:子 agent 的\": \"dal-guard: sub-agent's\",\n\t\"调用被拒绝。\": \"call was rejected.\",\n\t\"没有可用的当前模型,无法派发子 agent。\": \"No current model available, cannot dispatch a sub-agent.\",\n\t\"你是一个专注的子 agent,负责完成父任务派发给你的一个独立子任务。\":\n\t\t\"You are a focused sub-agent responsible for completing one independent subtask dispatched by the parent task.\",\n\t\"完成后用简洁的中文文字给出最终结果,不要反问,不要征求确认。\":\n\t\t\"When done, give a concise final answer in English. Do not ask clarifying questions or seek confirmation.\",\n\t派发子任务: \"Dispatch subtask\",\n\t\"派发一个独立子 agent 去完成指定子任务,可在同一轮多次调用以并行处理互不依赖的子任务\":\n\t\t\"Dispatches an independent sub-agent to complete a given subtask; can be called multiple times in the same turn to parallelize independent subtasks\",\n\t\"(实际并发上限 \": \" (actual concurrency capped at \",\n\t\")。子 agent 默认使用当前模型和完整工具集,\":\n\t\t\"). The sub-agent uses the current model and the full toolset by default, \",\n\t\"其每次工具调用同样经过 dal-guard 审批(无 UI 场景一律拒绝风险操作)。子 agent 看不到父对话历史,\":\n\t\t\"and every tool call it makes is also approved by dal-guard (risky actions are always rejected with no UI). The sub-agent cannot see the parent conversation, \",\n\t\"prompt 必须自包含所有必要上下文。\": \"so the prompt must be self-contained with all necessary context.\",\n\t\"task - 派发子 agent 并行处理独立子任务\": \"task - dispatch sub-agents to handle independent subtasks in parallel\",\n\n\t\"dal-bridge:请求失败后不允许自动换模型。\":\n\t\t\"dal-bridge: automatic model swap after a failed request is not allowed.\",\n\t'dal-mcp:连接 MCP 服务器 \"': 'dal-mcp: failed to connect to MCP server \"',\n\t'\" 失败:': '\": ',\n\t'dal-guard:MCP 工具 \"': 'dal-guard: MCP tool \"',\n\t'\" 调用被拒绝。': '\" call was denied.',\n\t'MCP 工具 \"': 'MCP tool \"',\n\t'\" 执行失败。': '\" execution failed.',\n\t\"查看/管理 MCP 服务器连接(list | status <server> | reconnect <server>)\":\n\t\t\"View/manage MCP server connections (list | status <server> | reconnect <server>)\",\n\t\"用法:/mcp list | /mcp status <server> | /mcp reconnect <server>\":\n\t\t\"Usage: /mcp list | /mcp status <server> | /mcp reconnect <server>\",\n\t\"用法:/mcp status <server>\": \"Usage: /mcp status <server>\",\n\t\"用法:/mcp reconnect <server>\": \"Usage: /mcp reconnect <server>\",\n\t\"未配置 MCP 服务器。在 .dal/mcp.json 或 ~/.dal/agent/mcp.json 中添加。\":\n\t\t\"No MCP servers configured. Add one to .dal/mcp.json or ~/.dal/agent/mcp.json.\",\n\t\"未找到 MCP 服务器:\": \"MCP server not found: \",\n\t已连接: \"connected\",\n\t连接失败: \"failed\",\n\t已断开: \"disconnected\",\n\t\"(\": \" (\",\n\t\" 个工具)\": \" tools)\",\n\t\"命令:\": \"Command: \",\n\t\"工具:\": \"Tools: \",\n\t\"(无)\": \"(none)\",\n\t\"最近错误:\": \"Last error: \",\n\t\"已重新连接:\": \"Reconnected: \",\n\t\"重连失败:\": \"Reconnect failed: \",\n\n\t// dal-guard: interactive approval gate for risky tool calls.\n\t\"特权执行(sudo/doas)\": \"Privileged execution (sudo/doas)\",\n\t强制推送将改写远程历史: \"Force push will rewrite remote history\",\n\t硬重置会丢弃本地改动: \"Hard reset will discard local changes\",\n\t\"git clean 会删除未跟踪文件\": \"git clean will delete untracked files\",\n\t将下载内容直接管道执行: \"Piping a download straight into a shell\",\n\t执行下载的脚本: \"Executing a downloaded script\",\n\t\"递归修改权限/属主\": \"Recursive permission/ownership change\",\n\t发布软件包: \"Publishing a package\",\n\t按名称结束进程: \"Killing processes by name\",\n\t底层磁盘操作: \"Low-level disk operation\",\n\t\"第三方 MCP 工具调用(\": \"Third-party MCP tool call (\",\n\t\")\": \")\",\n\t项目目录之外的文件改动: \"File change outside the project directory\",\n\t仅本次允许: \"Allow once\",\n\t\"本次会话内允许(同类操作)\": \"Allow for this session (same kind)\",\n\t拒绝: \"Deny\",\n\t\"需要审批:\": \"Approval required: \",\n\t'dal-guard:\"': 'dal-guard: \"',\n\t'\"需要交互式审批(': '\" requires interactive approval (',\n\t\")。请在交互模式下重试,或用 /guard yolo 关闭审批门。\":\n\t\t\"). Retry in interactive mode, or run /guard yolo to turn off the approval gate.\",\n\t\"dal-guard:用户已拒绝(\": \"dal-guard: user denied (\",\n\t\")。\": \").\",\n\t\"查看或切换 dal-guard 审批门(default | yolo)\": \"View or toggle the dal-guard approval gate (default | yolo)\",\n\t\"dal-guard 模式:\": \"dal-guard mode: \",\n\t\" · 本次会话已允许:\": \" · Allowed this session: \",\n};\n\nlet currentLanguage: DalLanguage = resolveLanguage();\n\n/** Same location as pi `getAgentDir()/language`, without importing the host package. */\nfunction languageFilePath(): string {\n\tconst envDir = process.env.DAL_CODING_AGENT_DIR;\n\tconst agentDir = envDir && envDir.length > 0 ? envDir : join(homedir(), \".dal\", \"agent\");\n\treturn join(agentDir, \"language\");\n}\n\nfunction resolveLanguage(): DalLanguage {\n\ttry {\n\t\tconst saved = readFileSync(languageFilePath(), \"utf8\").trim();\n\t\tif (saved === \"zh\" || saved === \"en\") return saved;\n\t} catch {\n\t\t// Not chosen yet — fall through to environment detection.\n\t}\n\tconst env = process.env.DAL_LANG || process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || \"\";\n\t// An unset locale used to mean Chinese. It is characteristic of Docker\n\t// images, CI runners and stripped-down SSH sessions rather than of Chinese\n\t// users — and those are exactly the environments that never see the language\n\t// picker, which only opens in a TUI (dal-lang/src/index.ts). A Chinese user\n\t// in a terminal is asked on first run and their answer is remembered; an\n\t// English user in a container had no way out of a Chinese interface.\n\treturn /^(zh|cmn)/i.test(env) ? \"zh\" : \"en\";\n}\n\n/** Whether the user has made an explicit, persisted language choice. */\nexport function hasChosenLanguage(): boolean {\n\ttry {\n\t\tconst saved = readFileSync(languageFilePath(), \"utf8\").trim();\n\t\treturn saved === \"zh\" || saved === \"en\";\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getLanguage(): DalLanguage {\n\treturn currentLanguage;\n}\n\n/**\n * Applies the language and persists the choice.\n *\n * Returns whether it was persisted. Callers must not claim success on a false:\n * the one-time picker used to say \"Restart dal to apply everywhere\" after a\n * failed write, so the user restarted into the old language and got asked again.\n */\nexport function setLanguage(language: DalLanguage): boolean {\n\tcurrentLanguage = language;\n\ttry {\n\t\tmkdirSync(dirname(languageFilePath()), { recursive: true });\n\t\twriteFileSync(languageFilePath(), language);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/** Translate a Chinese source string. Identity for zh; catalog lookup for en. */\nexport function t(zh: string): string {\n\tif (currentLanguage === \"zh\") return zh;\n\treturn EN_CATALOG[zh] ?? zh;\n}\n"]}
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAI1C,MAAM,UAAU,GAA2B;IAC1C,eAAe;IACf,iBAAO,EAAE,iBAAiB;IAC1B,WAAK,EAAE,SAAS;IAChB,qCAAqB,EAAE,4CAA4C;IACnE,sCAAsC;IACtC,uDAA2B,EAAE,kEAAkE;IAC/F,qBAAO,EAAE,uBAAuB;IAChC,qBAAO,EAAE,2BAA2B;IACpC,qBAAO,EAAE,gCAAgC;IACzC,qBAAO,EAAE,uBAAuB;IAChC,wCAAkB,EAAE,gDA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QAAE,OAAO,EAAE,CAAC;IACxC,OAAO,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,CAC5B","sourcesContent":["/**\n * Lightweight bilingual layer for dal.\n *\n * Keys are the Chinese source strings (the product's first language), values\n * are English translations. t() is identity for zh; for en it looks up the\n * catalog and falls back to the Chinese source when a translation is missing,\n * so partial coverage never breaks the UI.\n *\n * Language resolution: ~/.dal/language file > DAL_LANG env > system LANG.\n */\n\nimport { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nexport type DalLanguage = \"zh\" | \"en\";\n\nconst EN_CATALOG: Record<string, string> = {\n\t// model switch\n\t\"默认模型:\": \"Default model: \",\n\t\"模型:\": \"Model: \",\n\t\" 思考级别用 /thinking 调整\": \" Use /thinking to set the reasoning level\",\n\t// interactive status / error messages\n\t\"已有 bash 命令在运行,请先按 Esc 取消。\": \"A bash command is already running. Press Esc to cancel it first.\",\n\t已经在这个位置: \"Already at this point\",\n\t已取消自动压缩: \"Auto-compaction cancelled\",\n\t已取消分支摘要: \"Branch summarization cancelled\",\n\t已克隆到新会话: \"Cloned to new session\",\n\t\"切换 TUI 模式前请先关闭浮层\": \"Close active overlays before changing TUI mode\",\n\t已取消压缩: \"Compaction cancelled\",\n\t已复制最后一条回复到剪贴板: \"Copied last agent message to clipboard\",\n\t已复制所选消息到剪贴板: \"Copied selected message to clipboard\",\n\t当前模型不支持思考模式: \"Current model does not support thinking\",\n\t\"无法从 gh 的输出中解析 gist ID\": \"Failed to parse gist ID from gh output\",\n\t已分叉到新会话: \"Forked to new session\",\n\t\"未安装 GitHub CLI(gh),请从 https://cli.github.com/ 安装。\":\n\t\t\"GitHub CLI (gh) is not installed. Install it from https://cli.github.com/\",\n\t\"GitHub CLI 尚未登录,请先运行 gh auth login。\": \"GitHub CLI is not logged in. Run 'gh auth login' first.\",\n\t已取消导入: \"Import cancelled\",\n\t\"模型刷新超时,改为搜索已缓存的模型。\": \"Model refresh timed out; searching cached models.\",\n\t模型选择已保存到设置: \"Model selection saved to settings\",\n\t已跳转到所选位置: \"Navigated to selected point\",\n\t已取消跳转: \"Navigation cancelled\",\n\t\"还没有可复制的回复。\": \"No agent messages to copy yet.\",\n\t会话中没有条目: \"No entries in session\",\n\t\"没有可用的登录方式。\": \"No login methods available.\",\n\t没有可用于分叉的消息: \"No messages to fork from\",\n\t没有可恢复的排队消息: \"No queued messages to restore\",\n\t还没有可克隆的内容: \"Nothing to clone yet\",\n\t\"消息已排队,将在压缩完成后发送\": \"Queued message for after compaction\",\n\t已取消恢复: \"Resume cancelled\",\n\t已恢复会话: \"Resumed session\",\n\t已在当前目录恢复会话: \"Resumed session in current cwd\",\n\t所选条目没有可复制的文本: \"Selected entry has no text to copy\",\n\t已取消分享: \"Share cancelled\",\n\t启动仍在进行中: \"Startup is still in progress\",\n\t\"Windows 不支持挂起到后台\": \"Suspend to background is not supported on Windows\",\n\t\"用法:/import <path.jsonl>\": \"Usage: /import <path.jsonl>\",\n\t\"用法:/name <名称>\": \"Usage: /name <name>\",\n\t\"请等待压缩完成后再重新加载。\": \"Wait for compaction to finish before reloading.\",\n\t\"请等待当前回复完成后再重新加载。\": \"Wait for the current response to finish before reloading.\",\n\t// model selector / catalog\n\t\"仅显示已配置提供方的模型。用 /login 添加提供方。\":\n\t\t\"Only showing models from configured providers. Use /login to add providers.\",\n\t没有匹配的模型: \"No matching models\",\n\t\"正在刷新模型目录…\": \"Refreshing model catalogs…\",\n\t\"模型目录已刷新。\": \"Model catalogs refreshed.\",\n\t// dal-telemetry\n\t\"查看或切换匿名遥测(on | off)\": \"Show or toggle anonymous telemetry (on | off)\",\n\t\"匿名遥测已开启,重启后生效。\": \"Anonymous telemetry is on. Takes effect after restart.\",\n\t\"匿名遥测已关闭,重启后生效。\": \"Anonymous telemetry is off. Takes effect after restart.\",\n\t你已关闭: \"you turned it off\",\n\t\"DO_NOT_TRACK 已设置\": \"DO_NOT_TRACK is set\",\n\t\"DAL_TELEMETRY 已设置为关闭\": \"DAL_TELEMETRY is set to off\",\n\t\"检测到 CI 环境\": \"running in CI\",\n\t配置无法写入: \"the config file could not be written\",\n\t\"匿名遥测:开启\": \"Anonymous telemetry: on\",\n\t\"匿名遥测:关闭\": \"Anonymous telemetry: off\",\n\t\" 用 /telemetry on|off 切换\": \" Use /telemetry on|off to change this\",\n\t\"DAL 会发送匿名使用统计(不含代码、提示词和文件路径)以改进产品。/telemetry off 可关闭。\":\n\t\t\"DAL sends anonymous usage stats (never your code, prompts, or file paths) to improve the product. Run /telemetry off to opt out.\",\n\t\"DAL Code\": \"DAL Code\",\n\t\"输入 /login 登录 DeepAILab 账号即可开始使用。\":\n\t\t\"Run /login to sign in with your DeepAILab account and get started.\",\n\t\"当前没有可用模型。\": \"No models available. \",\n\t\"尚未选择模型。\": \"No model selected.\",\n\t\"然后用 /model 选择一个模型。\": \"Then use /model to select a model.\",\n\t所选模型: \"the selected model\",\n\t\"没有找到「{provider}」的 API 密钥。\": \"No API key found for {provider}. \",\n\t\"dal-bridge:无法联系 DAL Code 取得授权,已拒绝执行。\":\n\t\t\"dal-bridge: could not reach DAL Code for approval, so the action was refused.\",\n\t\"dal-bridge:用户已拒绝该操作。\": \"dal-bridge: the user rejected this action.\",\n\t\"submit_plan - 多步骤任务动手前先提交计划待用户审批\":\n\t\t\"submit_plan - submit a plan for approval before starting multi-step work\",\n\t提交计划待审批: \"Submit plan for approval\",\n\t\"在动手改动之前,把计划提交给用户审批。返回是否继续执行,以及用户给出的反馈。\":\n\t\t\"Submit a plan for the user to approve before making changes. Returns whether to proceed, plus any feedback.\",\n\t\"当任务是多步骤的、或会改动多个文件时使用。\": \"Use this when the task is multi-step or touches several files.\",\n\t\"这个计划要达成什么,一句话说明\": \"One sentence on what this plan achieves\",\n\t为什么选这个方案: \"Why this approach\",\n\t按顺序排列的执行步骤: \"The steps to carry out, in order\",\n\t这一步做什么: \"What this step does\",\n\t这一步的细节: \"Details for this step\",\n\t\"请在浏览器中确认登录请求,以连接 DeepAILab。\": \"Confirm the sign-in request in your browser to connect DeepAILab.\",\n\t\"警告:未签发刷新令牌 — 请检查 offline_access 授权范围。\":\n\t\t\"Warning: no refresh token was issued - check the offline_access scope.\",\n\t\"正在开通 DeepAILab 访问密钥…\": \"Provisioning your DeepAILab access key...\",\n\t\"访问密钥开通失败(\": \"Could not provision the access key (\",\n\t\"),下次使用时将自动重试。\": \"). It will be retried automatically next time.\",\n\t\"查看 DeepAILab 会员和套餐状态\": \"Show DeepAILab membership and plan status\",\n\t\"尚未登录。请运行 /login 并选择 DeepAILab。\": \"Not signed in. Run /login and choose DeepAILab.\",\n\t无法获取模型列表: \"Could not load the model list\",\n\t网关拒绝了请求: \"the gateway rejected the request\",\n\t请求超时: \"the request timed out\",\n\t\"无法连接 DeepAILab 网关\": \"could not reach the DeepAILab gateway\",\n\t\"MCP 配置有问题:\": \"MCP config problem: \",\n\t\"lsp: 正在启动语言服务器:\": \"lsp: starting the language server: \",\n\t\"lsp: line 必须从 1 开始。\": \"lsp: line is 1-based and must be at least 1.\",\n\t\"lsp: character 必须从 1 开始。\": \"lsp: character is 1-based and must be at least 1.\",\n\t\"lsp: filePath 必须是绝对路径。\": \"lsp: filePath must be absolute.\",\n\t\"未找到语言服务器命令:\": \"Language server command not found: \",\n\t\"。请安装:\": \". Install it with: \",\n\t\"没有为该文件类型配置语言服务器。请在 .dal/lsp.json 的 lspServers 中配置。\":\n\t\t\"No language server is configured for this file type. Add one under lspServers in .dal/lsp.json.\",\n\t\"lsp: 本地语言服务器查询失败:\": \"lsp: the local language server query failed: \",\n\t\"要加载的技能名称,取自本工具描述中列出的清单\":\n\t\t\"Name of the skill to load, from the list in this tool's description\",\n\t\"可用技能:\": \"Available skills:\",\n\t\"加载一个 DeepAILab 技能:针对特定任务的专门指引。当手头任务与下列某条描述相符时调用本工具,然后按返回的指引执行。\":\n\t\t\"Load a DeepAILab skill: specialised instructions for a particular kind of task. Call this when the work at hand matches one of the descriptions below, then follow what it returns.\",\n\t无法获取云端技能列表: \"Could not load the cloud skill list\",\n\t技能: \"Skill\",\n\t\"skill - 加载 DeepAILab 云端技能(专项任务指引)\":\n\t\t\"skill - load a DeepAILab cloud skill (task-specific instructions)\",\n\t\"没有这个技能:\": \"No such skill: \",\n\t\"可用:\": \"Available: \",\n\t\"加载技能失败:\": \"Could not load skill: \",\n\t\"查看可用的 DeepAILab 云端技能\": \"List the available DeepAILab cloud skills\",\n\t\"服务端返回了意外的 304\": \"the service answered 304 unexpectedly\",\n\t账号里有: \"Your account has \",\n\t\" 个扩展本机还没装,用 /packages 查看。\": \" extension(s) not installed here — run /packages to see them.\",\n\t查看账号推荐的扩展: \"List the extensions recommended on your account\",\n\t\"账号里的扩展都已安装。\": \"Every extension on your account is already installed.\",\n\t\"账号推荐、本机尚未安装的扩展:\": \"Recommended on your account, not installed here:\",\n\t\"已拒绝账号下发的 MCP 条目(只接受 https 远程服务器):\":\n\t\t\"Refused an MCP entry from the account (hosted https servers only): \",\n\t\"无法获取账号的 MCP 配置:\": \"Could not load the account's MCP configuration: \",\n\t\"当前没有可用的云端技能(未登录,或服务端目录为空)。\":\n\t\t\"No cloud skills are available (not signed in, or the catalogue is empty).\",\n\t云端技能: \"Cloud skills\",\n\t已激活: \"active\",\n\t未激活: \"inactive\",\n\t至: \"until\",\n\t\"无法加载会员信息:\": \"Could not load membership information: \",\n\t\"登录状态已失效,请运行 /login 重新登录 DeepAILab。\":\n\t\t\"Your session has expired. Run /login to sign in to DeepAILab again.\",\n\t\"账户缺少访问密钥(上次开通未成功)。运行 /login 重新登录即可补发。\":\n\t\t\"Your account has no access key — the last provisioning attempt did not complete. Run /login to issue one.\",\n\t\"账户额度已用完。运行 /account 查看套餐,或前往 deepailab.ai 充值后继续。\":\n\t\t\"Your account is out of credit. Run /account to see your plan, or top up at deepailab.ai to continue.\",\n\t\"请求太频繁,网关正在限流。请稍等几秒再试。\":\n\t\t\"Too many requests - the gateway is rate limiting. Wait a few seconds and try again.\",\n\t\"当前模型在网关上不可用(可能未绑定密钥)。用 /model 换一个模型试试。\":\n\t\t\"This model is not available on the gateway (it may have no key bound). Try another with /model.\",\n\t\"DeepAILab 网关暂时不可用(服务端错误),请稍后重试。\":\n\t\t\"The DeepAILab gateway is temporarily unavailable (server error). Please try again shortly.\",\n\t要查询的文件的绝对路径: \"Absolute path of the file to query\",\n\t\"查询类型:definition(定义)、references(引用)、hover(悬停文档)\":\n\t\t\"Query kind: definition, references, or hover\",\n\t\"符号所在行号(1 起算)\": \"Line the symbol is on (1-based)\",\n\t\"符号所在列号(1 起算,缺省为 1)\": \"Column the symbol is on (1-based, defaults to 1)\",\n\t\"语言服务器查询 (LSP)\": \"Language server query (LSP)\",\n\t\"通过语言服务器获取权威的类型信息:符号定义(definition)、全部引用位置(references)、悬停文档(hover)。\":\n\t\t\"Get authoritative type information from the language server: a symbol's definition, all of its references, or its hover documentation. \",\n\t\"支持已配置语言服务器的语言(TypeScript/JavaScript 开箱即用)。\":\n\t\t\"Works for any language with a configured server (TypeScript/JavaScript out of the box).\",\n\t\"lsp - 用语言服务器查询权威类型信息(definition / references / hover)\":\n\t\t\"lsp - authoritative type info from the language server (definition / references / hover)\",\n\t\"lsp: 无法联系 DAL Code 的 LSP 桥接,查询失败。改用 read/grep 继续。\":\n\t\t\"lsp: could not reach DAL Code's LSP bridge, so the query failed. Fall back to read/grep.\",\n\t\"… (结果过长,已截断)\": \"... (result too long, truncated)\",\n\t\"DeepAILab · 终端智能体\": \"DeepAILab · Terminal Agent\",\n\n\t中断: \"interrupt\",\n\t清屏: \"clear\",\n\t退出: \"exit\",\n\t\"退出(空输入时)\": \"exit (on empty input)\",\n\t挂起: \"suspend\",\n\t删除到行尾: \"delete to end of line\",\n\t切换思考深度: \"cycle thinking level\",\n\t切换模型: \"cycle models\",\n\t选择模型: \"select model\",\n\t展开工具输出: \"expand tool output\",\n\t展开思考过程: \"expand thinking\",\n\t外部编辑器: \"external editor\",\n\t命令菜单: \"command menu\",\n\t\"运行 bash\": \"run bash\",\n\t\"运行 bash(不进上下文)\": \"run bash (outside context)\",\n\t追加排队消息: \"queue follow-up message\",\n\t编辑排队消息: \"edit queued message\",\n\t粘贴图片: \"paste image\",\n\t拖入附件: \"drop files to attach\",\n\t\"清屏/退出\": \"clear/exit\",\n\t命令: \"commands\",\n\t更多: \"more\",\n\t\"按 ctrl+o 查看完整快捷键和已加载资源。\": \"Press ctrl+o for all shortcuts and loaded resources.\",\n\t\"遇到不会的直接问 dal——它能解释自己的功能和用法。首次使用请输入 /login 登录。\":\n\t\t\"Not sure how something works? Just ask dal — it can explain itself. Run /login to sign in first.\",\n\t会员: \"sub\",\n\t未登录: \"not signed in\",\n\t\"Enter 发送\": \"Enter to send\",\n\t\"ctrl+j 换行\": \"ctrl+j newline\",\n\t\"ctrl+v 贴图\": \"ctrl+v paste image\",\n\t\"ctrl+shift+s 截图\": \"ctrl+shift+s screenshot\",\n\t换行: \"newline\",\n\t贴图: \"paste image\",\n\t截图: \"screenshot\",\n\t附件: \"attach file\",\n\t\"@附件\": \"@ file\",\n\t个工具: \"tools\",\n\t\"拖选区域截图,取消则跳过\": \"Drag to capture a region. Cancel to skip.\",\n\t已取消截图: \"Screenshot cancelled\",\n\t\"截图后用 ctrl+v 粘贴\": \"Capture a screenshot, then paste with ctrl+v\",\n\t已选择: \"Selected\",\n\t上下文: \"context\",\n\t自动压缩: \"auto-compact\",\n\t思考关: \"thinking off\",\n\t思考: \"thinking\",\n\t\"发现新版本 \": \"New version \",\n\t\",运行 \": \" available. Run \",\n\t\"更新日志: \": \"Changelog: \",\n\t登录: \"Sign in\",\n\t快捷键: \"Shortcuts\",\n\t语言: \"Language\",\n\t终端智能体: \"Terminal Agent\",\n\n\t\"子任务的简短标题(3-5 个字,用于展示进度)\": \"Short task title (3-5 words, shown as progress label)\",\n\t\"交给子 agent 的完整任务说明,需自包含(子 agent 看不到父对话历史)\":\n\t\t\"Full task description for the sub-agent, must be self-contained (the sub-agent cannot see the parent conversation)\",\n\t\"true 时子 agent 只拥有只读工具(read/grep/find/ls),不能写文件或跑 bash\":\n\t\t\"When true, the sub-agent only gets read-only tools (read/grep/find/ls) and cannot write files or run bash\",\n\t\"子 agent 运行出错:\": \"Sub-agent failed: \",\n\t\"子 agent 没有产生任何输出。\": \"The sub-agent produced no output.\",\n\t\"dal-guard:子 agent 的\": \"dal-guard: sub-agent's\",\n\t\"调用被拒绝。\": \"call was rejected.\",\n\t\"没有可用的当前模型,无法派发子 agent。\": \"No current model available, cannot dispatch a sub-agent.\",\n\t\"你是一个专注的子 agent,负责完成父任务派发给你的一个独立子任务。\":\n\t\t\"You are a focused sub-agent responsible for completing one independent subtask dispatched by the parent task.\",\n\t\"完成后用简洁的中文文字给出最终结果,不要反问,不要征求确认。\":\n\t\t\"When done, give a concise final answer in English. Do not ask clarifying questions or seek confirmation.\",\n\t派发子任务: \"Dispatch subtask\",\n\t\"派发一个独立子 agent 去完成指定子任务,可在同一轮多次调用以并行处理互不依赖的子任务\":\n\t\t\"Dispatches an independent sub-agent to complete a given subtask; can be called multiple times in the same turn to parallelize independent subtasks\",\n\t\"(实际并发上限 \": \" (actual concurrency capped at \",\n\t\")。子 agent 默认使用当前模型和完整工具集,\":\n\t\t\"). The sub-agent uses the current model and the full toolset by default, \",\n\t\"其每次工具调用同样经过 dal-guard 审批(无 UI 场景一律拒绝风险操作)。子 agent 看不到父对话历史,\":\n\t\t\"and every tool call it makes is also approved by dal-guard (risky actions are always rejected with no UI). The sub-agent cannot see the parent conversation, \",\n\t\"prompt 必须自包含所有必要上下文。\": \"so the prompt must be self-contained with all necessary context.\",\n\t\"task - 派发子 agent 并行处理独立子任务\": \"task - dispatch sub-agents to handle independent subtasks in parallel\",\n\n\t\"dal-bridge:请求失败后不允许自动换模型。\":\n\t\t\"dal-bridge: automatic model swap after a failed request is not allowed.\",\n\t'dal-mcp:连接 MCP 服务器 \"': 'dal-mcp: failed to connect to MCP server \"',\n\t'\" 失败:': '\": ',\n\t'dal-guard:MCP 工具 \"': 'dal-guard: MCP tool \"',\n\t'\" 调用被拒绝。': '\" call was denied.',\n\t'MCP 工具 \"': 'MCP tool \"',\n\t'\" 执行失败。': '\" execution failed.',\n\t\"查看/管理 MCP 服务器连接(list | status <server> | reconnect <server>)\":\n\t\t\"View/manage MCP server connections (list | status <server> | reconnect <server>)\",\n\t\"用法:/mcp list | /mcp status <server> | /mcp reconnect <server>\":\n\t\t\"Usage: /mcp list | /mcp status <server> | /mcp reconnect <server>\",\n\t\"用法:/mcp status <server>\": \"Usage: /mcp status <server>\",\n\t\"用法:/mcp reconnect <server>\": \"Usage: /mcp reconnect <server>\",\n\t\"未配置 MCP 服务器。在 .dal/mcp.json 或 ~/.dal/agent/mcp.json 中添加。\":\n\t\t\"No MCP servers configured. Add one to .dal/mcp.json or ~/.dal/agent/mcp.json.\",\n\t\"未找到 MCP 服务器:\": \"MCP server not found: \",\n\t已连接: \"connected\",\n\t连接失败: \"failed\",\n\t已断开: \"disconnected\",\n\t\"(\": \" (\",\n\t\" 个工具)\": \" tools)\",\n\t\"命令:\": \"Command: \",\n\t\"工具:\": \"Tools: \",\n\t\"(无)\": \"(none)\",\n\t\"最近错误:\": \"Last error: \",\n\t\"已重新连接:\": \"Reconnected: \",\n\t\"重连失败:\": \"Reconnect failed: \",\n\n\t// dal-guard: interactive approval gate for risky tool calls.\n\t\"特权执行(sudo/doas)\": \"Privileged execution (sudo/doas)\",\n\t强制推送将改写远程历史: \"Force push will rewrite remote history\",\n\t硬重置会丢弃本地改动: \"Hard reset will discard local changes\",\n\t\"git clean 会删除未跟踪文件\": \"git clean will delete untracked files\",\n\t将下载内容直接管道执行: \"Piping a download straight into a shell\",\n\t执行下载的脚本: \"Executing a downloaded script\",\n\t\"递归修改权限/属主\": \"Recursive permission/ownership change\",\n\t发布软件包: \"Publishing a package\",\n\t按名称结束进程: \"Killing processes by name\",\n\t底层磁盘操作: \"Low-level disk operation\",\n\t\"第三方 MCP 工具调用(\": \"Third-party MCP tool call (\",\n\t\")\": \")\",\n\t项目目录之外的文件改动: \"File change outside the project directory\",\n\t仅本次允许: \"Allow once\",\n\t\"本次会话内允许(同类操作)\": \"Allow for this session (same kind)\",\n\t拒绝: \"Deny\",\n\t\"需要审批:\": \"Approval required: \",\n\t'dal-guard:\"': 'dal-guard: \"',\n\t'\"需要交互式审批(': '\" requires interactive approval (',\n\t\")。请在交互模式下重试,或用 /guard yolo 关闭审批门。\":\n\t\t\"). Retry in interactive mode, or run /guard yolo to turn off the approval gate.\",\n\t\"dal-guard:用户已拒绝(\": \"dal-guard: user denied (\",\n\t\")。\": \").\",\n\t\"查看或切换 dal-guard 审批门(default | yolo)\": \"View or toggle the dal-guard approval gate (default | yolo)\",\n\t\"dal-guard 模式:\": \"dal-guard mode: \",\n\t\" · 本次会话已允许:\": \" · Allowed this session: \",\n};\n\nlet currentLanguage: DalLanguage = resolveLanguage();\n\n/** Same location as pi `getAgentDir()/language`, without importing the host package. */\nfunction languageFilePath(): string {\n\tconst envDir = process.env.DAL_CODING_AGENT_DIR;\n\tconst agentDir = envDir && envDir.length > 0 ? envDir : join(homedir(), \".dal\", \"agent\");\n\treturn join(agentDir, \"language\");\n}\n\nfunction resolveLanguage(): DalLanguage {\n\ttry {\n\t\tconst saved = readFileSync(languageFilePath(), \"utf8\").trim();\n\t\tif (saved === \"zh\" || saved === \"en\") return saved;\n\t} catch {\n\t\t// Not chosen yet — fall through to environment detection.\n\t}\n\tconst env = process.env.DAL_LANG || process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || \"\";\n\t// An unset locale used to mean Chinese. It is characteristic of Docker\n\t// images, CI runners and stripped-down SSH sessions rather than of Chinese\n\t// users — and those are exactly the environments that never see the language\n\t// picker, which only opens in a TUI (dal-lang/src/index.ts). A Chinese user\n\t// in a terminal is asked on first run and their answer is remembered; an\n\t// English user in a container had no way out of a Chinese interface.\n\treturn /^(zh|cmn)/i.test(env) ? \"zh\" : \"en\";\n}\n\n/** Whether the user has made an explicit, persisted language choice. */\nexport function hasChosenLanguage(): boolean {\n\ttry {\n\t\tconst saved = readFileSync(languageFilePath(), \"utf8\").trim();\n\t\treturn saved === \"zh\" || saved === \"en\";\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function getLanguage(): DalLanguage {\n\treturn currentLanguage;\n}\n\n/**\n * Applies the language and persists the choice.\n *\n * Returns whether it was persisted. Callers must not claim success on a false:\n * the one-time picker used to say \"Restart dal to apply everywhere\" after a\n * failed write, so the user restarted into the old language and got asked again.\n */\nexport function setLanguage(language: DalLanguage): boolean {\n\tcurrentLanguage = language;\n\ttry {\n\t\tmkdirSync(dirname(languageFilePath()), { recursive: true });\n\t\twriteFileSync(languageFilePath(), language);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/** Translate a Chinese source string. Identity for zh; catalog lookup for en. */\nexport function t(zh: string): string {\n\tif (currentLanguage === \"zh\") return zh;\n\treturn EN_CATALOG[zh] ?? zh;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dalcode/dal-pi-kit",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "description": "Shared i18n helpers for DAL pi extensions. No engine peer.",
6
6
  "type": "module",
@@ -137,6 +137,11 @@ const EN_CATALOG: Record<string, string> = {
137
137
  "加载技能失败:": "Could not load skill: ",
138
138
  "查看可用的 DeepAILab 云端技能": "List the available DeepAILab cloud skills",
139
139
  "服务端返回了意外的 304": "the service answered 304 unexpectedly",
140
+ 账号里有: "Your account has ",
141
+ " 个扩展本机还没装,用 /packages 查看。": " extension(s) not installed here — run /packages to see them.",
142
+ 查看账号推荐的扩展: "List the extensions recommended on your account",
143
+ "账号里的扩展都已安装。": "Every extension on your account is already installed.",
144
+ "账号推荐、本机尚未安装的扩展:": "Recommended on your account, not installed here:",
140
145
  "已拒绝账号下发的 MCP 条目(只接受 https 远程服务器):":
141
146
  "Refused an MCP entry from the account (hosted https servers only): ",
142
147
  "无法获取账号的 MCP 配置:": "Could not load the account's MCP configuration: ",
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@dalcode/dal-skills",
3
- "version": "0.1.10",
3
+ "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts",
9
9
  "./client": "./src/client.ts",
10
- "./package.json": "./package.json"
10
+ "./package.json": "./package.json",
11
+ "./packages": "./src/packages.ts"
11
12
  },
12
13
  "files": [
13
14
  "src"
@@ -18,8 +19,8 @@
18
19
  ]
19
20
  },
20
21
  "dependencies": {
21
- "@dalcode/dal-pi-kit": "0.1.10",
22
- "@dalcode/deepailab": "0.1.10",
22
+ "@dalcode/dal-pi-kit": "1.0.0",
23
+ "@dalcode/deepailab": "1.0.0",
23
24
  "typebox": "1.3.7"
24
25
  },
25
26
  "peerDependencies": {
@@ -26,9 +26,10 @@
26
26
 
27
27
  import { t } from "@dalcode/dal-pi-kit";
28
28
  import { defaultConfig } from "@dalcode/deepailab/oidc";
29
- import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
29
+ import { type ExtensionAPI, type ExtensionContext, getAgentDir } from "@earendil-works/pi-coding-agent";
30
30
  import { Type } from "typebox";
31
31
  import { fetchSkillBody, fetchSkillIndex, type SkillSummary } from "./client.ts";
32
+ import { type AccountPackage, fetchAccountPackages, missingPackages, readInstalledSources } from "./packages.ts";
32
33
 
33
34
  const skillSchema = Type.Object({
34
35
  name: Type.String({ description: t("要加载的技能名称,取自本工具描述中列出的清单") }),
@@ -110,6 +111,23 @@ export default function (pi: ExtensionAPI) {
110
111
  return;
111
112
  }
112
113
 
114
+ // Best-effort and quiet on failure: a recommendation list that cannot be
115
+ // fetched is not worth interrupting anyone over, unlike skills or MCP which
116
+ // change what the agent can do.
117
+ try {
118
+ const account = await fetchAccountPackages(cfg.apiBase, vk);
119
+ const installed = readInstalledSources(getAgentDir());
120
+ pendingPackages = missingPackages(account, installed);
121
+ if (pendingPackages.length > 0 && ctx.hasUI) {
122
+ ctx.ui.notify(
123
+ `${t("账号里有")}${pendingPackages.length}${t(" 个扩展本机还没装,用 /packages 查看。")}`,
124
+ "info",
125
+ );
126
+ }
127
+ } catch {
128
+ // Ignored on purpose — see above.
129
+ }
130
+
113
131
  if (catalogue.length === 0) return;
114
132
 
115
133
  pi.registerTool({
@@ -161,6 +179,25 @@ export default function (pi: ExtensionAPI) {
161
179
  } as never);
162
180
  });
163
181
 
182
+ // Extensions the account recommends. Shown, never installed: an extension is
183
+ // code on this machine, and a list we merely display cannot become one.
184
+ let pendingPackages: readonly AccountPackage[] = [];
185
+ const describePackages = (list: readonly AccountPackage[]): string =>
186
+ list
187
+ .map((p) => ` dal install ${p.source} # ${p.name}${p.description ? ` — ${p.description}` : ""}`)
188
+ .join("\n");
189
+
190
+ pi.registerCommand("packages", {
191
+ description: t("查看账号推荐的扩展"),
192
+ handler: async (_args: string, ctx: ExtensionContext) => {
193
+ if (pendingPackages.length === 0) {
194
+ ctx.ui.notify(t("账号里的扩展都已安装。"), "info");
195
+ return;
196
+ }
197
+ ctx.ui.notify(`${t("账号推荐、本机尚未安装的扩展:")}\n${describePackages(pendingPackages)}`, "info");
198
+ },
199
+ });
200
+
164
201
  pi.registerCommand("skills", {
165
202
  description: t("查看可用的 DeepAILab 云端技能"),
166
203
  handler: async (_args: string, ctx: ExtensionContext) => {