@modusensus/dsh-mneme 0.7.9 → 0.7.10

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@modusensus/dsh-mneme",
3
- "version": "0.7.7",
3
+ "version": "0.7.10",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@modusensus/dsh-mneme",
9
- "version": "0.7.7",
9
+ "version": "0.7.10",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@huggingface/transformers": "^4.2.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@modusensus/dsh-mneme",
3
3
  "description": "Cross-session memory plugin for DeepSeek Harness with autoDream consolidation: SQLite store, Markdown mirrors, 7 model tools, automatic injection, session summarization, user profile/rules, custom slash commands, vector (semantic) search, and a Web GUI panel",
4
- "version": "0.7.9",
4
+ "version": "0.7.10",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -106,9 +106,10 @@ console.log("【1】插件装载");
106
106
  const checks = [];
107
107
  checks.push(["注册 7 个模型工具", registeredTools.length === 7]);
108
108
  checks.push(["注册 2 个注入上下文", injectContexts.length === 2 && injectContexts[0].name === "memory"]);
109
- // 契约是 9 条 exact 路由;prefix fallback(/api/dsh-mneme 404)是兜底,
110
- // 不计入路由数。
111
- checks.push(["注册 9 API 路由", apiRoutes.filter((r) => r.kind === "exact").length === 9]);
109
+ // 契约是 20 条 exact 路由(实体清单接口后由 19 条扩到 20 条);该断言此前
110
+ // 长期停在 9 条失去意义,现与 src/api.js 的 routes 返回值对齐,prefix
111
+ // fallback(/api/dsh-mneme 404)是兜底,不计入路由数。
112
+ checks.push(["注册 20 条 API 路由", apiRoutes.filter((r) => r.kind === "exact").length === 20]);
112
113
  for (const [label, ok] of checks) console.log(` ${ok ? "✅" : "❌"} ${label}`);
113
114
  if (!checks.every(([, ok]) => ok)) { console.log("\n装载检查失败,中止。"); process.exit(1); }
114
115
  console.log(` 工具:${registeredTools.map((t) => t.name).join(", ")}\n`);
@@ -637,6 +637,25 @@ export function createApi(ctx, service, settings, commands, embedder, semantic =
637
637
  }
638
638
  });
639
639
 
640
+ // --- entity directory (entity gene v0.3.0): read-only list for the UI ---
641
+ // Flat entity list (newest-seen first). Attributes and relations stay on
642
+ // their own per-entity endpoints, the directory only carries the columns
643
+ // the rail needs: name, type, mention_count, first/last seen.
644
+ register({
645
+ kind: "exact",
646
+ path: "/api/dsh-mneme/entities",
647
+ handler(req, res) {
648
+ try {
649
+ const url = new URL(req.url, "http://localhost");
650
+ const limit = Math.min(1000, Math.max(1, Number(url.searchParams.get("limit") ?? 500) || 500));
651
+ const entities = service.listEntities?.({ limit }) ?? [];
652
+ sendJson(res, 200, { entities, total: entities.length });
653
+ } catch {
654
+ sendJson(res, 500, { error: "internal" });
655
+ }
656
+ }
657
+ });
658
+
640
659
  // --- health: mirror sync state (F-NEW-03 / v0.3.6) ---
641
660
  // Auth-gated; only returns a sanitized error code (never raw last_error which
642
661
  // may leak paths/token-like strings/internal hosts). On state read failure it
@@ -799,7 +818,7 @@ export function createApi(ctx, service, settings, commands, embedder, semantic =
799
818
  });
800
819
 
801
820
  return {
802
- routes: 19,
821
+ routes: 20,
803
822
  dispose: () => {
804
823
  for (const dispose of disposers) dispose();
805
824
  }