@shgroup/dsh-serenity-hooks 1.87.7 → 1.89.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.
package/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-serenity-hooks",
3
- "version": "1.87.7",
3
+ "version": "1.89.0",
4
4
  "main": "lib/index.js",
5
5
  "description": "宁静号 ACC harness(Native Cordis 插件):给 DSH 装一个「AI 工作区」——14 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/cheap-worker/localstore/container_admin;另三个 im-bridge/acc-diag/diagram 按配置条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表。轨迹声明 = 轨迹目录下的 trajectory.json(约束面 + 旧标识 uid + CRO 机器绑定 cro.host;旧名 trajectory-constraint.json / skiff.json 仍在读取族里);轨迹提示词 = 轨迹目录下的 PROMPT.md(一条轨迹「是谁、按什么章程工作」,所有轨迹通用,追加在容器层与质量层之后,不替换它们)。适配 DSH 0.1.7-rc.1 / 0.2.0-rc.1 / 0.2.1-rc.1(三档,deepseek-ai/deepseek-harness)。",
6
6
  "engines": {
@@ -227,7 +227,7 @@ async function listCccs(ctx, opts = {}) {
227
227
  if (typeof defaultRoot === "string" && defaultRoot !== "" && !c.roots.includes(defaultRoot)) c.roots.unshift(defaultRoot);
228
228
  let rolesOf = null;
229
229
  if (opts.withRoles === true) {
230
- const { listTrajectoryConstraints } = await import("./profile-DGt_e-Nx.js").then((n) => n.a);
230
+ const { listTrajectoryConstraints } = await import("./profile-zxakCNXy.js").then((n) => n.a);
231
231
  rolesOf = (root) => {
232
232
  try {
233
233
  return listTrajectoryConstraints(root).map((p) => p.code);
package/lib/cro/log.d.ts CHANGED
@@ -104,6 +104,20 @@ export interface CroWakeLogEntry {
104
104
  * ⛔ 不要把它折回 `ok:true`(那是假成功),也不要折成 `fail`(那是假失败,见 `:171` 语义)。
105
105
  */
106
106
  notReady?: true;
107
+ /**
108
+ * 🔴 **"我判了,但决定不叫"**(`ok=false` 时才有意义)—— 2026-10-23 A102。
109
+ *
110
+ * 现状(修前):`no-wake` 只累加调度器的一个计数,**一个字都不落本档**
111
+ * ⇒ 该轨迹的流水**永久停在上一次真唤起处**。
112
+ * ⇒ 于是 **「我判了、只是不叫」与「我根本没被评估」在读数上完全一样** ——
113
+ * 实测:某轨迹的流水停在 `01:40`,owner 据此认为"守卫从那以后就没工作过",
114
+ * 而真相是它**此后每个 tick 都在被评估**,只是判定为"不打扰"。
115
+ *
116
+ * 🔴 **这是 D209 的同族第三条**,判据同源:**可以不出声地判"不打扰",但"判过"本身要留痕**。
117
+ * 四态因此显式分开:`ok` / `fail` / `not-ready` / `no-wake`。
118
+ * ⛔ 不要把它折进 `ok`(那会让人以为"叫过了"),也不要折进 `fail`(它不是失败)。
119
+ */
120
+ noWake?: true;
107
121
  /** 投递方式(`已投递(live)` / `已投递(冷载入)`)或失败原因 */
108
122
  detail: string;
109
123
  /** 调度器 tick 计数(便于与 `acc-diag` ①b 对齐) */
@@ -126,6 +140,8 @@ export interface CroWakeLogInput {
126
140
  ok: boolean;
127
141
  /** 🔴 `true` ⇒ 记作 `not-ready`(没送成,但**不算失败**)。见 {@link CroWakeLogEntry.notReady} */
128
142
  notReady?: boolean;
143
+ /** 🔴 `true` ⇒ 记作 `no-wake`(**判了、但不叫**,不是失败)。见 {@link CroWakeLogEntry.noWake} */
144
+ noWake?: boolean;
129
145
  detail: string;
130
146
  tick: number;
131
147
  reason: string | null;
@@ -154,6 +154,46 @@ export declare function imChannelIds(): string[];
154
154
  * @param root 本会话 CCC 根(由调用方解析)
155
155
  */
156
156
  export declare function hasEnabledImChannel(root: string): boolean;
157
+ /**
158
+ * 可见性判据(**轨迹级**,2026-10-23 owner 令):
159
+ * 这个 dsh 会话所属的认知轨迹,是否**被 IM 路由表点名**(= 它才是那个"接线人")。
160
+ *
161
+ * ## 它解决的问题(owner 原话的**去标识改写**,原文含私有角色名,按 D145 不入仓库)
162
+ *
163
+ * > 「很多轨迹发消息给我,但是我没空回,它们就会等待我,其实并不是,我希望他们继续工作;
164
+ * > 所以只有 IM 桥绑定了任意账户的认知轨迹才拥有 `im-bridge` 这个 tool,
165
+ * > 这样可以确保只有一个接线角色和我联系,其它轨迹和它联系即可,它会自行回复它们的」
166
+ *
167
+ * ⇒ 旧判据是 **CCC 级**({@link hasEnabledImChannel}:本 CCC 有任一启用账号 ⇒ 全体可见)。
168
+ * 它的后果不是"少一个工具",而是**一条错误的工作流**:每条轨迹都以为自己该直接对 owner 说话,
169
+ * 于是发完就**停下来等人回**——而 owner 根本没空逐条回。**工具在,就把等待也带上了。**
170
+ *
171
+ * ## 判据(两条,缺一不可)
172
+ *
173
+ * 1. 本 CCC 有可用账号({@link hasEnabledImChannel})—— 没有账号时路由表也没有意义;
174
+ * 2. 本会话**绑定的轨迹编码**出现在 `routes[].trajectory` 里。
175
+ *
176
+ * ⚠️ **为什么不看 `routes[].user`**:那是"对端是谁"(owner 的通道 id),
177
+ * 判"这条轨迹能不能说话"只跟**轨迹**有关,与哪个对端无关。
178
+ *
179
+ * ⚠️ **`*` 通配也算点名**:`{ user:"*", trajectory:"<某轨迹>" }` 这条路由的含义就是
180
+ * "**没人认领的消息都归那条轨迹**" ⇒ 它确实是一条被授权的接线轨迹,必须算可见。
181
+ * 这与 `matchWeixinRoute` 的通配兜底语义**同源**,不另立规则。
182
+ *
183
+ * ## 拿不到轨迹编码时怎么办(fail-closed,与 `exclusive` 同向)
184
+ *
185
+ * 会话 → 轨迹编码要读绑定。**取不到就判不可见**:
186
+ * - 与 `exclusive`(未声明 ⇒ 隐藏)同向;
187
+ * - 反向(取不到就放行)会让"绑定坏了"表现成"工具还在",
188
+ * 而那正是本判据要防的形态(D179:配置说它有、行为说它没有,且零报错)。
189
+ * ⚠️ 代价明示:绑定读取若短暂失败,该轮会少一个工具;下一轮绑定恢复即回。
190
+ * 这比"误给一条轨迹发消息的权限"便宜 —— 后者会让它**停下来等 owner**。
191
+ *
192
+ * @param root CCC 根
193
+ * @param trajectoryCode 本会话所属认知轨迹的编码(**由调用方解析**,见 `trajectory/policy/profile.ts`)
194
+ * @returns true = 该轨迹接线,`im-bridge` 可见
195
+ */
196
+ export declare function isImWiredTrajectory(root: string, trajectoryCode: string | null | undefined): boolean;
157
197
  /** 结果载荷(lossless JSON——工具返回值必须可 JSON 化) */
158
198
  export type ImJson = null | boolean | number | string | ImJson[] | {
159
199
  [key: string]: ImJson;