@shgroup/dsh-serenity-hooks 1.137.16 → 1.137.18
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-B0uRA4S2.js → contract-Mxgh_fl4.js} +12 -8
- package/lib/index.js +3 -3
- package/lib/{observation-L-KQr5RL.js → observation-8iVgMHVC.js} +1 -1
- package/lib/{service-BZwjW8JL.js → service-CWNPCS5c.js} +1 -1
- package/lib/tools/msm/service.d.ts +6 -0
- package/lib/trajectory/carrier-log.d.ts +19 -0
- package/package.json +1 -1
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-serenity-hooks",
|
|
3
|
-
"version": "1.137.
|
|
3
|
+
"version": "1.137.18",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):给 DSH 装一个「AI 工作区」——13 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin/browser_slot;另两个 im-bridge/diagram 按条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表 + 浏览器槽位管理(≤20 个独立 profile 的 Chrome 槽位,带占用归属与异常时向所属会话反向注入提醒)。轨迹声明 = 轨迹目录下的 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": {
|
|
@@ -74,20 +74,24 @@ function docsPointer(chapter, what) {
|
|
|
74
74
|
const execFileAsync = promisify(execFile);
|
|
75
75
|
const MSM_TIMEOUT_MS = 6e5;
|
|
76
76
|
const BUN_EXE_CANDIDATES = [
|
|
77
|
-
() => join(process.env["USERPROFILE"] ?? process.env["HOME"] ?? "", ".bun", "bin", "bun.exe"),
|
|
77
|
+
() => join(process.env["SERENITY_BUN"] ?? join(process.env["USERPROFILE"] ?? process.env["HOME"] ?? "", ".bun", "bin"), platform$1 === "win32" ? "bun.exe" : "bun"),
|
|
78
78
|
() => join(process.env["APPDATA"] ?? "", "npm", "node_modules", "bun", "bin", "bun.exe"),
|
|
79
|
-
() => join(process.env["LOCALAPPDATA"] ?? "", "npm", "node_modules", "bun", "bin", "bun.exe")
|
|
79
|
+
() => join(process.env["LOCALAPPDATA"] ?? "", "npm", "node_modules", "bun", "bin", "bun.exe"),
|
|
80
|
+
() => "/usr/local/bin/bun",
|
|
81
|
+
() => "/usr/bin/bun"
|
|
80
82
|
];
|
|
81
83
|
let bunExeCache;
|
|
84
|
+
/**
|
|
85
|
+
* 🔴 **导出供机械判据用**(2026-11-22):这行缺陷的形态是"非 Windows 分支恒返回裸名",
|
|
86
|
+
* 而它**在回执上完全看不出来**(走 npx 兜底时 MSM 照样正常返回)。
|
|
87
|
+
* ⇒ 判据必须是**直接读这个函数**,⛔ 不是读某次调用的回执,也⛔ 不是在测试里复刻探测逻辑。
|
|
88
|
+
*/
|
|
82
89
|
function bunExecutablePath() {
|
|
83
90
|
if (bunExeCache !== void 0) return bunExeCache;
|
|
84
|
-
if (platform$1 !== "win32") {
|
|
85
|
-
bunExeCache = "bun";
|
|
86
|
-
return bunExeCache;
|
|
87
|
-
}
|
|
88
91
|
for (const cand of BUN_EXE_CANDIDATES) try {
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
const p = cand();
|
|
93
|
+
if (p !== "" && existsSync(p)) {
|
|
94
|
+
bunExeCache = p;
|
|
91
95
|
return bunExeCache;
|
|
92
96
|
}
|
|
93
97
|
} catch {}
|
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { a as findSerenityRoot$1, d as readCccName, g as resolveInside, l as pat
|
|
|
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, 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-Dy6Qmm7z.js";
|
|
5
5
|
import { n as checkLocalstoreGitCompliance, o as readStore, s as runLocalStore, t as LOCALSTORE_SCOPES } from "./service-BRUHmVFn.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-BYeykzys.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-Mxgh_fl4.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-CRcW3ifg.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-BMaTNjK1.js";
|
|
10
10
|
import { 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, u as listBoundSessionIds } from "./injection-ME-aoZVl.js";
|
|
@@ -514,7 +514,7 @@ const KIT_ACTIONS = [
|
|
|
514
514
|
async function runKit(root, args, hostCtx) {
|
|
515
515
|
switch (args.action) {
|
|
516
516
|
case "health": {
|
|
517
|
-
const { containerStatus } = await import("./observation-
|
|
517
|
+
const { containerStatus } = await import("./observation-8iVgMHVC.js");
|
|
518
518
|
const s = containerStatus({
|
|
519
519
|
root,
|
|
520
520
|
hostCtx
|
|
@@ -560,7 +560,7 @@ async function runKit(root, args, hostCtx) {
|
|
|
560
560
|
}
|
|
561
561
|
case "diag": {
|
|
562
562
|
if (hostCtx === void 0) throw new Error("diag requires the plugin context (live session data unavailable without it)");
|
|
563
|
-
const { runDiag, renderDiag } = await import("./service-
|
|
563
|
+
const { runDiag, renderDiag } = await import("./service-CWNPCS5c.js");
|
|
564
564
|
return renderDiag(await runDiag(hostCtx, root ?? ""));
|
|
565
565
|
}
|
|
566
566
|
default: throw new Error(`Unknown action: ${args.action}`);
|
|
@@ -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-DSMqTrRU.js";
|
|
2
2
|
import { u as ACC_VERSION } from "./rules-BYeykzys.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-Mxgh_fl4.js";
|
|
4
4
|
import { a as wakeSchedulerState, p as listWakes } from "./scheduler-pOtONqPy.js";
|
|
5
5
|
import { resolve } from "node:path";
|
|
6
6
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
@@ -4,7 +4,7 @@ import { F as isoLocal, w as sessionEvents } from "./bind-file-Dy6Qmm7z.js";
|
|
|
4
4
|
import { d as WAKE_CATCH_UP_MS, l as listCroCognitiveTrajectories } from "./scheduler-pOtONqPy.js";
|
|
5
5
|
import { n as readSimpleSettings } from "./settings-YC-csZus.js";
|
|
6
6
|
import { i as subscriptionStats, r as subscriptionEval } from "./subscriptions-DBoO0GSO.js";
|
|
7
|
-
import { containerClocks, containerWakes } from "./observation-
|
|
7
|
+
import { containerClocks, containerWakes } from "./observation-8iVgMHVC.js";
|
|
8
8
|
//#region src/trajectory/live.ts
|
|
9
9
|
/**
|
|
10
10
|
* trajectory/live.ts — 进程内 live 会话取数 + 精简诊断
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
* 复用 CCC 的 mech-registry.json(v1 或数组格式)。cwd 钉在 CCC 根。
|
|
6
6
|
*/
|
|
7
7
|
import type { JsonValue } from '../../kernel/json.js';
|
|
8
|
+
/**
|
|
9
|
+
* 🔴 **导出供机械判据用**(2026-11-22):这行缺陷的形态是"非 Windows 分支恒返回裸名",
|
|
10
|
+
* 而它**在回执上完全看不出来**(走 npx 兜底时 MSM 照样正常返回)。
|
|
11
|
+
* ⇒ 判据必须是**直接读这个函数**,⛔ 不是读某次调用的回执,也⛔ 不是在测试里复刻探测逻辑。
|
|
12
|
+
*/
|
|
13
|
+
export declare function bunExecutablePath(): string | null;
|
|
8
14
|
type MsmAction = 'list' | 'exec' | 'register' | 'deregister' | 'check' | 'guide' | 'ccc-config' | 'catalog';
|
|
9
15
|
export declare const MSM_ACTIONS: readonly MsmAction[];
|
|
10
16
|
/**
|
|
@@ -103,6 +103,25 @@ export declare function extractHandoverNote(text: string): string | null;
|
|
|
103
103
|
* (人可能续写、模板可能先占位),所以正确做法是**全搬**,不是"规定只能有一个"。
|
|
104
104
|
*/
|
|
105
105
|
export declare function extractAllHandoverNotes(text: string): string[];
|
|
106
|
+
/**
|
|
107
|
+
* 标出「哪些行在代码围栏内」(`mask[行号] === true` 表示该行属于围栏内容)。
|
|
108
|
+
*
|
|
109
|
+
* ## 🔴 未闭合围栏的处置(这条是判据,⛔ 不是实现细节)
|
|
110
|
+
*
|
|
111
|
+
* 围栏开着却一直没闭合(写到一半被中断、或围栏标记只是长得像),**怎么办**:
|
|
112
|
+
*
|
|
113
|
+
* | 选法 | 后果 |
|
|
114
|
+
* |---|---|
|
|
115
|
+
* | 认为"后面全在围栏内" | **整个文件剩余部分都会被吞进便签节** ⇒ 新代 = 旧代,轮转被架空 |
|
|
116
|
+
* | ✅ **只有真正闭合的围栏才算围栏** | 未闭合处标题照常当边界 ⇒ **宁可少搬,不可错搬大段** |
|
|
117
|
+
*
|
|
118
|
+
* ⇒ 取后者。判据与本仓反复出现的那条同向:**残缺的长文档比短的完整文档危险得多**;
|
|
119
|
+
* 而这里更严重 —— 吞掉的是别人的正文,且没有任何读数会说出来。
|
|
120
|
+
*
|
|
121
|
+
* ⚠️ 实现要点:**两遍**。第一遍只认**已闭合**的围栏(配对成功才标记);
|
|
122
|
+
* 到文件尾仍未闭合的开围栏,**整段不标记** ⇒ 其中的标题照常当边界。
|
|
123
|
+
*/
|
|
124
|
+
export declare function fencedLineMask(lines: readonly string[], scanFrom: number): boolean[];
|
|
106
125
|
/**
|
|
107
126
|
* 便签节的**体量上限**(行数,`AC` 兜底,⛔ 不指望每条轨迹都把便签写短)。
|
|
108
127
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.137.
|
|
3
|
+
"version": "1.137.18",
|
|
4
4
|
"description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:13 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin/browser_slot;另两个 im-bridge/diagram 按条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫/对外输出守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表 + 浏览器槽位管理(≤20 个独立 profile 的 Chrome 槽位,带占用归属与异常时向所属会话反向注入提醒)。轨迹声明 = 轨迹目录下的 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": {
|