dsh-sixlayer-memory 2.5.1 → 2.5.2

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 CHANGED
@@ -11,7 +11,7 @@
11
11
  dsh plugin --profile desktop add dsh-sixlayer-memory
12
12
  ```
13
13
 
14
- **当前版本**:2.5.1 · **35 个工具** · schema v9 · 零外部依赖 · 回归 35 个套件全绿
14
+ **当前版本**:2.5.2 · **35 个工具** · schema v9 · 零外部依赖 · 回归 35 个套件全绿
15
15
 
16
16
  📦 [npm](https://www.npmjs.com/package/dsh-sixlayer-memory) · 🎬 [40 秒介绍视频](media/intro-40s.mp4) · 📝 [变更记录](CHANGELOG.md)
17
17
 
@@ -37,11 +37,13 @@ export function dshHomeCandidates({ env = process.env } = {}) {
37
37
 
38
38
  /** 找模型目录:配置 > 各 $DSH_HOME 候选。返回 {dir, tried} 便于诊断。 */
39
39
  export function resolveModelDirDetailed({ name = DEFAULT_MODEL, dataDir = '', env = process.env } = {}) {
40
+ // 注意:调用方常传空串(配置没写),空串不能当"用户指定了空名字",要回落到默认模型。
41
+ const modelName = (typeof name === 'string' && name.trim()) || DEFAULT_MODEL
40
42
  const tried = []
41
43
  const candidates = []
42
- if (name && path.isAbsolute(name)) candidates.push(name)
43
- for (const home of dshHomeCandidates({ env })) candidates.push(path.join(home, 'memory-core', 'models', name))
44
- if (dataDir) candidates.push(path.join(dataDir, 'models', name))
44
+ if (path.isAbsolute(modelName)) candidates.push(modelName)
45
+ for (const home of dshHomeCandidates({ env })) candidates.push(path.join(home, 'memory-core', 'models', modelName))
46
+ if (dataDir) candidates.push(path.join(dataDir, 'models', modelName))
45
47
  for (const dir of candidates) {
46
48
  tried.push(dir)
47
49
  if (fs.existsSync(path.join(dir, 'tokens.txt')) && fs.existsSync(path.join(dir, 'encoder-epoch-99-avg-1.onnx'))) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-sixlayer-memory",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "private": false,
5
5
  "description": "DSH 工作台:六层记忆底座(每轮自动召回 + 候选沉淀 + 闸门审计)+ 零件化,支持 QQ 随身使用。",
6
6
  "type": "module",