sage-mem 2.32.0 → 2.33.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.
package/README.en.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  **Cross-session memory for DeepSeek Harness — plain markdown files, no database, no worker.**
14
14
 
15
- **Current release: `2.32.0`** — the npm badge above is the dynamic source of truth. **Contract baseline: `1.0.0`** — the first stable release, whose public commitments, the capability boundaries and the list of things it explicitly cannot do are frozen in the
15
+ **Current release: `2.33.0`** — the npm badge above is the dynamic source of truth. **Contract baseline: `1.0.0`** — the first stable release, whose public commitments, the capability boundaries and the list of things it explicitly cannot do are frozen in the
16
16
  [frozen contract](https://github.com/gezi-wen/sage-mem/blob/main/docs/1.0.0-contract.md).
17
17
 
18
18
  If it is useful to you, a Star is the most direct feedback.
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  > File-based cross-session memory for DeepSeek Harness — every memory is a plain markdown file you can open, edit and delete. No database, no worker, no port.
16
16
 
17
- **当前发布版本:`2.32.0`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
17
+ **当前发布版本:`2.33.0`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
18
18
  [契约冻结](https://github.com/gezi-wen/sage-mem/blob/main/docs/1.0.0-contract.md)。
19
19
 
20
20
  如果它对你有用,给个 Star 是最直接的反馈。
package/lib/client.js CHANGED
@@ -7365,6 +7365,20 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
7365
7365
  });
7366
7366
  }
7367
7367
 
7368
+ /**
7369
+ * 失焦 / 回车时的保存(2.33.0):**只在真的变了**才发请求。
7370
+ *
7371
+ * 为什么去掉那个「保存」按钮:一屏里唯一的主按钮不该是「保存」——
7372
+ * 用户改完数字就去看别的了,那一下等于白改(外部访问页 2.29.0 已经踩过同一个坑)。
7373
+ */
7374
+ function saveStrengthIfChanged() {
7375
+ const next = pct(draft);
7376
+ // 没变就不发请求;变了才走 `saveStrength` —— 它带「必须是整数、0~100」的本地校验,
7377
+ // 这里另算一遍只会让两处口径分叉。
7378
+ if (next === pending) return;
7379
+ saveStrength();
7380
+ }
7381
+
7368
7382
  /** 开关:开 → 回到草稿里的值(默认 70);关 → 写 0。 */
7369
7383
  function toggle() {
7370
7384
  if (pending > 0) { save(0, t("lab.notice.off")); return; }
@@ -7416,12 +7430,17 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
7416
7430
  value: draft,
7417
7431
  disabled: busy || !memSet,
7418
7432
  onChange: function (e) { setDraft(e.target.value); },
7433
+ // 2.33.0:与外部访问页同一套 —— **失焦即存、回车即存**,不再需要「保存」按钮。
7434
+ // 一个数字输入框配一个主按钮,会把这一屏唯一的行动力放在保存上(其实改完就走等于没改)。
7435
+ onBlur: saveStrengthIfChanged,
7436
+ onKeyDown: function (e) {
7437
+ if (e.key !== "Enter") return;
7438
+ e.preventDefault();
7439
+ saveStrengthIfChanged();
7440
+ },
7419
7441
  }),
7420
7442
  h("span", { className: "smem-muted", key: "u" }, t("lab.unit")),
7421
- h("button", {
7422
- type: "button", className: "smem-btn smem-btn-primary", key: "save",
7423
- disabled: busy || !memSet, onClick: saveStrength,
7424
- }, busy ? t("lab.action.saving") : t("lab.action.save")),
7443
+ busy ? h("span", { className: "smem-muted", key: "busy" }, t("lab.action.saving")) : null,
7425
7444
  ]),
7426
7445
  h("div", { className: "smem-autodream-note", key: "hint" }, t("lab.hint.strength")),
7427
7446
  h("div", { className: "smem-autodream-note", key: "restart" },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sage-mem",
3
3
  "description": "Cross-session memory for DeepSeek Harness — plain markdown files, no database, no worker.",
4
- "version": "2.32.0",
4
+ "version": "2.33.0",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "icon": "./icon.png",