@shgroup/dsh-serenity-hooks 1.50.1 → 1.51.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.
@@ -20,5 +20,9 @@ export declare function verifyToolConsistency(manifestPath: string, registeredTo
20
20
  * v1.33:`logbook` 并入 `trajectory`(10),随后新增 **专属工具 `acc-diag`**(默认对所有
21
21
  * CCC 隐藏,只有声明 `exclusiveTools` 的 CCC 可见)⇒ 11。**条件可见不改变"注册"这一事实**:
22
22
  * 本常量与清单都列它(与 im-bridge 同规格)。
23
+ *
24
+ * v1.51(**D104**):新增 **`diagram`**(标签源码 → 进程内光栅化成 PNG;**缺省关**,
25
+ * 关时连 `ctx.tools.register` 都不调用)⇒ **12**。同规格:开关关着**不影响这里列它** ——
26
+ * 本常量描述的是"插件**具备**的工具面",不是"此刻注册了几个"。
23
27
  */
24
- export declare const REGISTERED_TOOLS: readonly ["container_fs", "container_trajectory", "dashboard", "container_git", "msm", "praxis", "handyman", "localstore", "container_admin", "im-bridge", "acc-diag"];
28
+ export declare const REGISTERED_TOOLS: readonly ["container_fs", "container_trajectory", "dashboard", "container_git", "msm", "praxis", "handyman", "localstore", "container_admin", "im-bridge", "acc-diag", "diagram"];
package/lib/invariant.js CHANGED
@@ -41,6 +41,10 @@ function verifyToolConsistency(manifestPath, registeredTools) {
41
41
  * v1.33:`logbook` 并入 `trajectory`(10),随后新增 **专属工具 `acc-diag`**(默认对所有
42
42
  * CCC 隐藏,只有声明 `exclusiveTools` 的 CCC 可见)⇒ 11。**条件可见不改变"注册"这一事实**:
43
43
  * 本常量与清单都列它(与 im-bridge 同规格)。
44
+ *
45
+ * v1.51(**D104**):新增 **`diagram`**(标签源码 → 进程内光栅化成 PNG;**缺省关**,
46
+ * 关时连 `ctx.tools.register` 都不调用)⇒ **12**。同规格:开关关着**不影响这里列它** ——
47
+ * 本常量描述的是"插件**具备**的工具面",不是"此刻注册了几个"。
44
48
  */
45
49
  const REGISTERED_TOOLS = [
46
50
  "container_fs",
@@ -53,7 +57,8 @@ const REGISTERED_TOOLS = [
53
57
  "localstore",
54
58
  "container_admin",
55
59
  "im-bridge",
56
- "acc-diag"
60
+ "acc-diag",
61
+ "diagram"
57
62
  ];
58
63
  //#endregion
59
64
  export { REGISTERED_TOOLS, verifyToolConsistency };
@@ -1,4 +1,4 @@
1
- import { r as cccRootForCwd } from "./ccc-roots-Duk89a-h.js";
1
+ import { r as cccRootForCwd } from "./ccc-roots-DtiMVRPo.js";
2
2
  import { basename, dirname, join } from "node:path";
3
3
  import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync } from "node:fs";
4
4
  //#region src/time.ts
@@ -1,3 +1,4 @@
1
+ import "node:module";
1
2
  //#region \0rolldown/runtime.js
2
3
  var __defProp = Object.defineProperty;
3
4
  var __exportAll = (all, no_symbols) => {
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { o as hostSettings } from "./access-CNccNtgf.js";
3
3
  //#region src/ports.ts
4
4
  /**
@@ -80,6 +80,7 @@ function defaultSimpleSettings() {
80
80
  publicAskEnabled: false,
81
81
  croEnabled: true,
82
82
  unattendedEnabled: false,
83
+ diagramEnabled: false,
83
84
  humanChannel: defaultHumanChannelSettings()
84
85
  };
85
86
  }
@@ -178,6 +179,7 @@ function simpleSettingsFromConfig(config) {
178
179
  publicAskEnabled: unwrapVolatile(config.publicAskEnabled) ?? d.publicAskEnabled,
179
180
  croEnabled: unwrapVolatile(config.croEnabled) ?? d.croEnabled,
180
181
  unattendedEnabled: unwrapVolatile(config.unattendedEnabled) ?? d.unattendedEnabled,
182
+ diagramEnabled: unwrapVolatile(config.diagramEnabled) ?? config.diagram?.enabled ?? d.diagramEnabled,
181
183
  humanChannel: humanChannelSettingsFromConfig(config.humanChannel)
182
184
  };
183
185
  }
@@ -69,6 +69,10 @@ interface SimpleConfigFragment {
69
69
  enabled?: boolean;
70
70
  httpPort?: number;
71
71
  };
72
+ /** diagram(实验性 demo;2026-09-29 owner 具名令 D104):标签源码 → 进程内出图(不借浏览器) */
73
+ diagram?: {
74
+ enabled?: boolean;
75
+ };
72
76
  /** human-channel(人机信道;**机器级**;2026-09-26 owner 定案):账号 / 订阅表 / 主控 / 出站白名单 */
73
77
  humanChannel?: HumanChannelConfigFragment;
74
78
  gatewayEnabled?: PanelBoolean;
@@ -80,6 +84,7 @@ interface SimpleConfigFragment {
80
84
  publicAskEnabled?: PanelBoolean;
81
85
  croEnabled?: PanelBoolean;
82
86
  unattendedEnabled?: PanelBoolean;
87
+ diagramEnabled?: PanelBoolean;
83
88
  }
84
89
  /**
85
90
  * 设置面板命名空间 = **profile 条目 id**(v0.1.7 起;与旧 `settings.yaml` 段名逐字相同)。
@@ -121,6 +126,15 @@ interface SerenitySimpleSettings {
121
126
  * —— 原"任何自排唤醒都排除"会让本机制永远够不着靠续接绳活着的维护会话;改窄后
122
127
  * **自排绳不再排除**,绳退化为**长周期保险丝**)。设计全文见 S142 的 **D77**。 */
123
128
  unattendedEnabled: boolean;
129
+ /** **diagram 工具总开关**(2026-09-29 owner 具名令 **D104**;**缺省关**)。
130
+ *
131
+ * 开启后:ACC 注册 `diagram` 工具 —— agent **直接给一段标签格式源码**,进程内
132
+ * `parseDsl → renderDsl(SVG + 四项体检)→ resvg-wasm 光栅化(内置字体)→ PNG`,
133
+ * 产物落 CCC `_tmp/diagram/` 且**图片块进对话**(**不借浏览器、不截图**)。
134
+ * **缺省关**:owner 口中的"demo 功能" ⇒ 关时**不注册**(工具不进模型工具清单:
135
+ * 零 token、不会被误调),同 `skiff`/`acp` 的"未开启零资源占用"口径。
136
+ * 依赖面:随包分发 3.8 MB 内置字体(`assets/diagram/`,wasm 对系统字体不可见)。 */
137
+ diagramEnabled: boolean;
124
138
  /** **human-channel(人机信道)机器级配置**(2026-09-26 owner 定案;P0-1 立 schema + 投影)。
125
139
  * 三张表(账号 / 订阅 / 主控)+ 出站白名单;**跨 CCC** ⇒ 归机器级,CCC 侧 `weixin.*` 随之退役
126
140
  * (退役动作在 P0-2~P0-4;本版**只立机器级面**,旧面照旧)。缺省与归一规则见
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { g as resolveInside, h as readUtf8, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS } from "./ccc-DG4Oc7I1.js";
3
3
  import { existsSync, statSync } from "node:fs";
4
4
  //#region src/skiff-role.ts
@@ -0,0 +1,2 @@
1
+ import type { Context } from 'cordis';
2
+ export declare function createDiagramTool(ctx: Context): import("@deepseek-ai/dsh-tools").ToolDefinition;
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { createCipheriv, createDecipheriv, createHash, randomBytes } from "node:crypto";
3
3
  //#region src/weixin-api.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS } from "./ccc-DG4Oc7I1.js";
3
3
  import { join, resolve } from "node:path";
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shgroup/dsh-serenity-hooks",
3
- "version": "1.50.1",
4
- "description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:11 个工具(container_fs/container_trajectory/dashboard/container_git/msm/praxis/handyman/localstore/container_admin/im-bridge/acc-diag)+ 机械约束(安全模式/工作区围墙/密钥守卫/对外输出守卫)+ 工作日志与原地重建 + 网页登录入口/微信桥/子角色/对外问答页/trajectory 唤醒注册表。适配 DSH 0.1.7-rc.1。",
3
+ "version": "1.51.0",
4
+ "description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:12 个工具(container_fs/container_trajectory/dashboard/container_git/msm/praxis/handyman/localstore/container_admin/im-bridge/acc-diag/diagram)+ 机械约束(安全模式/工作区围墙/密钥守卫/对外输出守卫)+ 工作日志与原地重建 + 网页登录入口/微信桥/子角色/对外问答页/trajectory 唤醒注册表。适配 DSH 0.1.7-rc.1。",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -31,10 +31,16 @@
31
31
  "assets/serenity-voyage.html",
32
32
  "assets/serenity-voyage-preview.png",
33
33
  "assets/README.md",
34
+ "assets/diagram/DroidSansFallbackFull.ttf",
35
+ "assets/diagram/LICENSE-Apache-2.0.txt",
36
+ "assets/diagram/PROVENANCE.md",
34
37
  "cordis.patch.yml",
35
38
  "dsh.plugin.json",
36
39
  "README.md"
37
40
  ],
41
+ "dependencies": {
42
+ "@resvg/resvg-wasm": "2.6.2"
43
+ },
38
44
  "scripts": {
39
45
  "typecheck": "tsc --noEmit",
40
46
  "test": "vitest run",