@lmzhen/dsh-evolution-state-json 0.3.17 → 0.3.18

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.
Files changed (2) hide show
  1. package/lib/index.js +15 -0
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -2742,6 +2742,21 @@ function apply(ctx, rawConfig) {
2742
2742
  }));
2743
2743
  });
2744
2744
  },
2745
+ async transactCuratorState(task) {
2746
+ await mutate(async () => {
2747
+ await jsonTransact("curator-state.json", (current) => {
2748
+ const next = task(current?.primary ?? null);
2749
+ if (next === null) {
2750
+ if (current !== null) delete current.primary;
2751
+ return current ?? {};
2752
+ }
2753
+ return {
2754
+ ...current ?? {},
2755
+ primary: next
2756
+ };
2757
+ });
2758
+ });
2759
+ },
2745
2760
  async listPending(status = "pending") {
2746
2761
  return await mutate(async () => {
2747
2762
  const map = await loadPendingMap();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-state-json",
3
3
  "description": "JSON-file evolution state provider over the IO seam (community build)",
4
- "version": "0.3.17",
4
+ "version": "0.3.18",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,12 +37,12 @@
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
- "@lmzhen/dsh-evolution-io": "^0.3.17",
41
- "@lmzhen/dsh-evolution-state-storage": "^0.3.17"
40
+ "@lmzhen/dsh-evolution-io": "^0.3.18",
41
+ "@lmzhen/dsh-evolution-state-storage": "^0.3.18"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
45
- "@lmzhen/dsh-evolution-io": "^0.3.17",
46
- "@lmzhen/dsh-evolution-state-storage": "^0.3.17"
45
+ "@lmzhen/dsh-evolution-io": "^0.3.18",
46
+ "@lmzhen/dsh-evolution-state-storage": "^0.3.18"
47
47
  }
48
48
  }