@a9i5k4/dsh-auto-memory 0.1.37 → 0.1.38

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 +25 -84
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -191,14 +191,6 @@ window.__ModuleLoader__.load({
191
191
  kvAvail: '可用', kvUnavail: '不可用', kvDup: '项目笔记重复标题', kvDupCount: ' 个',
192
192
  kvMem: '记忆文件', kvMemUser: '用户', kvMemNotes: '笔记', kvMemLog: '日志', kvMemMissing: '缺失',
193
193
  kvWs: '当前工作区', kvWsUnknown: '(未取到)', kvApi: 'API 连通', unknown: '(未知)',
194
- guideTitle: '欢迎使用 dsh-auto-memory', guideSub: '这个插件能干什么:',
195
- gFeat1: '三层记忆自动注入与检索:用户级 / 项目笔记 / 每日日志,每轮对话自动读、自动写',
196
- gFeat2: '每轮对话结束自动沉淀:修了什么 bug、做了哪些决策,自动按主题写进今日日志',
197
- gFeat3: 'AI 时段问候与三级抽屉:打开「记忆」面板,AI 按时段向你汇报当天进展',
198
- gFeat4: '智能检索与日历:自然语言提问找记忆;AI 自动把 deadline 记进日历并提醒',
199
- gFeat5: '接续其他 AI 工具的记忆:CodeBuddy / Claude Code / Codex 等的历史记忆一键接入',
200
- gFeat6: '自动检查更新:启动时检测新版本,设置页可一键更新',
201
- guideTip: '打开侧边栏「记忆」按钮即可使用;所有记忆都是本地明文文件,可随时查看修改。',
202
194
  updateTitle: 'dsh-auto-memory 已更新', updateSub: '本次更新内容:', gotIt: '知道了', noticeOpen: '了解更多',
203
195
  refresh: '刷新', refreshing: '刷新中…', close: '关闭', dragMove: '拖动移动', dragResize: '拖动调整大小', resetPos: '恢复默认位置',
204
196
  generated: '已生成', failed: '失败: ',
@@ -330,14 +322,6 @@ window.__ModuleLoader__.load({
330
322
  kvAvail: 'available', kvUnavail: 'unavailable', kvDup: 'Duplicate note headings', kvDupCount: '',
331
323
  kvMem: 'Memory files', kvMemUser: 'user', kvMemNotes: 'notes', kvMemLog: 'log', kvMemMissing: 'missing',
332
324
  kvWs: 'Current workspace', kvWsUnknown: '(unknown)', kvApi: 'API probes', unknown: '(unknown)',
333
- guideTitle: 'Welcome to dsh-auto-memory (pre)', guideSub: 'What this plugin does:',
334
- gFeat1: 'Three-layer memory with automatic injection & retrieval: user / project notes / daily logs',
335
- gFeat2: 'Auto-consolidation after every turn: bugs fixed and decisions made are written into today\'s log automatically',
336
- gFeat3: 'AI period greetings with three-level drawers: open the Memory panel for a period-by-period digest',
337
- gFeat4: 'Smart search & calendar: ask in natural language; AI files deadlines into the calendar and reminds you',
338
- gFeat5: 'Inherit memories from other AI tools: CodeBuddy / Claude Code / Codex etc. in one click',
339
- gFeat6: 'Auto update check at boot, one-click update in settings',
340
- guideTip: 'Click the Memory button in the sidebar to start; all memories are plain local Markdown files you can inspect anytime.',
341
325
  updateTitle: 'dsh-auto-memory Updated', updateSub: 'What\'s new in this update:', gotIt: 'Got it', noticeOpen: 'Learn more',
342
326
  refresh: 'Refresh', refreshing: 'Refreshing…', close: 'Close', dragMove: 'Drag to move', dragResize: 'Drag to resize', resetPos: 'Reset position',
343
327
  generated: 'Generated', failed: 'Failed: ',
@@ -497,6 +481,7 @@ window.__ModuleLoader__.load({
497
481
  '补丁 0.1.34:修复推理库检测——pnpm 把 transformers 提升到 profile 根 node_modules,检测补该路径,新用户装完即用,无需手动操作。',
498
482
  '补丁 0.1.37:修复「弹窗关不掉」(#13,感谢 @eclgo 报告)——暂离回归面板只在 away→active 翻转时弹一次;0.1.36 起回归检测全局化后,回归前(尚未发消息)面板会被每 30 秒强制重开,现已根治。',
499
483
  '补丁 0.1.37:修复语义引擎「推理库缺失」误报 (#14,感谢 @moonltppt 报告)——推理库探测改用 Node 真实解析,覆盖 npm/pnpm(hoisted/isolated)全部安装布局;并新增「打开即自动检测」:检测不到自动深度扫描(~/.dsh/profiles 全家 + pnpm 虚拟存储),命中即热接入(无需重启),仍缺才推荐安装/一键下载,推荐卡 24 小时免打扰。',
484
+ '补丁 0.1.38:修复新装首启弹的不是启动向导——删除旧的静态欢迎卡(内容与完整向导重复、且小卡形态无关闭按钮);全新安装首次打开直接进入完整欢迎向导(分步功能开关+引擎检测/下载引导),老用户按版本与向导完成态自动补看。',
500
485
  ], en: [
501
486
  '★ MAJOR: Brand-new Welcome Tour — after first launch or upgrade, every feature is introduced step by step with per-feature switches right in the tour (association / snapshot / greeting / night unattended / reflection / summaries / external memory / skill promotion…); engine detection, download, self-test and live external-source scanning are all inline.',
502
487
  '★ New brand visuals: an Office/Fluent-style liquid-glass app icon family — each step gets its own colored glass squircle icon (cyan inject / amber greeting / green calendar / violet engine / sky radar / coral finish) with dedicated looping motion (bell sway, page flip, linked rings, prism spin, radar sweep, rising spark); the signature three-slab frosted-glass logo stays on the Core step.',
@@ -512,6 +497,7 @@ window.__ModuleLoader__.load({
512
497
  'Patch 0.1.34: fixed inference-lib detection — pnpm hoists transformers to the profile-root node_modules; detection now covers that path, so fresh installs work out of the box.',
513
498
  'Patch 0.1.37: fixed the "popup cannot be closed" loop (#13, thanks @eclgo) — the welcome-back panel now opens only on the away→active transition; since 0.1.36 globalised away detection, the panel was force-reopened every 30s until the first message after returning. Root-caused and fixed.',
514
499
  'Patch 0.1.37: fixed the false "inference runtime missing" state (#14, thanks @moonltppt) — runtime detection now uses real Node resolution, covering npm/pnpm (hoisted/isolated) layouts; plus a new check-on-open flow: when not detected, a deep scan (~/.dsh/profiles + pnpm virtual store) runs automatically and hot-wires hits with no restart; only if still missing does it recommend installing / one-click download, with a 24h snooze.',
500
+ 'Patch 0.1.38: fixed first-run opening the legacy static welcome card instead of the tour (duplicate content, no close button in the compact card) — the card is removed; fresh installs now go straight into the full welcome tour (per-feature switches + engine detect/download), and existing users get the tour replayed based on version and tour state.',
515
501
  ] },
516
502
  '0.1.29': { zh: [
517
503
  '修复:工作区总览一直显示「未发现带记忆的工作区」——DSH 新版会话持久化改为 session.jsonl.zstd 压缩帧,旧逻辑只认 .jsonl 扫描不到任何会话;现已用 zstd 解压读取首行提取 cwd,并让空的 summary 缓存短时失效,避免空结果被永久固化。',
@@ -652,7 +638,6 @@ window.__ModuleLoader__.load({
652
638
  function dialogPriority(d) {
653
639
  if (!d) return 0
654
640
  if (d.kind === 'update') return 100
655
- if (d.kind === 'first') return 90
656
641
  if (d.kind === 'welcomeTour') return 85
657
642
  if (d.kind === 'modelDownload') return 85
658
643
  if (d.kind === 'notice') return d.notice && d.notice.level === 'urgent' ? 80 : 70
@@ -2597,7 +2582,6 @@ window.__ModuleLoader__.load({
2597
2582
  // 通用开场舞台必须在 first/notice/update 三个分支之前完成赋值;var 只提升声明、不提升赋值。
2598
2583
  var skipUpdateIntro = function () { setUpdateSkip(true) }
2599
2584
  var introEligible = dialogState.kind === 'update' ||
2600
- dialogState.kind === 'first' ||
2601
2585
  (dialogState.kind === 'notice' && !((dialogState.notice || {}).level === 'urgent'))
2602
2586
  var DamIntroBox = function (children) {
2603
2587
  if (!introEligible) return children
@@ -2615,56 +2599,6 @@ window.__ModuleLoader__.load({
2615
2599
  !updateSkip ? h('div', { 'data-dam-update-click': '', onClick: skipUpdateIntro }) : null,
2616
2600
  h('div', { 'data-dam-update-content': '' }, children))
2617
2601
  }
2618
- if (dialogState.kind === 'first') {
2619
- var feats = [t('gFeat1'), t('gFeat2'), t('gFeat3'), t('gFeat4'), t('gFeat5'), t('gFeat6')]
2620
- // M7.5:语义引擎资产检测(模块级缓存,避免重复请求;SLIDES 扩展点见下方渲染块)
2621
- var semStatus = window['dsh-auto-memory.semStatus']
2622
- if (!semStatus) {
2623
- semStatus = { status: 'checking' }
2624
- window['dsh-auto-memory.semStatus'] = semStatus
2625
- fetch('/api/dsh-auto-memory/semantic-status').then(function (r) { return r.json() }).then(function (j) {
2626
- semStatus.status = j.ready ? 'ready' : 'missing'
2627
- try { dlgTick() } catch (e9) {}
2628
- }).catch(function () { semStatus.status = 'unknown' })
2629
- }
2630
- var firstButton = h('button', { 'data-dam-btn': '', style: close, onClick: function () {
2631
- try {
2632
- localStorage.setItem('dsh-auto-memory.firstRunDone', '1')
2633
- if (dialogState && dialogState.currentVersion) localStorage.setItem('dsh-auto-memory.seenVersion', dialogState.currentVersion)
2634
- // 规范 F2(RELEASE-SEMANTIC-OPTION.md):首启关闭后进入「欢迎向导」
2635
- // (分步介绍+内联检测/下载;受设置 welcomeTourEnabled 门控,默认开)。
2636
- fetch('/api/dsh-auto-memory/config').then(function (r) { return r.json() }).then(function (cj) {
2637
- var cc = (cj && cj.config) || cj || {}
2638
- if (cc.welcomeTourEnabled !== false && !localStorage.getItem('dsh-auto-memory.semWizardDone')) {
2639
- openDialog({ kind: 'welcomeTour' })
2640
- } else {
2641
- try { localStorage.setItem('dsh-auto-memory.semWizardDone', '1') } catch (e5) {}
2642
- }
2643
- }).catch(function () {
2644
- if (!localStorage.getItem('dsh-auto-memory.semWizardDone')) openDialog({ kind: 'welcomeTour' })
2645
- })
2646
- } catch (e3) {}
2647
- closeDialog()
2648
- } }, t('gotIt'))
2649
- var firstChildren = [
2650
- h('div', { style: head }, t('guideTitle')),
2651
- h('div', { style: sub }, t('guideSub')),
2652
- feats.map(function (f) { return h('div', { style: item }, h('span', { style: dot }), f) }),
2653
- // M7.5 首启扩展点(SLIDES):新功能引导在此按序追加;当前块=内置语义引擎自动检测。
2654
- (function () {
2655
- var boxS = { margin: '8px 0 4px', padding: '8px 10px', borderRadius: '10px', border: '1px solid color-mix(in srgb, var(--dsw-alias-border-l1, rgba(128,128,128,.35)) 50%, transparent)', fontSize: 'calc(11px * var(--dam-scale))', lineHeight: 1.55 }
2656
- var st = semStatus
2657
- if (!st || st.status === 'checking') return h('div', { style: boxS }, locale === 'zh' ? '正在检测内置语义引擎…' : 'Detecting built-in semantic engine…')
2658
- if (st.status === 'ready') return h('div', { style: boxS }, '✓ ' + (locale === 'zh' ? '内置语义引擎已就绪(本地运行,记忆不出电脑)。可在「记忆」面板设置中切换检索模式。' : 'Built-in semantic engine ready (local-only). Switchable in Memory panel settings.'))
2659
- return h('div', { style: boxS }, locale === 'zh' ? '可选:内置语义引擎未下载(约130MB)。在「记忆」面板设置中可随时启用;未启用时词法检索照常可用。' : 'Optional: built-in semantic engine not downloaded (~130MB). Enable anytime in Memory panel settings; lexical search keeps working.')
2660
- })(),
2661
- h('div', { style: { fontSize: 'calc(12px * var(--dam-scale))', opacity: .8, marginTop: '4px' } }, t('guideTip')),
2662
- firstButton,
2663
- ]
2664
- return h('div', { style: overlay },
2665
- h('div', { style: box },
2666
- DamIntroBox(firstChildren)))
2667
- }
2668
2602
  if (dialogState.kind === 'welcomeTour' || dialogState.kind === 'modelDownload') {
2669
2603
  // 首启引导向导 v2(2026-08-31):分步功能全覆盖 + 步内功能开关(点击即时写配置)
2670
2604
  // + 完成步提醒「随时可在设置的哪个分区重新打开」。跳过/✕ 也先落到完成步(提醒)。
@@ -3580,33 +3514,39 @@ window.__ModuleLoader__.load({
3580
3514
  if (!document.hidden) autoOpenOnReturn()
3581
3515
  })
3582
3516
  } catch (e) {}
3583
- // 更新弹窗 / 首次指导:对比本地记录的已见版本,有更新或首次安装时弹窗(host 12h 缓存,不重复查网)
3584
- // v0.1.30 大更新触达:一次性标记 majorTour——所有用户(新老)升级后首次打开都先播放完整欢迎向导,
3585
- // 向导结束后接 CHANGELOG(含大更新内容+社区致谢);此后永不再弹(标记落 localStorage)
3517
+ // 更新弹窗 / 启动分发:对比本地记录的已见版本,有更新或首次安装时弹窗(host 12h 缓存,不重复查网)
3518
+ // v0.1.38:旧 first 卡已删除 → 全新安装直接完整欢迎向导;老用户按 seen/向导完成态补大更新。
3519
+ // 抽成具名函数便于状态机单测(startup-dispatch)。
3586
3520
  var MAJOR_TOUR_KEY = 'dsh-auto-memory.majorTourV130'
3587
- apiGet(API.updateCheck).then(function (d) {
3521
+ function dispatchStartupDialog(d) {
3588
3522
  if (d && d.current) {
3589
3523
  try {
3590
3524
  var seen = localStorage.getItem('dsh-auto-memory.seenVersion')
3591
3525
  var majorPending = !localStorage.getItem(MAJOR_TOUR_KEY)
3592
- // 老用户(有使用痕迹)seen < 0.1.30(大更新前版本)升级上来 → 强制触发一次欢迎向导(含引擎下载引导)。
3593
- // 不依赖一次性标记:0.1.29→0.1.34 升级即使曾看过旧版向导也要重放,确保模型下载引导不漏。
3594
- var isExisting = !!seen || !!localStorage.getItem('dsh-auto-memory.firstRunDone') || !!localStorage.getItem('dsh-auto-memory.semWizardDone')
3595
- var seenBeforeMajor = isExisting && (!seen || cmpVersion(seen, '0.1.30') < 0)
3596
- if (seenBeforeMajor && !localStorage.getItem('dsh-auto-memory.semWizardDone')) {
3526
+ var wizDone = localStorage.getItem('dsh-auto-memory.semWizardDone')
3527
+ var firstDone = localStorage.getItem('dsh-auto-memory.firstRunDone')
3528
+ // 0.1.38:旧的 first 欢迎卡已删除(内容被 welcomeTour 完整覆盖,且小卡形态无 关闭)
3529
+ // 全新安装直接完整欢迎向导(分步功能开关+引擎检测/下载引导)
3530
+ var freshInstall = !seen && !firstDone && !wizDone
3531
+ var isExisting = !!seen || !!firstDone || !!wizDone
3532
+ if (freshInstall) {
3533
+ openDialog({ kind: 'welcomeTour' })
3534
+ try { localStorage.setItem(MAJOR_TOUR_KEY, '1') } catch (eF) {}
3535
+ return
3536
+ }
3537
+ // 老用户(有使用痕迹)seen < 0.1.30(大更新前版本)或从未看过向导 → 补一次完整欢迎向导
3538
+ // (含引擎下载引导;0.1.29→0.1.34 直升即使曾看过旧版也重放,确保引导不漏)
3539
+ if (isExisting && !wizDone && (!seen || cmpVersion(seen, '0.1.30') < 0)) {
3597
3540
  openDialog({ kind: 'welcomeTour' })
3598
3541
  try { localStorage.setItem(MAJOR_TOUR_KEY, '1') } catch (eM) {}
3599
3542
  return
3600
3543
  }
3601
- if (majorPending && (d.current === '0.1.30' || seen)) {
3602
- // 大更新触达(老用户:seen<current 或已有使用痕迹;新装用户走 first 流程不重复打扰)
3544
+ if (majorPending && isExisting && !wizDone) {
3603
3545
  openDialog({ kind: 'welcomeTour' })
3604
3546
  try { localStorage.setItem(MAJOR_TOUR_KEY, '1') } catch (eM) {}
3605
3547
  return
3606
3548
  }
3607
- if (!seen && !localStorage.getItem('dsh-auto-memory.firstRunDone')) {
3608
- openDialog({ kind: 'first', currentVersion: d.current })
3609
- } else if (seen && seen !== d.current) {
3549
+ if (seen && seen !== d.current) {
3610
3550
  // 只弹 0.1.30 大更新卡(补丁并入其尾部),不逐个弹历史版本——大更新内容才是要传达的
3611
3551
  var bigKey = '0.1.30'
3612
3552
  if (CHANGELOG[bigKey]) {
@@ -3617,14 +3557,15 @@ window.__ModuleLoader__.load({
3617
3557
  if (versions.length) openDialog({ kind: 'update', versions: versions, currentVersion: d.current })
3618
3558
  else try { localStorage.setItem('dsh-auto-memory.seenVersion', d.current) } catch (e3) {}
3619
3559
  }
3620
- } else if (!seen && localStorage.getItem('dsh-auto-memory.firstRunDone')) {
3560
+ } else if (!seen && firstDone) {
3621
3561
  // 老用户但 seen 缺失(旧版升级/缓存清理):只看当前版本一条,不补历史链,避免把旧 log 塞给用户
3622
3562
  try { localStorage.setItem('dsh-auto-memory.seenVersion', d.current) } catch (e3) {}
3623
3563
  if (CHANGELOG[d.current]) openDialog({ kind: 'update', versions: [{ version: d.current, items: CHANGELOG[d.current] }], currentVersion: d.current })
3624
3564
  }
3625
3565
  } catch (e) {}
3626
3566
  }
3627
- }).catch(function () {})
3567
+ }
3568
+ apiGet(API.updateCheck).then(dispatchStartupDialog).catch(function () {})
3628
3569
 
3629
3570
  // 动态通知(发布者→用户:重大 bug 提醒,不依赖发版):启动检查 + 每小时刷新;按 id 去重,urgent 优先
3630
3571
  function checkNotices() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@a9i5k4/dsh-auto-memory",
3
3
  "description": "主动联想记忆插件:记忆不靠模型调用,自己被唤回——Host 观察情境,NLP+向量化双轨检索,固定边界注入不破坏前缀缓存。三层记忆自动沉淀、欢迎向导、唤起回顾、无人值守、AI 问候与反思、日历、跨工具记忆继承。Proactive associative memory for DSH: zero-call recall, three-layer auto-consolidation, welcome tour, unattended mode.",
4
- "version": "0.1.37",
4
+ "version": "0.1.38",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {