@restregular/dsh-memory 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -485,24 +485,74 @@ window.__ModuleLoader__.load({
485
485
  '.mem-traj-mark:focus-visible{outline:1px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}',
486
486
  '@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}}',
487
487
  '@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 - 150px);max-height:calc(100vh - 150px)}.memp .audit-detail{max-height:calc(100vh - 280px)}}',
488
- '.mem-scope-btn{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 8px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1;cursor:pointer;flex:none}',
488
+ '.mem-scope-wrap{display:inline-flex;min-width:0}',
489
+ '.mem-scope-btn{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 9px;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 55%,transparent);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1;cursor:pointer;flex:none;transition:border-color .12s ease,color .12s ease,background .12s ease}',
489
490
  '.mem-scope-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}',
490
- '.mem-scope-btn.on{color:var(--dsw-alias-brand-primary);border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 45%,var(--dsw-alias-border-l1))}',
491
+ '.mem-scope-btn.on{color:var(--dsw-alias-brand-primary);border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 45%,var(--dsw-alias-border-l1));background:color-mix(in srgb,var(--dsw-alias-brand-primary) 9%,transparent)}',
491
492
  '.mem-scope-btn svg{flex:none}',
492
- '.mem-scope-pop{position:fixed;z-index:80;width:300px;max-height:min(460px,62vh);display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-specific-menu,var(--dsw-alias-bg-layer-1));box-shadow:var(--dsw-elevation-panel,0 10px 30px rgba(0,0,0,.22));color:var(--dsw-alias-label-primary);font-size:13px}',
493
- '.mem-scope-pop h4{margin:0;font-size:13px;font-weight:600;line-height:1.4}',
493
+ // 毛玻璃浮窗:半透明 + backdrop blur;不支持 backdrop-filter 时退回实心底。
494
+ '.mem-scope-pop{position:fixed;z-index:80;width:360px;max-height:min(620px,80vh);display:flex;flex-direction:column;gap:9px;padding:14px;border:1px solid color-mix(in srgb,var(--dsw-alias-border-l2,var(--dsw-alias-border-l1)) 70%,transparent);border-radius:16px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 66%,transparent);-webkit-backdrop-filter:blur(20px) saturate(1.4);backdrop-filter:blur(20px) saturate(1.4);box-shadow:0 22px 60px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.08);color:var(--dsw-alias-label-primary);font-size:13px;overflow:hidden}',
495
+ '@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.mem-scope-pop{background:var(--dsw-specific-menu,var(--dsw-alias-bg-layer-1))}}',
496
+ '.mem-scope-head{display:flex;align-items:center;gap:8px}',
497
+ '.mem-scope-head h4{margin:0;font-size:13px;font-weight:600;line-height:1.4}',
498
+ '.mem-scope-head .spacer{flex:1}',
499
+ '.mem-scope-count{flex:none;padding:1px 8px;border:1px solid var(--dsw-alias-border-l1);border-radius:999px;color:var(--dsw-alias-label-secondary);font-size:10.5px;line-height:1.7}',
494
500
  '.mem-scope-pop .hint{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.55}',
495
- '.mem-scope-list{display:flex;flex-direction:column;gap:2px;overflow:auto;min-height:0;padding:2px 0}',
496
- '.mem-scope-item{display:flex;align-items:center;gap:8px;padding:6px;border-radius:7px;cursor:pointer}',
501
+ '.mem-scope-level{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}',
502
+ '.mem-scope-level-btn{display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:7px 8px;border:1px solid var(--dsw-alias-border-l1);border-radius:10px;background:transparent;color:var(--dsw-alias-label-secondary);font-size:11px;text-align:left;cursor:pointer;transition:border-color .12s ease,background .12s ease}',
503
+ '.mem-scope-level-btn b{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}',
504
+ '.mem-scope-level-btn span{font-size:9.5px;line-height:1.4;color:var(--dsw-alias-label-secondary)}',
505
+ '.mem-scope-level-btn:hover{border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 40%,var(--dsw-alias-border-l1))}',
506
+ '.mem-scope-level-btn.on{border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 55%,var(--dsw-alias-border-l1));background:color-mix(in srgb,var(--dsw-alias-brand-primary) 11%,transparent)}',
507
+ '.mem-scope-level-btn.on b,.mem-scope-level-btn.on span{color:var(--dsw-alias-brand-primary)}',
508
+ '.mem-scope-note{padding:5px 8px;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-state-warn-primary,#d9a23b) 10%,transparent);color:var(--dsw-alias-label-secondary);font-size:11px;line-height:1.5}',
509
+ '.mem-scope-search{display:flex;align-items:center;gap:6px}',
510
+ '.mem-scope-search input[type=search]{flex:1;min-width:0;padding:5px 9px;font-size:12px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 78%,transparent);color:var(--dsw-alias-label-primary);outline:none}',
511
+ '.mem-scope-search input[type=search]:focus{border-color:var(--dsw-alias-brand-primary)}',
512
+ '.mem-scope-search .linkbtn{white-space:nowrap;padding:2px 3px;border:none;background:none;color:var(--dsw-alias-label-secondary);font-size:11px;cursor:pointer}',
513
+ '.mem-scope-search .linkbtn:hover{color:var(--dsw-alias-brand-primary);border:none}',
514
+ '.mem-scope-list{display:flex;flex-direction:column;gap:3px;overflow:auto;min-height:0;max-height:min(300px,40vh);padding:2px 2px 2px 0;scrollbar-width:thin}',
515
+ '.mem-scope-list::-webkit-scrollbar{width:8px}',
516
+ '.mem-scope-list::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--dsw-alias-label-secondary) 35%,transparent);border-radius:999px;border:2px solid transparent;background-clip:padding-box}',
517
+ '.mem-scope-item{display:flex;flex-direction:column;gap:4px;padding:5px 6px;border:1px solid transparent;border-radius:10px}',
497
518
  '.mem-scope-item:hover{background:var(--dsw-alias-interactive-bg-hover)}',
498
- '.mem-scope-item input{margin:0;flex:none}',
499
- '.mem-scope-item .lab{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
500
- '.mem-scope-item .cnt{flex:none;color:var(--dsw-alias-label-secondary);font-size:11px}',
501
- '.mem-scope-foot{display:flex;align-items:center;gap:8px;justify-content:flex-end}',
519
+ '.mem-scope-item.on{border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 24%,var(--dsw-alias-border-l1));background:color-mix(in srgb,var(--dsw-alias-brand-primary) 7%,transparent)}',
520
+ '.mem-scope-row{display:flex;align-items:center;gap:8px}',
521
+ '.mem-scope-check{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;background:transparent;flex:none;cursor:pointer}',
522
+ '.mem-scope-check .box{display:flex;align-items:center;justify-content:center;width:16px;height:16px;border:1.5px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));border-radius:5px;background:transparent;color:var(--dsw-alias-label-on-brand,#fff);transition:background .12s ease,border-color .12s ease}',
523
+ '.mem-scope-check.on .box{background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}',
524
+ '.mem-scope-check:focus-visible{outline:1px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}',
525
+ '.mem-scope-label{flex:1;min-width:0;padding:0;border:none;background:transparent;color:var(--dsw-alias-label-primary);font-size:12.5px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}',
526
+ '.mem-scope-label:hover{color:var(--dsw-alias-brand-primary);border:none}',
527
+ '.mem-scope-row .cnt{flex:none;color:var(--dsw-alias-label-secondary);font-size:10.5px}',
528
+ '.mem-kind-row{display:flex;flex-wrap:wrap;gap:4px;padding-left:24px}',
529
+ '.mem-kind-chip{display:inline-flex;align-items:center;gap:3px;padding:1px 7px;border:1px solid var(--dsw-alias-border-l1);border-radius:999px;background:transparent;color:var(--dsw-alias-label-secondary);font-size:10.5px;line-height:1.7;cursor:pointer}',
530
+ '.mem-kind-chip:hover{border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 50%,var(--dsw-alias-border-l1));color:var(--dsw-alias-label-primary)}',
531
+ '.mem-kind-chip.on{border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 55%,var(--dsw-alias-border-l1));color:var(--dsw-alias-brand-primary);background:color-mix(in srgb,var(--dsw-alias-brand-primary) 10%,transparent)}',
532
+ '.mem-kind-chip i{font-style:normal;opacity:.65;font-size:9px}',
533
+ '.mem-scope-foot{display:flex;align-items:center;gap:8px}',
502
534
  '.mem-scope-foot .spacer{flex:1}',
503
- '.mem-scope-foot button{padding:5px 12px;font-size:12px}',
504
- '.mem-scope-foot button.primary{background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-on-brand,#fff)}',
505
- '.mem-scope-err{color:var(--dsw-alias-state-error-primary,#d33);font-size:12px;line-height:1.5}',
535
+ '.mem-scope-reset{padding:6px 13px;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:transparent;color:var(--dsw-alias-label-secondary);font-size:12px;cursor:pointer;transition:border-color .12s ease,color .12s ease}',
536
+ '.mem-scope-reset:hover:not(:disabled){border-color:color-mix(in srgb,var(--dsw-alias-brand-primary) 55%,var(--dsw-alias-border-l1));color:var(--dsw-alias-brand-primary)}',
537
+ '.mem-scope-save{padding:6px 16px;border:1px solid var(--dsw-alias-brand-primary);border-radius:9px;background:linear-gradient(180deg,color-mix(in srgb,var(--dsw-alias-brand-primary) 92%,white 8%),var(--dsw-alias-brand-primary));color:var(--dsw-alias-label-on-brand,#fff);font-size:12px;font-weight:600;cursor:pointer;box-shadow:0 4px 14px color-mix(in srgb,var(--dsw-alias-brand-primary) 30%,transparent);transition:filter .12s ease}',
538
+ '.mem-scope-save:hover:not(:disabled){filter:brightness(1.06)}',
539
+ '.mem-scope-reset:disabled,.mem-scope-save:disabled{opacity:.5;cursor:default;filter:none}',
540
+ '.mem-scope-err{padding:5px 8px;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-state-error-primary,#d33) 10%,transparent);color:var(--dsw-alias-state-error-primary,#d33);font-size:12px;line-height:1.5}',
541
+ // 范围外访问审批浮层(全局 fixed;根节点带 .memp 以复用审计 hover 浮窗样式)
542
+ '.mem-approval{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:90;width:min(520px,calc(100vw - 24px));max-height:min(70vh,620px);display:flex;flex-direction:column;pointer-events:none;padding:0;font-size:13px;color:var(--dsw-alias-label-primary)}',
543
+ '.mem-approval-card{pointer-events:auto;display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid color-mix(in srgb,var(--dsw-alias-state-warn-primary,#d9a23b) 42%,var(--dsw-alias-border-l1));border-radius:16px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 72%,transparent);-webkit-backdrop-filter:blur(20px) saturate(1.35);backdrop-filter:blur(20px) saturate(1.35);box-shadow:0 22px 60px rgba(0,0,0,.36),inset 0 1px 0 rgba(255,255,255,.08);overflow:hidden}',
544
+ '@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.mem-approval-card{background:var(--dsw-alias-bg-layer-1)}}',
545
+ '.mem-approval-head{display:flex;align-items:center;gap:7px}',
546
+ '.mem-approval-head b{font-size:13px;font-weight:600}',
547
+ '.mem-approval-head .spacer{flex:1}',
548
+ '.mem-approval-dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--dsw-alias-state-warn-primary,#d9a23b);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-state-warn-primary,#d9a23b) 18%,transparent)}',
549
+ '.mem-approval-query{padding:6px 9px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 55%,transparent);color:var(--dsw-alias-label-secondary);font-size:11.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word;max-height:80px;overflow:auto}',
550
+ '.mem-approval-list{display:flex;flex-direction:column;gap:6px;overflow:auto;min-height:0;max-height:min(300px,38vh)}',
551
+ '.mem-approval-item{display:flex;flex-direction:column;gap:4px;padding:7px 8px;border:1px solid var(--dsw-alias-border-l1);border-radius:10px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 55%,transparent)}',
552
+ '.mem-approval-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}',
553
+ '.mem-approval-summary{color:var(--dsw-alias-label-secondary);font-size:11.5px;line-height:1.5;word-break:break-word}',
554
+ '.mem-approval-foot{display:flex;align-items:center;gap:8px}',
555
+ '.mem-approval .spacer{flex:1}',
506
556
  ].join('')
507
557
 
508
558
  async function api(method, body) {
@@ -2475,6 +2525,53 @@ window.__ModuleLoader__.load({
2475
2525
  return target
2476
2526
  }
2477
2527
 
2528
+ // ===== 记录焦点总线:审批浮层里的记忆 ID → 面板「记录」页并展开卡片 =====
2529
+ const RECORD_FOCUS_EVENT = 'dsh-memory:record-focus'
2530
+ let pendingRecordFocus = null
2531
+
2532
+ function requestRecordFocus(target) {
2533
+ pendingRecordFocus = target && typeof target === 'object' ? { ...target, at: Date.now() } : null
2534
+ try {
2535
+ if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === 'function') {
2536
+ window.dispatchEvent(new CustomEvent(RECORD_FOCUS_EVENT, { detail: pendingRecordFocus }))
2537
+ }
2538
+ } catch { /* 没有 CustomEvent 时靠面板挂载时取一次 */ }
2539
+ }
2540
+
2541
+ function takeRecordFocus() {
2542
+ const target = pendingRecordFocus
2543
+ if (!target) return null
2544
+ pendingRecordFocus = null
2545
+ return target
2546
+ }
2547
+
2548
+ function peekRecordFocus() {
2549
+ return pendingRecordFocus
2550
+ }
2551
+
2552
+ /**
2553
+ * 打开记忆面板并定位到某条记录(审批浮层 hover 的点击动作)。
2554
+ * 优先侧栏主面板;没有侧栏入口时打开设置页。目标由面板挂载/事件消费。
2555
+ */
2556
+ function openMemoryRecordPanel(id, scope, record) {
2557
+ if (typeof id !== 'string' || id === '') return 'none'
2558
+ requestRecordFocus({ id, scope: typeof scope === 'string' ? scope : '', record: record || null })
2559
+ try {
2560
+ const main = safeSlots()?.entries?.('main') ?? []
2561
+ if (main.some((entry) => entry?.options?.key === 'memory')) {
2562
+ try { clientCtx?.get?.('layout')?.selectPanel?.('memory') } catch { /* 交给挂载消费 */ }
2563
+ return 'panel'
2564
+ }
2565
+ } catch { /* fallthrough */ }
2566
+ try {
2567
+ const settings = clientCtx?.get?.('settings')
2568
+ const openSection = settings?.store?.actions?.openSection ?? settings?.actions?.openSection ?? settings?.openSection
2569
+ if (typeof openSection === 'function') { openSection('memory'); return 'settings' }
2570
+ } catch { /* fallthrough */ }
2571
+ try { clientCtx?.get?.('layout')?.selectPanel?.('settings') } catch { /* 无布局服务 */ }
2572
+ return 'settings'
2573
+ }
2574
+
2478
2575
  /**
2479
2576
  * 从轨迹/头部入口打开记忆审计:优先主面板;没有侧栏入口时切到会话内的
2480
2577
  * 「记忆」视图;两者都不可用时至少打开设置页(面板挂载后会消费 pending)。
@@ -3358,6 +3455,18 @@ window.__ModuleLoader__.load({
3358
3455
  setScopeFilter(nextScope)
3359
3456
  load('', nextScope, false)
3360
3457
  }
3458
+ // 审批浮层 / 其它入口点击记忆 ID:挂载时消费一次 pending,之后靠同一事件。
3459
+ React.useEffect(() => {
3460
+ const applyFocus = () => {
3461
+ const target = takeRecordFocus()
3462
+ if (!target || typeof target.id !== 'string' || target.id === '') return
3463
+ openRecord(target.id, target.scope, target.record || null)
3464
+ }
3465
+ applyFocus()
3466
+ if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') return undefined
3467
+ window.addEventListener(RECORD_FOCUS_EVENT, applyFocus)
3468
+ return () => window.removeEventListener(RECORD_FOCUS_EVENT, applyFocus)
3469
+ }, [])
3361
3470
  // 导入完成后从设置页切换回记录页时,列表要能看到新数据(事件由设置页发出)。
3362
3471
  React.useEffect(() => {
3363
3472
  if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') return undefined
@@ -4342,13 +4451,29 @@ window.__ModuleLoader__.load({
4342
4451
  *
4343
4452
  * 弹层用 fixed 定位(按按钮 rect 往上开),避免被 composer 的 overflow 裁掉。
4344
4453
  */
4454
+ /**
4455
+ * 输入框里的「记忆可见域」按钮 + 浮窗。
4456
+ *
4457
+ * 宿主 `conversation.input.right` 是 session 作用域的 list 槽,owner 会把
4458
+ * `sessionId` 作为标准 prop 传进来,所以这里不需要 register 的 inject。
4459
+ *
4460
+ * 读写走 /memory/api/visibility:
4461
+ * GET ?session=<id> → { override, effective, inherited, scopes, kinds }
4462
+ * POST { session, visibility: { scopes: [{ scope, kinds? }], level } | null } → 同上
4463
+ * `override === null` = 使用默认三路集合;子 Agent 会话会继承父会话的 override。
4464
+ *
4465
+ * 弹层用 fixed 定位(按按钮 rect 往上开),避免被 composer 的 overflow 裁掉。
4466
+ * 视觉:毛玻璃背景 + 自定义勾选 + 类型 chips + 三档限制等级。
4467
+ */
4345
4468
  function MemoryVisibilityButton({ sessionId } = {}) {
4346
4469
  const [open, setOpen] = React.useState(false)
4347
4470
  const [loading, setLoading] = React.useState(false)
4348
4471
  const [busy, setBusy] = React.useState(false)
4349
4472
  const [error, setError] = React.useState('')
4350
4473
  const [data, setData] = React.useState(null)
4351
- const [selected, setSelected] = React.useState([])
4474
+ const [level, setLevel] = React.useState('normal')
4475
+ const [entries, setEntries] = React.useState({})
4476
+ const [search, setSearch] = React.useState('')
4352
4477
  const [anchor, setAnchor] = React.useState(null)
4353
4478
  const wrapRef = React.useRef(null)
4354
4479
 
@@ -4374,13 +4499,35 @@ window.__ModuleLoader__.load({
4374
4499
 
4375
4500
  if (typeof sessionId !== 'string' || sessionId === '') return null
4376
4501
 
4502
+ const allKindsOf = (value) => {
4503
+ const list = value && Array.isArray(value.kinds) ? value.kinds.filter((kind) => typeof kind === 'string') : []
4504
+ return list.length > 0 ? list : Object.keys(KIND_META)
4505
+ }
4506
+
4377
4507
  const applyPayload = (value) => {
4378
4508
  if (!value || typeof value !== 'object') return
4379
4509
  setData(value)
4380
- const next = Array.isArray(value.override)
4381
- ? value.override
4382
- : Array.isArray(value.effective) ? value.effective : []
4383
- setSelected([...next])
4510
+ const config = value.override || value.effective || (Array.isArray(value.defaults) && value.defaults.length > 0
4511
+ ? { level: 'normal', scopes: value.defaults.map((scope) => ({ scope })) }
4512
+ : null)
4513
+ const selected = config && Array.isArray(config.scopes) ? config.scopes.filter((rule) => rule && typeof rule.scope === 'string') : []
4514
+ setLevel(config && (config.level === 'absolute' || config.level === 'none') ? config.level : 'normal')
4515
+ const kindsAll = allKindsOf(value)
4516
+ const scopes = []
4517
+ const catalog = Array.isArray(value.scopes) ? value.scopes : []
4518
+ for (const item of catalog) {
4519
+ if (item && typeof item.scope === 'string' && !scopes.includes(item.scope)) scopes.push(item.scope)
4520
+ }
4521
+ for (const rule of selected) {
4522
+ if (!scopes.includes(rule.scope)) scopes.push(rule.scope)
4523
+ }
4524
+ const next = {}
4525
+ for (const scope of scopes) {
4526
+ const rule = selected.find((item) => item.scope === scope)
4527
+ const kinds = rule && Array.isArray(rule.kinds) && rule.kinds.length > 0 ? rule.kinds.filter((kind) => kindsAll.includes(kind)) : [...kindsAll]
4528
+ next[scope] = { enabled: rule !== undefined, kinds }
4529
+ }
4530
+ setEntries(next)
4384
4531
  }
4385
4532
 
4386
4533
  const load = () => {
@@ -4402,18 +4549,60 @@ window.__ModuleLoader__.load({
4402
4549
  if (rect) nextAnchor = { left: rect.left, top: rect.top }
4403
4550
  } catch { nextAnchor = null }
4404
4551
  setAnchor(nextAnchor)
4552
+ setSearch('')
4405
4553
  setOpen(true)
4406
4554
  load()
4407
4555
  }
4408
4556
 
4409
4557
  const toggleScope = (scope) => {
4410
- setSelected((prev) => prev.includes(scope) ? prev.filter((item) => item !== scope) : [...prev, scope])
4558
+ const kindsAll = allKindsOf(data)
4559
+ setEntries((prev) => {
4560
+ const current = prev[scope]
4561
+ return { ...prev, [scope]: { enabled: !(current && current.enabled), kinds: current && current.kinds.length > 0 ? current.kinds : [...kindsAll] } }
4562
+ })
4563
+ }
4564
+
4565
+ const toggleKind = (scope, kind) => {
4566
+ setEntries((prev) => {
4567
+ const current = prev[scope]
4568
+ if (!current) return prev
4569
+ const has = current.kinds.includes(kind)
4570
+ if (has && current.kinds.length === 1) return prev // 至少保留一种类型;全部用「全部」按钮
4571
+ const kinds = has ? current.kinds.filter((item) => item !== kind) : [...current.kinds, kind]
4572
+ return { ...prev, [scope]: { ...current, kinds } }
4573
+ })
4574
+ }
4575
+
4576
+ const setAllKinds = (scope) => {
4577
+ const kindsAll = allKindsOf(data)
4578
+ setEntries((prev) => {
4579
+ const current = prev[scope]
4580
+ if (!current) return prev
4581
+ return { ...prev, [scope]: { ...current, kinds: [...kindsAll] } }
4582
+ })
4583
+ }
4584
+
4585
+ const selectAll = () => {
4586
+ const kindsAll = allKindsOf(data)
4587
+ setEntries((prev) => {
4588
+ const next = { ...prev }
4589
+ for (const scope of Object.keys(next)) next[scope] = { enabled: true, kinds: next[scope].kinds.length > 0 ? next[scope].kinds : [...kindsAll] }
4590
+ return next
4591
+ })
4592
+ }
4593
+
4594
+ const clearAll = () => {
4595
+ setEntries((prev) => {
4596
+ const next = { ...prev }
4597
+ for (const scope of Object.keys(next)) next[scope] = { ...next[scope], enabled: false }
4598
+ return next
4599
+ })
4411
4600
  }
4412
4601
 
4413
- const save = (scopes) => {
4602
+ const save = (config) => {
4414
4603
  setBusy(true)
4415
4604
  setError('')
4416
- api('visibility', { session: sessionId, scopes })
4605
+ api('visibility', { session: sessionId, visibility: config })
4417
4606
  .then((value) => {
4418
4607
  applyPayload(value)
4419
4608
  setOpen(false)
@@ -4422,12 +4611,28 @@ window.__ModuleLoader__.load({
4422
4611
  .finally(() => setBusy(false))
4423
4612
  }
4424
4613
 
4614
+ const saveDraft = () => {
4615
+ const scopes = Object.entries(entries)
4616
+ .filter(([, entry]) => entry && entry.enabled)
4617
+ .map(([scope, entry]) => ({ scope, kinds: [...entry.kinds] }))
4618
+ if (scopes.length === 0) { setError('至少选择一个可见范围'); return }
4619
+ save({ scopes, level })
4620
+ }
4621
+
4425
4622
  const scopes = data && Array.isArray(data.scopes) ? data.scopes : []
4426
- const hasOverride = Boolean(data && Array.isArray(data.override))
4427
- const count = selected.length
4623
+ const override = data && data.override && Array.isArray(data.override.scopes) ? data.override : null
4624
+ const hasOverride = override !== null
4625
+ const overrideCount = hasOverride ? override.scopes.length : 0
4626
+ const selectedCount = Object.values(entries).filter((entry) => entry && entry.enabled).length
4627
+ const kindsAll = allKindsOf(data)
4628
+ const needle = search.trim().toLowerCase()
4629
+ const visibleScopes = scopes.filter((item) => {
4630
+ if (!needle) return true
4631
+ return String(item.label || item.scope).toLowerCase().includes(needle) || String(item.scope).toLowerCase().includes(needle)
4632
+ })
4428
4633
  let popStyle = {}
4429
4634
  if (anchor) {
4430
- const width = 300
4635
+ const width = 360
4431
4636
  const margin = 8
4432
4637
  const viewportW = (typeof window !== 'undefined' && Number(window.innerWidth)) || 1024
4433
4638
  const viewportH = (typeof window !== 'undefined' && Number(window.innerHeight)) || 768
@@ -4437,60 +4642,310 @@ window.__ModuleLoader__.load({
4437
4642
  }
4438
4643
  }
4439
4644
 
4645
+ const levelMeta = [
4646
+ { value: 'absolute', label: '绝对限制', hint: '范围外一律查不到' },
4647
+ { value: 'normal', label: '普通限制', hint: '范围外需审批' },
4648
+ { value: 'none', label: '无限制', hint: '不限制读取' },
4649
+ ]
4650
+
4440
4651
  return h('span', { className: 'mem-scope-wrap', ref: wrapRef },
4441
4652
  h('button', {
4442
4653
  type: 'button',
4443
4654
  className: `mem-scope-btn${hasOverride ? ' on' : ''}`,
4444
- title: '记忆可见范围(本会话及子 Agent)',
4445
- 'aria-label': '记忆可见范围',
4655
+ title: '记忆可见域(本会话及子 Agent)',
4656
+ 'aria-label': '记忆可见域',
4446
4657
  'aria-expanded': open,
4447
4658
  onMouseDown: (event) => { try { event.preventDefault() } catch { /* keepFocus */ } },
4448
4659
  onClick: toggle,
4449
4660
  },
4450
4661
  h(NavLineIcon, { size: 14 }),
4451
- h('span', null, count > 0 ? `记忆 ${count}` : '记忆范围'),
4662
+ h('span', null, hasOverride ? `记忆可见域 ${overrideCount}` : '记忆范围'),
4452
4663
  ),
4453
- open ? h('div', { className: 'mem-scope-pop', style: popStyle, role: 'dialog', 'aria-label': '记忆可见范围' },
4454
- h('h4', null, '记忆可见范围'),
4664
+ open ? h('div', { className: 'mem-scope-pop', style: popStyle, role: 'dialog', 'aria-label': '记忆可见域' },
4665
+ h('div', { className: 'mem-scope-head' },
4666
+ h('h4', null, '记忆可见域'),
4667
+ h('span', { className: 'spacer' }),
4668
+ h('span', { className: 'mem-scope-count' }, `已选 ${selectedCount}`),
4669
+ ),
4455
4670
  h('div', { className: 'hint' },
4456
- '本会话的 Agent 及其子 Agent 只能检索和读取勾选的范围;未勾选的范围不会被注入。'),
4671
+ 'Agent 默认只能检索和读取勾选的作用域与类型;限制等级决定范围外怎么处理。'),
4457
4672
  data && data.inherited
4458
4673
  ? h('div', { className: 'hint' }, '当前继承自父会话;保存后在本会话独立生效。')
4459
4674
  : null,
4675
+ h('div', { className: 'mem-scope-level', role: 'radiogroup', 'aria-label': '限制等级' },
4676
+ levelMeta.map((item) => h('button', {
4677
+ key: item.value,
4678
+ type: 'button',
4679
+ role: 'radio',
4680
+ 'aria-checked': level === item.value,
4681
+ className: `mem-scope-level-btn${level === item.value ? ' on' : ''}`,
4682
+ onClick: () => setLevel(item.value),
4683
+ title: item.hint,
4684
+ }, h('b', null, item.label), h('span', null, item.hint))),
4685
+ ),
4686
+ level === 'none'
4687
+ ? h('div', { className: 'mem-scope-note' }, '无限制:范围选择会保存,但暂不参与读取限制。')
4688
+ : null,
4689
+ h('div', { className: 'mem-scope-search' },
4690
+ h('input', {
4691
+ type: 'search',
4692
+ placeholder: '搜索作用域…',
4693
+ value: search,
4694
+ 'aria-label': '搜索作用域',
4695
+ onChange: (event) => setSearch(event.target.value),
4696
+ }),
4697
+ h('button', { type: 'button', className: 'linkbtn', onClick: selectAll }, '全选'),
4698
+ h('button', { type: 'button', className: 'linkbtn', onClick: clearAll }, '取消全选'),
4699
+ ),
4460
4700
  loading
4461
4701
  ? h('div', { className: 'hint' }, '读取中…')
4462
4702
  : h('div', { className: 'mem-scope-list' },
4463
- scopes.length === 0
4464
- ? h('div', { className: 'hint' }, '还没有可选的范围。')
4465
- : scopes.map((item) => h('label', { className: 'mem-scope-item', key: item.scope },
4466
- h('input', {
4467
- type: 'checkbox',
4468
- checked: selected.includes(item.scope),
4469
- onChange: () => toggleScope(item.scope),
4470
- }),
4471
- h('span', { className: 'lab', title: item.scope }, item.label || item.scope),
4472
- h('span', { className: 'cnt' }, `${item.records ?? 0}`),
4473
- )),
4703
+ visibleScopes.length === 0
4704
+ ? h('div', { className: 'hint' }, needle ? '没有匹配的作用域。' : '还没有可选的范围。')
4705
+ : visibleScopes.map((item) => {
4706
+ const entry = entries[item.scope] || { enabled: false, kinds: [...kindsAll] }
4707
+ const kindCounts = new Map()
4708
+ for (const kind of Array.isArray(item.kinds) ? item.kinds : []) {
4709
+ if (kind && typeof kind.kind === 'string') kindCounts.set(kind.kind, Number(kind.records) || 0)
4710
+ }
4711
+ return h('div', { className: `mem-scope-item${entry.enabled ? ' on' : ''}`, key: item.scope },
4712
+ h('div', { className: 'mem-scope-row' },
4713
+ h('button', {
4714
+ type: 'button',
4715
+ role: 'checkbox',
4716
+ 'aria-checked': entry.enabled,
4717
+ className: `mem-scope-check${entry.enabled ? ' on' : ''}`,
4718
+ onClick: () => toggleScope(item.scope),
4719
+ 'aria-label': entry.enabled ? '取消选择' : '选择',
4720
+ }, h('span', { className: 'box' }, entry.enabled ? h('svg', { width: 11, height: 11, viewBox: '0 0 12 12', 'aria-hidden': 'true' }, h('path', { d: 'M2 6.2 4.7 9 10 3.4', fill: 'none', stroke: 'currentColor', strokeWidth: 1.8, strokeLinecap: 'round', strokeLinejoin: 'round' })) : null)),
4721
+ h('button', {
4722
+ type: 'button',
4723
+ className: 'mem-scope-label',
4724
+ title: item.scope,
4725
+ onClick: () => toggleScope(item.scope),
4726
+ }, item.label || item.scope),
4727
+ h('span', { className: 'cnt' }, `${item.records ?? 0}`),
4728
+ ),
4729
+ entry.enabled
4730
+ ? h('div', { className: 'mem-kind-row' },
4731
+ h('button', {
4732
+ type: 'button',
4733
+ className: `mem-kind-chip${entry.kinds.length >= kindsAll.length ? ' on' : ''}`,
4734
+ onClick: () => setAllKinds(item.scope),
4735
+ title: '允许该作用域下所有类型',
4736
+ }, '全部'),
4737
+ kindsAll.map((kind) => {
4738
+ const on = entry.kinds.includes(kind)
4739
+ const label = kindMeta(kind).label
4740
+ const count = kindCounts.get(kind)
4741
+ return h('button', {
4742
+ key: kind,
4743
+ type: 'button',
4744
+ className: `mem-kind-chip${on ? ' on' : ''}`,
4745
+ 'aria-pressed': on,
4746
+ onClick: () => toggleKind(item.scope, kind),
4747
+ title: `${label}${count === undefined ? '' : ` · ${count} 条`}`,
4748
+ }, label, count === undefined ? null : h('i', null, count))
4749
+ }),
4750
+ )
4751
+ : null,
4752
+ )
4753
+ }),
4474
4754
  ),
4475
4755
  error ? h('div', { className: 'mem-scope-err' }, error) : null,
4476
4756
  h('div', { className: 'mem-scope-foot' },
4477
4757
  h('button', {
4478
4758
  type: 'button',
4479
- className: 'linkbtn',
4759
+ className: 'mem-scope-reset',
4480
4760
  disabled: busy || !data || data.override === null,
4481
4761
  onClick: () => save(null),
4482
4762
  }, '恢复默认'),
4483
4763
  h('span', { className: 'spacer' }),
4484
4764
  h('button', {
4485
4765
  type: 'button',
4486
- className: 'primary',
4487
- disabled: busy || selected.length === 0,
4488
- onClick: () => save(selected),
4766
+ className: 'mem-scope-save',
4767
+ disabled: busy || selectedCount === 0,
4768
+ onClick: saveDraft,
4489
4769
  }, busy ? '保存中…' : '保存'),
4490
4770
  ),
4491
4771
  ) : null,
4492
4772
  )
4493
4773
  }
4774
+ /**
4775
+ * 普通限制下的「范围外记忆访问审批」浮层。
4776
+ *
4777
+ * 工具在 memory_search / memory_get / memory_list 命中可见域外的记录时会在
4778
+ * provider 里挂起一个 Promise,这里轮询 /memory/api/approvals 把它显示给用户。
4779
+ * 用户点「拒绝 / 允许一次」→ POST /memory/api/approvals → 工具拿到结果继续。
4780
+ *
4781
+ * 视觉沿用审计详情里的 hover 浮窗(.audit-tip / .audit-id / .audit-pill):
4782
+ * 把根节点标成 .memp,这些样式就会按同一套 token 生效。
4783
+ */
4784
+ function MemoryApprovalOverlay() {
4785
+ const [approvals, setApprovals] = React.useState([])
4786
+ const [busy, setBusy] = React.useState('')
4787
+ const [error, setError] = React.useState('')
4788
+ const [tip, setTip] = React.useState(null)
4789
+ const tipTimer = React.useRef(null)
4790
+ const hideTimer = React.useRef(null)
4791
+ const activeRef = React.useRef(true)
4792
+
4793
+ const clearTimers = () => {
4794
+ if (tipTimer.current !== null) { clearTimeout(tipTimer.current); tipTimer.current = null }
4795
+ if (hideTimer.current !== null) { clearTimeout(hideTimer.current); hideTimer.current = null }
4796
+ }
4797
+
4798
+ React.useEffect(() => {
4799
+ activeRef.current = true
4800
+ return () => {
4801
+ activeRef.current = false
4802
+ clearTimers()
4803
+ }
4804
+ }, [])
4805
+
4806
+ const refresh = () => {
4807
+ api('approvals')
4808
+ .then((value) => {
4809
+ if (!activeRef.current) return
4810
+ setApprovals(Array.isArray(value.approvals) ? value.approvals : [])
4811
+ })
4812
+ .catch(() => { /* 轮询失败静默重试 */ })
4813
+ }
4814
+
4815
+ React.useEffect(() => {
4816
+ refresh()
4817
+ if (typeof setInterval !== 'function') return undefined
4818
+ const timer = setInterval(() => {
4819
+ if (typeof document !== 'undefined' && document.hidden) return
4820
+ refresh()
4821
+ }, 1500)
4822
+ return () => clearInterval(timer)
4823
+ }, [])
4824
+
4825
+ const answer = (id, outcome) => {
4826
+ setBusy(id)
4827
+ setError('')
4828
+ api('approvals', { id, outcome })
4829
+ .then(() => {
4830
+ setApprovals((prev) => prev.filter((item) => item.id !== id))
4831
+ hideTip()
4832
+ })
4833
+ .catch((e) => setError(String((e && e.message) || e)))
4834
+ .finally(() => setBusy(''))
4835
+ }
4836
+
4837
+ const hideTip = () => { clearTimers(); setTip(null) }
4838
+ const cancelHideTip = () => {
4839
+ if (hideTimer.current !== null) { clearTimeout(hideTimer.current); hideTimer.current = null }
4840
+ }
4841
+ const scheduleHideTip = () => {
4842
+ if (tipTimer.current !== null) { clearTimeout(tipTimer.current); tipTimer.current = null }
4843
+ cancelHideTip()
4844
+ hideTimer.current = setTimeout(() => { hideTimer.current = null; setTip(null) }, 220)
4845
+ }
4846
+ const positionFor = (element) => {
4847
+ const width = typeof window !== 'undefined' ? window.innerWidth : 1200
4848
+ const height = typeof window !== 'undefined' ? window.innerHeight : 800
4849
+ const rect = element && typeof element.getBoundingClientRect === 'function' ? element.getBoundingClientRect() : null
4850
+ if (rect === null) return { x: 12, y: 12 }
4851
+ const tipWidth = Math.min(380, width - 24)
4852
+ const tipHeight = 260
4853
+ const x = Math.max(12, Math.min(rect.left, width - tipWidth - 12))
4854
+ let y = rect.bottom + 8
4855
+ if (y + tipHeight > height - 12) y = Math.max(12, rect.top - tipHeight - 8)
4856
+ return { x, y }
4857
+ }
4858
+ const fetchRecord = (id) => {
4859
+ api(`records?id=${encodeURIComponent(id)}`)
4860
+ .then((value) => {
4861
+ const record = Array.isArray(value.records) ? value.records[0] : undefined
4862
+ if (!record || !activeRef.current) return
4863
+ setTip((prev) => prev !== null && prev.item && prev.item.id === id
4864
+ ? { ...prev, item: { ...prev.item, content: record.content, tags: Array.isArray(record.tags) ? record.tags : prev.item.tags, scope: record.scope, kind: record.kind, importance: record.importance } }
4865
+ : prev)
4866
+ })
4867
+ .catch(() => { /* 悬浮详情是增强,失败就展示轮询里的摘要 */ })
4868
+ }
4869
+ const showTip = (item, element) => {
4870
+ clearTimers()
4871
+ tipTimer.current = setTimeout(() => {
4872
+ tipTimer.current = null
4873
+ setTip({ item, ...positionFor(element) })
4874
+ fetchRecord(item.id)
4875
+ }, 350)
4876
+ }
4877
+
4878
+ const pending = approvals.length > 0 ? approvals[0] : null
4879
+ const tipNode = tip === null ? null : (() => {
4880
+ const item = tip.item || {}
4881
+ return h('div', { className: 'audit-tip', style: { left: tip.x, top: tip.y }, onMouseEnter: cancelHideTip, onMouseLeave: hideTip, onClick: () => openMemoryRecordPanel(item.id, item.scope, item) },
4882
+ h('div', { className: 'audit-tip-head' }, h('span', null, '记忆'), h('span', { className: 'audit-tip-title' }, item.id || '未知')),
4883
+ h('div', { className: 'audit-tip-meta' },
4884
+ auditPill(item.kind ? kindMeta(item.kind).label : '未知', 'mute'),
4885
+ auditPill(item.scope || '', 'mute'),
4886
+ auditPill(`重要度 ${Number(item.importance ?? 0).toFixed(2)}`, 'mute'),
4887
+ ),
4888
+ item.tags && item.tags.length > 0
4889
+ ? h('div', { className: 'audit-flat' }, item.tags.map((tag) => h('span', { className: 'tag', key: tag }, tag)))
4890
+ : null,
4891
+ h('div', { className: 'audit-tip-content' }, String(item.content || '')),
4892
+ h('div', { className: 'audit-tip-foot' }, '点击跳转到「记录」页并展开'),
4893
+ )
4894
+ })()
4895
+
4896
+ if (pending === null) return null
4897
+
4898
+ return h('div', { className: 'memp mem-approval' },
4899
+ h('div', { className: 'mem-approval-card', role: 'dialog', 'aria-label': '记忆访问审批' },
4900
+ h('div', { className: 'mem-approval-head' },
4901
+ h('span', { className: 'mem-approval-dot' }),
4902
+ h('b', null, '记忆访问审批'),
4903
+ h('span', { className: 'muted' }, pending.tool || 'memory'),
4904
+ h('span', { className: 'spacer' }),
4905
+ approvals.length > 1 ? h('span', { className: 'muted' }, `还有 ${approvals.length - 1} 个待审批`) : null,
4906
+ ),
4907
+ h('div', { className: 'mem-approval-query' }, `Agent 查询:${pending.query || '(未提供)'}`),
4908
+ h('div', { className: 'hint' }, '以下记忆不在本会话的可见域内。允许一次只对本次调用生效,拒绝则工具拿不到这些内容。'),
4909
+ h('div', { className: 'mem-approval-list' },
4910
+ pending.items.map((item) => h('div', { className: 'mem-approval-item', key: item.id },
4911
+ h('div', { className: 'mem-approval-row' },
4912
+ h('button', {
4913
+ type: 'button',
4914
+ className: 'audit-id',
4915
+ 'aria-label': item.id,
4916
+ onMouseEnter: (event) => showTip(item, event.currentTarget),
4917
+ onMouseLeave: scheduleHideTip,
4918
+ onClick: () => openMemoryRecordPanel(item.id, item.scope, item),
4919
+ }, String(item.id).length > 12 ? `${item.id.slice(0, 8)}…${item.id.slice(-4)}` : item.id),
4920
+ h('span', { className: 'audit-pill mute' }, item.scope),
4921
+ h('span', { className: 'audit-pill mute' }, item.kind ? kindMeta(item.kind).label : '未知'),
4922
+ item.reason === 'kind'
4923
+ ? h('span', { className: 'audit-pill warn' }, '类型受限')
4924
+ : h('span', { className: 'audit-pill warn' }, '范围外'),
4925
+ ),
4926
+ h('div', { className: 'mem-approval-summary' }, String(item.content || '').replace(/\s+/g, ' ').slice(0, 180)),
4927
+ )),
4928
+ ),
4929
+ error ? h('div', { className: 'mem-scope-err' }, error) : null,
4930
+ h('div', { className: 'mem-approval-foot' },
4931
+ h('button', {
4932
+ type: 'button',
4933
+ className: 'mem-scope-reset',
4934
+ disabled: busy === pending.id,
4935
+ onClick: () => answer(pending.id, 'rejected'),
4936
+ }, '拒绝'),
4937
+ h('span', { className: 'spacer' }),
4938
+ h('button', {
4939
+ type: 'button',
4940
+ className: 'mem-scope-save',
4941
+ disabled: busy === pending.id,
4942
+ onClick: () => answer(pending.id, 'allowed-once'),
4943
+ }, busy === pending.id ? '处理中…' : '允许一次'),
4944
+ ),
4945
+ ),
4946
+ tipNode,
4947
+ )
4948
+ }
4494
4949
 
4495
4950
  function apply(ctx) {
4496
4951
  try {
@@ -4602,7 +5057,7 @@ window.__ModuleLoader__.load({
4602
5057
  name: 'conversation.input.right',
4603
5058
  id: 'memory-visibility',
4604
5059
  order: 30,
4605
- label: () => '记忆范围',
5060
+ label: () => '记忆可见域',
4606
5061
  }, MemoryVisibilityButton))
4607
5062
  } catch (error) {
4608
5063
  console.warn('[dsh-memory] 记忆可见范围按钮注册失败:', error?.message)
@@ -4634,6 +5089,16 @@ window.__ModuleLoader__.load({
4634
5089
  } catch (error) {
4635
5090
  console.warn('[dsh-memory] 轨迹详情记忆页签注册失败:', error?.message)
4636
5091
  }
5092
+ // 普通限制下的范围外访问审批浮层:全局 fixed,自己轮询待审批。
5093
+ try {
5094
+ slots.inject('shell.overlay', () => slots.register({
5095
+ name: 'shell.overlay',
5096
+ id: 'memory-access-approval',
5097
+ order: 62,
5098
+ }, () => React.createElement(MemoryApprovalOverlay)))
5099
+ } catch (error) {
5100
+ console.warn('[dsh-memory] 记忆访问审批浮层注册失败:', error?.message)
5101
+ }
4637
5102
  } catch (error) {
4638
5103
  console.error('[dsh-memory] client apply 失败(已吞掉):', error?.message)
4639
5104
  }
@@ -4752,6 +5217,10 @@ window.__ModuleLoader__.load({
4752
5217
  SettingsTab: SettingsTab,
4753
5218
  AuditTab: AuditTab,
4754
5219
  MemoryVisibilityButton: MemoryVisibilityButton,
5220
+ MemoryApprovalOverlay: MemoryApprovalOverlay,
5221
+ openMemoryRecordPanel: openMemoryRecordPanel,
5222
+ requestRecordFocus: requestRecordFocus,
5223
+ takeRecordFocus: takeRecordFocus,
4755
5224
  buildMemoryTree: buildMemoryTree,
4756
5225
  KIND_META: KIND_META,
4757
5226
  CSS: CSS,