dsh-chat-embed 0.6.5 → 0.6.6
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 +2 -1
- package/client.js +1 -1
- package/docs/architecture.md +1 -1
- package/docs/publishing.md +61 -11
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -272,7 +272,7 @@ git clone <repo-url> dsh-chat-embed
|
|
|
272
272
|
cd dsh-chat-embed
|
|
273
273
|
|
|
274
274
|
# 无需安装依赖;直接跑门禁与测试
|
|
275
|
-
npm run check # 语法 + 清单 + 显示资源 + 服务注册表 + 85
|
|
275
|
+
npm run check # 语法 + 清单 + 显示资源 + 服务注册表 + 85 项测试(CI 同样会跑)
|
|
276
276
|
npm test # 只跑测试
|
|
277
277
|
```
|
|
278
278
|
|
|
@@ -323,6 +323,7 @@ plugin_manager { "action": "install_bundle", "target": "<本仓库克隆路径>"
|
|
|
323
323
|
|
|
324
324
|
| 版本 | 变化 |
|
|
325
325
|
| --- | --- |
|
|
326
|
+
| `0.6.6` | 元数据同步版:把 `engines.node` 收紧到 `>=22.14.0`、门禁脚本从 `prepublishOnly` 换成 `prepack`(同时覆盖 `npm pack` 与 `npm publish`)落到 npm 上;新增 CI 工作流(Node 22/24 跑门禁,并校验 tag 与 `BUILD` 一致)。无功能变化 |
|
|
326
327
|
| `0.6.5` | 设置菜单标题与诊断卡片显示自身版本号;「检查补丁配置」改为一次性开关:不再内联渲染报告,而是打开新会话并把已知事实预填进输入框(借用 DSH「创建你的插件」的 `uiWorkspace.startSession` 用法) |
|
|
327
328
|
| `0.6.3` | 自检报告改为一次性:关闭设置菜单即清除,重新打开不再显示上次的报告 |
|
|
328
329
|
| `0.6.2` | 修复设置菜单被长路径撑宽:菜单加 `max-width`、报告文本 `overflow-wrap:anywhere`、补丁命令单独占一行(便于整条复制) |
|
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.
|
|
106
|
+
const BUILD = '0.6.6'
|
|
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__'
|
package/docs/architecture.md
CHANGED
|
@@ -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
|
+
当前实现:**v0.6.6**(`client.js` 约 3985 行,85 项契约测试)。
|
|
7
7
|
|
|
8
8
|
> **架构一句话**:聊天页直接渲染在**席位的布局盒**里(`.dce-panel.dce-inline`,`width/height:100%`),几何完全交给 CSS;席位只有两个 —— 中央主面板(`main`)和右栏聊天 tab —— 二者互斥,**哪边点哪边接管**,切换时 guest 重建一次并回到上次会话。
|
|
9
9
|
|
package/docs/publishing.md
CHANGED
|
@@ -4,35 +4,85 @@
|
|
|
4
4
|
|
|
5
5
|
## 版本与提交约定
|
|
6
6
|
|
|
7
|
-
- 同时改 `package.json` 的 `version` 与 `client.js` 的 `BUILD
|
|
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 不移动**——它标记的是已发布的那次提交。
|
|
11
|
+
|
|
12
|
+
## CI
|
|
13
|
+
|
|
14
|
+
`.github/workflows/ci.yml`:push 到 master、任何 PR、任何 `v*.*.*` tag 都会触发,Node 22 与 24 各跑一遍。
|
|
15
|
+
|
|
16
|
+
| 步骤 | 作用 |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| Gate | `npm run check`(bundle 检查 + 85 项契约测试) |
|
|
19
|
+
| Show the packed file list | `npm pack --dry-run`,让日志里能看见发出去的到底是什么 |
|
|
20
|
+
| Tag matches package.json version | 仅在 tag 触发时跑,tag 与版本不一致直接失败 |
|
|
21
|
+
| client BUILD matches package.json version | 面板显示假版本号是常见事故,这里显式拦一次 |
|
|
22
|
+
|
|
23
|
+
仓库没有运行时依赖,也没有 lock 文件,所以正常情况下 `npm ci` 会跳过;一旦加了依赖,锁文件出现后自动生效。
|
|
10
24
|
|
|
11
25
|
## 发版步骤
|
|
12
26
|
|
|
27
|
+
**顺序:先发布,后打 tag。** `npm publish` 是唯一不可逆的一步(72 小时后只能 deprecate),tag 与 Release 随时可删可重做。先做不可逆的,失败就停,不会留下"GitHub 有 Release、npm 没有包"的幽灵版本。
|
|
28
|
+
|
|
13
29
|
```powershell
|
|
14
|
-
|
|
15
|
-
npm run
|
|
16
|
-
|
|
30
|
+
# 1. 本地门禁
|
|
31
|
+
npm run check
|
|
32
|
+
|
|
33
|
+
# 2. 单提交并推送(触发 CI)
|
|
34
|
+
# --orphan 重写 + gc --prune=now + 强推 master
|
|
35
|
+
|
|
36
|
+
# 3. 等 CI 绿
|
|
37
|
+
gh run list --repo poluce/dsh-chat-embed --limit 1
|
|
38
|
+
|
|
39
|
+
# 4. 发布到 npm(prepack 会自动再跑一次门禁)
|
|
40
|
+
npm publish
|
|
41
|
+
|
|
42
|
+
# 5. 打 tag 并推送(CI 校验 tag == package.json version)
|
|
43
|
+
git tag v<版本>
|
|
44
|
+
git push origin refs/tags/v<版本>
|
|
45
|
+
|
|
46
|
+
# 6. 创建 GitHub Release(附分发包)
|
|
47
|
+
npm run pack:dist
|
|
48
|
+
gh release create v<版本> dist\dsh-chat-embed-<版本>.tgz --title "v<版本>" --notes-file dist\release-notes-<版本>.md
|
|
17
49
|
```
|
|
18
50
|
|
|
19
|
-
`
|
|
51
|
+
`prepack` 也挂了 `npm run check`,所以 `npm pack` / `npm publish` 两条路径都不会放过未过门禁的代码。0.6.5 及之前用的是 `prepublishOnly`,它只覆盖发布,GitHub Release 的 tarball 因此没有门禁。
|
|
52
|
+
|
|
53
|
+
`dist/` 与 `*.tgz` 已被 `.gitignore` 忽略。
|
|
20
54
|
|
|
21
55
|
发版后自检:
|
|
22
56
|
|
|
23
57
|
```powershell
|
|
24
|
-
|
|
25
|
-
|
|
58
|
+
npm view dsh-chat-embed version # 应等于 <版本>
|
|
59
|
+
npm audit signatures # 校验 provenance 签名
|
|
60
|
+
gh release download v<版本> --pattern '*.tgz' --dir $env:TEMP\check
|
|
61
|
+
Get-FileHash $env:TEMP\check\dsh-chat-embed-<版本>.tgz -Algorithm SHA256
|
|
26
62
|
```
|
|
27
63
|
|
|
64
|
+
## 已知的发版顺序债
|
|
65
|
+
|
|
66
|
+
0.6.5 及之前的版本是「tag → Release → publish」,与上面的顺序相反。已发布的历史无法回溯修正,从下一个版本起按新顺序执行。
|
|
67
|
+
|
|
68
|
+
## trusted publishing(未启用)
|
|
69
|
+
|
|
70
|
+
目前用 `~/.npmrc` 里的 Granular token 发布(绕过 2FA),包上没有 provenance。切 OIDC 需要:
|
|
71
|
+
|
|
72
|
+
1. npm 包设置页 → Trusted Publisher → GitHub Actions,填 owner `poluce`、repo `dsh-chat-embed`、workflow 文件名;
|
|
73
|
+
2. 该配置**必须在 2 天内完成首次成功发布**,否则过期;
|
|
74
|
+
3. 需要 workflow 带 `id-token: write`、GitHub-hosted runner、npm CLI ≥ 11.5.1、Node ≥ 22.14.0(`engines` 已收紧)。
|
|
75
|
+
|
|
76
|
+
⚠️ 一个已知冲突:provenance 把包绑定到发布时的 commit SHA,而本仓库每次发版都重写历史并 `gc --prune=now`,旧版本的 commit 会变成不可达对象,npm 页面上"source commit"链接最终会失效。要么接受旧版本链接腐烂,要么保留历史。
|
|
77
|
+
|
|
28
78
|
## 当前发布物
|
|
29
79
|
|
|
30
80
|
| 项 | 地址 |
|
|
31
81
|
| --- | --- |
|
|
32
82
|
| 仓库 | <https://github.com/poluce/dsh-chat-embed> |
|
|
33
83
|
| Release | <https://github.com/poluce/dsh-chat-embed/releases> |
|
|
34
|
-
| 分发包 | `dsh-chat-embed-0.6.
|
|
35
|
-
| npm | `dsh-chat-embed@0.6.
|
|
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`) |
|
|
36
86
|
| 商店图标 | `assets/icon-180.png`(180×180 PNG) |
|
|
37
87
|
| 商店截图 | `assets/screenshots/` + 仓库根 `screenshots.json`(6 张) |
|
|
38
88
|
|
|
@@ -51,7 +101,7 @@ dsh plugin --profile desktop add git+https://github.com/poluce/dsh-chat-embed.gi
|
|
|
51
101
|
|
|
52
102
|
1. 注册账号并完成邮箱验证:<https://www.npmjs.com/signup>;
|
|
53
103
|
2. 本机登录:`npm login`(浏览器确认或一次性密码;开了 2FA 输入验证码);
|
|
54
|
-
3. 发布:`npm publish`(`
|
|
104
|
+
3. 发布:`npm publish`(`prepack` 自动跑门禁;包名 `dsh-chat-embed` 已发布 `0.6.6`);
|
|
55
105
|
4. 使用者随后只需:`dsh plugin --profile desktop add dsh-chat-embed`。
|
|
56
106
|
|
|
57
107
|
## 发布前后检查项
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-chat-embed",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
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",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"check": "node scripts/verify-bundle.mjs && npm test",
|
|
43
43
|
"test": "node --test \"test/**/*.test.mjs\"",
|
|
44
|
-
"
|
|
44
|
+
"prepack": "npm run check",
|
|
45
45
|
"pack:dist": "node scripts/pack-dist.mjs"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
|
-
"node": ">=22",
|
|
69
|
+
"node": ">=22.14.0",
|
|
70
70
|
"dsh": ">=0.1.0-rc.6"
|
|
71
71
|
}
|
|
72
72
|
}
|