dsh-memvault 0.9.12 → 0.10.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 (48) hide show
  1. package/README.md +51 -396
  2. package/README.zh.md +50 -324
  3. package/cordis.patch.yml +18 -20
  4. package/docs/CORE-DESIGN.md +277 -0
  5. package/docs/DETAIL.md +1 -0
  6. package/docs/DETAIL.zh.md +1 -0
  7. package/docs/DEVLOG.md +701 -0
  8. package/docs/images/relation-graph-2026-11-02.png +0 -0
  9. package/docs/preview.svg +41 -0
  10. package/icon.svg +9 -0
  11. package/lib/blocks.js +11 -2
  12. package/lib/client.js +705 -168
  13. package/lib/config.js +46 -87
  14. package/lib/core/adjudicate.js +94 -0
  15. package/lib/core/backfill.js +32 -0
  16. package/lib/core/block-write.js +85 -0
  17. package/lib/core/decide.js +159 -0
  18. package/lib/core/embed.js +122 -0
  19. package/lib/core/env.js +72 -0
  20. package/lib/core/extract.js +151 -0
  21. package/lib/core/host.js +81 -0
  22. package/lib/core/importers.js +261 -0
  23. package/lib/core/llm.js +49 -0
  24. package/lib/{memories.js → core/panel-read.js} +80 -136
  25. package/lib/core/pipeline.js +95 -0
  26. package/lib/core/schema.js +123 -0
  27. package/lib/core/search.js +191 -0
  28. package/lib/core/store.js +347 -0
  29. package/lib/core/tools.js +182 -0
  30. package/lib/core/write.js +89 -0
  31. package/lib/extract.js +1 -39
  32. package/lib/index.js +194 -128
  33. package/lib/panel.js +13 -11
  34. package/lib/review.js +5 -1
  35. package/lib/structure.js +6 -1
  36. package/locale/en.json +7 -0
  37. package/locale/zh.json +7 -0
  38. package/package.json +10 -7
  39. package/scripts/backfill-core.mjs +53 -0
  40. package/scripts/import-core.mjs +56 -0
  41. package/scripts/smoke-config.mjs +12 -14
  42. package/scripts/smoke-extract.mjs +19 -40
  43. package/scripts/smoke-package.mjs +88 -27
  44. package/scripts/smoke-panel.mjs +293 -162
  45. package/src/client/index.js +703 -166
  46. package/lib/blocks-write.js +0 -121
  47. package/lib/cli.js +0 -90
  48. package/lib/reindex.js +0 -32
@@ -0,0 +1,41 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300" fill="none">
2
+ <!-- Memory panel: the block list that is injected, one row selected. -->
3
+ <rect x="32" y="44" width="340" height="212" rx="16" fill="#94A3B8" fill-opacity="0.08" stroke="#94A3B8" stroke-opacity="0.55" stroke-width="1.5"/>
4
+ <rect x="52" y="60" width="78" height="16" rx="8" fill="#4D6BFE" fill-opacity="0.9"/>
5
+ <rect x="142" y="65" width="84" height="6" rx="3" fill="#94A3B8" fill-opacity="0.45"/>
6
+ <rect x="300" y="65" width="40" height="6" rx="3" fill="#94A3B8" fill-opacity="0.25"/>
7
+
8
+ <circle cx="58" cy="104" r="4" fill="#4D6BFE"/>
9
+ <rect x="72" y="100" width="176" height="8" rx="4" fill="#94A3B8" fill-opacity="0.4"/>
10
+ <rect x="300" y="100" width="40" height="8" rx="4" fill="#94A3B8" fill-opacity="0.22"/>
11
+
12
+ <rect x="52" y="120" width="300" height="28" rx="9" fill="#4D6BFE" fill-opacity="0.12" stroke="#4D6BFE" stroke-opacity="0.55" stroke-width="1.5"/>
13
+ <circle cx="68" cy="134" r="4" fill="#4D6BFE"/>
14
+ <rect x="82" y="130" width="150" height="8" rx="4" fill="#4D6BFE" fill-opacity="0.8"/>
15
+ <rect x="300" y="130" width="40" height="8" rx="4" fill="#4D6BFE" fill-opacity="0.35"/>
16
+
17
+ <circle cx="58" cy="170" r="4" fill="#94A3B8" fill-opacity="0.6"/>
18
+ <rect x="72" y="166" width="196" height="8" rx="4" fill="#94A3B8" fill-opacity="0.3"/>
19
+ <rect x="300" y="166" width="40" height="8" rx="4" fill="#94A3B8" fill-opacity="0.2"/>
20
+
21
+ <circle cx="58" cy="204" r="4" fill="#94A3B8" fill-opacity="0.4"/>
22
+ <rect x="72" y="200" width="132" height="8" rx="4" fill="#94A3B8" fill-opacity="0.24"/>
23
+
24
+ <path d="M52 232h300" stroke="#94A3B8" stroke-opacity="0.35" stroke-width="1.5"/>
25
+
26
+ <!-- Relation graph: memories as nodes, relations as weighted edges. -->
27
+ <g stroke="#94A3B8" stroke-opacity="0.55" stroke-width="2">
28
+ <path d="M470 96 548 116"/>
29
+ <path d="M470 96 516 170"/>
30
+ <path d="M548 116 516 170"/>
31
+ <path d="M516 170 452 190"/>
32
+ <path d="M516 170 566 206"/>
33
+ <path d="M452 190 492 230"/>
34
+ </g>
35
+ <circle cx="516" cy="170" r="9" fill="#4D6BFE"/>
36
+ <circle cx="470" cy="96" r="7" fill="#94A3B8" fill-opacity="0.75"/>
37
+ <circle cx="548" cy="116" r="7" fill="#94A3B8" fill-opacity="0.75"/>
38
+ <circle cx="452" cy="190" r="7" fill="#94A3B8" fill-opacity="0.75"/>
39
+ <circle cx="566" cy="206" r="7" fill="#94A3B8" fill-opacity="0.6"/>
40
+ <circle cx="492" cy="230" r="7" fill="#94A3B8" fill-opacity="0.6"/>
41
+ </svg>
package/icon.svg ADDED
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none">
2
+ <rect x="6.5" y="7.5" width="23" height="21" rx="5" stroke="#4D6BFE" stroke-width="2"/>
3
+ <circle cx="11.6" cy="14" r="1.7" fill="#4D6BFE"/>
4
+ <circle cx="11.6" cy="19" r="1.7" fill="#4D6BFE" opacity="0.55"/>
5
+ <circle cx="11.6" cy="24" r="1.7" fill="#4D6BFE" opacity="0.3"/>
6
+ <path d="M16.4 14h8.4" stroke="#4D6BFE" stroke-width="2" stroke-linecap="round"/>
7
+ <path d="M16.4 19h8.4" stroke="#4D6BFE" stroke-width="2" stroke-linecap="round" opacity="0.55"/>
8
+ <path d="M16.4 24h5.4" stroke="#4D6BFE" stroke-width="2" stroke-linecap="round" opacity="0.3"/>
9
+ </svg>
package/lib/blocks.js CHANGED
@@ -17,9 +17,18 @@
17
17
  * ever SELECTs, and SQLite handles concurrent readers fine.
18
18
  */
19
19
  import { DatabaseSync } from 'node:sqlite'
20
+ import { homedir } from 'node:os'
21
+ import { join } from 'node:path'
20
22
 
21
- /** Default store; matches MEMVAULT_DB_PATH in the MemVault project .env. */
22
- export const DEFAULT_DB_PATH = process.env.MEMVAULT_DB_PATH ?? 'D:/Claude_code/memory/data/memvault.db'
23
+ /**
24
+ * Default store: the plugin's own database, beside the rest of its DSH state.
25
+ *
26
+ * `MEMVAULT_DB_PATH` still wins when a user points it elsewhere, and the plugin's
27
+ * real path is resolved once in `core/host.js` (`DSH_MEMVAULT_CORE_DB` for tests
28
+ * and overrides). This constant exists for direct module use and the smoke test;
29
+ * it is deliberately not an author-specific absolute path.
30
+ */
31
+ export const DEFAULT_DB_PATH = process.env.MEMVAULT_DB_PATH ?? join(homedir(), '.dsh', 'memvault', 'memvault.db')
23
32
 
24
33
  /**
25
34
  * Which blocks to inject. MemVault keys blocks by `(scope_type, scope_id)`