@restregular/dsh-memory 0.12.3 → 0.12.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  本项目的版本记录。安装 id 与 npm 版本一一对应。
4
4
 
5
+ ## 0.12.5 — 审计表头与行严格对齐
6
+
7
+ - 表头移入滚动容器内部并设为 sticky:表头与行共享同一个内容宽度(含滚动条),不再出现标题比内容偏左。
8
+ - 表头与行统一 `box-sizing: border-box`,使用相同的 1px 透明/实线边框与 9px 水平内边距,列起点逐像素一致。
9
+ - 重新分配列宽:通道 140、触发/阶段 `minmax(150px,1.3fr)`、候选 `minmax(110px,.8fr)`、预算 112、
10
+ 投递 `minmax(108px,.9fr)`、结果 92;总宽度仍自适应,触发和投递不再被截断。
11
+ - 行内预算改为紧凑条(flex:进度条 + `used/budget`),不再套用详情页的三列预算网格,避免数字被裁切。
12
+ - 测试新增:表头存在、行内预算为紧凑条、表头列名可见。
13
+
14
+ ## 0.12.4 — 审计页自动刷新与窗口内布局
15
+
16
+ - **自动刷新**:默认开启,间隔 0.5 秒;可关闭,并可在 0.5 / 1 / 2 / 5 / 10 秒之间切换。
17
+ 刷新在页面隐藏时跳过;静默刷新不显示加载态、不影响当前筛选与选中详情。
18
+ - **精简顶部**:移除“记忆审计”标题、解释文本和右侧“内存模式”气泡;保留带边框的内存模式提示。
19
+ - **窗口内布局**:审计页固定为视口高度,整页不再上下滚动;只有事件列表与详情各自滚动。
20
+ - **列表标题栏**:新增与行对齐的表头(时间 / 通道·事件 / 触发·阶段 / 候选·选中·省略 / 预算 / 投递 / 结果);
21
+ 收窄触发/阶段列,放宽结果列,数值列自适应。
22
+ - **操作反馈就地显示**:“已复制”显示在复制按钮旁,导出结果显示在导出按钮旁,不再固定在顶部。
23
+ - 测试补充:审计页无标题/解释文本、自动刷新开关可见、列表位于滚动容器、筛选用自绘控件、两行筛选布局。
24
+
5
25
  ## 0.12.3 — 审计页筛选与滚动布局优化
6
26
 
7
27
  - 筛选区改为两行紧凑布局:会话/通道/结果/时间范围/搜索/仅看问题/刷新在第一行,
package/README.md CHANGED
@@ -415,6 +415,8 @@ npm run verify # 构建到 .verify/,不落 packages/
415
415
 
416
416
  ## 更新日志
417
417
 
418
+ - **0.12.5** —— 审计表头移入滚动容器并 sticky,与行严格对齐;重分配列宽,行内预算改紧凑条。
419
+ - **0.12.4** —— 审计页默认每 0.5 秒自动刷新(可关/可调间隔);移除顶部标题与气泡,整页固定在窗口内,仅列表滚动;新增表头并优化列宽;复制/导出提示就地显示。
418
420
  - **0.12.3** —— 审计页筛选改为两行紧凑布局与自绘时间范围/开关;事件列表放入独立滚动容器。
419
421
  - **0.12.2** —— 修复 `CordisMemoryService` 未转发审计方法,导致审计页显示“provider 未提供注入审计接口”;升级后需重启 DSH。
420
422
  - **0.12.1** —— 审计 v2 收尾:详情无障碍/唯一 key、JSON 导出、摘要渲染失败记录、部分注入 outcome。
package/lib/client.js CHANGED
@@ -335,11 +335,12 @@ window.__ModuleLoader__.load({
335
335
  '.memp .td-rel-text{color:var(--dsw-alias-label-secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}',
336
336
  '@media (max-width:620px){.memp .tree-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.memp .tree-toolbar input[type=text]{max-width:none}}',
337
337
  // ===== 审计 =====
338
- '.memp .audit{display:flex;flex-direction:column;gap:12px;min-height:0}',
338
+ '.memp .audit{display:flex;flex-direction:column;gap:10px;min-height:0;height:calc(100vh - 160px);max-height:calc(100vh - 160px);overflow:hidden}',
339
339
  '.memp .audit-head{display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap}',
340
340
  '.memp .audit-title{font-size:16px;font-weight:650;line-height:1.35}',
341
341
  '.memp .audit-sub{font-size:11.5px;color:var(--dsw-alias-label-secondary);line-height:1.55;margin-top:2px}',
342
342
  '.memp .audit-mode{margin-left:auto;display:flex;gap:6px;align-items:center;flex-wrap:wrap}',
343
+ '.memp .audit-inline-note{font-size:10.5px;color:var(--dsw-alias-brand-primary);white-space:nowrap}',
343
344
  '.memp .audit-banner{border:1px solid color-mix(in srgb,#D9A441 42%,var(--dsw-alias-border-l1));background:color-mix(in srgb,#D9A441 9%,transparent);border-radius:9px;padding:7px 10px;font-size:11.5px;line-height:1.55;color:var(--dsw-alias-label-secondary)}',
344
345
  '.memp .audit-banner.bad{border-color:color-mix(in srgb,var(--dsw-alias-label-danger, #e05555) 45%,var(--dsw-alias-border-l1));background:color-mix(in srgb,var(--dsw-alias-label-danger, #e05555) 8%,transparent)}',
345
346
  '.memp .audit-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}',
@@ -360,13 +361,16 @@ window.__ModuleLoader__.load({
360
361
  '.memp .audit-switch .switch.on .knob{left:16px}',
361
362
  '.memp .audit-filter-sub{padding-top:1px}',
362
363
  '.memp .audit-range-sep{color:var(--dsw-alias-label-secondary);font-size:11px;flex:none}',
363
- '.memp .audit-split{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;min-height:0;align-items:start}',
364
+ '.memp .audit-split{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;min-height:0;flex:1;overflow:hidden;align-items:stretch}',
364
365
  '.memp .audit-split.has-detail{grid-template-columns:minmax(0,1fr) minmax(300px,360px)}',
365
- '.memp .audit-list{display:flex;flex-direction:column;gap:5px;min-width:0;max-height:min(58vh,620px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:1px 4px 1px 1px;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--dsw-alias-label-secondary) 30%,transparent) transparent}',
366
+ '.memp .audit-list-wrap{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden}',
367
+ '.memp .audit-table-head{display:grid;grid-template-columns:62px 140px minmax(150px,1.3fr) minmax(110px,0.8fr) 112px minmax(108px,0.9fr) 92px;gap:8px;align-items:center;position:sticky;top:0;z-index:2;box-sizing:border-box;padding:6px 9px;margin-bottom:2px;font-size:10px;letter-spacing:.03em;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);border:1px solid transparent;border-bottom-color:var(--dsw-alias-border-l1)}',
368
+ '.memp .audit-table-head span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
369
+ '.memp .audit-list{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:5px 4px 1px 1px;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--dsw-alias-label-secondary) 30%,transparent) transparent}',
366
370
  '.memp .audit-list::-webkit-scrollbar{width:8px}',
367
371
  '.memp .audit-list::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--dsw-alias-label-secondary) 28%,transparent);border-radius:999px;border:2px solid transparent;background-clip:padding-box}',
368
372
  '.memp .audit-list::-webkit-scrollbar-track{background:transparent}',
369
- '.memp .audit-row{display:grid;grid-template-columns:64px 116px minmax(90px,1fr) 92px 104px 84px 74px;gap:8px;align-items:center;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-alias-bg-layer-1);padding:6px 9px;font-size:11.5px;cursor:pointer;text-align:left;color:inherit;width:100%}',
373
+ '.memp .audit-row{display:grid;grid-template-columns:62px 140px minmax(150px,1.3fr) minmax(110px,0.8fr) 112px minmax(108px,0.9fr) 92px;gap:8px;align-items:center;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-alias-bg-layer-1);padding:6px 9px;font-size:11.5px;cursor:pointer;text-align:left;color:inherit;width:100%}',
370
374
  '.memp .audit-row:hover{border-color:var(--dsw-alias-brand-primary)}',
371
375
  '.memp .audit-row.on{border-color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 6%,var(--dsw-alias-bg-layer-1))}',
372
376
  '.memp .audit-row .m{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
@@ -381,7 +385,7 @@ window.__ModuleLoader__.load({
381
385
  '.memp .audit-pill.bad{color:var(--dsw-alias-label-danger, #e05555);border-color:color-mix(in srgb,var(--dsw-alias-label-danger, #e05555) 42%,var(--dsw-alias-border-l1))}',
382
386
  '.memp .audit-pill.mute{color:var(--dsw-alias-label-secondary)}',
383
387
  '.memp .audit-empty{border:1px dashed var(--dsw-alias-border-l1);border-radius:10px;padding:26px 16px;text-align:center;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.65}',
384
- '.memp .audit-detail{border:1px solid var(--dsw-alias-border-l1);border-radius:11px;background:var(--dsw-alias-bg-layer-1);padding:10px 11px;display:flex;flex-direction:column;gap:9px;max-height:min(560px,68vh);overflow:auto;scrollbar-width:thin}',
388
+ '.memp .audit-detail{border:1px solid var(--dsw-alias-border-l1);border-radius:11px;background:var(--dsw-alias-bg-layer-1);padding:10px 11px;display:flex;flex-direction:column;gap:9px;max-height:100%;min-height:0;overflow:auto;scrollbar-width:thin}',
385
389
  '.memp .audit-detail-head{display:flex;gap:7px;align-items:center}',
386
390
  '.memp .audit-detail-head b{font-size:12.5px}',
387
391
  '.memp .audit-detail-head .spacer{flex:1}',
@@ -392,6 +396,11 @@ window.__ModuleLoader__.load({
392
396
  '.memp .audit-sec{border-top:1px solid var(--dsw-alias-border-l1);padding-top:8px;display:flex;flex-direction:column;gap:5px}',
393
397
  '.memp .audit-sec-title{font-size:10.5px;letter-spacing:.04em;color:var(--dsw-alias-label-secondary)}',
394
398
  '.memp .audit-budget{display:grid;grid-template-columns:64px minmax(0,1fr) 92px;gap:7px;align-items:center;font-size:10.5px;color:var(--dsw-alias-label-secondary)}',
399
+ '.memp .audit-budget-compact{display:flex;align-items:center;gap:5px;min-width:0;font-size:10px;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums}',
400
+ '.memp .audit-budget-compact .bar{flex:1;min-width:18px;height:4px;border-radius:999px;background:var(--dsw-alias-bg-layer-2);overflow:hidden}',
401
+ '.memp .audit-budget-compact .bar i{display:block;height:100%;border-radius:999px;background:var(--dsw-alias-brand-primary)}',
402
+ '.memp .audit-budget-compact .bar i.over{background:var(--dsw-alias-label-danger, #e05555)}',
403
+ '.memp .audit-budget-compact .num{flex:none;white-space:nowrap}',
395
404
  '.memp .audit-budget .bar{height:5px;border-radius:999px;background:var(--dsw-alias-bg-layer-2);overflow:hidden}',
396
405
  '.memp .audit-budget .bar i{display:block;height:100%;border-radius:999px;background:var(--dsw-alias-brand-primary)}',
397
406
  '.memp .audit-budget .bar i.over{background:var(--dsw-alias-label-danger, #e05555)}',
@@ -399,8 +408,8 @@ window.__ModuleLoader__.load({
399
408
  '.memp .audit-json{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;line-height:1.45;white-space:pre-wrap;word-break:break-word;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:7px;max-height:220px;overflow:auto}',
400
409
  '.memp .audit-pager{display:flex;gap:6px;align-items:center;justify-content:flex-end;font-size:11px;color:var(--dsw-alias-label-secondary)}',
401
410
  '.memp .audit-flat{display:flex;flex-wrap:wrap;gap:4px}',
402
- '@media (max-width:900px){.memp .audit-split.has-detail{grid-template-columns:minmax(0,1fr)}.memp .audit-row{grid-template-columns:54px 100px minmax(80px,1fr) 70px 84px}}',
403
- '@media (max-width:620px){.memp .audit-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.memp .audit-row{grid-template-columns:minmax(0,1fr) auto;gap:4px 8px}.memp .audit-row .sec{display:none}.memp .audit-filter-row input[type=text],.memp .audit-filter-row input[type=search]{max-width:none;flex:1}.memp .audit-list{max-height:52vh}}',
411
+ '@media (max-width:900px){.memp .audit-split.has-detail{grid-template-columns:minmax(0,1fr)}.memp .audit-row{grid-template-columns:54px 120px 120px minmax(100px,1fr) 96px 100px 80px}.memp .audit-table-head{grid-template-columns:54px 120px 120px minmax(100px,1fr) 96px 100px 80px}}',
412
+ '@media (max-width:620px){.memp .audit-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.memp .audit-table-head{display:none}.memp .audit-row{display:flex;flex-wrap:wrap;gap:4px 8px}.memp .audit-row .col-trigger,.memp .audit-row .col-budget{display:none}.memp .audit-row .col-nums{margin-left:auto}.memp .audit-row .col-time{order:1}.memp .audit-row .col-channel{order:2}.memp .audit-row .col-delivery{order:3}.memp .audit-row .col-outcome{order:4;margin-left:auto}.memp .audit-filter-row input[type=text],.memp .audit-filter-row input[type=search]{max-width:none;flex:1}.memp .audit{height:calc(100vh - 120px);max-height:calc(100vh - 120px)}}',
404
413
  ].join('')
405
414
 
406
415
  async function api(method, body) {
@@ -2091,6 +2100,7 @@ window.__ModuleLoader__.load({
2091
2100
  if (navigator?.clipboard?.writeText) {
2092
2101
  await navigator.clipboard.writeText(text)
2093
2102
  setNotice('已复制')
2103
+ setTimeout(() => setNotice(''), 2200)
2094
2104
  return
2095
2105
  }
2096
2106
  } catch { /* fallthrough */ }
@@ -2122,7 +2132,11 @@ window.__ModuleLoader__.load({
2122
2132
  const [cursor, setCursor] = React.useState('')
2123
2133
  const [loading, setLoading] = React.useState(true)
2124
2134
  const [error, setError] = React.useState('')
2125
- const [notice, setNotice] = React.useState('')
2135
+ const [copyNotice, setCopyNotice] = React.useState('')
2136
+ const [exportNotice, setExportNotice] = React.useState('')
2137
+ const [autoRefresh, setAutoRefresh] = React.useState(true)
2138
+ const [refreshMs, setRefreshMs] = React.useState(500)
2139
+ const loadingRef = React.useRef(false)
2126
2140
  const [session, setSession] = React.useState(readAuditSession())
2127
2141
  const [channel, setChannel] = React.useState('')
2128
2142
  const [outcome, setOutcome] = React.useState('')
@@ -2159,8 +2173,11 @@ window.__ModuleLoader__.load({
2159
2173
  return params
2160
2174
  }
2161
2175
 
2162
- async function load(cursorValue, stack) {
2163
- setLoading(true); setError(''); setNotice('')
2176
+ async function load(cursorValue, stack, options = {}) {
2177
+ const silent = options.silent === true
2178
+ if (silent && loadingRef.current) return
2179
+ loadingRef.current = true
2180
+ if (!silent) { setLoading(true); setError('') }
2164
2181
  try {
2165
2182
  const value = await api(`audit?${queryParams(cursorValue)}`)
2166
2183
  const list = Array.isArray(value.entries) ? value.entries : []
@@ -2170,16 +2187,28 @@ window.__ModuleLoader__.load({
2170
2187
  setNextCursor(typeof value.nextCursor === 'string' ? value.nextCursor : null)
2171
2188
  setCursor(cursorValue || '')
2172
2189
  if (stack !== undefined) setCursorStack(stack)
2173
- if (selectedId !== null && !list.some((entry) => entry.id === selectedId)) setSelectedId(null)
2190
+ if (selectedId !== null && !list.some((entry) => entry.id === selectedId)) { setSelectedId(null); setCopyNotice('') }
2191
+ if (silent) setError('')
2174
2192
  } catch (e) {
2175
2193
  setError(String(e.message || e))
2176
- setEntries([])
2194
+ if (!silent) setEntries([])
2177
2195
  }
2178
- setLoading(false)
2196
+ loadingRef.current = false
2197
+ if (!silent) setLoading(false)
2179
2198
  }
2180
2199
 
2181
2200
  React.useEffect(() => { load('', []) }, [reloadTick])
2182
2201
 
2202
+ // 自动刷新:默认 500ms,可关;页面隐藏时跳过,避免后台无意义轮询。
2203
+ React.useEffect(() => {
2204
+ if (!autoRefresh) return undefined
2205
+ const timer = setInterval(() => {
2206
+ if (typeof document !== 'undefined' && document.hidden) return
2207
+ load(cursor, cursorStack, { silent: true })
2208
+ }, refreshMs)
2209
+ return () => clearInterval(timer)
2210
+ }, [autoRefresh, refreshMs, cursor, cursorStack, session, channel, outcome, trigger, search, problem, range, since, until])
2211
+
2183
2212
  const resetAndReload = () => { setCursor(''); setCursorStack([]); setReloadTick((n) => n + 1) }
2184
2213
  const selected = selectedId === null ? null : entries.find((entry) => entry.id === selectedId) || null
2185
2214
  const prepared = entries.filter((entry) => entry.delivery && entry.delivery.status === 'unknown' && entry.reasonCode === 'prepared').length
@@ -2200,9 +2229,10 @@ window.__ModuleLoader__.load({
2200
2229
  const channelOptions = [{ value: '', label: '全部通道' }].concat(Object.keys(AUDIT_CHANNEL_META).map((key) => ({ value: key, label: AUDIT_CHANNEL_META[key] })))
2201
2230
  const outcomeOptions = [{ value: '', label: '全部结果' }].concat(Object.keys(AUDIT_OUTCOME_META).map((key) => ({ value: key, label: AUDIT_OUTCOME_META[key].label })))
2202
2231
  const rangeOptions = AUDIT_RANGE_META.map((item) => ({ value: item.value, label: item.label }))
2232
+ const refreshOptions = [500, 1000, 2000, 5000, 10000].map((ms) => ({ value: String(ms), label: `${ms / 1000} 秒` }))
2203
2233
 
2204
2234
  const exportAudit = async (format) => {
2205
- setNotice('')
2235
+ setExportNotice('')
2206
2236
  try {
2207
2237
  const res = await fetch(`${API}/audit/export?${queryParams('')}&format=${format}`)
2208
2238
  if (!res.ok) throw new Error(`HTTP ${res.status}`)
@@ -2213,9 +2243,10 @@ window.__ModuleLoader__.load({
2213
2243
  link.download = `dsh-memory-audit.${format}`
2214
2244
  link.click()
2215
2245
  setTimeout(() => URL.revokeObjectURL(url), 1000)
2216
- setNotice(`已导出当前筛选(${format.toUpperCase()})。`)
2246
+ setExportNotice(`已导出当前筛选(${format.toUpperCase()})。`)
2247
+ setTimeout(() => setExportNotice(''), 2200)
2217
2248
  } catch (e) {
2218
- setNotice(`导出失败:${String(e.message || e)}`)
2249
+ setExportNotice(`导出失败:${String(e.message || e)}`)
2219
2250
  }
2220
2251
  }
2221
2252
 
@@ -2263,6 +2294,14 @@ window.__ModuleLoader__.load({
2263
2294
  h('button', { disabled: loading, onClick: () => setReloadTick((n) => n + 1) }, loading ? '刷新中…' : '刷新'),
2264
2295
  ),
2265
2296
  h('div', { className: 'audit-filter-row audit-filter-sub' },
2297
+ h('span', { className: 'audit-switch' },
2298
+ h(Switch, { checked: autoRefresh, disabled: loading, label: '自动刷新', onChange: (next) => setAutoRefresh(next) }),
2299
+ '自动刷新',
2300
+ ),
2301
+ h(Dropdown, {
2302
+ items: refreshOptions, value: String(refreshMs), disabled: loading || !autoRefresh,
2303
+ onChange: (next) => setRefreshMs(Number(next)),
2304
+ }),
2266
2305
  h('input', {
2267
2306
  type: 'text', className: 'audit-trigger', placeholder: '触发源', value: trigger,
2268
2307
  'aria-label': '按触发源筛选',
@@ -2294,6 +2333,7 @@ window.__ModuleLoader__.load({
2294
2333
  h('span', { className: 'spacer' }),
2295
2334
  h('button', { disabled: loading, onClick: () => exportAudit('jsonl') }, '导出 JSONL'),
2296
2335
  h('button', { disabled: loading, onClick: () => exportAudit('json') }, '导出 JSON'),
2336
+ exportNotice ? h('span', { className: 'audit-inline-note' }, exportNotice) : null,
2297
2337
  ),
2298
2338
  )
2299
2339
 
@@ -2307,24 +2347,24 @@ window.__ModuleLoader__.load({
2307
2347
  return h('button', {
2308
2348
  key: entry.id,
2309
2349
  className: 'audit-row' + (entry.id === selectedId ? ' on' : ''),
2310
- onClick: () => setSelectedId(entry.id),
2350
+ onClick: () => { setSelectedId(entry.id); setCopyNotice('') },
2311
2351
  },
2312
- h('span', { className: 'm t', title: fmtTime(entry.at) }, shortTime(entry.at)),
2313
- h('span', { className: 'm' },
2352
+ h('span', { className: 'm t col-time', title: fmtTime(entry.at) }, shortTime(entry.at)),
2353
+ h('span', { className: 'm col-channel' },
2314
2354
  h('b', { className: 'ch' }, auditChannelLabel(entry.channel)),
2315
2355
  h('span', { className: 'trig' }, ` · ${entry.kind || 'event'}`),
2316
2356
  ),
2317
- h('span', { className: 'm trig', title: `${entry.trigger || ''} ${entry.phase || ''}` },
2357
+ h('span', { className: 'm trig col-trigger', title: `${entry.trigger || ''} ${entry.phase || ''}` },
2318
2358
  `${entry.trigger || '—'}${entry.phase ? ` / ${entry.phase}` : ''}`),
2319
- h('span', { className: 'm nums' }, `${candidates} / ${picked} / ${omitted}`),
2320
- h('span', { className: 'm' }, budget
2321
- ? h('span', { className: 'audit-budget' },
2359
+ h('span', { className: 'm nums col-nums' }, `${candidates} / ${picked} / ${omitted}`),
2360
+ h('span', { className: 'm col-budget' }, budget
2361
+ ? h('span', { className: 'audit-budget-compact' },
2322
2362
  h('span', { className: 'bar' }, h('i', { className: budget.over ? 'over' : '', style: { width: `${budget.budget > 0 ? Math.min(100, Math.round((budget.used / budget.budget) * 100)) : 100}%` } })),
2323
2363
  h('span', { className: 'num' }, `${budget.used}/${budget.budget}`),
2324
2364
  )
2325
2365
  : h('span', { className: 'muted' }, '—')),
2326
- h('span', { className: 'm del' }, auditPill(delivery.label + delivery.detail, delivery.tone, delivery.detail || undefined)),
2327
- h('span', { className: 'm' }, auditPill(outcomeMeta.label, outcomeMeta.tone)),
2366
+ h('span', { className: 'm del col-delivery' }, auditPill(delivery.label + delivery.detail, delivery.tone, delivery.detail || undefined)),
2367
+ h('span', { className: 'm col-outcome' }, auditPill(outcomeMeta.label, outcomeMeta.tone)),
2328
2368
  )
2329
2369
  }
2330
2370
 
@@ -2349,8 +2389,9 @@ window.__ModuleLoader__.load({
2349
2389
  h('div', { className: 'audit-detail-head' },
2350
2390
  h('b', null, auditSummaryLine(selected)),
2351
2391
  h('span', { className: 'spacer' }),
2352
- h('button', { className: 'linkbtn', onClick: () => copyAuditText(selected.id, setNotice) }, '复制 ID'),
2353
- h('button', { className: 'audit-close', title: '关闭', onClick: () => setSelectedId(null) }, '×'),
2392
+ h('button', { className: 'linkbtn', onClick: () => copyAuditText(selected.id, setCopyNotice) }, '复制 ID'),
2393
+ copyNotice ? h('span', { className: 'audit-inline-note' }, copyNotice) : null,
2394
+ h('button', { className: 'audit-close', title: '关闭', onClick: () => { setSelectedId(null); setCopyNotice('') } }, '×'),
2354
2395
  ),
2355
2396
  h('div', { className: 'audit-kv' },
2356
2397
  kv('事件', selected.id),
@@ -2425,11 +2466,20 @@ window.__ModuleLoader__.load({
2425
2466
  h('details', { className: 'audit-sec' },
2426
2467
  h('summary', { className: 'audit-sec-title' }, '原始结构化事件'),
2427
2468
  h('pre', { className: 'audit-json' }, json),
2428
- h('div', { className: 'row' }, h('button', { className: 'linkbtn', onClick: () => copyAuditText(json, setNotice) }, '复制 JSON')),
2469
+ h('div', { className: 'row' }, h('button', { className: 'linkbtn', onClick: () => copyAuditText(json, setCopyNotice) }, '复制 JSON'), copyNotice ? h('span', { className: 'audit-inline-note' }, copyNotice) : null),
2429
2470
  ),
2430
2471
  )
2431
2472
  })() : null
2432
2473
 
2474
+ const listHeader = h('div', { className: 'audit-table-head' },
2475
+ h('span', null, '时间'),
2476
+ h('span', null, '通道 / 事件'),
2477
+ h('span', null, '触发 / 阶段'),
2478
+ h('span', null, '候选 / 选中 / 省略'),
2479
+ h('span', null, '预算'),
2480
+ h('span', null, '投递'),
2481
+ h('span', null, '结果'),
2482
+ )
2433
2483
  const listBody = loading
2434
2484
  ? h('div', { className: 'audit-empty' }, '加载审计事件…')
2435
2485
  : entries.length === 0
@@ -2439,19 +2489,10 @@ window.__ModuleLoader__.load({
2439
2489
  error ? h('div', { className: 'err' }, error) : null,
2440
2490
  error ? h('div', null, h('button', { onClick: () => setReloadTick((n) => n + 1) }, '重试')) : null,
2441
2491
  )
2442
- : h('div', { className: 'audit-list' }, entries.map(row))
2492
+ : h('div', { className: 'audit-list' }, listHeader, entries.map(row))
2493
+ const listArea = h('div', { className: 'audit-list-wrap' }, listBody)
2443
2494
 
2444
2495
  return h('div', { className: 'audit' },
2445
- h('div', { className: 'audit-head' },
2446
- h('div', null,
2447
- h('div', { className: 'audit-title' }, '记忆审计'),
2448
- h('div', { className: 'audit-sub' }, '追踪记忆注入的触发、筛选、预算、投递与失败原因;评估选中 ≠ 已投递。'),
2449
- ),
2450
- h('div', { className: 'audit-mode' },
2451
- auditPill(persistence === 'memory' ? '内存模式 · 重启后不保留' : persistence === 'jsonl' ? '持久化正常' : '记录不完整', persistence === 'degraded' ? 'bad' : persistence === 'memory' ? 'warn' : 'ok'),
2452
- notice ? h('span', { className: 'muted' }, notice) : null,
2453
- ),
2454
- ),
2455
2496
  ...banner,
2456
2497
  h('div', { className: 'audit-stats' },
2457
2498
  h('div', { className: 'audit-stat' }, h('b', null, String(total)), h('span', null, '筛选内事件')),
@@ -2463,7 +2504,7 @@ window.__ModuleLoader__.load({
2463
2504
  toolbar,
2464
2505
  error && entries.length > 0 ? h('div', { className: 'err' }, error) : null,
2465
2506
  h('div', { className: 'audit-split' + (selected ? ' has-detail' : '') },
2466
- h('div', null, listBody),
2507
+ listArea,
2467
2508
  detail,
2468
2509
  ),
2469
2510
  h('div', { className: 'audit-pager' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restregular/dsh-memory",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "description": "DeepSeek Harness 记忆系统(单包单入口):JSONL 存储 + 本地向量检索(BGE-M3)+ 五个模型工具 + 自动召回注入 + 管理面板。",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",