@shgroup/dsh-serenity-hooks 1.23.2 → 1.23.3
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 +29 -9
- 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.23.
|
|
3
|
+
"version": "1.23.3",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):真实 DSH 工具 cc_fs/session/acc_msm/eap/neat/cce/loop/session_rebuild + 拦截缝机械约束(safe-mode/路径守卫)+ 高级设定面板(双端口网关/账号管理)。适配 DSH 公开版(0.1.0-rc,deepseek-ai/deepseek-harness)。",
|
|
6
6
|
"engines": {
|
package/lib/index.js
CHANGED
|
@@ -6265,11 +6265,20 @@ var KeeperTracker = class {
|
|
|
6265
6265
|
function reminderText(code, score) {
|
|
6266
6266
|
return `[TRAJECTORY-STEWARD] Score threshold reached (${score}). Please acknowledge with [TRAJECTORY-STEWARD-recorded-${code}] once progress is synced to the working session (acc-session show). No need to interrupt your work — just acknowledge inline and keep going.`;
|
|
6267
6267
|
}
|
|
6268
|
-
/**
|
|
6269
|
-
*
|
|
6270
|
-
*
|
|
6271
|
-
|
|
6272
|
-
|
|
6268
|
+
/**
|
|
6269
|
+
* F2 rebuild 提示(v1.21;v1.22.1 对齐"轨迹跟踪器"概念;v1.23.0 英化 + 载体关系;
|
|
6270
|
+
* v1.23.3 行动指令化——用户反馈"一直在触发为啥没执行":旧文案是状态播报式
|
|
6271
|
+
* ("[TRAJECTORY] Context usage at N%..."),模型当成系统状态而非行动请求,可一直忽略。
|
|
6272
|
+
* 新文案 = 明确的行动指令(ACT NOW + 何时执行 + 必须执行),对齐 steward ACK 协议风格。
|
|
6273
|
+
*
|
|
6274
|
+
* escalated=true(v1.23.3):连续多轮超阈值仍未 rebuild → 升级强制语气
|
|
6275
|
+
* (STOP and rebuild now,持续注入直到调用 session_rebuild)。
|
|
6276
|
+
*/
|
|
6277
|
+
function rebuildReminderText(ratio, threshold, escalated = false) {
|
|
6278
|
+
const pct = (ratio * 100).toFixed(0);
|
|
6279
|
+
const thr = (threshold * 100).toFixed(0);
|
|
6280
|
+
if (escalated) return `[TRAJECTORY-ESCALATED] Context usage at ${pct}% (threshold ${thr}%) — you have been reminded repeatedly and have NOT called session_rebuild. This is now mandatory: STOP at the current task step and call the session_rebuild tool immediately. The conversation will be cleared and rebuilt in place; SESSION.md is the persistent trajectory and stays in place — identity continues from it. Do not continue working without rebuilding; this reminder persists until you call session_rebuild.`;
|
|
6281
|
+
return `[TRAJECTORY] Context usage at ${pct}% (threshold ${thr}%). This session is the rebuildable carrier of the trajectory: SESSION.md is the persistent body, this conversation is only a temporary work copy. ACT NOW: at the next natural pause (end of the current task step), call the session_rebuild tool to clear and rebuild this conversation — the current copy is discarded, identity continues from SESSION.md. If you are in the middle of an unbreakable step, continue it, then rebuild at its end. Do not ignore this; rebuild is the expected action, not an option.`;
|
|
6273
6282
|
}
|
|
6274
6283
|
/** 读取会话 contextPressure 投影(sessionProjections 可选服务;未装配返回 null) */
|
|
6275
6284
|
function readContextPressure(ctx, session) {
|
|
@@ -6292,6 +6301,9 @@ const PLUGIN_SOURCE$1 = {
|
|
|
6292
6301
|
};
|
|
6293
6302
|
/** 每 agent 一个跟踪器(进程内存态,agent token 维度) */
|
|
6294
6303
|
const trackers = /* @__PURE__ */ new Map();
|
|
6304
|
+
/** 连续超阈值轮数达此值 → 升级为 [TRAJECTORY-ESCALATED] 强制语气(此后持续升级催,直到 rebuild) */
|
|
6305
|
+
const REBUILD_ESCALATE_AFTER = 3;
|
|
6306
|
+
const rebuildReminderStates = /* @__PURE__ */ new Map();
|
|
6295
6307
|
function registerKeeper(ctx, opts = {}) {
|
|
6296
6308
|
const defaultThreshold = opts.defaultThreshold ?? 150;
|
|
6297
6309
|
const trackerFor = (exec) => {
|
|
@@ -6324,10 +6336,18 @@ function registerKeeper(ctx, opts = {}) {
|
|
|
6324
6336
|
const pressure = readContextPressure(ctx, session);
|
|
6325
6337
|
if (pressure && pressure.contextWindow && pressure.contextWindow > 0) {
|
|
6326
6338
|
const ratio = pressure.projectedTokens / pressure.contextWindow;
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6339
|
+
const threshold = readSimpleSettings().rebuildThreshold;
|
|
6340
|
+
if (ratio >= threshold) {
|
|
6341
|
+
const key = exec.agent?.session?.id ?? "global";
|
|
6342
|
+
const st = rebuildReminderStates.get(key) ?? { consecutive: 0 };
|
|
6343
|
+
st.consecutive += 1;
|
|
6344
|
+
const escalated = st.consecutive >= REBUILD_ESCALATE_AFTER;
|
|
6345
|
+
blocks.push({
|
|
6346
|
+
type: "text",
|
|
6347
|
+
text: rebuildReminderText(ratio, threshold, escalated)
|
|
6348
|
+
});
|
|
6349
|
+
rebuildReminderStates.set(key, st);
|
|
6350
|
+
}
|
|
6331
6351
|
}
|
|
6332
6352
|
}
|
|
6333
6353
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.3",
|
|
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": {
|