dsh-chat-embed 0.6.6 → 0.6.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
@@ -287,7 +287,14 @@ plugin_manager { "action": "install_bundle", "target": "<本仓库克隆路径>"
287
287
 
288
288
  ### 发布与分发
289
289
 
290
- 维护者发版、打包、GitHub Release、npm 发布与插件列表投稿:见 **[docs/publishing.md](docs/publishing.md)**。
290
+ 一条命令发版(门禁 → 提交 → 推送 → 等 CI → 发布 npm → 打 tag → 建 Release,中途失败可重跑续做):
291
+
292
+ ```powershell
293
+ node scripts/release.mjs 0.6.7 --summary "这次改了什么"
294
+ node scripts/release.mjs 0.6.7 --summary "..." --dry-run # 只看计划
295
+ ```
296
+
297
+ 发版细节、CI 与 dependabot、插件列表投稿:见 **[docs/publishing.md](docs/publishing.md)**。
291
298
 
292
299
  ---
293
300
 
@@ -323,6 +330,8 @@ plugin_manager { "action": "install_bundle", "target": "<本仓库克隆路径>"
323
330
 
324
331
  | 版本 | 变化 |
325
332
  | --- | --- |
333
+ | `0.6.8` | 去掉单提交策略:发版改为普通提交 + 普通推送,不再 --orphan 重写、reflog expire、gc --prune 与强推;恢复 git log/diff/blame/bisect,发版失败可 reset 回退,并为 OIDC provenance 扫清障碍 |
334
+ | `0.6.7` | 发版脚本:一条命令完成 bump/gate/提交/推送/等 CI/发布/打 tag/建 release;新增 dependabot 自动维护固定 SHA 的 Action |
326
335
  | `0.6.6` | 元数据同步版:把 `engines.node` 收紧到 `>=22.14.0`、门禁脚本从 `prepublishOnly` 换成 `prepack`(同时覆盖 `npm pack` 与 `npm publish`)落到 npm 上;新增 CI 工作流(Node 22/24 跑门禁,并校验 tag 与 `BUILD` 一致)。无功能变化 |
327
336
  | `0.6.5` | 设置菜单标题与诊断卡片显示自身版本号;「检查补丁配置」改为一次性开关:不再内联渲染报告,而是打开新会话并把已知事实预填进输入框(借用 DSH「创建你的插件」的 `uiWorkspace.startSession` 用法) |
328
337
  | `0.6.3` | 自检报告改为一次性:关闭设置菜单即清除,重新打开不再显示上次的报告 |
package/client.js CHANGED
@@ -103,7 +103,7 @@ window.__ModuleLoader__.load({
103
103
  let openRightTabImpl = () => {}
104
104
 
105
105
  /** Build identity, surfaced in the panel so a packaged app can be diagnosed. */
106
- const BUILD = '0.6.6'
106
+ const BUILD = '0.6.8'
107
107
 
108
108
  /** Where a re-applied instance finds the one it must take over from. */
109
109
  const INSTANCE_KEY = '__DSH_CHAT_EMBED_INSTANCE__'
@@ -3,7 +3,7 @@
3
3
  本文记录 `client.js` 里每一条**反直觉**的实现决策、支撑它的证据,以及升级桌面壳时必须重新验证的清单。
4
4
 
5
5
  目标运行环境:**`@deepseek-ai/dsh-desktop 0.2.2-rc.1`(Electron / Chromium)**。
6
- 当前实现:**v0.6.6**(`client.js` 约 3985 行,85 项契约测试)。
6
+ 当前实现:**v0.6.8**(`client.js` 约 3985 行,85 项契约测试)。
7
7
 
8
8
  > **架构一句话**:聊天页直接渲染在**席位的布局盒**里(`.dce-panel.dce-inline`,`width/height:100%`),几何完全交给 CSS;席位只有两个 —— 中央主面板(`main`)和右栏聊天 tab —— 二者互斥,**哪边点哪边接管**,切换时 guest 重建一次并回到上次会话。
9
9
 
@@ -7,7 +7,7 @@
7
7
  - 同时改 `package.json` 的 `version` 与 `client.js` 的 `BUILD`,两者必须一致(CI 与契约测试都会拦);
8
8
  - 门禁必须绿:`npm run check`(`verify-bundle` + 85 项契约测试);
9
9
  - 代码注释/提交信息英文,文档中文;
10
- - 仓库保持**单提交**:每次发版用 `--orphan` + `gc --prune=now` 重写历史后强推 master。**tag 不移动**——它标记的是已发布的那次提交。
10
+ - 提交历史正常累积,**不再重写**:发版就是一次普通提交 + 普通 push。tag 不移动——它标记的是当时发布的那次提交。
11
11
 
12
12
  ## CI
13
13
 
@@ -22,29 +22,51 @@
22
22
 
23
23
  仓库没有运行时依赖,也没有 lock 文件,所以正常情况下 `npm ci` 会跳过;一旦加了依赖,锁文件出现后自动生效。
24
24
 
25
+ `.github/dependabot.yml`:每周一维护 `ci.yml` 里固定成 commit SHA 的 action。我们钉的是 `uses: owner/action@<40 位 SHA> # vX.Y.Z` 这种形式,Dependabot 认得行尾的版本注释,会把 SHA 换成新版本的完整 SHA 并同步更新注释。同周的 action 升级合成一个 PR。包本身没有依赖,所以没有声明 npm 生态。
26
+
25
27
  ## 发版步骤
26
28
 
27
- **顺序:先发布,后打 tag。** `npm publish` 是唯一不可逆的一步(72 小时后只能 deprecate),tag 与 Release 随时可删可重做。先做不可逆的,失败就停,不会留下"GitHub 有 Release、npm 没有包"的幽灵版本。
29
+ 一条命令:
28
30
 
29
31
  ```powershell
30
- # 1. 本地门禁
31
- npm run check
32
+ node scripts/release.mjs 0.6.7 --summary "一句话说明这次改了什么"
33
+ ```
32
34
 
33
- # 2. 单提交并推送(触发 CI)
34
- # --orphan 重写 + gc --prune=now + 强推 master
35
+ 它按顺序做六件事。**顺序的理由:先发布,后打 tag。** `npm publish` 是唯一不可逆的一步(72 小时后只能 deprecate),tag 与 Release 随时可删可重做;先做不可逆的,失败就停,不会留下"GitHub 有 Release、npm 没有包"的幽灵版本。
35
36
 
36
- # 3. 等 CI 绿
37
- gh run list --repo poluce/dsh-chat-embed --limit 1
37
+ | 阶段 | 做什么 | 已经做过时怎么判断 |
38
+ | --- | --- | --- |
39
+ | bump | 改 `package.json` / `client.js` 的 `BUILD` / README 版本历史 / 两份文档 | 值相同就不动 |
40
+ | gate | `npm run check` | — |
41
+ | commit | `git add -A` + 普通提交 | 工作树干净则跳过 |
42
+ | push | 推送 master,触发 CI | — |
43
+ | ci | 等这次推送的 CI 跑完,红了就停 | — |
44
+ | publish | `npm publish` | registry 上已有该版本则跳过 |
45
+ | tag | 打 tag 并推送(CI 再校验一次) | tag 已存在则跳过 |
46
+ | release | `npm run pack:dist` + `gh release create` | Release 已存在则跳过 |
38
47
 
39
- # 4. 发布到 npm(prepack 会自动再跑一次门禁)
40
- npm publish
48
+ 每个阶段都先检查现状,所以**中途失败后重跑同一条命令即可续做**,不会重复发布或重复建 tag。
41
49
 
42
- # 5. 打 tag 并推送(CI 校验 tag == package.json version)
43
- git tag v<版本>
44
- git push origin refs/tags/v<版本>
50
+ 常用变体:
51
+
52
+ ```powershell
53
+ node scripts/release.mjs 0.6.7 --summary "..." --dry-run # 只打印计划,不改任何东西
54
+ node scripts/release.mjs 0.6.7 --summary "..." --stop-after gate # 做完 bump+门禁就停
55
+ node scripts/release.mjs 0.6.7 --summary "..." --notes dist\notes.md # Release 用独立说明文件
56
+ ```
57
+
58
+ 每条提交只描述自己这次发布(`dsh-chat-embed <版本>: <summary>`)。项目长描述只留在历史第一条提交里,不再随版本重复。
59
+
60
+ ### 手动等价步骤(脚本出问题时的兜底)
45
61
 
46
- # 6. 创建 GitHub Release(附分发包)
47
- npm run pack:dist
62
+ ```powershell
63
+ npm run check # 1. 本地门禁
64
+ # 2. git add -A && git commit && git push
65
+ gh run list --repo poluce/dsh-chat-embed --limit 1 # 3. 等 CI 绿
66
+ npm publish # 4. 发布到 npm(prepack 会自动再跑一次门禁)
67
+ git tag v<版本> # 5. 打 tag 并推送
68
+ git push origin refs/tags/v<版本>
69
+ npm run pack:dist # 6. 打包 + 建 Release
48
70
  gh release create v<版本> dist\dsh-chat-embed-<版本>.tgz --title "v<版本>" --notes-file dist\release-notes-<版本>.md
49
71
  ```
50
72
 
@@ -73,7 +95,7 @@ Get-FileHash $env:TEMP\check\dsh-chat-embed-<版本>.tgz -Algorithm SHA256
73
95
  2. 该配置**必须在 2 天内完成首次成功发布**,否则过期;
74
96
  3. 需要 workflow 带 `id-token: write`、GitHub-hosted runner、npm CLI ≥ 11.5.1、Node ≥ 22.14.0(`engines` 已收紧)。
75
97
 
76
- ⚠️ 一个已知冲突:provenance 把包绑定到发布时的 commit SHA,而本仓库每次发版都重写历史并 `gc --prune=now`,旧版本的 commit 会变成不可达对象,npm 页面上"source commit"链接最终会失效。要么接受旧版本链接腐烂,要么保留历史。
98
+ 提交历史正常累积之后,provenance 里的 commit SHA 会长期可达,npm 页面上的"source commit"链接不会失效。
77
99
 
78
100
  ## 当前发布物
79
101
 
@@ -81,8 +103,8 @@ Get-FileHash $env:TEMP\check\dsh-chat-embed-<版本>.tgz -Algorithm SHA256
81
103
  | --- | --- |
82
104
  | 仓库 | <https://github.com/poluce/dsh-chat-embed> |
83
105
  | Release | <https://github.com/poluce/dsh-chat-embed/releases> |
84
- | 分发包 | `dsh-chat-embed-0.6.6.tgz`(16 个文件,约 70 kB) |
85
- | npm | `dsh-chat-embed@0.6.6`(<https://www.npmjs.com/package/dsh-chat-embed>,维护者 `poluce_auto`) |
106
+ | 分发包 | `dsh-chat-embed-0.6.8.tgz`(16 个文件,约 70 kB) |
107
+ | npm | `dsh-chat-embed@0.6.8`(<https://www.npmjs.com/package/dsh-chat-embed>,维护者 `poluce_auto`) |
86
108
  | 商店图标 | `assets/icon-180.png`(180×180 PNG) |
87
109
  | 商店截图 | `assets/screenshots/` + 仓库根 `screenshots.json`(6 张) |
88
110
 
@@ -101,7 +123,7 @@ dsh plugin --profile desktop add git+https://github.com/poluce/dsh-chat-embed.gi
101
123
 
102
124
  1. 注册账号并完成邮箱验证:<https://www.npmjs.com/signup>;
103
125
  2. 本机登录:`npm login`(浏览器确认或一次性密码;开了 2FA 输入验证码);
104
- 3. 发布:`npm publish`(`prepack` 自动跑门禁;包名 `dsh-chat-embed` 已发布 `0.6.6`);
126
+ 3. 发布:`npm publish`(`prepack` 自动跑门禁;包名 `dsh-chat-embed` 已发布 `0.6.8`);
105
127
  4. 使用者随后只需:`dsh plugin --profile desktop add dsh-chat-embed`。
106
128
 
107
129
  ## 发布前后检查项
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-chat-embed",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "author": "poluce <fishsummer@126.com>",
5
5
  "description": "Multi-tab AI chat embed for the DeepSeek Harness desktop app: DeepSeek, 豆包, ChatGPT, MiniMax, Kimi, Gemini and Grok, each signed in separately.",
6
6
  "type": "module",