@shgroup/dsh-serenity-hooks 1.16.9 → 1.16.11

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.16.9",
3
+ "version": "1.16.11",
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
@@ -2361,6 +2361,7 @@ function createLoopTool(ctx) {
2361
2361
  const parentCtx = exec.agent?.ctx;
2362
2362
  const inherited = loopPresetInheritance(parentCtx);
2363
2363
  if (!ctx.agents) throw new Error("loop: ctx.agents 不可用");
2364
+ const parentSession = (exec.agent?.session)?.id;
2364
2365
  let handle;
2365
2366
  let loopAgent;
2366
2367
  const spawnAgent = async () => {
@@ -2369,6 +2370,8 @@ function createLoopTool(ctx) {
2369
2370
  sessionId,
2370
2371
  meta: {
2371
2372
  cwd: root,
2373
+ origin: "subagent",
2374
+ ...parentSession === void 0 ? {} : { parentSession },
2372
2375
  ...inherited.agentPreset === void 0 ? {} : { agentPreset: inherited.agentPreset }
2373
2376
  },
2374
2377
  agentOptions: {
@@ -3006,14 +3009,15 @@ const PLUGIN_SOURCE = {
3006
3009
  plugin: "dsh-serenity-hooks"
3007
3010
  };
3008
3011
  /**
3009
- * ACC 注入消息:完整内容 = 简短身份头 + 完整系统提示词(ACC 5 + CCC 顶层 skill 原文)。
3010
- * 用户要求:在此处注入完整 ACC 系统提示词内容 + CCC 顶层 skill 原文(对齐 osp system.transform)。
3011
- * scope = dsh 会话 id:Session 块按会话隔离,不跨会话泄露。
3012
+ * ACC 注入消息(S134 去重):**只含简短身份锚点**([ACC] 已激活 + CCC + 约束 + loop 模型 + Phase 2)。
3013
+ * 完整身份(ACC 5 + CCE + Constraints + EAP + SKILL 全文 + Session 块)由**系统提示词层**
3014
+ * (systemPrompt.section,每轮 prompt 装配自动注入,含 subagent)承担——对话消息流/压缩重注入
3015
+ * 不再重复注入同一内容(token 双倍浪费,见 S134 注入方案梳理)。
3012
3016
  */
3013
- function accMessage(root, configPaths, entrySkillMaxChars, scope = DEFAULT_SESSION_SCOPE) {
3017
+ function accMessage(root, configPaths, entrySkillMaxChars) {
3014
3018
  const content = [{
3015
3019
  type: "text",
3016
- text: `${accIdentityText(root, configPaths, entrySkillMaxChars)}\n\n${serenitySystemPrompt(root, scope)}`
3020
+ text: accIdentityText(root, configPaths, entrySkillMaxChars)
3017
3021
  }];
3018
3022
  return createUserMessage({
3019
3023
  content,
@@ -3060,7 +3064,7 @@ function registerContext(ctx, opts = {}) {
3060
3064
  } catch {}
3061
3065
  if (injected.has(key)) return;
3062
3066
  injected.add(key);
3063
- agent.inject(accMessage(root, configPaths, entrySkillMaxChars, agentScope(agent)));
3067
+ agent.inject(accMessage(root, configPaths, entrySkillMaxChars));
3064
3068
  syncSafeModeRestriction(agent, root);
3065
3069
  };
3066
3070
  if (opts.seedOnStart ?? true) ctx.on("agent/session-start", (payload) => {
@@ -3084,7 +3088,7 @@ function registerContext(ctx, opts = {}) {
3084
3088
  return {
3085
3089
  kind: "enter",
3086
3090
  messages: [
3087
- accMessage(root, configPaths, entrySkillMaxChars, agentScope(agent)),
3091
+ accMessage(root, configPaths, entrySkillMaxChars),
3088
3092
  ...messages,
3089
3093
  ...downstream.messages
3090
3094
  ]
@@ -3107,9 +3111,8 @@ function registerCompactRetention(ctx, opts = {}) {
3107
3111
  if (!agent) return;
3108
3112
  const root = findSerenityRoot(agent.session?.header?.cwd ?? process.cwd());
3109
3113
  if (!root) return;
3110
- const scope = agent.session?.id ?? "default";
3111
3114
  try {
3112
- agent.inject(accMessage(root, configPaths, entrySkillMaxChars, scope));
3115
+ agent.inject(accMessage(root, configPaths, entrySkillMaxChars));
3113
3116
  } catch {}
3114
3117
  });
3115
3118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shgroup/dsh-serenity-hooks",
3
- "version": "1.16.9",
3
+ "version": "1.16.11",
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": {