dal-code 1.0.40 → 1.0.42

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 (145) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/NOTICE +76 -1
  3. package/PRIVACY.md +68 -2
  4. package/dist/cli/startup-ui.js +1 -1
  5. package/dist/core/agent-session.d.ts +3 -0
  6. package/dist/core/agent-session.js +6 -6
  7. package/dist/core/bug-report.js +5 -5
  8. package/dist/core/settings-manager.d.ts +0 -5
  9. package/dist/core/settings-manager.js +1 -1
  10. package/dist/dal/manifest.js +1 -1
  11. package/dist/modes/interactive/components/status-indicator.d.ts +1 -1
  12. package/dist/modes/interactive/components/status-indicator.js +1 -1
  13. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  14. package/dist/modes/interactive/interactive-mode.js +2 -2
  15. package/dist/modes/print-mode.d.ts +1 -1
  16. package/dist/modes/print-mode.js +7 -6
  17. package/dist/modes/rpc/rpc-client.d.ts +5 -1
  18. package/dist/modes/rpc/rpc-client.js +3 -3
  19. package/dist/modes/rpc/rpc-mode.js +1 -1
  20. package/dist/modes/rpc/rpc-types.d.ts +25 -0
  21. package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
  22. package/dist/node_modules/@dalcode/dal-advisor/src/index.js +9 -8
  23. package/dist/node_modules/@dalcode/dal-awake/LICENSE +21 -0
  24. package/dist/node_modules/@dalcode/dal-awake/package.json +31 -0
  25. package/dist/node_modules/@dalcode/dal-awake/src/index.js +3 -0
  26. package/dist/node_modules/@dalcode/dal-awake/src/inhibitor.js +1 -0
  27. package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
  28. package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
  29. package/dist/node_modules/@dalcode/dal-compat/package.json +2 -2
  30. package/dist/node_modules/@dalcode/dal-compat/src/at-imports.js +3 -0
  31. package/dist/node_modules/@dalcode/dal-compat/src/index.js +7 -5
  32. package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
  33. package/dist/node_modules/@dalcode/dal-dap/src/install.js +2 -2
  34. package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
  35. package/dist/node_modules/@dalcode/dal-goal/package.json +3 -3
  36. package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
  37. package/dist/node_modules/@dalcode/dal-guard/src/edit-anchor-core.js +22 -21
  38. package/dist/node_modules/@dalcode/dal-guard/src/edit-anchor.js +4 -4
  39. package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
  40. package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
  41. package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
  42. package/dist/node_modules/@dalcode/dal-learn/package.json +5 -2
  43. package/dist/node_modules/@dalcode/dal-learn/src/index.js +10 -10
  44. package/dist/node_modules/@dalcode/dal-learn/src/lessons.js +3 -3
  45. package/dist/node_modules/@dalcode/dal-learn/src/patches.js +10 -0
  46. package/dist/node_modules/@dalcode/dal-lsp/package.json +3 -3
  47. package/dist/node_modules/@dalcode/dal-mcp/package.json +5 -5
  48. package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
  49. package/dist/node_modules/@dalcode/dal-office/src/index.d.ts +1 -0
  50. package/dist/node_modules/@dalcode/dal-office/src/index.js +1 -1
  51. package/dist/node_modules/@dalcode/dal-office/src/render/deck-source.d.ts +10 -0
  52. package/dist/node_modules/@dalcode/dal-office/src/render/deck-source.js +2 -0
  53. package/dist/node_modules/@dalcode/dal-office/src/render/pptx.js +3 -3
  54. package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +3 -3
  55. package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
  56. package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +3 -3
  57. package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -4
  58. package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
  59. package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
  60. package/dist/node_modules/@dalcode/dal-review/src/core.d.ts +1 -0
  61. package/dist/node_modules/@dalcode/dal-review/src/core.js +1 -1
  62. package/dist/node_modules/@dalcode/dal-review/src/findings.js +2 -2
  63. package/dist/node_modules/@dalcode/dal-review/src/index.js +1 -1
  64. package/dist/node_modules/@dalcode/dal-review/src/prompt.d.ts +1 -1
  65. package/dist/node_modules/@dalcode/dal-review/src/prompt.js +3 -2
  66. package/dist/node_modules/@dalcode/dal-review/src/runner.d.ts +2 -1
  67. package/dist/node_modules/@dalcode/dal-review/src/runner.js +2 -2
  68. package/dist/node_modules/@dalcode/dal-review/src/simplify.d.ts +5 -0
  69. package/dist/node_modules/@dalcode/dal-review/src/simplify.js +30 -0
  70. package/dist/node_modules/@dalcode/dal-review/src/types.d.ts +5 -0
  71. package/dist/node_modules/@dalcode/dal-review/src/types.js +1 -1
  72. package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
  73. package/dist/node_modules/@dalcode/dal-router/package.json +4 -4
  74. package/dist/node_modules/@dalcode/dal-rtk/LICENSE +21 -0
  75. package/dist/node_modules/@dalcode/dal-rtk/package.json +31 -0
  76. package/dist/node_modules/@dalcode/dal-rtk/src/index.js +2 -0
  77. package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
  78. package/dist/node_modules/@dalcode/dal-skills/src/bundled/bounded-code-repair/SKILL.md +45 -0
  79. package/dist/node_modules/@dalcode/dal-skills/src/bundled/evidence-first-retrieval/SKILL.md +43 -0
  80. package/dist/node_modules/@dalcode/dal-skills/src/bundled/validated-structured-output/SKILL.md +36 -0
  81. package/dist/node_modules/@dalcode/dal-skills/src/bundled.js +1 -1
  82. package/dist/node_modules/@dalcode/dal-statusline/package.json +2 -2
  83. package/dist/node_modules/@dalcode/dal-structured/package.json +2 -2
  84. package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
  85. package/dist/node_modules/@dalcode/dal-subagent/src/index.js +21 -21
  86. package/dist/node_modules/@dalcode/dal-telemetry/package.json +8 -2
  87. package/dist/node_modules/@dalcode/dal-telemetry/src/config.js +3 -2
  88. package/dist/node_modules/@dalcode/dal-telemetry/src/consent.js +1 -0
  89. package/dist/node_modules/@dalcode/dal-telemetry/src/failure-queue.js +4 -0
  90. package/dist/node_modules/@dalcode/dal-telemetry/src/failure-reporting.js +5 -0
  91. package/dist/node_modules/@dalcode/dal-telemetry/src/failures.js +2 -0
  92. package/dist/node_modules/@dalcode/dal-telemetry/src/index.js +4 -3
  93. package/dist/node_modules/@dalcode/dal-telemetry/src/reporter.js +1 -1
  94. package/dist/node_modules/@dalcode/dal-telemetry/src/repro.js +1 -0
  95. package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
  96. package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
  97. package/dist/node_modules/@dalcode/dal-tool-catalog/src/index.js +4 -4
  98. package/dist/node_modules/@dalcode/dal-tool-catalog/src/path-hint.js +1 -0
  99. package/dist/node_modules/@dalcode/dal-tool-catalog/src/repair-hook.js +2 -1
  100. package/dist/node_modules/@dalcode/dal-tool-catalog/src/repair.js +1 -1
  101. package/dist/node_modules/@dalcode/dal-tool-catalog/src/tool-name.js +1 -0
  102. package/dist/node_modules/@dalcode/dal-usage/package.json +2 -2
  103. package/dist/node_modules/@dalcode/dal-usage/src/index.d.ts +1 -0
  104. package/dist/node_modules/@dalcode/dal-usage/src/index.js +2 -2
  105. package/dist/node_modules/@dalcode/dal-usage/src/time-limit.d.ts +4 -0
  106. package/dist/node_modules/@dalcode/dal-usage/src/time-limit.js +2 -0
  107. package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
  108. package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
  109. package/dist/node_modules/@dalcode/dal-workflow/src/index.js +4 -4
  110. package/dist/node_modules/@dalcode/dal-workflow/src/lean-code.js +1 -1
  111. package/dist/node_modules/@dalcode/dal-workflow/src/working-contract.js +1 -0
  112. package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
  113. package/dist/node_modules/@dalcode/deepailab/src/index.js +3 -3
  114. package/dist/node_modules/@earendil-works/chord/package.json +1 -1
  115. package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  116. package/dist/node_modules/@earendil-works/pi-ai/dist/cli.js +0 -0
  117. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  118. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  119. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  120. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
  121. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  122. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
  123. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +1 -0
  124. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
  125. package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
  126. package/dist/node_modules/@earendil-works/pi-client/package.json +3 -3
  127. package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
  128. package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
  129. package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
  130. package/dist/node_modules/@earendil-works/pi-protocol/package.json +2 -2
  131. package/dist/node_modules/@earendil-works/pi-server/package.json +3 -3
  132. package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  133. package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
  134. package/dist/sdk/index.d.ts +1 -1
  135. package/dist/sdk/office.d.ts +1 -1
  136. package/dist/sdk/office.js +1 -1
  137. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  138. package/examples/extensions/gondolin/package-lock.json +2 -2
  139. package/examples/extensions/gondolin/package.json +1 -1
  140. package/examples/extensions/sandbox/package-lock.json +2 -2
  141. package/examples/extensions/sandbox/package.json +1 -1
  142. package/examples/extensions/with-deps/package-lock.json +2 -2
  143. package/examples/extensions/with-deps/package.json +1 -1
  144. package/npm-shrinkwrap.json +2 -2
  145. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,41 @@ DAL Code 的发布说明。这里只写用户看得见的变化。
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [1.0.42] - 2026-10-18
12
+
13
+ - 助手生成的 PPT 会在文件里一并保存这份演示的大纲和所用风格:在 DAL Code 里对它「换风格」时直接按原内容重新排版,不用再让助手重做一遍。用 PowerPoint、WPS、Keynote 打开不受影响。
14
+ - 在 DAL Code 桌面应用里回答"是否允许发送匿名使用统计 / 失败症状"后,选择会立即生效,不用重启:选"不允许"时立刻停止,尚未发出的内容直接丢弃,不会再发(在终端里用 `/telemetry off` 关闭时也是如此)。你之前在终端里拒绝过的,桌面应用不会把它改回"允许"。
15
+ - “精简改动”改为默认开启:在内部评测里,开启后通过率不变,平均少走一轮,改动的代码行数少了约一成。助手会优先复用项目里已有的代码,不加任务用不到的抽象和配置;输入校验、错误处理和安全照常保留。不想要的话在设置里写 `leanCode: false`,或设环境变量 `DAL_LEAN_CODE=off`。
16
+
17
+ ## [1.0.41] - 2026-10-18
18
+
19
+ - 长对话不再因为“上下文超长”先失败一次:快接近模型上限时(按模型的上下文窗口减去给回答预留的空间来算),会在发出请求之前就先压缩,包括你刚贴进一大段内容、或者接着一个很长的旧会话提问的时候。压缩时界面会显示“正在压缩”。压缩后紧接着的那次请求就带上待办清单和任务台账,助手不会忘了做到哪一步。
20
+ - 余额不足时立刻停下:账户余额或额度用完时,这一轮马上结束,正在运行的子助手也一起停止,不再自动重试、不会换别的模型偷偷继续,并提示“账户余额不足,请充值后重试”(中英文跟随界面语言);如果是某个模型自己的上游通道没钱了,会提示换一个模型。DAL Code 会据此显示充值入口。`dal -p` 里子助手因余额不足被停下时,也会以非零状态退出并说明原因。
21
+ - 断网不再白白丢掉这一轮:回答到一半网络断开、连接被重置或者长时间没有任何数据时,会自动重连,间隔逐次加长(可按 Esc 取消),界面显示“网络中断,n 秒后重连(第 n 次)”。已经执行过的工具不会因为重连再执行一遍,断掉的半截回答不计入用量。多次重连仍不成功时,会说明网络没有恢复、会话已保存;网络恢复后发一句“继续”(`dal -p` 用 `dal -c`)就能接着做。
22
+ - 按停止会立刻断开与服务端的连接,模型不会在后台接着生成。
23
+ - 新增运行时长上限:`dal -p --max-time 20m "任务"`(也可写 `90s`、`1h30m`),到时间后立即停止这次运行——包括正在跑的命令——并说明怎么继续,`dal -p` 以非零状态退出,适合脚本和 CI 防止任务一直跑下去。不加时和以前一样。
24
+
25
+ - 助手更不容易“偷换问题”:不会用压掉报错、跳过测试、只对某个输入特殊处理的办法让问题“看起来解决了”(除非你要求);改动函数、类型、消息格式或配置前会先找出其他调用处和副本一起改;没亲眼确认过的事会说明是推测。子助手在任务没做完时会接着做下去,不会停在“接下来我会…”;代码评审会检查改动影响到的调用方;“第二意见”在方案没问题时只说一句;过往经验和项目当前情况冲突时以项目为准。
26
+
27
+ - 项目说明文件(AGENTS.md、CLAUDE.md、`.claude/rules/`)里写的 `@docs/测试说明.md` 这类引用会像 Claude Code 一样把那份文件的内容带进来,最多嵌套 5 层;代码块里的 `@`、邮箱地址不受影响,项目外的文件和 `.env`、密钥这类敏感文件不会被读入。
28
+ - 子目录里的 AGENTS.md 或 CLAUDE.md(比如 monorepo 里每个包自己的说明)会在助手第一次读写该目录下的文件时自动交给它,每个文件只给一次。可在设置里用 `dalCompat.atImports: false`、`dalCompat.nestedInstructions: false` 分别关闭,`--no-context-files` 会一并跳过。
29
+
30
+ - 模型用别家工具的叫法调用工具(如 `read_file`、`Bash`、`run_terminal_cmd`)时,只要能确定对应的是哪个工具、参数也对得上,就直接按正确的工具执行并在结果里注明,不再白白报一次“找不到工具”;对不上的照常报错。
31
+ - 助手读取或修改一个不存在的路径时,报错里会直接列出项目里同名的文件(例如少写了一层目录),助手可以马上用正确路径重试,不用再到处搜索;不会自动替它改去别的文件。
32
+
33
+ - 助手用“// ... 其余代码不变 ...”这类占位注释代替真实代码去覆盖文件或做替换时会被拦下、什么都不写入,并被要求写出完整内容,避免被省略的代码被悄悄删掉;新建文件、展开语法 `...rest` 之类的正常代码不受影响。
34
+
35
+ - 新增 `/simplify`:只读检查你的改动里有没有能直接复用项目已有代码的地方、可以写得更简单的逻辑、重复或多余的工作,以及保护不了任何东西的测试和只是复述代码的注释,逐条给出位置和改法。默认只提建议、不改任何文件;想采纳就说“应用第 1、3 条”,或用 `/simplify --apply` 让助手接着把值得做的几条改掉并跑检查。任何建议都不能改变行为,也不会删减校验、错误处理和安全检查。可和 `/review` 一样指定 `--base`、`--commit`、`--pr`,`dal -p "/simplify"` 也可用。
36
+
37
+ - 新增三个随附技能,让较快的小模型也更稳:「小范围修复」修 bug 时先复现、只改一处、用实际跑过的检查证明修好,最多重试两次就停下说明;「先找证据再回答」查资料时按权威程度选来源、每条结论标出处,查不到就明说“证据不足”而不是编;「可校验的结构化输出」要固定格式(JSON、CSV、只能选一个选项)时先定格式、生成后实际校验。需要时自动加载,不用安装。
38
+
39
+ - 长任务不再被电脑休眠打断:一次任务运行超过半分钟时,DAL 会让电脑保持唤醒(屏幕照常可以熄灭),任务结束后立即恢复正常休眠;短问答不受影响,整个过程不弹通知、不在对话里插话。`/awake` 查看状态,`/awake off` 本次会话关闭;设置里写 `dalKeepAwake: false`(或环境变量 `DAL_KEEP_AWAKE=off`)可一直关闭。支持 macOS、Linux 和 Windows。
40
+ - 已经自己装了 rtk(一个压缩命令输出的开源工具)的用户,助手运行的命令会自动经 rtk 压缩输出,同样的上下文能装下更多内容;审批和危险命令拦截仍按助手原本写的命令判断。没装 rtk 时什么都不变,DAL 也不会替你安装。`/rtk` 查看是否在用,设置里写 `dalRtk: false` 或 `RTK_DISABLED=1` 关闭。
41
+ - 匿名使用统计和崩溃信息改为**先征得同意**:以前是提示一次后默认开启,现在默认关闭,在终端界面里第一次启动时问你(允许 / 不允许 / 以后再问),选“允许”或执行 `/telemetry on` 之后才会发送;`dal -p` 等无人回答的方式一律不发送。以前只看到过提示、从没选择过的,升级后同样视为未同意;以前用 `/telemetry off` 关掉的,仍然保持关闭。接收服务上线前不会询问,也不会收集。
42
+ - 新增失败症状上报,**默认关闭**,只有你同意后才会开启。任务没做好时(比如工具反复失败、修改对不上原文、同一个操作原样重复、测试没过却说完成、被你打断后纠正),DAL 只记录“出了哪一类问题”:问题类别、用到的工具名和次数、模型、DAL 版本、操作系统、轮数、耗时和花费。**不会**发送你的提示词、回答、代码、文件内容、文件路径、目录或仓库名、命令和输出、密钥;你自己接入的模型和 MCP 服务器只记为“自定义”。发送前后各有一道检查,多出任何内容整条都不发。第一次遇到失败时会问一次(允许 / 不允许 / 以后再问),没回答之前什么都不记录;接收服务上线前不会询问,也不会收集。`/telemetry failures` 查看状态,`/telemetry failures show` 原样列出待发送的内容,`/telemetry failures off` 关闭并立即删除待发送内容(`/telemetry off` 会连同它一起关闭);也可以设环境变量 `DAL_FAILURE_REPORTS=0`,`DO_NOT_TRACK=1` 和 CI 环境里一律不上报。没联网时先存在本机稍后再发,发不出去不影响使用,退出时最多等 1 秒。
43
+ - 可以为一次失败附上复现材料:`/telemetry attach` 会先给你看要发送的内容(这次任务的请求、工具调用和截断后的输出,密钥已遮盖、敏感文件不含内容、路径只留文件名),每次单独询问,不会记住“总是允许”。
44
+ - 新增 `/evolve`:查看经过评测和人工审核的改进补丁,用 `/evolve on <编号>` / `/evolve off <编号>` 单独开关;设 `DAL_EVOLVE_PATCHES=off` 可全部停用。目前没有内置补丁,行为与之前相同。
45
+
11
46
  ## [1.0.40] - 2026-10-17
12
47
 
13
48
  - 自动选模型改为先征得同意:它会把每轮提问的部分内容(最多前 8000 字)发给第三方路由服务来挑选模型、调整工具和思考深度。第一次在终端里需要用到时会先问你,选“不用”就一直用你选的模型,什么都不发送;以后可用 `/factory auto on` / `/factory auto off` 随时开关,关掉后子助手选模型、插件排序、命令复核这些也都不再向第三方发送内容。还没回答过时,`dal -p` 和其他非交互方式一律不发送。
package/NOTICE CHANGED
@@ -132,6 +132,11 @@ The advisor tool (@dalcode/dal-advisor) adapts the design of:
132
132
  spend is recorded on the tool result, and none of the package's prompts
133
133
  are used.
134
134
 
135
+ The missing-path hint of @dalcode/dal-tool-catalog (src/path-hint.ts) follows
136
+ the idea of oh-my-pi's read tool (https://github.com/can1357/oh-my-pi, at the commit named for
137
+ the debugger below, MIT License), which resolves a missing path to a unique suffix match;
138
+ no code was copied, and DAL only suggests the matching files.
139
+
135
140
  Tool-argument repair (@dalcode/dal-tool-catalog: src/repair.ts) follows the
136
141
  ideas of tool-input-repair in pi-model-tools
137
142
  (https://github.com/bacnh85/pi-extensions), by bacnh85: closing JSON cut off
@@ -146,6 +151,20 @@ rejecting amounts that are not plain decimals. No code was copied (no license
146
151
  file); DAL counts the session's own recorded spend (sub-agents, advisor,
147
152
  lesson drafting included) and stops before the next request instead.
148
153
 
154
+ The /simplify command (@dalcode/dal-review: src/simplify.ts) adapts:
155
+
156
+ compound-engineering-plugin, skills/ce-simplify-code
157
+ (https://github.com/EveryInc/compound-engineering-plugin), at commit
158
+ 2e41b4490a37f53db0beb6d4904618da9af2f559
159
+ Copyright (c) 2025 Every
160
+ Licensed under the MIT License, whose terms are the same as those in the
161
+ LICENSE file distributed with this package. Adapted: the code-reuse,
162
+ code-quality, efficiency, test-value and comment reviewer checklists, the
163
+ behaviour-preserving and "never simplify away a safety check" rules, and
164
+ reporting before editing. Modified: one read-only reviewer reporting through
165
+ DAL's review tool instead of five dispatched agents, report-only by default,
166
+ no host-specific dispatch or model selection.
167
+
149
168
  The lean-code rule (@dalcode/dal-workflow: src/lean-code.ts) adapts:
150
169
 
151
170
  Ponytail (https://github.com/DietrichGebert/ponytail), at commit
@@ -159,6 +178,25 @@ The lean-code rule (@dalcode/dal-workflow: src/lean-code.ts) adapts:
159
178
  condensed into one system-prompt rule. Ponytail's levels, commands and
160
179
  wording are not used.
161
180
 
181
+ The @-import expansion of instruction files (@dalcode/dal-compat:
182
+ src/at-imports.ts) is ported from oh-my-pi,
183
+ packages/coding-agent/src/discovery/at-imports.ts (same repository, commit,
184
+ copyright holders and MIT License as the debugger below). Modified:
185
+ synchronous, imports confined to the project (or home for user-level files),
186
+ credential-like files never read, per-file and total size caps.
187
+
188
+ Prompt wording adapted from oh-my-pi's prompts (same repository, commit and MIT
189
+ License as the debugger below), condensed and reworded: the working contract
190
+ of @dalcode/dal-workflow (src/working-contract.ts: never substitute an easier
191
+ problem or suppress a symptom; find other call sites and copies; mark what was
192
+ not observed), the sub-agent rule to continue rather than end on a plan or a
193
+ promise (@dalcode/dal-subagent), the reviewer's check of a changed contract's
194
+ consumers (@dalcode/dal-review), the advisor's "silence when sound" and
195
+ completion-after-sampling rules (@dalcode/dal-advisor), and memory yielding to
196
+ the repository (@dalcode/dal-learn). The --max-time run limit of
197
+ @dalcode/dal-usage (src/time-limit.ts) follows the idea of oh-my-pi's flag of
198
+ the same name; no code was copied.
199
+
162
200
  The MCP reconnect schedule (@dalcode/dal-mcp, src/index.ts) follows:
163
201
 
164
202
  pi-mcp-extension 1.5.1 (npm), Copyright (c) 2026 irahardianto
@@ -196,7 +234,8 @@ pinned to one version and checked against its SHA-256:
196
234
  Microsoft Corporation, MIT License; its LICENSE ships inside the package.
197
235
  vscode-js-debug 1.140.0 (https://github.com/microsoft/vscode-js-debug),
198
236
  Copyright (c) Microsoft Corporation, MIT License; its LICENSE ships inside
199
- the downloaded archive.
237
+ the downloaded archive. The same archive, unchanged, is redistributed as the
238
+ npm package @deepailab/js-debug-dap, with that LICENSE alongside it.
200
239
 
201
240
  The visual skills (@dalcode/dal-skills: src/bundled/web-design,
202
241
  diagram-design, poster-design, print-design and the shared
@@ -221,6 +260,23 @@ src/bundled/visual-kit) and the chart and diagram styles of
221
260
  The terms of the MIT and ISC licenses are the same in substance as those in
222
261
  the LICENSE file distributed with this package.
223
262
 
263
+ The bundled skills bounded-code-repair, evidence-first-retrieval and
264
+ validated-structured-output (@dalcode/dal-skills: src/bundled/) are adapted
265
+ from the small-model reliability skills of:
266
+
267
+ pi-coding-agent-forge (https://github.com/Firstp1ck/pi-coding-agent-forge),
268
+ pi-extension-small-modal-reliability/skills, at commit
269
+ 2328249ba2941af2bc55d05487dfd9800f617191
270
+ Copyright (c) 2026 Firstpick
271
+ Licensed under the MIT License, whose terms are the same as those in the
272
+ LICENSE file distributed with this package. Adapted: the workflows (one
273
+ behaviour inside a declared write boundary, reproduce first, observed
274
+ checks as the only evidence, at most two repair attempts; source priority,
275
+ exact passages, the supported / partial / conflicting / insufficient
276
+ outcomes; declarative output contracts with at most two repairs).
277
+ Rewritten in Chinese for DAL; the host-specific adapter sections, tools and
278
+ commands are left out.
279
+
224
280
  The page templates load these libraries at view time, unmodified, from a
225
281
  pinned version on the npmmirror CDN with a subresource-integrity hash; they
226
282
  are not redistributed in this package:
@@ -263,6 +319,25 @@ credited here:
263
319
  organs" - the official-document page, type and numbering parameters follow
264
320
  the standard's published format specification.
265
321
 
322
+ The keep-awake extension (@dalcode/dal-awake: src/inhibitor.ts, src/index.ts)
323
+ is adapted from:
324
+
325
+ @narumitw/pi-caffeinate 0.49.11 (https://github.com/narumiruna/pi-extensions)
326
+ Copyright (c) 2026 narumiruna
327
+ Licensed under the MIT License, whose terms are the same as those in the
328
+ LICENSE file distributed with this package. Adapted: the per-platform
329
+ helpers (macOS caffeinate, Linux systemd-inhibit held by a shell watcher
330
+ bound to the parent process, Windows SetThreadExecutionState released by
331
+ closing stdin). Modified: held only after a run has lasted 30 seconds,
332
+ system-awake mode only, no notifications, menu, custom command or D-Bus
333
+ call, DAL names.
334
+
335
+ The rtk adapter (@dalcode/dal-rtk) follows the `rtk rewrite` contract of rtk's
336
+ own agent hook (https://github.com/rtk-ai/rtk, hooks, Apache License 2.0):
337
+ exit 0 or 3 with the rewritten command, exit 1 for none, a 2-second timeout,
338
+ version 0.23 or later, failing open. No code was copied. rtk itself is not
339
+ distributed with DAL; it is used only when the user has installed it.
340
+
266
341
  Design ideas, no code copied. The edit anchors in @dalcode/dal-guard
267
342
  (src/edit-anchor.ts: an edit is checked against the file version the model
268
343
  last read and refused when that place has changed since) follow the hashline
package/PRIVACY.md CHANGED
@@ -7,6 +7,11 @@
7
7
 
8
8
  ## 一、匿名使用统计
9
9
 
10
+ **默认关闭,你同意后才开。** 在终端界面里第一次启动时会问一次:允许 / 不允许 / 以后再问
11
+ (选"以后再问"三十天内不再问);`dal -p` 等无人回答的方式一律不发送。告知不等于同意:
12
+ 旧版本只"提示过一次"、你从没选择过的,升级后同样视为未同意,不会发送。
13
+ 接收端尚未配置时(当前版本即如此),既不会问,也不会收集。
14
+
10
15
  ### 我们收集什么
11
16
 
12
17
  只有枚举值和计数,一共五种事件:
@@ -53,18 +58,79 @@
53
58
  三种方式,任选其一:
54
59
 
55
60
  ```bash
61
+ /telemetry on # 在 dal 里执行,开启(等同于在提问时选"允许")
56
62
  /telemetry off # 在 dal 里执行,永久关闭
57
63
  export DAL_TELEMETRY=0 # 环境变量
58
64
  export DO_NOT_TRACK=1 # 跨厂商通用约定
59
65
  ```
60
66
 
61
67
  在 CI 环境(检测到 `CI` / `GITHUB_ACTIONS` / `GITLAB_CI` / `BUILDKITE` / `JENKINS_URL`)
62
- 默认不上报。
68
+ 即使同意过也不上报。
63
69
 
64
70
  一旦你用 `/telemetry off` 关闭,**环境变量无法把它重新打开**。
65
71
  用 `/telemetry` 可查看当前状态和关闭原因。
66
72
 
67
- 开关与匿名 ID 存放在 `~/.dal/agent/telemetry.json`(权限 0600),删除该文件等同于重置。
73
+ 在 DAL Code 桌面应用里,同一个问题由桌面应用在自己的窗口里问,你的回答会交给 `dal` 记下,
74
+ 效果与 `/telemetry on|off` 相同,立即生效;选"不允许"时尚未发出的内容会直接丢弃。
75
+ 桌面应用启动 `dal` 时也可以通过 `DAL_TELEMETRY_CONSENT=granted|denied`
76
+ (失败症状为 `DAL_FAILURE_REPORTS_CONSENT`)带上你在桌面里的选择,但这只在你还没有在 `dal` 里
77
+ 做过选择时才会被采用:**你在 `dal` 里拒绝过的,桌面应用或环境变量都无法改回"允许"**。
78
+
79
+ 你的选择与匿名 ID 存放在 `~/.dal/agent/telemetry.json`(权限 0600),只在你回答后才写入;
80
+ 删除该文件等同于重置(重新变为未同意)。
81
+
82
+ ## 一(补)、失败症状上报(默认关闭)
83
+
84
+ 代码见 `packages/dal-telemetry/src/failures.ts`(判定与白名单)、`failure-queue.ts`(离线队列)、
85
+ `failure-reporting.ts`(同意与开关)。接收端契约见 `docs/evolution/collector-contract.md`。
86
+
87
+ **默认关闭。** 与上面的匿名使用统计分开询问,同意其中一项不等于同意另一项。
88
+ 只有你明确同意后才会记录和发送。第一次遇到任务没做好时,`dal` 会问一次:
89
+ 允许 / 不允许 / 以后再问(选"以后再问"三十天内不再问)。在你回答之前,失败只在内存里判定,
90
+ 不写盘、不发送。接收端尚未配置时(当前版本即如此),既不会问,也不会收集。
91
+
92
+ ### 上报什么
93
+
94
+ 每次没做好的任务最多一条"症状",只有枚举值、工具名和计数:
95
+
96
+ | 字段 | 内容 |
97
+ |---|---|
98
+ | 失败类别 | 固定列表之一:工具反复失败、编辑锚点失效、同一调用原样重复、输出被截断或超出单次花费/轮数上限、上下文溢出、以错误结束、被你中途打断后纠正、下一句在纠正它、测试没过却说完成、多次被保护拦截 |
99
+ | 工具摘要 | 工具名(与匿名统计同一规则:MCP 工具一律 `mcp__other`,自装扩展 `extension__other`)、调用次数、失败次数、错误类别(固定列表) |
100
+ | 工具序列 | 上面这些工具名按顺序折叠,成功/失败,最多 32 段 |
101
+ | 模型 | 我们目录里的模型 ID;你自己配置的模型一律记为 `custom` |
102
+ | 其他 | DAL 版本、操作系统、轮数、耗时(秒)、花费(美元)、压缩次数、日期(只到天) |
103
+ | 标识 | 每条一个随机 ID;一个每 30 天更换一次的随机上报者 ID(只用来数"多少台机器遇到",与匿名统计 ID、账号都无关) |
104
+
105
+ ### 不上报什么
106
+
107
+ 提示词、模型回答、工具参数、工具输出、报错原文、代码、文件内容、文件路径、目录名、仓库名、
108
+ 环境变量、密钥。这些在症状里**没有字段可放**:发送前和发送时各有一道校验,
109
+ 多出任何字段、出现路径或疑似密钥的形状,整条拒发。
110
+
111
+ ### 附带复现材料(每次单独同意)
112
+
113
+ `/telemetry attach` 可以为本次会话最近一次失败附上复现材料:这次任务的请求、工具调用和截断后的
114
+ 工具输出。它包含内容,所以每次都会先给你看要发的内容并单独询问,不会记住"总是允许"。
115
+ 密钥会被遮盖,敏感文件(`.env`、私钥等)不含内容,绝对路径只保留文件名;
116
+ 仍有疑似密钥或个人路径时拒绝发送。接收端保存 30 天后删除。
117
+
118
+ ### 离线与失败
119
+
120
+ 症状先写进 `~/.dal/agent/telemetry-failures.jsonl`(权限 0600),联网时分批发送;
121
+ 发不出去就留着稍后再试(最多 10 次、最长 14 天、最多 200 条),发送失败从不影响使用,
122
+ 退出时最多等 1 秒。
123
+
124
+ ### 怎么关
125
+
126
+ ```bash
127
+ /telemetry failures off # 关闭失败症状上报,并立即删除待发送内容
128
+ /telemetry off # 关闭全部上报(含失败症状),同样立即删除
129
+ export DAL_FAILURE_REPORTS=0
130
+ ```
131
+
132
+ `DO_NOT_TRACK=1`、`DAL_TELEMETRY=0`、CI 环境同样一律关闭。
133
+ `/telemetry failures show` 原样列出待发送的内容,`/telemetry failures` 查看状态。
68
134
 
69
135
  ## 二、你和模型之间的数据
70
136
 
@@ -1 +1 @@
1
- var A=Object.defineProperty;var o=(e,t)=>A(e,"name",{value:t,configurable:!0});import{ProcessTerminal as g,setCapabilityOverrides as y,setKeybindings as v,TuiMainScreen as F}from"@earendil-works/pi-tui";import{existsSync as P}from"fs";import{APP_NAME as _,CONFIG_DIR_NAME as N,ENV_AGENT_DIR as I,getAgentDir as T,getSettingsPath as b,PACKAGE_NAME as x}from"../config.js";import{areExperimentalFeaturesEnabled as M}from"../core/experimental.js";import{KeybindingsManager as O}from"../core/keybindings.js";import{DefaultPackageManager as k}from"../core/package-manager.js";import{SettingsManager as D}from"../core/settings-manager.js";import{ExtensionInputComponent as R}from"../modes/interactive/components/extension-input.js";import{ExtensionSelectorComponent as G}from"../modes/interactive/components/extension-selector.js";import{FirstTimeSetupComponent as q}from"../modes/interactive/components/first-time-setup.js";import{SYSTEM_THEME_NAME as w}from"../modes/interactive/theme/system-theme.js";import{DEFAULT_THEME_SETTING as l,getTerminalTheme as p,initTheme as K,loadThemeFromPath as L,markTerminalColorsPending as H,resolveThemeSetting as d,setRegisteredThemes as j,setTerminalColors as U,setTheme as u}from"../modes/interactive/theme/theme.js";import{requestTerminalColors as V}from"../modes/interactive/theme/theme-controller.js";const Y="@earendil-works/pi-coding-agent",z="pi",B=".pi";function J({packageName:e,appName:t,configDirName:i}){return e===Y&&t===z&&i===B}o(J,"isOfficialDistribution");function Q(e){const t=[],i=new Set;for(const n of e)if(n.enabled)try{const a=L(n.path);if(a.name){if(i.has(a.name))continue;i.add(a.name)}t.push(a)}catch{}return t}o(Q,"loadThemes");async function W(e){const t=D.inMemory(e.getGlobalSettings(),{projectTrusted:!1}),n=await new k({cwd:process.cwd(),agentDir:T(),settingsManager:t}).resolve(async()=>"skip");return Q(n.themes)}o(W,"loadStartupThemes");async function f(e){y(e.getTerminalCapabilityOverrides()),j(await W(e)),H(),K(d(e.getThemeSetting()??l,p())??w),v(O.create());const t=new F(new g,e.getShowHardwareCursor(),T());return t.setClearOnShrink(e.getClearOnShrink()),t}o(f,"createStartupTui");function S(e,t){e.start();const i=t.getThemeSetting();C(e,()=>{u(d(i??l,p())??w)})}o(S,"startStartupTui");function C(e,t){V(e,i=>{U(i),t(),e.invalidate(),e.requestRender()})}o(C,"queryStartupTerminalColors");async function h(e){e.clear(),e.requestRender(),await new Promise(t=>setTimeout(t,25))}o(h,"clearStartupTui");function le(e=b()){return!J({packageName:x,appName:_,configDirName:N})||!M()||process.env[I]?!1:!P(e)}o(le,"shouldRunFirstTimeSetup");async function pe(e,t,i){const n=await f(e);return new Promise(a=>{let m=!1;const s=o(async r=>{m||(m=!0,await h(n),n.stop(),a(r))},"finish"),c=new G(t,i.map(r=>r.label),r=>{s(i.find(E=>E.label===r)?.value)},()=>{s(void 0)},{tui:n});n.addChild(c),n.setFocus(c),S(n,e)})}o(pe,"showStartupSelector");async function de(e){const t=await f(e);return new Promise(i=>{let n=!1;const a=o(async r=>{n||(n=!0,r&&(e.setTheme(r.theme),e.setEnableAnalytics(r.shareAnalytics),await e.flush()),await h(t),t.stop(),i())},"finish");t.start();const m=o(r=>d(r,p())??r,"concrete");let s=m(l);u(s);const c=new q({onThemePreview:o(r=>{s=m(r),u(s),t.requestRender()},"onThemePreview"),onSubmit:o(r=>{a(r)},"onSubmit"),onCancel:o(()=>{a(void 0)},"onCancel")});t.addChild(c),t.setFocus(c),t.requestRender(),C(t,()=>u(s))})}o(de,"showFirstTimeSetup");async function fe(e,t,i){const n=await f(e);return new Promise(a=>{let m=!1;const s=o(async r=>{m||(m=!0,c.dispose(),await h(n),n.stop(),a(r))},"finish"),c=new R(t,i,r=>{s(r)},()=>{s(void 0)},{tui:n});n.addChild(c),n.setFocus(c),S(n,e)})}o(fe,"showStartupInput");export{f as createStartupTui,le as shouldRunFirstTimeSetup,de as showFirstTimeSetup,fe as showStartupInput,pe as showStartupSelector,S as startStartupTui};
1
+ var g=Object.defineProperty;var o=(e,t)=>g(e,"name",{value:t,configurable:!0});import{ProcessTerminal as C,setCapabilityOverrides as y,setKeybindings as _,TuiMainScreen as v}from"@earendil-works/pi-tui";import{existsSync as P}from"fs";import{APP_NAME as F,CONFIG_DIR_NAME as N,ENV_AGENT_DIR as b,getAgentDir as h,getSettingsPath as I,PACKAGE_NAME as x}from"../config.js";import{areExperimentalFeaturesEnabled as M}from"../core/experimental.js";import{KeybindingsManager as O}from"../core/keybindings.js";import{DefaultPackageManager as R}from"../core/package-manager.js";import{SettingsManager as k}from"../core/settings-manager.js";import{ExtensionInputComponent as D}from"../modes/interactive/components/extension-input.js";import{ExtensionSelectorComponent as G}from"../modes/interactive/components/extension-selector.js";import{FirstTimeSetupComponent as q}from"../modes/interactive/components/first-time-setup.js";import{SYSTEM_THEME_NAME as S}from"../modes/interactive/theme/system-theme.js";import{DEFAULT_THEME_SETTING as l,getTerminalTheme as p,initTheme as L,loadThemeFromPath as K,markTerminalColorsPending as H,resolveThemeSetting as d,setRegisteredThemes as U,setTerminalColors as Y,setTheme as u}from"../modes/interactive/theme/theme.js";import{requestTerminalColors as j}from"../modes/interactive/theme/theme-controller.js";const V="@earendil-works/pi-coding-agent",W="pi",z=".pi";function B({packageName:e,appName:t,configDirName:i}){return e===V&&t===W&&i===z}o(B,"isOfficialDistribution");function J(e){const t=[],i=new Set;for(const n of e)if(n.enabled)try{const a=K(n.path);if(a.name){if(i.has(a.name))continue;i.add(a.name)}t.push(a)}catch{}return t}o(J,"loadThemes");async function Q(e){const t=k.inMemory(e.getGlobalSettings(),{projectTrusted:!1}),n=await new R({cwd:process.cwd(),agentDir:h(),settingsManager:t}).resolve(async()=>"skip");return J(n.themes)}o(Q,"loadStartupThemes");async function f(e){y(e.getTerminalCapabilityOverrides()),U(await Q(e)),H(),L(d(e.getThemeSetting()??l,p())??S),_(O.create());const t=new v(new C,e.getShowHardwareCursor(),h());return t.setClearOnShrink(e.getClearOnShrink()),t}o(f,"createStartupTui");function w(e,t){e.start();const i=t.getThemeSetting();E(e,()=>{u(d(i??l,p())??S)})}o(w,"startStartupTui");function E(e,t){j(e,i=>{Y(i),t(),e.invalidate(),e.requestRender()})}o(E,"queryStartupTerminalColors");async function T(e){e.clear(),e.requestRender(),await new Promise(t=>setTimeout(t,25))}o(T,"clearStartupTui");function de(e=I()){return!B({packageName:x,appName:F,configDirName:N})||!M()||process.env[b]?!1:!P(e)}o(de,"shouldRunFirstTimeSetup");async function fe(e,t,i){const n=await f(e);return new Promise(a=>{let m=!1;const s=o(async r=>{m||(m=!0,await T(n),n.stop(),a(r))},"finish"),c=new G(t,i.map(r=>r.label),r=>{s(i.find(A=>A.label===r)?.value)},()=>{s(void 0)},{tui:n});n.addChild(c),n.setFocus(c),w(n,e)})}o(fe,"showStartupSelector");const X=Symbol.for("dalcode.telemetry.startupAnswer");function Z(e){globalThis[X]=e}o(Z,"handOverStartupTelemetryAnswer");async function Te(e){const t=await f(e);return new Promise(i=>{let n=!1;const a=o(async r=>{n||(n=!0,r&&(e.setTheme(r.theme),Z(r.shareAnalytics),await e.flush()),await T(t),t.stop(),i())},"finish");t.start();const m=o(r=>d(r,p())??r,"concrete");let s=m(l);u(s);const c=new q({onThemePreview:o(r=>{s=m(r),u(s),t.requestRender()},"onThemePreview"),onSubmit:o(r=>{a(r)},"onSubmit"),onCancel:o(()=>{a(void 0)},"onCancel")});t.addChild(c),t.setFocus(c),t.requestRender(),E(t,()=>u(s))})}o(Te,"showFirstTimeSetup");async function he(e,t,i){const n=await f(e);return new Promise(a=>{let m=!1;const s=o(async r=>{m||(m=!0,c.dispose(),await T(n),n.stop(),a(r))},"finish"),c=new D(t,i,r=>{s(r)},()=>{s(void 0)},{tui:n});n.addChild(c),n.setFocus(c),w(n,e)})}o(he,"showStartupInput");export{X as STARTUP_TELEMETRY_ANSWER_SLOT,f as createStartupTui,Z as handOverStartupTelemetryAnswer,de as shouldRunFirstTimeSetup,Te as showFirstTimeSetup,he as showStartupInput,fe as showStartupSelector,w as startStartupTui};
@@ -76,6 +76,7 @@ export type AgentSessionEvent = WithParentToolCallId<Exclude<AgentEvent, {
76
76
  maxAttempts: number;
77
77
  delayMs: number;
78
78
  errorMessage: string;
79
+ cause: "network" | "provider";
79
80
  } | {
80
81
  type: "auto_retry_end";
81
82
  success: boolean;
@@ -192,6 +193,7 @@ export declare class AgentSession {
192
193
  private _followUpMessages;
193
194
  private _pendingNextTurnMessages;
194
195
  private _pendingCustomMessages;
196
+ private _requestCompactionChecked;
195
197
  private _compactionAbortController;
196
198
  private _autoCompactionAbortController;
197
199
  private _overflowRecoveryAttempted;
@@ -272,6 +274,7 @@ export declare class AgentSession {
272
274
  private _compactionThresholdFor;
273
275
  private _pruneToolOutputsInsteadOfCompacting;
274
276
  private _compactBeforeNextAssistantResponse;
277
+ private _compactAtRequestBoundary;
275
278
  private _installAgentRequestProjection;
276
279
  private _dispatchTurnEndBoundary;
277
280
  private _installAgentBoundaryHooks;