@a9i5k4/dsh-auto-memory 0.1.31 → 0.1.33
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/README.md +1 -1
- package/lib/client.js +70 -17
- package/lib/semantic-js.js +4 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
</details>
|
|
49
49
|
|
|
50
50
|
<p align="center">
|
|
51
|
-
<a href="README.md">中文</a> · <b>English</b> · License BSD-3-Clause · <code>pnpm add @a9i5k4/dsh-auto-memory</code>
|
|
51
|
+
<a href="README.zh-CN.md">中文</a> · <b>English</b> · License BSD-3-Clause · <code>pnpm add @a9i5k4/dsh-auto-memory</code>
|
|
52
52
|
</p>
|
|
53
53
|
|
|
54
54
|
> **v0.1.30 MAJOR UPDATE** — A brand-new Welcome Tour: every feature introduced step by step with per-feature switches; an Office/Fluent-style liquid-glass app icon family; a changelog intro animation; and an unattended mode built for long batch jobs.
|
package/lib/client.js
CHANGED
|
@@ -491,6 +491,7 @@ window.__ModuleLoader__.load({
|
|
|
491
491
|
'修复:记忆面板默认位置不再遮挡侧边栏「记忆」入口按钮——改为锚定按钮正上方,重叠时自动让出;支持点击面板外部或按 Esc 关闭。感谢 @ProperSAMA(PR #12)。',
|
|
492
492
|
'修复:更新弹窗在小卡形态下内容被裁剪、底部按钮不可达导致无法关闭——新增右上 ✕ 关闭(同步已读版本),内容区自动滚动。',
|
|
493
493
|
'改进:「唤起回顾」决策↔投递时间线——每条决策标注真实投递结果(✓投递×N/未投递/技能✓),判定队列汇总与政策提示;记忆固化(stale 门降版本容忍,语料升版不再整单压制召回)。',
|
|
494
|
+
'补丁 0.1.31:发布物运行时 section 名 dsh:m6-reference-tail → 裸名(发布身份统一,不再带预览标识)。',
|
|
494
495
|
], en: [
|
|
495
496
|
'★ 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.',
|
|
496
497
|
'★ 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.',
|
|
@@ -500,6 +501,7 @@ window.__ModuleLoader__.load({
|
|
|
500
501
|
'Fix: The panel no longer covers the sidebar "Memory" entry button — default position anchors above it, overlapping geometry auto-yields, and outside-click/Esc close is supported. Thanks @ProperSAMA (PR #12).',
|
|
501
502
|
'Fix: The update dialog could become impossible to close when its content overflowed the compact card — added an ✕ in the top-right (marks version seen) and made the content area scrollable.',
|
|
502
503
|
'Improved: Recall-review decision↔delivery timeline (delivered×N / not delivered / skill badges per decision), review-queue digest with policy hints, and consolidation stale-gate version tolerance so corpus version bumps no longer suppress recall.',
|
|
504
|
+
'Patch 0.1.31: release runtime section name dsh:m6-reference-tail → bare name (unified release identity, no preview marker).',
|
|
503
505
|
] },
|
|
504
506
|
'0.1.29': { zh: [
|
|
505
507
|
'修复:工作区总览一直显示「未发现带记忆的工作区」——DSH 新版会话持久化改为 session.jsonl.zstd 压缩帧,旧逻辑只认 .jsonl 扫描不到任何会话;现已用 zstd 解压读取首行提取 cwd,并让空的 summary 缓存短时失效,避免空结果被永久固化。',
|
|
@@ -977,6 +979,11 @@ window.__ModuleLoader__.load({
|
|
|
977
979
|
'@keyframes dam-tour-swap { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }',
|
|
978
980
|
'[data-dam-tour-dl] { margin: 8px auto 0; max-width: 420px; text-align: left; font-size: 12px; }',
|
|
979
981
|
'[data-dam-tour-dl-row] { display: flex; justify-content: space-between; gap: 10px; opacity: .75; font-size: 10.5px; margin-bottom: 3px; }',
|
|
982
|
+
'[data-dam-tour-dl-tier] { margin-top: 8px; border: 1px solid rgba(128,128,128,.22); border-radius: 9px; overflow: hidden; }',
|
|
983
|
+
'[data-dam-tour-dl-tier-row] { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 10px; font-size: 11px; }',
|
|
984
|
+
'[data-dam-tour-dl-tier-row:first-child] { border-bottom: 1px solid rgba(128,128,128,.14); background: rgba(47,164,106,.08); }',
|
|
985
|
+
'[data-dam-tour-dl-tier-row] b { font-weight: 700; white-space: nowrap; }',
|
|
986
|
+
'[data-dam-tour-dl-tier-row] span { opacity: .7; font-size: 10.5px; text-align: right; }',
|
|
980
987
|
'[data-dam-tour-bar] { height: 7px; border-radius: 99px; background: rgba(128,128,128,.18); overflow: hidden; }',
|
|
981
988
|
'[data-dam-tour-bar-i] { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--dam-accent, #2456c4), #7ea4ff); transition: width .4s ease; }',
|
|
982
989
|
'[data-dam-tour-dots] { display: flex; gap: 7px; justify-content: center; margin: 18px 0 4px; z-index: 2; position: relative; }',
|
|
@@ -2518,10 +2525,20 @@ window.__ModuleLoader__.load({
|
|
|
2518
2525
|
// 每次向导变为可见时回到第一步,并拉一份当前配置快照(开关步读写用)
|
|
2519
2526
|
if (tourShowing) {
|
|
2520
2527
|
setTourStep(0)
|
|
2528
|
+
wizSt.tourCfg = null
|
|
2529
|
+
wizSt.cfgLoaded = false
|
|
2521
2530
|
fetch('/api/dsh-auto-memory/config').then(function (r) { return r.json() }).then(function (j) {
|
|
2522
2531
|
wizSt.tourCfg = (j && (j.config || j)) || {}
|
|
2532
|
+
// mode 型开关(唤起注入模式)实际存储在 embedding-config.json(semantic-emit 接口维护),
|
|
2533
|
+
// 需从 semantic-status 合并进来,导览开关才能显示真实当前值并与设置页联动。
|
|
2534
|
+
try {
|
|
2535
|
+
fetch('/api/dsh-auto-memory/semantic-status').then(function (r2) { return r2.json() }).then(function (j2) {
|
|
2536
|
+
if (j2 && j2.activationEmitMode !== undefined) { wizSt.tourCfg.activationEmitMode = j2.activationEmitMode; try { dlgTick() } catch (e13) {} }
|
|
2537
|
+
}).catch(function () {})
|
|
2538
|
+
} catch (_) {}
|
|
2539
|
+
wizSt.cfgLoaded = true
|
|
2523
2540
|
try { dlgTick() } catch (e11) {}
|
|
2524
|
-
}).catch(function () { wizSt.tourCfg = wizSt.tourCfg || {} })
|
|
2541
|
+
}).catch(function () { wizSt.tourCfg = wizSt.tourCfg || {}; wizSt.cfgLoaded = true })
|
|
2525
2542
|
fetch('/api/dsh-auto-memory/external').then(function (r) { return r.json() }).then(function (j) {
|
|
2526
2543
|
wizSt.extScan = j
|
|
2527
2544
|
try { dlgTick() } catch (e12) {}
|
|
@@ -2530,14 +2547,25 @@ window.__ModuleLoader__.load({
|
|
|
2530
2547
|
}, [tourShowing])
|
|
2531
2548
|
useEffect(function () {
|
|
2532
2549
|
if (!tourShowing) return undefined
|
|
2533
|
-
if (
|
|
2550
|
+
if (wizSt.ready) return undefined // 已就绪无需轮询
|
|
2534
2551
|
var iv = setInterval(function () {
|
|
2535
2552
|
fetch('/api/dsh-auto-memory/semantic-status').then(function (r) { return r.json() }).then(function (j) {
|
|
2536
2553
|
Object.assign(wizSt, j); try { dlgTick() } catch (e10) {}
|
|
2537
2554
|
}).catch(function () {})
|
|
2538
2555
|
}, 1500)
|
|
2539
2556
|
return function () { clearInterval(iv) }
|
|
2540
|
-
}, [tourShowing, tourDlPhase])
|
|
2557
|
+
}, [tourShowing, tourDlPhase, wizSt.ready])
|
|
2558
|
+
// 无语义引擎自动引导:进入引擎下载步且引擎未就绪/未下载/未出错时,自动开始下载内置 JS 档(C2 默认)。
|
|
2559
|
+
// 用户可稍后在设置页手动装 Python 进阶档;词法检索 0GB 永远兜底,不阻塞。
|
|
2560
|
+
useEffect(function () {
|
|
2561
|
+
if (!tourShowing) return undefined
|
|
2562
|
+
var curStep = TOUR_STEPS[tourStep]
|
|
2563
|
+
if (!curStep || !curStep.dl) return undefined
|
|
2564
|
+
if (wizSt.ready || wizSt.loaded === false) return undefined
|
|
2565
|
+
var ph = wizSt.download && wizSt.download.phase
|
|
2566
|
+
if (ph === 'downloading' || ph === 'verifying' || ph === 'done' || ph === 'error') return undefined
|
|
2567
|
+
apiPost('/api/dsh-auto-memory/semantic-download', { action: 'start', mirror: 'auto' }).catch(function () {})
|
|
2568
|
+
}, [tourShowing, tourStep, wizSt.ready])
|
|
2541
2569
|
if (!dialogState) return null
|
|
2542
2570
|
// 左下角小卡片(记忆按钮上方),高透明毛玻璃,不遮全屏
|
|
2543
2571
|
var overlay = { position: 'fixed', left: '10px', bottom: '64px', zIndex: 2147483000, width: 'min(360px, calc(100vw - 20px))', maxHeight: 'min(46vh, 430px)', display: 'flex', flexDirection: 'column' }
|
|
@@ -2700,7 +2728,9 @@ window.__ModuleLoader__.load({
|
|
|
2700
2728
|
: dl.phase === 'verifying' ? t('dlVerifying')
|
|
2701
2729
|
: dl.phase === 'downloading' ? (t('dlDownloading') + ' · ' + fmtMB(dl.bytesDone || 0) + ' / ' + fmtMB(dl.bytesTotal || totalBytes))
|
|
2702
2730
|
: dl.phase === 'error' ? (t('dlError') + ': ' + String(dl.error || '').slice(0, 90))
|
|
2703
|
-
: dl.phase === 'done' ?
|
|
2731
|
+
: dl.phase === 'done' ? (wizSt.assetPresent && !wizSt.peerPresent
|
|
2732
|
+
? (locale === 'zh' ? '模型已下载,推理库缺失——请运行 pnpm add @huggingface/transformers 后重启' : 'Model downloaded, inference lib missing — run pnpm add @huggingface/transformers and restart')
|
|
2733
|
+
: t('dlDone'))
|
|
2704
2734
|
: (locale === 'zh' ? '未下载 · 词法检索照常可用' : 'Not downloaded · lexical search keeps working')
|
|
2705
2735
|
var startDl = function () {
|
|
2706
2736
|
apiPost('/api/dsh-auto-memory/semantic-download', { action: 'start', mirror: 'auto' }).catch(function () {})
|
|
@@ -2709,12 +2739,14 @@ window.__ModuleLoader__.load({
|
|
|
2709
2739
|
var EXT_SOURCE_KEYS = ['workbuddy-user', 'workbuddy-profile', 'codebuddy-memory', 'claude-global', 'project-conventions', 'workbuddy-sessions', 'claude-sessions', 'codex-sessions']
|
|
2710
2740
|
var tourToggleOn = function (tg) {
|
|
2711
2741
|
var c = wizSt.tourCfg || {}
|
|
2742
|
+
if (!wizSt.cfgLoaded) return false // 配置未加载完,一律视为关且禁用,避免误触默认值
|
|
2712
2743
|
if (tg.key === 'autoSummaryTimes') return (c[tg.key] || []).length > 0
|
|
2713
2744
|
if (tg.groupAll) { var v = c[tg.key] || {}; return !!v['workbuddy-user'] }
|
|
2714
2745
|
if (tg.mode) { var m = c[tg.key]; if (m === undefined) return tg.def === true; return m === 'canary-explicit' || m === 'active' }
|
|
2715
2746
|
return c[tg.key] === undefined ? tg.def !== false : !!c[tg.key]
|
|
2716
2747
|
}
|
|
2717
2748
|
var tourToggleClick = function (tg) {
|
|
2749
|
+
if (!wizSt.cfgLoaded) return // 配置未加载完,禁止写入,防止覆盖用户设置
|
|
2718
2750
|
var c = wizSt.tourCfg = wizSt.tourCfg || {}
|
|
2719
2751
|
var on = tourToggleOn(tg)
|
|
2720
2752
|
var patch = {}
|
|
@@ -2724,10 +2756,17 @@ window.__ModuleLoader__.load({
|
|
|
2724
2756
|
else patch[tg.key] = !on
|
|
2725
2757
|
Object.assign(c, patch)
|
|
2726
2758
|
dlgTick()
|
|
2727
|
-
|
|
2759
|
+
// mode 型开关(唤起注入模式)走 semantic-emit 接口——与设置页同源(embedding-config.json),
|
|
2760
|
+
// 保证导览切换与设置页双向联动;其余开关写常规 config。
|
|
2761
|
+
if (tg.mode) {
|
|
2762
|
+
apiPost('/api/dsh-auto-memory/semantic-emit', { mode: patch[tg.key] }).catch(function () {})
|
|
2763
|
+
} else {
|
|
2764
|
+
apiPost('/api/dsh-auto-memory/config', patch).catch(function () {})
|
|
2765
|
+
}
|
|
2728
2766
|
}
|
|
2729
2767
|
// 外部来源单源勾选(扫描行;勾选即写 externalSources 对象)
|
|
2730
2768
|
var tourExtToggle = function (id) {
|
|
2769
|
+
if (!wizSt.cfgLoaded) return // 配置未加载完,禁止写入
|
|
2731
2770
|
var c = wizSt.tourCfg = wizSt.tourCfg || {}
|
|
2732
2771
|
var cur = Object.assign({}, c.externalSources || {})
|
|
2733
2772
|
cur[id] = (cur[id] !== false) ? false : true
|
|
@@ -2746,17 +2785,15 @@ window.__ModuleLoader__.load({
|
|
|
2746
2785
|
var finishTour = function () {
|
|
2747
2786
|
try { localStorage.setItem('dsh-auto-memory.semWizardDone', '1') } catch (e4) {}
|
|
2748
2787
|
closeDialog()
|
|
2749
|
-
// v0.1.30 大更新链:向导结束 →
|
|
2750
|
-
//
|
|
2788
|
+
// v0.1.30 大更新链:向导结束 → 直接接 0.1.30 大更新卡(老用户历史版本不逐个弹,
|
|
2789
|
+
// 大更新内容才是要传达的)。apiGet 异步拉当前版本,失败静默(向导本身已完成使命)。
|
|
2751
2790
|
try {
|
|
2752
2791
|
apiGet(API.updateCheck).then(function (d) {
|
|
2753
2792
|
var cur = (d && d.current) || '0.1.30'
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
}
|
|
2759
|
-
openDialog({ kind: 'update', versions: [{ version: cur, items: CHANGELOG[cur] || CHANGELOG['0.1.30'] }], currentVersion: cur })
|
|
2793
|
+
// 只弹大更新(0.1.30);若当前版本更新(补丁)也并入 0.1.30 卡(补丁内容已在 0.1.30 items 尾部)
|
|
2794
|
+
var latestKey = '0.1.30'
|
|
2795
|
+
openDialog({ kind: 'update', versions: [{ version: latestKey, items: CHANGELOG[latestKey] || CHANGELOG['0.1.30'] }], currentVersion: cur })
|
|
2796
|
+
try { localStorage.setItem('dsh-auto-memory.seenVersion', cur) } catch (e5) {}
|
|
2760
2797
|
}).catch(function () {
|
|
2761
2798
|
openDialog({ kind: 'update', versions: [{ version: '0.1.30', items: CHANGELOG['0.1.30'] }], currentVersion: '0.1.30' })
|
|
2762
2799
|
})
|
|
@@ -2835,7 +2872,14 @@ window.__ModuleLoader__.load({
|
|
|
2835
2872
|
wizReady ? null : h('div', { 'data-dam-tour-bar': '' },
|
|
2836
2873
|
h('div', { 'data-dam-tour-bar-i': '', style: { width: prog + '%', background: dl.phase === 'error' ? 'linear-gradient(90deg,#c44a4a,#e08a8a)' : undefined } })),
|
|
2837
2874
|
!wizReady && wizSt.loaded && !dlActive ? h('div', { 'data-dam-tour-dl-row': '', style: { marginTop: '4px' } },
|
|
2838
|
-
h('span', null, (locale === 'zh' ? '下载源: ' : 'Source: ') + (dl.mirrorUsed === 'cn' ? t('mCn') : dl.mirrorUsed === 'intl' ? t('mIntl') : t('mAuto')) + (locale === 'zh' ? ' · 失败自动切备用源' : ' · auto-failover'))) : null
|
|
2875
|
+
h('span', null, (locale === 'zh' ? '下载源: ' : 'Source: ') + (dl.mirrorUsed === 'cn' ? t('mCn') : dl.mirrorUsed === 'intl' ? t('mIntl') : t('mAuto')) + (locale === 'zh' ? ' · 失败自动切备用源' : ' · auto-failover'))) : null,
|
|
2876
|
+
h('div', { 'data-dam-tour-dl-tier': '' },
|
|
2877
|
+
h('div', { 'data-dam-tour-dl-tier-row': '' },
|
|
2878
|
+
h('b', null, locale === 'zh' ? '内置 JS 档(自动)' : 'Built-in JS tier (auto)'),
|
|
2879
|
+
h('span', null, locale === 'zh' ? 'e5-small · ~129MB · 默认,正在为你安装' : 'e5-small · ~129MB · default, installing for you')),
|
|
2880
|
+
h('div', { 'data-dam-tour-dl-tier-row': '' },
|
|
2881
|
+
h('b', null, locale === 'zh' ? 'Python 进阶档(可选)' : 'Python tier (optional)'),
|
|
2882
|
+
h('span', null, locale === 'zh' ? 'BGE-M3 int8 · 563MB · 追求更高精度的发烧友可在设置页安装' : 'BGE-M3 int8 · 563MB · for enthusiasts chasing higher precision — installable in Settings')))) : null,
|
|
2839
2883
|
step.final ? h('div', null,
|
|
2840
2884
|
h('div', { 'data-dam-tour-chips': '' },
|
|
2841
2885
|
allToggles.filter(function (tg) { return tourToggleOn(tg) }).map(function (tg) {
|
|
@@ -3498,11 +3542,20 @@ window.__ModuleLoader__.load({
|
|
|
3498
3542
|
if (!seen && !localStorage.getItem('dsh-auto-memory.firstRunDone')) {
|
|
3499
3543
|
openDialog({ kind: 'first', currentVersion: d.current })
|
|
3500
3544
|
} else if (seen && seen !== d.current) {
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3545
|
+
// 只弹 0.1.30 大更新卡(补丁并入其尾部),不逐个弹历史版本——大更新内容才是要传达的
|
|
3546
|
+
var bigKey = '0.1.30'
|
|
3547
|
+
if (CHANGELOG[bigKey]) {
|
|
3548
|
+
openDialog({ kind: 'update', versions: [{ version: bigKey, items: CHANGELOG[bigKey] }], currentVersion: d.current })
|
|
3549
|
+
try { localStorage.setItem('dsh-auto-memory.seenVersion', d.current) } catch (e3b) {}
|
|
3550
|
+
} else {
|
|
3551
|
+
var versions = changelogBetween(seen, d.current)
|
|
3552
|
+
if (versions.length) openDialog({ kind: 'update', versions: versions, currentVersion: d.current })
|
|
3553
|
+
else try { localStorage.setItem('dsh-auto-memory.seenVersion', d.current) } catch (e3) {}
|
|
3554
|
+
}
|
|
3504
3555
|
} else if (!seen && localStorage.getItem('dsh-auto-memory.firstRunDone')) {
|
|
3556
|
+
// 老用户但 seen 缺失(旧版升级/缓存清理):只看当前版本一条,不补历史链,避免把旧 log 塞给用户
|
|
3505
3557
|
try { localStorage.setItem('dsh-auto-memory.seenVersion', d.current) } catch (e3) {}
|
|
3558
|
+
if (CHANGELOG[d.current]) openDialog({ kind: 'update', versions: [{ version: d.current, items: CHANGELOG[d.current] }], currentVersion: d.current })
|
|
3506
3559
|
}
|
|
3507
3560
|
} catch (e) {}
|
|
3508
3561
|
}
|
package/lib/semantic-js.js
CHANGED
|
@@ -282,7 +282,10 @@ export function createSemanticDownloaderPre(opts = {}) {
|
|
|
282
282
|
function tmpDir() { return path.join(modelsRoot, '.tmp-dl') }
|
|
283
283
|
|
|
284
284
|
async function fetchToFile(fileRec, base) {
|
|
285
|
-
|
|
285
|
+
// 镜像 base 已含模型子目录(Xenova/multilingual-e5-small/resolve/main/),
|
|
286
|
+
// rel 带 multilingual-e5-small/ 前缀用于落位;URL 拼接时剥掉前缀避免路径重复 404。
|
|
287
|
+
const urlRel = fileRec.rel.indexOf(E5_MODELS_SUBDIR + '/') === 0 ? fileRec.rel.slice(E5_MODELS_SUBDIR.length + 1) : fileRec.rel
|
|
288
|
+
const res = await doFetch(base + fileRelUrl(urlRel), { redirect: 'follow' })
|
|
286
289
|
if (!res.ok) throw new Error('http-' + res.status)
|
|
287
290
|
if (!res.body) throw new Error('no-body')
|
|
288
291
|
const total = Number(res.headers.get('content-length')) || fileRec.bytes
|
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.
|
|
4
|
+
"version": "0.1.33",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -42,5 +42,8 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@deepseek-ai/cordis": "^4.0.1"
|
|
44
44
|
},
|
|
45
|
+
"optionalDependencies": {
|
|
46
|
+
"@huggingface/transformers": "^3.7.6"
|
|
47
|
+
},
|
|
45
48
|
"license": "BSD-3-Clause"
|
|
46
49
|
}
|