dsh-tool-content-guard 1.0.0 → 1.0.1
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/CHANGELOG.md +12 -0
- package/README.md +37 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
本文件记录 `dsh-tool-content-guard` 的对外变更。版本号语义:修 bug → patch,
|
|
4
4
|
行为/配置新增 → minor,不兼容的挂载点或默认行为变更 → major。
|
|
5
5
|
|
|
6
|
+
## [1.0.1] — 2026-10-13
|
|
7
|
+
|
|
8
|
+
文档同步版(**无代码改动**):让 npm 上的文档与仓库一致,并让 `master` 的 HEAD 有一个对应的发布 tag。
|
|
9
|
+
|
|
10
|
+
- README 补上「发版(维护者)」里的 **staged publishing 实测与批准办法**,以及 npm 首发已上线的状态;
|
|
11
|
+
- `v1.0.0` 这个 tag 指向的是 **1.0.0 的发布内容**(`1eb753b`,与 npm 上 1.0.0 的 tarball 逐字节一致);
|
|
12
|
+
其后有两条**纯文档**提交(`594e5e3`、`0f06b6d`),所以 1.0.1 就是给这两条补一个可追溯的发布点,
|
|
13
|
+
避免出现「HEAD 没有对应 tag」;
|
|
14
|
+
- 发版步骤里的分支名修正为 `master`(仓库默认分支已从 `main` 统一为 `master`)。
|
|
15
|
+
|
|
6
16
|
## [1.0.0] — 2026-10-13
|
|
7
17
|
|
|
8
18
|
首个发布版。
|
|
@@ -18,6 +28,8 @@
|
|
|
18
28
|
- **无副作用**:合法 content 原样返回**同一个 decision 对象**(不拷贝、不告警);只重建被改到的块
|
|
19
29
|
(`{ ...block, text }`),未改的块保持同一引用,深冻结安全。
|
|
20
30
|
- **自检**:35 项纯 Node 单测(`npm test`,末行 `CONTENT GUARD: OK`)。
|
|
31
|
+
- **发布**:npm `dsh-tool-content-guard@1.0.0`(2026-10-13)+ Gitee 仓库
|
|
32
|
+
<https://gitee.com/hc905/dsh-tool-content-guard>(tag `v1.0.0`)。
|
|
21
33
|
|
|
22
34
|
**背景(为什么要它)**:2026-10-13 `patent_invalidation_verify` 的 `render()` 把 `text` 写成了
|
|
23
35
|
30 行数组,请求体里出现 `{"type":"text","text":[…]}`,DeepSeek Messages 网关整包 422
|
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ post-execute 策略跑完,再归一化**最终** content;PTC 子调用的 `t
|
|
|
55
55
|
|
|
56
56
|
## 安装
|
|
57
57
|
|
|
58
|
-
**方式一:npm
|
|
58
|
+
**方式一:npm(不需要本机安装 git)**
|
|
59
59
|
|
|
60
60
|
DSH 桌面端 → 侧栏「插件」→「添加插件」,输入:
|
|
61
61
|
|
|
@@ -63,6 +63,11 @@ DSH 桌面端 → 侧栏「插件」→「添加插件」,输入:
|
|
|
63
63
|
dsh-tool-content-guard
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
> npm 首发 `1.0.0` 已于 2026-10-13 上线(实测 `pnpm add dsh-tool-content-guard` 装到 1.0.0,
|
|
67
|
+
> 且装下来的那份自检 35 项全过)。发布瞬间 registry 上曾只出现占位版 `0.0.0-stage`
|
|
68
|
+
> (“Temporary package placeholder for staged publishing”),几分钟后 `dist-tags.latest`
|
|
69
|
+
> 自动指向 `1.0.0`;这段经过记在下面「发版(维护者)」里,供下次发布排障。
|
|
70
|
+
|
|
66
71
|
**方式二:从 Gitee 仓库安装**(需要本机已安装 git;地址**注意结尾的 `.git`**)
|
|
67
72
|
|
|
68
73
|
```
|
|
@@ -147,13 +152,40 @@ node D:\DWork\dsfix\verify-guard-vs-log.mjs # 末行 GUARD vs LOG: OK
|
|
|
147
152
|
# 同步在 CHANGELOG.md 顶部加一条
|
|
148
153
|
npm test # 35 项,必须末行 CONTENT GUARD: OK
|
|
149
154
|
npm pack --dry-run # 看 tarball 内容,确认没多带东西
|
|
150
|
-
# 2) 提交并推 Gitee
|
|
151
|
-
git add -A; git commit -m "release: v1.0.
|
|
152
|
-
git push origin
|
|
153
|
-
# 3) 发 npm
|
|
155
|
+
# 2) 提交并推 Gitee(默认分支 master),**每次发版都要打 tag**
|
|
156
|
+
git add -A; git commit -m "release: v1.0.1"; git tag -a v1.0.1 -m "v1.0.1 — 一句话"
|
|
157
|
+
git push origin master --tags
|
|
158
|
+
# 3) 发 npm
|
|
154
159
|
npm publish
|
|
155
160
|
```
|
|
156
161
|
|
|
162
|
+
> **tag 规则**:每次发版都在**发布提交**上打 annotated tag(`vX.Y.Z`)并推送。
|
|
163
|
+
> 文档类提交跟在 tag 之后属于正常(`v1.0.1` 就是这么来的);**不要移动已经发布过的 tag**。
|
|
164
|
+
|
|
165
|
+
### npm 发布会被分阶段(staged publishing)— 2026-10-13 实测
|
|
166
|
+
|
|
167
|
+
本机 `~/.npmrc` 里是**绕过 2FA 的 token**,npm 正在限制这类 token 用于 direct publishing,
|
|
168
|
+
于是 `npm publish` 返回成功(`+ dsh-tool-content-guard@1.0.0`),版本却进了**分阶段发布队列**:
|
|
169
|
+
registry 上只多出一个占位版 `0.0.0-stage`(description = “Temporary package placeholder for
|
|
170
|
+
staged publishing”,2 files / 344 B),`dist-tags.latest` 指向它,真正的 `1.0.0` 不可见、不可装。
|
|
171
|
+
用同一个 token 也读不到待批队列:`npm stage list` 返回 `[]`,`npm profile get` 直接 403。
|
|
172
|
+
|
|
173
|
+
批准(要过账号 2FA,在能交互输入 OTP 的终端里做):
|
|
174
|
+
|
|
175
|
+
```powershell
|
|
176
|
+
npm login # 换成能过 2FA 的登录态(或直接在 npmjs.com 包页面点批准)
|
|
177
|
+
npm stage list # 记下 stage-id(UUID)
|
|
178
|
+
npm stage approve <stage-id>
|
|
179
|
+
npm view dsh-tool-content-guard version # 期望 1.0.0,不再是 0.0.0-stage
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
要避免这一步:用能通过 2FA 的发布方式(交互式 `npm login` 后的会话),
|
|
183
|
+
或调整账号的 2FA 策略。**判据**:`npm view <pkg> version` 显示 `0.0.0-stage` 就是还卡在审批。
|
|
184
|
+
|
|
185
|
+
**本次实测的结局**:没有做任何批准动作,约 6 分钟后 `dist-tags.latest` 自己变成了 `1.0.0`
|
|
186
|
+
(`versions` 里 `0.0.0-stage` 与 `1.0.0` 并存,前者是占位残留)。所以看到 `0.0.0-stage`
|
|
187
|
+
先别慌,过几分钟复查一次;若长时间仍是占位,再用上面的批准命令或去 npmjs.com 点批准。
|
|
188
|
+
|
|
157
189
|
发布物白名单 = `package.json` 的 `files`:`cordis.patch.yml`、`index.js`、`locale`、
|
|
158
190
|
`test`、`icon.svg`、`CHANGELOG.md`,外加 npm 强制包含的 `README.md` / `LICENSE` /
|
|
159
191
|
`package.json`。`node_modules/`(本地 junction)与 `*.bak-*` 由 `.gitignore` 挡住,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-tool-content-guard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "DSH 插件:host 侧兜底——把工具 content 里非字符串的 `text` 强制字符串化(默认),或在开发模式下直接把这次调用判失败。挂在官方扩展点 tools/post-execute,先让其它策略跑完再归一化,避免 `{\"type\":\"text\",\"text\":[…]}` 这种非法块把 DeepSeek Messages 请求打成 422(invalid type: sequence, expected a string),也避免它落进会话日志、毒掉整个会话。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"icon": "./icon.svg",
|