sage-mem 2.15.0 → 2.15.1

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.15.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.15.1`** — 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.15.0`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
17
+ **当前发布版本:`2.15.1`** —— 顶部 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
@@ -4846,10 +4846,12 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
4846
4846
  "todo.filter.openTitle": "只显示未完成(待删除块照旧显示:它是待清空的队列)",
4847
4847
  "todo.filter.all": "全部",
4848
4848
  "todo.filter.allTitle": "连旧文件里遗留的 - [x] 行一起显示",
4849
- "todo.undoDepth.label": "撤销",
4849
+ "todo.undoDepth.label": "撤销上限",
4850
4850
  "todo.undoDepth.option": "{n} 步",
4851
4851
  "todo.action.undoTitle": "撤销上一步(栈深 {depth} 步,只在本次页面里有效)",
4852
4852
  "todo.action.archive": "搬进流水({count})",
4853
+ "todo.action.archiveConfirm": "确认搬进流水({count})",
4854
+ "todo.action.archiveConfirm.title": "会写进 {file},并从清单删掉 {count} 行;这一步不可撤销",
4853
4855
  "todo.notice.archived": "已把 {count} 条搬进 {file},并从清单里删掉(这一步不可撤销)",
4854
4856
  "todo.notice.archivedDup": "这些条目在 {file} 里都已经有了,只删掉了清单里那几行",
4855
4857
  "todo.notice.archiveStale": "{count} 条已写进流水,但清单刚被别处改过:清单里那几行**没删**,刷新后再点一次即可(重复会被跳过)",
@@ -5487,10 +5489,12 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
5487
5489
  "todo.filter.openTitle": "Show open items only (the pending-deletion block stays: it is a queue to clear)",
5488
5490
  "todo.filter.all": "All",
5489
5491
  "todo.filter.allTitle": "Also show legacy - [x] lines left in the file",
5490
- "todo.undoDepth.label": "Undo",
5492
+ "todo.undoDepth.label": "Undo limit",
5491
5493
  "todo.undoDepth.option": "{n} steps",
5492
5494
  "todo.action.undoTitle": "Undo the last edit (stack depth {depth}; in-memory only)",
5493
5495
  "todo.action.archive": "Move to log ({count})",
5496
+ "todo.action.archiveConfirm": "Confirm move ({count})",
5497
+ "todo.action.archiveConfirm.title": "Appends to {file} and removes {count} line(s) from the list; this cannot be undone",
5494
5498
  "todo.notice.archived": "Moved {count} item(s) into {file} and removed them from the list (this cannot be undone)",
5495
5499
  "todo.notice.archivedDup": "Those items were already in {file}; only the list lines were removed",
5496
5500
  "todo.notice.archiveStale": "{count} item(s) were appended to the log, but the list changed elsewhere: its lines were NOT removed. Refresh and click again — duplicates are skipped.",
@@ -10165,7 +10169,10 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
10165
10169
  current.items.push(item);
10166
10170
  // 插入点 = 本条之后:节尾最后一条的下方,不会被后面的空行 / 下一节吃掉。
10167
10171
  current.insertAt = i + 1;
10168
- if (item.done) done += 1; else open += 1;
10172
+ // 2.15.1:**「长期约束」不算未完成**。那一节的标题自己写着「不是待办」,
10173
+ // 把它计入「N 条未完成」既骗人又和标题冲突(真机截图里 30 条里有 8 条是约束)。
10174
+ // 已完成计数不受影响:待删除块里的条目本来就是 done。
10175
+ if (item.done) done += 1; else if (current.kind !== "constraint") open += 1;
10169
10176
  lastItem = item;
10170
10177
  continue;
10171
10178
  }
@@ -10448,10 +10455,23 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
10448
10455
  }
10449
10456
  const sDraft = react.useState("");
10450
10457
  const draft = sDraft[0], setDraft = sDraft[1];
10458
+ // 2.15.1:「搬进流水」两步确认 —— 它不可撤销(流水那半撤不回来),
10459
+ // 点一下就把记忆流水写掉、清单行删掉,不该是一次误触就能完成的动作。
10460
+ const sConfirm = react.useState(false);
10461
+ const confirming = sConfirm[0], setConfirming = sConfirm[1];
10462
+ react.useEffect(function () {
10463
+ // 块被清空 / 换了一份文件时,别让确认态悬着。
10464
+ if (blockCountRaw() === 0) setConfirming(false);
10465
+ }, [props.doneCount, sec.items.length]);
10466
+ function blockCountRaw() {
10467
+ return typeof props.doneCount === "number" ? props.doneCount : sec.items.length;
10468
+ }
10451
10469
  const openCount = sec.items.filter(function (it) { return !it.done; }).length;
10452
10470
  const doneCount = sec.items.length - openCount;
10453
10471
  // 「清空全部」清的是**整个块**(不是当前筛出来的这几条),所以按钮上的数字要取块的真实条数。
10454
- const blockCount = typeof props.doneCount === "number" ? props.doneCount : sec.items.length;
10472
+ const blockCount = blockCountRaw();
10473
+ // 2.15.1:待删除块里没有「未完成」,别画那个永远是 0 的「0 / N」。
10474
+ const countText = isDone ? String(doneCount || blockCount) : String(openCount) + (doneCount > 0 ? " / " + String(doneCount) : "");
10455
10475
  return h("section", { className: "smem-todo-group" + (isDone ? " smem-todo-group-done" : "") }, [
10456
10476
  // 标题行是**行**不是按钮:右边还要放「清空全部」,按钮套按钮在浏览器里会互相吃掉。
10457
10477
  h("div", { key: "head", className: "smem-todo-group-head" }, [
@@ -10463,17 +10483,35 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
10463
10483
  }, [
10464
10484
  h("span", { key: "chev", className: "smem-todo-chev" }, collapsed ? "▸" : "▾"),
10465
10485
  h("span", { key: "t", className: "smem-todo-group-title" }, sec.title || (isDone ? t("todo.doneGroup") : t(TODO_SECTION_FALLBACK))),
10466
- h("span", { key: "n", className: "smem-todo-count" }, String(openCount) + (doneCount > 0 ? " / " + String(doneCount) : "")),
10486
+ h("span", { key: "n", className: "smem-todo-count" }, countText),
10467
10487
  ]),
10468
10488
  isDone && blockCount > 0
10489
+ ? (confirming
10490
+ ? h("button", {
10491
+ key: "archiveConfirm",
10492
+ type: "button",
10493
+ className: "smem-todo-mini smem-todo-archive smem-todo-del",
10494
+ title: t("todo.action.archiveConfirm.title", { count: blockCount, file: TODO_LOG_FILE }),
10495
+ disabled: props.busy,
10496
+ onClick: function () { setConfirming(false); props.onArchive(sec); },
10497
+ }, t("todo.action.archiveConfirm", { count: blockCount }))
10498
+ : h("button", {
10499
+ key: "archive",
10500
+ type: "button",
10501
+ className: "smem-todo-mini smem-todo-archive",
10502
+ title: t("todo.action.archive", { count: blockCount, file: TODO_LOG_FILE }),
10503
+ disabled: props.busy,
10504
+ onClick: function () { setConfirming(true); },
10505
+ }, t("todo.action.archive", { count: blockCount, file: TODO_LOG_FILE })))
10506
+ : null,
10507
+ isDone && blockCount > 0 && confirming
10469
10508
  ? h("button", {
10470
- key: "archive",
10509
+ key: "archiveCancel",
10471
10510
  type: "button",
10472
- className: "smem-todo-mini smem-todo-archive",
10473
- title: t("todo.action.archive", { count: blockCount, file: TODO_LOG_FILE }),
10511
+ className: "smem-todo-mini",
10474
10512
  disabled: props.busy,
10475
- onClick: function () { props.onArchive(sec); },
10476
- }, t("todo.action.archive", { count: blockCount, file: TODO_LOG_FILE }))
10513
+ onClick: function () { setConfirming(false); },
10514
+ }, t("todo.action.cancel"))
10477
10515
  : null,
10478
10516
  isDone && blockCount > 0
10479
10517
  ? h("button", {
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.15.0",
4
+ "version": "2.15.1",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "icon": "./icon.png",