dsh-instruction-memory 1.0.6 → 1.0.8

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
@@ -4,7 +4,7 @@
4
4
 
5
5
  ![设置页截图](docs/screenshot.png)
6
6
 
7
- > 想先看看界面?`docs/demo.html` 无需安装 DSH,浏览器直接打开即可体验真实设置页(内置演示数据)。
7
+ > 想先看看界面?在 [GitHub 仓库](https://github.com/HERO476/dsh-instruction-memory)中打开 `docs/demo.html`,无需安装 DSH,浏览器直接体验真实设置页(内置演示数据)。
8
8
 
9
9
  ## 安装
10
10
 
@@ -36,6 +36,7 @@ dsh plugin --profile web remove dsh-instruction-memory
36
36
  | `contract-test.mjs` | 契约测试:驱动真实路由,验证两半之间的响应格式 |
37
37
  | `verify.mjs` | 装载验证:按 DSH 的方式加载两半 |
38
38
  | `smoke-test.mjs` | 注入渲染逻辑的单元测试 |
39
+ | `host-range-test.mjs` | 宿主版本范围契约测试:固定矩阵 × 两种 semver 判定模式,锁死兼容性声明 |
39
40
  | `docs/demo.html` | 离线演示页:桩掉 DSH 外壳、加载真实 Client 半渲染设置页(不随 npm 包发布) |
40
41
 
41
42
  ## 生效方式
@@ -73,10 +74,10 @@ DSH 就会得到第二份空记忆,看起来像"记忆消失"。
73
74
 
74
75
  ## 兼容性
75
76
 
76
- `dsh.compatibility.dsh` 声明为:
77
+ `dsh.compatibility.dsh` 与 `dsh.engines.dsh` 声明为同一串:
77
78
 
78
79
  ```
79
- >=0.1.3-alpha.2 <0.1.4 || >=0.1.4-0 <0.1.5-0 || >=0.1.5-alpha.1
80
+ >=0.1.3-alpha.2 <0.1.4 || >=0.1.4-0 <0.1.5-0 || >=0.1.5-alpha.1 <0.1.6-0 || >=0.1.6-alpha.0 <0.2.0-0 || >=0.2.0-0
80
81
  ```
81
82
 
82
83
  **实测范围**:以下 5 个宿主版本已在 **Windows / Node 22** 上逐个真实启动验证(每个版本都确认了
@@ -84,14 +85,29 @@ DSH 就会得到第二份空记忆,看起来像"记忆消失"。
84
85
 
85
86
  `0.1.3-alpha.2` · `0.1.5-alpha.1` · `0.1.5-alpha.2` · `0.1.5-rc.1` · `0.1.5-rc.2`
86
87
 
87
- **为什么写成分段形式**:node-semver 规定"候选版本带预发布标签时,区间里必须存在同一个
88
- major.minor.patch 且自身带预发布标签的比较符"。因此看起来很宽的写法——例如 `>=0.1.3-alpha.2`
89
- 甚至 `>=0.1.3-alpha.2 <0.2.0-0`——**反而匹配不到** `0.1.5-rc.1` / `0.1.5-rc.2` 这些预发布版本
90
- (已用 node-semver 7.8.5 与插件市场自带的版本判定实现逐一实测确认)。分段写法在两者下都能覆盖上面 5 个版本。
88
+ 此外 `0.1.6-alpha.2` 完成了完整的装载与兼容性判定核验(`host-range-test.mjs` 的固定矩阵覆盖它)。
91
89
 
92
- **为什么没有上限**:不设上限,未来 DSH 发布新的预发布版本时不会被判为"超出上限"而拒绝升级。
93
- 代价是 `0.2.0` / `1.0.0` 这类未来版本在 node-semver 下也会被判为满足;若你希望严格封顶,
94
- 在末尾追加 `<0.2.0-0` 即可(注意那会让下一版 0.1.6+ 被市场判为超限)。
90
+ **为什么写成分段形式**:node-semver 规定"候选版本带预发布标签时,区间里必须存在同一个
91
+ major.minor.patch 且自身带预发布标签的比较符"。这条规则是**集合级**的——一个 `||` 分支最多
92
+ 覆盖**一个** minor 的预发布版本。由此产生两个必须遵守的约束:
93
+
94
+ - **宽写法接不住预发布**:`>=0.1.3-alpha.2`、`>=0.1.3-alpha.2 <0.2.0-0` 都**匹配不到**
95
+ `0.1.4-0` / `0.1.5-rc.1` / `0.1.6-alpha.2`——因为 `0.1.3` 与 `0.2.0` 的 tuple 都不等于
96
+ 它们各自的 tuple(已用 node-semver 7.8.5 实测确认)。
97
+ - **每段的上界不能省**:省略会被上一段的比较符"续接"。例如单写 `>=0.1.5-alpha.1`(不封顶),
98
+ 在把 `0.1.3` 当 token 时会放行 `0.1.3-alpha.0/1`。
99
+
100
+ ⚠️ **一个必须知道的上限**:**未声明的未来 minor 的预发布版本,无法被任何范围覆盖。**
101
+ `0.1.7-rc.1` 这类版本 tuple 与所有比较符都不同,在 npm 语义下**永远匹配不到**——与
102
+ `^0.1.0` 无法匹配 `0.1.7-rc.1` 是同一个限制。正式版(`0.1.7`、`0.2.0`、`1.0.0` 等)不受影响。
103
+ DSH 发布新的预发布 minor 时需追加一段,例如 `|| >=0.1.7-alpha.0 <0.2.0-0`;
104
+ `host-range-test.mjs` 的矩阵会把这类缺口暴露出来。
105
+
106
+ **历史修复说明**:1.0.7 及以前,范围末段是 `>=0.1.5-alpha.1`。它使宿主 `0.1.6-alpha.2`
107
+ 在 npm **默认**语义下被判为**不兼容**(预发布门禁要求 tuple 相同:`0.1.5 ≠ 0.1.6`,
108
+ `>=` 的大小比较根本走不到)。插件市场因为传入 `includePrerelease: true` 而侥幸放行,但任何
109
+ 标准 semver 判定都会拒绝——包括 `npm` / `pnpm` 的依赖解析。现已改为逐段枚举,
110
+ 两种判定模式结果一致。
95
111
 
96
112
  **未验证范围**:macOS / Linux、`headless` 与 `tui` profile、以及上表之外的其他 DSH 版本均未实测。
97
113
 
@@ -99,6 +115,7 @@ major.minor.patch 且自身带预发布标签的比较符"。因此看起来很
99
115
  市场只读 `engines.dsh` / `dsh.engines.dsh` 以及 `@deepseek-ai/dsh*` 的 `peerDependencies`,并不读 `dsh.compatibility.dsh`。
100
116
  从 1.0.4 起宿主要求会真实出现在市场卡片上,并生效于安装前的校验:**范围之外的宿主上,市场会把本插件从列表中隐藏并拒绝安装/更新**
101
117
  (市场只隐藏"确认不兼容"的条目;"未声明"或"无法确认"的条目照常显示)。范围之外的宿主仍可自行用 `dsh plugin add` 安装,只是不再被市场担保。
118
+ `host-range-test.mjs` 会断言这两处字段逐字节一致。
102
119
 
103
120
  ## 发布(维护者)
104
121
 
Binary file
package/lib/client.js CHANGED
@@ -541,7 +541,15 @@ window.__ModuleLoader__.load({
541
541
  })
542
542
 
543
543
  ctx.effect(() => slots.inject('settings.section', () => slots.register(
544
- { name: 'settings.section', id: 'instruction-memory', order: 26, label: '指令记忆' },
544
+ // `order` 1200 deliberately sits far above every official section
545
+ // (general 0, models 10, plugins 15, agent-presets 20, archived-
546
+ // sessions 25) and above the third-party ones in the wild (mnemon 20,
547
+ // pet 30, market 40, prompt-optimizer 90, better-sidebar 100,
548
+ // version-update 140). `settings.section` is a `list` slot, so a
549
+ // duplicate order does not throw — it silently makes the render order
550
+ // depend on registration timing. The previous value was 26, one above
551
+ // the official tail: a single new official section would have collided.
552
+ { name: 'settings.section', id: 'instruction-memory', order: 1200, label: '指令记忆' },
545
553
  () => h(InstructionPanel, null),
546
554
  )))
547
555
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-instruction-memory",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "User-only instruction memory for DSH: long-term instructions maintained in the settings UI and auto-injected into every conversation — the model has no write access. 指令记忆:只由用户在设置页维护的长期指令,自动注入此后每轮对话;模型没有任何写入口。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,7 +27,8 @@
27
27
  "lib",
28
28
  "cordis.patch.yml",
29
29
  "README.md",
30
- "LICENSE"
30
+ "LICENSE",
31
+ "docs/screenshot.png"
31
32
  ],
32
33
  "keywords": [
33
34
  "dsh",
@@ -51,7 +52,7 @@
51
52
  },
52
53
  "author": "huangpeiyan",
53
54
  "scripts": {
54
- "test": "node smoke-test.mjs && node contract-test.mjs && node verify.mjs",
55
+ "test": "node host-range-test.mjs && node smoke-test.mjs && node contract-test.mjs && node verify.mjs",
55
56
  "prepublishOnly": "node check-metadata.mjs"
56
57
  },
57
58
  "dsh": {
@@ -66,10 +67,10 @@
66
67
  "platform": "web"
67
68
  },
68
69
  "engines": {
69
- "dsh": ">=0.1.3-alpha.2 <0.1.4 || >=0.1.4-0 <0.1.5-0 || >=0.1.5-alpha.1"
70
+ "dsh": ">=0.1.3-alpha.2 <0.1.4 || >=0.1.4-0 <0.1.5-0 || >=0.1.5-alpha.1 <0.1.6-0 || >=0.1.6-alpha.0 <0.2.0-0 || >=0.2.0-0"
70
71
  },
71
72
  "compatibility": {
72
- "dsh": ">=0.1.3-alpha.2 <0.1.4 || >=0.1.4-0 <0.1.5-0 || >=0.1.5-alpha.1"
73
+ "dsh": ">=0.1.3-alpha.2 <0.1.4 || >=0.1.4-0 <0.1.5-0 || >=0.1.5-alpha.1 <0.1.6-0 || >=0.1.6-alpha.0 <0.2.0-0 || >=0.2.0-0"
73
74
  }
74
75
  }
75
76
  }