dsh-instruction-memory 1.0.8 → 1.0.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/README.md +17 -12
- package/lib/index.js +22 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ DSH 就会得到第二份空记忆,看起来像"记忆消失"。
|
|
|
77
77
|
`dsh.compatibility.dsh` 与 `dsh.engines.dsh` 声明为同一串:
|
|
78
78
|
|
|
79
79
|
```
|
|
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
|
+
>=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.1.7-0 || >=0.1.7-alpha.0 <0.2.0-0 || >=0.2.0-0
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
**实测范围**:以下 5 个宿主版本已在 **Windows / Node 22** 上逐个真实启动验证(每个版本都确认了
|
|
@@ -85,7 +85,8 @@ DSH 就会得到第二份空记忆,看起来像"记忆消失"。
|
|
|
85
85
|
|
|
86
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`
|
|
87
87
|
|
|
88
|
-
此外 `0.1.6-alpha.2` 完成了完整的装载与兼容性判定核验(`host-range-test.mjs`
|
|
88
|
+
此外 `0.1.6-alpha.2` 与 `0.1.7-rc.2` 完成了完整的装载与兼容性判定核验(`host-range-test.mjs`
|
|
89
|
+
的固定矩阵覆盖它们,且该脚本会**读取本机实际安装的宿主版本**做实时断言)。
|
|
89
90
|
|
|
90
91
|
**为什么写成分段形式**:node-semver 规定"候选版本带预发布标签时,区间里必须存在同一个
|
|
91
92
|
major.minor.patch 且自身带预发布标签的比较符"。这条规则是**集合级**的——一个 `||` 分支最多
|
|
@@ -98,16 +99,20 @@ major.minor.patch 且自身带预发布标签的比较符"。这条规则是**
|
|
|
98
99
|
在把 `0.1.3` 当 token 时会放行 `0.1.3-alpha.0/1`。
|
|
99
100
|
|
|
100
101
|
⚠️ **一个必须知道的上限**:**未声明的未来 minor 的预发布版本,无法被任何范围覆盖。**
|
|
101
|
-
`0.1.
|
|
102
|
-
`^0.1.0` 无法匹配 `0.1.
|
|
103
|
-
DSH 发布新的预发布 minor 时需追加一段,例如 `|| >=0.1.
|
|
104
|
-
`host-range-test.mjs`
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
`0.1.8-rc.1` 这类版本 tuple 与所有比较符都不同,在 npm 语义下**永远匹配不到**——与
|
|
103
|
+
`^0.1.0` 无法匹配 `0.1.8-rc.1` 是同一个限制。正式版(`0.1.8`、`0.2.0`、`1.0.0` 等)不受影响。
|
|
104
|
+
DSH 发布新的预发布 minor 时需追加一段,例如 `|| >=0.1.8-alpha.0 <0.2.0-0`;
|
|
105
|
+
`host-range-test.mjs` 的**实时守卫**会把这类缺口暴露出来(它直接读本机安装的宿主版本)。
|
|
106
|
+
|
|
107
|
+
**历史修复说明**(同一个 bug 出现过两次,值得记下来):
|
|
108
|
+
|
|
109
|
+
- 1.0.7 及以前,范围末段是 `>=0.1.5-alpha.1`,使宿主 `0.1.6-alpha.2` 在 npm **默认**语义下
|
|
110
|
+
被判为**不兼容**(预发布门禁要求 tuple 相同:`0.1.5 ≠ 0.1.6`,`>=` 的大小比较根本走不到)。
|
|
111
|
+
- 1.0.8 改为逐段枚举,但只枚举到 `0.1.6`。DSH 随后发布 `0.1.7-rc.2`,**同一个假阴性再次出现**:
|
|
112
|
+
范围里最后一个预发布 tuple 是 `0.1.6`,而 `0.1.7 ≠ 0.1.6`。1.0.9 补上 `0.1.7` 段。
|
|
113
|
+
|
|
114
|
+
两次都因为插件市场传入 `includePrerelease: true` 而侥幸放行,但任何标准 semver 判定
|
|
115
|
+
(`npm` / `pnpm` 的依赖解析)都会拒绝。现在 `host-range-test.mjs` 同时具备固定矩阵与实时守卫。
|
|
111
116
|
|
|
112
117
|
**未验证范围**:macOS / Linux、`headless` 与 `tui` profile、以及上表之外的其他 DSH 版本均未实测。
|
|
113
118
|
|
package/lib/index.js
CHANGED
|
@@ -36,7 +36,28 @@ const STORE_FILE_NAME = 'memory.json'
|
|
|
36
36
|
/** Pre-release location, kept only so existing installs can migrate off it. */
|
|
37
37
|
const LEGACY_FILE_NAME = '.dsh-instruction-memory.json'
|
|
38
38
|
const SECTION_NAME = 'instruction-memory'
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Placement of the injected instruction block among the system prompt's
|
|
41
|
+
* ordered sections. Sections are concatenated ascending; equal orders fall
|
|
42
|
+
* back to code-unit name order, which is not something a plugin can reason
|
|
43
|
+
* about — so this value must not collide with a reserved slot.
|
|
44
|
+
*
|
|
45
|
+
* `@deepseek-ai/dsh-system-prompt` owns a central `SECTION_ORDERS` table
|
|
46
|
+
* (0.1.7-rc.2): HARNESS_IDENTITY -1000, DEPLOYMENT_PERSONA_PREFIX 0,
|
|
47
|
+
* PLAN_POLICY 500, TEAM_POLICY 600, PTC_ONLY 800, FILE_REFERENCE **900**,
|
|
48
|
+
* TOOL_BASH 1000, … STRUCTURED_OUTPUT 9900, HARNESS_SOURCE 10000,
|
|
49
|
+
* WEB_SURFACE 10100, DEPLOYMENT_PERSONA_SUFFIX 10200.
|
|
50
|
+
*
|
|
51
|
+
* This was 900 through 1.0.8 — an exact tie with FILE_REFERENCE. It never
|
|
52
|
+
* threw (a tie only degrades to dictionary order), and it happened to sort
|
|
53
|
+
* the way we wanted: `instruction-memory` > `file-reference` on code units
|
|
54
|
+
* ('i' 105 > 'f' 102), so the block landed just after the file references.
|
|
55
|
+
* That is an accident of the name, not a decision, and renaming the section
|
|
56
|
+
* would silently move it. 950 states the intent outright: in the gap between
|
|
57
|
+
* FILE_REFERENCE (900) and TOOL_BASH (1000) — after the file-reference block,
|
|
58
|
+
* before the tool descriptions, clear of every reserved value.
|
|
59
|
+
*/
|
|
60
|
+
const SECTION_ORDER = 950
|
|
40
61
|
const API_PREFIX = '/instruction-memory/api'
|
|
41
62
|
/** Request body ceiling for the settings-page route; anything larger is rejected. */
|
|
42
63
|
const MAX_BODY_CHARS = 1_000_000
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-instruction-memory",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
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",
|
|
@@ -61,16 +61,16 @@
|
|
|
61
61
|
},
|
|
62
62
|
"client": {
|
|
63
63
|
"inject": [
|
|
64
|
-
"@deepseek-ai/dsh-client-
|
|
65
|
-
"@deepseek-ai/dsh-client-ui-
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
66
66
|
],
|
|
67
67
|
"platform": "web"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
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
|
+
"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.1.7-0 || >=0.1.7-alpha.0 <0.2.0-0 || >=0.2.0-0"
|
|
71
71
|
},
|
|
72
72
|
"compatibility": {
|
|
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
|
+
"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.1.7-0 || >=0.1.7-alpha.0 <0.2.0-0 || >=0.2.0-0"
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|