@shgroup/dsh-serenity-hooks 1.16.7 → 1.16.8
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/index.js +14 -8
- 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.16.
|
|
3
|
+
"version": "1.16.8",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):真实 DSH 工具 cc_fs/session/acc_msm/eap/neat/cce/loop + 拦截缝机械约束(safe-mode/路径守卫/会话落盘)。适配 DSH 公开版(0.1.0-rc,deepseek-ai/deepseek-harness)。私有(dsh-external 组织)。",
|
|
6
6
|
"engines": {
|
package/lib/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { randomBytes, randomUUID } from "node:crypto";
|
|
|
12
12
|
/**
|
|
13
13
|
* ccc.ts — CCC 纯逻辑层(零 DSH 依赖,可独立单测)
|
|
14
14
|
*
|
|
15
|
-
* 职责:CCC 根检测(P1)、git 检测(P2
|
|
15
|
+
* 职责:CCC 根检测(P1)、git 检测(P2)、serenity.json 配置读取(.opencode 规范位置,.dsh 回退)、
|
|
16
16
|
* 路径守卫(P3 语义)、安全模式黑名单匹配。
|
|
17
17
|
*
|
|
18
18
|
* 由 tools/ 与 seams/ 复用;逻辑移植自 dsh-serenity-plugin v0.1-v0.2
|
|
@@ -66,7 +66,11 @@ function resolveInside(root, p) {
|
|
|
66
66
|
if (classifyPath(abs, root) === "outside") throw new Error(`Path escape blocked: "${p}" resolves outside "${root}"`);
|
|
67
67
|
return abs;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* ACC 依赖的 CCC 配置路径(S134 修正:兼容历史——历史在 .opencode,规范位置 = .opencode;
|
|
71
|
+
* .dsh 仅作 dsh 运行时回退,不优先)。
|
|
72
|
+
*/
|
|
73
|
+
const DEFAULT_SERENITY_CONFIG_PATHS = [".opencode/serenity.json", ".dsh/serenity.json"];
|
|
70
74
|
function loadSerenityConfig(root, paths = DEFAULT_SERENITY_CONFIG_PATHS) {
|
|
71
75
|
for (const candidate of paths) {
|
|
72
76
|
const p = resolve(root, candidate);
|
|
@@ -1389,7 +1393,7 @@ const kitTool = defineTool({
|
|
|
1389
1393
|
* (JSON 格式——方便 MSM 直接 read + JSON.parse 读取,零解析依赖)。
|
|
1390
1394
|
*
|
|
1391
1395
|
* git 提交策略(可靠机制 × 用户自由):
|
|
1392
|
-
* - 配置:.
|
|
1396
|
+
* - 配置:.opencode/serenity.json `localstore.gitTrack`: "allow"(可提交)| "deny"(禁提交)
|
|
1393
1397
|
* - **缺省 deny(没配就是不提交)**;且 deny 的保证**不依赖 dsh 运行**——
|
|
1394
1398
|
* 写入时自动确保 .gitignore 含 localstore.json(物理保证:即使 dsh 不在、
|
|
1395
1399
|
* 用户手动 git commit 也不会误提交),cc_git 检查为第二道防线(拒绝 + 提示)
|
|
@@ -1558,7 +1562,7 @@ function docText(root) {
|
|
|
1558
1562
|
`存储于 CCC 根根目录 ${path}(JSON 格式,MSM 可直接 read + JSON.parse)。`,
|
|
1559
1563
|
"",
|
|
1560
1564
|
"## git 提交策略",
|
|
1561
|
-
"- 配置:.
|
|
1565
|
+
"- 配置:.opencode/serenity.json `localstore.gitTrack`:`\"allow\"`(可提交)| `\"deny\"`(禁提交;.dsh 回退)",
|
|
1562
1566
|
"- **缺省 deny(没配就是不提交)**;deny 时写入会自动确保 .gitignore 含 localstore.json",
|
|
1563
1567
|
" (物理保证,不依赖 dsh 运行);cc_git commit 会检查拒绝",
|
|
1564
1568
|
"- 想提交:配置 `\"localstore\": { \"gitTrack\": \"allow\" }`,并从 .gitignore 移除 localstore.json",
|
|
@@ -2245,7 +2249,7 @@ function lastAssistantText(agent) {
|
|
|
2245
2249
|
function createLoopTool(ctx) {
|
|
2246
2250
|
return defineTool({
|
|
2247
2251
|
name: "loop",
|
|
2248
|
-
description: "牛马循环(老 loop 等效):用指定模型创建专用 agent 反复执行任务直到完成。\n用法:loop 接受 task(要完成的目标)或依赖 session 上下文;模型缺省读 .
|
|
2252
|
+
description: "牛马循环(老 loop 等效):用指定模型创建专用 agent 反复执行任务直到完成。\n用法:loop 接受 task(要完成的目标)或依赖 session 上下文;模型缺省读 .opencode/serenity.json 的 loop.defaultModel(当前 minimax-cn-coding-plan/MiniMax-M3,廉价牛马)。\n行为:内部硬性 while 循环驱动 agent 逐轮推进任务,每轮等待无超时(agent 工作多久等多久)。唯一完成条件 = agent 精确回显本轮随机完成码(stop token),防止低智能模型提前结束。轮次不需要调用者指定——对话轮次**无上限**(不完成不返回),agent 非正常停止时自动重启(重启 ≤100 次,防死循环保险阀)。\n进度:写入 AGENT_SESSIONS/loop-<label>.md/.json;同 label 再次调用从上次轮次续跑(不重做)。\n约束:loop agent 受完整 Serenity 约束(ACC 身份/入口技能系统提示词/守卫/session-keeper)。\n示例:loop 执行「扫描 SQC 并修复 DC 问题」,label: sqc-scan",
|
|
2249
2253
|
parameters: {
|
|
2250
2254
|
task: {
|
|
2251
2255
|
type: "string",
|
|
@@ -2274,7 +2278,7 @@ function createLoopTool(ctx) {
|
|
|
2274
2278
|
if (!root) throw new Error("No CCC found: no .serenity file from agent cwd");
|
|
2275
2279
|
const cfg = loadSerenityConfig(root, DEFAULT_SERENITY_CONFIG_PATHS);
|
|
2276
2280
|
const model = args.model ?? cfg.loop?.defaultModel;
|
|
2277
|
-
if (!model) throw new Error("loop 需要 model:传参或配置 .
|
|
2281
|
+
if (!model) throw new Error("loop 需要 model:传参或配置 .opencode/serenity.json loop.defaultModel");
|
|
2278
2282
|
const label = args.label;
|
|
2279
2283
|
if (!ctx.agentLoop) throw new Error("loop: ctx.agentLoop 不可用");
|
|
2280
2284
|
const { provider, model: modelName } = splitModel(model);
|
|
@@ -2413,7 +2417,7 @@ function renderText(value) {
|
|
|
2413
2417
|
}
|
|
2414
2418
|
const localstoreTool = defineTool({
|
|
2415
2419
|
name: "localstore",
|
|
2416
|
-
description: "ACC 标准本地凭据/配置存储:一个工具管理两个命名空间 credential(凭据)与 config(本地偏好)。存储于 CCC 根根目录 localstore.json(JSON 格式,MSM 可直接读取)。git 策略:.
|
|
2420
|
+
description: "ACC 标准本地凭据/配置存储:一个工具管理两个命名空间 credential(凭据)与 config(本地偏好)。存储于 CCC 根根目录 localstore.json(JSON 格式,MSM 可直接读取)。git 策略:.opencode/serenity.json localstore.gitTrack(allow 可提交 / deny 禁提交,缺省 deny;.dsh 回退)——deny 时写入自动确保 .gitignore 含该文件(物理保证),cc_git commit 会检查拒绝。子命令:list(列 key,凭据不返回值)/ get <name>(读值)/ set <name> <value>(写)/ unset <name>(删)/ show <name>(元数据,凭据不打印值)/ doc(输出存储规范——路径/格式/key 规范/git 策略,agent 可按说明直接用 read/write 操作文件)。默认 scope=credential;config 需传 --scope config(路径为 section.key,如 loop.defaultModel)。",
|
|
2417
2421
|
parameters: {
|
|
2418
2422
|
action: {
|
|
2419
2423
|
type: "string",
|
|
@@ -2656,7 +2660,9 @@ function accBlock(root) {
|
|
|
2656
2660
|
" neat — return the full Neat design collaboration protocol",
|
|
2657
2661
|
" cce — return the full Cognitive Continuity Engineering framework",
|
|
2658
2662
|
" loop — 牛马循环:指定模型专用 agent 反复执行",
|
|
2659
|
-
" localstore — ACC 本地凭据/配置存储(
|
|
2663
|
+
" localstore — ACC 本地凭据/配置存储(CCC 根 localstore.json,JSON 格式;git 策略 localstore.gitTrack 缺省 deny);doc 子命令输出规范",
|
|
2664
|
+
"",
|
|
2665
|
+
" ℹ️ CCC 内文件操作(read/write/edit/glob/grep 等)请使用相对 CCC 根的相对路径(如 AGENT_SESSIONS/2026-08-14--S134--x/SESSION.md);Root / SESSION.md path 等绝对路径仅作标识,不作工具入参",
|
|
2660
2666
|
"",
|
|
2661
2667
|
"The DSH platform tools remain available too (read/write/edit/glob/grep/web_search/ask_user_question/subagent/workflow/goal and more) — the ACC tools above are the serenity-native layer, not the only tools.",
|
|
2662
2668
|
"",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.8",
|
|
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": {
|