@lmzhen/dsh-evolution-state-json 0.22.0 → 0.24.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.
Files changed (2) hide show
  1. package/lib/index.js +4 -3
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
- import { evolutionHome, isAbsent, isPresent, isUnknown, makeSerialQueue, probeText, transactIo, transactTaskGuard } from "@lmzhen/dsh-evolution-core";
2
+ import { preferProvider } from "@lmzhen/dsh-evolution-io";
3
+ import { evolutionHome, isAbsent, isPresent, isRecord, isUnknown, makeSerialQueue, probeText, transactIo, transactTaskGuard } from "@lmzhen/dsh-evolution-core";
3
4
  import { CURATOR_STATE_FILE, CURATOR_STATE_KEY, CURATOR_STATE_TABLE, PENDING_ARCHIVE_BAK_FILE, PENDING_ARCHIVE_FILE, PENDING_LEGACY_FILE, PENDING_RESOLVED_CAP, PENDING_STATE_FILE, PENDING_TABLE, PROVIDER_JSON, REVIEW_STATE_FILE, REVIEW_STATE_SESSION_CAP, REVIEW_STATE_TABLE, assertCloneable, canClaimPending, canResolvePending, cloneRecord, recordIssue, releasedStatus, selectPendingOverflow, selectSessionOverflow } from "@lmzhen/dsh-evolution-state-storage";
4
5
  import { basename, dirname, isAbsolute, join } from "node:path";
5
6
  //#region lib/types/index.js
@@ -40,7 +41,7 @@ const pendingArchiveKey = (record) => `${record.id}\u0000${record.status}\u0000$
40
41
  * corrupt map that used to read as "empty" and was silently overwritten by
41
42
  * the next save. Only these four files are record maps; the archive sidecar
42
43
  * is a top-level ARRAY and must NOT be gated by this predicate. */
43
- const isPlainRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
44
+ const isPlainRecord = isRecord;
44
45
  const RECORD_MAP_FILES = new Set([
45
46
  REVIEW_STATE_FILE,
46
47
  CURATOR_STATE_FILE,
@@ -219,7 +220,7 @@ async function jsonTransact(ctx, io, root, file, task, options) {
219
220
  function apply(ctx, rawConfig = {}) {
220
221
  const root = (rawConfig.root ?? "").trim() || evolutionHome();
221
222
  if (rawConfig.root !== void 0 && rawConfig.root.trim() !== "" && !isAbsolute(rawConfig.root)) ctx.logger.warn(`evolution-state-json: config.root "${rawConfig.root}" is a relative path and resolves against the process CWD ("${root}") — pass an absolute path to make the store location launch-independent`);
222
- const io = () => ctx.evolutionIo.provider();
223
+ const io = () => preferProvider(ctx.evolutionIo, ["fs"]);
223
224
  const pathOf = (file) => join(root, file);
224
225
  const quarantineMemory = newQuarantineMemory();
225
226
  const gateDroppedCurrent = /* @__PURE__ */ new Set();
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.22.0",
4
+ "version": "0.24.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,16 +27,16 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.4",
30
- "@lmzhen/dsh-evolution-core": "^0.22.0"
30
+ "@lmzhen/dsh-evolution-core": "^0.24.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@deepseek-ai/cordis": "^4.0.1",
34
- "@lmzhen/dsh-evolution-io": "^0.22.0",
35
- "@lmzhen/dsh-evolution-state-storage": "^0.22.0"
34
+ "@lmzhen/dsh-evolution-io": "^0.24.0",
35
+ "@lmzhen/dsh-evolution-state-storage": "^0.24.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@lmzhen/dsh-evolution-io": "^0.22.0",
39
- "@lmzhen/dsh-evolution-state-storage": "^0.22.0",
40
- "@lmzhen/dsh-evolution-io-node": "^0.22.0"
38
+ "@lmzhen/dsh-evolution-io": "^0.24.0",
39
+ "@lmzhen/dsh-evolution-state-storage": "^0.24.0",
40
+ "@lmzhen/dsh-evolution-io-node": "^0.24.0"
41
41
  }
42
42
  }