sage-mem 2.28.0 → 2.29.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 +1 -1
- package/README.md +1 -1
- package/lib/client.js +342 -107
- package/package.json +1 -1
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
|
+
**Current release: `2.29.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.
|
|
17
|
+
**当前发布版本:`2.29.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
|
@@ -2524,7 +2524,10 @@ const StarmapRuntime = (function (require, _react) {
|
|
|
2524
2524
|
};
|
|
2525
2525
|
|
|
2526
2526
|
const CSS = [
|
|
2527
|
-
|
|
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
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
".smem-btn-
|
|
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,#
|
|
2564
|
-
".smem-btn-danger:
|
|
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-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
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-
|
|
2716
|
-
|
|
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
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
2795
|
-
".smem-update-link{color:var(--dsw-alias-brand-primary
|
|
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
|
|
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
|
|
2818
|
-
".smem-tab--on:after{animation:smem-under
|
|
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
|
|
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
|
|
2835
|
-
".smem-entry-summary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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:
|
|
2959
|
-
".smem-ext-row:hover{background:var(--dsw-alias-bg-
|
|
2960
|
-
'.smem-ext-row--on{border-left-color:var(--dsw-alias-brand-primary
|
|
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
|
|
2970
|
-
'.smem-intake-badge--conflict{border-color:var(--dsw-
|
|
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-
|
|
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,40 @@ 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
|
+
/**
|
|
8108
|
+
* 标签切分(本页专用)。
|
|
8109
|
+
*
|
|
8110
|
+
* 为什么不调 `50-shared-ui.js` 里的 `parseTagInput`:那份在**另一个作用域**里,
|
|
8111
|
+
* 68 这个分片够不着 —— 直接调会 ReferenceError,整块面板渲染崩成空白(2026-12-04 实测)。
|
|
8112
|
+
* 三件事与它保持一致:认 `,` `,` `、` 三种分隔符、剥掉 YAML 有语法含义的字符、去空。
|
|
8113
|
+
*/
|
|
8114
|
+
function parseTagsOf(raw) {
|
|
8115
|
+
return String(raw == null ? "" : raw)
|
|
8116
|
+
.split(/[,,、]+/)
|
|
8117
|
+
.map(function (s) { return s.replace(/[\[\]"'#:]/g, "").trim(); })
|
|
8118
|
+
.filter(function (s) { return s !== ""; })
|
|
8119
|
+
.slice(0, 20)
|
|
8120
|
+
.map(function (s) { return s.slice(0, 40); });
|
|
8121
|
+
}
|
|
8122
|
+
|
|
8059
8123
|
/** 前缀候选:默认那两个 + 另外两类(面板把「不给」也画出来,免得以为漏了)。 */
|
|
8060
8124
|
const PREFIX_CHOICES = ["project_", "reference_", "user_", "feedback_"];
|
|
8061
8125
|
|
|
8126
|
+
/**
|
|
8127
|
+
* 搜索命中的文件(最多 8 条)。
|
|
8128
|
+
*
|
|
8129
|
+
* 名字与描述都参与匹配、大小写不敏感;空查询**不返回任何东西** ——
|
|
8130
|
+
* 一进来就把整库铺开,等于把下面那张完整清单复制一遍。
|
|
8131
|
+
*/
|
|
8132
|
+
const findQuery = String(findDraft || "").trim().toLowerCase();
|
|
8133
|
+
const findMatches = findQuery === ""
|
|
8134
|
+
? []
|
|
8135
|
+
: files.filter(function (f) {
|
|
8136
|
+
const name = String((f && f.file) || "").toLowerCase();
|
|
8137
|
+
const desc = String((f && f.description) || "").toLowerCase();
|
|
8138
|
+
return name.indexOf(findQuery) >= 0 || desc.indexOf(findQuery) >= 0;
|
|
8139
|
+
}).slice(0, 8);
|
|
8140
|
+
|
|
8062
8141
|
function load() {
|
|
8063
8142
|
if (!remote || typeof remote.getSettings !== "function") {
|
|
8064
8143
|
setErr(t("ext.err.noSettings"));
|
|
@@ -8074,13 +8153,13 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8074
8153
|
}, function (e) { setErr(String((e && e.message) || e)); });
|
|
8075
8154
|
if (typeof remote.externalStatus === "function") {
|
|
8076
8155
|
Promise.resolve(remote.externalStatus()).then(function (res) {
|
|
8077
|
-
setStatus(unwrap(res) || {});
|
|
8078
|
-
}, function () {
|
|
8156
|
+
setStatus(unwrap(res) || {}); setStatusErr("");
|
|
8157
|
+
}, function (e) { setStatusErr(String((e && e.message) || e)); });
|
|
8079
8158
|
}
|
|
8080
8159
|
if (typeof remote.listFiles === "function") {
|
|
8081
8160
|
Promise.resolve(remote.listFiles()).then(function (res) {
|
|
8082
|
-
setFiles(Array.isArray(unwrap(res)) ? unwrap(res) : []);
|
|
8083
|
-
}, function () {
|
|
8161
|
+
setFiles(Array.isArray(unwrap(res)) ? unwrap(res) : []); setFilesErr("");
|
|
8162
|
+
}, function (e) { setFilesErr(String((e && e.message) || e)); });
|
|
8084
8163
|
}
|
|
8085
8164
|
}
|
|
8086
8165
|
|
|
@@ -8088,20 +8167,45 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8088
8167
|
|
|
8089
8168
|
react.useEffect(function () { load(); }, []);
|
|
8090
8169
|
|
|
8170
|
+
/**
|
|
8171
|
+
* 状态每 15 秒自刷一次。
|
|
8172
|
+
*
|
|
8173
|
+
* 「最近一轮」是宿主那边在写的(每 45 秒一轮),页面只在进页与保存后读一次 ——
|
|
8174
|
+
* 开着坐十分钟,卡上还写着「还没有导出过」(审计 P1-6)。
|
|
8175
|
+
*/
|
|
8176
|
+
react.useEffect(function () {
|
|
8177
|
+
if (!enabled) return undefined;
|
|
8178
|
+
const id = setInterval(function () { refreshStatus(); }, 15000);
|
|
8179
|
+
return function () { clearInterval(id); };
|
|
8180
|
+
}, [enabled]);
|
|
8181
|
+
|
|
8091
8182
|
/** 保存一段 `external` 补丁。`setSettings` 自带 `{ok, settings}`,不要过 unwrap。 */
|
|
8183
|
+
/**
|
|
8184
|
+
* 保存后**统一回读**一次设置(2.29.0)。
|
|
8185
|
+
*
|
|
8186
|
+
* 为什么不再信任 `setSettings` 返回值里的 `settings`:2026-12-04 实测,
|
|
8187
|
+
* 点开关之后后端确实关掉了(端点停了),但界面仍是「已开启」——
|
|
8188
|
+
* 返回的那份快照与落盘结果对不上,前端拿它 setState 就等于把旧值又画了一遍。
|
|
8189
|
+
* 回读的代价是一次 RPC,换来的是「界面永远等于服务端」。
|
|
8190
|
+
*/
|
|
8191
|
+
function reloadSettings() {
|
|
8192
|
+
if (!remote || typeof remote.getSettings !== "function") return;
|
|
8193
|
+
Promise.resolve(remote.getSettings()).then(function (res) {
|
|
8194
|
+
const d = unwrap(res) || {};
|
|
8195
|
+
setMemSet(d);
|
|
8196
|
+
// 回读只覆盖草稿里**没有未保存修改**的那几个 —— 这里保守起见,只在草稿为空时回填,
|
|
8197
|
+
// 免得把用户正在输入的内容冲掉。
|
|
8198
|
+
if (String(tagDraft || "").trim() === "") setTagsOf((d.external || {}).tags);
|
|
8199
|
+
}, function () { /* 回读失败不动界面:最坏是这次点击看起来没生效,下次操作会再读 */ });
|
|
8200
|
+
}
|
|
8201
|
+
|
|
8092
8202
|
function saveExternal(patch, okMsg) {
|
|
8093
8203
|
if (!remote || typeof remote.setSettings !== "function") { setErr(t("ext.err.noSettings")); return; }
|
|
8094
8204
|
setBusy(true); setErr(null); setNotice("");
|
|
8095
8205
|
Promise.resolve(remote.setSettings({ external: patch })).then(function (out) {
|
|
8096
8206
|
setBusy(false);
|
|
8097
8207
|
if (out && out.ok === false) { setErr(out.error || t("ext.err.rejected")); return; }
|
|
8098
|
-
|
|
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
|
-
}
|
|
8208
|
+
reloadSettings();
|
|
8105
8209
|
// 保存完立刻重读状态:暴露条数与端点都要马上反映出来(宿主那边已经 refresh 过)。
|
|
8106
8210
|
refreshStatus();
|
|
8107
8211
|
setNotice(okMsg);
|
|
@@ -8114,7 +8218,7 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8114
8218
|
function refreshStatus() {
|
|
8115
8219
|
if (!remote || typeof remote.externalStatus !== "function") return;
|
|
8116
8220
|
Promise.resolve(remote.externalStatus()).then(function (res) {
|
|
8117
|
-
setStatus(unwrap(res) || {});
|
|
8221
|
+
setStatus(unwrap(res) || {}); setStatusErr("");
|
|
8118
8222
|
}, function () { /* 同上 */ });
|
|
8119
8223
|
}
|
|
8120
8224
|
|
|
@@ -8133,23 +8237,75 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8133
8237
|
|
|
8134
8238
|
/** 标签白名单:逗号分隔(中英文逗号都收)。空 = 不按标签开放。 */
|
|
8135
8239
|
function saveTags() {
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8240
|
+
// 走本页的 parseTagsOf:认半角逗号、全角逗号与顿号,并剥掉 YAML 里有语法含义的字符。
|
|
8241
|
+
// 旧实现只切 `[,,]`,中文输入法敲出的「记忆系统、发布」会被当成一个标签(审计 P3-1)。
|
|
8242
|
+
saveExternal({ tags: parseTagsOf(tagDraft) }, t("ext.notice.saved"));
|
|
8243
|
+
}
|
|
8244
|
+
|
|
8245
|
+
/**
|
|
8246
|
+
* 失焦即保存(2.29.0)。
|
|
8247
|
+
*
|
|
8248
|
+
* 为什么去掉那三个「保存」按钮:同一屏三个同等权重的主按钮,等于没有主操作,
|
|
8249
|
+
* 用户不知道点哪个才对(2026-12-04 用户反馈)。改成「改完离开就存」,
|
|
8250
|
+
* 并**只在真的变了**才发请求 —— 否则点一下输入框再点走,就会白刷一次提示。
|
|
8251
|
+
*/
|
|
8252
|
+
function saveTagsIfChanged() {
|
|
8253
|
+
const next = parseTagsOf(tagDraft);
|
|
8254
|
+
const cur = (ext && Array.isArray(ext.tags) ? ext.tags : []).map(function (s) { return String(s).trim(); }).filter(function (s) { return s !== ""; });
|
|
8255
|
+
if (next.join("\u0000") === cur.join("\u0000")) return;
|
|
8256
|
+
saveTags();
|
|
8257
|
+
}
|
|
8258
|
+
|
|
8259
|
+
/** 回车 = 立即保存并失焦(不用等用户点到别处)。 */
|
|
8260
|
+
function submitOnEnter(handler) {
|
|
8261
|
+
return function (e) {
|
|
8262
|
+
if (e.key !== "Enter") return;
|
|
8263
|
+
e.preventDefault();
|
|
8264
|
+
handler();
|
|
8265
|
+
if (e.target && typeof e.target.blur === "function") e.target.blur();
|
|
8266
|
+
};
|
|
8267
|
+
}
|
|
8268
|
+
|
|
8269
|
+
/**
|
|
8270
|
+
* 某个文件**现在是否在白名单里** —— 这是「意图」,不是「上一轮导出的结果」。
|
|
8271
|
+
*
|
|
8272
|
+
* 为什么不能拿 `exposedNames` 当勾选态:那是导出**之后**的结果,最多要等 45 秒才更新。
|
|
8273
|
+
* 用户点一下勾,界面半分钟内不动,看起来就是「点了没反应」(2026-12-04 实测两次)。
|
|
8274
|
+
* 这里按 include / exclude / prefixes 现算,点完立刻变。
|
|
8275
|
+
*
|
|
8276
|
+
* 三者优先级与后端 `lib/mirror/policy.js` 一致:排除 > 包含 > 前缀。
|
|
8277
|
+
*/
|
|
8278
|
+
function isIncluded(name) {
|
|
8279
|
+
if (!ext) return false;
|
|
8280
|
+
const n = String(name);
|
|
8281
|
+
const inc = (ext.include || []).map(String);
|
|
8282
|
+
const exc = (ext.exclude || []).map(String);
|
|
8283
|
+
if (exc.indexOf(n) >= 0) return false;
|
|
8284
|
+
if (inc.indexOf(n) >= 0) return true;
|
|
8285
|
+
const lower = n.toLowerCase();
|
|
8286
|
+
// 与后端 `lib/mirror/policy.js` 的 `isExposed` **同序**:排除 > 包含 > 前缀 > 标签。
|
|
8287
|
+
// 前端**刻意不判 `enabled`** —— 关着的时候勾选是「打开后要导出什么」,不是「现在正在导出」。
|
|
8288
|
+
if ((ext.prefixes || []).some(function (p) { return lower.indexOf(String(p).toLowerCase()) === 0; })) return true;
|
|
8289
|
+
const hit = (files || []).filter(function (f) { return String(f && f.file) === n; })[0];
|
|
8290
|
+
const own = (hit && Array.isArray(hit.tags) ? hit.tags : []).map(function (t) { return String(t).toLowerCase(); });
|
|
8291
|
+
if (own.length && (ext.tags || []).some(function (t) { return own.indexOf(String(t).toLowerCase()) >= 0; })) return true;
|
|
8292
|
+
return false;
|
|
8141
8293
|
}
|
|
8142
8294
|
|
|
8143
8295
|
/**
|
|
8144
8296
|
* 逐条勾选:勾上 → include、取消 → exclude(同时从另一侧摘掉,免得两份名单都记着它)。
|
|
8145
8297
|
* 「取消」写的是 exclude 而不是「什么都不做」—— 前缀整类打开时,只有 exclude 能压过它。
|
|
8298
|
+
*
|
|
8299
|
+
* 先本地改、再发请求:点击瞬间就要看见变化,等服务端回来才动等于没反馈。
|
|
8300
|
+
* 请求失败时 `saveExternal` 会设错误,下一次回读把界面纠正回真实值。
|
|
8146
8301
|
*/
|
|
8147
8302
|
function toggleFile(name) {
|
|
8148
8303
|
if (!ext) return;
|
|
8149
8304
|
const include = (ext.include || []).filter(function (n) { return n !== name; });
|
|
8150
8305
|
const exclude = (ext.exclude || []).filter(function (n) { return n !== name; });
|
|
8151
|
-
if (
|
|
8306
|
+
if (isIncluded(name)) exclude.push(name);
|
|
8152
8307
|
else include.push(name);
|
|
8308
|
+
setMemSet({ ...memSet, external: { ...ext, include: include, exclude: exclude } });
|
|
8153
8309
|
saveExternal({ include: include, exclude: exclude }, t("ext.notice.file"));
|
|
8154
8310
|
}
|
|
8155
8311
|
|
|
@@ -8157,7 +8313,7 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8157
8313
|
const raw = String(portDraft == null ? "" : portDraft).trim();
|
|
8158
8314
|
const n = Number(raw);
|
|
8159
8315
|
if (raw === "" || !Number.isInteger(n) || n < 1024 || n > 65535) { setErr(t("ext.err.port")); return; }
|
|
8160
|
-
saveExternal({ port: n }, t("ext.notice.port"));
|
|
8316
|
+
saveExternal({ port: n }, enabled ? t("ext.notice.port") : t("ext.notice.saved"));
|
|
8161
8317
|
}
|
|
8162
8318
|
|
|
8163
8319
|
/** 轮询间隔(15–600 秒)。它是第二道保险:目录事件漏了也有它兜底。 */
|
|
@@ -8168,6 +8324,19 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8168
8324
|
saveExternal({ pollSeconds: n }, t("ext.notice.poll"));
|
|
8169
8325
|
}
|
|
8170
8326
|
|
|
8327
|
+
/** 只有值真的变了才发请求(失焦被触发得很频繁,空写一次会刷掉提示条)。 */
|
|
8328
|
+
function savePortIfChanged() {
|
|
8329
|
+
const n = Number(String(portDraft == null ? "" : portDraft).trim());
|
|
8330
|
+
if (!Number.isInteger(n) || n === (ext && ext.port)) return;
|
|
8331
|
+
savePort();
|
|
8332
|
+
}
|
|
8333
|
+
|
|
8334
|
+
function savePollIfChanged() {
|
|
8335
|
+
const n = Number(String(pollDraft == null ? "" : pollDraft).trim());
|
|
8336
|
+
if (!Number.isInteger(n) || n === (ext && ext.pollSeconds)) return;
|
|
8337
|
+
savePoll();
|
|
8338
|
+
}
|
|
8339
|
+
|
|
8171
8340
|
const statusText = busy
|
|
8172
8341
|
? t("lab.action.saving")
|
|
8173
8342
|
: (enabled
|
|
@@ -8182,13 +8351,17 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8182
8351
|
written: status.written, unchanged: status.unchanged, deleted: status.deleted,
|
|
8183
8352
|
});
|
|
8184
8353
|
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8354
|
+
// 「读不到」不能画成「未启动」:后者会让用户以为端点真的没起来(审计 P1-7)。
|
|
8355
|
+
const endpointLine = statusErr
|
|
8356
|
+
? t("ext.endpoint.readFailed", { error: statusErr })
|
|
8357
|
+
: (!endpoint
|
|
8358
|
+
? t("ext.endpoint.off")
|
|
8359
|
+
: (endpoint.listening
|
|
8360
|
+
? t("ext.endpoint.on", { url: endpoint.url })
|
|
8361
|
+
: (endpoint.error ? t("ext.endpoint.error", { error: endpoint.error }) : t("ext.endpoint.off"))));
|
|
8362
|
+
|
|
8363
|
+
return h("div", { className: "smem-external smem-stack" }, [
|
|
8364
|
+
h("div", { className: "smem-module-card", key: "main" }, [
|
|
8192
8365
|
h("div", { className: "smem-modcard-head", key: "head" }, [
|
|
8193
8366
|
h(Switch, {
|
|
8194
8367
|
key: "sw",
|
|
@@ -8222,6 +8395,37 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8222
8395
|
h("div", { className: "smem-autodream-note", key: "hint" }, t("ext.prefixesHint")),
|
|
8223
8396
|
]),
|
|
8224
8397
|
|
|
8398
|
+
// ── 按名字搜索并加入(2.29.0)──
|
|
8399
|
+
// 用户原话:记忆一多,靠下面那张长清单翻太慢 —— 要在前缀区下面直接搜到某一条。
|
|
8400
|
+
// 命中的行与下面「逐条勾选」走同一个 `toggleFile`,两处状态天然一致。
|
|
8401
|
+
h("div", { className: "smem-autodream-sec", key: "find" }, [
|
|
8402
|
+
h("div", { className: "smem-autodream-key", key: "k" }, t("ext.find")),
|
|
8403
|
+
h("input", {
|
|
8404
|
+
className: "smem-input", key: "q", type: "search",
|
|
8405
|
+
value: findDraft,
|
|
8406
|
+
disabled: busy || !memSet,
|
|
8407
|
+
placeholder: t("ext.findPlaceholder"),
|
|
8408
|
+
onChange: function (e) { setFindDraft(e.target.value); },
|
|
8409
|
+
}),
|
|
8410
|
+
findQuery === ""
|
|
8411
|
+
? null
|
|
8412
|
+
: (findMatches.length === 0
|
|
8413
|
+
? h("div", { className: "smem-muted", key: "none" }, t("ext.findNone"))
|
|
8414
|
+
: h("div", { className: "smem-ext-list", key: "hits" }, findMatches.map(function (f) {
|
|
8415
|
+
const name = String(f && f.file ? f.file : "");
|
|
8416
|
+
const on = isIncluded(name);
|
|
8417
|
+
return h("label", { className: "smem-ext-row" + (on ? " smem-ext-row--on" : ""), key: "hit-" + name, title: String((f && f.description) || "") }, [
|
|
8418
|
+
h("input", {
|
|
8419
|
+
type: "checkbox", key: "c", checked: on,
|
|
8420
|
+
disabled: busy || !memSet,
|
|
8421
|
+
onChange: function () { toggleFile(name); },
|
|
8422
|
+
}),
|
|
8423
|
+
h("span", { className: "smem-ext-name", key: "n" }, name),
|
|
8424
|
+
h("span", { className: "smem-muted", key: "d" }, String((f && f.description) || "").slice(0, 60)),
|
|
8425
|
+
]);
|
|
8426
|
+
}))),
|
|
8427
|
+
]),
|
|
8428
|
+
|
|
8225
8429
|
// ── 白名单:按标签 ──
|
|
8226
8430
|
h("div", { className: "smem-autodream-sec", key: "tags" }, [
|
|
8227
8431
|
h("div", { className: "smem-autodream-row", key: "r" }, [
|
|
@@ -8232,11 +8436,9 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8232
8436
|
disabled: busy || !memSet,
|
|
8233
8437
|
placeholder: t("ext.tagsPlaceholder"),
|
|
8234
8438
|
onChange: function (e) { setTagDraft(e.target.value); },
|
|
8439
|
+
onBlur: saveTagsIfChanged,
|
|
8440
|
+
onKeyDown: submitOnEnter(saveTagsIfChanged),
|
|
8235
8441
|
}),
|
|
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
8442
|
]),
|
|
8241
8443
|
h("div", { className: "smem-autodream-note", key: "hint" }, t("ext.tagsHint")),
|
|
8242
8444
|
]),
|
|
@@ -8245,24 +8447,31 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8245
8447
|
h("div", { className: "smem-autodream-sec", key: "files" }, [
|
|
8246
8448
|
h("div", { className: "smem-autodream-key", key: "k" }, t("ext.files")),
|
|
8247
8449
|
h("div", { className: "smem-autodream-note", key: "hint" }, t("ext.filesHint")),
|
|
8248
|
-
|
|
8249
|
-
? h("div", { className: "smem-
|
|
8250
|
-
:
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8450
|
+
filesErr
|
|
8451
|
+
? h("div", { className: "smem-err", key: "readErr" }, "⚠ " + t("ext.filesReadFailed", { error: filesErr }))
|
|
8452
|
+
: (files.length === 0
|
|
8453
|
+
? h("div", { className: "smem-muted", key: "empty" }, t("ext.filesEmpty"))
|
|
8454
|
+
: h("div", { className: "smem-ext-list", key: "list" }, files.map(function (f) {
|
|
8455
|
+
const name = String(f && f.file ? f.file : "");
|
|
8456
|
+
const on = isIncluded(name);
|
|
8457
|
+
return h("label", { className: "smem-ext-row" + (on ? " smem-ext-row--on" : ""), key: name, title: String((f && f.description) || "") }, [
|
|
8458
|
+
h("input", {
|
|
8459
|
+
type: "checkbox", key: "c", checked: on,
|
|
8460
|
+
disabled: busy || !memSet,
|
|
8461
|
+
onChange: function () { toggleFile(name); },
|
|
8462
|
+
}),
|
|
8463
|
+
h("span", { className: "smem-ext-name", key: "n" }, name),
|
|
8464
|
+
h("span", { className: "smem-muted", key: "d" }, String((f && f.description) || "").slice(0, 60)),
|
|
8465
|
+
]);
|
|
8466
|
+
}))),
|
|
8467
|
+
enabled && exposed.size > 0
|
|
8264
8468
|
? h("div", { className: "smem-autodream-note", key: "count" }, t("ext.exposed", { count: exposed.size }))
|
|
8265
8469
|
: null,
|
|
8470
|
+
// 关着的时候把话说清楚:勾选是「打开后要导出什么」,不是「现在已经在导出」
|
|
8471
|
+
// (审计 P0-2:关掉开关后界面还写着「实际暴露 N 条」,自相矛盾)。
|
|
8472
|
+
!enabled
|
|
8473
|
+
? h("div", { className: "smem-autodream-note", key: "off" }, t("ext.exposedOff"))
|
|
8474
|
+
: null,
|
|
8266
8475
|
]),
|
|
8267
8476
|
|
|
8268
8477
|
// ── 端点与最近一轮 ──
|
|
@@ -8274,11 +8483,9 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8274
8483
|
value: portDraft,
|
|
8275
8484
|
disabled: busy || !memSet,
|
|
8276
8485
|
onChange: function (e) { setPortDraft(e.target.value); },
|
|
8486
|
+
onBlur: savePortIfChanged,
|
|
8487
|
+
onKeyDown: submitOnEnter(savePortIfChanged),
|
|
8277
8488
|
}),
|
|
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
8489
|
]),
|
|
8283
8490
|
h("div", { className: "smem-autodream-row", key: "poll" }, [
|
|
8284
8491
|
h("span", { className: "smem-autodream-key", key: "k" }, t("ext.poll")),
|
|
@@ -8287,12 +8494,10 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8287
8494
|
value: pollDraft,
|
|
8288
8495
|
disabled: busy || !memSet,
|
|
8289
8496
|
onChange: function (e) { setPollDraft(e.target.value); },
|
|
8497
|
+
onBlur: savePollIfChanged,
|
|
8498
|
+
onKeyDown: submitOnEnter(savePollIfChanged),
|
|
8290
8499
|
}),
|
|
8291
8500
|
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
8501
|
]),
|
|
8297
8502
|
h("div", { className: "smem-autodream-note", key: "ep" }, t("ext.endpointLabel") + " " + endpointLine),
|
|
8298
8503
|
h("div", { className: "smem-autodream-note", key: "last" }, lastLine),
|
|
@@ -8307,8 +8512,11 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
8307
8512
|
: null,
|
|
8308
8513
|
]),
|
|
8309
8514
|
|
|
8310
|
-
|
|
8311
|
-
|
|
8515
|
+
]),
|
|
8516
|
+
|
|
8517
|
+
// ── 2.26.0 写侧:外部来件 ──
|
|
8518
|
+
// 与主卡**平级**:以前它嵌在主卡里面,三层边框(外卡 → 分区 → 内卡)挤在一起(审计 P2-3)。
|
|
8519
|
+
h(ExternalIntakeCard, { key: "intake", ctx: props.ctx }),
|
|
8312
8520
|
|
|
8313
8521
|
err ? h("div", { className: "smem-err", key: "err" }, "⚠ " + err) : null,
|
|
8314
8522
|
notice ? h("div", { className: "smem-ok", key: "ok" }, "✓ " + notice) : null,
|
|
@@ -12118,7 +12326,34 @@ h("span", { key: "sep", className: "smem-actions-sep", "aria-hidden": "true" }),
|
|
|
12118
12326
|
* Client 插件:$mount strict remote contribution(第三方 remote 不在
|
|
12119
12327
|
* 宿主的固定 remote 清单里,必须自己挂),再注册设置页签 / 侧栏入口。
|
|
12120
12328
|
*/
|
|
12329
|
+
/**
|
|
12330
|
+
* 兜底红带(2.29.0)。
|
|
12331
|
+
*
|
|
12332
|
+
* React 的错误边界只认 class,而本插件的分片里不写 class —— 测试 harness 直接调用
|
|
12333
|
+
* 组件函数,class 组件在那里根本渲染不出来(2026-12-04 试过,`cannot be invoked without 'new'`)。
|
|
12334
|
+
* 所以退一步:挂 window 的未捕获异常,一旦渲染炸了,至少在页顶摊一条红带并写出错误原文,
|
|
12335
|
+
* 而不是让用户对着黑屏猜。
|
|
12336
|
+
*/
|
|
12337
|
+
function installFatalBanner() {
|
|
12338
|
+
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
12339
|
+
if (typeof window.addEventListener !== "function") return;
|
|
12340
|
+
if (window.__smemFatalHooked) return;
|
|
12341
|
+
window.__smemFatalHooked = true;
|
|
12342
|
+
window.addEventListener("error", function (ev) {
|
|
12343
|
+
try {
|
|
12344
|
+
if (document.getElementById("smem-fatal-banner")) return;
|
|
12345
|
+
const bar = document.createElement("div");
|
|
12346
|
+
bar.id = "smem-fatal-banner";
|
|
12347
|
+
bar.style.cssText = "position:fixed;left:0;right:0;top:0;z-index:99999;padding:8px 12px;"
|
|
12348
|
+
+ "font:12px/1.5 system-ui,sans-serif;background:#7f1d1d;color:#fff;white-space:pre-wrap;";
|
|
12349
|
+
bar.textContent = "sage-mem 面板渲染失败:" + ((ev && ev.message) || "未知错误") + " —— 刷新页面可重试。";
|
|
12350
|
+
if (document.body) document.body.appendChild(bar);
|
|
12351
|
+
} catch (e) { /* 兜底自己出错就不再兜 */ }
|
|
12352
|
+
});
|
|
12353
|
+
}
|
|
12354
|
+
|
|
12121
12355
|
async function apply(ctx) {
|
|
12356
|
+
installFatalBanner();
|
|
12122
12357
|
await ctx.remote.$mount(TYPERT_REMOTE);
|
|
12123
12358
|
// 样式注入(参照官方 client bundle 的 data-plugin-css 约定,幂等)
|
|
12124
12359
|
const tagId = "sage-mem/settings.css";
|
package/package.json
CHANGED