@lmzhen/dsh-evolution-core 0.3.58 → 0.3.59
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/lib/index.js +8 -7
- package/lib/types/prompts.d.ts +2 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1629,8 +1629,8 @@ D. 库·整合纪律(计划形态约束)
|
|
|
1629
1629
|
* orchestrate — a second model-facing prompt living OUTSIDE the bundle digest.
|
|
1630
1630
|
* It now rides PROMPT_BUNDLE so the digest integrity check covers every
|
|
1631
1631
|
* maintenance prompt. Adding the entry changes the bundle digest (the intended
|
|
1632
|
-
* fail-closed signal); PROMPT_BUNDLE_VERSION
|
|
1633
|
-
*
|
|
1632
|
+
* fail-closed signal); PROMPT_BUNDLE_VERSION is owned by the core test pin and
|
|
1633
|
+
* bumps with the batch that changes the bundle (15→16 in 0.3.58).
|
|
1634
1634
|
*/
|
|
1635
1635
|
const MAINTAIN_OUTPUT_INSTRUCTION = "按模板契约输出 JSON 维护计划(verdict/plan/notes);你有 skill 工具与维护模板;并在维护探针(maintenance_probe)挂载时可用它深挖细节。";
|
|
1636
1636
|
/**
|
|
@@ -3097,24 +3097,25 @@ const CORRECTION_PATTERNS = [
|
|
|
3097
3097
|
const FIX_PATTERNS = [/worked after|fixed by|the fix was|root cause/i, /retry(?:ing)? worked|workaround/i];
|
|
3098
3098
|
/** Fold one session event into the current turn observation. */
|
|
3099
3099
|
function observeEvent(signal, event) {
|
|
3100
|
+
const data = event.data;
|
|
3101
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) return;
|
|
3100
3102
|
if (event.type === "user/message") {
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
+
const content = data.content;
|
|
3104
|
+
if (!Array.isArray(content)) return;
|
|
3105
|
+
const text = content.map((block) => block.type === "text" ? block.text ?? "" : "").join(" ");
|
|
3103
3106
|
signal.userChars += text.length;
|
|
3104
3107
|
if (CORRECTION_PATTERNS.some((pattern) => pattern.test(text))) signal.memorySignal = true;
|
|
3105
3108
|
if (FIX_PATTERNS.some((pattern) => pattern.test(text))) signal.skillSignal = true;
|
|
3106
3109
|
return;
|
|
3107
3110
|
}
|
|
3108
3111
|
if (event.type === "assistant/message") {
|
|
3109
|
-
const message =
|
|
3112
|
+
const message = data.message;
|
|
3110
3113
|
if (!message || !Array.isArray(message.content)) return;
|
|
3111
3114
|
const text = message.content.map((block) => block.type === "text" ? block.text ?? "" : "").join(" ");
|
|
3112
3115
|
signal.assistantChars += text.length;
|
|
3113
3116
|
return;
|
|
3114
3117
|
}
|
|
3115
3118
|
if (event.type === "tool/call") {
|
|
3116
|
-
const data = event.data;
|
|
3117
|
-
if (data === null || typeof data !== "object" || Array.isArray(data)) return;
|
|
3118
3119
|
signal.toolCalls += 1;
|
|
3119
3120
|
const name = data.name;
|
|
3120
3121
|
if (name === "skill" || name === "skill_manage") signal.skillSignal = true;
|
package/lib/types/prompts.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export declare const MAINTAIN_PROMPT = "<<<MAINTAIN_PROMPT v={bundle_version} si
|
|
|
27
27
|
* orchestrate — a second model-facing prompt living OUTSIDE the bundle digest.
|
|
28
28
|
* It now rides PROMPT_BUNDLE so the digest integrity check covers every
|
|
29
29
|
* maintenance prompt. Adding the entry changes the bundle digest (the intended
|
|
30
|
-
* fail-closed signal); PROMPT_BUNDLE_VERSION
|
|
31
|
-
*
|
|
30
|
+
* fail-closed signal); PROMPT_BUNDLE_VERSION is owned by the core test pin and
|
|
31
|
+
* bumps with the batch that changes the bundle (15→16 in 0.3.58).
|
|
32
32
|
*/
|
|
33
33
|
export declare const MAINTAIN_OUTPUT_INSTRUCTION = "\u6309\u6A21\u677F\u5951\u7EA6\u8F93\u51FA JSON \u7EF4\u62A4\u8BA1\u5212\uFF08verdict/plan/notes\uFF09\uFF1B\u4F60\u6709 skill \u5DE5\u5177\u4E0E\u7EF4\u62A4\u6A21\u677F\uFF1B\u5E76\u5728\u7EF4\u62A4\u63A2\u9488\uFF08maintenance_probe\uFF09\u6302\u8F7D\u65F6\u53EF\u7528\u5B83\u6DF1\u6316\u7EC6\u8282\u3002";
|
|
34
34
|
/**
|
package/package.json
CHANGED