@lmzhen/dsh-evolution-review 0.2.0 → 0.3.0

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 CHANGED
@@ -1,37 +1,8 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { createUserMessage } from "@deepseek-ai/dsh-llm";
4
- import { COMPLETION_SKILL_REVIEW_PROMPT, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_USER_CHAR_LIMIT, PROMPT_BUNDLE, SkillLibrary, advanceReview, evolutionIoAdapter, foldTurn, resolveOrigins, reviewPrompt, verifyPromptBundle } from "@lmzhen/dsh-evolution-core";
4
+ import { COMPLETION_SKILL_REVIEW_PROMPT, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_USER_CHAR_LIMIT, PROMPT_BUNDLE, SkillLibrary, advanceReview, evolutionIoAdapter, foldTurn, redactSecrets, resolveOrigins, reviewPrompt, verifyPromptBundle } from "@lmzhen/dsh-evolution-core";
5
5
  import { validateEvolutionPlan } from "@lmzhen/dsh-evolution-plan-validator";
6
- //#region lib/types/redact.js
7
- /**
8
- * Review-input redaction. Review/curator subagents are the one place where a
9
- * cross-session conversation snapshot leaves the owning session's context, so
10
- * credential-shaped text is masked before it is sent. Redaction is best-effort
11
- * and conservative: it targets well-known secret shapes and inline
12
- * assignment patterns, never wholesale content.
13
- */
14
- const SECRET_PATTERNS = [
15
- ["openai-style key", /sk-[A-Za-z0-9_-]{16,}/g],
16
- ["aws access key", /AKIA[0-9A-Z]{16}/g],
17
- ["github token", /gh[pousr]_[A-Za-z0-9]{20,}/g],
18
- ["gitlab token", /glpat-[A-Za-z0-9_-]{16,}/g],
19
- ["slack token", /xox[baprs]-[A-Za-z0-9-]{10,}/g],
20
- ["jwt", /eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g],
21
- ["bearer credential", /Bearer [A-Za-z0-9._~+/=\-]{16,}/g],
22
- ["inline assignment", /(\b(?:token|api[_-]?key|secret|password|passwd)\b[\s]*[:=][\s]*[\"\x27]?)([A-Z0-9._~+/=\-]{12,})/gi]
23
- ];
24
- /**
25
- * Mask credential-shaped text in a review request.
26
- * @param text - the assembled review request text.
27
- * @returns the text with matched secrets replaced by `<redacted>`.
28
- */
29
- function redactReviewSecrets(text) {
30
- let out = text;
31
- for (const [, pattern] of SECRET_PATTERNS) out = out.replace(pattern, (_match, p1) => p1 === void 0 ? "<redacted>" : `${p1}<redacted>`);
32
- return out;
33
- }
34
- //#endregion
35
6
  //#region lib/types/index.js
36
7
  /**
37
8
  * Background review orchestration: signal gate → one-shot subagent → trusted plan execution.
@@ -150,7 +121,7 @@ function apply(ctx, rawConfig) {
150
121
  try {
151
122
  const routingPolicy = ctx.get("evolutionPolicy");
152
123
  const model = kind === "memory" ? routingPolicy?.get().memoryReviewModel ?? "deepseek-v4-flash" : routingPolicy?.get().skillReviewModel ?? "deepseek-v4-pro";
153
- const reviewText = redactReviewSecrets(buildReviewRequest(session, kind, signal, config.reviewContextMessages, config.reviewMessageChars));
124
+ const reviewText = redactSecrets(buildReviewRequest(session, kind, signal, config.reviewContextMessages, config.reviewMessageChars));
154
125
  const agentOptions = { model };
155
126
  if (config.reviewProvider) agentOptions.provider = config.reviewProvider;
156
127
  const run = await subagents.start("spawn", {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-review",
3
3
  "description": "Background review orchestration (community build)",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,8 +33,8 @@
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
35
  "@deepseek-ai/schemastery": "^3.18.1",
36
- "@lmzhen/dsh-evolution-core": "^0.2.0",
37
- "@lmzhen/dsh-evolution-plan-validator": "^0.2.0"
36
+ "@lmzhen/dsh-evolution-core": "^0.3.0",
37
+ "@lmzhen/dsh-evolution-plan-validator": "^0.3.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.1",
@@ -43,7 +43,7 @@
43
43
  "@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
44
44
  "@deepseek-ai/dsh-session": "^0.1.1-rc.2",
45
45
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
46
- "@lmzhen/dsh-evolution-state": "^0.2.0"
46
+ "@lmzhen/dsh-evolution-state": "^0.3.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@deepseek-ai/dsh-agent": "^0.1.1-rc.2",
@@ -54,8 +54,8 @@
54
54
  "@deepseek-ai/dsh-session-persistence": "^0.1.1-rc.2",
55
55
  "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.1-rc.2",
56
56
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
57
- "@lmzhen/dsh-evolution-core": "^0.2.0",
58
- "@lmzhen/dsh-evolution-plan-validator": "^0.2.0",
59
- "@lmzhen/dsh-evolution-state": "^0.2.0"
57
+ "@lmzhen/dsh-evolution-core": "^0.3.0",
58
+ "@lmzhen/dsh-evolution-plan-validator": "^0.3.0",
59
+ "@lmzhen/dsh-evolution-state": "^0.3.0"
60
60
  }
61
61
  }
@@ -1,14 +0,0 @@
1
- /**
2
- * Review-input redaction. Review/curator subagents are the one place where a
3
- * cross-session conversation snapshot leaves the owning session's context, so
4
- * credential-shaped text is masked before it is sent. Redaction is best-effort
5
- * and conservative: it targets well-known secret shapes and inline
6
- * assignment patterns, never wholesale content.
7
- */
8
- /**
9
- * Mask credential-shaped text in a review request.
10
- * @param text - the assembled review request text.
11
- * @returns the text with matched secrets replaced by `<redacted>`.
12
- */
13
- export declare function redactReviewSecrets(text: string): string;
14
- //# sourceMappingURL=redact.d.ts.map