@lmzhen/dsh-evolution-review 0.59.1 → 0.59.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/lib/index.js CHANGED
@@ -18,6 +18,14 @@ import { assertSkillsRootAliasRetired, filterUnreadSkillOps } from "@lmzhen/dsh-
18
18
  /** The only terminal tool call in an aux review. */
19
19
  const REVIEW_DONE_TOOL_NAME = "review_done";
20
20
  /** Tool that lets the model wait for a resource lock before re-reading. */
21
+ /** Classify a skill-write tool error without importing the write service's enum. */
22
+ function skillErrorKind(text) {
23
+ if (/SKILL_STALE_VERSION/.test(text)) return "stale";
24
+ if (/SKILL_RESOURCE_BUSY|resource-busy/.test(text)) return "busy";
25
+ if (/SKILL_NOT_OBSERVED/.test(text)) return "unobserved";
26
+ if (/SKILL_AMBIGUOUS_EDIT/.test(text)) return "ambiguous";
27
+ if (/SKILL_NOT_FOUND/.test(text)) return "not-found";
28
+ }
21
29
  const REVIEW_WAIT_TOOL_NAME = "review_wait";
22
30
  const REVIEW_WAIT_TOOL = {
23
31
  name: REVIEW_WAIT_TOOL_NAME,
@@ -332,7 +340,8 @@ async function runReview(input) {
332
340
  type: actionType(call.name),
333
341
  action: call.name,
334
342
  target: toolTarget(call.name, call.arguments),
335
- status: "error"
343
+ status: "error",
344
+ errorKind: "busy"
336
345
  });
337
346
  messages.push(createToolResultMessage({
338
347
  callId: call.id,
@@ -362,11 +371,14 @@ async function runReview(input) {
362
371
  }));
363
372
  continue;
364
373
  }
374
+ const errorText = item.result.isError ? item.result.content.map((block) => block.type === "text" ? block.text : "").join("\n") : "";
375
+ const errorKind = item.result.isError ? skillErrorKind(errorText) : void 0;
365
376
  actions.push({
366
377
  type: actionType(call.name),
367
378
  action: call.name,
368
379
  target: toolTarget(call.name, call.arguments),
369
- status: item.result.isError ? "error" : item.result.content.some((block) => block.type === "text" && /staged id:|已暂存|pending_id/.test(block.text)) ? "staged" : "ok"
380
+ status: item.result.isError ? "error" : item.result.content.some((block) => block.type === "text" && /staged id:|已暂存|pending_id/.test(block.text)) ? "staged" : "ok",
381
+ ...errorKind === void 0 ? {} : { errorKind }
370
382
  });
371
383
  if (call.name === "skill" && item.result.isError !== true) try {
372
384
  const parsed = JSON.parse(call.arguments);
@@ -1591,7 +1603,7 @@ function apply(ctx, rawConfig = {}) {
1591
1603
  "run_code",
1592
1604
  "review_done",
1593
1605
  "review_wait"
1594
- ]), agent);
1606
+ ]), reviewChild.agent);
1595
1607
  } catch (error) {
1596
1608
  await reviewChild?.dispose();
1597
1609
  releaseKind();
@@ -52,7 +52,6 @@ export interface ReviewReport {
52
52
  }
53
53
  /** The only terminal tool call in an aux review. */
54
54
  export declare const REVIEW_DONE_TOOL_NAME = "review_done";
55
- /** Tool that lets the model wait for a resource lock before re-reading. */
56
55
  export declare const REVIEW_WAIT_TOOL_NAME = "review_wait";
57
56
  /** Extra instruction appended to aux prompts only; foreground prompts stay unchanged. */
58
57
  export declare const AUX_COMPLETION_INSTRUCTION = "When all durable changes for this review are complete, call review_done as the only tool call in your final batch. Do not call it while more edits remain. A precise no-op is still a completed review: always finish with review_done and an unchanged report instead of stopping without it. If a write is locked, call review_wait once, then re-read the target and retry; never reapply a stale patch.";
@@ -70,6 +69,7 @@ export interface ReviewAction {
70
69
  readonly action: string;
71
70
  readonly target: string;
72
71
  readonly status: 'ok' | 'staged' | 'error';
72
+ readonly errorKind?: 'stale' | 'busy' | 'unobserved' | 'ambiguous' | 'not-found' | undefined;
73
73
  }
74
74
  export interface ReviewUsage {
75
75
  readonly inputTokens?: number;
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.59.1",
4
+ "version": "0.59.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,23 +29,23 @@
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
31
  "@deepseek-ai/schemastery": "^3.18.5",
32
- "@lmzhen/dsh-evolution-core": "0.59.1",
33
- "@lmzhen/dsh-evolution-platform-contract": "0.59.1",
34
- "@lmzhen/dsh-evolution-adapter": "0.59.1"
32
+ "@lmzhen/dsh-evolution-core": "0.59.3",
33
+ "@lmzhen/dsh-evolution-platform-contract": "0.59.3",
34
+ "@lmzhen/dsh-evolution-adapter": "0.59.3"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@deepseek-ai/cordis": "^4.0.5",
38
38
  "@deepseek-ai/dsh-agent": "0.2.2-rc.5",
39
39
  "@deepseek-ai/dsh-llm": "0.2.2-rc.5",
40
40
  "@deepseek-ai/dsh-session": "0.2.2-rc.5",
41
- "@lmzhen/dsh-evolution-state": "^0.59.1"
41
+ "@lmzhen/dsh-evolution-state": "^0.59.3"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@deepseek-ai/dsh-agent": "0.2.2-rc.5",
45
45
  "@deepseek-ai/dsh-llm": "0.2.2-rc.5",
46
46
  "@deepseek-ai/dsh-session": "0.2.2-rc.5",
47
- "@lmzhen/dsh-evolution-core": "^0.59.1",
48
- "@lmzhen/dsh-evolution-state": "^0.59.1"
47
+ "@lmzhen/dsh-evolution-core": "^0.59.3",
48
+ "@lmzhen/dsh-evolution-state": "^0.59.3"
49
49
  },
50
50
  "engines": {
51
51
  "dsh": "0.2.2-rc.5"