@lmzhen/dsh-evolution-approval 0.1.0-rc.28 → 0.1.0-rc.29
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 +7 -2
- package/package.json +8 -8
package/lib/index.js
CHANGED
|
@@ -86,10 +86,15 @@ var EvolutionApproval = class extends Service {
|
|
|
86
86
|
return await this.state().listPending(status);
|
|
87
87
|
}
|
|
88
88
|
async approve(id) {
|
|
89
|
-
return await this.dedupe(id
|
|
89
|
+
return await this.dedupe(`approve:${id}`, () => this.doApprove(id));
|
|
90
90
|
}
|
|
91
91
|
async reject(id) {
|
|
92
|
-
return await this.dedupe(id
|
|
92
|
+
return await this.dedupe(`reject:${id}`, async () => {
|
|
93
|
+
const claimId = randomUUID();
|
|
94
|
+
if (!await this.state().claimPending(id, claimId)) return {
|
|
95
|
+
ok: false,
|
|
96
|
+
message: `Pending write "${id}" is already being resolved by another writer.`
|
|
97
|
+
};
|
|
93
98
|
const resolution = await this.state().tryResolvePending(id, "rejected");
|
|
94
99
|
if (!resolution.applied || !resolution.record) return {
|
|
95
100
|
ok: false,
|
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.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.29",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
39
39
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
40
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.
|
|
41
|
-
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.
|
|
40
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.29",
|
|
41
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.29"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
45
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.
|
|
46
|
-
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.
|
|
47
|
-
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.
|
|
48
|
-
"@lmzhen/dsh-evolution-io-node": "^0.1.0-rc.
|
|
49
|
-
"@lmzhen/dsh-evolution-state-json": "^0.1.0-rc.
|
|
45
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.1.0-rc.29",
|
|
46
|
+
"@lmzhen/dsh-evolution-state": "^0.1.0-rc.29",
|
|
47
|
+
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.29",
|
|
48
|
+
"@lmzhen/dsh-evolution-io-node": "^0.1.0-rc.29",
|
|
49
|
+
"@lmzhen/dsh-evolution-state-json": "^0.1.0-rc.29"
|
|
50
50
|
}
|
|
51
51
|
}
|