sage-mem 2.28.0 → 2.29.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.28.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.29.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.28.0`** —— 顶部 npm 徽章是动态权威。**契约基线:`1.0.0`** —— 第一个稳定版,公开承诺、能力边界与「明确做不到」的清单冻结在
17
+ **当前发布版本:`2.29.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
@@ -2524,7 +2524,10 @@ const StarmapRuntime = (function (require, _react) {
2524
2524
  };
2525
2525
 
2526
2526
  const CSS = [
2527
- ".smem-root{display:flex;flex-direction:column;gap:12px;font-size:13px;line-height:1.55;color:var(--dsw-alias-label-primary);max-width:760px;}",
2527
+ // ── 动效基线(2.29.0)──
2528
+ // 时长与缓动只在这里定一次:交互反馈 120–160ms、只动颜色/transform/opacity。
2529
+ // 不做自动播放入场(那是「AI 做的页面」最强的信号),也不动 width/height/top/left。
2530
+ ".smem-root{display:flex;flex-direction:column;gap:12px;font-size:13px;line-height:1.55;color:var(--dsw-alias-label-primary);max-width:760px;--smem-dur-fast:120ms;--smem-dur:160ms;--smem-dur-slow:220ms;--smem-ease:cubic-bezier(.2,0,0,1);}",
2528
2531
  // 2.5.0:一屏两张卡(自动整理 = 做梦 + 归档;库健康 = 冲突 + 体检)。
2529
2532
  // `.smem-root` 本身是 gap 12 的列,但这两张卡中间有标题层级差,间距给大一点。
2530
2533
  ".smem-stack{display:flex;flex-direction:column;gap:18px;}",
@@ -2553,17 +2556,30 @@ const StarmapRuntime = (function (require, _react) {
2553
2556
  ".smem-taglist{display:flex;gap:4px;flex-wrap:wrap;}",
2554
2557
  ".smem-tag{font-size:11px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));border-radius:5px;padding:1px 6px;white-space:nowrap;}",
2555
2558
  ".smem-search{flex:1;min-width:160px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:inherit;padding:5px 10px;font-size:12px;outline:none;font-family:inherit;}",
2556
- ".smem-search:focus{border-color:var(--dsw-alias-brand-primary,#4d76e6);}",
2557
- ".smem-btn{border:1px solid var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-primary);border-radius:8px;padding:4px 12px;font-size:12px;cursor:pointer;font-family:inherit;white-space:nowrap;}",
2558
- ".smem-btn:hover{border-color:var(--dsw-alias-brand-primary,#4d76e6);color:var(--dsw-alias-brand-primary,#4d76e6);}",
2559
- ".smem-btn:disabled{opacity:.5;cursor:default;}",
2560
- ".smem-btn-primary{background:var(--dsw-alias-brand-primary,#4d76e6);border-color:var(--dsw-alias-brand-primary,#4d76e6);color:var(--dsw-alias-label-primary-foreground,var(--dsw-alias-bg-base,#10131a));}",
2561
- ".smem-btn-primary:hover{color:var(--dsw-alias-label-primary-foreground,var(--dsw-alias-bg-base,#10131a));opacity:.88;}",
2559
+ ".smem-search:focus{border-color:var(--dsw-alias-brand-primary);}",
2560
+ // ── 按钮三态(2.29.0 重做)──
2561
+ // 旧版 hover 改的是 `color: brand-primary` —— 而深色主题下 brand 就是近白,
2562
+ // 与默认文字色几乎相同,于是「hover 一点反应都没有」(审计 P0-3 / P2-2)。
2563
+ // 现在 hover 动**背景**(宿主的 interactive-bg-hover 自带浅/深两版),按下给 1px 下沉。
2564
+ ".smem-btn{border:1px solid var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-primary);border-radius:8px;padding:4px 12px;font-size:12px;cursor:pointer;font-family:inherit;white-space:nowrap;transition:background-color var(--smem-dur-fast) var(--smem-ease),border-color var(--smem-dur-fast) var(--smem-ease),color var(--smem-dur-fast) var(--smem-ease),transform var(--smem-dur-fast) var(--smem-ease);}",
2565
+ ".smem-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l3);}",
2566
+ ".smem-btn:active:not(:disabled){transform:translateY(.5px);}",
2567
+ ".smem-btn:focus-visible{outline:2px solid var(--dsw-alias-border-selected);outline-offset:2px;}",
2568
+ ".smem-btn:disabled{opacity:.45;cursor:not-allowed;}",
2569
+ // 紧凑尺寸 + 无框变体(2.29.0):卡片里四个操作如果都给边框,一行会冒出四个方框,
2570
+ // 层级全平。现在「编辑」保留边框,锁定/归档/删除用无框变体,只靠文字与 hover 提示。
2571
+ ".smem-btn-xs{padding:2px 8px;font-size:11.5px;border-radius:6px;}",
2572
+ ".smem-btn.smem-btn-plain{border-color:transparent;background:transparent;}",
2573
+ ".smem-btn-primary{background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-primary-foreground,var(--dsw-alias-bg-base,#10131a));}",
2574
+ ".smem-btn-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover,var(--dsw-alias-brand-primary));border-color:var(--dsw-alias-button-primary-hover,var(--dsw-alias-brand-primary));}",
2562
2575
  ".smem-btn-danger-ghost{color:var(--dsw-alias-state-error-primary,#ef4444);border-color:var(--dsw-alias-border-l2);}",
2563
- ".smem-btn-danger{background:var(--dsw-alias-state-error-primary,#dc2626);border-color:var(--dsw-alias-state-error-primary,#dc2626);color:#fff;}",
2564
- ".smem-btn-danger:hover{color:#fff;opacity:.9;}",
2576
+ ".smem-btn-danger-ghost:hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-error-primary,#ef4444) 12%,transparent);border-color:var(--dsw-alias-state-error-primary,#ef4444);}",
2577
+ ".smem-btn-danger{background:var(--dsw-alias-state-error-primary,#dc2626);border-color:var(--dsw-alias-state-error-primary,#dc2626);color:var(--dsw-static-neutral-bluish-00,#fff);}",
2578
+ ".smem-btn-danger:hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-error-primary,#dc2626) 86%,#000);}",
2565
2579
  ".smem-list{display:flex;flex-direction:column;gap:10px;}",
2566
- ".smem-card{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;background:var(--dsw-alias-bg-layer-1);padding:10px 12px;display:flex;flex-direction:column;gap:6px;}",
2580
+ ".smem-card{border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-1);padding:10px 12px;display:flex;flex-direction:column;gap:6px;transition:border-color var(--smem-dur-fast) var(--smem-ease),background-color var(--smem-dur-fast) var(--smem-ease);}",
2581
+ // 卡片要有 hover 反馈:旧版边框 1.19:1,鼠标扫过去完全看不出「这是可以操作的区域」(审计 P2-2)。
2582
+ ".smem-card:hover{border-color:var(--dsw-alias-border-l3);}",
2567
2583
  ".smem-card-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}",
2568
2584
  ".smem-card-title{font-weight:600;flex:1;min-width:120px;overflow-wrap:anywhere;text-align:left;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}",
2569
2585
  ".smem-badge{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l1);border-radius:6px;padding:1px 6px;white-space:nowrap;}",
@@ -2595,7 +2611,7 @@ const StarmapRuntime = (function (require, _react) {
2595
2611
  // 抽屉方案能成立的前提(否则三个能力就退回「藏起来」了)。
2596
2612
  ".smem-drawer{position:relative;flex:none;}",
2597
2613
  ".smem-drawer-pop{position:absolute;right:0;top:calc(100% + 6px);z-index:6;min-width:236px;max-width:min(320px,calc(100vw - 24px));background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.10);padding:6px;display:flex;flex-direction:column;gap:2px;}",
2598
- ".smem-drawer-item{display:flex;align-items:center;gap:8px;border:0;background:transparent;font-family:inherit;font-size:12.5px;color:var(--dsw-alias-label-primary);text-align:left;padding:6px 8px;border-radius:8px;cursor:pointer;}",
2614
+ ".smem-drawer-item{display:flex;align-items:center;gap:8px;border:0;background:transparent;transition:background-color 120ms cubic-bezier(.2,0,0,1);font-family:inherit;font-size:12.5px;color:var(--dsw-alias-label-primary);text-align:left;padding:6px 8px;border-radius:8px;cursor:pointer;}",
2599
2615
  ".smem-drawer-item:hover{background:var(--dsw-alias-bg-layer-2);}",
2600
2616
  '.smem-drawer-item[data-on="1"]{background:var(--dsw-alias-bg-layer-2);font-weight:600;}',
2601
2617
  ".smem-drawer-item .smem-status{margin-left:auto;}",
@@ -2606,7 +2622,7 @@ const StarmapRuntime = (function (require, _react) {
2606
2622
  ".smem-dbg-time{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);font-size:12px;}",
2607
2623
  ".smem-dbg-sess{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;color:var(--dsw-alias-label-secondary);}",
2608
2624
  ".smem-dbg-out{font-size:12px;font-weight:600;}",
2609
- ".smem-dbg-ok{color:var(--dsw-alias-brand-primary,#4d76e6);}",
2625
+ ".smem-dbg-ok{color:var(--dsw-alias-brand-primary);}",
2610
2626
  ".smem-dbg-warn{color:var(--dsw-alias-state-warn-primary,#d97706);}",
2611
2627
  ".smem-dbg-dim{color:var(--dsw-alias-label-secondary);}",
2612
2628
  ".smem-dbg-query{font-size:12.5px;color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;}",
@@ -2673,8 +2689,8 @@ const StarmapRuntime = (function (require, _react) {
2673
2689
  // 遮罩压暗全屏并**吃掉**背景的点击;卡片居中,键盘焦点被 Tab 圈不住时
2674
2690
  // 至少还有 Esc / 点遮罩 / 取消三条出口(Esc 由调用方的 effect 挂)。
2675
2691
  ".smem-modal-host{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:16px;}",
2676
- ".smem-modal-scrim{position:absolute;inset:0;background:rgba(0,0,0,.5);animation:smem-fade 220ms cubic-bezier(.2,0,0,1);}",
2677
- ".smem-modal{position:relative;width:min(460px,92vw);max-height:calc(100vh - 48px);overflow:auto;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;padding:16px;box-shadow:0 24px 60px rgba(0,0,0,.34);animation:smem-pop 220ms cubic-bezier(.2,0,0,1);}",
2692
+ ".smem-modal-scrim{position:absolute;inset:0;background:rgba(0,0,0,.5);animation:smem-fade 160ms cubic-bezier(.2,0,0,1);}",
2693
+ ".smem-modal{position:relative;width:min(460px,92vw);max-height:calc(100vh - 48px);overflow:auto;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:12px;padding:16px;box-shadow:0 24px 60px rgba(0,0,0,.34);animation:smem-pop 160ms cubic-bezier(.2,0,0,1);}",
2678
2694
  "@keyframes smem-pop{from{opacity:0;transform:translateY(6px) scale(.985);}to{opacity:1;transform:none;}}",
2679
2695
  ".smem-modal-title{font-weight:600;font-size:13.5px;margin-bottom:8px;}",
2680
2696
  ".smem-modal-body{font-size:12.5px;line-height:1.65;color:var(--dsw-alias-label-secondary);display:flex;flex-direction:column;gap:8px;}",
@@ -2695,10 +2711,10 @@ const StarmapRuntime = (function (require, _react) {
2695
2711
  // 抽屉从右侧滑入,遮罩自带淡入。两处都用 `animation` 而不是 transition:mount 即播,
2696
2712
  // 不依赖二次渲染(页面不可见时 rAF 不触发)。
2697
2713
  ".smem-drawer-host{position:fixed;inset:0;z-index:40;display:flex;justify-content:flex-end;}",
2698
- ".smem-drawer-scrim{position:absolute;inset:0;background:rgba(0,0,0,.42);animation:smem-fade 220ms cubic-bezier(.2,0,0,1);}",
2714
+ ".smem-drawer-scrim{position:absolute;inset:0;background:rgba(0,0,0,.42);animation:smem-fade 160ms cubic-bezier(.2,0,0,1);}",
2699
2715
  "@keyframes smem-fade{from{opacity:0;}to{opacity:1;}}",
2700
2716
  "@keyframes smem-slide{from{transform:translateX(100%);}to{transform:none;}}",
2701
- ".smem-drawer-panel{position:relative;display:flex;flex-direction:column;width:min(560px,94vw);height:100%;background:var(--dsw-alias-bg-layer-1);border-left:1px solid var(--dsw-alias-border-l2);box-shadow:-18px 0 42px rgba(0,0,0,.28);animation:smem-slide 220ms cubic-bezier(.2,0,0,1);}",
2717
+ ".smem-drawer-panel{position:relative;display:flex;flex-direction:column;width:min(560px,94vw);height:100%;background:var(--dsw-alias-bg-layer-1);border-left:1px solid var(--dsw-alias-border-l2);box-shadow:-18px 0 42px rgba(0,0,0,.28);animation:smem-slide 160ms cubic-bezier(.2,0,0,1);}",
2702
2718
  ".smem-drawer-head{display:flex;align-items:flex-start;gap:10px;padding:14px 16px;border-bottom:1px solid var(--dsw-alias-border-l2);}",
2703
2719
  ".smem-drawer-title{font-weight:600;font-size:13.5px;}",
2704
2720
  ".smem-drawer-x{margin-left:auto;flex:none;width:26px;height:26px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1);background:transparent;color:var(--dsw-alias-label-secondary);font-size:15px;line-height:1;font-family:inherit;cursor:pointer;}",
@@ -2708,12 +2724,15 @@ const StarmapRuntime = (function (require, _react) {
2708
2724
  "@media (prefers-reduced-motion:reduce){.smem-drawer-scrim,.smem-drawer-panel{animation:none;}}",
2709
2725
  ".smem-label{font-size:12px;color:var(--dsw-alias-label-secondary);}",
2710
2726
  ".smem-input,.smem-textarea{width:100%;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-base);color:inherit;padding:6px 10px;font-size:13px;outline:none;font-family:inherit;}",
2711
- ".smem-input:focus,.smem-textarea:focus{border-color:var(--dsw-alias-brand-primary,#4d76e6);}",
2727
+ ".smem-input:focus,.smem-textarea:focus{border-color:var(--dsw-alias-border-l4);outline:none;}",
2712
2728
  ".smem-textarea{resize:vertical;min-height:72px;}",
2713
2729
  ".smem-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}",
2714
- ".smem-chip{border:1px solid var(--dsw-alias-border-l1);background:transparent;color:var(--dsw-alias-label-secondary);border-radius:999px;padding:3px 12px;font-size:12px;cursor:pointer;font-family:inherit;}",
2715
- ".smem-chip:hover{border-color:var(--dsw-alias-border-l2);}",
2716
- '.smem-chip[data-on="1"]{border-color:var(--dsw-alias-brand-primary,#4d76e6);color:var(--dsw-alias-brand-primary,#4d76e6);}',
2730
+ ".smem-chip{border:1px solid var(--dsw-alias-border-l1);background:transparent;color:var(--dsw-alias-label-secondary);border-radius:999px;padding:3px 12px;font-size:12px;cursor:pointer;font-family:inherit;transition:background .16s ease-out,border-color .16s ease-out,color .16s ease-out;}",
2731
+ ".smem-chip:hover{border-color:var(--dsw-alias-border-l3);background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.04));}",
2732
+ // 选中态(2.29.0):从「只改边框与文字色」改成**淡蓝填充 + 蓝边 + 主文字**。
2733
+ // 旧写法在深色主题下几乎看不出差别 —— 用户点了 chip 以为没生效(2026-12-04)。
2734
+ '.smem-chip[data-on="1"]{border-color:var(--dsw-static-blue-450,#4d93f8);background:color-mix(in srgb,var(--dsw-static-blue-450,#4d93f8) 18%,transparent);color:var(--dsw-alias-label-primary);font-weight:510;}',
2735
+ '.smem-chip[data-on="1"]:hover{background:color-mix(in srgb,var(--dsw-static-blue-450,#4d93f8) 26%,transparent);}',
2717
2736
  ".smem-chips{display:flex;gap:6px;flex-wrap:wrap;}",
2718
2737
  // ── 模块卡头(2.5.0,D39)────────────────────────────────────────────
2719
2738
  // 一屏两张模块卡,就必须看得出「这张卡到哪儿为止」——
@@ -2751,12 +2770,24 @@ const StarmapRuntime = (function (require, _react) {
2751
2770
  ".smem-autodream-sec{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;background:var(--dsw-alias-bg-layer-1);padding:10px 12px;display:flex;flex-direction:column;gap:9px;}",
2752
2771
  ".smem-autodream-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap;}",
2753
2772
  ".smem-autodream-key{font-size:12px;color:var(--dsw-alias-label-secondary);flex:none;min-width:78px;}",
2754
- ".smem-switch{border:1px solid var(--dsw-alias-border-l2);background:transparent;border-radius:999px;width:38px;height:21px;position:relative;cursor:pointer;flex:none;padding:0;}",
2755
- '.smem-switch::after{content:"";position:absolute;top:2px;left:2px;width:15px;height:15px;border-radius:50%;background:var(--dsw-alias-label-secondary);transition:left .15s,background .15s;}',
2756
- '.smem-switch[data-on="1"]{border-color:var(--dsw-alias-brand-primary,#4d76e6);background:var(--dsw-alias-brand-primary,#4d76e6);}',
2757
- '.smem-switch[data-on="1"]::after{left:19px;background:#fff;}',
2773
+ /**
2774
+ * 开关(2.29.0 重做)。
2775
+ *
2776
+ * ⚠️ 滑块**不许写死 `#fff`**:宿主 `--dsw-alias-brand-primary` 在深色主题下是近白
2777
+ * `rgb(249,250,251)`,白底加白滑块 = 滑块消失,开关看起来「没打开」(2026-12-04 用户实测)。
2778
+ *
2779
+ * 现在轨道用宿主蓝(全页唯一彩色),滑块分两态:
2780
+ * 关闭 = 中灰(在深轨道上看得见)
2781
+ * 开启 = `--dsw-alias-bg-base`(深色下是深色、浅色下是白色,自动与轨道反色)
2782
+ */
2783
+ ".smem-switch{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));border-radius:999px;width:38px;height:21px;position:relative;cursor:pointer;flex:none;padding:0;transition:background .16s ease-out,border-color .16s ease-out;}",
2784
+ '.smem-switch::after{content:"";position:absolute;top:3px;left:3px;width:13px;height:13px;border-radius:50%;background:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));transition:left .16s ease-out,background .16s ease-out;}',
2785
+ ".smem-switch:hover:not(:disabled){border-color:var(--dsw-alias-border-l3);}",
2786
+ '.smem-switch[data-on="1"]{border-color:var(--dsw-static-blue-450,#4d93f8);background:var(--dsw-static-blue-450,#4d93f8);}',
2787
+ '.smem-switch[data-on="1"]::after{left:calc(100% - 16px);background:var(--dsw-alias-bg-base,#fff);}',
2788
+ ".smem-switch:disabled{opacity:.45;cursor:not-allowed;}",
2758
2789
  ".smem-num{width:66px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-base);color:inherit;padding:4px 8px;font-size:12px;font-family:inherit;outline:none;}",
2759
- ".smem-num:focus{border-color:var(--dsw-alias-brand-primary,#4d76e6);}",
2790
+ ".smem-num:focus{border-color:var(--dsw-alias-brand-primary);}",
2760
2791
  ".smem-status{font-size:12px;color:var(--dsw-alias-label-secondary);}",
2761
2792
  ".smem-autodream-note{font-size:11.5px;color:var(--dsw-alias-label-secondary);line-height:1.5;}",
2762
2793
  // 2.7.1(Q04):上限设置的诊断清单 —— 逐条列宿主的原话,缩进浅一点、行距紧一点。
@@ -2766,7 +2797,7 @@ const StarmapRuntime = (function (require, _react) {
2766
2797
  ".smem-autodream-list{display:flex;flex-direction:column;gap:6px;}",
2767
2798
  ".smem-report{border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:6px 9px;font-size:12px;cursor:pointer;background:transparent;color:inherit;text-align:left;font-family:inherit;}",
2768
2799
  ".smem-report:hover{border-color:var(--dsw-alias-border-l2);}",
2769
- '.smem-report[data-on="1"]{border-color:var(--dsw-alias-brand-primary,#4d76e6);}',
2800
+ '.smem-report[data-on="1"]{border-color:var(--dsw-alias-brand-primary);}',
2770
2801
  ".smem-report-pre{max-height:320px;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:10px 12px;background:var(--dsw-alias-bg-layer-2);font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;line-height:1.6;}",
2771
2802
  ".smem-autodream-adv>summary{cursor:pointer;font-size:12px;color:var(--dsw-alias-label-secondary);}",
2772
2803
  ".smem-autodream-adv>div{display:flex;flex-direction:column;gap:8px;padding-top:9px;}",
@@ -2784,21 +2815,21 @@ const StarmapRuntime = (function (require, _react) {
2784
2815
  ".smem-ad-rb{font-size:12px;line-height:1.5;overflow-wrap:anywhere;}",
2785
2816
  ".smem-ad-run{display:flex;align-items:center;gap:8px;flex-wrap:wrap;width:100%;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:6px 9px;background:transparent;color:inherit;text-align:left;font-family:inherit;font-size:12px;cursor:pointer;}",
2786
2817
  ".smem-ad-run:hover{border-color:var(--dsw-alias-border-l2);}",
2787
- '.smem-ad-run[data-on="1"]{border-color:var(--dsw-alias-brand-primary,#4d76e6);}',
2818
+ '.smem-ad-run[data-on="1"]{border-color:var(--dsw-alias-brand-primary);}',
2788
2819
  ".smem-ad-md{max-height:360px;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:10px 12px;background:var(--dsw-alias-bg-layer-2);font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;line-height:1.6;}",
2789
2820
  // ── 注入参数 / 保留名名单(自动做梦 tab)──
2790
2821
  ".smem-ad-warn{color:var(--dsw-alias-state-warn-primary,#d97706);}",
2791
2822
  ".smem-chip--fixed{opacity:.72;cursor:default;}",
2792
2823
  ".smem-chip-x{border:0;background:transparent;color:inherit;cursor:pointer;font-size:11px;font-family:inherit;padding:0 0 0 5px;}",
2793
2824
  // ── 更新提示(有新版本才出现的一条窄横幅)──
2794
- ".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);}",
2795
- ".smem-update-link{color:var(--dsw-alias-brand-primary,#4d76e6);text-decoration:underline;}",
2825
+ ".smem-update{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid var(--dsw-alias-brand-primary);border-radius:8px;padding:6px 10px;font-size:12px;background:var(--dsw-alias-bg-layer-1);}",
2826
+ ".smem-update-link{color:var(--dsw-alias-brand-primary);text-decoration:underline;}",
2796
2827
  ".smem-update-x{margin-left:auto;border:0;background:transparent;color:inherit;cursor:pointer;font-size:14px;line-height:1;padding:0 2px;}",
2797
2828
  // ── 1.5.1:筛选汇总行(有筛选才出现)──
2798
2829
  ".smem-filter-summary{width:100%;display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);}",
2799
2830
  ".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;}",
2800
2831
  ".smem-sum-x{border:0;background:transparent;color:inherit;cursor:pointer;font-size:12px;line-height:1;padding:0 0 0 2px;}",
2801
- ".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;}",
2832
+ ".smem-sum-clear{border:0;background:transparent;color:var(--dsw-alias-brand-primary);font-size:12px;font-family:inherit;cursor:pointer;padding:2px 4px;}",
2802
2833
  // ── 1.5.0:动作分组 / 长文 clamp / 空态骨架 / 窄窗口 ──
2803
2834
  ".smem-actions-sep{width:1px;height:16px;background:var(--dsw-alias-border-l2);margin:0 2px;align-self:center;}",
2804
2835
  ".smem-clamp-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;cursor:pointer;}",
@@ -2814,14 +2845,14 @@ const StarmapRuntime = (function (require, _react) {
2814
2845
  // 首次打开也播一次:在用户看来那就是切了一页(D39)。
2815
2846
  "@keyframes smem-enter{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:none;}}",
2816
2847
  "@keyframes smem-under{from{transform:scaleX(.35);opacity:0;}to{transform:scaleX(1);opacity:1;}}",
2817
- ".smem-view{animation:smem-enter 220ms cubic-bezier(.2,0,0,1);}",
2818
- ".smem-tab--on:after{animation:smem-under 220ms cubic-bezier(.2,0,0,1);}",
2848
+ ".smem-view{animation:smem-enter 160ms cubic-bezier(.2,0,0,1);}",
2849
+ ".smem-tab--on:after{animation:smem-under 160ms cubic-bezier(.2,0,0,1);}",
2819
2850
  "@media (prefers-reduced-motion:reduce){.smem-view{animation:none;}.smem-tab--on:after{animation:none;}}",
2820
2851
  // 窄窗口(≤420px):头部带与筛选条各让一行,卡片动作允许换行、分隔符隐藏。
2821
2852
  "@media (max-width:420px){.smem-root{gap:10px;}.smem-head{gap:6px;}.smem-head-actions{flex-wrap:wrap;}.smem-card-title{min-width:0;word-break:break-word;}.smem-actions{flex-wrap:wrap;}.smem-actions-sep{display:none;}.smem-num{width:56px;}.smem-search{min-width:100px;}}",
2822
2853
  // ── 1.8.0:侧栏入口(设置开关 + 中央主区整页)──
2823
2854
  ".smem-check{display:flex;align-items:center;gap:7px;font-size:12.5px;cursor:pointer;user-select:none;}",
2824
- ".smem-check input{margin:0;cursor:pointer;accent-color:var(--dsw-alias-brand-primary,#4d76e6);}",
2855
+ ".smem-check input{margin:0;cursor:pointer;accent-color:var(--dsw-alias-brand-primary);}",
2825
2856
  ".smem-page{display:flex;flex-direction:column;gap:10px;padding:14px 16px 18px;box-sizing:border-box;min-height:0;overflow:auto;}",
2826
2857
  ".smem-page-top{display:flex;align-items:center;}",
2827
2858
  ".smem-page-back{display:inline-flex;align-items:center;gap:5px;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12.5px;line-height:1.4;padding:3px 6px 3px 2px;border-radius:6px;cursor:pointer;}",
@@ -2831,8 +2862,8 @@ const StarmapRuntime = (function (require, _react) {
2831
2862
  // 2.7.0 起默认收起:收起时只露标题 + 当前状态,展开才是三选一。
2832
2863
  ".smem-plugin-card{display:flex;flex-direction:column;gap:8px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:12px 14px;background:var(--dsw-alias-bg-layer-1,#fafbfc);box-sizing:border-box;}",
2833
2864
  ".smem-entry-summary{display:flex;align-items:center;gap:8px;width:100%;border:0;background:transparent;padding:0;margin:0;font-family:inherit;text-align:left;cursor:pointer;color:inherit;}",
2834
- ".smem-entry-summary:hover .smem-plugin-card-title{color:var(--dsw-alias-brand-primary,#4d76e6);}",
2835
- ".smem-entry-summary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4d76e6);outline-offset:3px;border-radius:6px;}",
2865
+ ".smem-entry-summary:hover .smem-plugin-card-title{color:var(--dsw-alias-brand-primary);}",
2866
+ ".smem-entry-summary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:3px;border-radius:6px;}",
2836
2867
  ".smem-entry-chevron{flex:none;margin-left:auto;color:var(--dsw-alias-label-tertiary,#8b93a1);transition:transform 180ms cubic-bezier(.2,0,0,1);}",
2837
2868
  ".smem-entry-body{display:flex;flex-direction:column;gap:8px;padding-top:2px;}",
2838
2869
  ".smem-entry-opts{display:flex;flex-direction:column;gap:6px;}",
@@ -2910,18 +2941,18 @@ const StarmapRuntime = (function (require, _react) {
2910
2941
  ".smem-todo-count{font-size:11px;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);}",
2911
2942
  // 顶部统计条右侧的图标按钮(撤销 / 重做):无边框、跟文字同色、栈空时半透明。
2912
2943
  ".smem-todo-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:20px;padding:0;border:0;border-radius:6px;background:none;color:currentColor;cursor:pointer;}",
2913
- ".smem-todo-icon-btn:hover:not(:disabled){background:var(--dsw-alias-bg-l2);}",
2944
+ ".smem-todo-icon-btn:hover:not(:disabled){background:var(--dsw-alias-bg-layer-2);}",
2914
2945
  ".smem-todo-icon-btn:disabled{opacity:.35;cursor:default;}",
2915
2946
  ".smem-todo-list{display:flex;flex-direction:column;gap:6px;}",
2916
2947
  ".smem-todo-item{display:flex;gap:8px;align-items:flex-start;border-radius:8px;padding:4px 2px;}",
2917
- ".smem-todo-item:hover{background:var(--dsw-alias-bg-l2);}",
2948
+ ".smem-todo-item:hover{background:var(--dsw-alias-bg-layer-2);}",
2918
2949
  ".smem-todo-box{flex:0 0 auto;width:16px;height:16px;margin-top:1px;border-radius:5px;border:1px solid var(--dsw-alias-border-l2);background:transparent;color:transparent;font-size:11px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;}",
2919
2950
  ".smem-todo-box-on{background:var(--dsw-alias-brand-primary,#3b82f6);border-color:transparent;color:#fff;}",
2920
2951
  ".smem-todo-body{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px;}",
2921
2952
  ".smem-todo-title{font-weight:600;overflow-wrap:anywhere;}",
2922
2953
  ".smem-todo-text{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;white-space:pre-wrap;}",
2923
- ".smem-todo-ref{border-radius:4px;padding:0 3px;background:var(--dsw-alias-bg-l2);color:var(--dsw-alias-label-secondary);font-size:11.5px;}",
2924
- ".smem-todo-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;border-radius:4px;padding:0 3px;background:var(--dsw-alias-bg-l2);}",
2954
+ ".smem-todo-ref{border-radius:4px;padding:0 3px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-size:11.5px;}",
2955
+ ".smem-todo-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;border-radius:4px;padding:0 3px;background:var(--dsw-alias-bg-layer-2);}",
2925
2956
  ".smem-todo-item-done .smem-todo-title{text-decoration:line-through;opacity:.6;}",
2926
2957
  ".smem-todo-item-done .smem-todo-text{opacity:.6;}",
2927
2958
  ".smem-todo-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}",
@@ -2933,7 +2964,7 @@ const StarmapRuntime = (function (require, _react) {
2933
2964
  ".smem-todo-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:0 0 2px;}",
2934
2965
  ".smem-todo-tools > span[data-spring]{flex:1;}",
2935
2966
  ".smem-todo-filter{border:1px solid transparent;border-radius:6px;padding:1px 6px;}",
2936
- ".smem-todo-filter-on{border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-l2);color:var(--dsw-alias-label-primary);}",
2967
+ ".smem-todo-filter-on{border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);}",
2937
2968
  ".smem-todo-depth{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;color:var(--dsw-alias-label-secondary);}",
2938
2969
  ".smem-todo-depth-select{width:auto;padding:0 2px;font-size:11.5px;}",
2939
2970
  // 「搬进流水」是待删除块的主动作(清空是丢弃、这条是留档),给品牌色。
@@ -2955,9 +2986,9 @@ const StarmapRuntime = (function (require, _react) {
2955
2986
  // 2.25.0:「外部访问」逐条勾选清单 —— 只是一个带边框的滚动列表,
2956
2987
  // 勾上的行用左侧强调条区分(不整行换底色,长列表里那样太吵)。
2957
2988
  ".smem-ext-list{display:flex;flex-direction:column;gap:2px;max-height:260px;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:6px 8px;}",
2958
- ".smem-ext-row{display:flex;align-items:center;gap:8px;padding:3px 4px;border-radius:6px;border-left:2px solid transparent;cursor:pointer;font-size:12.5px;}",
2959
- ".smem-ext-row:hover{background:var(--dsw-alias-bg-l2,transparent);}",
2960
- '.smem-ext-row--on{border-left-color:var(--dsw-alias-brand-primary,#4d76e6);}',
2989
+ ".smem-ext-row{display:flex;align-items:center;gap:8px;padding:5px 6px;border-radius:6px;border-left:2px solid transparent;cursor:pointer;font-size:12.5px;transition:background-color var(--smem-dur-fast) var(--smem-ease),border-color var(--smem-dur-fast) var(--smem-ease);}",
2990
+ ".smem-ext-row:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));}",
2991
+ '.smem-ext-row--on{border-left-color:var(--dsw-alias-brand-primary);}',
2961
2992
  ".smem-ext-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;}",
2962
2993
  // 2.26.0「外部来件」:一条提交一块,动作按钮靠右;徽标用颜色区分「可批准 / 需人工 / 冲突」。
2963
2994
  '.smem-intake-list{display:flex;flex-direction:column;gap:8px;}',
@@ -2966,13 +2997,13 @@ const StarmapRuntime = (function (require, _react) {
2966
2997
  '.smem-intake-src{font-weight:600;color:var(--dsw-alias-label-primary);}',
2967
2998
  '.smem-intake-name{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;}',
2968
2999
  '.smem-intake-badge{border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:1px 8px;font-size:11px;color:var(--dsw-alias-label-secondary);}',
2969
- '.smem-intake-badge--create{border-color:var(--dsw-alias-brand-primary,#4d76e6);color:var(--dsw-alias-brand-primary,#4d76e6);}',
2970
- '.smem-intake-badge--conflict{border-color:var(--dsw-alias-static-red-600,#c62828);color:var(--dsw-alias-static-red-600,#c62828);}',
3000
+ '.smem-intake-badge--create{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary);}',
3001
+ '.smem-intake-badge--conflict{border-color:var(--dsw-static-red-600,#c62828);color:var(--dsw-static-red-600,#c62828);}',
2971
3002
  '.smem-intake-why{font-size:11.5px;color:var(--dsw-alias-label-secondary);}',
2972
3003
  '.smem-intake-excerpt{font-size:12px;color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;}',
2973
3004
  '.smem-intake-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:2px;}',
2974
3005
  '.smem-intake-reports{display:flex;flex-direction:column;gap:8px;margin-top:8px;}',
2975
- '.smem-intake-report{margin:0;padding:8px;border-radius:6px;background:var(--dsw-alias-bg-l2,transparent);font-size:11.5px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;}',
3006
+ '.smem-intake-report{margin:0;padding:8px;border-radius:6px;background:var(--dsw-alias-bg-layer-2,transparent);font-size:11.5px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;}',
2976
3007
  ].join("\n");
2977
3008
 
2978
3009
  /**
@@ -3294,7 +3325,7 @@ const StarmapRuntime = (function (require, _react) {
3294
3325
  : null,
3295
3326
  h("div", { className: "smem-card-foot", key: "foot" }, [
3296
3327
  h("div", { className: "smem-actions", key: "acts" }, [
3297
- h("button", { type: "button", className: "smem-btn", key: "edit", onClick: function () { props.onEdit(item.file); } }, t("card.edit")),
3328
+ h("button", { type: "button", className: "smem-btn smem-btn-xs", key: "edit", onClick: function () { props.onEdit(item.file); } }, t("card.edit")),
3298
3329
  // 语义分组:左边只放「编辑」(安全、可逆),右边放「锁定 / 归档 / 删除」(对这条记忆的退役/保护决定)。
3299
3330
  h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
3300
3331
  /**
@@ -3307,7 +3338,7 @@ const StarmapRuntime = (function (require, _react) {
3307
3338
  */
3308
3339
  h("button", {
3309
3340
  type: "button",
3310
- className: "smem-btn" + (item.locked ? " smem-btn-locked" : ""),
3341
+ className: "smem-btn smem-btn-xs smem-btn-plain" + (item.locked ? " smem-btn-locked" : ""),
3311
3342
  key: "lock",
3312
3343
  title: item.locked
3313
3344
  ? t("card.lockedTitle")
@@ -3317,14 +3348,14 @@ const StarmapRuntime = (function (require, _react) {
3317
3348
  }, item.locked ? t("card.locked") : t("card.lock")),
3318
3349
  // 归档排在「锁定」和「删除」之间:比编辑轻、比删除温和,且随时可逆。
3319
3350
  h("button", {
3320
- type: "button", className: "smem-btn", key: "arch",
3351
+ type: "button", className: "smem-btn smem-btn-xs smem-btn-plain", key: "arch",
3321
3352
  title: item.locked
3322
3353
  ? t("card.archiveLockedTitle")
3323
3354
  : t("card.archiveTitle"),
3324
3355
  disabled: props.busy || item.locked === true,
3325
3356
  onClick: function () { props.onAskArchive(item.file); },
3326
3357
  }, t("card.archive")),
3327
- h("button", { type: "button", className: "smem-btn smem-btn-danger-ghost", key: "del", onClick: function () { props.onAskDelete(item.file, item.revision); } }, t("card.delete")),
3358
+ h("button", { type: "button", className: "smem-btn smem-btn-xs smem-btn-danger-ghost smem-btn-plain", key: "del", onClick: function () { props.onAskDelete(item.file, item.revision); } }, t("card.delete")),
3328
3359
  ]),
3329
3360
  // 两个确认框都是**模态**(2.5.0):DOM 里留在卡片内只是为了「状态跟着这一行走」,
3330
3361
  // 视觉上是全屏一层 —— 列表被滚出视野时,按下去那一刻看到的东西还在眼前。
@@ -3432,7 +3463,7 @@ const StarmapRuntime = (function (require, _react) {
3432
3463
  : h("div", { className: "smem-card-foot", key: "foot" },
3433
3464
  h("div", { className: "smem-actions", key: "acts" }, [
3434
3465
  h("button", {
3435
- type: "button", className: "smem-btn", key: "edit",
3466
+ type: "button", className: "smem-btn smem-btn-xs", key: "edit",
3436
3467
  disabled: props.busy,
3437
3468
  onClick: function () { props.onEdit(item.file); },
3438
3469
  }, t("card.edit")),
@@ -4342,17 +4373,23 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
4342
4373
  "ext.status.off": "关闭(默认)",
4343
4374
  "ext.prefixes": "按前缀整类开放",
4344
4375
  "ext.prefixesHint": "默认只开 project_ 与 reference_;user_ 与 feedback_ 是「关于我自己」的记忆,默认不给。",
4376
+ "ext.find": "按名字搜索并加入",
4377
+ "ext.findPlaceholder": "输入文件名或描述片段,回车不用按 —— 边打边筛",
4378
+ "ext.findNone": "没有匹配的记忆。",
4345
4379
  "ext.tags": "按标签开放",
4346
4380
  "ext.tagsPlaceholder": "用逗号分隔,例如:记忆系统, 发布",
4347
4381
  "ext.tagsHint": "留空 = 不按标签开放。标签写在记忆的 frontmatter 里。",
4348
4382
  "ext.files": "逐条勾选",
4349
4383
  "ext.filesHint": "勾上就包含、取消就排除;前缀整类开着时,取消勾选会记成「逐条排除」并压过前缀。",
4350
4384
  "ext.filesEmpty": "记忆目录里还没有可导出的条目。",
4385
+ "ext.filesReadFailed": "读不到记忆目录:{error}",
4351
4386
  "ext.exposed": "当前实际暴露 {count} 条(以上一轮导出为准)",
4387
+ "ext.exposedOff": "外部访问关着 —— 上面的勾选先存着,打开后才按它导出。",
4352
4388
  "ext.port": "端点端口",
4353
4389
  "ext.endpointLabel": "只读端点:",
4354
4390
  "ext.endpoint.on": "在听 {url}",
4355
4391
  "ext.endpoint.off": "未启动",
4392
+ "ext.endpoint.readFailed": "读不到状态:{error}",
4356
4393
  "ext.endpoint.error": "起不来:{error}",
4357
4394
  "ext.lastExport": "最近一轮:{time} · 写 {written} / 未变 {unchanged} / 删 {deleted}",
4358
4395
  "ext.lastExport.never": "最近一轮:还没有导出过",
@@ -5075,17 +5112,23 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
5075
5112
  "ext.status.off": "Off (default)",
5076
5113
  "ext.prefixes": "Expose whole prefix groups",
5077
5114
  "ext.prefixesHint": "Only project_ and reference_ are on by default; user_ and feedback_ are memories about you and stay private.",
5115
+ "ext.find": "Search by name and add",
5116
+ "ext.findPlaceholder": "Type a file name or a fragment of its description",
5117
+ "ext.findNone": "No matching memories.",
5078
5118
  "ext.tags": "Expose by tag",
5079
5119
  "ext.tagsPlaceholder": "Comma separated, e.g. memory-system, release",
5080
5120
  "ext.tagsHint": "Empty means no tag-based exposure. Tags live in each memory's frontmatter.",
5081
5121
  "ext.files": "Per-file selection",
5082
5122
  "ext.filesHint": "Checked means included, unchecked means excluded; when a prefix group is on, unchecking records a per-file exclusion that overrides it.",
5083
5123
  "ext.filesEmpty": "No exportable entries in the memory directory yet.",
5124
+ "ext.filesReadFailed": "cannot read the memory directory: {error}",
5084
5125
  "ext.exposed": "{count} exposed right now (from the last export)",
5126
+ "ext.exposedOff": "External access is off — the selection is kept and applies once you turn it on.",
5085
5127
  "ext.port": "Endpoint port",
5086
5128
  "ext.endpointLabel": "Read-only endpoint:",
5087
5129
  "ext.endpoint.on": "listening on {url}",
5088
5130
  "ext.endpoint.off": "not running",
5131
+ "ext.endpoint.readFailed": "status unavailable: {error}",
5089
5132
  "ext.endpoint.error": "failed to start: {error}",
5090
5133
  "ext.lastExport": "Last export: {time} · {written} written / {unchanged} unchanged / {deleted} deleted",
5091
5134
  "ext.lastExport.never": "Last export: never ran",
@@ -8042,7 +8085,12 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8042
8085
  const sSet = react.useState(null); const memSet = sSet[0], setMemSet = sSet[1];
8043
8086
  const sStatus = react.useState(null); const status = sStatus[0], setStatus = sStatus[1];
8044
8087
  const sFiles = react.useState([]); const files = sFiles[0], setFiles = sFiles[1];
8088
+ // 「读不到」与「没有」必须分开显示:把失败画成空态,用户会以为页面坏了(审计 P1-7)。
8089
+ const sFilesErr = react.useState(""); const filesErr = sFilesErr[0], setFilesErr = sFilesErr[1];
8090
+ const sStatusErr = react.useState(""); const statusErr = sStatusErr[0], setStatusErr = sStatusErr[1];
8045
8091
  const sTags = react.useState(""); const tagDraft = sTags[0], setTagDraft = sTags[1];
8092
+ // 2.29.0:按名字搜文件、直接勾进白名单 —— 记忆一多,靠下面那个长列表翻太慢。
8093
+ const sFind = react.useState(""); const findDraft = sFind[0], setFindDraft = sFind[1];
8046
8094
  const sPort = react.useState(""); const portDraft = sPort[0], setPortDraft = sPort[1];
8047
8095
  const sPoll = react.useState(""); const pollDraft = sPoll[0], setPollDraft = sPoll[1];
8048
8096
  const sBusy = react.useState(false); const busy = sBusy[0], setBusy = sBusy[1];
@@ -8056,9 +8104,31 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8056
8104
  const exposed = new Set(exposedNames);
8057
8105
  const endpoint = (status && status.endpoint) || null;
8058
8106
 
8107
+ // 标签切分直接用 `50-shared-ui.js` 的 `parseTagInput`(认 `,` `,` `、`,剥 YAML 字符,截断)。
8108
+ //
8109
+ // 这里曾经复制过一份 `parseTagsOf`,理由写的是「50 在内层作用域、68 够不着」——**那是错的**。
8110
+ // `client/*.js` 拼成的是**同一个 factory 作用域**(`scripts/build-client.mjs` 只是逐字节拼接),
8111
+ // `50` 与 `68` 的顶层声明同级。2026-12-04 那次白屏的真凶是另一次全局替换(`enabled` 未定义),
8112
+ // 与这里无关。2026-12-04 晚(2.29.1)删掉复制品、改回调用。
8113
+
8059
8114
  /** 前缀候选:默认那两个 + 另外两类(面板把「不给」也画出来,免得以为漏了)。 */
8060
8115
  const PREFIX_CHOICES = ["project_", "reference_", "user_", "feedback_"];
8061
8116
 
8117
+ /**
8118
+ * 搜索命中的文件(最多 8 条)。
8119
+ *
8120
+ * 名字与描述都参与匹配、大小写不敏感;空查询**不返回任何东西** ——
8121
+ * 一进来就把整库铺开,等于把下面那张完整清单复制一遍。
8122
+ */
8123
+ const findQuery = String(findDraft || "").trim().toLowerCase();
8124
+ const findMatches = findQuery === ""
8125
+ ? []
8126
+ : files.filter(function (f) {
8127
+ const name = String((f && f.file) || "").toLowerCase();
8128
+ const desc = String((f && f.description) || "").toLowerCase();
8129
+ return name.indexOf(findQuery) >= 0 || desc.indexOf(findQuery) >= 0;
8130
+ }).slice(0, 8);
8131
+
8062
8132
  function load() {
8063
8133
  if (!remote || typeof remote.getSettings !== "function") {
8064
8134
  setErr(t("ext.err.noSettings"));
@@ -8074,13 +8144,13 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8074
8144
  }, function (e) { setErr(String((e && e.message) || e)); });
8075
8145
  if (typeof remote.externalStatus === "function") {
8076
8146
  Promise.resolve(remote.externalStatus()).then(function (res) {
8077
- setStatus(unwrap(res) || {});
8078
- }, function () { /* 状态读不到不影响设置那一半 */ });
8147
+ setStatus(unwrap(res) || {}); setStatusErr("");
8148
+ }, function (e) { setStatusErr(String((e && e.message) || e)); });
8079
8149
  }
8080
8150
  if (typeof remote.listFiles === "function") {
8081
8151
  Promise.resolve(remote.listFiles()).then(function (res) {
8082
- setFiles(Array.isArray(unwrap(res)) ? unwrap(res) : []);
8083
- }, function () { /* 列表读不到就只显示开关与端点 */ });
8152
+ setFiles(Array.isArray(unwrap(res)) ? unwrap(res) : []); setFilesErr("");
8153
+ }, function (e) { setFilesErr(String((e && e.message) || e)); });
8084
8154
  }
8085
8155
  }
8086
8156
 
@@ -8088,20 +8158,45 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8088
8158
 
8089
8159
  react.useEffect(function () { load(); }, []);
8090
8160
 
8161
+ /**
8162
+ * 状态每 15 秒自刷一次。
8163
+ *
8164
+ * 「最近一轮」是宿主那边在写的(每 45 秒一轮),页面只在进页与保存后读一次 ——
8165
+ * 开着坐十分钟,卡上还写着「还没有导出过」(审计 P1-6)。
8166
+ */
8167
+ react.useEffect(function () {
8168
+ if (!enabled) return undefined;
8169
+ const id = setInterval(function () { refreshStatus(); }, 15000);
8170
+ return function () { clearInterval(id); };
8171
+ }, [enabled]);
8172
+
8091
8173
  /** 保存一段 `external` 补丁。`setSettings` 自带 `{ok, settings}`,不要过 unwrap。 */
8174
+ /**
8175
+ * 保存后**统一回读**一次设置(2.29.0)。
8176
+ *
8177
+ * 为什么不再信任 `setSettings` 返回值里的 `settings`:2026-12-04 实测,
8178
+ * 点开关之后后端确实关掉了(端点停了),但界面仍是「已开启」——
8179
+ * 返回的那份快照与落盘结果对不上,前端拿它 setState 就等于把旧值又画了一遍。
8180
+ * 回读的代价是一次 RPC,换来的是「界面永远等于服务端」。
8181
+ */
8182
+ function reloadSettings() {
8183
+ if (!remote || typeof remote.getSettings !== "function") return;
8184
+ Promise.resolve(remote.getSettings()).then(function (res) {
8185
+ const d = unwrap(res) || {};
8186
+ setMemSet(d);
8187
+ // 回读只覆盖草稿里**没有未保存修改**的那几个 —— 这里保守起见,只在草稿为空时回填,
8188
+ // 免得把用户正在输入的内容冲掉。
8189
+ if (String(tagDraft || "").trim() === "") setTagsOf((d.external || {}).tags);
8190
+ }, function () { /* 回读失败不动界面:最坏是这次点击看起来没生效,下次操作会再读 */ });
8191
+ }
8192
+
8092
8193
  function saveExternal(patch, okMsg) {
8093
8194
  if (!remote || typeof remote.setSettings !== "function") { setErr(t("ext.err.noSettings")); return; }
8094
8195
  setBusy(true); setErr(null); setNotice("");
8095
8196
  Promise.resolve(remote.setSettings({ external: patch })).then(function (out) {
8096
8197
  setBusy(false);
8097
8198
  if (out && out.ok === false) { setErr(out.error || t("ext.err.rejected")); return; }
8098
- if (out && out.settings) {
8099
- setMemSet(out.settings);
8100
- const cur = out.settings.external || {};
8101
- setTagsOf(cur.tags);
8102
- setPortDraft(String(typeof cur.port === "number" ? cur.port : ""));
8103
- setPollDraft(String(typeof cur.pollSeconds === "number" ? cur.pollSeconds : ""));
8104
- }
8199
+ reloadSettings();
8105
8200
  // 保存完立刻重读状态:暴露条数与端点都要马上反映出来(宿主那边已经 refresh 过)。
8106
8201
  refreshStatus();
8107
8202
  setNotice(okMsg);
@@ -8114,7 +8209,7 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8114
8209
  function refreshStatus() {
8115
8210
  if (!remote || typeof remote.externalStatus !== "function") return;
8116
8211
  Promise.resolve(remote.externalStatus()).then(function (res) {
8117
- setStatus(unwrap(res) || {});
8212
+ setStatus(unwrap(res) || {}); setStatusErr("");
8118
8213
  }, function () { /* 同上 */ });
8119
8214
  }
8120
8215
 
@@ -8133,23 +8228,77 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8133
8228
 
8134
8229
  /** 标签白名单:逗号分隔(中英文逗号都收)。空 = 不按标签开放。 */
8135
8230
  function saveTags() {
8136
- const list = String(tagDraft == null ? "" : tagDraft)
8137
- .split(/[,,]/)
8138
- .map(function (s) { return s.trim(); })
8139
- .filter(function (s) { return s !== ""; });
8140
- saveExternal({ tags: list }, t("ext.notice.saved"));
8231
+ // 走共享的 parseTagInput:认半角逗号、全角逗号与顿号,并剥掉 YAML 里有语法含义的字符。
8232
+ // 旧实现只切 `[,,]`,中文输入法敲出的「记忆系统、发布」会被当成一个标签(审计 P3-1)。
8233
+ saveExternal({ tags: parseTagInput(tagDraft) }, t("ext.notice.saved"));
8234
+ }
8235
+
8236
+ /**
8237
+ * 失焦即保存(2.29.0)。
8238
+ *
8239
+ * 为什么去掉那三个「保存」按钮:同一屏三个同等权重的主按钮,等于没有主操作,
8240
+ * 用户不知道点哪个才对(2026-12-04 用户反馈)。改成「改完离开就存」,
8241
+ * 并**只在真的变了**才发请求 —— 否则点一下输入框再点走,就会白刷一次提示。
8242
+ */
8243
+ function saveTagsIfChanged() {
8244
+ const next = parseTagInput(tagDraft);
8245
+ const cur = (ext && Array.isArray(ext.tags) ? ext.tags : []).map(function (s) { return String(s).trim(); }).filter(function (s) { return s !== ""; });
8246
+ if (next.join("\u0000") === cur.join("\u0000")) return;
8247
+ saveTags();
8248
+ }
8249
+
8250
+ /** 回车 = 立即保存并失焦(不用等用户点到别处)。 */
8251
+ function submitOnEnter(handler) {
8252
+ return function (e) {
8253
+ if (e.key !== "Enter") return;
8254
+ e.preventDefault();
8255
+ handler();
8256
+ if (e.target && typeof e.target.blur === "function") e.target.blur();
8257
+ };
8258
+ }
8259
+
8260
+ /**
8261
+ * 某个文件**现在是否在白名单里** —— 这是「意图」,不是「上一轮导出的结果」。
8262
+ *
8263
+ * 为什么不能拿 `exposedNames` 当勾选态:那是导出**之后**的结果,最多要等 45 秒才更新。
8264
+ * 用户点一下勾,界面半分钟内不动,看起来就是「点了没反应」(2026-12-04 实测两次)。
8265
+ * 这里按 include / exclude / prefixes 现算,点完立刻变。
8266
+ *
8267
+ * 三者优先级与后端 `lib/mirror/policy.js` 一致:排除 > 包含 > 前缀。
8268
+ */
8269
+ function isIncluded(name) {
8270
+ if (!ext) return false;
8271
+ const n = String(name);
8272
+ // 大小写不敏感 —— 与后端 `policy.js:246-247` 同口径。名单可能被手改过
8273
+ // (`Project_Beta.md`),前端按精确全等判就会画出「勾着但实际没导」。
8274
+ const lower = n.toLowerCase();
8275
+ const inc = (ext.include || []).map(function (x) { return String(x).toLowerCase(); });
8276
+ const exc = (ext.exclude || []).map(function (x) { return String(x).toLowerCase(); });
8277
+ if (exc.indexOf(lower) >= 0) return false;
8278
+ if (inc.indexOf(lower) >= 0) return true;
8279
+ // 与后端 `lib/mirror/policy.js` 的 `isExposed` **同序**:排除 > 包含 > 前缀 > 标签。
8280
+ // 前端**刻意不判 `enabled`** —— 关着的时候勾选是「打开后要导出什么」,不是「现在正在导出」。
8281
+ if ((ext.prefixes || []).some(function (p) { return lower.indexOf(String(p).toLowerCase()) === 0; })) return true;
8282
+ const hit = (files || []).filter(function (f) { return String(f && f.file) === n; })[0];
8283
+ const own = (hit && Array.isArray(hit.tags) ? hit.tags : []).map(function (t) { return String(t).toLowerCase(); });
8284
+ if (own.length && (ext.tags || []).some(function (t) { return own.indexOf(String(t).toLowerCase()) >= 0; })) return true;
8285
+ return false;
8141
8286
  }
8142
8287
 
8143
8288
  /**
8144
8289
  * 逐条勾选:勾上 → include、取消 → exclude(同时从另一侧摘掉,免得两份名单都记着它)。
8145
8290
  * 「取消」写的是 exclude 而不是「什么都不做」—— 前缀整类打开时,只有 exclude 能压过它。
8291
+ *
8292
+ * 先本地改、再发请求:点击瞬间就要看见变化,等服务端回来才动等于没反馈。
8293
+ * 请求失败时 `saveExternal` 会设错误,下一次回读把界面纠正回真实值。
8146
8294
  */
8147
8295
  function toggleFile(name) {
8148
8296
  if (!ext) return;
8149
8297
  const include = (ext.include || []).filter(function (n) { return n !== name; });
8150
8298
  const exclude = (ext.exclude || []).filter(function (n) { return n !== name; });
8151
- if (exposed.has(name)) exclude.push(name);
8299
+ if (isIncluded(name)) exclude.push(name);
8152
8300
  else include.push(name);
8301
+ setMemSet({ ...memSet, external: { ...ext, include: include, exclude: exclude } });
8153
8302
  saveExternal({ include: include, exclude: exclude }, t("ext.notice.file"));
8154
8303
  }
8155
8304
 
@@ -8157,7 +8306,7 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8157
8306
  const raw = String(portDraft == null ? "" : portDraft).trim();
8158
8307
  const n = Number(raw);
8159
8308
  if (raw === "" || !Number.isInteger(n) || n < 1024 || n > 65535) { setErr(t("ext.err.port")); return; }
8160
- saveExternal({ port: n }, t("ext.notice.port"));
8309
+ saveExternal({ port: n }, enabled ? t("ext.notice.port") : t("ext.notice.saved"));
8161
8310
  }
8162
8311
 
8163
8312
  /** 轮询间隔(15–600 秒)。它是第二道保险:目录事件漏了也有它兜底。 */
@@ -8168,6 +8317,19 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8168
8317
  saveExternal({ pollSeconds: n }, t("ext.notice.poll"));
8169
8318
  }
8170
8319
 
8320
+ /** 只有值真的变了才发请求(失焦被触发得很频繁,空写一次会刷掉提示条)。 */
8321
+ function savePortIfChanged() {
8322
+ const n = Number(String(portDraft == null ? "" : portDraft).trim());
8323
+ if (!Number.isInteger(n) || n === (ext && ext.port)) return;
8324
+ savePort();
8325
+ }
8326
+
8327
+ function savePollIfChanged() {
8328
+ const n = Number(String(pollDraft == null ? "" : pollDraft).trim());
8329
+ if (!Number.isInteger(n) || n === (ext && ext.pollSeconds)) return;
8330
+ savePoll();
8331
+ }
8332
+
8171
8333
  const statusText = busy
8172
8334
  ? t("lab.action.saving")
8173
8335
  : (enabled
@@ -8182,13 +8344,17 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8182
8344
  written: status.written, unchanged: status.unchanged, deleted: status.deleted,
8183
8345
  });
8184
8346
 
8185
- const endpointLine = !endpoint
8186
- ? t("ext.endpoint.off")
8187
- : (endpoint.listening
8188
- ? t("ext.endpoint.on", { url: endpoint.url })
8189
- : (endpoint.error ? t("ext.endpoint.error", { error: endpoint.error }) : t("ext.endpoint.off")));
8190
-
8191
- return h("div", { className: "smem-external smem-module-card" }, [
8347
+ // 「读不到」不能画成「未启动」:后者会让用户以为端点真的没起来(审计 P1-7)。
8348
+ const endpointLine = statusErr
8349
+ ? t("ext.endpoint.readFailed", { error: statusErr })
8350
+ : (!endpoint
8351
+ ? t("ext.endpoint.off")
8352
+ : (endpoint.listening
8353
+ ? t("ext.endpoint.on", { url: endpoint.url })
8354
+ : (endpoint.error ? t("ext.endpoint.error", { error: endpoint.error }) : t("ext.endpoint.off"))));
8355
+
8356
+ return h("div", { className: "smem-external smem-stack" }, [
8357
+ h("div", { className: "smem-module-card", key: "main" }, [
8192
8358
  h("div", { className: "smem-modcard-head", key: "head" }, [
8193
8359
  h(Switch, {
8194
8360
  key: "sw",
@@ -8222,6 +8388,37 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8222
8388
  h("div", { className: "smem-autodream-note", key: "hint" }, t("ext.prefixesHint")),
8223
8389
  ]),
8224
8390
 
8391
+ // ── 按名字搜索并加入(2.29.0)──
8392
+ // 用户原话:记忆一多,靠下面那张长清单翻太慢 —— 要在前缀区下面直接搜到某一条。
8393
+ // 命中的行与下面「逐条勾选」走同一个 `toggleFile`,两处状态天然一致。
8394
+ h("div", { className: "smem-autodream-sec", key: "find" }, [
8395
+ h("div", { className: "smem-autodream-key", key: "k" }, t("ext.find")),
8396
+ h("input", {
8397
+ className: "smem-input", key: "q", type: "search",
8398
+ value: findDraft,
8399
+ disabled: busy || !memSet,
8400
+ placeholder: t("ext.findPlaceholder"),
8401
+ onChange: function (e) { setFindDraft(e.target.value); },
8402
+ }),
8403
+ findQuery === ""
8404
+ ? null
8405
+ : (findMatches.length === 0
8406
+ ? h("div", { className: "smem-muted", key: "none" }, t("ext.findNone"))
8407
+ : h("div", { className: "smem-ext-list", key: "hits" }, findMatches.map(function (f) {
8408
+ const name = String(f && f.file ? f.file : "");
8409
+ const on = isIncluded(name);
8410
+ return h("label", { className: "smem-ext-row" + (on ? " smem-ext-row--on" : ""), key: "hit-" + name, title: String((f && f.description) || "") }, [
8411
+ h("input", {
8412
+ type: "checkbox", key: "c", checked: on,
8413
+ disabled: busy || !memSet,
8414
+ onChange: function () { toggleFile(name); },
8415
+ }),
8416
+ h("span", { className: "smem-ext-name", key: "n" }, name),
8417
+ h("span", { className: "smem-muted", key: "d" }, String((f && f.description) || "").slice(0, 60)),
8418
+ ]);
8419
+ }))),
8420
+ ]),
8421
+
8225
8422
  // ── 白名单:按标签 ──
8226
8423
  h("div", { className: "smem-autodream-sec", key: "tags" }, [
8227
8424
  h("div", { className: "smem-autodream-row", key: "r" }, [
@@ -8232,11 +8429,9 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8232
8429
  disabled: busy || !memSet,
8233
8430
  placeholder: t("ext.tagsPlaceholder"),
8234
8431
  onChange: function (e) { setTagDraft(e.target.value); },
8432
+ onBlur: saveTagsIfChanged,
8433
+ onKeyDown: submitOnEnter(saveTagsIfChanged),
8235
8434
  }),
8236
- h("button", {
8237
- type: "button", className: "smem-btn smem-btn-primary", key: "save",
8238
- disabled: busy || !memSet, onClick: saveTags,
8239
- }, busy ? t("lab.action.saving") : t("lab.action.save")),
8240
8435
  ]),
8241
8436
  h("div", { className: "smem-autodream-note", key: "hint" }, t("ext.tagsHint")),
8242
8437
  ]),
@@ -8245,24 +8440,31 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8245
8440
  h("div", { className: "smem-autodream-sec", key: "files" }, [
8246
8441
  h("div", { className: "smem-autodream-key", key: "k" }, t("ext.files")),
8247
8442
  h("div", { className: "smem-autodream-note", key: "hint" }, t("ext.filesHint")),
8248
- files.length === 0
8249
- ? h("div", { className: "smem-muted", key: "empty" }, t("ext.filesEmpty"))
8250
- : h("div", { className: "smem-ext-list", key: "list" }, files.map(function (f) {
8251
- const name = String(f && f.file ? f.file : "");
8252
- const on = exposed.has(name);
8253
- return h("label", { className: "smem-ext-row" + (on ? " smem-ext-row--on" : ""), key: name, title: String((f && f.description) || "") }, [
8254
- h("input", {
8255
- type: "checkbox", key: "c", checked: on,
8256
- disabled: busy || !memSet,
8257
- onChange: function () { toggleFile(name); },
8258
- }),
8259
- h("span", { className: "smem-ext-name", key: "n" }, name),
8260
- h("span", { className: "smem-muted", key: "d" }, String((f && f.description) || "").slice(0, 60)),
8261
- ]);
8262
- })),
8263
- exposed.size > 0
8443
+ filesErr
8444
+ ? h("div", { className: "smem-err", key: "readErr" }, "⚠ " + t("ext.filesReadFailed", { error: filesErr }))
8445
+ : (files.length === 0
8446
+ ? h("div", { className: "smem-muted", key: "empty" }, t("ext.filesEmpty"))
8447
+ : h("div", { className: "smem-ext-list", key: "list" }, files.map(function (f) {
8448
+ const name = String(f && f.file ? f.file : "");
8449
+ const on = isIncluded(name);
8450
+ return h("label", { className: "smem-ext-row" + (on ? " smem-ext-row--on" : ""), key: name, title: String((f && f.description) || "") }, [
8451
+ h("input", {
8452
+ type: "checkbox", key: "c", checked: on,
8453
+ disabled: busy || !memSet,
8454
+ onChange: function () { toggleFile(name); },
8455
+ }),
8456
+ h("span", { className: "smem-ext-name", key: "n" }, name),
8457
+ h("span", { className: "smem-muted", key: "d" }, String((f && f.description) || "").slice(0, 60)),
8458
+ ]);
8459
+ }))),
8460
+ enabled && exposed.size > 0
8264
8461
  ? h("div", { className: "smem-autodream-note", key: "count" }, t("ext.exposed", { count: exposed.size }))
8265
8462
  : null,
8463
+ // 关着的时候把话说清楚:勾选是「打开后要导出什么」,不是「现在已经在导出」
8464
+ // (审计 P0-2:关掉开关后界面还写着「实际暴露 N 条」,自相矛盾)。
8465
+ !enabled
8466
+ ? h("div", { className: "smem-autodream-note", key: "off" }, t("ext.exposedOff"))
8467
+ : null,
8266
8468
  ]),
8267
8469
 
8268
8470
  // ── 端点与最近一轮 ──
@@ -8274,11 +8476,9 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8274
8476
  value: portDraft,
8275
8477
  disabled: busy || !memSet,
8276
8478
  onChange: function (e) { setPortDraft(e.target.value); },
8479
+ onBlur: savePortIfChanged,
8480
+ onKeyDown: submitOnEnter(savePortIfChanged),
8277
8481
  }),
8278
- h("button", {
8279
- type: "button", className: "smem-btn smem-btn-primary", key: "save",
8280
- disabled: busy || !memSet, onClick: savePort,
8281
- }, busy ? t("lab.action.saving") : t("lab.action.save")),
8282
8482
  ]),
8283
8483
  h("div", { className: "smem-autodream-row", key: "poll" }, [
8284
8484
  h("span", { className: "smem-autodream-key", key: "k" }, t("ext.poll")),
@@ -8287,12 +8487,10 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8287
8487
  value: pollDraft,
8288
8488
  disabled: busy || !memSet,
8289
8489
  onChange: function (e) { setPollDraft(e.target.value); },
8490
+ onBlur: savePollIfChanged,
8491
+ onKeyDown: submitOnEnter(savePollIfChanged),
8290
8492
  }),
8291
8493
  h("span", { className: "smem-muted", key: "u" }, t("ext.unit.seconds")),
8292
- h("button", {
8293
- type: "button", className: "smem-btn smem-btn-primary", key: "save",
8294
- disabled: busy || !memSet, onClick: savePoll,
8295
- }, busy ? t("lab.action.saving") : t("lab.action.save")),
8296
8494
  ]),
8297
8495
  h("div", { className: "smem-autodream-note", key: "ep" }, t("ext.endpointLabel") + " " + endpointLine),
8298
8496
  h("div", { className: "smem-autodream-note", key: "last" }, lastLine),
@@ -8307,8 +8505,11 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8307
8505
  : null,
8308
8506
  ]),
8309
8507
 
8310
- // ── 2.26.0 写侧:外部来件 ──
8311
- h(ExternalIntakeCard, { key: "intake", ctx: props.ctx }),
8508
+ ]),
8509
+
8510
+ // ── 2.26.0 写侧:外部来件 ──
8511
+ // 与主卡**平级**:以前它嵌在主卡里面,三层边框(外卡 → 分区 → 内卡)挤在一起(审计 P2-3)。
8512
+ h(ExternalIntakeCard, { key: "intake", ctx: props.ctx }),
8312
8513
 
8313
8514
  err ? h("div", { className: "smem-err", key: "err" }, "⚠ " + err) : null,
8314
8515
  notice ? h("div", { className: "smem-ok", key: "ok" }, "✓ " + notice) : null,
@@ -8361,12 +8562,17 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
8361
8562
  }, function (e) { setBusy(""); setErr(String((e && e.message) || e)); });
8362
8563
  }
8363
8564
 
8364
- /** patch 的「复制建议」:只复制「建议改成」那一段,不复制整份 patch。 */
8565
+ /**
8566
+ * patch 的「复制建议」:只复制「建议改成」那一段,不复制整份 patch。
8567
+ *
8568
+ * 走 `56-health-prompt.js` 的 `copyPromptText`:它带 `execCommand` 降级。
8569
+ * 只认 `navigator.clipboard` 的写法在**局域网 http 部署(非安全上下文)下必然失败** ——
8570
+ * 同一个产品里两处复制行为不同,用户只会觉得「这里坏了」(2.29.1 统一)。
8571
+ */
8365
8572
  function copySuggestion(text) {
8366
- const clip = typeof navigator !== "undefined" ? navigator.clipboard : null;
8367
- if (!clip || typeof clip.writeText !== "function") { setErr(t("ext.intake.err.noClipboard")); return; }
8368
- Promise.resolve(clip.writeText(String(text || ""))).then(function () {
8369
- setNotice(t("ext.intake.notice.copied"));
8573
+ Promise.resolve(copyPromptText(String(text == null ? "" : text))).then(function (ok) {
8574
+ if (ok === true) setNotice(t("ext.intake.notice.copied"));
8575
+ else setErr(t("ext.intake.err.noClipboard"));
8370
8576
  }, function () { setErr(t("ext.intake.err.noClipboard")); });
8371
8577
  }
8372
8578
 
@@ -12118,7 +12324,34 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
12118
12324
  * Client 插件:$mount strict remote contribution(第三方 remote 不在
12119
12325
  * 宿主的固定 remote 清单里,必须自己挂),再注册设置页签 / 侧栏入口。
12120
12326
  */
12327
+ /**
12328
+ * 兜底红带(2.29.0)。
12329
+ *
12330
+ * React 的错误边界只认 class,而本插件的分片里不写 class —— 测试 harness 直接调用
12331
+ * 组件函数,class 组件在那里根本渲染不出来(2026-12-04 试过,`cannot be invoked without 'new'`)。
12332
+ * 所以退一步:挂 window 的未捕获异常,一旦渲染炸了,至少在页顶摊一条红带并写出错误原文,
12333
+ * 而不是让用户对着黑屏猜。
12334
+ */
12335
+ function installFatalBanner() {
12336
+ if (typeof window === "undefined" || typeof document === "undefined") return;
12337
+ if (typeof window.addEventListener !== "function") return;
12338
+ if (window.__smemFatalHooked) return;
12339
+ window.__smemFatalHooked = true;
12340
+ window.addEventListener("error", function (ev) {
12341
+ try {
12342
+ if (document.getElementById("smem-fatal-banner")) return;
12343
+ const bar = document.createElement("div");
12344
+ bar.id = "smem-fatal-banner";
12345
+ bar.style.cssText = "position:fixed;left:0;right:0;top:0;z-index:99999;padding:8px 12px;"
12346
+ + "font:12px/1.5 system-ui,sans-serif;background:#7f1d1d;color:#fff;white-space:pre-wrap;";
12347
+ bar.textContent = "sage-mem 面板渲染失败:" + ((ev && ev.message) || "未知错误") + " —— 刷新页面可重试。";
12348
+ if (document.body) document.body.appendChild(bar);
12349
+ } catch (e) { /* 兜底自己出错就不再兜 */ }
12350
+ });
12351
+ }
12352
+
12121
12353
  async function apply(ctx) {
12354
+ installFatalBanner();
12122
12355
  await ctx.remote.$mount(TYPERT_REMOTE);
12123
12356
  // 样式注入(参照官方 client bundle 的 data-plugin-css 约定,幂等)
12124
12357
  const tagId = "sage-mem/settings.css";
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.28.0",
4
+ "version": "2.29.1",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "icon": "./icon.png",