@a9i5k4/dsh-auto-memory 0.1.21 → 0.1.23

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/client.js +61 -13
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -115,7 +115,7 @@ window.__ModuleLoader__.load({
115
115
  kvAvail: '可用', kvUnavail: '不可用', kvDup: '项目笔记重复标题', kvDupCount: ' 个',
116
116
  kvMem: '记忆文件', kvMemUser: '用户', kvMemNotes: '笔记', kvMemLog: '日志', kvMemMissing: '缺失',
117
117
  kvWs: '当前工作区', kvWsUnknown: '(未取到)', kvApi: 'API 连通', unknown: '(未知)',
118
- guideTitle: '欢迎使用 dsh-auto-memory(开发版)', guideSub: '这个插件能干什么:',
118
+ guideTitle: '欢迎使用 dsh-auto-memory', guideSub: '这个插件能干什么:',
119
119
  gFeat1: '三层记忆自动注入与检索:用户级 / 项目笔记 / 每日日志,每轮对话自动读、自动写',
120
120
  gFeat2: '每轮对话结束自动沉淀:修了什么 bug、做了哪些决策,自动按主题写进今日日志',
121
121
  gFeat3: 'AI 时段问候与三级抽屉:打开「记忆」面板,AI 按时段向你汇报当天进展',
@@ -209,7 +209,7 @@ window.__ModuleLoader__.load({
209
209
  kvAvail: 'available', kvUnavail: 'unavailable', kvDup: 'Duplicate note headings', kvDupCount: '',
210
210
  kvMem: 'Memory files', kvMemUser: 'user', kvMemNotes: 'notes', kvMemLog: 'log', kvMemMissing: 'missing',
211
211
  kvWs: 'Current workspace', kvWsUnknown: '(unknown)', kvApi: 'API probes', unknown: '(unknown)',
212
- guideTitle: 'Welcome to dsh-auto-memory (dev)', guideSub: 'What this plugin does:',
212
+ guideTitle: 'Welcome to dsh-auto-memory', guideSub: 'What this plugin does:',
213
213
  gFeat1: 'Three-layer memory with automatic injection & retrieval: user / project notes / daily logs',
214
214
  gFeat2: 'Auto-consolidation after every turn: bugs fixed and decisions made are written into today\'s log automatically',
215
215
  gFeat3: 'AI period greetings with three-level drawers: open the Memory panel for a period-by-period digest',
@@ -324,6 +324,18 @@ window.__ModuleLoader__.load({
324
324
 
325
325
  // ───────────────────────── 更新弹窗 / 首次指导 ─────────────────────────
326
326
  var CHANGELOG = {
327
+ '0.1.23': { zh: [
328
+ '修复:正式发布包首次欢迎文案仍显示“开发版”;发布转换与残留校验已加强,确保开发版和正式版身份完全隔离。',
329
+ ], en: [
330
+ 'Fix: the published first-run guide still showed a dev label; release conversion and residual checks now enforce complete dev/release identity isolation.',
331
+ ] },
332
+ '0.1.22': { zh: [
333
+ '修复:更新说明可能被公告、欢迎或自动总结弹窗覆盖,导致升级后没有看到 changelog。',
334
+ '优化:更新说明现在优先展示并排队其他弹窗,只有点击“知道了”后才标记为已读;未确认时重启仍会再次显示。',
335
+ ], en: [
336
+ 'Fix: the update changelog could be replaced by notice, welcome, or summary dialogs during startup.',
337
+ 'Polish: update notes now take priority and queue other dialogs; the version is marked seen only after acknowledgement, so it appears again after restart when unconfirmed.',
338
+ ] },
327
339
  '0.1.21': { zh: [
328
340
  '上下文与缓存:动态记忆改为运行时快照,静态规则保持稳定;切换模型、跨天和记忆刷新不再反复击穿前缀缓存。',
329
341
  '记忆系统:三层记忆、普通检索与多关键词 recall、自动沉淀已完成运行时验证,写入、读取和检索链路稳定。',
@@ -393,9 +405,35 @@ window.__ModuleLoader__.load({
393
405
  '0.1.10': { zh: ['自动检查更新 + 设置页一键更新', '日界:凌晨的活儿归前一天(默认 7:30)', '记忆根目录系统文件夹选择器,换位置自动迁移', '每日写入预算,超限自动压缩旧内容', '30 天 AI 蒸馏'], en: ['Auto update check + one-click update in settings', 'Day boundary: late-night work logs to yesterday (default 07:30)', 'Native OS folder picker for memory root, auto-migration', 'Daily write budget with auto-compaction', '30-day AI distillation'] },
394
406
  }
395
407
  var dialogListeners = new Set()
396
- var dialogState = null // {kind:'update', versions:[...]} | {kind:'first'}
397
- function openDialog(d) { dialogState = d; dialogListeners.forEach(function (fn) { try { fn() } catch (e) {} }) }
398
- function closeDialog() { dialogState = null; dialogListeners.forEach(function (fn) { try { fn() } catch (e) {} }) }
408
+ var dialogState = null // 当前展示的弹窗
409
+ var dialogQueue = [] // 启动期多个异步弹窗按优先级排队,不相互覆盖
410
+ function dialogPriority(d) {
411
+ if (!d) return 0
412
+ if (d.kind === 'update') return 100
413
+ if (d.kind === 'first') return 90
414
+ if (d.kind === 'notice') return d.notice && d.notice.level === 'urgent' ? 80 : 70
415
+ if (d.kind === 'summary') return 60
416
+ if (d.kind === 'welcomeBack') return 50
417
+ return 10
418
+ }
419
+ function dialogKey(d) {
420
+ if (!d) return ''
421
+ if (d.kind === 'update') return 'update:' + (d.currentVersion || '')
422
+ if (d.kind === 'notice') return 'notice:' + ((d.notice && d.notice.id) || '')
423
+ if (d.kind === 'summary') return 'summary:' + ((d.summary && d.summary.date) || '') + ':' + ((d.summary && d.summary.time) || '')
424
+ return d.kind
425
+ }
426
+ function notifyDialog() { dialogListeners.forEach(function (fn) { try { fn() } catch (e) {} }) }
427
+ function openDialog(d) {
428
+ if (!d) return
429
+ var key = dialogKey(d)
430
+ if ((dialogState && dialogKey(dialogState) === key) || dialogQueue.some(function (x) { return dialogKey(x) === key })) return
431
+ if (!dialogState) dialogState = d
432
+ else if (dialogPriority(d) > dialogPriority(dialogState)) { dialogQueue.unshift(dialogState); dialogState = d }
433
+ else dialogQueue.push(d)
434
+ notifyDialog()
435
+ }
436
+ function closeDialog() { dialogState = dialogQueue.shift() || null; notifyDialog() }
399
437
  function onDialog(fn) { dialogListeners.add(fn); return function () { dialogListeners.delete(fn) } }
400
438
  function cmpVersion(a, b) {
401
439
  var pa = String(a).split('.').map(Number), pb = String(b).split('.').map(Number)
@@ -1359,7 +1397,13 @@ window.__ModuleLoader__.load({
1359
1397
  h('div', { style: sub }, t('guideSub')),
1360
1398
  feats.map(function (f) { return h('div', { style: item }, h('span', { style: dot }), f) }),
1361
1399
  h('div', { style: { fontSize: 'calc(12px * var(--dam-scale))', opacity: .8, marginTop: '4px' } }, t('guideTip')),
1362
- h('button', { 'data-dam-btn': '', style: close, onClick: closeDialog }, t('gotIt'))))
1400
+ h('button', { 'data-dam-btn': '', style: close, onClick: function () {
1401
+ try {
1402
+ localStorage.setItem('dsh-auto-memory.firstRunDone', '1')
1403
+ if (dialogState && dialogState.currentVersion) localStorage.setItem('dsh-auto-memory.seenVersion', dialogState.currentVersion)
1404
+ } catch (e3) {}
1405
+ closeDialog()
1406
+ } }, t('gotIt'))))
1363
1407
  }
1364
1408
  if (dialogState.kind === 'notice') {
1365
1409
  var n = dialogState.notice || {}
@@ -1416,7 +1460,10 @@ window.__ModuleLoader__.load({
1416
1460
  h('div', { style: { fontSize: 'calc(13px * var(--dam-scale))', fontWeight: 700, margin: '6px 0 2px', opacity: .9 } }, 'v' + v.version),
1417
1461
  items.map(function (it) { return h('div', { style: item }, h('span', { style: dot }), it) }))
1418
1462
  }),
1419
- h('button', { 'data-dam-btn': '', style: close, onClick: closeDialog }, t('gotIt'))))
1463
+ h('button', { 'data-dam-btn': '', style: close, onClick: function () {
1464
+ try { if (lastV) localStorage.setItem('dsh-auto-memory.seenVersion', lastV) } catch (e3) {}
1465
+ closeDialog()
1466
+ } }, t('gotIt'))))
1420
1467
  }
1421
1468
 
1422
1469
  // ───────────────────────── 设置页 ─────────────────────────
@@ -1643,13 +1690,14 @@ window.__ModuleLoader__.load({
1643
1690
  try {
1644
1691
  var seen = localStorage.getItem('dsh-auto-memory.seenVersion')
1645
1692
  if (!seen && !localStorage.getItem('dsh-auto-memory.firstRunDone')) {
1646
- try { localStorage.setItem('dsh-auto-memory.firstRunDone', '1') } catch (e2) {}
1647
- openDialog({ kind: 'first' })
1693
+ openDialog({ kind: 'first', currentVersion: d.current })
1648
1694
  } else if (seen && seen !== d.current) {
1649
1695
  var versions = changelogBetween(seen, d.current)
1650
- if (versions.length) openDialog({ kind: 'update', versions: versions })
1696
+ if (versions.length) openDialog({ kind: 'update', versions: versions, currentVersion: d.current })
1697
+ else try { localStorage.setItem('dsh-auto-memory.seenVersion', d.current) } catch (e3) {}
1698
+ } else if (!seen && localStorage.getItem('dsh-auto-memory.firstRunDone')) {
1699
+ try { localStorage.setItem('dsh-auto-memory.seenVersion', d.current) } catch (e3) {}
1651
1700
  }
1652
- try { localStorage.setItem('dsh-auto-memory.seenVersion', d.current) } catch (e3) {}
1653
1701
  } catch (e) {}
1654
1702
  }
1655
1703
  }).catch(function () {})
@@ -1703,7 +1751,7 @@ window.__ModuleLoader__.load({
1703
1751
  function registerSurfaces() {
1704
1752
  try {
1705
1753
  surfaceDisposers.push(slots.inject('sidebar.footer.action', function () {
1706
- return slots.register({ name: 'sidebar.footer.action', id: 'auto-memory', order: 5, label: t('memory') }, function () { return h(SidebarButton) })
1754
+ return slots.register({ name: 'sidebar.footer.action', id: 'auto-memory', order: 5, label: t('memory') + '' }, function () { return h(SidebarButton) })
1707
1755
  }))
1708
1756
  surfaceDisposers.push(slots.inject('shell.overlay', function () {
1709
1757
  return slots.register({ name: 'shell.overlay', id: 'auto-memory', order: 5 }, function () { return h(MemoryPanel) })
@@ -1712,7 +1760,7 @@ window.__ModuleLoader__.load({
1712
1760
  return slots.register({ name: 'shell.overlay', id: 'auto-memory-dialogs', order: 6 }, function () { return h(DialogHost) })
1713
1761
  }))
1714
1762
  surfaceDisposers.push(slots.inject('settings.section', function () {
1715
- return slots.register({ name: 'settings.section', id: 'auto-memory', order: 25, label: t('autoMemory') }, function (props) { return h(SettingsPage, { close: props && props.close }) })
1763
+ return slots.register({ name: 'settings.section', id: 'auto-memory', order: 25, label: t('autoMemory') + '' }, function (props) { return h(SettingsPage, { close: props && props.close }) })
1716
1764
  }))
1717
1765
  } catch (e) {
1718
1766
  console.warn('[dsh-auto-memory] slot registration failed', e)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@a9i5k4/dsh-auto-memory",
3
3
  "description": "DSH 自动记忆插件:三层记忆(用户级/项目笔记/每日日志)自动注入与检索、每轮对话自动沉淀、每日反思、可视化面板与设置页,支持继承其他 AI 工具的记忆。",
4
- "version": "0.1.21",
4
+ "version": "0.1.23",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {