@restregular/dsh-memory 0.9.7 → 0.9.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 (3) hide show
  1. package/README.md +9 -0
  2. package/lib/client.js +181 -69
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -17,6 +17,10 @@ English: Local, durable memory for DeepSeek Harness — one npm package, one loa
17
17
 
18
18
  ![记忆树](./preview/memory-tree.png)
19
19
 
20
+ 设置页「记忆 → 设置」的卡片式布局:每个开关都有可见 label、说明和状态,自动召回标签在同卡编辑。
21
+
22
+ ![设置页卡片](./preview/memory-settings.png)
23
+
20
24
  模型在对话里查记忆 —— `memory_search` 的入参与召回结果:
21
25
 
22
26
  ![memory_search 工具调用](./preview/memory-search.png)
@@ -345,6 +349,11 @@ tools/build-single-package.mjs 构建(产物契约检查 + 可选加载验证)
345
349
 
346
350
  ## 版本
347
351
 
352
+ - **0.9.8** —— 设置页重写为卡片式:
353
+ - 每个开关都有可见 label、说明和「已开启 / 已关闭」状态,不再只靠 tooltip;数值项也有独立 label 与提示。
354
+ - 分组改成卡片:每轮召回 / 印象形态 / 会话摘要 / 记忆使用策略 / 硬性规则 / 自动召回 / 轮末提醒 / 侧栏入口;规则卡显示当前规则条数与作用域数。
355
+ - 自动召回标签编辑器并入「自动召回」卡,保存按钮与说明同屏;数据导出 / 导入独立成卡。
356
+ - 窄面板自动单列;新增回归测试,断言每个开关都有可见 label、hint 和状态文案。
348
357
  - **0.9.7** —— 行为召回从“固定发布/部署模式”改成**标签匹配**:
349
358
  - `autoRecall.tags` 是可编辑标签列表,不再要求写正则;默认并入记忆库里已有的标签(`useMemoryTags`),所以不需要把每个标签抄进设置。
350
359
  - 匹配源扩到可见 `assistant/message` text 块、`todo/write` 任务清单、`command/run`、`goal/change`、`tool/call` 的 name/description/参数,以及 `tool/result` 失败描述;不读取 hidden reasoning。
package/lib/client.js CHANGED
@@ -164,6 +164,37 @@ window.__ModuleLoader__.load({
164
164
  '.memp .switch .knob{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;transition:left .12s ease;box-shadow:0 1px 2px rgba(0,0,0,.25)}',
165
165
  '.memp .switch.on .knob{left:16px}',
166
166
  '.memp .setfoot{display:flex;align-items:center;gap:10px;padding-top:12px}',
167
+ // 新版设置页:卡片 + 可见 label + 状态文案 + 字段说明
168
+ '.memp .setp{display:flex;flex-direction:column;gap:10px}',
169
+ '.memp .sethead{display:flex;align-items:flex-end;gap:12px;padding:0 2px 2px}',
170
+ '.memp .sethead-text{flex:1;min-width:0}',
171
+ '.memp .sethead-title{font-size:14px;font-weight:600;line-height:1.35}',
172
+ '.memp .sethead-sub{font-size:11.5px;color:var(--dsw-alias-label-secondary);line-height:1.5;margin-top:2px}',
173
+ '.memp .sethead-saved{flex:none;font-size:11.5px;color:var(--dsw-alias-brand-primary);padding-bottom:2px}',
174
+ '.memp .setcards{display:flex;flex-direction:column;gap:9px}',
175
+ '.memp .setcard{border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1);overflow:hidden}',
176
+ '.memp .setcard-head{display:flex;align-items:flex-start;gap:14px;padding:11px 13px;background:linear-gradient(120deg,color-mix(in srgb,var(--dsw-alias-brand-primary) 5%,var(--dsw-alias-bg-layer-1)),var(--dsw-alias-bg-layer-1) 62%)}',
177
+ '.memp .setcard-heading{flex:1;min-width:0}',
178
+ '.memp .setcard-title{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;line-height:1.4}',
179
+ '.memp .setcard-desc{font-size:11.5px;color:var(--dsw-alias-label-secondary);line-height:1.55;margin-top:3px}',
180
+ '.memp .setcard-pill{font-size:10px;font-weight:400;line-height:1.7;padding:0 7px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);white-space:nowrap}',
181
+ '.memp .setcard-enable{display:flex;align-items:center;gap:6px;flex:none;padding-top:1px}',
182
+ '.memp .setcard-enable-label{font-size:11.5px;color:var(--dsw-alias-label-secondary)}',
183
+ '.memp .setcard-enable-state{font-size:10px;color:var(--dsw-alias-label-secondary);min-width:42px;text-align:right}',
184
+ '.memp .setcard-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:8px;padding:11px 13px;border-top:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1)}',
185
+ '.memp .setcard-body.data-body{display:block}',
186
+ '.memp .setcard-note{padding:0 13px 11px;font-size:11px;color:var(--dsw-alias-label-secondary);line-height:1.5}',
187
+ '.memp .setfield{display:flex;align-items:center;gap:10px;min-width:0;padding:7px 9px;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-alias-bg-layer-2)}',
188
+ '.memp .setfield-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}',
189
+ '.memp .setfield-label{font-size:12px;font-weight:500;line-height:1.45;color:var(--dsw-alias-label-primary)}',
190
+ '.memp .setfield-hint{font-size:10.5px;line-height:1.45;color:var(--dsw-alias-label-secondary)}',
191
+ '.memp .setfield-control{display:flex;align-items:center;gap:5px;flex:none}',
192
+ '.memp .setfield-state{font-size:10px;color:var(--dsw-alias-label-secondary);min-width:38px;text-align:right}',
193
+ '.memp .setfield input[type=number]{width:82px;padding:4px 7px;background:var(--dsw-alias-bg-layer-1)}',
194
+ '.memp .setcard-body .autorecall{grid-column:1/-1}',
195
+ '.memp .setcard-body .autorecall textarea{min-height:132px;background:var(--dsw-alias-bg-layer-1)}',
196
+ '.memp .setcard.datacard .setcard-head{background:var(--dsw-alias-bg-layer-1)}',
197
+ '@media (max-width:560px){.memp .setcard-head{flex-wrap:wrap}.memp .setcard-enable{margin-left:auto}.memp .setcard-body{grid-template-columns:1fr}}',
167
198
  '.memp .autorecall{flex:1 1 100%;display:flex;flex-direction:column;gap:6px;margin-top:6px}',
168
199
  '.memp .autorecall textarea{min-height:150px;font-family:var(--ds-font-family-code, ui-monospace, monospace);font-size:11px;line-height:1.5}',
169
200
  '.memp .autorecall .row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}',
@@ -1511,7 +1542,8 @@ window.__ModuleLoader__.load({
1511
1542
  }
1512
1543
 
1513
1544
  /** 设置项开关:轨道 + 圆点,与向量服务的 toggle 同一套视觉。 */
1514
- function Switch({ checked, disabled, onChange, title }) {
1545
+ function Switch({ checked, disabled, onChange, title, label }) {
1546
+ const aria = title || label
1515
1547
  return h('button', {
1516
1548
  type: 'button',
1517
1549
  className: 'switch' + (checked ? ' on' : ''),
@@ -1519,6 +1551,7 @@ window.__ModuleLoader__.load({
1519
1551
  'aria-checked': Boolean(checked),
1520
1552
  disabled: Boolean(disabled),
1521
1553
  ...(title ? { title } : {}),
1554
+ ...(aria ? { 'aria-label': aria } : {}),
1522
1555
  onClick: () => onChange(!checked),
1523
1556
  }, h('span', { className: 'knob' }))
1524
1557
  }
@@ -1533,67 +1566,73 @@ window.__ModuleLoader__.load({
1533
1566
  const SETTINGS_GROUPS = [
1534
1567
  {
1535
1568
  key: 'recall', title: '每轮召回',
1536
- desc: '按本轮问题检索记忆并插入上下文,内容没变不重复注入。',
1569
+ desc: '按本轮用户消息检索记忆并插入上下文;内容没变不会重复注入。',
1537
1570
  fields: [
1538
- { k: 'enabled', label: '启用', type: 'bool' },
1539
- { k: 'topK', label: '最多条数', type: 'num', min: 1, max: 20, step: 1 },
1540
- { k: 'tokenBudget', label: 'token 预算', type: 'num', min: 50, max: 4000, step: 50 },
1571
+ { k: 'enabled', label: '启用', type: 'bool', hint: '关闭后每轮不再按问题检索记忆。' },
1572
+ { k: 'topK', label: '最多条数', type: 'num', min: 1, max: 20, step: 1, hint: '每次最多注入几条相关记忆。' },
1573
+ { k: 'tokenBudget', label: 'token 预算', type: 'num', min: 50, max: 4000, step: 50, hint: '召回块允许占用的最大 token 数。' },
1541
1574
  ],
1542
1575
  },
1543
1576
  {
1544
1577
  key: 'impression', title: '印象形态',
1545
- desc: '每条只给摘要,细节由模型用 memory_get 取。',
1578
+ desc: '召回时只给每条记忆的开头,模型需要细节时再用 memory_get 取全文。',
1546
1579
  fields: [
1547
- { k: 'enabled', label: '启用', type: 'bool' },
1548
- { k: 'chars', label: '每条字数', type: 'num', min: 40, max: 800, step: 20 },
1580
+ { k: 'enabled', label: '启用', type: 'bool', hint: '关闭后召回直接给长文摘要。' },
1581
+ { k: 'chars', label: '每条字数', type: 'num', min: 40, max: 800, step: 20, hint: '每条记忆在召回块里保留多少字。' },
1549
1582
  ],
1550
1583
  },
1551
1584
  {
1552
1585
  key: 'digest', title: '会话摘要',
1553
- desc: '会话第一步给一次项目 / 全局的记忆概览;正文被截断时附一条标签索引。',
1586
+ desc: '新会话第一步给一次项目 / 全局记忆概览;正文被截断时附一条可检索的标签索引。',
1554
1587
  fields: [
1555
- { k: 'enabled', label: '启用', type: 'bool' },
1556
- { k: 'topK', label: '最多条数', type: 'num', min: 1, max: 30, step: 1 },
1557
- { k: 'tokenBudget', label: 'token 预算', type: 'num', min: 50, max: 4000, step: 50 },
1558
- { k: 'hintBudget', label: '标签预算', type: 'num', min: 30, max: 1000, step: 10 },
1559
- { k: 'hintMaxItems', label: '标签条数', type: 'num', min: 1, max: 30, step: 1 },
1588
+ { k: 'enabled', label: '启用', type: 'bool', hint: '关闭后新会话不再收到记忆摘要。' },
1589
+ { k: 'topK', label: '最多条数', type: 'num', min: 1, max: 30, step: 1, hint: '摘要正文最多列几条。' },
1590
+ { k: 'tokenBudget', label: '正文预算', type: 'num', min: 50, max: 4000, step: 50, hint: '正文摘要的 token 预算;超出部分转成标签索引。' },
1591
+ { k: 'hintBudget', label: '标签预算', type: 'num', min: 30, max: 1000, step: 10, hint: '标签索引独立预算,不占正文。' },
1592
+ { k: 'hintMaxItems', label: '标签条数', type: 'num', min: 1, max: 30, step: 1, hint: '标签索引最多列几条。' },
1560
1593
  ],
1561
1594
  },
1562
1595
  {
1563
1596
  key: 'policy', title: '记忆使用策略',
1564
- desc: '系统提示常驻段:何时查、查到怎么用、查不到怎么办。',
1565
- fields: [{ k: 'enabled', label: '启用', type: 'bool' }],
1597
+ desc: '系统提示常驻段:什么时候该查记忆、查到后怎么用、查不到怎么办。',
1598
+ fields: [
1599
+ { k: 'enabled', label: '启用', type: 'bool', hint: '关闭只移除这段提示,不影响记忆检索。' },
1600
+ ],
1566
1601
  },
1567
1602
  {
1568
1603
  key: 'rules', title: '硬性规则',
1569
- desc: '把 kind=rule 的记忆放进系统提示常驻段;旧会话下一轮补一条新增/变更的规则。',
1570
- hint: '关闭只影响系统提示常驻段,记忆本身仍可被检索',
1604
+ desc: '把 kind=rule 的记忆放进系统提示常驻段;旧会话下一轮补一条新增 / 变更的规则。',
1605
+ hint: '关闭只影响系统提示常驻段,规则本身仍可被 memory_search 检索。',
1571
1606
  fields: [
1572
- { k: 'enabled', label: '启用', type: 'bool' },
1573
- { k: 'maxItems', label: '最多条数', type: 'num', min: 1, max: 40, step: 1 },
1574
- { k: 'tokenBudget', label: 'token 预算', type: 'num', min: 50, max: 4000, step: 50 },
1575
- { k: 'delta', label: '变更提醒', type: 'bool', hint: '旧会话在下一轮第一步补一条新增/编辑过的规则;没变化的不重复' },
1607
+ { k: 'enabled', label: '启用', type: 'bool', hint: '关闭后规则不再进入系统提示常驻段。' },
1608
+ { k: 'maxItems', label: '最多条数', type: 'num', min: 1, max: 40, step: 1, hint: '规则段最多列几条。' },
1609
+ { k: 'tokenBudget', label: 'token 预算', type: 'num', min: 50, max: 4000, step: 50, hint: '规则段的 token 上限;mandatory 溢出会额外警告。' },
1610
+ { k: 'delta', label: '变更提醒', type: 'bool', hint: '旧会话在下一轮第一步补一条新增 / 编辑过的规则;没变化不重复。' },
1576
1611
  ],
1577
1612
  },
1578
1613
  {
1579
1614
  key: 'autoRecall', title: '自动召回',
1580
- desc: '从可见文本(assistant 输出、任务清单、命令/工具描述、失败信息)匹配记忆标签,命中即检索。',
1615
+ desc: '从可见文本(assistant 输出、任务清单、命令 / 工具描述、失败信息)匹配记忆标签,命中即检索。',
1581
1616
  fields: [
1582
- { k: 'enabled', label: '启用', type: 'bool' },
1583
- { k: 'useToolDescription', label: '用工具 description', type: 'bool', hint: '失败/命中时优先用工具调用自己写的 description 做检索' },
1584
- { k: 'useMemoryTags', label: '用记忆标签', type: 'bool', hint: '自动把记忆库里已有的标签并入触发词' },
1585
- { k: 'maxQueryChars', label: '查询字数', type: 'num', min: 40, max: 500, step: 10 },
1617
+ { k: 'enabled', label: '启用', type: 'bool', hint: '关闭后只保留普通每轮召回与工具失败召回。' },
1618
+ { k: 'useToolDescription', label: '使用工具 description', type: 'bool', hint: '失败或命中时优先用工具调用自己写的 description 做检索。' },
1619
+ { k: 'useMemoryTags', label: '使用记忆标签', type: 'bool', hint: '自动把记忆库里已有的标签并入触发词。' },
1620
+ { k: 'maxQueryChars', label: '查询字数上限', type: 'num', min: 40, max: 500, step: 10, hint: '单次自动召回查询最多多少字,避免把整段命令塞进检索。' },
1586
1621
  ],
1587
1622
  },
1588
1623
  {
1589
1624
  key: 'turnEnd', title: '轮末提醒',
1590
- desc: '下一轮开头提醒把本轮结论落盘,默认关闭。',
1591
- fields: [{ k: 'enabled', label: '启用', type: 'bool' }],
1625
+ desc: '下一轮开头提醒把本轮结论落盘;默认关闭,避免打断连续对话。',
1626
+ fields: [
1627
+ { k: 'enabled', label: '启用', type: 'bool', hint: '开启后每轮结束会给一条“有结论就记一条”的提醒。' },
1628
+ ],
1592
1629
  },
1593
1630
  {
1594
1631
  key: 'sidebar', title: '侧栏入口',
1595
- desc: '在左侧栏「插件」下方显示记忆入口,点击打开面板。',
1596
- fields: [{ k: 'enabled', label: '启用', type: 'bool' }],
1632
+ desc: '在左侧栏「插件」下方显示「记忆」入口,点击在主界面打开面板。',
1633
+ fields: [
1634
+ { k: 'enabled', label: '启用', type: 'bool', hint: '关闭只隐藏侧栏入口,设置页仍然可用。' },
1635
+ ],
1597
1636
  },
1598
1637
  ]
1599
1638
 
@@ -1623,6 +1662,87 @@ window.__ModuleLoader__.load({
1623
1662
  )
1624
1663
  }
1625
1664
 
1665
+ /** 单个数值 / 开关字段:label 和 hint 都必须是可见文本,不能只放在 title 里。 */
1666
+ function SettingField({ field, value, onPatch }) {
1667
+ if (field.type === 'bool') {
1668
+ const checked = Boolean(value)
1669
+ return h('div', { className: 'setfield' },
1670
+ h('div', { className: 'setfield-main' },
1671
+ h('span', { className: 'setfield-label' }, field.label),
1672
+ field.hint ? h('span', { className: 'setfield-hint' }, field.hint) : null,
1673
+ ),
1674
+ h('div', { className: 'setfield-control' },
1675
+ h(Switch, {
1676
+ checked,
1677
+ label: field.label,
1678
+ title: field.hint || field.label,
1679
+ onChange: onPatch,
1680
+ }),
1681
+ h('span', { className: 'setfield-state' }, checked ? '已开启' : '已关闭'),
1682
+ ),
1683
+ )
1684
+ }
1685
+ return h('label', { className: 'setfield' },
1686
+ h('span', { className: 'setfield-main' },
1687
+ h('span', { className: 'setfield-label' }, field.label),
1688
+ field.hint ? h('span', { className: 'setfield-hint' }, field.hint) : null,
1689
+ ),
1690
+ h('input', {
1691
+ type: 'number', min: field.min, max: field.max, step: field.step, value: value,
1692
+ onChange: (e) => onPatch(Number(e.target.value)),
1693
+ }),
1694
+ )
1695
+ }
1696
+
1697
+ /** 一张设置卡:标题 + 描述 + 显式的「启用」开关 + 字段网格。 */
1698
+ function SettingsCard({ group, value, rulesCount, patch, tags }) {
1699
+ const enabledField = group.fields.find((field) => field.k === 'enabled' && field.type === 'bool')
1700
+ const fields = group.fields.filter((field) => field !== enabledField)
1701
+ const enabled = enabledField ? Boolean(value[enabledField.k]) : true
1702
+ return h('section', { className: 'setcard' },
1703
+ h('div', { className: 'setcard-head' },
1704
+ h('div', { className: 'setcard-heading' },
1705
+ h('div', { className: 'setcard-title' },
1706
+ group.title,
1707
+ group.key === 'rules' && rulesCount !== null
1708
+ ? h('span', { className: 'setcard-pill' }, `${rulesCount.total} 条规则 / ${rulesCount.scopes} 个作用域`)
1709
+ : null,
1710
+ ),
1711
+ h('div', { className: 'setcard-desc' }, group.desc),
1712
+ ),
1713
+ enabledField
1714
+ ? h('div', { className: 'setcard-enable' },
1715
+ h('span', { className: 'setcard-enable-label' }, enabledField.label || '启用'),
1716
+ h(Switch, {
1717
+ checked: enabled,
1718
+ label: enabledField.label,
1719
+ title: enabledField.hint || `${group.title}:${enabledField.label}`,
1720
+ onChange: (next) => patch(group.key, enabledField.k, next),
1721
+ }),
1722
+ h('span', { className: 'setcard-enable-state' }, enabled ? '已开启' : '已关闭'),
1723
+ )
1724
+ : null,
1725
+ ),
1726
+ fields.length > 0 || group.key === 'autoRecall'
1727
+ ? h('div', { className: 'setcard-body' },
1728
+ fields.map((field) => h(SettingField, {
1729
+ key: field.k,
1730
+ field,
1731
+ value: value[field.k],
1732
+ onPatch: (next) => patch(group.key, field.k, next),
1733
+ })),
1734
+ group.key === 'autoRecall'
1735
+ ? h(AutoRecallTagsEditor, {
1736
+ tags,
1737
+ onSave: (next) => patch('autoRecall', 'tags', next),
1738
+ })
1739
+ : null,
1740
+ )
1741
+ : null,
1742
+ group.hint ? h('div', { className: 'setcard-note' }, group.hint) : null,
1743
+ )
1744
+ }
1745
+
1626
1746
  function SettingsTab() {
1627
1747
  const [settings, setSettings] = React.useState(null)
1628
1748
  const [error, setError] = React.useState('')
@@ -1705,49 +1825,40 @@ window.__ModuleLoader__.load({
1705
1825
  if (!settings) return h('div', { className: 'empty' }, error || '加载设置…')
1706
1826
 
1707
1827
  return h('div', { className: 'setp' },
1708
- h('div', { className: 'hint' }, '设置保存在记忆数据目录的 settings.json。'),
1709
- SETTINGS_GROUPS.map((group) => {
1710
- const value = settings[group.key] || {}
1711
- return h('div', { className: 'setrow', key: group.key },
1712
- h('span', { className: 'set-title' }, group.title),
1713
- group.fields.map((field) => field.type === 'bool'
1714
- ? h(Switch, {
1715
- key: field.k,
1716
- checked: Boolean(value[field.k]),
1717
- title: field.hint || group.hint || field.label,
1718
- onChange: (next) => patch(group.key, field.k, next),
1719
- })
1720
- : h('label', { className: 'set-field', key: field.k }, field.label, ' ',
1721
- h('input', {
1722
- type: 'number', min: field.min, max: field.max, step: field.step, value: value[field.k],
1723
- onChange: (e) => patch(group.key, field.k, Number(e.target.value)),
1724
- }))),
1725
- h('span', { className: 'set-desc' }, group.desc),
1726
- group.key === 'rules' && rulesCount !== null
1727
- ? h('span', { className: 'set-field' }, `${rulesCount.total} 条规则 / ${rulesCount.scopes} 个作用域(在「记录 → 新建」里选 kind=rule 添加)`)
1728
- : null,
1729
- )
1730
- }),
1731
- h('div', { className: 'setrow' },
1732
- h('span', { className: 'set-title' }, '召回标签'),
1733
- h('span', { className: 'set-desc' }, '工具调用命中标签,或工具失败时,用操作/失败描述检索记忆。'),
1734
- h(AutoRecallTagsEditor, {
1828
+ h('div', { className: 'sethead' },
1829
+ h('div', { className: 'sethead-text' },
1830
+ h('div', { className: 'sethead-title' }, '注入设置'),
1831
+ h('div', { className: 'sethead-sub' }, '修改后立即保存到 settings.json;开关旁显示当前状态,字段下方是说明。'),
1832
+ ),
1833
+ notice ? h('span', { className: 'sethead-saved' }, notice) : null,
1834
+ ),
1835
+ h('div', { className: 'setcards' },
1836
+ SETTINGS_GROUPS.map((group) => h(SettingsCard, {
1837
+ key: group.key,
1838
+ group,
1839
+ value: settings[group.key] || {},
1840
+ rulesCount,
1841
+ patch,
1735
1842
  tags: settings.autoRecall && Array.isArray(settings.autoRecall.tags) ? settings.autoRecall.tags : [],
1736
- onSave: (tags) => patch('autoRecall', 'tags', tags),
1737
- }),
1843
+ })),
1738
1844
  ),
1739
- h('div', { className: 'setrow data' },
1740
- h('span', { className: 'set-title' }, '数据'),
1741
- h('span', { className: 'set-desc' }, '导出文本(不含向量),导入按当前模型重新嵌入并按内容去重。'),
1742
- h('div', { className: 'row' },
1743
- h('button', { onClick: exportAll }, '导出全部'),
1744
- h('label', { className: 'set-field' }, '导入文件',
1745
- h('input', { type: 'file', accept: '.json,application/json', onChange: importFile })),
1746
- dataNotice ? h('span', { className: 'muted' }, dataNotice) : null,
1845
+ h('section', { className: 'setcard datacard' },
1846
+ h('div', { className: 'setcard-head' },
1847
+ h('div', { className: 'setcard-heading' },
1848
+ h('div', { className: 'setcard-title' }, '数据'),
1849
+ h('div', { className: 'setcard-desc' }, '导出文本不含向量;导入按当前模型重新嵌入,并按「作用域 + 内容」去重。'),
1850
+ ),
1851
+ ),
1852
+ h('div', { className: 'setcard-body data-body' },
1853
+ h('div', { className: 'row' },
1854
+ h('button', { onClick: exportAll }, '导出全部'),
1855
+ h('label', { className: 'set-field' }, '导入文件',
1856
+ h('input', { type: 'file', accept: '.json,application/json', onChange: importFile })),
1857
+ dataNotice ? h('span', { className: 'muted' }, dataNotice) : null,
1858
+ ),
1747
1859
  ),
1748
1860
  ),
1749
1861
  error ? h('div', { className: 'err' }, error) : null,
1750
- notice ? h('div', { className: 'muted' }, notice) : null,
1751
1862
  )
1752
1863
  }
1753
1864
 
@@ -2412,6 +2523,7 @@ window.__ModuleLoader__.load({
2412
2523
  RecordCard: RecordCard,
2413
2524
  MemoryPanel: MemoryPanel,
2414
2525
  MemoryTreeTab: MemoryTreeTab,
2526
+ SettingsTab: SettingsTab,
2415
2527
  buildMemoryTree: buildMemoryTree,
2416
2528
  KIND_META: KIND_META,
2417
2529
  CSS: CSS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restregular/dsh-memory",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "DeepSeek Harness 本地长期记忆(单包单入口):JSONL 存储 + 本地向量检索(BGE-M3)+ 五个模型工具 + 自动召回注入 + 管理面板。",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",