@shgroup/dsh-serenity-hooks 1.27.0 → 1.27.1

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.27.0",
3
+ "version": "1.27.1",
4
4
  "main": "lib/index.js",
5
5
  "description": "宁静号 ACC harness(Native Cordis 插件):真实 DSH 工具 cc_fs/session/acc_msm/eap/neat/cce/handyman/session_rebuild/skiff_admin + 拦截缝机械约束(safe-mode/路径守卫)+ 高级设定面板(双端口网关/账号管理)+ Skiff 认知子集角色(实验性)。适配 DSH 公开版(0.1.0-rc,deepseek-ai/deepseek-harness)。",
6
6
  "engines": {
package/lib/client.js CHANGED
@@ -4159,7 +4159,10 @@ Instruction-following style:
4159
4159
  setLoginPhase("idle");
4160
4160
  (async () => {
4161
4161
  try {
4162
- const res = await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: { accept: "application/json" } });
4162
+ const res = await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: {
4163
+ accept: "application/json",
4164
+ "x-serenity-ui": "1"
4165
+ } });
4163
4166
  if (!res.ok) {
4164
4167
  const body = await res.json().catch(() => null);
4165
4168
  if (alive) setLoadError(body?.error ?? `HTTP ${res.status}`);
@@ -4181,7 +4184,10 @@ Instruction-following style:
4181
4184
  let timer;
4182
4185
  const poll = async () => {
4183
4186
  try {
4184
- const res = await fetch(`/serenity/weixin/login?key=${encodeURIComponent(loginKey)}`, { headers: { accept: "application/json" } });
4187
+ const res = await fetch(`/serenity/weixin/login?key=${encodeURIComponent(loginKey)}`, { headers: {
4188
+ accept: "application/json",
4189
+ "x-serenity-ui": "1"
4190
+ } });
4185
4191
  if (!alive) return;
4186
4192
  if (!res.ok) {
4187
4193
  const body = await res.json().catch(() => null);
@@ -4194,7 +4200,10 @@ Instruction-following style:
4194
4200
  setLoginPhase("confirmed");
4195
4201
  setLoginNotice(`账号 ${body.accountId} 已绑定 ✓(token 已写入 CCC localstore)`);
4196
4202
  if (selectedRoot) {
4197
- const sbody = await (await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: { accept: "application/json" } })).json().catch(() => null);
4203
+ const sbody = await (await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: {
4204
+ accept: "application/json",
4205
+ "x-serenity-ui": "1"
4206
+ } })).json().catch(() => null);
4198
4207
  if (alive && sbody) setStatus(sbody);
4199
4208
  }
4200
4209
  return;
@@ -4264,7 +4273,10 @@ Instruction-following style:
4264
4273
  accountId
4265
4274
  })
4266
4275
  })).ok) return;
4267
- const sbody = await (await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: { accept: "application/json" } })).json().catch(() => null);
4276
+ const sbody = await (await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: {
4277
+ accept: "application/json",
4278
+ "x-serenity-ui": "1"
4279
+ } })).json().catch(() => null);
4268
4280
  if (sbody) setStatus(sbody);
4269
4281
  } catch {}
4270
4282
  };
@@ -4297,7 +4309,10 @@ Instruction-following style:
4297
4309
  return;
4298
4310
  }
4299
4311
  setLoadError(null);
4300
- const sbody = await (await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: { accept: "application/json" } })).json().catch(() => null);
4312
+ const sbody = await (await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: {
4313
+ accept: "application/json",
4314
+ "x-serenity-ui": "1"
4315
+ } })).json().catch(() => null);
4301
4316
  if (sbody) setStatus(sbody);
4302
4317
  } catch {}
4303
4318
  };
@@ -4322,7 +4337,10 @@ Instruction-following style:
4322
4337
  return;
4323
4338
  }
4324
4339
  setLoadError(null);
4325
- const sbody = await (await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: { accept: "application/json" } })).json().catch(() => null);
4340
+ const sbody = await (await fetch(`/serenity/weixin?ccc=${encodeURIComponent(selectedRoot)}`, { headers: {
4341
+ accept: "application/json",
4342
+ "x-serenity-ui": "1"
4343
+ } })).json().catch(() => null);
4326
4344
  if (sbody) setStatus(sbody);
4327
4345
  } catch {}
4328
4346
  };
@@ -4404,23 +4422,45 @@ Instruction-following style:
4404
4422
  className: "ss-rowCard",
4405
4423
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4406
4424
  className: "ss-rowText",
4407
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4425
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4408
4426
  className: "ss-rowName",
4409
- children: "账号"
4427
+ children: [
4428
+ "账号(",
4429
+ status.accounts.length,
4430
+ ")"
4431
+ ]
4410
4432
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4411
4433
  className: "ss-rowDesc",
4412
- children: status.accounts.length === 0 ? "未绑定任何微信账号——点击右侧「扫码绑定」" : status.accounts.map((a) => `${a.accountId}${a.name ? ` · ${a.name}` : ""}${a.bound ? " · 已绑定" : " · 未绑定凭据"}(${bridgeStateText(a.accountId)})`).join(";")
4434
+ children: status.accounts.length === 0 ? "未绑定任何微信账号——点击下方「扫码绑定微信」逐个添加" : "每个账号独立轮询;可继续扫码添加更多"
4435
+ })]
4436
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "ss-rowControl" })]
4437
+ }) }),
4438
+ status.accounts.map((a) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4439
+ className: "ss-rowCard",
4440
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4441
+ className: "ss-rowText",
4442
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4443
+ className: "ss-rowName",
4444
+ children: [a.accountId, a.name ? ` · ${a.name}` : ""]
4445
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4446
+ className: "ss-rowDesc",
4447
+ children: [
4448
+ a.bound ? "已绑定凭据" : "未绑定凭据",
4449
+ "(",
4450
+ bridgeStateText(a.accountId),
4451
+ ")"
4452
+ ]
4413
4453
  })]
4414
4454
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4415
4455
  className: "ss-rowControl",
4416
- children: status.accounts.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4456
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4417
4457
  type: "button",
4418
4458
  className: "ss-removeBtn",
4419
- onClick: () => void removeAccount(status.accounts[0].accountId),
4420
- children: "移除首个"
4459
+ onClick: () => void removeAccount(a.accountId),
4460
+ children: "移除"
4421
4461
  })
4422
4462
  })]
4423
- }) }),
4463
+ }) }, a.accountId)),
4424
4464
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4425
4465
  className: "ss-rowCard",
4426
4466
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -4431,7 +4471,7 @@ Instruction-following style:
4431
4471
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4432
4472
  className: "ss-rowDesc",
4433
4473
  children: [
4434
- loginPhase === "idle" && "用手机微信「扫一扫」扫描二维码并确认,即绑定该 CCC 的微信桥账号",
4474
+ loginPhase === "idle" && "用手机微信「扫一扫」扫描二维码并确认——每扫一次绑定一个新账号",
4435
4475
  loginPhase === "waiting" && "二维码已生成(5 分钟内有效)——微信扫一扫 → 手机上确认绑定",
4436
4476
  loginPhase === "confirmed" && (loginNotice ?? "绑定成功"),
4437
4477
  loginPhase === "error" && (loginError ?? "绑定失败"),
@@ -4443,7 +4483,7 @@ Instruction-following style:
4443
4483
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4444
4484
  type: "button",
4445
4485
  className: "ss-loginBtn",
4446
- disabled: loginPhase === "waiting" || !status.enabled === false,
4486
+ disabled: loginPhase === "waiting",
4447
4487
  onClick: () => void startLogin(),
4448
4488
  children: loginPhase === "waiting" ? "等待扫码…" : "扫码绑定"
4449
4489
  })
@@ -4596,7 +4636,6 @@ Instruction-following style:
4596
4636
  const gatewayOn = value?.gatewayEnabled ?? false;
4597
4637
  const rebuildOn = value?.rebuildEnabled ?? true;
4598
4638
  const threshold = value?.rebuildThreshold ?? .9;
4599
- const namingOn = value?.namingEnabled ?? true;
4600
4639
  const skiffOn = value?.skiffEnabled ?? false;
4601
4640
  const skiffPort = value?.skiffDebugPort ?? 3099;
4602
4641
  const acpOn = value?.acpEnabled ?? false;
@@ -4653,17 +4692,6 @@ Instruction-following style:
4653
4692
  })
4654
4693
  }) })]
4655
4694
  }),
4656
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Group, {
4657
- title: "会话",
4658
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowCard, {
4659
- title: "会话命名",
4660
- desc: "使用宁静号会话时,把当前会话命名为 SESSION 目录名",
4661
- control: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Toggle, {
4662
- checked: namingOn,
4663
- onChange: (on) => toggle("namingEnabled", on)
4664
- })
4665
- }) })
4666
- }),
4667
4695
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Group, {
4668
4696
  title: "Skiff",
4669
4697
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowCard, {
@@ -48,10 +48,6 @@ export interface RebuildSettings {
48
48
  /** contextPressure 触发比例(0~1) */
49
49
  thresholdRatio: number;
50
50
  }
51
- /** F3 会话命名配置 */
52
- export interface NamingSettings {
53
- enabled: boolean;
54
- }
55
51
  /** 彩蛋功能:persona 模式(v1.23.1,S142 用户需求)
56
52
  * 配置后替换 ACC 系统提示词中"输出约束/指令遵循约束"部分(EAP 块 + MSM 原则段);
57
53
  * 未配置(mode 空)→ 完全默认行为,零影响。 */
@@ -74,7 +70,6 @@ export interface PublicAskSettings {
74
70
  export interface AdvancedSettings {
75
71
  gateway: GatewaySettings;
76
72
  rebuild: RebuildSettings;
77
- naming: NamingSettings;
78
73
  persona: PersonaSettings;
79
74
  publicAsk: PublicAskSettings;
80
75
  }
@@ -136,7 +131,7 @@ export interface GatewayAccountWire {
136
131
  /** 该账号是否已绑定 TOTP(v1.22.4) */
137
132
  hasTotp: boolean;
138
133
  }
139
- /** 设定 wire 形态(GET /serenity/config 返回;rebuild/naming 同持久化,gateway 去 hash) */
134
+ /** 设定 wire 形态(GET /serenity/config 返回;rebuild 同持久化,gateway 去 hash) */
140
135
  export interface AdvancedSettingsWire {
141
136
  gateway: {
142
137
  enabled: boolean;
@@ -149,7 +144,6 @@ export interface AdvancedSettingsWire {
149
144
  totpEnabled: boolean;
150
145
  };
151
146
  rebuild: RebuildSettings;
152
- naming: NamingSettings;
153
147
  persona: PersonaSettings;
154
148
  publicAsk: {
155
149
  /** 开放容器白名单(v1.26.2:容器名数组;空 = 全部开放) */
package/lib/index.d.ts CHANGED
@@ -49,10 +49,6 @@ export interface Config {
49
49
  enabled?: boolean;
50
50
  thresholdRatio?: number;
51
51
  };
52
- /** F3 会话命名(entry 默认值,运行时经 DSH settings) */
53
- naming?: {
54
- enabled?: boolean;
55
- };
56
52
  /** F4 Skiff(实验性):调试服务启停(entry 默认值,运行时经 DSH settings) */
57
53
  skiff?: {
58
54
  enabled?: boolean;