@kenz1117/dsh-engram 0.13.8 → 0.13.9

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/index.js CHANGED
@@ -18782,7 +18782,7 @@ function estimateTokens(text) {
18782
18782
  return Math.ceil(wide * WIDE_TOKENS_PER_CHAR + narrow / 4);
18783
18783
  }
18784
18784
  // package.json
18785
- var version = "0.13.7";
18785
+ var version = "0.13.9";
18786
18786
  // src/index.ts
18787
18787
  /**
18788
18788
  * dsh-engram:DeepSeek Harness 跨会话长期记忆插件(host 半)。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kenz1117/dsh-engram",
3
3
  "description": "Local-first cross-session long-term memory for DeepSeek Harness: dual-scope SQLite stores, hybrid FTS5 + local-vector retrieval with RRF, an evidence gate, provenance audit and SM-2 spaced repetition. 23 narrow tools, zero external services, zero API keys.",
4
- "version": "0.13.8",
4
+ "version": "0.13.9",
5
5
  "icon": "icon.svg",
6
6
  "logo": "icon-256.svg",
7
7
  "publishConfig": {
@@ -123,7 +123,7 @@
123
123
  "optional": true
124
124
  }
125
125
  },
126
- "dependencies": {
126
+ "optionalDependencies": {
127
127
  "@huggingface/transformers": "^4.3.2"
128
128
  },
129
129
  "devDependencies": {
@@ -183,7 +183,15 @@ function findDatabases(dbDir) {
183
183
  */
184
184
  async function createEmbedder(options) {
185
185
  // 动态 import:--help 与参数错误不加载模型运行时。
186
- const { env, pipeline } = await import('@huggingface/transformers')
186
+ // 引擎是 optionalDependencies:弱网安装可能被跳过。这里必须说清发生了什么、
187
+ // 怎么补,而不是抛一段裸栈。
188
+ let transformers
189
+ try {
190
+ transformers = await import('@huggingface/transformers')
191
+ } catch {
192
+ throw new Error(`本地嵌入引擎未随插件安装(弱网安装可能跳过 optionalDependencies)。请网络稳定时更新/重装插件,或手动执行:pnpm add @huggingface/transformers --filter "@kenz1117/dsh-engram"`)
193
+ }
194
+ const { env, pipeline } = transformers
187
195
  env.cacheDir = options.cacheDir
188
196
  // 下载端点可经 HF_ENDPOINT 覆盖(镜像);模型已在缓存时不会访问网络。
189
197
  if (process.env.HF_ENDPOINT) env.remoteHost = process.env.HF_ENDPOINT