@lmzhen/dsh-memory-files 0.3.82 → 0.4.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 (3) hide show
  1. package/README.md +18 -18
  2. package/lib/index.js +3 -1
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -1,28 +1,28 @@
1
- # @deepseek-ai/dsh-memory-files
1
+ # @lmzhen/dsh-memory-files
2
2
 
3
- Local layered memory provider
3
+ Local layered memory provider: registers the `files` provider into `ctx.memory` over the IO seam.
4
4
 
5
- ## Model Experience
5
+ ## Model surface
6
6
 
7
- ### Indirect model surface
7
+ - **Model-visible:** nothing of its own: `tool-memory` owns the tool and the injection.
8
+ - **Prompt prefix / KV cache:** unchanged by this package: family-level rules single-sourced in `packages/README.md` §"Model-visible prompt prefix and the KV cache".
9
+ - **Mount it?** yes — the `memory-files` provider row, in `evolution-host`/`evolution-all`/one-click `evolution-preset`.
8
10
 
9
- #### What the model sees
11
+ ## Configuration
10
12
 
11
- `@deepseek-ai/dsh-memory-files` registers no direct prompt or tool schema itself. Model-visible effects are owned by the packages that consume this service.
13
+ - `providerName` (default `files`): the registered name.
14
+ - `memoryCharLimit` / `userCharLimit` (`2200` / `1375`) the budget the STORE enforces per target.
15
+ - `root`: directory override; `''` means `$DSH_HOME/memories`.
16
+ - `addDatePrefix` / `maxConsolidationFailures` (`false` / `3`) date prefixes on entries; consolidation failures one turn tolerates.
17
+ - `threatExemptLabels` (default `[]`): benign threat labels for the MEMORY store (per-site rule in `evolution-threat`).
12
18
 
13
- #### Token effect
19
+ ## Known limitations
14
20
 
15
- Zero direct token effect from this package; consumers add any model-visible tokens.
16
-
17
- #### KV Cache effect
18
-
19
- Independent of request-prefix construction. This package does not alter the assembled prompt or tool list.
20
-
21
- ## Known Limitations and Deferred Work
22
-
23
- - **The memory budget is configured in two places.** `memoryCharLimit`/`userCharLimit` (this package) is what the STORE enforces; `evolution-policy`'s `memoryChars`/`userChars` is what the review pipeline PLANS against. An UNSET limit here follows the mounted policy (row order permitting — the policy must already be mounted when this row assembles), an explicit value wins, and an explicit value that contradicts the policy warns once at load. `/evolution doctor` re-checks the pair at run time and reports a `memory budget:` finding, which also catches the row-order case. "Unset" is read as "equal to the schema default": the loader fills defaults into the row config, so a row that pins the default value explicitly is indistinguishable from one that omits it.
21
+ - **The memory budget is configured in two places.** `memoryCharLimit`/`userCharLimit` (this package) is what the STORE enforces; `evolution-policy`'s `memoryChars`/`userChars` is what the review pipeline PLANS against. An unset limit follows the mounted policy, an explicit value wins, a contradiction warns once at load; `/evolution doctor` re-checks the pair at run time.
22
+ - Nothing selects this provider implicitly: with `memory.provider` empty the FIRST registered provider serves every read/write: set the pin or row order decides.
24
23
 
24
+ **Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
25
25
 
26
- - `providerName` (default `files`) is the name this provider registers under. Nothing selects it implicitly: `memory.provider` pins the registry to one name (V27 G6.3), and with the pin empty the FIRST registered provider serves every read/write — so with two providers mounted, set the pin or the choice is row order.
26
+ ## Notes and history
27
27
 
28
- **Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
28
+ - `memory.provider` pins the registry to one name (V27 G6.3), and with the pin empty the FIRST registered provider serves every read/write: so with two providers mounted, set the pin or the choice is row order.
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
+ import { resolve } from "node:path";
2
3
  import z from "@deepseek-ai/schemastery";
3
4
  import { DEFAULT_CONSOLIDATION_FAILURES, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_USER_CHAR_LIMIT, MemoryStore, clampedNumber, evolutionIoAdapter, makeSerialQueue } from "@lmzhen/dsh-evolution-core";
4
5
  //#region lib/types/index.js
@@ -45,7 +46,8 @@ function apply(ctx, rawConfig = {}) {
45
46
  if (explicitLimit("userCharLimit") && budget.user !== void 0 && config.userCharLimit !== budget.user) ctx.logger.warn(`memory-files: userCharLimit=${config.userCharLimit} contradicts evolution-policy userChars=${budget.user} — same divergence as memoryCharLimit`);
46
47
  const io = evolutionIoAdapter(() => ctx.evolutionIo.provider());
47
48
  const serializedWrite = makeSerialQueue();
48
- const resolvedRoot = (config.root || "").trim();
49
+ const trimmedRoot = (config.root || "").trim();
50
+ const resolvedRoot = trimmedRoot === "" ? "" : resolve(trimmedRoot);
49
51
  const store = new MemoryStore({
50
52
  memoryCharLimit: config.memoryCharLimit,
51
53
  userCharLimit: config.userCharLimit,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-memory-files",
3
3
  "description": "Local layered memory provider (community build)",
4
- "version": "0.3.82",
4
+ "version": "0.4.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.1",
30
- "@lmzhen/dsh-evolution-core": "^0.3.82"
30
+ "@lmzhen/dsh-evolution-core": "^0.4.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@deepseek-ai/cordis": "^4.0.1",
34
- "@lmzhen/dsh-evolution-io": "^0.3.82",
35
- "@lmzhen/dsh-memory": "^0.3.82"
34
+ "@lmzhen/dsh-evolution-io": "^0.4.0",
35
+ "@lmzhen/dsh-memory": "^0.4.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@lmzhen/dsh-evolution-core": "^0.3.82",
39
- "@lmzhen/dsh-evolution-io": "^0.3.82",
40
- "@lmzhen/dsh-memory": "^0.3.82"
38
+ "@lmzhen/dsh-evolution-core": "^0.4.0",
39
+ "@lmzhen/dsh-evolution-io": "^0.4.0",
40
+ "@lmzhen/dsh-memory": "^0.4.0"
41
41
  }
42
42
  }