dsh-plugin-tool-management 0.22.6 → 0.22.8

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +17 -19
  3. package/README_EN.md +16 -18
  4. package/docs/COMPATIBILITY.md +112 -112
  5. package/docs/TROUBLESHOOTING.md +5 -5
  6. package/lib/client.js +239 -164
  7. package/lib/compat/capability-specs.js +1 -1
  8. package/lib/compat/probe.js +19 -19
  9. package/lib/confirm-gate.js +13 -13
  10. package/lib/context-inject-contract.js +6 -9
  11. package/lib/context-inject-frame.js +10 -8
  12. package/lib/context-inject-surface.js +1 -1
  13. package/lib/context-inject.js +1 -1
  14. package/lib/evolution/cold.js +2 -2
  15. package/lib/evolution/config.js +6 -15
  16. package/lib/evolution/gates.js +11 -2
  17. package/lib/evolution/maintenance.js +40 -12
  18. package/lib/evolution/notes.js +47 -6
  19. package/lib/evolution/review.js +1 -1
  20. package/lib/evolution/runtime.js +0 -1
  21. package/lib/evolution/state.js +29 -3
  22. package/lib/evolution/write.js +228 -79
  23. package/lib/index.js +210 -95
  24. package/lib/legacy-tool-names.js +39 -28
  25. package/lib/mcp/state-section.js +2 -2
  26. package/lib/memories/catalog.js +11 -0
  27. package/lib/memories/constants.js +34 -13
  28. package/lib/memories/projection.js +1 -1
  29. package/lib/memories/render-auto.js +11 -10
  30. package/lib/memories/service.js +10 -3
  31. package/lib/memories/snapshot.js +6 -5
  32. package/lib/op-registry.js +3 -0
  33. package/lib/ops/compat.js +4 -2
  34. package/lib/ops/evolution.js +52 -32
  35. package/lib/ops/memory.js +1 -1
  36. package/lib/ops/trash.js +1 -1
  37. package/lib/scenes/candidates.js +5 -1
  38. package/lib/skills/catalog.js +2 -2
  39. package/lib/subagents/catalog.js +1 -1
  40. package/lib/subagents/persona-parse.js +22 -3
  41. package/lib/subagents/run-provider.js +4 -4
  42. package/lib/text-width.js +8 -2
  43. package/lib/tool-table-switch.js +21 -9
  44. package/lib/tools/control.js +3 -3
  45. package/lib/tools/deps.js +4 -4
  46. package/lib/tools/memory.js +95 -42
  47. package/lib/tools/prompt.js +1 -1
  48. package/lib/tools/remove.js +4 -4
  49. package/lib/tools/scene.js +1 -1
  50. package/lib/tools/table.js +40 -17
  51. package/lib/trash-id.js +1 -1
  52. package/package.json +24 -24
package/lib/client.js CHANGED
@@ -353,13 +353,22 @@ button.dsm-qty:disabled{cursor:default}
353
353
  .dsm-kind-tag{flex:none;display:inline-flex;align-items:center;padding:0 6px;height:18px;border-radius:4px;border:1px solid var(--dsw-alias-line-tertiary,rgba(255,255,255,.16));color:var(--dsw-alias-label-tertiary,rgba(255,255,255,.55));font-size:11px;line-height:1;white-space:nowrap}
354
354
  .dsm-target-pick{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
355
355
  .dsm-target-pick>*{flex:1 1 120px;min-width:0}
356
+ /* 「新建记忆」的层级 + 二级下拉:左边那格只装短标签(全局 / 工作区 / 场景),宽度减半 ——
357
+ 腾出来的横向空间全给右边那格,因为它装的是工作区名 / 场景名,那串名字常比一整行还长,
358
+ 挤在半宽里就被省略号截掉,看不出是哪一档。
359
+ 只有层级一格时(选「全局」)它独占整行 —— 空着一大半不自然。 */
360
+ .dsm-target-pick>.dsm-target-level{flex:0 0 120px}
361
+ .dsm-target-pick>.dsm-target-name{flex:1 1 auto;min-width:0}
362
+ .dsm-target-pick>.dsm-target-level:only-child{flex:1 1 auto}
356
363
  /* 后台复习与其它段同版式:标题在框外,列表与失败项在框里。 */
357
364
  .dsm-evo-review{display:flex;flex-direction:column;gap:6px}
358
365
  .dsm-evo-review-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
359
- /* 折叠标题:与其它分节标题**同一档字号 / 字重 / 颜色**,但可点。不能写 font:inherit ——
360
- 这个元素同时挂着 .dsm-evo-section-title,而 font 简写会把那条规则的 12px/600 一起
361
- 覆盖成父级的正文字号,结果只有这一段标题比别的大一号(用户截图里一眼就看出来了)。 */
362
- .dsm-evo-review-toggle{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:600;line-height:17px;cursor:pointer}
366
+ /* 折叠标题:与其它分节标题**同一档字号 / 字重**,但可点,所以文字用主色而不是三级灰。
367
+ 不能写 font:inherit —— 这个元素同时挂着 .dsm-evo-section-title,而 font 简写会把那条
368
+ 规则的 12px/600 一起覆盖成父级的正文字号,结果只有这一段标题比别的大一号(用户截图里
369
+ 一眼就看出来了)。 */
370
+ .dsm-evo-review-toggle{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600;line-height:17px;cursor:pointer}
371
+ .dsm-evo-review-caret{width:12px;height:12px;flex:none;color:var(--dsw-alias-label-primary)}
363
372
  .dsm-evo-review-toggle:disabled{cursor:default}
364
373
  .dsm-evo-review-head .dsm-help{margin:0;margin-left:auto}
365
374
  /* 每会话复习上限:一句话里一个数字框,与「学习频率」那条同一版式。 */
@@ -706,14 +715,13 @@ button.dsm-qty:disabled{cursor:default}
706
715
  .dsm-compat-pill-warn{border-color:var(--dsm-warn);color:var(--dsm-warn)}
707
716
  .dsm-compat-reach-marks{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px;min-width:0}
708
717
  .dsm-inject-settings{display:flex;flex-direction:column;gap:8px;padding:8px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsm-radius-m);background:var(--dsw-alias-bg-layer-2)}
709
- /* 注入域开关:八颗 chip 排成等宽网格(用户 2026-11-10:「这个排版设计好点」)。
710
- 此前是 flex 等分,最后一行只剩两颗时会被 flex:1 1 0 拉成整行宽的两大块;
711
- 改成 4 列 grid 后每颗同宽,八颗正好两行。窄栏(≤640px)退成两列,保证
712
- 「工作区自动记忆」这类长标签不被截断。
718
+ /* 注入域开关:每颗 chip 等宽,按可用宽度自动折行(用户 2026-11-10:「这个排版设计好点」)。
719
+ 此前是 flex 等分,最后一行只剩两颗时会被 flex:1 1 0 拉成整行宽的两大块;改成 grid
720
+ 后每颗同宽。列数不写死:域清单由服务端给,加一域不该让最后一行只剩一颗孤零零的
721
+ (七域在 6 列下就是这种形状)。minmax 下限保证「工作区笔记」这类长标签不被截断。
713
722
  开/关不只靠颜色:chip 里有一颗 6px 圆点,开 = 成功色实心、关 = 当前字色半透明,
714
723
  色盲或低对比屏上也能分辨;再加 role=switch + aria-checked 供读屏。 */
715
724
  .dsm-inject-domains{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
716
- @media (max-width:640px){.dsm-inject-domains{grid-template-columns:repeat(3,minmax(0,1fr))}}
717
725
  .dsm-inject-chip{box-sizing:border-box;display:inline-flex;width:100%;min-width:0;min-height:32px;align-items:center;justify-content:center;gap:6px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsm-radius-m);background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:12px;line-height:18px;white-space:nowrap;cursor:pointer}
718
726
  .dsm-inject-chip:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
719
727
  .dsm-inject-chip:focus-visible{outline-style:solid;outline-color:var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-width:var(--dsw-focus-ring-width,2px);outline-offset:2px}
@@ -749,6 +757,9 @@ button.dsm-qty:disabled{cursor:default}
749
757
  .dsm-tooltable-summary{display:flex;align-items:center;gap:8px;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}
750
758
  /* 会话层那一句(0.21.2):这张工具表归属哪一层、改动影响谁。 */
751
759
  .dsm-tooltable-scope{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}
760
+ /* 「<工具名>(≈N)随自主记忆开启 · 实际下发 N 个」(只在开启时显示):不在表里占行,用弱一档的字色挂在合计下面,
761
+ 与上面的手动合计分开读。 */
762
+ .dsm-tooltable-derived{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}
752
763
  /* 「保存方案 / 恢复方案」钉在合计那一行的最右(用户 2026-09-23 指定位置)。
753
764
  按钮压到与 18px 行高齐平:宿主默认的 .dsm-btn 比这行字高,直接放会把整行顶开。 */
754
765
  .dsm-tooltable-preset-actions{display:flex;flex:none;align-items:center;gap:4px;margin-left:auto}
@@ -1359,6 +1370,10 @@ button.dsm-qty:disabled{cursor:default}
1359
1370
  .dsm-head-stats{display:flex;overflow:hidden;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsm-radius-m);background:var(--dsw-alias-bg-layer-2)}
1360
1371
  .dsm-head-stat{display:flex;flex:1;min-width:0;align-items:baseline;gap:4px;padding:6px 12px;border-right:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;white-space:nowrap;overflow:hidden}
1361
1372
  .dsm-head-stat:last-child{border-right:0}
1373
+ /* 按内容取宽的一格(记忆页的「记忆域预算」):其余格等分整行,这格按文字的自然宽度占位。
1374
+ 它是这一行里最长的一串(「记忆域预算 262144/262144 B」),等分时先被省略号截掉 ——
1375
+ 数字被截比标签被截严重得多。flex:0 0 auto = 不参与等分、不伸缩。 */
1376
+ .dsm-head-stat-auto{flex:0 0 auto}
1362
1377
  /* 统计格里的标签(2026-10-12 改成标签在前、值在后):深灰 12px,可收缩截断;
1363
1378
  值(.dsm-head-num)恒不收缩 —— 宁可截标签也不能截数字。 */
1364
1379
  .dsm-head-stat-label{min-width:0;overflow:hidden;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap}
@@ -5090,6 +5105,17 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
5090
5105
  const injectParts = []
5091
5106
  if (inject) {
5092
5107
  const domains = (inject && inject.domains) || {}
5108
+ // 域名与顺序都取响应里的 `domains`:服务端已按注入域清单规范化成完整的七个键,
5109
+ // 界面再写一份字面量就会在加域 / 调序时与注入通道对不上。
5110
+ //
5111
+ // 两块记忆在界面上合成一颗「记忆」:后端仍保留 `memoryGlobal` / `memoryWorkspace`
5112
+ // 两个域(各自预算、各自快照),开关处只把这个合成键同时写进两个布尔值,避免出现
5113
+ // 「界面上关了、实际还剩半层在注入」的半开状态。
5114
+ const chipKeys = Object.keys(domains).reduce(function (out, key) {
5115
+ if (key === 'memoryWorkspace') return out
5116
+ out.push(key === 'memoryGlobal' ? 'memory' : key)
5117
+ return out
5118
+ }, [])
5093
5119
  injectParts.push(
5094
5120
  // 开关行(REDESIGN §5.2,切片五换装):总开关一行。
5095
5121
  React.createElement(SettingsRow, { key: 'force', name: t('compat.inject.force'),
@@ -5097,43 +5123,41 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
5097
5123
  React.createElement('div', { key: 'domains-head', className: 'dsm-seg-group' },
5098
5124
  React.createElement('span', null, t('compat.inject.domains')),
5099
5125
  React.createElement('span', { className: 'dsm-seg-group-line' })),
5100
- // 多域**一行**(用户 2026-10-12:「分六行很占用空间,能不能一行显示,而且还能美观、
5101
- // 简洁、高级」):每颗 chip 等分排开,开 = 成功色描边 + 实心点、关 = 默认描边 + 灰点。
5102
- // 不再用一排 32px 开关 —— 名字与开关并排要 ~105px,六份就是 630px,一行放不下还得
5103
- // 靠缩小字号硬塞;chip 把「名字」本身变成控件,窄栏按 flex-basis 折行也不会挤成一团。
5126
+ // 多域**挤在一块**(用户 2026-10-12:「分六行很占用空间,能不能一行显示,而且还能美观、
5127
+ // 简洁、高级」):每颗 chip 等宽排开,开 = 成功色描边 + 实心点、关 = 默认描边 + 灰点。
5128
+ // 不用一排 32px 开关 —— 名字与开关并排要 ~105px,七份就是 700px;chip 把「名字」本身
5129
+ // 变成控件,列宽由 CSS 的 auto-fit 决定,窄栏折成两三行而不是缩小字号硬塞。
5104
5130
  // a11y:role=switch + aria-checked 挂在 chip 上(它就是一个开关,只是长成了标签的样子),
5105
5131
  // 键盘可聚焦、Enter/Space 由 button 语义自带。
5106
5132
  React.createElement('div', { key: 'domains', className: 'dsm-inject-domains' },
5107
- // 两块记忆在界面上只占一个「记忆」开关:工作区笔记不是用户要单独管的东西,
5108
- // 自主记忆的学习 / 注入层开关在记忆页签。这里只管"记忆这一域注不注入",
5109
- // 点一下同时写 memoryGlobal / memoryWorkspace 两个内部域。
5110
- ['scene', 'memoryGlobal', 'mcp', 'skills', 'subagents', 'prompt'].map(function (key) {
5133
+ chipKeys.map(function (key) {
5134
+ const merged = key === 'memory'
5111
5135
  // 技能与提示词两域在标准类预设下由宿主送、本插件让位 —— 关掉它们时本插件会连
5112
5136
  // 宿主那条一起拦下(见 context-inject.ts 的 officialKindsToSuppress)。这里给
5113
5137
  // 那两项一句 title,免得用户以为"关了没用"。
5114
5138
  const carrier = key === 'skills' || key === 'prompt'
5115
- const memoryPair = key === 'memoryGlobal'
5116
- const on = memoryPair
5117
- ? domains.memoryGlobal !== false && domains.memoryWorkspace !== false
5139
+ const on = merged
5140
+ ? domains.memoryGlobal !== false || domains.memoryWorkspace !== false
5118
5141
  : domains[key] !== false
5142
+ // 有专属说明的域用自己的 title,其余回落到通用的 carrier 说明。
5143
+ const tipKey = 'compat.inject.domain.' + key + '.title'
5144
+ const tip = t(tipKey)
5145
+ const title = tip !== tipKey ? tip : carrier ? t('compat.inject.domain.carrier.title') : undefined
5119
5146
  return React.createElement('button', {
5120
5147
  key: 'domain-' + key,
5121
5148
  type: 'button',
5122
5149
  role: 'switch',
5123
5150
  'aria-checked': on,
5124
5151
  className: 'dsm-inject-chip' + (on ? ' dsm-inject-chip-on' : ''),
5125
- title: memoryPair
5126
- ? t('compat.inject.domain.memory.title')
5127
- : carrier ? t('compat.inject.domain.carrier.title') : undefined,
5152
+ title: title,
5128
5153
  'aria-label': t('compat.inject.domain.' + key),
5129
5154
  onClick: function () {
5130
5155
  const nextDomains = Object.assign({}, domains)
5131
- if (memoryPair) {
5132
- const next = !on
5133
- nextDomains.memoryGlobal = next
5134
- nextDomains.memoryWorkspace = next
5156
+ if (merged) {
5157
+ nextDomains.memoryGlobal = !on
5158
+ nextDomains.memoryWorkspace = !on
5135
5159
  } else {
5136
- nextDomains[key] = domains[key] === false
5160
+ nextDomains[key] = !on
5137
5161
  }
5138
5162
  saveInject({ domains: nextDomains })
5139
5163
  },
@@ -5234,12 +5258,16 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
5234
5258
  const groupLabel = function (key) {
5235
5259
  if (key === 'other') return t('compat.tools.other')
5236
5260
  if (key === 'control') return t('compat.tools.group.control')
5237
- return t('compat.inject.domain.' + key)
5261
+ // 分组键来自注入域内部名(`memoryGlobal` / `memoryWorkspace`),而工具表里记忆是
5262
+ // 一组 —— 折到合并后的「记忆」标签。注入实况仍按全局 / 工作区分行显示,用各自的
5263
+ // 词条;不折的话组头会把内部键名原样显示出来。
5264
+ const uiKey = key === 'memoryGlobal' || key === 'memoryWorkspace' ? 'memory' : key
5265
+ return t('compat.inject.domain.' + uiKey)
5238
5266
  }
5239
5267
  const toolTableDisabled = toolTableBusy || scopeSessionLocked || toolTable.state === 'unknown'
5240
- // 自主记忆那条工具没有独立开关:面板画成「只读行」—— 名字与介绍照常显示,
5241
- // 自主记忆那条工具不在这份报表里(服务端已把它从分组与计数中摘掉):
5242
- // 它的可见性只跟记忆页的两个开关走,这里没有它的行。
5268
+ // 自主记忆那条工具没有独立开关:它的可见性只跟记忆页的两个开关走,
5269
+ // 因此不在这份报表的分组里(服务端已把它从分组与计数中摘掉),界面上没有它的勾选行。
5270
+ // 它到底下发没下发、以及"实际一共几个工具",由下面那一行补上。
5243
5271
  const rows = []
5244
5272
  groups.forEach(function (group) {
5245
5273
  const tools = group.tools
@@ -5322,6 +5350,14 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
5322
5350
  title: presetCount ? t('compat.tools.preset.apply.tip') : t('compat.tools.preset.apply.tipEmpty'),
5323
5351
  onClick: function () { setToolPreset({ mode: 'apply' }) },
5324
5352
  }, t('compat.tools.preset.apply')))),
5353
+ // 表里能勾的只有手动清单里的工具;正文里还固定搭着一份跟随自主记忆开关的
5354
+ // 记忆工具,它没有勾选框、不占一行。开启时补一行写明它和"实际一共下发几个"
5355
+ // —— 否则合计行的数字与模型真正看到的工具数会差一个;关闭时没有这个差额,
5356
+ // 整行不显示。
5357
+ report.derived && report.derived.active ? React.createElement('div', { key: 'derived', className: 'dsm-tooltable-derived' },
5358
+ t('compat.tools.derived', { name: report.derived.name, tok: report.derived.tok }),
5359
+ ' · ',
5360
+ t('compat.tools.sent', { count: report.sentCount })) : null,
5325
5361
  // 这一张表归属哪一层 / 为什么勾不动(锁)。读不到时这一节本来就不渲染。
5326
5362
  scopeLine ? React.createElement('div', { className: 'dsm-tooltable-scope' }, scopeLine) : null,
5327
5363
  scopeSessionLocked
@@ -6006,7 +6042,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
6006
6042
 
6007
6043
  // ── 整机迁移(0.15.0 C2)──────────────────────────────────────────────────
6008
6044
  // 导出 = 一个目录带走全部;导入 = 先读清单预览、勾选域、选冲突策略,再执行。
6009
- // 两步是硬要求:一次写六个域的失败面太大,用户必须先看到"哪域有多少、几个重名"。
6045
+ // 两步是硬要求:一次写多个域的失败面太大,用户必须先看到"哪域有多少、几个重名"。
6010
6046
  /** 内联的目录浏览面板(挂在对应输入框下面,不再套一层弹窗)。 */
6011
6047
  const snapBrowsePanel = function (target) {
6012
6048
  if (!browse || browse.target !== target) return null
@@ -6789,7 +6825,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
6789
6825
  "evo.source.session": "生效来源:本会话设置",
6790
6826
  "evo.stat": "已学 {learned} 条 · 生效 {active} 条 · 待确认 {pending} 条",
6791
6827
  "evo.stat.reviewDue": " · 待复核 {due} 条",
6792
- "evo.stat.archived": " · 已归档 {archived} 条",
6793
6828
  "evo.stat.broken": " · 索引读不到,条目可能显示不全",
6794
6829
  "evo.empty": "暂无",
6795
6830
  "evo.layer.global": "全局",
@@ -6800,8 +6835,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
6800
6835
  "evo.tag.candidate": "待确认",
6801
6836
  "evo.tag.active": "生效",
6802
6837
  "evo.tag.core": "常驻",
6803
- "evo.tag.superseded": "已取代",
6804
- "evo.tag.archived": "已归档",
6805
6838
  "evo.approve": "确认",
6806
6839
  "evo.approved": "已确认:这条会进上下文",
6807
6840
  "evo.review.open": "查看",
@@ -6820,6 +6853,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
6820
6853
  "evo.kind.procedure": "做法",
6821
6854
  "evo.review.kind.ttl30": "30 天后提醒复核",
6822
6855
  "evo.review.kind.ttlForever": "不会过期",
6856
+ // 行上那颗类型标签的悬停说明:说清"这是什么类型的记忆、什么时候会回来让你复核",
6857
+ // 不把服务端的裸 ttl 天数直接甩给用户。
6858
+ "evo.review.tip": "{kind}记忆:{ttl}",
6859
+ "evo.review.tipNoKind": "有保质期的类型到期后会回到待确认,提醒你复核",
6823
6860
  "evo.review.evidence.title": "凭什么记这条:",
6824
6861
  "evo.review.basis": "当时的判断依据:{text}",
6825
6862
  "evo.review.evidence.line": "· {source}:「{quote}」",
@@ -6830,7 +6867,7 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
6830
6867
  "evo.tier.model_inference": "模型推断",
6831
6868
  "evo.review.approving": "确认中…",
6832
6869
  "evo.review.reject": "否决",
6833
- "evo.rejected": "已否决:这条不再注入,可在列表里恢复",
6870
+ "evo.rejected": "已移入回收站,可在那里恢复",
6834
6871
  "evo.review.deleted": "已删除",
6835
6872
  "evo.review.needed": "待复核",
6836
6873
  "evo.review.done": "复核",
@@ -7171,9 +7208,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7171
7208
  "compat.token.mismatch": "与宿主配置的令牌不一致:请填入配置里的那个值。",
7172
7209
  "compat.token.failed": "读取令牌状态失败,请刷新后重试。",
7173
7210
  "compat.inject.domains": "注入内容",
7174
- "compat.inject.domain.scene": "场景", "compat.inject.domain.memoryGlobal": "记忆", "compat.inject.domain.mcp": "MCP",
7175
- "compat.inject.domain.memoryWorkspace": "工作区笔记",
7176
- "compat.inject.domain.memory.title": "同时管控用户记忆与自主记忆的注入;自主记忆的学习 / 注入开关在记忆页签",
7211
+ "compat.inject.domain.scene": "场景", "compat.inject.domain.memory": "记忆", "compat.inject.domain.mcp": "MCP",
7212
+ "compat.inject.domain.memoryGlobal": "全局记忆", "compat.inject.domain.memoryWorkspace": "工作区记忆",
7213
+ "compat.inject.domain.memory.title": "全局记忆(含常开共享组)、当前工作区的手写记忆与两层自主笔记一起注入;关掉后这些都不再注入。场景记忆由「场景」开关控制",
7177
7214
  "compat.inject.domain.subagents": "子智能体", "compat.inject.domain.prompt": "提示词",
7178
7215
  "compat.inject.domain.skills": "技能",
7179
7216
  "compat.inject.domain.carrier.title": "关掉后,系统自带的那份也会一并停掉",
@@ -7213,8 +7250,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7213
7250
  "compat.tools.repair.failed": "修复失败:与本机服务没接上",
7214
7251
  "compat.note.toolTableFile.corrupt": "工具表侧车(tool-table.json)损坏:暂时沿用上次成功值(没有则出厂默认),保存已禁用;请修复或删除该文件后重试。",
7215
7252
  "compat.note.toolTableFile.unreadable": "工具表侧车(tool-table.json)不可读:暂时沿用上次成功值(没有则出厂默认),保存已禁用;请检查文件权限或删除该文件后重试。",
7216
- "compat.tools.summaryAll": "{total} 个工具全部下发 · ≈{tok} tok/轮",
7217
- "compat.tools.summary": "下发 {on}/{total} 个 · ≈{tok} tok/轮(关掉的省下 ≈{saved})",
7253
+ "compat.tools.summaryAll": "{total} 个工具手动下发 · ≈{tok} tok/轮",
7254
+ "compat.tools.summary": "手动下发 {on}/{total} 个 · ≈{tok} tok/轮(关掉的省下 ≈{saved})",
7255
+ "compat.tools.derived": "{name}(≈{tok})随自主记忆开启",
7256
+ "compat.tools.sent": "实际下发 {count} 个",
7218
7257
  "compat.tools.groupCount": "{on}/{total} 个 · ≈{tok}",
7219
7258
  "compat.tools.other": "其它",
7220
7259
  "compat.tools.group.control": "工具开关",
@@ -7265,10 +7304,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7265
7304
  "compat.tools.about.scene_manager_switch": "进入/退出场景",
7266
7305
  "compat.tools.about.scene_manager_save": "新建/修改场景",
7267
7306
  "compat.tools.about.scene_manager_archive": "改场景档案",
7268
- "compat.tools.about.memory_get": "查/读/搜记忆与笔记",
7269
- "compat.tools.about.memory_switch": "启用/停用记忆",
7270
- "compat.tools.about.memory_remember": "记住用户要求保留的内容",
7271
- "compat.tools.about.memory_note": "学习/忘记笔记",
7307
+ "compat.tools.about.memory_manager_get": "查/读/搜记忆与笔记",
7308
+ "compat.tools.about.memory_manager_switch": "启用/停用记忆",
7309
+ "compat.tools.about.memory_manager_remember": "记住用户要求保留的内容",
7310
+ "compat.tools.about.memory_manager_note": "学习/忘记笔记",
7272
7311
  "compat.tools.about.mcp_manager_list": "列出服务器",
7273
7312
  "compat.tools.about.mcp_manager_switch": "启用/停用服务器",
7274
7313
  "compat.tools.about.mcp_manager_save": "新建/修改服务器",
@@ -7282,14 +7321,14 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7282
7321
  "compat.tools.about.subagent_manager_save": "新建/修改人设",
7283
7322
  "compat.tools.about.prompt_manager_list": "列出全局提示词",
7284
7323
  "compat.tools.about.prompt_manager_apply": "应用全局提示词",
7285
- "compat.tools.about.tool_manager_tools": "本对话的工具开关",
7324
+ "compat.tools.about.tool_manager_switch": "本对话的工具开关",
7286
7325
  // 五个域的删除合进一条之后,行内只能给一个中性对象词("条目");
7287
7326
  // 具体是哪一类写在悬停那一档的 domain 里。
7288
- "compat.tools.about.plugin_manager_remove": "删除/恢复条目",
7289
- "compat.tools.hover.memory_get": "用户记忆与 Agent 笔记的读取入口。不给参数 = 清单(用户记忆带场景、启停与一句话描述,笔记带层、状态与是否注入);给 id = 正文(用户记忆 id 形如 <场景>/<名字>,笔记 id 带 note: 前缀;不带前缀时先找用户记忆,再找笔记);给 query = 两边一起按词过滤。默认只列会注入的条目,all=true 连停用、场景未启用、归档的一起列。只看不改。",
7290
- "compat.tools.hover.memory_switch": "只拨索引里的开关,.md 文件一个字不动,随时能拨回来。停用的记忆不再进上下文,等于把注入预算让给别人 —— 想省 token 优先用它,而不是删。",
7291
- "compat.tools.hover.memory_remember": "用户明确要求记住时用。scope=scene 写进某个场景(只有该场景开着才注入);scope=global 每个项目都注入;scope=workspace 写成本项目的 Agent 笔记(需要自主记忆开着)。没说范围就先问用户,别猜。给 id 则更新已有记忆或笔记,而不是新建。记忆会进之后每一轮请求,只记从代码、配置、git 推不出来的事;同名的第二条会替换第一条的正文。",
7292
- "compat.tools.hover.memory_note": "Agent 自己推断的一句话笔记:learn 记一条(title + text),forget 按 id / slot / title / 注入行首句忘掉。查看笔记用 memory_get。用户明确要求记住的内容走 memory_remember,不要用这条。笔记 id 带 note: 前缀,用户记忆 id 是 <场景>/<名字>。",
7327
+ "compat.tools.about.plugin_manager_trash": "删除/恢复条目",
7328
+ "compat.tools.hover.memory_manager_get": "用户记忆与 Agent 笔记的读取入口。不给参数 = 清单(用户记忆带场景、启停与一句话描述,笔记带层、状态与是否注入);给 id = 正文(用户记忆 id 形如 <场景>/<名字>,笔记 id 带 note: 前缀;不带前缀时先找用户记忆,再找笔记);给 query = 两边一起按词过滤。默认只列会注入的条目,all=true 连停用、场景未启用、归档的一起列。只看不改。",
7329
+ "compat.tools.hover.memory_manager_switch": "只拨索引里的开关,.md 文件一个字不动,随时能拨回来。停用的记忆不再进上下文,等于把注入预算让给别人 —— 想省 token 优先用它,而不是删。",
7330
+ "compat.tools.hover.memory_manager_remember": "用户明确要求记住时用。scope=scene 写进某个场景(只有该场景开着才注入);scope=global 每个项目都注入;scope=workspace 写成本项目的用户记忆(用户资产,不需要自主记忆开着)。没说范围就先问用户,别猜。给 id 则更新已有记忆或笔记,而不是新建。记忆会进之后每一轮请求,只记从代码、配置、git 推不出来的事;同名的第二条会替换第一条的正文。",
7331
+ "compat.tools.hover.memory_manager_note": "Agent 自己推断的一句话笔记:learn 记一条(title + text),forget 按 id / slot / title / 注入行首句忘掉。查看笔记用 memory_manager_get。用户明确要求记住的内容走 memory_manager_remember,不要用这条。笔记 id 带 note: 前缀,用户记忆 id 是 <场景>/<名字>。",
7293
7332
  "compat.tools.hover.scene_manager_list": "列出每个场景:场景名(界面显示名不同时会一并标出 —— 工具要的是前者)、启用 / 已进入 / 已锁定、场景说明、绑定的预设、记忆条数,以及档案:进入它时会开哪些 MCP / 技能 / 人设(没勾的一律关掉)。要改某个场景的档案之前先看它 —— 保存是整段替换,看不到现有勾选就会把原来勾的挤掉;要进入哪个场景也在这一份里挑。只看不改。",
7294
7333
  "compat.tools.hover.scene_manager_switch": "进入一个场景:按它的档案把 MCP / 技能 / 人设整套拨到位(没勾的一律关掉),注入范围收窄成它的记忆,并把场景绑定的预设正文写进全局 AGENTS.md。退出则按进场景前的快照精确还原,基线也恢复。切之前先用 scene_manager_list 看一眼那个场景的档案。改的是整个运行时环境,所以默认要用户确认。",
7295
7334
  "compat.tools.hover.scene_manager_save": "建一个场景,或改掉已有的那个 —— 回执会说清走了哪条。场景是「进入时按它切换」的一套:档案里勾了什么,进入后就开什么,其余全部关掉。只写记录不碰档案 —— 档案由另一条工具写;「照现在的样子存」(capture)则由当前生效状态把档案一次填好。写档案或写记录都不会让场景生效 —— 要生效得进入它(scene_manager_switch,或你在「场景」页点)。没传的字段保持原样。",
@@ -7307,10 +7346,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7307
7346
  "compat.tools.hover.subagent_manager_save": "新建人设,或改掉已存在的那份 —— 回执会说清走了哪条。可改名字、描述、正文(正文会作为子代理的系统提示词)与输出要求,没传的字段保持原样;改名会连带改场景与档案里的绑定。provider / 模型 / 工具限制只留给面板(模型看不到自己改对了没有,所以不给)。描述决定模型什么时候会选它。",
7308
7347
  "compat.tools.hover.prompt_manager_list": "列出全局提示词预设(写进 AGENTS.md 的那一类)与摘要,标明当前生效的是哪一份 —— 同时只有一份生效。要换用哪份之前先用它确认名字。快捷提示词不在这个域里:那是用户自己在输入框里点出来的一段话,不进上下文,模型这边没有可做的动作。",
7309
7348
  "compat.tools.hover.prompt_manager_apply": "把某份预设应用到用户级 AGENTS.md,之后的对话立刻按它走。一次只有一份在生效,换一份就是替换上一份。",
7310
- "compat.tools.hover.tool_manager_tools": "模型自己开关**本对话**能用的插件工具。action=list 列出这个对话当前关着的那些(每条一句话用途 + 每轮 ≈token);action=enable / disable 把它们打开或关掉,只影响这个对话,从下一次请求起生效。要在对话里说「进入某个场景」而场景工具恰好是关着的时候,就靠它。action=repair 修坏掉的侧车(记忆索引 / 作用域侧车 / MCP 停用表 / 模型工具表)—— 那一步会把损坏的文件改名留存、按空表(工具表按出厂名单)继续,所以会先问一次。",
7311
- // 删除族:五个域合进一条 `plugin_manager_remove`,悬停要一次说清 domain 的取值、
7349
+ "compat.tools.hover.tool_manager_switch": "模型自己开关**本对话**能用的插件工具。action=list 列出这个对话当前关着的那些(每条一句话用途 + 每轮 ≈token);action=enable / disable 把它们打开或关掉,只影响这个对话,从下一次请求起生效。要在对话里说「进入某个场景」而场景工具恰好是关着的时候,就靠它。action=repair 修坏掉的侧车(记忆索引 / 作用域侧车 / MCP 停用表 / 模型工具表)—— 那一步会把损坏的文件改名留存、按空表(工具表按出厂名单)继续,所以会先问一次。",
7350
+ // 删除族:五个域合进一条 `plugin_manager_trash`,悬停要一次说清 domain 的取值、
7312
7351
  // 各域 id 的形状,以及"只是不想注入就用 switch 停用"这条更省事的替代路径。
7313
- "compat.tools.hover.plugin_manager_remove": "把一条移进回收站、从回收站恢复,或列出回收站。domain 决定动的是哪一类:memory(id 是 <场景>/<名字>)、skill、persona、preset(用它的 id)、scene。删除可恢复 —— 只想让它别再注入或别再进目录,用对应的 switch 停用即可,不必删;删技能时可传 root 指定来源。永久删除在各自那一页的回收站里做。",
7352
+ "compat.tools.hover.plugin_manager_trash": "把一条移进回收站、从回收站恢复,或列出回收站。domain 决定动的是哪一类:memory(id 是 <场景>/<名字>)、skill、persona、preset(用它的 id)、scene。删除可恢复 —— 只想让它别再注入或别再进目录,用对应的 switch 停用即可,不必删;删技能时可传 root 指定来源。永久删除在各自那一页的回收站里做。",
7314
7353
  "compat.live.title": "注入实况", "compat.live.hint": "模型实际看到的内容(只读)",
7315
7354
  "compat.live.never": "这段对话还没投过", "compat.live.delivered": "本段对话已投递 {count} 条 · 最近 {time}",
7316
7355
  "compat.live.copy": "复制全文", "compat.live.copied": "已复制", "compat.live.noAgent": "还没有会话:发一条消息后再来看",
@@ -7384,8 +7423,12 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7384
7423
  "memory.diagnose.title": "记忆体检", "memory.diagnose.summary": "{rules} 条记忆 · {scenes} 个场景 · {issues} 个问题", "memory.diagnose.clean": "未发现问题,一切正常。",
7385
7424
  "memory.diag.error": "错误", "memory.diag.warning": "警告", "memory.diag.info": "提示",
7386
7425
  "memory.stat.total": "记忆", "memory.stat.sceneCount": "场景", "memory.stat.conflicts": "冲突", "memory.status.sceneOff": "场景未启用", "memory.status.off": "未启用",
7387
- "memory.budget.label": "注入预算", "memory.budget.bytes": "{used}/{max} B",
7426
+ "memory.budget.label": "记忆域预算", "memory.budget.bytes": "{used}/{max} B",
7388
7427
  "memory.budget.over": "已超限",
7428
+ // 服务端没给 / 只给了降级值时显示这两个,不拿 0 冒充满额。
7429
+ "memory.budget.unknown": "未知",
7430
+ "memory.budget.degraded": "降级",
7431
+ "memory.budget.degradedTip": "预算统计降级:{reason}",
7389
7432
  "memory.budget.truncated": "超出预算,段尾已列出未注入的记忆",
7390
7433
  "memory.budget.dropped": "本次未注入:{names}",
7391
7434
  "memory.scene.enable": "启用", "memory.scene.enableAll": "全部启用", "memory.scene.off": "未启用", "memory.scene.shared": "常开", "memory.scene.global.tag": "常驻",
@@ -7881,7 +7924,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7881
7924
  "evo.source.session": "In effect from: this conversation",
7882
7925
  "evo.stat": "{learned} learned · {active} active · {pending} pending",
7883
7926
  "evo.stat.reviewDue": " · {due} to review",
7884
- "evo.stat.archived": " · {archived} archived",
7885
7927
  "evo.stat.broken": " · index unreadable, some notes may be missing",
7886
7928
  "evo.empty": "None yet",
7887
7929
  "evo.layer.global": "Global",
@@ -7892,8 +7934,6 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7892
7934
  "evo.tag.candidate": "Pending",
7893
7935
  "evo.tag.active": "Active",
7894
7936
  "evo.tag.core": "Pinned",
7895
- "evo.tag.superseded": "Superseded",
7896
- "evo.tag.archived": "Archived",
7897
7937
  "evo.approve": "Approve",
7898
7938
  "evo.approved": "Approved: it will be injected from now on",
7899
7939
  "evo.review.open": "Review",
@@ -7920,9 +7960,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
7920
7960
  "evo.kind.procedure": "procedure",
7921
7961
  "evo.review.kind.ttl30": "review reminder after 30 days",
7922
7962
  "evo.review.kind.ttlForever": "no expiry",
7963
+ "evo.review.tip": "{kind} memory: {ttl}",
7964
+ "evo.review.tipNoKind": "Types with an expiry come back for review so you can confirm them",
7923
7965
  "evo.review.approving": "Approving…",
7924
7966
  "evo.review.reject": "Reject",
7925
- "evo.rejected": "Rejected: it will not be injected; you can restore it from the list",
7967
+ "evo.rejected": "Moved to the recycle bin — you can restore it there",
7926
7968
  "evo.review.deleted": "Deleted",
7927
7969
  "evo.review.needed": "Needs review",
7928
7970
  "evo.review.done": "Reviewed",
@@ -8252,9 +8294,9 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
8252
8294
  "compat.inject.caps.entries": "Inject up to", "compat.inject.caps.entriesUnit": "items",
8253
8295
  "compat.inject.caps.descLen": "Description up to", "compat.inject.caps.descLenUnit": "chars",
8254
8296
  "compat.inject.domains": "What to inject",
8255
- "compat.inject.domain.scene": "Scene", "compat.inject.domain.memoryGlobal": "Memory", "compat.inject.domain.mcp": "MCP",
8256
- "compat.inject.domain.memoryWorkspace": "Workspace notes",
8257
- "compat.inject.domain.memory.title": "Controls injection for hand-written and autonomous memories together; the autonomous-memory switches live on the Memory tab",
8297
+ "compat.inject.domain.scene": "Scene", "compat.inject.domain.memory": "Memory", "compat.inject.domain.mcp": "MCP",
8298
+ "compat.inject.domain.memoryGlobal": "Global memory", "compat.inject.domain.memoryWorkspace": "Workspace memory",
8299
+ "compat.inject.domain.memory.title": "Global memories (including the shared always-on group), this workspace's hand-written memories and both autonomous-note layers, sent together; turning this off stops all of them. Scene memories follow the Scene switch",
8258
8300
  "compat.inject.domain.subagents": "Subagents", "compat.inject.domain.prompt": "Prompt",
8259
8301
  "compat.inject.domain.skills": "Skills",
8260
8302
  "compat.inject.domain.carrier.title": "Turning this off also stops the copy the system sends by itself",
@@ -8290,8 +8332,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
8290
8332
  "compat.tools.repair.failed": "Repair failed: the local service could not be reached",
8291
8333
  "compat.note.toolTableFile.corrupt": "The tool-table sidecar (tool-table.json) is corrupt: the last good value is in effect (factory default if none), and saving is blocked. Repair or delete the file and retry.",
8292
8334
  "compat.note.toolTableFile.unreadable": "The tool-table sidecar (tool-table.json) is unreadable: the last good value is in effect (factory default if none), and saving is blocked. Check file permissions or delete the file and retry.",
8293
- "compat.tools.summaryAll": "all {total} tools sent · ≈{tok} tok per turn",
8294
- "compat.tools.summary": "{on}/{total} sent · ≈{tok} tok per turn ({saved} tok saved)",
8335
+ "compat.tools.summaryAll": "all {total} tools sent manually · ≈{tok} tok per turn",
8336
+ "compat.tools.summary": "{on}/{total} sent manually · ≈{tok} tok per turn ({saved} tok saved)",
8337
+ "compat.tools.derived": "{name} (≈{tok}) follows autonomous memory (on)",
8338
+ "compat.tools.sent": "{count} tools actually sent",
8295
8339
  "compat.tools.groupCount": "{on}/{total} · ≈{tok}",
8296
8340
  "compat.tools.other": "Other",
8297
8341
  "compat.tools.group.control": "Tool switches",
@@ -8339,10 +8383,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
8339
8383
  "compat.tools.about.scene_manager_switch": "Enter/leave a scene",
8340
8384
  "compat.tools.about.scene_manager_save": "Create/update a scene",
8341
8385
  "compat.tools.about.scene_manager_archive": "Update a scene archive",
8342
- "compat.tools.about.memory_get": "Read/search memories and notes",
8343
- "compat.tools.about.memory_switch": "Enable/disable a memory",
8344
- "compat.tools.about.memory_remember": "Remember something the user asked to keep",
8345
- "compat.tools.about.memory_note": "Learn/forget notes",
8386
+ "compat.tools.about.memory_manager_get": "Read/search memories and notes",
8387
+ "compat.tools.about.memory_manager_switch": "Enable/disable a memory",
8388
+ "compat.tools.about.memory_manager_remember": "Remember something the user asked to keep",
8389
+ "compat.tools.about.memory_manager_note": "Learn/forget notes",
8346
8390
  "compat.tools.about.mcp_manager_list": "List servers",
8347
8391
  "compat.tools.about.mcp_manager_switch": "Enable/disable a server",
8348
8392
  "compat.tools.about.mcp_manager_save": "Create/update a server",
@@ -8356,14 +8400,14 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
8356
8400
  "compat.tools.about.subagent_manager_save": "Create/update a persona",
8357
8401
  "compat.tools.about.prompt_manager_list": "List global prompts",
8358
8402
  "compat.tools.about.prompt_manager_apply": "Apply a global prompt",
8359
- "compat.tools.about.tool_manager_tools": "This conversation's tool switches",
8403
+ "compat.tools.about.tool_manager_switch": "This conversation's tool switches",
8360
8404
  // One merged delete tool for all five domains: the inline line needs a neutral
8361
8405
  // object noun, the domain values live in the hover tier.
8362
- "compat.tools.about.plugin_manager_remove": "Delete/restore an item",
8363
- "compat.tools.hover.memory_get": "The read side for user memories and agent notes. No arguments → catalogs (memories with scene, on/off state and one-line description; notes with layer, status and whether they inject). An id → the full body (user memory ids look like <scene>/<name>; note ids carry the note: prefix, and an unprefixed id is looked up as a memory first, then a note). A query → both catalogs filtered by words. Only injecting entries by default; all=true adds disabled, inactive-scene and archived ones. Read-only.",
8364
- "compat.tools.hover.memory_switch": "Flips the index switch only — the .md file is untouched and it is reversible. A disabled memory stops being injected, which frees byte budget for the others; prefer this over deleting when you want to spend fewer tokens.",
8365
- "compat.tools.hover.memory_remember": "Use when the user explicitly asks you to keep something. scope=scene writes into a scene (injected only when that scene is on); scope=global injects in every project; scope=workspace stores a workspace note (needs autonomous memory). If the user did not say where, ask — do not guess. Pass id to update an existing memory or note instead of creating one. Memories enter every later request, so record only what cannot be re-derived from code, config or git; a second entry with the same name replaces the first body.",
8366
- "compat.tools.hover.memory_note": "Agent-inferred one-line notes: learn records one (title + text), forget removes one by id, slot, title or the first line as injected. Inspect notes with memory_get. When the user explicitly asks you to keep something, use memory_remember instead. Note ids carry the note: prefix; user memory ids are <scene>/<name>.",
8406
+ "compat.tools.about.plugin_manager_trash": "Delete/restore an item",
8407
+ "compat.tools.hover.memory_manager_get": "The read side for user memories and agent notes. No arguments → catalogs (memories with scene, on/off state and one-line description; notes with layer, status and whether they inject). An id → the full body (user memory ids look like <scene>/<name>; note ids carry the note: prefix, and an unprefixed id is looked up as a memory first, then a note). A query → both catalogs filtered by words. Only injecting entries by default; all=true adds disabled, inactive-scene and archived ones. Read-only.",
8408
+ "compat.tools.hover.memory_manager_switch": "Flips the index switch only — the .md file is untouched and it is reversible. A disabled memory stops being injected, which frees byte budget for the others; prefer this over deleting when you want to spend fewer tokens.",
8409
+ "compat.tools.hover.memory_manager_remember": "Use when the user explicitly asks you to keep something. scope=scene writes into a scene (injected only when that scene is on); scope=global injects in every project; scope=workspace stores a user memory for this workspace (a user asset, no autonomous memory needed). If the user did not say where, ask — do not guess. Pass id to update an existing memory or note instead of creating one. Memories enter every later request, so record only what cannot be re-derived from code, config or git; a second entry with the same name replaces the first body.",
8410
+ "compat.tools.hover.memory_manager_note": "Agent-inferred one-line notes: learn records one (title + text), forget removes one by id, slot, title or the first line as injected. Inspect notes with memory_manager_get. When the user explicitly asks you to keep something, use memory_manager_remember instead. Note ids carry the note: prefix; user memory ids are <scene>/<name>.",
8367
8411
  "compat.tools.hover.scene_manager_list": "Lists every scene: its name (with the display label when it differs — tools need the name), enabled / entered / locked state, its description, bound preset, memory count, and its archive: which MCP servers, skills and personas entering it switches on, everything else going off. Look here before changing a scene's archive — saving replaces a whole section, so an unseen selection gets dropped — and use it to pick which scene to enter. Read-only.",
8368
8412
  "compat.tools.hover.scene_manager_switch": "Enters a scene: its archive is applied across MCP, skills and personas (anything it does not list goes off), injection narrows to its memories, and its bound preset is written into the global AGENTS.md. Leaving restores the runtime snapshot taken on entry, including the previous baseline. Check the scene's archive in scene_manager_list first. It rewrites the whole runtime environment, so it asks for confirmation by default.",
8369
8413
  "compat.tools.hover.scene_manager_save": "Saves a scene — a named bundle the user enters: whatever its archive lists gets switched on, everything else off. It writes the record only; the archive is written by a separate tool (capture fills the archive from what is currently switched on). Writing does not turn the scene on — enter it with scene_manager_switch (or the Scenes page) for that. Fields you omit keep their current value.",
@@ -8381,10 +8425,10 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
8381
8425
  "compat.tools.hover.subagent_manager_save": "Creates a persona, or updates the existing one — the receipt says which. You can set the name, description, body (the body becomes the subagent's system prompt) and output contract; omitted fields keep their current values, and a rename makes scene and archive bindings follow. Provider, model and tool limits stay in the panel (the model cannot tell whether it got them right, so it is not offered them). The description decides when the model picks it.",
8382
8426
  "compat.tools.hover.prompt_manager_list": "Lists the global prompt presets (the ones written into AGENTS.md) with their summaries and marks the one currently in effect — only one is active at a time. Use it to confirm the name before switching. Quick prompts are not this domain: the user picks those in the composer, they never enter the context, and there is nothing for the model to do with them.",
8383
8427
  "compat.tools.hover.prompt_manager_apply": "Applies a preset to the user-level AGENTS.md; later conversations follow it immediately. Only one preset is in effect, so applying another replaces it.",
8384
- "compat.tools.hover.tool_manager_tools": "The model switches which of this plugin's tools THIS conversation can use. action=list lists the ones that are off here (one line of purpose each, plus their per-turn token cost); action=enable / disable turns them on or off, affecting this conversation only and taking effect from the next request. This is what unblocks \"switch to that scene\" when the scene tools happen to be off. action=repair fixes a broken sidecar (memory index / scope sidecar / MCP disabled-tools table / model tool table) — that renames the damaged file aside and continues with an empty table (the factory list, for the tool table), so it asks first.",
8428
+ "compat.tools.hover.tool_manager_switch": "The model switches which of this plugin's tools THIS conversation can use. action=list lists the ones that are off here (one line of purpose each, plus their per-turn token cost); action=enable / disable turns them on or off, affecting this conversation only and taking effect from the next request. This is what unblocks \"switch to that scene\" when the scene tools happen to be off. action=repair fixes a broken sidecar (memory index / scope sidecar / MCP disabled-tools table / model tool table) — that renames the damaged file aside and continues with an empty table (the factory list, for the tool table), so it asks first.",
8385
8429
  // One merged delete tool for all five domains: the hover has to carry the domain
8386
8430
  // values, the per-domain id shapes, and the cheaper alternative (switch off).
8387
- "compat.tools.hover.plugin_manager_remove": "Moves one item to the trash, restores one from the trash, or lists the trash. domain says which kind: memory (id is <scene>/<name>), skill, persona, preset (use its id) or scene. Deleting is reversible — to just stop it being injected or leaving the catalog, disable it with the matching switch instead; pass root to pick the source when trashing a skill. Emptying the trash is a panel action on that domain's page.",
8431
+ "compat.tools.hover.plugin_manager_trash": "Moves one item to the trash, restores one from the trash, or lists the trash. domain says which kind: memory (id is <scene>/<name>), skill, persona, preset (use its id) or scene. Deleting is reversible — to just stop it being injected or leaving the catalog, disable it with the matching switch instead; pass root to pick the source when trashing a skill. Emptying the trash is a panel action on that domain's page.",
8388
8432
  "compat.live.title": "Live injection", "compat.live.hint": "What the model actually sees (read-only)",
8389
8433
  "compat.live.never": "nothing delivered in this conversation yet", "compat.live.delivered": "{count} delivered in this conversation · last {time}",
8390
8434
  "compat.live.copy": "Copy all", "compat.live.copied": "Copied", "compat.live.noAgent": "No session yet — send a message first",
@@ -8459,8 +8503,11 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
8459
8503
  "memory.diagnose.title": "Memory checkup", "memory.diagnose.summary": "{rules} memories · {scenes} scenes · {issues} issues", "memory.diagnose.clean": "No issues found.",
8460
8504
  "memory.diag.error": "Error", "memory.diag.warning": "Warning", "memory.diag.info": "Info",
8461
8505
  "memory.stat.total": "Memories", "memory.stat.sceneCount": "Scenes", "memory.stat.conflicts": "Conflicts", "memory.status.sceneOff": "scene off", "memory.status.off": "disabled",
8462
- "memory.budget.label": "Injection budget", "memory.budget.bytes": "{used}/{max} B",
8506
+ "memory.budget.label": "Memory-domain budget", "memory.budget.bytes": "{used}/{max} B",
8463
8507
  "memory.budget.over": "Over budget",
8508
+ "memory.budget.unknown": "Unknown",
8509
+ "memory.budget.degraded": "Degraded",
8510
+ "memory.budget.degradedTip": "Budget accounting is degraded: {reason}",
8464
8511
  "memory.budget.truncated": "Over budget — the memories left out are listed at the end",
8465
8512
  "memory.budget.dropped": "Not injected this time: {names}",
8466
8513
  "memory.scene.enable": "Enabled", "memory.scene.enableAll": "Enable all", "memory.scene.off": "Off", "memory.scene.shared": "always on", "memory.scene.global.tag": "always injected",
@@ -9170,22 +9217,22 @@ button.dsm-rowselect-box:disabled{cursor:default;opacity:.45}
9170
9217
 
9171
9218
  // 顶部栏右端:GitHub 链接(issues 在仓库)+ 版本号(全界面唯一显示处)。
9172
9219
 
9173
- // ── 设置侧栏「工具管理」那一行的图标(2026-10-18 起,2026-11-04 改走官方插槽)──
9220
+ // ── 设置侧栏「工具管理」那一行的图标 ──
9174
9221
  //
9175
- // 0.2.2-rc.1 起宿主提供了 `settings.section.icon` 这个 slot:
9222
+ // 宿主提供了 `settings.section.icon` 这个 slot:
9176
9223
  // dsh-client-ui-settings-general 的 SettingsPanel 渲染每一行时调用
9177
9224
  // renderSlot('settings.section.icon', { size, active }, { only: row.id, fallback: navIcon(row.id) })
9178
9225
  // 只要注册 id 与 `settings.section` 的 id 相同,就能拿到自己的字形;没注册的 id
9179
9226
  // 仍旧回落到宿主那张封闭名单(account / models / agent-presets / plugins /
9180
9227
  // archived-sessions),其余一律是默认齿轮。
9181
9228
  //
9182
- // 为什么改掉旧实现:0.2.1 及以前没有这个 slot,本插件用的是「CSS 藏掉宿主 svg、
9229
+ // 为什么改掉旧实现:旧宿主没有这个 slot,本插件用的是「CSS 藏掉宿主 svg、
9183
9230
  // 在 ::before 上画自己的图」的 DOM 接管法(dshmarket / dsh-better-sidebar 的先例)。
9184
- // 0.2.2 把图标从 `button > svg` 改成了 `button > span.navIcon > svg`,那条
9231
+ // 后来宿主把图标从 `button > svg` 改成了 `button > span.navIcon > svg`,那条
9185
9232
  // `> svg` 选择器随之失配 —— 宿主的齿轮没被藏住,于是同一行并排出现「叠方块 + 齿轮」
9186
- // 两个图标(2026-11-04 用户截图:工具管理 / 插件市场 / 侧边卡片都是这个症状,
9187
- // 后两家用的也是同一套接管法)。既然官方把插槽开出来了,MutationObserver 那套
9188
- // 搬砖就该整段删掉,而不是再补一条更宽的选择器去猜宿主的 DOM。
9233
+ // 两个图标(用户截图里工具管理 / 插件市场 / 侧边卡片都是这个症状,后两家用的也是
9234
+ // 同一套接管法)。既然官方把插槽开出来了,MutationObserver 那套搬砖就该整段删掉,
9235
+ // 而不是再补一条更宽的选择器去猜宿主的 DOM。
9189
9236
  //
9190
9237
  // 图形与 docs/images/icon.svg 同源(三层叠放方块,1024 视图框),但这里内联 path:
9191
9238
  // 客户端 bundle 是单文件,没有加载外部资源的通道。`fill: currentColor` 让它在
@@ -16458,11 +16505,10 @@ function enabledMemoryCount(rules) {
16458
16505
  var deleted = m.deletedAt ? new Date(m.deletedAt).toLocaleString() : ''
16459
16506
  if (deleted) rows.push([t('trash.preview.field.deletedAt'), deleted])
16460
16507
  if (domain === 'memories') {
16461
- // 自动记忆的停用副本:没有场景、不是 bundle,多报一层与「已归档」状态。
16508
+ // 自动记忆的副本:没有场景、不是 bundle,只多报一条属于自己的层。
16462
16509
  if (m.auto === true) {
16463
16510
  rows.push([t('trash.preview.field.auto'), t('trash.preview.yes')])
16464
16511
  rows.push([t('trash.preview.field.layer'), t('evo.layer.' + (m.autoLayer === 'global' ? 'global' : 'workspace'))])
16465
- rows.push([t('trash.preview.field.status'), t('evo.tag.archived')])
16466
16512
  return rows
16467
16513
  }
16468
16514
  if (m.group !== undefined) rows.push([t('trash.preview.field.scene'), sceneLabel([], String(m.group || ''))])
@@ -17235,7 +17281,8 @@ function enabledMemoryCount(rules) {
17235
17281
  var q = String(modal.memQuery || '').trim().toLowerCase()
17236
17282
  var items = checkedFirst('memories', q ? own.filter(function (m) {
17237
17283
  return String(m.name).toLowerCase().indexOf(q) >= 0
17238
- || String(m.description || '').toLowerCase().indexOf(q) >= 0
17284
+ // 与记忆页同一口径:搜索命中正文首行(`excerpt`),旧数据退回 description。
17285
+ || String(m.excerpt || m.description || '').toLowerCase().indexOf(q) >= 0
17239
17286
  }) : own, function (m) { return String(m.id) }, function (m) { return memoryEnabled(String(m.id)) })
17240
17287
  var enabledCount = own.filter(function (m) { return memoryEnabled(String(m.id)) }).length
17241
17288
  // 草稿**另算一栏**(`· N 条待创建`),不并进 `x/y 已勾选`:那一栏是「全选 / 全不选」
@@ -17277,14 +17324,17 @@ function enabledMemoryCount(rules) {
17277
17324
  onChange: function () { togglePendingMemory(i) },
17278
17325
  })
17279
17326
  }).concat(items.map(function (m) {
17327
+ // 记忆正文首行由服务端以 `excerpt` 给出(`description` 是另一份独立维护的说明);
17328
+ // 旧数据没有 `excerpt` 时才退回 description。
17329
+ var desc = m.excerpt || m.description || ''
17280
17330
  return RowSelect({
17281
17331
  disabled: busy,
17282
17332
  key: m.id,
17283
17333
  checked: memoryEnabled(String(m.id)),
17284
17334
  name: m.name,
17285
17335
  // 记忆描述是自由正文的首行,可能很长:截断到 MEM_DESC_MAX,全文放 title。
17286
- desc: m.description ? clipText(m.description, MEM_DESC_MAX) : null,
17287
- descTitle: m.description || null,
17336
+ desc: desc ? clipText(desc, MEM_DESC_MAX) : null,
17337
+ descTitle: desc || null,
17288
17338
  // 单行:描述排在名字右边(用户 2026-11-06)。
17289
17339
  compact: true,
17290
17340
  // 带附件的 bundle 记忆标一枚回形针 + 个数(见 attachMark)。
@@ -19996,7 +20046,9 @@ function enabledMemoryCount(rules) {
19996
20046
  if (sceneFilter !== '' && sceneOfGroup(r.group) !== sceneFilter) return false
19997
20047
  if (!q) return true
19998
20048
  return (r.name || '').toLowerCase().indexOf(q) >= 0
19999
- || (r.description || '').toLowerCase().indexOf(q) >= 0
20049
+ // 搜索改用 `excerpt`(正文首行):用户找一条记忆时记得的是正文里的说法,
20050
+ // 不是那条独立维护的 `description`。旧数据没有 `excerpt` 时退回 description。
20051
+ || (r.excerpt || r.description || '').toLowerCase().indexOf(q) >= 0
20000
20052
  || (r.group || '').toLowerCase().indexOf(q) >= 0
20001
20053
  }
20002
20054
  // 场景 → 记忆:场景元数据来自宿主 scenes(含**空场景**与保留场景 global),
@@ -20253,9 +20305,14 @@ function enabledMemoryCount(rules) {
20253
20305
  var scopeState = useScopeLayer()
20254
20306
  /** 取数用的会话 id:全局层传空串(= 服务端按全局口径算)。 */
20255
20307
  function scopeSessionId() { return scopeIsSession() ? scopeState.sessionId : '' }
20308
+ // 切层 / 进场景会连着发几次 rules-list;只认最后一次请求的结果 —— 否则先发后到的
20309
+ // 旧响应会把界面盖回上一层的数据,用户看到的是"切了层,列表还是旧的"。
20310
+ var refreshSeqRef = React.useRef(0)
20256
20311
  function refresh(silent) {
20312
+ var seq = ++refreshSeqRef.current
20257
20313
  if (!silent) setData(function (prev) { return Object.assign({}, prev, { loading: true, error: null }) })
20258
20314
  apiCall('rules-list', { sessionId: scopeSessionId() }).then(function (r) {
20315
+ if (seq !== refreshSeqRef.current) return
20259
20316
  if (r && r.ok) {
20260
20317
  // 合并式更新:只覆盖本页由 rules-list 驱动的字段,其余 state 键保持不变。
20261
20318
  // `anyLocked` / `activeScene` 必须一起合并 —— 它们此前**从没被写进 state**
@@ -20280,6 +20337,7 @@ function enabledMemoryCount(rules) {
20280
20337
  setData(function (prev) { return Object.assign({}, prev, { loading: false, error: translateError(t, r), rules: [], scenes: [], activeMode: 'all', sceneMemory: EMPTY_MEMORY, stats: EMPTY_STATS, warnings: [] }) })
20281
20338
  }
20282
20339
  }).catch(function (e) {
20340
+ if (seq !== refreshSeqRef.current) return
20283
20341
  setData(function (prev) { return Object.assign({}, prev, { loading: false, error: errMsg(e), rules: [], scenes: [], activeMode: 'all', sceneMemory: EMPTY_MEMORY, stats: EMPTY_STATS, warnings: [] }) })
20284
20342
  })
20285
20343
  }
@@ -20661,13 +20719,9 @@ function enabledMemoryCount(rules) {
20661
20719
 
20662
20720
  // ── 渲染 ──
20663
20721
  var stats = data.stats || EMPTY_STATS
20664
- // 注入预算:宿主 rules-list 一直在返回 sceneMemory,但此前从未渲染 ——
20665
- // 于是"超出预算、部分记忆没进提示词"对用户完全不可见。
20666
- // 展示位 2026-10-12 搬到页头统计格(原来在工具条右侧,带一条 72px 进度条);
20667
- // 进度条随之下线,超限改由整格转错误色 + 标签补「已超限」表达。
20722
+ // 场景段的截断 / 丢弃清单仍来自 rules-list 的 `sceneMemory`;注入预算的已用
20723
+ // 改由服务端 `auto.injectBytes` 给(见下方预算那段),这里不再自己算上限与已用。
20668
20724
  var memInfo = data.sceneMemory || EMPTY_MEMORY
20669
- var memMax = Number(memInfo.maxBytes) || 0
20670
- var memUsed = Number(memInfo.usedBytes) || 0
20671
20725
  var droppedNames = React.useMemo(function () {
20672
20726
  return (memInfo.dropped || []).map(function (d) { return (d.scene ? d.scene + '/' : '') + d.name })
20673
20727
  }, [memInfo])
@@ -20817,8 +20871,11 @@ function enabledMemoryCount(rules) {
20817
20871
  // (`📎 N 个附件`)已经说清了。`memory.form.*` 两个键**仍然在用**(回收站/导出
20818
20872
  // 里按 `'memory.form.' + …` 计算取词),别顺手删掉。
20819
20873
  var attachNode = attachTag(r, shadowed)
20874
+ // 列表摘要用正文首行(`excerpt`);旧数据没有这个字段时退回 `description`,
20875
+ // 否则升级后老记忆的行会突然只剩名称。
20876
+ var excerptText = r.excerpt || r.description || ''
20820
20877
  var metaBits = [
20821
- r.excerpt ? React.createElement('span', { key: 'excerpt', className: 'dsm-listrow-meta-desc', title: r.excerpt }, r.excerpt) : null,
20878
+ excerptText ? React.createElement('span', { key: 'excerpt', className: 'dsm-listrow-meta-desc', title: excerptText }, excerptText) : null,
20822
20879
  groupLabelOf(r) ? React.createElement('span', { key: 'group', className: 'dsm-listrow-meta-info' }, groupLabelOf(r)) : null,
20823
20880
  ]
20824
20881
  // 名称旁那颗体积:纯量值、不可点,所以是 span;等宽数字免得整列右缘跟着抖。
@@ -21352,9 +21409,9 @@ function enabledMemoryCount(rules) {
21352
21409
  }
21353
21410
 
21354
21411
  /**
21355
- * 否决当前这条 → 归档(不再注入、列表里收起、随时可恢复),然后进入下一条。
21412
+ * 否决当前这条 → 正文移进统一回收站,然后进入下一条。
21356
21413
  *
21357
- * 不用 `evolution-forget`:那条会删文件并写墓碑,30 天内同义内容学不回来 ——
21414
+ * 不用 `evolution-forget`:那条会写墓碑,30 天内同义内容学不回来 ——
21358
21415
  * 「这条我不要」和「这个说法以后都别记」是两件事,否决只该表达前一件。
21359
21416
  */
21360
21417
  function rejectEvolutionInReview() {
@@ -21362,7 +21419,7 @@ function enabledMemoryCount(rules) {
21362
21419
  if (!cur || cur.busy || cur.loading) return
21363
21420
  var id = cur.id
21364
21421
  setEvoReview(Object.assign({}, cur, { busy: true, error: null }))
21365
- apiCall('evolution-set-status', { id: id, status: 'archived' }).then(function (res) {
21422
+ apiCall('evolution-discard', { id: id }).then(function (res) {
21366
21423
  if (!res || res.ok === false) {
21367
21424
  setEvoReview(function (c) {
21368
21425
  return c && c.id === id ? Object.assign({}, c, { busy: false, error: translateError(t, res) }) : c
@@ -21547,9 +21604,7 @@ function enabledMemoryCount(rules) {
21547
21604
  // core / playbook 是旧数据里仍可注入的两档,按「生效」显示,不标成待确认。
21548
21605
  var statusKey = e.status === 'core' ? 'evo.tag.core'
21549
21606
  : e.status === 'active' || e.status === 'playbook' ? 'evo.tag.active'
21550
- : e.status === 'superseded' ? 'evo.tag.superseded'
21551
- : e.status === 'archived' ? 'evo.tag.archived'
21552
- : 'evo.tag.candidate'
21607
+ : 'evo.tag.candidate'
21553
21608
  var enabled = e.enabled !== false
21554
21609
  var tone = !enabled ? 'idle' : e.status === 'core' || e.status === 'active' || e.status === 'playbook' ? 'ok' : e.status === 'candidate' ? 'warn' : 'idle'
21555
21610
  var pending = e.status === 'candidate'
@@ -21568,11 +21623,18 @@ function enabledMemoryCount(rules) {
21568
21623
  // 复核,偏好 / 纠正不过期),属于「这条是什么」而不是「这条说了什么」,
21569
21624
  // 跟正文摘要挤在一行会被长摘要挤掉。
21570
21625
  var kindTag = null
21626
+ var kindLabel = ''
21627
+ var kindTtl = ''
21571
21628
  if (e.kind) {
21572
21629
  var kindKey = 'evo.kind.' + String(e.kind)
21573
21630
  var kindText = t(kindKey)
21574
21631
  // 字典里没有这个值时 `t` 会原样回传键名:宁可不显示,也不要把 `evo.kind.xxx` 摆给用户看。
21575
21632
  if (kindText !== kindKey) {
21633
+ kindLabel = kindText
21634
+ // 保质期与复习弹窗同一判据:事实 / 做法 30 天后提醒复核,偏好 / 纠正不过期。
21635
+ kindTtl = (e.kind === 'fact' || e.kind === 'procedure')
21636
+ ? t('evo.review.kind.ttl30')
21637
+ : t('evo.review.kind.ttlForever')
21576
21638
  kindTag = React.createElement('span', { key: 'kind', className: 'dsm-kind-tag' }, kindText)
21577
21639
  }
21578
21640
  }
@@ -21580,7 +21642,16 @@ function enabledMemoryCount(rules) {
21580
21642
  // 用户看一眼确认仍然成立就点菜单里的「复核」,计时重新开始。
21581
21643
  // 与 `pendingReason`(待裁决,不注入)是两个字段:合成一个就会出现
21582
21644
  // "提醒一下 → 这条从上下文里消失",界面还显示生效。
21645
+ //
21646
+ // `reviewDue` 不是日期:维护扫描写进去的是标记串(如 `ttl`)。直接当 tooltip 会把
21647
+ // 内部标记摆给用户看,所以这里换成本地的一句话,类型已知时带上类型。
21583
21648
  if (e.reviewDue) metaBits.push(React.createElement('span', { key: 'review', className: 'dsm-listrow-meta-info' }, t('evo.review.needed')))
21649
+ var reviewTip = ''
21650
+ if (e.reviewDue) {
21651
+ reviewTip = kindLabel !== ''
21652
+ ? t('evo.review.tip', { kind: kindLabel, ttl: kindTtl })
21653
+ : t('evo.review.tipNoKind')
21654
+ }
21584
21655
  // 停用由行内开关承担(与记忆行同构);菜单里只留编辑、复核与删除。
21585
21656
  var menuItems = [
21586
21657
  { key: 'edit', label: t('btn.edit'), disabled: evoBusy, onClick: function () { openEvolutionEditor(e) } },
@@ -21594,7 +21665,7 @@ function enabledMemoryCount(rules) {
21594
21665
  nameAfter: React.createElement('span', { className: 'dsm-qty' }, t('memory.size.tokens', { count: Number(e.tokens) || 0 })),
21595
21666
  tag: kindTag,
21596
21667
  meta: metaBits.length ? metaBits : undefined,
21597
- metaTitle: e.pendingReason || e.reviewDue || undefined,
21668
+ metaTitle: e.pendingReason || reviewTip || undefined,
21598
21669
  // 候选行右侧是「查看」:先读正文再决定要不要它 —— 确认一条没看过的记忆是盲签,
21599
21670
  // 而它会进入之后每一次对话的上下文。生效行是开关,与记忆行同一语义:
21600
21671
  // 关 = 不再注入,条目保留。
@@ -21681,7 +21752,7 @@ function enabledMemoryCount(rules) {
21681
21752
  }
21682
21753
  // 学到的那几行默认收起(用户 2026-11-11):它是**历史**,不是待办。开着只会让
21683
21754
  // 「学习记录」这张卡越翻越长,而真正需要动手的是下面的失败项 —— 那一块不折叠。
21684
- var reviewOpen = collapsed['evo:review'] !== true
21755
+ var reviewOpen = collapsed['evo:review'] === true
21685
21756
  return React.createElement('div', { className: 'dsm-evo-review' },
21686
21757
  // 标题行在框外(与学习频率同版式):左边是可折叠的标题,右边是最近时间与重试。
21687
21758
  React.createElement('div', { className: 'dsm-evo-review-head' },
@@ -21689,9 +21760,10 @@ function enabledMemoryCount(rules) {
21689
21760
  type: 'button', className: 'dsm-evo-section-title dsm-evo-review-toggle',
21690
21761
  'aria-expanded': reviewOpen && learned.length > 0,
21691
21762
  disabled: learned.length === 0,
21692
- onClick: function () { toggleCollapse('evo:review', reviewOpen) },
21693
- }, t('evo.queue.title'),
21694
- learned.length > 0 ? React.createElement('span', { key: 'n', className: 'dsm-count dsm-count-tight' }, String(learned.length)) : null),
21763
+ onClick: function () { toggleCollapse('evo:review', !reviewOpen) },
21764
+ },
21765
+ learned.length > 0 ? React.createElement(CaretIcon, { key: 'caret', open: reviewOpen, className: 'dsm-evo-review-caret' }) : null,
21766
+ t('evo.queue.title')),
21695
21767
  lastAt ? React.createElement('span', { className: 'dsm-help' }, t('evo.review.last', { time: evoTimeText(lastAt) })) : null,
21696
21768
  (failed + dead + orphan > 0)
21697
21769
  ? React.createElement('button', {
@@ -21777,8 +21849,10 @@ function enabledMemoryCount(rules) {
21777
21849
  }
21778
21850
 
21779
21851
  /**
21780
- * 过滤一组自主记忆:搜索命中 + 去掉已归档 / 已取代,并算出生效数。
21781
- * 卡片与「全局」卡里的内嵌分节共用这一份口径。
21852
+ * 过滤一组自主记忆:搜索命中 + 丢掉已归档 / 已取代,并算出生效数。
21853
+ *
21854
+ * 已归档不再出现在自主记忆目录里:否决与删除都把正文移进了统一回收站,
21855
+ * 恢复入口只有回收站一个,这里不需要第二套。
21782
21856
  */
21783
21857
  function evolutionGroupView(groups) {
21784
21858
  return (groups || []).map(function (g) {
@@ -21790,7 +21864,6 @@ function enabledMemoryCount(rules) {
21790
21864
  return hay.toLowerCase().indexOf(q) >= 0
21791
21865
  })
21792
21866
  }
21793
- // 已取代是历史,已归档在回收站,都不占列表。
21794
21867
  var live = rows.filter(function (e) { return e.status !== 'archived' && e.status !== 'superseded' })
21795
21868
  return { key: g.key, label: g.label, live: live, on: evolutionOnCount(live) }
21796
21869
  })
@@ -21811,16 +21884,21 @@ function enabledMemoryCount(rules) {
21811
21884
  * `cardKey` 同时是折叠状态的键。
21812
21885
  *
21813
21886
  * 复用场景卡的骨架(.dsm-source),行沿用 renderEvolutionRow(ListRow):
21814
- * 名称 + 正文,候选行右侧有「确认」,生效行右侧是开关(关闭只停止注入,删除才进回收站)。
21887
+ * 名称 + 正文,候选行右侧有「确认」,生效行右侧是开关(关闭只停止注入,否决与删除都进回收站)。
21815
21888
  * 卡头右侧的「设置」开设置弹窗(两层开关 / 风格 / 整理),卡片本身只管展示与逐条操作。
21889
+ *
21890
+ * 已归档 / 已否决 / 已删除都不在这里:正文已经移进统一回收站,恢复入口只有回收站。
21816
21891
  */
21817
21892
  function renderEvolutionCard(opts) {
21818
21893
  var layerOn = opts.layerOn
21819
21894
  var groups = evolutionGroupView(opts.groups)
21820
21895
  var total = 0
21821
21896
  var onCount = 0
21822
- groups.forEach(function (g) { total += g.live.length; onCount += g.on })
21823
- // 一条都没有 → 不渲染:空卡 / 空提示只占空间,开关状态在页头按钮与设置弹窗里。
21897
+ groups.forEach(function (g) {
21898
+ total += g.live.length
21899
+ onCount += g.on
21900
+ })
21901
+ // 一条生效的都没有 → 不渲染:空卡只占空间。
21824
21902
  if (total === 0) return null
21825
21903
  // 默认展开跟总开关走(开 = 这里就是它注入的清单,该一眼能看);手动收起的以手动为准。
21826
21904
  var openFlag = collapsed[opts.cardKey]
@@ -21905,7 +21983,8 @@ function enabledMemoryCount(rules) {
21905
21983
  }
21906
21984
  }
21907
21985
  if (group === '') {
21908
- setResult({ ok: false, error: t('memory.workspace.noCwd') })
21986
+ // Notice 读的是 `text`(`error` 字段不会显示),用错键会让这次点击完全没反馈。
21987
+ setResult({ ok: false, text: t('memory.workspace.noCwd') })
21909
21988
  return
21910
21989
  }
21911
21990
  setEditor(draftForCreate(group))
@@ -22425,7 +22504,7 @@ function enabledMemoryCount(rules) {
22425
22504
 
22426
22505
  function renderEvolutionModal() {
22427
22506
  var st = evo.status
22428
- var auto = (st && st.auto) || { entries: 0, active: 0, pendingReview: 0 }
22507
+ var auto = (st && st.auto) || { entries: 0, active: 0, pending: 0 }
22429
22508
  var eff = (st && st.effective) || {}
22430
22509
  var overall = eff.enabled === true
22431
22510
  var globalOn = eff.learnGlobal === true
@@ -22442,14 +22521,11 @@ function enabledMemoryCount(rules) {
22442
22521
  var statText = t('evo.stat', {
22443
22522
  learned: auto.entries || 0,
22444
22523
  active: auto.active || 0,
22445
- pending: auto.pendingReview || 0,
22524
+ pending: auto.pending || 0,
22446
22525
  })
22447
- // 待复核与已归档只在非零时追加:它们是"需要你做什么"与"你已经收起了什么",
22448
- // 恒显示一个 0 只会让这行变长。这两个数服务端一直在给,界面此前从没读过。
22526
+ // 待复核只在非零时追加:它表示"需要你做什么",恒显示一个 0 只会让这行变长。
22449
22527
  var evoDue = Number(auto.reviewDue) || 0
22450
22528
  if (evoDue > 0) statText += t('evo.stat.reviewDue', { due: evoDue })
22451
- var evoArchived = Number(auto.archived) || 0
22452
- if (evoArchived > 0) statText += t('evo.stat.archived', { archived: evoArchived })
22453
22529
  // 索引读坏:条目可能整块为空,而用户看到的是"我明明学过几条"。这一句必须显式
22454
22530
  // 说清是读不到,不是没有 —— 否则他会以为自己的记忆丢了。
22455
22531
  if (auto.broken === true) statText += t('evo.stat.broken')
@@ -22539,49 +22615,38 @@ function enabledMemoryCount(rules) {
22539
22615
  var evoGlobalOn = evoEff.learnGlobal === true
22540
22616
  var evoWorkspaceOn = evoEff.learnWorkspace === true
22541
22617
  var evoOn = evoGlobalOn || evoWorkspaceOn
22542
- var evoPending = Number(evo.status && evo.status.auto && evo.status.auto.pendingReview) || 0
22543
- // 页头「注入预算」的**已用**只有一个来源:服务端按注入侧口径算好的总占用。
22544
- //
22545
- // 那个数包含四块(场景段 + 工作区记忆 + 全局自主 + 工作区自主),而界面手里
22546
- // 的 `memInfo.usedBytes` 只含场景段 —— 自己相加会漏掉工作区记忆,于是显示
22547
- // "还剩 100 KiB"而实际早已超限。
22618
+ var evoPending = Number(evo.status && evo.status.auto && evo.status.auto.pending) || 0
22619
+ // 页头「记忆域预算」= 记忆域的已用 / 上限,唯一来源是服务端 `auto.injectBytes`
22620
+ // (`{ bytes, maxBytes, breakdown, degraded? }`)。`bytes` 是这一轮真正进上下文的
22621
+ // 记忆正文:全局 + 工作区 + 跟着场景消息走的场景记忆,三块共用一个总盘。界面别再
22622
+ // 按各层自己加,否则会把标题与收尾语重复记一遍。
22548
22623
  //
22549
- // 服务端没给(老版本 / 单测)时才退回本地累加:那个算法会高估,但不会漏报。
22550
- var serverUsed = evo.status && evo.status.auto && evo.status.auto.injectBytes
22551
- var hasServerUsed = typeof serverUsed === 'number' && isFinite(serverUsed)
22552
- var evoBytes = (function () {
22553
- if (hasServerUsed) return Math.max(0, serverUsed)
22554
- var hash = String((evo.status && evo.status.workspace && evo.status.workspace.hash) || '')
22555
- var total = memUsed
22556
- ;(evo.entries || []).forEach(function (e) {
22557
- if (e.injects !== true) return
22558
- if (e.layer === 'global') { if (evoGlobalOn) total += Number(e.bytes) || 0; return }
22559
- if (e.layer === 'workspace') { if (evoWorkspaceOn && hash !== '' && String(e.workspace || '') === hash) total += Number(e.bytes) || 0 }
22560
- })
22561
- return total
22562
- })()
22624
+ // 缺字段(老版本 / 单测)或 `degraded` 非空时显示「未知 / 降级」:拿 0 顶会被读成
22625
+ // "记忆不占字节",超限也不会转红,比留白更糟。
22626
+ var injectBytes = evo.status && evo.status.auto && evo.status.auto.injectBytes
22627
+ var hasInjectBytes = !!injectBytes && typeof injectBytes === 'object'
22628
+ && typeof injectBytes.bytes === 'number' && isFinite(injectBytes.bytes)
22629
+ var budgetDegradedText = injectBytes && typeof injectBytes.degraded === 'string' ? injectBytes.degraded : ''
22630
+ var budgetUnknown = !hasInjectBytes
22631
+ var budgetDegraded = hasInjectBytes && budgetDegradedText !== ''
22632
+ var evoBytes = hasInjectBytes ? Math.max(0, injectBytes.bytes) : 0
22633
+ var budgetMax = hasInjectBytes && typeof injectBytes.maxBytes === 'number' && isFinite(injectBytes.maxBytes)
22634
+ ? Math.max(0, injectBytes.maxBytes) : 0
22563
22635
  // 超限判据与显示用同一个数:两处各算一套时,会出现"红了但数字没超"。
22564
- var budgetOver = memMax > 0 && evoBytes > memMax
22636
+ var budgetOver = !budgetUnknown && !budgetDegraded && budgetMax > 0 && evoBytes > budgetMax
22637
+ var budgetValue = budgetUnknown ? t('memory.budget.unknown')
22638
+ : budgetDegraded ? t('memory.budget.degraded')
22639
+ : t('memory.budget.bytes', { used: evoBytes, max: budgetMax })
22565
22640
  var evoConflicts = Number(evo.status && evo.status.auto && evo.status.auto.conflicts) || 0
22566
22641
  // 工作区自主记忆卡:所有工作区合成一张,卡内按名称分节。场景筛选选了具体场景时
22567
22642
  // 跟着隐藏 —— 自主记忆不绑场景,出现在"某场景里有什么"的答案里只会添乱。
22568
22643
  var evoCards = renderEvolutionCards()
22569
- // 全局自主记忆嵌在「全局」卡里:搜索只命中自主记忆时,用户记忆一条都没命中的
22570
- // 全局卡也必须出现,否则那节内容跟着卡一起消失。
22571
- var autoGlobalGroups = evolutionGroupView([{
22572
- key: 'global',
22573
- label: '',
22574
- rows: (evo.entries || []).filter(function (e) { return e.layer === 'global' }),
22575
- }])
22576
- var autoGlobalVisible = sceneFilter === '' && (evoGlobalOn || autoGlobalGroups[0].live.length > 0)
22577
22644
  var cardBuckets = visibleBuckets
22578
- if (autoGlobalVisible && cardBuckets.indexOf('global') < 0) cardBuckets = ['global'].concat(cardBuckets)
22579
- // 顺序(用户 2026-11-10):全局(含全局自主记忆)→ 工作区自主记忆 → 其余场景卡。
22580
- // 没有全局卡时工作区卡排最前;它不绑场景,不该被挤到页面末尾。
22581
22645
  // 页面顺序(用户定的四类记忆,从上到下):
22582
22646
  // 全局记忆 → 自主记忆 → 工作区记忆 → 场景记忆(每场景一张)。
22583
- // 全局卡内部还嵌着自主·全局那一节 —— 它与全局记忆是同一层的东西,分开成卡读起来
22584
- // 像两套配置;自主卡只放工作区自主那半。
22647
+ // 全局自主记忆与工作区自主记忆都在上面那张自主卡里(见 renderEvolutionCards),
22648
+ // 不往全局卡里塞,也不再为了让"只命中自主记忆"的全局卡出现而强插 key ——
22649
+ // 那会把一张空的用户记忆卡拉出来。
22585
22650
  var sceneCards = cardBuckets.map(renderSceneCard)
22586
22651
  var wsCard = renderWorkspaceCard()
22587
22652
  var globalIndex = cardBuckets.indexOf('global')
@@ -22605,11 +22670,13 @@ function enabledMemoryCount(rules) {
22605
22670
  [(stats.enabled || 0) + '/' + (stats.total || 0), t('memory.stat.total')],
22606
22671
  [(stats.scenes || 0) + '/' + (data.scenes || []).length, t('memory.stat.sceneCount')],
22607
22672
  // 注入预算本来就是"已用/上限",与上面两格同形;超限整格转错误色。
22608
- // 已用直接用 `evoBytes`:服务端给值时它已经是**四块合计**(场景段 + 工作区
22609
- // 记忆 + 两层自主),再叠加 `memUsed` 会把场景段算两遍。
22610
- [memMax > 0 ? t('memory.budget.bytes', { used: evoBytes, max: memMax }) : '—',
22673
+ // 已用只取服务端的 `injectBytes.bytes`(记忆域),不叠加任何本地累加 ——
22674
+ // 见上面预算那段注释。取不到时值是「未知 / 降级」,不是 0。
22675
+ // 这格按内容取宽(dsm-head-stat-auto),不与另两格等分:它的文字最长
22676
+ // (「记忆域预算 262144/262144 B」),等分时先被截断(用户 2026-11-12)。
22677
+ [budgetValue,
22611
22678
  budgetOver ? t('memory.budget.label') + ' · ' + t('memory.budget.over') : t('memory.budget.label'),
22612
- budgetOver ? 'dsm-stat-over' : ''],
22679
+ 'dsm-head-stat-auto' + (budgetOver ? ' dsm-stat-over' : '')],
22613
22680
  // 冲突格**只在真有时才出现**:恒显示一个 0 的统计比不显示更糟 —— 用户会
22614
22681
  // 以为"没有冲突",而实际上那个字段此前压根没被赋值过。
22615
22682
  ...(evoConflicts > 0
@@ -22653,6 +22720,9 @@ function enabledMemoryCount(rules) {
22653
22720
  React.createElement('div', { className: 'dsm-source-filter' },
22654
22721
  React.createElement(SourceSelect, { options: sceneOptions, value: sceneFilter, onChange: setSceneFilter }))),
22655
22722
  memInfo.truncated ? React.createElement('p', { className: 'dsm-help' }, t('memory.budget.truncated')) : null,
22723
+ // 降级原因原样渲染(服务端给的实况串,不进 DICT):预算数字这时不可信,
22724
+ // 用户需要知道是哪个文件读坏了。
22725
+ budgetDegraded ? React.createElement('p', { className: 'dsm-help' }, t('memory.budget.degradedTip', { reason: budgetDegradedText })) : null,
22656
22726
  droppedNames.length ? React.createElement('p', { className: 'dsm-help' }, t('memory.budget.dropped', { names: droppedNames.join('、') })) : null,
22657
22727
  // 成功 / 失败统一走 Notice(成功浮层 2.6 秒自动消失,见上方 result 清理 effect;
22658
22728
  // 错误留在文档流里不自动消失——错误需要一直看得见)。
@@ -22765,12 +22835,12 @@ function enabledMemoryCount(rules) {
22765
22835
  onClick: function () { stepEvolutionReview(1) },
22766
22836
  }, '›')),
22767
22837
  // 左下否决 / 右下确认(用户 2026-11-11)。处理完自动进下一条,全部处理完自动关窗。
22768
- // 否决 = 归档(不注入、可恢复),不是删除 —— 删除会写墓碑,30 天内同义内容
22838
+ // 否决 = 正文移进回收站,可恢复,但不写墓碑 —— 删除会写墓碑,30 天内同义内容
22769
22839
  // 都学不回来,那是另一件事。
22770
22840
  React.createElement('div', { className: 'dsm-modal-actions dsm-modal-actions-split' },
22771
22841
  // 与「确认」同一档主按钮(用户 2026-11-11):两个都是对这条记忆的处置,
22772
- // 没有主次,方向由文案与左右位置表达。**不用红色** —— 否决是归档(不注入、
22773
- // 可恢复),不是销毁;红色在这里会把「先不采用」说成「危险操作」。
22842
+ // 没有主次,方向由文案与左右位置表达。**不用红色** —— 否决是把正文收进
22843
+ // 回收站,可恢复,不是销毁;红色在这里会把「先不采用」说成「危险操作」。
22774
22844
  React.createElement('button', { type: 'button', className: 'dsm-btn', disabled: evoReview.busy || evoReview.loading, onClick: rejectEvolutionInReview }, t('evo.review.reject')),
22775
22845
  React.createElement('button', {
22776
22846
  type: 'button', className: 'dsm-btn',
@@ -22889,7 +22959,11 @@ function enabledMemoryCount(rules) {
22889
22959
  */
22890
22960
  editor.mode === 'create'
22891
22961
  ? React.createElement('div', { className: 'dsm-target-pick' },
22962
+ // 层级下拉只装短标签(全局 / 工作区 / 场景),给它固定窄宽;
22963
+ // 腾出来的横向空间全给右边那个 —— 它装的是工作区名 / 场景名,
22964
+ // 那串名字常比容器还长,收窄了就被截成看不出是哪一档。
22892
22965
  React.createElement(SourceSelect, {
22966
+ className: 'dsm-target-level',
22893
22967
  options: createTargets.levels,
22894
22968
  value: createKind,
22895
22969
  ariaLabel: t('memory.field.level'),
@@ -22897,6 +22971,7 @@ function enabledMemoryCount(rules) {
22897
22971
  onChange: function (v) { onPickCreateLevel(v) },
22898
22972
  }),
22899
22973
  createKind === 'global' ? null : React.createElement(SourceSelect, {
22974
+ className: 'dsm-target-name',
22900
22975
  options: createKind === 'workspace' ? createTargets.workspace : createTargets.scene,
22901
22976
  value: editor.group || '',
22902
22977
  ariaLabel: createKind === 'workspace' ? t('memory.level.workspace') : t('memory.level.scene'),
@@ -23378,7 +23453,7 @@ function enabledMemoryCount(rules) {
23378
23453
  const wsHash = isWs ? String(r.group || '').split('/')[1] || '' : ''
23379
23454
  const wsName = wsHash !== '' ? (wsLabels[wsHash] || '') : ''
23380
23455
  return {
23381
- id: r.id, key: r.id, label: r.name, on: mc.on, scoped: mc.scoped, note: r.description,
23456
+ id: r.id, key: r.id, label: r.name, on: mc.on, scoped: mc.scoped, note: r.excerpt || r.description,
23382
23457
  scene: scene,
23383
23458
  group0: String(r.group || ''),
23384
23459
  // 打了字会跨场景搜,那时按场景分组才看得清是哪里的记忆。