@lmzhen/dsh-evolution-approval 0.30.40 → 0.30.41

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
@@ -636,7 +636,16 @@ var EvolutionApproval = class extends Service {
636
636
  message: `待批准写入「${id}」已被另一个写入方了结。`
637
637
  };
638
638
  }
639
+ if (resolution.record === null) return {
640
+ ok: false,
641
+ message: `已批准写入「${id}」已重放,但了结记录返回空记录:请核验该写入。`
642
+ };
639
643
  await this.recordDecision(resolution.record, audit);
644
+ this.ctx.emit("evolution/approval-decided", {
645
+ record: resolution.record,
646
+ action: "approve",
647
+ ok: true
648
+ });
640
649
  return {
641
650
  ok: true,
642
651
  message: `已批准 ${record.kind} 写入「${id}」(${record.summary})。`
@@ -156,6 +156,17 @@ declare module '@deepseek-ai/cordis' {
156
156
  interface Context {
157
157
  evolutionApproval: EvolutionApproval;
158
158
  }
159
+ interface Events {
160
+ /**
161
+ * Emitted after an approval decision has been durably recorded.
162
+ * @mode emit
163
+ */
164
+ 'evolution/approval-decided'(payload: {
165
+ readonly record: PendingRecord;
166
+ readonly action: 'approve' | 'reject';
167
+ readonly ok: boolean;
168
+ }): void;
169
+ }
159
170
  }
160
171
  export interface Config {
161
172
  /** Master switch. Default false matches Hermes write_approval default. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-approval",
3
3
  "description": "Stage/pending approval service for Hermes-style self-evolution writes (community build)",
4
- "version": "0.30.40",
4
+ "version": "0.30.41",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,18 +27,18 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.5",
30
- "@lmzhen/dsh-evolution-core": "^0.30.40"
30
+ "@lmzhen/dsh-evolution-core": "^0.30.41"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@deepseek-ai/cordis": "^4.0.5",
34
- "@lmzhen/dsh-evolution-core": "^0.30.40",
35
- "@lmzhen/dsh-evolution-state": "^0.30.40",
36
- "@lmzhen/dsh-evolution-state-storage": "^0.30.40"
34
+ "@lmzhen/dsh-evolution-core": "^0.30.41",
35
+ "@lmzhen/dsh-evolution-state": "^0.30.41",
36
+ "@lmzhen/dsh-evolution-state-storage": "^0.30.41"
37
37
  },
38
38
  "devDependencies": {
39
- "@lmzhen/dsh-evolution-core": "^0.30.40",
40
- "@lmzhen/dsh-evolution-state": "^0.30.40",
41
- "@lmzhen/dsh-evolution-state-storage": "^0.30.40"
39
+ "@lmzhen/dsh-evolution-core": "^0.30.41",
40
+ "@lmzhen/dsh-evolution-state": "^0.30.41",
41
+ "@lmzhen/dsh-evolution-state-storage": "^0.30.41"
42
42
  },
43
43
  "engines": {
44
44
  "dsh": ">=0.2.1-rc.2 <0.2.2-0"