sage-mem 1.5.0 → 1.5.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.md CHANGED
@@ -538,6 +538,9 @@ No. Serialized writes guarantee only **in-process** ordering; there is no file l
538
538
  **Can I do without autodream?**
539
539
  Yes, it is off by default. It and archiving are two different things: archiving is a deterministic rule (by idle days), calls no model and costs nothing.
540
540
 
541
+ **The plugin market says "the registry's latest is older than the installed version, updating would downgrade"?**
542
+ That is a **stale `/latest` cache on the download-region mirror**, not a mis-published package: the mirror's full metadata (the document pnpm reads) already has the new version, while the `/<pkg>/latest` shortcut still serves an old one. Retry after a minute or two; if it persists, temporarily switch the market's download region to "Global" (the origin registry, registry.npmjs.org), update, then switch back. To check what is actually published: `npm view sage-mem dist-tags`.
543
+
541
544
  ## Uninstall
542
545
 
543
546
  ```bash
package/README.zh.md CHANGED
@@ -543,6 +543,9 @@ npm test # 全部断言(含三条守卫)
543
543
  **能不用自动做梦吗?**
544
544
  能,它默认就是关闭的。它和归档是两件事:归档是确定性规则(按闲置天数),不调模型、不花钱。
545
545
 
546
+ **插件市场报「registry 上的最新版比已装还旧,更新会降级」?**
547
+ 那是**下载地区镜像的 `/latest` 缓存滞后**,不是包发错了:镜像的全量元数据(pnpm 读的那份)已经是新版,但 `/<包>/latest` 这个快捷入口还缓存着旧值。先等一两分钟重试;仍然不行就把插件市场的「下载地区」临时切到「全球」(直连 registry.npmjs.org)更新,完成后再切回。核对实际发布版本:`npm view sage-mem dist-tags`。
548
+
546
549
  ## 卸载
547
550
 
548
551
  ```bash
package/lib/client.js CHANGED
@@ -2160,6 +2160,11 @@ const StarmapRuntime = (function (require, _react) {
2160
2160
  ".smem-update{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid var(--dsw-alias-brand-primary,#4d76e6);border-radius:8px;padding:6px 10px;font-size:12px;background:var(--dsw-alias-bg-layer-1);}",
2161
2161
  ".smem-update-link{color:var(--dsw-alias-brand-primary,#4d76e6);text-decoration:underline;}",
2162
2162
  ".smem-update-x{margin-left:auto;border:0;background:transparent;color:inherit;cursor:pointer;font-size:14px;line-height:1;padding:0 2px;}",
2163
+ // ── 1.5.1:筛选汇总行(有筛选才出现)──
2164
+ ".smem-filter-summary{width:100%;display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);}",
2165
+ ".smem-sum-item{display:inline-flex;align-items:center;gap:2px;border:1px solid var(--dsw-alias-border-l1);border-radius:999px;padding:1px 8px;}",
2166
+ ".smem-sum-x{border:0;background:transparent;color:inherit;cursor:pointer;font-size:12px;line-height:1;padding:0 0 0 2px;}",
2167
+ ".smem-sum-clear{border:0;background:transparent;color:var(--dsw-alias-brand-primary,#4d76e6);font-size:12px;font-family:inherit;cursor:pointer;padding:2px 4px;}",
2163
2168
  // ── 1.5.0:动作分组 / 长文 clamp / 空态骨架 / 窄窗口 ──
2164
2169
  ".smem-actions-sep{width:1px;height:16px;background:var(--dsw-alias-border-l2);margin:0 2px;align-self:center;}",
2165
2170
  ".smem-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;cursor:pointer;}",
@@ -3749,6 +3754,8 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
3749
3754
  const sNotice = react.useState("");
3750
3755
  const notice = sNotice[0], setNotice = sNotice[1];
3751
3756
  const sQuery = react.useState("");
3757
+ const sTagOpen = react.useState(false);
3758
+ const tagOpen = sTagOpen[0], setTagOpen = sTagOpen[1];
3752
3759
  const query = sQuery[0], setQuery = sQuery[1];
3753
3760
  const sExpanded = react.useState({});
3754
3761
  const expanded = sExpanded[0], setExpanded = sExpanded[1];
@@ -4366,6 +4373,17 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
4366
4373
  return hay.indexOf(q) >= 0;
4367
4374
  });
4368
4375
  const hasFilter = !!(statusFilter !== "all" || typeFilter.length || tagFilter.length || q);
4376
+ // 标签最多平铺 6 个:再多就把筛选条撑成三行,而真正常用的标签通常就那几个。
4377
+ const TAG_VISIBLE_MAX = 6;
4378
+ const tagShown = tagOpen ? tagList : tagList.slice(0, TAG_VISIBLE_MAX);
4379
+ const tagHiddenCount = tagList.length - tagShown.length;
4380
+ // 汇总行里每一项都是「现在正在筛什么 + 单独撤掉它」;只出现有筛选时。
4381
+ function sumItem(label, onRemove) {
4382
+ return h("span", { className: "smem-sum-item", key: "sum-" + label }, [
4383
+ label,
4384
+ h("button", { type: "button", className: "smem-sum-x", key: "x", title: "撤掉这项筛选", onClick: onRemove }, "×"),
4385
+ ]);
4386
+ }
4369
4387
  // 两个计数永远一起露脸:用户不必先筛状态才知道档案馆里有没有东西。
4370
4388
  const headerCount = (hasFilter ? "筛出 " + String(filtered.length) + " / " + String(statusItems.length) + " · " : "") +
4371
4389
  "活动中 " + String(items.length) + " · 已归档 " + String(archiveItems.length);
@@ -4603,6 +4621,24 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
4603
4621
  // 三排筛选:状态 / 类型 / 标签。组内 OR、组间 AND,再与搜索框 AND。
4604
4622
  tab === "files" && totalCount
4605
4623
  ? h("div", { className: "smem-filters", key: "filters" }, [
4624
+ hasFilter
4625
+ ? h("div", { className: "smem-filter-summary", key: "sum" }, [
4626
+ statusFilter !== "all"
4627
+ ? sumItem("状态:" + (statusFilter === "active" ? "活动中" : "已归档"), function () { setStatusFilter("all"); })
4628
+ : null,
4629
+ typeFilter.map(function (t) {
4630
+ return sumItem("类型:" + (TYPE_LABEL[t] || t), function () { toggleIn(setTypeFilter, t); });
4631
+ }),
4632
+ tagFilter.map(function (g) {
4633
+ return sumItem("标签:#" + g, function () { toggleIn(setTagFilter, g); });
4634
+ }),
4635
+ query.trim() ? sumItem("搜索:" + query.trim(), function () { setQuery(""); }) : null,
4636
+ h("button", {
4637
+ type: "button", className: "smem-sum-clear", key: "all",
4638
+ onClick: function () { setStatusFilter("all"); setTypeFilter([]); setTagFilter([]); setQuery(""); },
4639
+ }, "清除全部"),
4640
+ ])
4641
+ : null,
4606
4642
  h("span", { className: "smem-filters-label", key: "lst" }, "状态"),
4607
4643
  h("button", {
4608
4644
  type: "button", key: "st-all", className: "smem-chip",
@@ -4638,13 +4674,20 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
4638
4674
  }),
4639
4675
  tagList.length ? h("span", { className: "smem-sep", key: "sep" }) : null,
4640
4676
  tagList.length ? h("span", { className: "smem-filters-label", key: "lgt" }, "标签") : null,
4641
- tagList.map(function (g) {
4677
+ tagShown.map(function (g) {
4642
4678
  return h("button", {
4643
4679
  type: "button", key: "tag-" + g, className: "smem-chip",
4644
4680
  "data-on": tagFilter.indexOf(g) >= 0 ? "1" : "0",
4645
4681
  onClick: function () { toggleIn(setTagFilter, g); },
4646
4682
  }, ["#" + g, h("span", { className: "smem-chip-n", key: "n" }, String(tagCounts[g]))]);
4647
4683
  }),
4684
+ tagList.length > TAG_VISIBLE_MAX
4685
+ ? h("button", {
4686
+ type: "button", key: "moretag", className: "smem-btn",
4687
+ title: tagOpen ? "收起标签" : "还有一些标签没显示",
4688
+ onClick: function () { setTagOpen(!tagOpen); },
4689
+ }, tagOpen ? "收起标签" : ("更多标签 (" + String(tagHiddenCount) + ")") )
4690
+ : null,
4648
4691
  hasFilter
4649
4692
  ? h("button", {
4650
4693
  type: "button", key: "clear", className: "smem-btn",
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": "1.5.0",
4
+ "version": "1.5.1",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {