dsh-memory-engine 0.8.2 → 0.8.3

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.
package/README.md CHANGED
@@ -11,20 +11,27 @@ DSH 插件的本地记忆引擎,带神经网络可视化。它让 agent 保存
11
11
 
12
12
  ![记忆图谱](docs/screenshot.png)
13
13
 
14
- 当前版本:0.8.1。Node ≥22,零新增依赖。四套配色与球体、星系、大脑神经网络三种布局自由组合,默认保留原来的经典星空与球体。自动记忆默认关闭,由用户在图谱头部或设置页手动打开;开启后每轮对话会额外调用一次模型,可能产生费用。自动导入默认只收聊天会话的用户消息,支持来源白名单、工作指令过滤、流程话过滤、规则分类、错误原因、一次性重扫和账本清理。
14
+ 当前版本:0.8.2。Node ≥22,零新增依赖。四套配色与球体、星系、大脑神经网络三种布局自由组合,默认保留原来的经典星空与球体。自动记忆默认关闭,由用户在图谱头部或设置页手动打开;开启后每轮对话会额外调用一次模型,可能产生费用。自动导入默认只收聊天会话的用户消息,支持来源白名单、工作指令过滤、流程话过滤、规则分类、错误原因、一次性重扫和账本清理。
15
15
 
16
16
  ## 安装(重要)
17
17
 
18
18
  **请指定版本号安装。** pnpm 可能因为本地缓存的包元数据解析到旧版本(实测 `pnpm add dsh-memory-engine` 会装到 0.7.5):
19
19
 
20
20
  ```bash
21
- pnpm add dsh-memory-engine@0.8.1
21
+ pnpm add dsh-memory-engine@0.8.2
22
22
  ```
23
23
 
24
24
  装完重启 DSH,标题栏出现「🧠 记忆图谱」。
25
25
 
26
26
  0.7.5 及更早版本存在 `memory_map` 参数名撞 JSON Schema 保留字的问题,调用时整轮返回 400,请勿使用。
27
27
 
28
+ ## 0.8.2 关闭按钮更好点
29
+
30
+ - 关闭按钮加大点击区域(高 42px、内边距 11×20),不再需要瞄准
31
+ - 详情卡的 × 放大到 40×40
32
+ - 外观面板的关闭键同步放大
33
+ - Esc 逐层关闭:引导 → 详情 → 外观面板 → 整个图谱(原有逻辑,已在文档写明)
34
+
28
35
  ## 0.8.1 图谱外观
29
36
 
30
37
  图谱头部点击「外观」,可组合选择四套配色与三种布局;「设置」页也有同一组选项。点选立即应用并保存,刷新后保留;保存失败会回滚并显示原因。「恢复默认」同时恢复经典星空和球体。
package/lib/client.js CHANGED
@@ -596,7 +596,7 @@ function frame(now) {
596
596
  }
597
597
 
598
598
  var defaultSettings = { hideButton: false, showGuideOnEmpty: true, graphTheme: "classic", graphLayout: "sphere", autoMemory: { enabled: false, maxPerTurn: 2, dailyCap: 40 }, showAutoMemoryCostHint: true };
599
- var actionStyle = { padding: "7px 12px", borderRadius: "8px", border: "1px solid var(--memory-border,#6999b8)", background: "var(--memory-button,#102236)", color: "var(--memory-text,#e2f4ff)", font: "inherit", cursor: "pointer" };
599
+ var actionStyle = { padding: "7px 12px", borderRadius: "8px", border: "1px solid var(--memory-border,#6999b8)", background: "var(--memory-button,#102236)", color: "var(--memory-text,#e2f4ff)", font: "inherit", cursor: "pointer", whiteSpace: "nowrap", flexShrink: 0 };
600
600
  var closeStyle = Object.assign({}, actionStyle, { padding: "11px 20px", minHeight: "42px", fontWeight: 700, letterSpacing: "0.02em" });
601
601
  var fieldStyle = { boxSizing: "border-box", padding: "10px 12px", borderRadius: "8px", border: "1px solid #35536b", background: "#091422", color: "#e2f4ff", font: "inherit", minWidth: 0 };
602
602
  var kinds = ["知识", "印象", "对话", "事件", "日记"];
@@ -1372,7 +1372,7 @@ function frame(now) {
1372
1372
  React.createElement("style", null, "@keyframes dsh-memory-detail-in{from{opacity:0;transform:translateX(24px)}to{opacity:1;transform:translateX(0)}}@media(prefers-reduced-motion:reduce){[data-memory-engine-detail]{animation:none!important}}"),
1373
1373
  React.createElement("div", {
1374
1374
  "data-memory-engine-controls": "true",
1375
- style: { position: "absolute", top: "16px", right: "18px", zIndex: 1, display: "flex", gap: "8px" },
1375
+ style: { position: "absolute", top: "16px", right: "18px", zIndex: 1, display: "flex", flexWrap: "wrap", justifyContent: "flex-end", alignItems: "center", gap: "8px", rowGap: "8px", maxWidth: "calc(100% - 36px)" },
1376
1376
  }, React.createElement("div", { role: "tablist", "aria-label": "记忆面板", style: { display: "flex", gap: "4px", marginRight: "8px" } },
1377
1377
  [["map", "图谱"], ["memories", "记忆"], ["settings", "设置"]].map(function (entry) {
1378
1378
  return React.createElement("button", { key: entry[0], type: "button", role: "tab", "aria-selected": tab === entry[0], "data-memory-engine-tab": entry[0],
@@ -1388,7 +1388,7 @@ function frame(now) {
1388
1388
  onClick: closeMap,
1389
1389
  "aria-label": "关闭记忆图谱",
1390
1390
  title: "关闭(Esc)",
1391
- style: closeStyle,
1391
+ style: Object.assign({}, closeStyle, { marginLeft: "4px" }),
1392
1392
  }, "关闭 ×")), appearanceOpen ? React.createElement("section", { ref: appearancePanel, role: "dialog", "aria-label": "外观", "data-memory-engine-appearance-panel": "true",
1393
1393
  style: { position: "absolute", top: "62px", right: "18px", zIndex: 3, boxSizing: "border-box", width: "min(380px,calc(100vw - 36px))", maxHeight: "calc(100vh - 90px)", overflowY: "auto",
1394
1394
  padding: "18px", border: "1px solid var(--memory-border,#3976a0)", borderRadius: "12px", background: "var(--memory-panel,#07111f)", boxShadow: "0 12px 35px #0004" } },
package/lib/client.src.js CHANGED
@@ -17,7 +17,7 @@ window.__ModuleLoader__.load({
17
17
  /* __GRAPH_LAYOUT__ */
18
18
 
19
19
  var defaultSettings = { hideButton: false, showGuideOnEmpty: true, graphTheme: "classic", graphLayout: "sphere", autoMemory: { enabled: false, maxPerTurn: 2, dailyCap: 40 }, showAutoMemoryCostHint: true };
20
- var actionStyle = { padding: "7px 12px", borderRadius: "8px", border: "1px solid var(--memory-border,#6999b8)", background: "var(--memory-button,#102236)", color: "var(--memory-text,#e2f4ff)", font: "inherit", cursor: "pointer" };
20
+ var actionStyle = { padding: "7px 12px", borderRadius: "8px", border: "1px solid var(--memory-border,#6999b8)", background: "var(--memory-button,#102236)", color: "var(--memory-text,#e2f4ff)", font: "inherit", cursor: "pointer", whiteSpace: "nowrap", flexShrink: 0 };
21
21
  var closeStyle = Object.assign({}, actionStyle, { padding: "11px 20px", minHeight: "42px", fontWeight: 700, letterSpacing: "0.02em" });
22
22
  var fieldStyle = { boxSizing: "border-box", padding: "10px 12px", borderRadius: "8px", border: "1px solid #35536b", background: "#091422", color: "#e2f4ff", font: "inherit", minWidth: 0 };
23
23
  var kinds = ["知识", "印象", "对话", "事件", "日记"];
@@ -793,7 +793,7 @@ window.__ModuleLoader__.load({
793
793
  React.createElement("style", null, "@keyframes dsh-memory-detail-in{from{opacity:0;transform:translateX(24px)}to{opacity:1;transform:translateX(0)}}@media(prefers-reduced-motion:reduce){[data-memory-engine-detail]{animation:none!important}}"),
794
794
  React.createElement("div", {
795
795
  "data-memory-engine-controls": "true",
796
- style: { position: "absolute", top: "16px", right: "18px", zIndex: 1, display: "flex", gap: "8px" },
796
+ style: { position: "absolute", top: "16px", right: "18px", zIndex: 1, display: "flex", flexWrap: "wrap", justifyContent: "flex-end", alignItems: "center", gap: "8px", rowGap: "8px", maxWidth: "calc(100% - 36px)" },
797
797
  }, React.createElement("div", { role: "tablist", "aria-label": "记忆面板", style: { display: "flex", gap: "4px", marginRight: "8px" } },
798
798
  [["map", "图谱"], ["memories", "记忆"], ["settings", "设置"]].map(function (entry) {
799
799
  return React.createElement("button", { key: entry[0], type: "button", role: "tab", "aria-selected": tab === entry[0], "data-memory-engine-tab": entry[0],
@@ -809,7 +809,7 @@ window.__ModuleLoader__.load({
809
809
  onClick: closeMap,
810
810
  "aria-label": "关闭记忆图谱",
811
811
  title: "关闭(Esc)",
812
- style: closeStyle,
812
+ style: Object.assign({}, closeStyle, { marginLeft: "4px" }),
813
813
  }, "关闭 ×")), appearanceOpen ? React.createElement("section", { ref: appearancePanel, role: "dialog", "aria-label": "外观", "data-memory-engine-appearance-panel": "true",
814
814
  style: { position: "absolute", top: "62px", right: "18px", zIndex: 3, boxSizing: "border-box", width: "min(380px,calc(100vw - 36px))", maxHeight: "calc(100vh - 90px)", overflowY: "auto",
815
815
  padding: "18px", border: "1px solid var(--memory-border,#3976a0)", borderRadius: "12px", background: "var(--memory-panel,#07111f)", boxShadow: "0 12px 35px #0004" } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-memory-engine",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "DSH 本地记忆插件:自动记忆、遗忘曲线、关键词关联、可检索可编辑,数据留在本机。",
5
5
  "keywords": [
6
6
  "dsh",