@shgroup/dsh-serenity-hooks 1.17.1 → 1.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-serenity-hooks",
3
- "version": "1.17.1",
3
+ "version": "1.17.3",
4
4
  "main": "lib/index.js",
5
5
  "description": "宁静号 ACC harness(Native Cordis 插件):真实 DSH 工具 cc_fs/session/acc_msm/eap/neat/cce/loop + 拦截缝机械约束(safe-mode/路径守卫/会话落盘)。适配 DSH 公开版(0.1.0-rc,deepseek-ai/deepseek-harness)。私有(dsh-external 组织)。",
6
6
  "engines": {
package/lib/index.js CHANGED
@@ -626,6 +626,20 @@ flags 是 new-style 对象数组,用于参数校验与 path 逃逸守卫:
626
626
  - 配对 .test.ts 或 .spec.ts(DC-M1,vitest)
627
627
  - 业务子进程环境:注入 SERENITY_ROOT / SERENITY_CCC / SERENITY_VERSION
628
628
 
629
+ ## 交互与确认规范(禁止阻塞性确认)
630
+ - MSM 运行在**无用户交互的子进程**(spawn/execFile,600s 超时)——**禁止**用
631
+ readline / prompt / process.stdin 等阻塞等待用户输入(会卡死至超时被 kill)
632
+ - 需要二次确认时:**直接返回确认信息**(输出将执行的操作与影响 + 如何带确认参数重试),
633
+ 以非 0 退出码返回(或明确提示)
634
+ - agent 确认后**重新调用 MSM 并带上确认参数**(如 --confirm / --yes / --force)重试
635
+ - 标准模式(两段式):
636
+ 1. 首次调用:检测到破坏性/需确认操作且未带确认 flag → 输出确认请求(列出操作/影响/回滚),
637
+ exit 非 0(如 1 user),**不执行任何变更**
638
+ 2. agent 评估后重新调用:带确认 flag → 执行并输出结果
639
+ - 适用场景:删除/覆盖/推送/批量操作 等不可逆或影响面大的操作
640
+ - 反例(禁止):readline 等待用户输入、process.stdin.on('data') 阻塞等待
641
+ (MSM 无 stdin 交互通道——卡死至 600s 超时)
642
+
629
643
  ## 品质检查(acc_msm check,DC-M1~M4)
630
644
  DC-M1 有 .test.ts/.spec.ts;DC-M2 有 main() 守卫(function main( / isMain / require.main === / import.meta.url);
631
645
  DC-M3 双向:脚本未注册 + 注册表引用脚本缺失;DC-M4 路径型 flag 标记 type:"path"
@@ -3786,7 +3800,12 @@ function resolveActiveSessionInfo(root, scope) {
3786
3800
  return null;
3787
3801
  }
3788
3802
  }
3789
- /** 5) Session 块:逐字对齐 osp(活跃会话 + todowrite 首位约定);scope = dsh 会话维度 */
3803
+ /**
3804
+ * 5) Session 块:对齐 osp(活跃会话 + todowrite 首位约定);scope = dsh 会话维度。
3805
+ * **平台适配(v1.17.2)**:osp 的 todowrite 首项含 `priority: "low"`(opencode todo 支持),
3806
+ * 但 DSH 平台 todowrite schema 无 priority(additionalProperties: false 拒绝)→ agent 照做报
3807
+ * `todos[0].priority is not a declared property`。DSH 版去掉 priority 字段(其余逐字对齐 osp)。
3808
+ */
3790
3809
  function sessionBlock(root, scope = DEFAULT_SESSION_SCOPE) {
3791
3810
  const active = resolveActiveSessionInfo(root, scope);
3792
3811
  if (!active) return "";
@@ -3808,7 +3827,7 @@ function sessionBlock(root, scope = DEFAULT_SESSION_SCOPE) {
3808
3827
  "CRITICAL: When calling todowrite, the first item in the todos array MUST",
3809
3828
  "always be:",
3810
3829
  ` { content: "SESSION: ${active.sessionId} — ${active.dirName.replace(/^\d{4}-\d{2}-\d{2}--/, "")}",`,
3811
- " status: \"completed\", priority: \"low\" }",
3830
+ " status: \"completed\" }",
3812
3831
  "This preserves the session context across todo updates.",
3813
3832
  "Do NOT remove or reorder this item — keep it at position 0.",
3814
3833
  ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shgroup/dsh-serenity-hooks",
3
- "version": "1.17.1",
3
+ "version": "1.17.3",
4
4
  "description": "宁静号 ACC harness — Native Cordis 插件(DeepSeek Harness 运行时)。真实 DSH 工具注册(cc_fs/session/acc_msm 等 9 工具)+ 拦截缝机械约束(safe-mode/路径守卫/会话落盘)+ 系统提示词注入(ACC/CCE/Constraints/SKILL/Session 五块)。适配 DSH 公开版(deepseek-ai/deepseek-harness 0.1.0-rc)。",
5
5
  "license": "MIT",
6
6
  "repository": {