@shgroup/dsh-serenity-hooks 1.119.0 → 1.120.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 +1 -1
- package/lib/{contract-qqnsi8tc.js → contract-C-UR4xdI.js} +19 -6
- package/lib/index.js +11 -13
- package/lib/{observation-Ci2SBIX2.js → observation-BfGhRr78.js} +1 -1
- package/lib/patches/web-fetch.d.ts +29 -11
- package/lib/{service-8KAznyDu.js → service-B7ND7xKf.js} +1 -1
- package/package.json +2 -2
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-serenity-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.120.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):给 DSH 装一个「AI 工作区」——12 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin;另两个 im-bridge/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": {
|
|
@@ -1429,21 +1429,34 @@ function forgetImBridgeVisibility(_sessionId) {}
|
|
|
1429
1429
|
/** 会话销毁清理(lifecycle 调用)——方案 C 后由统一清理撤销,这里保留语义占位。 */
|
|
1430
1430
|
function forgetHostScheduleToolHiding(_sessionId) {}
|
|
1431
1431
|
/**
|
|
1432
|
-
* 宿主 `dsh-tool-schedule`
|
|
1432
|
+
* 宿主 `dsh-tool-schedule` 注册的模型可见工具名(**逐字**)。
|
|
1433
1433
|
*
|
|
1434
1434
|
* 🔴 **为什么要在 CCC 内屏蔽**(owner 原话:「这和 CRO 冲突,要求在宁静号激活情况下屏蔽掉」):
|
|
1435
1435
|
* 宁静号的唤醒/巡航走 `cognitive_trajectory send-later` → `AGENT_SESSIONS/wake-registry.json`
|
|
1436
1436
|
* → 中心调度器 5min tick(D58)。宿主这套定时器是**另一个**真相源 ⇒ 两处记账、
|
|
1437
1437
|
* CRO 判据失真、且模型可能顺手排一个"不在任何账本里"的唤醒。
|
|
1438
|
-
*
|
|
1439
|
-
*
|
|
1440
|
-
*
|
|
1438
|
+
*
|
|
1439
|
+
* 🔴🔴 **2026-11-06(S142):宿主 0.2.2-rc.1 把这套工具改了名,本表没跟上 ⇒ 屏蔽漏了一半**。
|
|
1440
|
+
* 实测(`msm sys node` 读本机装机包的 `lib/index.js`,⛔ 非推断):
|
|
1441
|
+
* | 宿主版本 | `dsh-tool-schedule` 真实注册名 |
|
|
1442
|
+
* |---|---|
|
|
1443
|
+
* | `0.2.1-rc.2` | `schedule_create` / `schedule_list` / `schedule_update` / `schedule_delete` |
|
|
1444
|
+
* | `0.2.2-rc.1` | `schedule_create` / `schedule_list` / **`schedule_view`** / **`schedule_edit`** |
|
|
1445
|
+
* ⇒ `schedule_update` / `schedule_delete` **已不存在**(写在本表里=永远剔不掉的无效名),
|
|
1446
|
+
* 而 `schedule_view` / `schedule_edit` **从未被屏蔽**(用户在会话里能直接看到并调用它们)。
|
|
1447
|
+
* **失效形态是静默的**:宿主 `restrict()` 对未知名只会**剔除**(我们那边的降级档还会打
|
|
1448
|
+
* 「跳过 N 个未注册名」),所以"旧名失效+新名漏网"在读数面上表现为**一切正常**。
|
|
1449
|
+
* ⇒ 判据:**这张表是宿主侧的名字,宿主改名必须同批改这里**;升级宿主后要**真机核一次工具面**
|
|
1450
|
+
* (会话里能不能看见 `schedule_*`),⛔ 不能只信单元测试——它测的是本表,本表错了它也绿。
|
|
1451
|
+
* ⚠️ 本清单**合并发射时不做探活**。⚠️ 现状缺口(v1.87.1 如实登记):宿主**没装**
|
|
1452
|
+
* `dsh-tool-schedule` 时,这些名字会把整次 restrict 拒掉,而退档只保留 ACC 自己的名字
|
|
1453
|
+
* ⇒ 这一格的屏蔽**不生效**(旧实现同样不生效,**未回归**;但"顺带修好了"这句是假的,已删)。
|
|
1441
1454
|
*/
|
|
1442
1455
|
const HOST_SCHEDULE_TOOL_NAMES = [
|
|
1443
1456
|
"schedule_create",
|
|
1444
1457
|
"schedule_list",
|
|
1445
|
-
"
|
|
1446
|
-
"
|
|
1458
|
+
"schedule_view",
|
|
1459
|
+
"schedule_edit"
|
|
1447
1460
|
];
|
|
1448
1461
|
/** 会话销毁清理(lifecycle 调用)。
|
|
1449
1462
|
* ⚠️ 方案 C 后撤销只在 `forgetToolVisibility` 做一次;本函数保留语义占位。
|
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { _ as resolveInside, a as findSerenityRoot$1, d as readCccName, h as rea
|
|
|
4
4
|
import { A as useSession, C as resolveSessionByTitle, D as showSession, E as setActiveSessionInfo, F as isoLocal, I as localFileStamp, M as TRAJECTORY_LEGACY_FILENAMES, O as summarize, S as readTrajectoryUid, T as sessionsRoot, _ as listSessions, b as parseTrajectoryCode, c as UID_FILENAME, d as createSession, f as extractSessionMdPathFromText, j as TRAJECTORY_FILENAME, k as trajectoryDescOf, l as archiveSession, m as getActiveSessionInfo, o as COGNITIVE_TRAJECTORY_ACTIONS, p as findSession, u as clearActiveSessionInfo, v as namingTitleFor, w as sessionEvents, y as parseSessionContextFromEvents } from "./bind-file-B0TuOP89.js";
|
|
5
5
|
import { n as checkLocalstoreGitCompliance, o as readStore, s as runLocalStore, t as LOCALSTORE_SCOPES } from "./service-Dv-8E2bI.js";
|
|
6
6
|
import { d as findPackageRoot, i as constraintSystemPromptSource, l as resolveConstraintSystemPrompt, r as constraintCognitiveTrajectory, t as TRAJECTORY_CONSTRAINT_HINT, u as ACC_VERSION } from "./rules-DKlpuFN_.js";
|
|
7
|
-
import { C as docsPointer, S as runMsmAsync, _ as CCC_CONFIG_REFERENCE, a as setSafeMode, b as loadMsmEntries, d as forgetNonCccToolVisibility, g as ACC_CATALOG, h as forgetToolVisibility, i as readDshVersion, m as syncToolVisibility, n as summarizeHostContract, o as listOpencodeSkillDirs, p as registerGuards, r as getStatus, s as loadOpencodeSkill, t as hostContractReport, w as setWeixinSendEndpoint, x as runMsm, y as findEntry } from "./contract-
|
|
7
|
+
import { C as docsPointer, S as runMsmAsync, _ as CCC_CONFIG_REFERENCE, a as setSafeMode, b as loadMsmEntries, d as forgetNonCccToolVisibility, g as ACC_CATALOG, h as forgetToolVisibility, i as readDshVersion, m as syncToolVisibility, n as summarizeHostContract, o as listOpencodeSkillDirs, p as registerGuards, r as getStatus, s as loadOpencodeSkill, t as hostContractReport, w as setWeixinSendEndpoint, x as runMsm, y as findEntry } from "./contract-C-UR4xdI.js";
|
|
8
8
|
import { c as replacesDefaultIdentity, i as listTrajectoryConstraints, l as trajectoryCodeForSession, n as findDirNameByCode, o as readTrajectoryConstraintAt, r as isTrajectoryConstrained, s as readTrajectoryConstraintByCode, t as TRAJECTORY_CONSTRAINT_FILENAME } from "./profile-Djqz4Noy.js";
|
|
9
9
|
import { A as TRAJECTORY_PROMPT_FILENAME, C as recordToolUsage, D as buildResourceNameSuffix, E as buildResourceIndex, O as isSafeSkillName, S as verifyTotpCode, T as SKILL_ONTOLOGY_FILE, _ as projectKnownWorkspaces, a as trajectoryConstraintFor, b as FACE_PORTS, c as trajectoryWorkspaceMdPath, d as splitModel, f as registerCognitiveTrajectorySkillSection, g as migrateLegacyLocalstore, h as applyWirePatch, i as getTrajectoryAgent, j as hasTrajectoryPrompt, k as truncateContent, l as unregisterTrajectorySession, m as registerEntrySkillSectionGlobal, n as deliverToTrajectory, o as trajectoryConstraintMsmGate, p as registerEntrySkillSection, r as ensureWorkspacePromptSection, s as trajectoryConstraintParticipates, t as createTrajectoryAgent, u as workspaceCognitiveTrajectoryLine, v as readAdvancedSettings, w as REFERENCE_DIR, x as MECHANISM_PORTS, y as toWire } from "./session-C4AzKUh_.js";
|
|
10
10
|
import { a as ACC_MESSAGE_KIND, d as readLastBound, f as resolveSessionCognitiveTrajectoryLabel, i as toMessage, l as findTrajectoryOfSession, n as deliver, o as PLUGIN_SOURCE, r as makeInjection, s as appendBound } from "./injection-B5jZxemg.js";
|
|
@@ -515,7 +515,7 @@ const KIT_ACTIONS = [
|
|
|
515
515
|
async function runKit(root, args, hostCtx) {
|
|
516
516
|
switch (args.action) {
|
|
517
517
|
case "health": {
|
|
518
|
-
const { containerStatus } = await import("./observation-
|
|
518
|
+
const { containerStatus } = await import("./observation-BfGhRr78.js");
|
|
519
519
|
const s = containerStatus({
|
|
520
520
|
root,
|
|
521
521
|
hostCtx
|
|
@@ -561,7 +561,7 @@ async function runKit(root, args, hostCtx) {
|
|
|
561
561
|
}
|
|
562
562
|
case "diag": {
|
|
563
563
|
if (hostCtx === void 0) throw new Error("diag requires the plugin context (live session data unavailable without it)");
|
|
564
|
-
const { runDiag, renderDiag } = await import("./service-
|
|
564
|
+
const { runDiag, renderDiag } = await import("./service-B7ND7xKf.js");
|
|
565
565
|
return renderDiag(await runDiag(hostCtx, root ?? ""));
|
|
566
566
|
}
|
|
567
567
|
default: throw new Error(`Unknown action: ${args.action}`);
|
|
@@ -16462,9 +16462,13 @@ function isAllowedFetchAddress(address) {
|
|
|
16462
16462
|
return false;
|
|
16463
16463
|
}
|
|
16464
16464
|
/**
|
|
16465
|
-
*
|
|
16465
|
+
* 解析并校验地址集合(本模块自带的 {@link FetchResolver} 契约)。
|
|
16466
16466
|
*
|
|
16467
|
-
*
|
|
16467
|
+
* ⚠️ **前身是宿主的 `HttpFetchResolver`,但那个类型在 0.2.2-rc.1 已随地址解析层一起被删除**
|
|
16468
|
+
* (见文件头)。这里的语义沿用它,⛔ 但别再说"这是宿主契约" —— 那会让下一个维护者
|
|
16469
|
+
* 去宿主里找一个不存在的类型(D151:退役功能的残留引用是零信号熵)。
|
|
16470
|
+
*
|
|
16471
|
+
* 语义:**任一地址不合法即整体拒绝**(防 DNS 重绑定),
|
|
16468
16472
|
* 仅判据从「公网单播」放宽为 `isAllowedFetchAddress`。
|
|
16469
16473
|
*/
|
|
16470
16474
|
const resolveAllowedAddresses = async (hostname, signal) => {
|
|
@@ -16508,13 +16512,6 @@ async function lookupAll(hostname, signal) {
|
|
|
16508
16512
|
lookupPromise.catch(() => void 0);
|
|
16509
16513
|
}
|
|
16510
16514
|
}
|
|
16511
|
-
/**
|
|
16512
|
-
* 注册接管 `http` id 的 fetch provider(宿主内置 provider 由本包 bundle patch 禁用)。
|
|
16513
|
-
*
|
|
16514
|
-
* 后端包 `@deepseek-ai/dsh-web-fetch-http` 用**动态 import**:宿主版本里若没有该包,
|
|
16515
|
-
* 只降级为一条告警(绝不因缺一个可选后端而让整机启动失败——apply 抛错 = dsh 启动失败)。
|
|
16516
|
-
* 失败一律响亮但不抛错。
|
|
16517
|
-
*/
|
|
16518
16515
|
async function registerWebFetchProvider(ctx) {
|
|
16519
16516
|
const web = hostWeb(ctx);
|
|
16520
16517
|
if (typeof web?.registerFetchProvider !== "function") {
|
|
@@ -16527,7 +16524,8 @@ async function registerWebFetchProvider(ctx) {
|
|
|
16527
16524
|
...FETCH_LIMIT_DEFAULTS,
|
|
16528
16525
|
userAgent: backend.DEFAULT_USER_AGENT
|
|
16529
16526
|
};
|
|
16530
|
-
|
|
16527
|
+
const Provider = backend.HttpFetchProvider;
|
|
16528
|
+
web.registerFetchProvider(new Provider(limits, resolveAllowedAddresses));
|
|
16531
16529
|
console.log(`[serenity-hooks] ✓ web fetch provider 已接管(id=${backend.LOCAL_FETCH_PROVIDER_ID},额外放行 fake-ip 段 198.18.0.0/15)`);
|
|
16532
16530
|
} catch (error) {
|
|
16533
16531
|
console.error(`[serenity-hooks] ✗ web fetch provider 注册失败(web_fetch 将不可用): ${String(error?.message ?? error)}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as readCccName, i as findGitRoot, l as pathInside, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS } from "./ccc-x94FCzOv.js";
|
|
2
2
|
import { u as ACC_VERSION } from "./rules-DKlpuFN_.js";
|
|
3
|
-
import { i as readDshVersion, t as hostContractReport, v as checkRegistryQuality } from "./contract-
|
|
3
|
+
import { i as readDshVersion, t as hostContractReport, v as checkRegistryQuality } from "./contract-C-UR4xdI.js";
|
|
4
4
|
import { i as wakeSchedulerState, v as listWakes } from "./scheduler-CUPz7geH.js";
|
|
5
5
|
import { resolve } from "node:path";
|
|
6
6
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
@@ -23,7 +23,27 @@
|
|
|
23
23
|
* 配额、二进制拒绝全部仍由宿主实现执行。
|
|
24
24
|
*/
|
|
25
25
|
import type { Context } from 'cordis';
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* 🔴 **0.2.2-rc.1 适配(2026-11-05,S142)**:宿主导出的 `HttpFetchResolver` 类型被**删除**了。
|
|
28
|
+
*
|
|
29
|
+
* 不是改名,是**整层消失**:`0.2.1-rc.2` 的 `provider.d.ts:24` 有
|
|
30
|
+
* `export type HttpFetchResolver = (hostname, signal) => Promise<PublicAddress[]>`,
|
|
31
|
+
* 而 `0.2.2-rc.1` 的同名文件里**没有这个导出**(同时 `network.ts` / `isPublicIpAddress` /
|
|
32
|
+
* `createPinnedLookup` 也一起消失,构造器从 `(limits, resolveAddresses?)` 缩成 `(limits)`)。
|
|
33
|
+
* 上游 README 已明写新立场:「It does not restrict destination addresses」。
|
|
34
|
+
*
|
|
35
|
+
* ⇒ 本模块**在 0.2.2+ 上已无存在理由**(它当年唯一的作用就是放宽那条地址判据)。
|
|
36
|
+
* 但**旧宿主(0.1.7 / 0.2.0 / 0.2.1)仍在支持档里**,而它们真的会拦 fake-ip
|
|
37
|
+
* ⇒ 不能现在删。故此处**自带一份结构等价的契约**,⛔ 不再从宿主 import 那个已消失的类型。
|
|
38
|
+
*
|
|
39
|
+
* ⚠️ 退役条件(写给下一个我):当 `VERIFIED_HOST_BANDS` 的下界抬到 `0.2.2` 之上时,
|
|
40
|
+
* **本文件连同 `cordis.patch.yml` 的 `disabled: true` 一起整块删除** —— 留着的每一天都是
|
|
41
|
+
* 一份「没人需要、但将来会漂」的代码。
|
|
42
|
+
*/
|
|
43
|
+
type FetchResolver = (hostname: string, signal: AbortSignal) => Promise<Array<{
|
|
44
|
+
address: string;
|
|
45
|
+
family: 4 | 6;
|
|
46
|
+
}>>;
|
|
27
47
|
/** 公网单播 IPv4(拒绝全部保留/私网段——与宿主判定口径一致,只额外放行 fake-ip) */
|
|
28
48
|
export declare function isPublicV4(address: string): boolean;
|
|
29
49
|
/** fake-ip 段判定(198.18.0.0/15) */
|
|
@@ -36,17 +56,15 @@ export declare function isPublicV6(address: string): boolean;
|
|
|
36
56
|
/** 该地址是否允许被抓取:公网单播 **或** fake-ip 段 */
|
|
37
57
|
export declare function isAllowedFetchAddress(address: string): boolean;
|
|
38
58
|
/**
|
|
39
|
-
*
|
|
59
|
+
* 解析并校验地址集合(本模块自带的 {@link FetchResolver} 契约)。
|
|
40
60
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
export declare const resolveAllowedAddresses: HttpFetchResolver;
|
|
45
|
-
/**
|
|
46
|
-
* 注册接管 `http` id 的 fetch provider(宿主内置 provider 由本包 bundle patch 禁用)。
|
|
61
|
+
* ⚠️ **前身是宿主的 `HttpFetchResolver`,但那个类型在 0.2.2-rc.1 已随地址解析层一起被删除**
|
|
62
|
+
* (见文件头)。这里的语义沿用它,⛔ 但别再说"这是宿主契约" —— 那会让下一个维护者
|
|
63
|
+
* 去宿主里找一个不存在的类型(D151:退役功能的残留引用是零信号熵)。
|
|
47
64
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* 失败一律响亮但不抛错。
|
|
65
|
+
* 语义:**任一地址不合法即整体拒绝**(防 DNS 重绑定),
|
|
66
|
+
* 仅判据从「公网单播」放宽为 `isAllowedFetchAddress`。
|
|
51
67
|
*/
|
|
68
|
+
export declare const resolveAllowedAddresses: FetchResolver;
|
|
52
69
|
export declare function registerWebFetchProvider(ctx: Context): Promise<void>;
|
|
70
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import { F as isoLocal, w as sessionEvents } from "./bind-file-B0TuOP89.js";
|
|
|
4
4
|
import { g as WAKE_CATCH_UP_MS, m as listCroCognitiveTrajectories } from "./scheduler-CUPz7geH.js";
|
|
5
5
|
import { n as readSimpleSettings } from "./settings-DibHCfEU.js";
|
|
6
6
|
import { i as subscriptionStats, r as subscriptionEval } from "./subscriptions-CGpxv6Z6.js";
|
|
7
|
-
import { containerClocks, containerWakes } from "./observation-
|
|
7
|
+
import { containerClocks, containerWakes } from "./observation-BfGhRr78.js";
|
|
8
8
|
//#region src/trajectory/live.ts
|
|
9
9
|
/**
|
|
10
10
|
* trajectory/live.ts — 进程内 live 会话取数 + 精简诊断
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.120.0",
|
|
4
4
|
"description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:12 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin;另两个 im-bridge/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(三档)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"typecheck": "tsc --noEmit",
|
|
53
53
|
"test": "vitest run",
|
|
54
54
|
"build": "tsdown -c tsdown.config.ts && tsc -p tsconfig.json --emitDeclarationOnly",
|
|
55
|
-
"prepare": "tsdown --config tsdown.prepare.config.ts && tsc -p tsconfig.json --emitDeclarationOnly"
|
|
55
|
+
"prepare": "tsdown --config tsdown.prepare.config.ts --config-loader unrun && tsc -p tsconfig.json --emitDeclarationOnly"
|
|
56
56
|
},
|
|
57
57
|
"dsh": {
|
|
58
58
|
"bundle": {
|