@shgroup/dsh-serenity-hooks 1.25.4 → 1.25.6

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.25.4",
3
+ "version": "1.25.6",
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/index.js CHANGED
@@ -9382,20 +9382,32 @@ function sendHtml(res, html) {
9382
9382
  res.end(html);
9383
9383
  }
9384
9384
  /**
9385
- * 发现候选 CCC 列表(多 CCC 手工切换,v1.25.4):
9386
- * live 会话 cwd 上溯 .serenity 去重 + 默认绑定 root 兜底(不在列表时放首位)。
9387
- */
9388
- function discoverCccs(ctx, defaultRoot) {
9385
+ * 发现候选 CCC 列表(多 CCC 手工切换,v1.25.6):
9386
+ * **dsh 工作区注册表**(workspaceRegistry.list,持久化——所有工作目录即使无 live 会话;
9387
+ * S142 用户 2026-08-29:应直接拉 dsh 工作区,且只列具体 CCC)
9388
+ * **sessionPersistence 兜底**(持久化会话 headers——必装配服务,覆盖所有历史会话工作目录;
9389
+ * 用户实测 workspaceRegistry 拉取仍空时兜底)
9390
+ * ③ live 会话兜底
9391
+ * ④ 默认绑定 root 兜底(不在列表时放首位)
9392
+ */
9393
+ async function discoverCccs(ctx, defaultRoot) {
9389
9394
  const roots = [];
9395
+ const pushRoot = (cwd) => {
9396
+ if (typeof cwd !== "string" || cwd === "") return;
9397
+ const r = findSerenityRoot(cwd);
9398
+ if (r && !roots.includes(r)) roots.push(r);
9399
+ };
9390
9400
  try {
9401
+ const registry = ctx.get?.("workspaceRegistry");
9402
+ for (const ws of registry?.list?.() ?? []) pushRoot(ws?.path);
9403
+ } catch {}
9404
+ if (roots.length === 0) try {
9405
+ const sp = ctx.get?.("sessionPersistence");
9406
+ for (const h of await sp?.list?.() ?? []) pushRoot(h?.cwd);
9407
+ } catch {}
9408
+ if (roots.length === 0) try {
9391
9409
  const sessions = ctx.sessions;
9392
- for (const s of sessions?.list?.() ?? []) {
9393
- const cwd = s?.header?.cwd;
9394
- if (typeof cwd === "string") {
9395
- const r = findSerenityRoot(cwd);
9396
- if (r && !roots.includes(r)) roots.push(r);
9397
- }
9398
- }
9410
+ for (const s of sessions?.list?.() ?? []) pushRoot(s?.header?.cwd);
9399
9411
  } catch {}
9400
9412
  if (!roots.includes(defaultRoot)) roots.unshift(defaultRoot);
9401
9413
  return roots.map((root) => ({
@@ -9568,7 +9580,7 @@ async function handle(ctx, defaultRoot, webPort, req, res) {
9568
9580
  try {
9569
9581
  const url = (req.url ?? "/").split("?")[0] ?? "/";
9570
9582
  if (req.method === "GET" && url === "/") {
9571
- sendHtml(res, skiffDebugPage(discoverCccs(ctx, defaultRoot), defaultRoot, webPort));
9583
+ sendHtml(res, skiffDebugPage(await discoverCccs(ctx, defaultRoot), defaultRoot, webPort));
9572
9584
  return;
9573
9585
  }
9574
9586
  if (req.method === "POST" && url === "/ask") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shgroup/dsh-serenity-hooks",
3
- "version": "1.25.4",
3
+ "version": "1.25.6",
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": {