@a9i5k4/dsh-auto-memory 0.1.32 → 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/lib/client.js +5 -3
- package/lib/semantic-js.js +4 -1
- package/package.json +4 -1
package/lib/client.js
CHANGED
|
@@ -2547,14 +2547,14 @@ window.__ModuleLoader__.load({
|
|
|
2547
2547
|
}, [tourShowing])
|
|
2548
2548
|
useEffect(function () {
|
|
2549
2549
|
if (!tourShowing) return undefined
|
|
2550
|
-
if (
|
|
2550
|
+
if (wizSt.ready) return undefined // 已就绪无需轮询
|
|
2551
2551
|
var iv = setInterval(function () {
|
|
2552
2552
|
fetch('/api/dsh-auto-memory/semantic-status').then(function (r) { return r.json() }).then(function (j) {
|
|
2553
2553
|
Object.assign(wizSt, j); try { dlgTick() } catch (e10) {}
|
|
2554
2554
|
}).catch(function () {})
|
|
2555
2555
|
}, 1500)
|
|
2556
2556
|
return function () { clearInterval(iv) }
|
|
2557
|
-
}, [tourShowing, tourDlPhase])
|
|
2557
|
+
}, [tourShowing, tourDlPhase, wizSt.ready])
|
|
2558
2558
|
// 无语义引擎自动引导:进入引擎下载步且引擎未就绪/未下载/未出错时,自动开始下载内置 JS 档(C2 默认)。
|
|
2559
2559
|
// 用户可稍后在设置页手动装 Python 进阶档;词法检索 0GB 永远兜底,不阻塞。
|
|
2560
2560
|
useEffect(function () {
|
|
@@ -2728,7 +2728,9 @@ window.__ModuleLoader__.load({
|
|
|
2728
2728
|
: dl.phase === 'verifying' ? t('dlVerifying')
|
|
2729
2729
|
: dl.phase === 'downloading' ? (t('dlDownloading') + ' · ' + fmtMB(dl.bytesDone || 0) + ' / ' + fmtMB(dl.bytesTotal || totalBytes))
|
|
2730
2730
|
: dl.phase === 'error' ? (t('dlError') + ': ' + String(dl.error || '').slice(0, 90))
|
|
2731
|
-
: 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'))
|
|
2732
2734
|
: (locale === 'zh' ? '未下载 · 词法检索照常可用' : 'Not downloaded · lexical search keeps working')
|
|
2733
2735
|
var startDl = function () {
|
|
2734
2736
|
apiPost('/api/dsh-auto-memory/semantic-download', { action: 'start', mirror: 'auto' }).catch(function () {})
|
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
|
}
|