dsh-aurorix-agentbook 1.7.0 → 1.7.2

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 (2) hide show
  1. package/lib/web.js +5 -2
  2. package/package.json +2 -3
package/lib/web.js CHANGED
@@ -186,7 +186,8 @@ const ORDER = ['soul','rules','profile','explicit','long_term','episodic'];
186
186
  const $ = (id) => document.getElementById(id);
187
187
  const esc = (v) => String(v == null ? '' : v).replace(/[&<>"]/g, (c) => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;'}[c]));
188
188
  const fmtTotal = (n) => ${JSON.stringify(zh ? '共 ' : '')} + n + ${JSON.stringify(zh ? ' 条' : ' records')};
189
- const fmtHits = (n, tot) => ${JSON.stringify(zh ? '命中 ' : '')} + n + ${JSON.stringify(zh ? ' 条(共 ' : ' hits (of ')} + tot + ${JSON.stringify(zh ? ' 条)' : ')')};
189
+ const fmtHits = (n, tot, loose) => ${JSON.stringify(zh ? '命中 ' : '')} + n + ${JSON.stringify(zh ? ' 条(共 ' : ' hits (of ')} + tot + ${JSON.stringify(zh ? ' 条)' : ')')}
190
+ + (loose ? ${JSON.stringify(zh ? ';整句太严,已放宽成任一词匹配' : '; all-word match was too strict, so any word counts')} : '');
190
191
  const fmtVault = (shown, total) => ${JSON.stringify(zh ? '共 ' : '')} + total + ${JSON.stringify(zh ? ' 条,显示 ' : ' total, ')} + shown + ${JSON.stringify(zh ? ' 条' : ' shown')};
191
192
 
192
193
  let D = null, EDITING = false, VAULT_ALL = [], searchEpoch = 0, detailEpoch = 0, vaultReady = false;
@@ -328,7 +329,7 @@ $('go').onclick = async () => {
328
329
  const hits = Array.isArray(s.hits) ? s.hits : [];
329
330
  if (q === '') { renderMemoryList($('results'), hits, s.listError ? T.fail + s.listError : T.none, (row) => openDetail(row, 'memory')); return; }
330
331
  $('results').innerHTML = hits.length === 0 ? '<div class="hint">' + esc(T.noHit) + '</div>'
331
- : '<div class="hint">' + fmtHits(hits.length, s.searchTotal ?? s.total ?? 0) + '</div>' + hits.map((r, i) =>
332
+ : '<div class="hint">' + fmtHits(hits.length, s.searchTotal ?? s.total ?? 0, s.searchLoose === true) + '</div>' + hits.map((r, i) =>
332
333
  '<div class="item" data-i="' + i + '">' + DOC + '<div class="txt"><div class="t">' + esc(r.title || '') +
333
334
  '</div><div class="m">' + esc((r.plane || '') + ' · ' + String(r.preview || '').slice(0, 90)) + '</div></div><div class="chev">›</div></div>').join('');
334
335
  [...$('results').querySelectorAll('.item')].forEach((n) => { n.onclick = () => openDetail(hits[Number(n.dataset.i)], 'memory'); });
@@ -595,6 +596,8 @@ export function createWebHandler({ backend, connection }) {
595
596
  hasCredentialPlane: context.ok && context.hasCredentialPlane === true,
596
597
  statsError: context.ok ? undefined : context.reason,
597
598
  searchTotal: result.total ?? result.items.length,
599
+ // 这一轮补过 OR 兜底时告诉页面,让用户知道命中数为什么变多。
600
+ searchLoose: result.loose === true,
598
601
  hits: (result.items ?? []).map((x) => ({ id: x.id, title: x.title, plane: x.plane, preview: x.preview ?? '' })),
599
602
  })
600
603
  return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-aurorix-agentbook",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "dsh-aurorix-agentbook:给 dsh-go 接通 Aurorix 记忆库——原生界面(状态条/胶囊/菜单/面板/保险箱)加宿主侧提示词注入、分层快照与四个工具。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -62,8 +62,7 @@
62
62
  "icon": "book",
63
63
  "placement": [
64
64
  "session.tab",
65
- "features",
66
- "chat.panel"
65
+ "features"
67
66
  ],
68
67
  "presentation": "sheet"
69
68
  }