@takboo/dsh-coopanion 0.4.20 → 0.4.21
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 +3 -2
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/assets/coopanion.png +0 -0
- package/assets/coopanion.svg +9 -0
- package/dist/build-info.json +2 -2
- package/docs/compatibility.md +7 -1
- package/docs/development.md +5 -1
- package/docs/market/takboo__dsh-coopanion.yml +1 -0
- package/docs/release-notes.md +7 -0
- package/docs/releasing.md +10 -0
- package/docs/usage.md +3 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +5 -1
- package/scripts/check-package.mjs +9 -0
- package/scripts/compatibility/check.mjs +10 -2
- package/scripts/compatibility/discover.mjs +8 -0
- package/scripts/compatibility/planning.mjs +1 -1
- package/scripts/compatibility/published.mjs +157 -0
- package/scripts/compatibility/report.mjs +39 -9
- package/scripts/compatibility/runner.mjs +6 -3
- package/scripts/verify-engineering.sh +1 -1
- package/tests/compatibility-monitor.mjs +32 -0
- package/tests/install.mjs +11 -0
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
[](https://github.com/takboo/dsh-coopanion/releases/latest)
|
|
8
8
|
[](https://github.com/takboo/dsh-coopanion/actions/workflows/ci.yml)
|
|
9
9
|
[](LICENSE)
|
|
10
|
+
[](https://dshfind.com/zh/plugins/takboo/dsh-coopanion?ref=badge)
|
|
10
11
|
|
|
11
12
|
[**下载插件**](https://github.com/takboo/dsh-coopanion/releases/latest/download/dsh-coopanion.tgz) · [快速开始](#开始一起工作) · [使用指南](docs/usage.md) · [更新记录](https://github.com/takboo/dsh-coopanion/releases/latest)
|
|
12
13
|
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
打开侧边栏 **插件 → 添加插件**,在「包名或地址」中填入:
|
|
59
60
|
|
|
60
61
|
```text
|
|
61
|
-
@takboo/dsh-coopanion@0.4.
|
|
62
|
+
@takboo/dsh-coopanion@0.4.21
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
点击安装,完成后启用 `dsh-coopanion`,再完全退出并重新打开 Harness。
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
使用 **Desktop 自带的 `dsh` 命令**。先启动 Desktop 一次完成初始化,完全退出应用后执行:
|
|
71
72
|
|
|
72
73
|
```bash
|
|
73
|
-
dsh plugin --profile desktop add @takboo/dsh-coopanion@0.4.
|
|
74
|
+
dsh plugin --profile desktop add @takboo/dsh-coopanion@0.4.21
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
完成后重新打开 Desktop。其他 profile 的安装方法见[使用指南](docs/usage.md#通过-dsh-命令行安装)。
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -12,6 +12,10 @@ The textures and thumbnails in `web/upstream/whale/`, and the generated tray ico
|
|
|
12
12
|
|
|
13
13
|
This integration follows the project user's existing statement that the community character is reusable. AGPL does not relicense these textures. The complete original upstream rights notice is preserved verbatim in [web/upstream/THIRD_PARTY_NOTICES.md](web/upstream/THIRD_PARTY_NOTICES.md). Its sections on speech-recognition libraries/models describe the upstream package; this plugin does not bundle those components.
|
|
14
14
|
|
|
15
|
+
## Coopanion distribution icon
|
|
16
|
+
|
|
17
|
+
`assets/coopanion.svg` is original project artwork made from geometric shapes, licensed under AGPL-3.0-or-later. `assets/coopanion.png` is its 180 × 180 raster export for the package manifest and the market card. Regenerate it with `rsvg-convert -o assets/coopanion.png assets/coopanion.svg`. The tray keeps its separate artwork and notice above.
|
|
18
|
+
|
|
15
19
|
## Electron
|
|
16
20
|
|
|
17
21
|
Electron 44.7.0 is installed as a dependency and retains its MIT license and Chromium's accompanying notices. Runtime download and verification remain unchanged.
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="180" height="180" viewBox="0 0 180 180">
|
|
2
|
+
<rect x="1" y="1" width="178" height="178" rx="38" fill="#182951"/>
|
|
3
|
+
<path fill="#9de5ff" d="M40 101c0-26 22-46 49-46 24 0 43 14 48 35 8-10 17-14 27-13-1 16-9 26-24 31-5 23-24 36-48 36-29 0-52-17-52-43Z"/>
|
|
4
|
+
<path fill="#54a5f2" d="M41 111c13 11 31 15 53 15 16 0 30-4 44-13-7 20-24 31-46 31-25 0-45-12-51-33Z"/>
|
|
5
|
+
<circle cx="72" cy="93" r="5" fill="#182951"/>
|
|
6
|
+
<path d="M64 108c4 5 10 6 15 1" fill="none" stroke="#182951" stroke-width="3.5" stroke-linecap="round"/>
|
|
7
|
+
<path fill="#ffe1a0" d="m128 30 4 10 10 4-10 4-4 10-4-10-10-4 10-4Z"/>
|
|
8
|
+
<circle cx="107" cy="31" r="3" fill="#e1f7ff"/>
|
|
9
|
+
</svg>
|
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"commit": "
|
|
3
|
+
"commit": "810789948475c42deb8333333510fa25b4e3ed7e",
|
|
4
4
|
"dirty": false,
|
|
5
|
-
"productDigest": "
|
|
5
|
+
"productDigest": "8eabee6ab2c719a3ccad94f9dac2ece5bd581286bf42080abfffdf50a2e7aa0a"
|
|
6
6
|
}
|
package/docs/compatibility.md
CHANGED
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
|
|
22
22
|
报告读取兼容下载后的两种布局:多个 artifact 的具名子目录,以及单个 artifact 直接展开到输出根目录。准备阶段已经确认的依赖冲突保留为 failed,不因后续平台 job 未执行而降为“缺报告、等待重试”;单个组件仍须通过原有来源、目标和包摘要校验。
|
|
23
23
|
|
|
24
|
+
## 双轨宿主证据
|
|
25
|
+
|
|
26
|
+
发现阶段读取 npm `latest` 的精确版本和 integrity。SDK 组件身份同时绑定宿主和这份发布物,原包更新后会重新观察。发布轨在独立 Linux Docker 任务中下载并校验 npm 原始 tarball,使用默认准入安装到干净 profile。接受后用包内探针验证真实 Web 宿主和插件设置。拒绝时核对官方诊断、profile 回滚和配置中无该插件,报告 `refused-as-expected`。候选轨继续运行原有三平台适配安装矩阵,报告候选包 SHA-256、integrity、实际准入和运行阶段。两轨核对同一精确 DSH 版本和 integrity。插件断言失败记 `failed`,安装准备、浏览器启动或执行中断按实际阶段记 `retry`。
|
|
27
|
+
|
|
28
|
+
手动工作流输入一个精确宿主版本可同时演练两轨。可用 Docker 在本地复现发布轨,容器内安装项目锁定的 Playwright Chromium 后运行 `DSH_VERSION=0.2.2-rc.1 npm run compat:published`。候选适配使用 `compat:prepare` 和 `compat:check`,传入同一发现目标和构建目录。正式支持范围由项目 PR 审阅决定。
|
|
29
|
+
|
|
24
30
|
## 配套基线与验证范围
|
|
25
31
|
|
|
26
32
|
已审阅的 Cordis、Schemastery、Loader/Include/Group、Cosmokit 及 Host Timer 精确输入统一由 [reviewed-dependencies.mjs](../scripts/compatibility/reviewed-dependencies.mjs) 维护。准备 job、SDK/Desktop 的 npm Web Host 安装和提案/报告校验共用该定义。
|
|
@@ -33,7 +39,7 @@ Loader/Include/Group/Cosmokit 显式列入候选开发依赖,避免预
|
|
|
33
39
|
|
|
34
40
|
SDK 检查及 Desktop 的 npm Web Host 安装保持官方发布字节和原有 peer 约束,安装后检查完整依赖树,并在报告中保存 `hostDependencies`;成功报告必须与审阅输入一致。官方 Desktop ASAR 按原字节独立验证。固定配套证据与普通 npm 浮动解析分别结算;正式 rc.1 的普通安装由发布矩阵验证。
|
|
35
41
|
|
|
36
|
-
基线和候选分别执行类型及单元检查,候选执行完整浏览器、通知与 test:inbox-ui。Linux 只构建一次候选 .tgz,三个安装 job 下载同一字节,验证摘要后分别在 Linux x64、Windows x64 与 macOS ARM64 运行真实 Loader
|
|
42
|
+
基线和候选分别执行类型及单元检查,候选执行完整浏览器、通知与 test:inbox-ui。Linux 只构建一次候选 .tgz,三个安装 job 下载同一字节,验证摘要后分别在 Linux x64、Windows x64 与 macOS ARM64 运行真实 Loader、网页设置、通知/目标/会话契约、原生桌宠与恢复。项目基线继续保留静态准入断言。既有完整安装断言保留,候选没有跳过完成或接受回执检查。
|
|
37
43
|
|
|
38
44
|
Desktop job 在独立目录下载匹配的官方 macOS ARM64 ZIP,检查摘要、路径及符号链接、完整代码签名和 DeepSeek Team ID;允许的载体运行时由 [desktop-artifact.mjs](../scripts/compatibility/desktop-artifact.mjs) 校验。通知、目标完成与会话契约单独运行于真实 ASAR,随后在官方 Electron 中运行同包安装与桌宠联动。该 GUI 流程的 Web Host/Client 由对应 npm 产物提供,桌宠按产品正常路径使用其声明的独立 Electron 依赖;原生 Desktop shell、通知中心、真实账号模型及物理输入/多屏另行验收。
|
|
39
45
|
|
package/docs/development.md
CHANGED
|
@@ -48,7 +48,9 @@ CI 测试沙箱参数仅供隔离实例;普通安装保留 Chromium sandbox
|
|
|
48
48
|
|
|
49
49
|
## 固定基座验收
|
|
50
50
|
|
|
51
|
-
在干净 checkout 准备 Git、Bash、Node.js 和 Docker
|
|
51
|
+
在干净 checkout 准备 Git、Bash、Node.js 和 Docker。共享基座为 [dsh-plugin-engineering](https://github.com/takboo/dsh-plugin-engineering) 提交 `9ed36752356975cd7d47c11d63744220443c1bf7`,在该提交下阅读 `docs/engineering-contract.md`、`docs/plugin-onboarding.md`、`docs/distribution.md` 和 `docs/test-environments.md`。传入已构建的包,以及包含这个固定提交的基座 checkout。
|
|
52
|
+
|
|
53
|
+
试点的普通浏览器检查在 Linux Docker 内使用锁定的 Chromium。本机 macOS 的浏览器与原生桌面检查按上方隔离环境执行。
|
|
52
54
|
|
|
53
55
|
```bash
|
|
54
56
|
bash scripts/verify-engineering.sh /path/to/dsh-plugin-engineering /path/to/candidate.tgz artifacts/engineering-acceptance
|
|
@@ -56,6 +58,8 @@ bash scripts/verify-engineering.sh /path/to/dsh-plugin-engineering /path/to/cand
|
|
|
56
58
|
|
|
57
59
|
入口从包内构建信息读取源码提交,并核对[宿主目标配置](../tests/engineering-targets.json)和 Web 探针在源码提交、候选包和 checkout 中的字节一致。输出目录需为新路径。基座在 Linux 容器内验证宿主准入、Web 行为和卸载,并把输入摘要和基座身份写入 `host.json`。Coopanion 的 `test:inbox-ui` 在同一个容器镜像内运行,使用同一包和包内锁文件,结果及 Chromium 版本写入 `inbox-ui.log`。
|
|
58
60
|
|
|
61
|
+
DSH 插件管理器通过 `./package.json` 导出读取安装包的顶层 `icon`。发布包校验同时检查导出、图标字节和原始 SVG。升级图标后在真实插件管理器核对实际渲染的 PNG。
|
|
62
|
+
|
|
59
63
|
## 关键行为回归
|
|
60
64
|
|
|
61
65
|
| 改动 | 检查入口与范围 |
|
|
@@ -5,3 +5,4 @@ description:
|
|
|
5
5
|
en: Adds an animated desktop companion with task notifications, session chat, character packs, and native settings for DeepSeek Harness.
|
|
6
6
|
zh: 为 DeepSeek Harness 添加动画桌面伙伴,支持任务提醒、会话聊天、角色包和原生设置。
|
|
7
7
|
tarball: https://github.com/takboo/dsh-coopanion/releases/latest/download/dsh-coopanion.tgz
|
|
8
|
+
icon: https://raw.githubusercontent.com/takboo/dsh-coopanion/main/assets/coopanion.png
|
package/docs/release-notes.md
CHANGED
package/docs/releasing.md
CHANGED
|
@@ -61,6 +61,16 @@ OIDC 认证失败时核对实际 Trusted Publisher 绑定和 job 日志。认证
|
|
|
61
61
|
|
|
62
62
|
## 最近一次发布核验
|
|
63
63
|
|
|
64
|
+
### v0.4.20
|
|
65
|
+
|
|
66
|
+
2026-11-09 发布 [v0.4.20](https://github.com/takboo/dsh-coopanion/releases/tag/v0.4.20),发布源码为 `5febec8cfe35b4b106ab1587157b2f2574136564`,规范包 SHA-256 为 `4591faa7c1164b944ab844bc62cd83bb3cfa10b0ed86b63a5c47e528952cc0c0`。核验时 npm `latest` 为 `0.4.20`,DSH `0.2.2-rc.1` 从 npm 安装精确版本通过。npm tarball、Release 版本包、固定别名及 latest 下载与规范包逐字节一致。[verification.json](https://github.com/takboo/dsh-coopanion/releases/download/v0.4.20/verification.json)
|
|
67
|
+
|
|
68
|
+
[main CI](https://github.com/takboo/dsh-coopanion/actions/runs/42603391595) 通过。发布验证完成七版宿主、三平台共 21 组同包安装,OIDC 发布复用该运行的规范包。[发布验证](https://github.com/takboo/dsh-coopanion/actions/runs/42606722518) · [OIDC 发布](https://github.com/takboo/dsh-coopanion/actions/runs/42609601652)
|
|
69
|
+
|
|
70
|
+
固定基座 `5fe3e92c64d4dfbbcfd3926fb52c347b10cc641e` 的 Linux 容器验证了 DSH `0.2.2-rc.1` 安装、设置和卸载,以及 `0.2.1-rc.4` 拒绝且无残留。Coopanion 收件箱测试同样在 Linux 容器通过。官方 Windows Desktop `0.2.2-rc.1` 的两个隔离 profile 分别验证了插件管理器安装后的真实桌宠窗口,以及冷下载中点击关闭后安装器和连接退出、Host 保持可用。正式复测覆盖隔离 VM 的交互会话。详细身份、检查范围和市场快照见[补充核验记录](https://github.com/takboo/dsh-coopanion/releases/download/v0.4.20/additional-verification.json)。
|
|
71
|
+
|
|
72
|
+
### v0.4.19
|
|
73
|
+
|
|
64
74
|
2026-11-05 已发布 [v0.4.19](https://github.com/takboo/dsh-coopanion/releases/tag/v0.4.19),核验时 npm `latest` 为 `0.4.19`。发布提交为 `28ed7679fe28fabff3f2b2d0fa48e69d85d05a55`,规范包 SHA-256 为 `7f5d0cc83823c25985a99ec30741662e64f17b6185b2fa5dc40ac863d2559ba1`;npm tarball、Release 版本包、固定别名和当时的 latest 下载字节一致。固定身份见该 Release 的 [verification.json](https://github.com/takboo/dsh-coopanion/releases/download/v0.4.19/verification.json),详细范围见[补充核验记录](https://github.com/takboo/dsh-coopanion/releases/download/v0.4.19/additional-verification.json)。
|
|
65
75
|
|
|
66
76
|
[main CI](https://github.com/takboo/dsh-coopanion/actions/runs/41995247279) 和[标签发布流程](https://github.com/takboo/dsh-coopanion/actions/runs/41998629966) 最终通过七版宿主、三平台共 21 组同包安装。首轮标签检查在 DSH `0.2.1-rc.5` 上分别出现 Linux 重启后陪伴模式不符和 Windows Host 退出超时,另有 Windows/DSH `0.2.1-rc.3` 原生窗口未就绪;三项在同源同包、原断言与原期限下复验通过,根因尚未确认,原始失败保留。
|
package/docs/usage.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
### 在 Harness 中从 npm 安装
|
|
12
12
|
|
|
13
|
-
打开侧边栏 **插件 → 添加插件**,在「包名或地址」输入 **`@takboo/dsh-coopanion@0.4.
|
|
13
|
+
打开侧边栏 **插件 → 添加插件**,在「包名或地址」输入 **`@takboo/dsh-coopanion@0.4.21`**,点击安装,再启用 `dsh-coopanion`。显式版本可以避免发布首日的裸包名解析回退,原因见下方。安装方式见 [Harness 官方插件管理说明](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/client/ui-plugin-manager/README.zh.md#安装一个组合包)。
|
|
14
14
|
|
|
15
15
|
### 安装版本与发布时间保护
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@ pnpm 11 的 `minimumReleaseAge` 默认为 1440 分钟(24 小时)。详情页
|
|
|
23
23
|
**Desktop:** 使用 Desktop 自带的 `dsh` 命令。先启动 Desktop 一次初始化 profile,完全退出应用,再执行:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
dsh plugin --profile desktop add @takboo/dsh-coopanion@0.4.
|
|
26
|
+
dsh plugin --profile desktop add @takboo/dsh-coopanion@0.4.21
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
npm 安装的 dsh 不能管理 Desktop 所拥有的 profile;若系统找不到 Desktop 的命令,先在 Desktop 的菜单栏中使用 **Manage dsh command/管理 dsh 命令** 安装命令入口。
|
|
@@ -31,7 +31,7 @@ npm 安装的 dsh 不能管理 Desktop 所拥有的 profile;若系统找不到
|
|
|
31
31
|
**本机 Web profile:** 使用 npm 安装的 dsh 时,向实际使用的 profile 安装。例如默认 `web` profile:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
dsh plugin --profile web add @takboo/dsh-coopanion@0.4.
|
|
34
|
+
dsh plugin --profile web add @takboo/dsh-coopanion@0.4.21
|
|
35
35
|
dsh --profile web
|
|
36
36
|
```
|
|
37
37
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takboo/dsh-coopanion",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.21",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@takboo/dsh-coopanion",
|
|
9
|
-
"version": "0.4.
|
|
9
|
+
"version": "0.4.21",
|
|
10
10
|
"license": "AGPL-3.0-or-later",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"dompurify": "3.4.17",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takboo/dsh-coopanion",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.21",
|
|
4
4
|
"description": "DeepSeek Whale desktop companion and task notifications for DeepSeek Harness",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
@@ -27,14 +27,17 @@
|
|
|
27
27
|
"node": ">=22.19",
|
|
28
28
|
"dsh": "0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3 || 0.2.1-rc.5 || 0.2.2-rc.1"
|
|
29
29
|
},
|
|
30
|
+
"icon": "./assets/coopanion.png",
|
|
30
31
|
"main": "./dist/index.js",
|
|
31
32
|
"exports": {
|
|
32
33
|
".": "./dist/index.js",
|
|
34
|
+
"./package.json": "./package.json",
|
|
33
35
|
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
34
36
|
"./client": "./dist/client.js"
|
|
35
37
|
},
|
|
36
38
|
"files": [
|
|
37
39
|
"dist",
|
|
40
|
+
"assets",
|
|
38
41
|
"desktop",
|
|
39
42
|
"web",
|
|
40
43
|
"web/markdown-runtime.js",
|
|
@@ -97,6 +100,7 @@
|
|
|
97
100
|
"test:m2:host": "node tests/session-host-contract.mjs",
|
|
98
101
|
"compat:discover": "node scripts/compatibility/discover.mjs",
|
|
99
102
|
"compat:prepare": "node scripts/compatibility/prepare.mjs",
|
|
103
|
+
"compat:published": "node scripts/compatibility/published.mjs",
|
|
100
104
|
"compat:check": "node scripts/compatibility/check.mjs",
|
|
101
105
|
"compat:desktop": "node scripts/compatibility/desktop.mjs",
|
|
102
106
|
"compat:report": "node scripts/compatibility/report.mjs"
|
|
@@ -25,6 +25,15 @@ assert.ok(unpack('dist/client.js').includes(`id: ${JSON.stringify(packed.name)}`
|
|
|
25
25
|
if (values['expected-version']) assert.equal(packed.version, values['expected-version'], 'archive version differs from tag');
|
|
26
26
|
else assert.equal(packed.version, pkg.version);
|
|
27
27
|
assert.equal(packed.repository.url, pkg.repository.url);
|
|
28
|
+
assert.equal(packed.icon, './assets/coopanion.png');
|
|
29
|
+
assert.equal(packed.exports['./package.json'], './package.json', 'DSH needs the exported manifest to read the installed icon');
|
|
30
|
+
const icon = execFileSync('tar', ['-xOzf', archive, `package/${packed.icon.slice(2)}`]);
|
|
31
|
+
assert.deepEqual(icon, readFileSync(packed.icon), 'archive icon differs from project icon');
|
|
32
|
+
assert.equal(icon.subarray(0, 8).toString('hex'), '89504e470d0a1a0a');
|
|
33
|
+
assert.equal(icon.readUInt32BE(16), 180);
|
|
34
|
+
assert.equal(icon.readUInt32BE(20), 180);
|
|
35
|
+
assert.ok(icon.length <= 32 * 1024, 'icon must fit the DSH index inline limit');
|
|
36
|
+
assert.ok(entries.includes('package/assets/coopanion.svg'), 'missing original icon source');
|
|
28
37
|
for (const required of ['dist/client.js', 'dist/index.js', 'dist/character-store.cjs', 'dist/figure-server.cjs', 'cordis.patch.yml', 'desktop/main.cjs', 'desktop/tray-state.cjs', 'desktop/preload.cjs', 'web/index.html', 'web/pet.js', 'web/speech.js', 'web/session-ui.js', 'web/chat-contract.js', 'web/chat-contract.d.ts', 'web/text-scale.js', 'web/text-scale.d.ts', 'docs/text-readability-contract.md', 'tests/text-scale-ui.mjs', 'tests/helpers/text-scale-native.mjs', 'src/chat.ts', 'tests/session-host-contract.mjs', 'tests/fixtures/session-host.mjs', 'docs/session-chat-contract.md', 'web/locale.js', 'web/locale.d.ts', 'src/client/locale-sync.ts', 'tests/locale-ui.mjs', 'tests/locale-client.mjs', 'web/reply-markdown.js', 'web/markdown-runtime.js', 'web/tray-icon.js', 'web/upstream/kit/rig.js', 'web/upstream/kit/body.js', 'web/upstream/figure-frame.html', 'web/upstream/body-host.js', 'web/upstream/whale/figure.json', 'web/upstream/whale/model.json', 'web/upstream/whale/tex/face.png', 'web/upstream/UPSTREAM.md', 'web/upstream/THIRD_PARTY_NOTICES.md', 'src/figure-server.ts', 'src/upstream/packs.ts', 'scripts/build.mjs', 'npm-shrinkwrap.json', 'tsconfig.json', 'tsconfig.client.json', '.node-version', 'docs/characters.md', 'examples/star/figure.json', 'examples/star/figure.js', 'tests/figures.test.ts', 'docs/licenses/marked.txt', 'docs/licenses/dompurify.txt', 'THIRD_PARTY_NOTICES.md', 'LICENSE', 'LICENSE-MIT', 'README.md']) assert.ok(entries.includes(`package/${required}`), `missing ${required}`);
|
|
29
38
|
assert.ok(!entries.some(path => path.includes('node_modules/') || path.includes('.cache/')));
|
|
30
39
|
assert.ok(!entries.some(path => /character-runtime|character.schema|\/animation\.|\/character-pack\.(?:[cm]?[jt]s)(?:\.map)?$|\/web\/characters\//.test(path)), 'old engine and format must not be packaged');
|
|
@@ -21,7 +21,11 @@ try {
|
|
|
21
21
|
assert.equal(meta.version, report.version); assert.equal(meta.sourceCommit, report.sourceCommit); assert.equal(meta.targetIdentity, report.target.identity);
|
|
22
22
|
const baseline = JSON.parse(await readFile(join(root, 'package.json'), 'utf8'));
|
|
23
23
|
const archive = join(bundle, `dsh-coopanion-${baseline.version}.tgz`);
|
|
24
|
-
|
|
24
|
+
const bytes = await readFile(archive);
|
|
25
|
+
report.archiveSha256 = createHash('sha256').update(bytes).digest('hex');
|
|
26
|
+
assert.equal(report.archiveSha256, meta.archiveSha256);
|
|
27
|
+
report.package = { name: baseline.name, version: baseline.version, sha256: report.archiveSha256,
|
|
28
|
+
integrity: `sha512-${createHash('sha512').update(bytes).digest('base64')}`, sourceCommit: report.sourceCommit };
|
|
25
29
|
const metadata = await request(`https://registry.npmjs.org/@deepseek-ai%2Fdsh/${report.version}`);
|
|
26
30
|
assert.equal(metadata.dist.integrity, report.target.npm.integrity);
|
|
27
31
|
await copySource(workspace);
|
|
@@ -31,13 +35,17 @@ try {
|
|
|
31
35
|
await npm('platform-install', ['ci', '--ignore-scripts', '--no-audit', '--no-fund'], { setup: true });
|
|
32
36
|
report.hostDependencies = hostDependencies(report.version);
|
|
33
37
|
await npm('host-install', ['install', '--prefix', runtime, '--no-audit', '--no-fund', ...Object.entries(report.hostDependencies).map(([name, exact]) => `${name}@${exact}`)], { setup: true, timeout: 10 * 60000 });
|
|
38
|
+
const lock = JSON.parse(await readFile(join(runtime, 'package-lock.json'), 'utf8'));
|
|
39
|
+
assert.equal(lock.packages['node_modules/@deepseek-ai/dsh'].integrity, report.target.npm.integrity);
|
|
34
40
|
await npm('host-dependency-tree', ['ls', '--all', '--prefix', runtime]);
|
|
35
41
|
await command(report, output, 'normal-admission', process.execPath, [join(workspace, 'scripts/compatibility/admission.mjs'), runtime, report.version, join(bundle, 'candidate.json')], { cwd: workspace, env });
|
|
36
|
-
Object.assign(env, { DSH_TEST_VERSION: report.version, DSH_TEST_RUNTIME: runtime, DSH_TEST_PACKAGE_DIR: bundle });
|
|
42
|
+
Object.assign(env, { DSH_TEST_VERSION: report.version, DSH_TEST_RUNTIME: runtime, DSH_TEST_PACKAGE_DIR: bundle, DSH_TEST_PHASE_FILE: join(output, 'candidate-phases.json') });
|
|
37
43
|
await npm('candidate-installation', ['run', 'test:install'], { timeout: 25 * 60000 });
|
|
38
44
|
report.status = 'partial'; report.reason = 'Actual Loader, browser Client, native companion, notification/goal/session contracts and recovery passed on the same candidate archive and reported exact Host dependency composition; source review and unpinned upstream installations remain separate.';
|
|
39
45
|
} catch (error) { report.status = error instanceof StageError ? error.status : error instanceof FetchError ? 'retry' : 'failed'; report.reason = String(error.stack ?? error).slice(0, 6000); }
|
|
40
46
|
finally {
|
|
47
|
+
try { report.candidatePhases = JSON.parse(await readFile(join(output, 'candidate-phases.json'), 'utf8')); }
|
|
48
|
+
catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
41
49
|
for (const name of await readdir(join(workspace, 'artifacts')).catch(() => [])) if (/\.(json|png)$/.test(name)) await cp(join(workspace, 'artifacts', name), join(output, name));
|
|
42
50
|
report.productionSourcesStable = before === await sourceDigest();
|
|
43
51
|
if (!report.productionSourcesStable) { report.status = 'failed'; report.reason = 'Source files changed during candidate installation'; }
|
|
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';
|
|
|
3
3
|
import { appendFile, readFile, writeFile } from 'node:fs/promises';
|
|
4
4
|
import { pathToFileURL } from 'node:url';
|
|
5
5
|
import { compareVersions, digest, pages, request, version, versionPattern, assertRepository, FetchError } from './common.mjs';
|
|
6
|
+
import { packageName, stableVersion } from '../release-support.mjs';
|
|
6
7
|
import { selectChecks } from './planning.mjs';
|
|
7
8
|
export const desktopFeed = 'https://download.deepseek.com/dsh-desk/feeds/mac-arm64/nightly-mac.yml';
|
|
8
9
|
export function parseDesktopFeed(source) {
|
|
@@ -70,6 +71,13 @@ export async function discover({ manual = '', token, repo, local = false, pullRe
|
|
|
70
71
|
assert(/^[a-f\d]{40}$/.test(commit.sha)); target.commit = commit.sha;
|
|
71
72
|
}
|
|
72
73
|
for (const target of targets) target.identity = digest({ version: target.version, npm: target.npm, release: target.release ?? null, desktop: target.desktop ?? null, commit: target.commit ?? null });
|
|
74
|
+
if (targets.some(target => target.npm.integrity)) {
|
|
75
|
+
const metadata = await request(`https://registry.npmjs.org/${encodeURIComponent(packageName)}/latest`);
|
|
76
|
+
assert.equal(metadata.name, packageName);
|
|
77
|
+
assert.match(metadata.version, stableVersion);
|
|
78
|
+
assert.match(metadata.dist.integrity, /^sha512-[A-Za-z0-9+/]{86}==$/);
|
|
79
|
+
for (const target of targets) target.published = { name: metadata.name, version: metadata.version, integrity: metadata.dist.integrity };
|
|
80
|
+
}
|
|
73
81
|
const selected = selectChecks(targets, issues, { baseline, manual: normalized, pullRequest });
|
|
74
82
|
if (manual) assert.equal(selected.length, 1, 'Exact published target not found');
|
|
75
83
|
return selected;
|
|
@@ -6,7 +6,7 @@ export { validComponents } from './common.mjs';
|
|
|
6
6
|
export function componentIdentities(target) {
|
|
7
7
|
const dependencies = reviewedDependencies(target.version);
|
|
8
8
|
const reviewed = dependencies ? { dependencyBaseline: dependencies, hostDependencies: hostDependencies(target.version) } : {};
|
|
9
|
-
return { sdk: digest({ contract:
|
|
9
|
+
return { sdk: digest({ contract: 2, version: target.version, npm: target.npm, published: target.published, ...reviewed }),
|
|
10
10
|
desktop: target.desktop ? digest({ contract: 1, version: target.version, desktop: target.desktop, npm: target.npm, ...reviewed }) : null };
|
|
11
11
|
}
|
|
12
12
|
export function componentDue(previous, identity, { manual = false, now = Date.now() } = {}) {
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { delimiter, join, resolve } from 'node:path';
|
|
7
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
8
|
+
import { pathToFileURL } from 'node:url';
|
|
9
|
+
import { chromium } from 'playwright-core';
|
|
10
|
+
import { discover } from './discover.mjs';
|
|
11
|
+
import { FetchError, request } from './common.mjs';
|
|
12
|
+
import { hostDependencies } from './reviewed-dependencies.mjs';
|
|
13
|
+
import { commit, isolatedEnv, command, npmCli, StageError } from './runner.mjs';
|
|
14
|
+
import { packageName } from '../release-support.mjs';
|
|
15
|
+
|
|
16
|
+
const scratch = await mkdtemp(join(tmpdir(), 'coopanion-published-'));
|
|
17
|
+
const output = resolve(process.env.DSH_REPORT_DIR ?? 'artifacts/compat-published');
|
|
18
|
+
const runtime = join(scratch, 'runtime');
|
|
19
|
+
const report = { schema: 1, kind: 'published', sourceCommit: commit(), platform: process.platform, arch: process.arch, status: 'running', stages: [] };
|
|
20
|
+
const env = await isolatedEnv(scratch);
|
|
21
|
+
env.PATH = join(runtime, 'node_modules', '.bin') + delimiter + env.PATH;
|
|
22
|
+
env.npm_config_ignore_scripts = 'true';
|
|
23
|
+
const run = (name, file, args, options) => command(report, output, name, file, args, { cwd: scratch, env, ...options });
|
|
24
|
+
const npm = (name, args) => run(name, process.execPath, [npmCli(), ...args], { setup: true });
|
|
25
|
+
let phase = 'setup', browser, host;
|
|
26
|
+
|
|
27
|
+
async function snapshot(path) {
|
|
28
|
+
return readFile(path).catch(error => {
|
|
29
|
+
if (error.code !== 'ENOENT') throw error;
|
|
30
|
+
return null;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function probeWeb(cli, packedProbe) {
|
|
35
|
+
phase = 'browser';
|
|
36
|
+
browser = await chromium.launch({ headless: true, env });
|
|
37
|
+
report.browser = browser.version();
|
|
38
|
+
report.stages.push({ name: phase, status: 'passed' });
|
|
39
|
+
phase = 'web-boot';
|
|
40
|
+
host = spawn(process.execPath, [cli, '--profile', 'probe', '--port', '0', '--no-open'], { cwd: scratch, env, detached: true, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
41
|
+
const url = await new Promise((resolve, reject) => {
|
|
42
|
+
let output = '';
|
|
43
|
+
const timer = setTimeout(() => finish(new StageError('web-boot timeout', 'retry')), 60_000);
|
|
44
|
+
function finish(error, url) {
|
|
45
|
+
clearTimeout(timer);
|
|
46
|
+
if (error) reject(error);
|
|
47
|
+
else resolve(url);
|
|
48
|
+
}
|
|
49
|
+
const observe = chunk => {
|
|
50
|
+
output = (output + chunk).slice(-16000);
|
|
51
|
+
const url = output.match(/http:\/\/127\.0\.0\.1:\d+\/\?token=[A-Za-z0-9_-]+/)?.[0];
|
|
52
|
+
if (url) finish(null, url);
|
|
53
|
+
};
|
|
54
|
+
host.stdout.on('data', observe);
|
|
55
|
+
host.stderr.on('data', observe);
|
|
56
|
+
host.once('error', error => finish(new StageError(error.code, 'retry')));
|
|
57
|
+
host.once('exit', (code, signal) => finish(new StageError(`web-boot exited ${code ?? signal}`, signal ? 'retry' : 'failed')));
|
|
58
|
+
});
|
|
59
|
+
report.stages.push({ name: phase, status: 'passed' });
|
|
60
|
+
phase = 'web-navigation';
|
|
61
|
+
const page = await browser.newPage({ locale: 'en-US' });
|
|
62
|
+
page.setDefaultTimeout(15_000);
|
|
63
|
+
assert((await page.goto(url, { timeout: 30_000 }))?.ok(), 'DSH browser navigation failed');
|
|
64
|
+
report.stages.push({ name: phase, status: 'passed' });
|
|
65
|
+
phase = 'web-ready';
|
|
66
|
+
await packedProbe.prepareClient(page);
|
|
67
|
+
report.stages.push({ name: phase, status: 'passed' });
|
|
68
|
+
phase = 'plugin-web';
|
|
69
|
+
report.observed = await packedProbe.verifyClient(page);
|
|
70
|
+
report.stages.push({ name: phase, status: 'passed' });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
assert.equal(process.platform, 'linux', 'Run the published browser track in Linux Docker');
|
|
75
|
+
report.target = process.env.DSH_TARGET_JSON ? JSON.parse(process.env.DSH_TARGET_JSON)
|
|
76
|
+
: (await discover({ manual: process.env.DSH_VERSION, token: process.env.GH_TOKEN, local: true }))[0];
|
|
77
|
+
assert(report.target, 'Choose an exact DSH target');
|
|
78
|
+
const { version, published } = report.target;
|
|
79
|
+
report.version = version;
|
|
80
|
+
if (!published || !report.target.npm?.integrity) throw new FetchError('Wait for both exact npm publications');
|
|
81
|
+
const metadata = await request(`https://registry.npmjs.org/${encodeURIComponent(packageName)}/${encodeURIComponent(published.version)}`);
|
|
82
|
+
assert.equal(metadata.name, packageName);
|
|
83
|
+
assert.equal(metadata.version, published.version);
|
|
84
|
+
assert.equal(metadata.dist.integrity, published.integrity);
|
|
85
|
+
const bytes = await request(metadata.dist.tarball, { responseType: 'bytes' });
|
|
86
|
+
assert.equal(`sha512-${createHash('sha512').update(bytes).digest('base64')}`, published.integrity);
|
|
87
|
+
report.package = { ...published, sha256: createHash('sha256').update(bytes).digest('hex') };
|
|
88
|
+
const archive = join(scratch, 'published.tgz');
|
|
89
|
+
await writeFile(archive, bytes);
|
|
90
|
+
const readPacked = async path => run('packed-' + path.split('/').at(-1), 'tar', ['-xOf', archive, `package/${path}`], { captureStdout: true });
|
|
91
|
+
const manifest = JSON.parse(await readPacked('package.json'));
|
|
92
|
+
assert.equal(manifest.name, packageName);
|
|
93
|
+
assert.equal(manifest.version, published.version);
|
|
94
|
+
const build = JSON.parse(await readPacked('dist/build-info.json'));
|
|
95
|
+
assert.match(build.commit, /^[a-f0-9]{40}$/);
|
|
96
|
+
assert.equal(build.dirty, false);
|
|
97
|
+
report.package.sourceCommit = build.commit;
|
|
98
|
+
|
|
99
|
+
report.hostDependencies = hostDependencies(version);
|
|
100
|
+
await npm('host-install', ['install', '--prefix', runtime, '--no-audit', '--no-fund', 'pnpm@11.28.5', ...Object.entries(report.hostDependencies).map(([name, exact]) => `${name}@${exact}`)]);
|
|
101
|
+
const lock = JSON.parse(await readFile(join(runtime, 'package-lock.json'), 'utf8'));
|
|
102
|
+
assert.equal(lock.packages['node_modules/@deepseek-ai/dsh'].integrity, report.target.npm.integrity);
|
|
103
|
+
await npm('host-dependency-tree', ['ls', '--all', '--prefix', runtime]);
|
|
104
|
+
const cli = join(runtime, 'node_modules/@deepseek-ai/dsh/lib/bin.js');
|
|
105
|
+
const dsh = (name, args, options) => run(name, process.execPath, [cli, ...args], options);
|
|
106
|
+
assert.equal((await dsh('host-version', ['--version'], { captureStdout: true })).trim(), version);
|
|
107
|
+
const { evaluatePluginCompatibility } = await import(pathToFileURL(join(runtime, 'node_modules/@deepseek-ai/dsh-app-boot/lib/index.js')).href);
|
|
108
|
+
const refusal = evaluatePluginCompatibility(manifest, {}, version);
|
|
109
|
+
const dump = ['--profile', 'probe', '--dump-config'];
|
|
110
|
+
await dsh('profile-setup', ['--from-default-profile', 'web', ...dump], { setup: true });
|
|
111
|
+
const profile = join(env.DSH_HOME, 'profiles', 'probe');
|
|
112
|
+
const profilePaths = ['package.json', 'pnpm-lock.yaml', 'cordis.patch.yml'].map(name => join(profile, name));
|
|
113
|
+
const before = await Promise.all(profilePaths.map(snapshot));
|
|
114
|
+
phase = 'admission';
|
|
115
|
+
await dsh('admission', ['plugin', '--profile', 'probe', 'add', archive], refusal ? {
|
|
116
|
+
expectedRefusal: log => log.includes('engines.dsh') && log.includes(`${manifest.name}@${manifest.version}`)
|
|
117
|
+
&& log.includes(version) && log.includes(manifest.engines.dsh),
|
|
118
|
+
} : {});
|
|
119
|
+
assert.equal(await snapshot(join(profile, 'compatibility.json')), null, 'No compatibility override may be written');
|
|
120
|
+
if (refusal) {
|
|
121
|
+
assert.deepEqual(await Promise.all(profilePaths.map(snapshot)), before, 'Refusal altered profile files');
|
|
122
|
+
assert(!(await dsh('refusal-profile', dump)).includes(packageName), 'Refused package survived in composed profile');
|
|
123
|
+
report.admission = 'refused-as-expected';
|
|
124
|
+
} else {
|
|
125
|
+
const installed = JSON.parse(await readFile(join(profile, 'node_modules', packageName, 'package.json'), 'utf8'));
|
|
126
|
+
assert.equal(installed.version, published.version);
|
|
127
|
+
assert.equal(JSON.parse(await readFile(profilePaths[0], 'utf8')).dependencies[packageName], `file:${archive}`);
|
|
128
|
+
assert((await dsh('admitted-profile', dump)).includes(packageName));
|
|
129
|
+
report.admission = 'admitted';
|
|
130
|
+
const source = await readPacked('tests/engineering-web-probe.mjs');
|
|
131
|
+
report.probeSha256 = createHash('sha256').update(source).digest('hex');
|
|
132
|
+
const probe = join(scratch, 'published-probe.mjs');
|
|
133
|
+
await writeFile(probe, source);
|
|
134
|
+
await probeWeb(cli, await import(pathToFileURL(probe).href));
|
|
135
|
+
}
|
|
136
|
+
report.status = 'passed';
|
|
137
|
+
} catch (error) {
|
|
138
|
+
report.status = error instanceof StageError ? error.status : error instanceof FetchError || phase === 'browser' ? 'retry' : 'failed';
|
|
139
|
+
report.failurePhase = phase;
|
|
140
|
+
// The launch URL is local and contains a one-time token.
|
|
141
|
+
report.reason = String(error.message).replace(/https?:\/\/[^\s"'<>]+/g, '[url]').slice(0, 2000);
|
|
142
|
+
} finally {
|
|
143
|
+
if (host?.pid && host.exitCode === null && host.signalCode === null) {
|
|
144
|
+
const stop = signal => {
|
|
145
|
+
try { process.kill(-host.pid, signal); } catch (error) { if (error.code !== 'ESRCH') throw error; }
|
|
146
|
+
};
|
|
147
|
+
stop('SIGTERM');
|
|
148
|
+
await delay(500);
|
|
149
|
+
stop('SIGKILL');
|
|
150
|
+
}
|
|
151
|
+
await browser?.close();
|
|
152
|
+
await rm(scratch, { recursive: true, force: true });
|
|
153
|
+
await mkdir(output, { recursive: true });
|
|
154
|
+
await writeFile(join(output, 'report.json'), JSON.stringify(report, null, 2) + '\n');
|
|
155
|
+
console.log(JSON.stringify({ status: report.status, admission: report.admission, reason: report.reason }));
|
|
156
|
+
process.exitCode = report.status === 'passed' ? 0 : 1;
|
|
157
|
+
}
|
|
@@ -18,7 +18,7 @@ export function issueBody(target, reports, { status, attempts, runUrl, sourceCom
|
|
|
18
18
|
`Upstream commit: ${safe(target.commit ?? target.npm.commit ?? 'not available; npm publication only')}`,
|
|
19
19
|
`Plugin source commit: \`${safe(sourceCommit)}\`; [Actions evidence](${runUrl})`,
|
|
20
20
|
`Result: **${status}** (attempt ${attempts})`, '',
|
|
21
|
-
...reports.map(r => `- ${r.kind === 'desktop' ? 'Desktop ' : 'SDK '}${safe(r.platform)}/${safe(r.arch)}: **${safe(r.status)}** — ${safe(r.reason)}`), '',
|
|
21
|
+
...reports.map(r => `- ${r.kind === 'desktop' ? 'Desktop ' : r.kind === 'published' ? 'Published npm ' : 'SDK candidate '}${safe(r.platform)}/${safe(r.arch)}: **${safe(r.status)}** — ${safe(r.reason ?? r.admission)}`), '',
|
|
22
22
|
...componentLines(components),
|
|
23
23
|
proposalUrl ? `Dependency proposal: ${proposalUrl}` : '', safe(details), '',
|
|
24
24
|
'This is candidate evidence, not a production compatibility declaration. Formal host support is unchanged. No automatic merge, tag or release.',
|
|
@@ -38,6 +38,26 @@ function componentLines(components = {}) {
|
|
|
38
38
|
export function validateReport(r, target, sourceCommit, kind) {
|
|
39
39
|
assert.equal(r.version, target.version); assert.equal(r.sourceCommit, sourceCommit);
|
|
40
40
|
assert.equal(r.target?.identity, target.identity);
|
|
41
|
+
if (kind === 'published') {
|
|
42
|
+
assert.deepEqual(r.target.published, target.published);
|
|
43
|
+
assert.equal(r.target.npm.integrity, target.npm.integrity);
|
|
44
|
+
assert.equal(r.kind, 'published');
|
|
45
|
+
assert.equal(r.platform, 'linux');
|
|
46
|
+
assert(['passed', 'failed', 'retry'].includes(r.status));
|
|
47
|
+
if (r.status === 'passed') {
|
|
48
|
+
const { sha256, sourceCommit: publishedCommit, ...publication } = r.package;
|
|
49
|
+
assert.deepEqual(publication, target.published);
|
|
50
|
+
assert.match(sha256, /^[a-f\d]{64}$/);
|
|
51
|
+
assert.match(publishedCommit, /^[a-f\d]{40}$/);
|
|
52
|
+
assert(['admitted', 'refused-as-expected'].includes(r.admission));
|
|
53
|
+
assert(r.stages.some(stage => stage.name === 'admission' && stage.status === (r.admission === 'admitted' ? 'passed' : r.admission)));
|
|
54
|
+
if (r.admission === 'admitted') {
|
|
55
|
+
assert.match(r.probeSha256, /^[a-f\d]{64}$/);
|
|
56
|
+
assert(r.stages.some(stage => stage.name === 'plugin-web' && stage.status === 'passed'));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return r;
|
|
60
|
+
}
|
|
41
61
|
assert.equal(r.productionAdmissionChanged, false); assert.equal(r.productionSourcesStable, true);
|
|
42
62
|
assert(['passed', 'partial', 'failed', 'retry'].includes(r.status));
|
|
43
63
|
if (['passed', 'partial'].includes(r.status) && reviewedDependencies(target.version)) {
|
|
@@ -55,7 +75,15 @@ export function validateReport(r, target, sourceCommit, kind) {
|
|
|
55
75
|
}
|
|
56
76
|
} else {
|
|
57
77
|
assert(!r.kind); assert(['darwin/arm64','win32/x64','linux/x64'].includes(`${r.platform}/${r.arch}`));
|
|
58
|
-
if (['passed', 'partial'].includes(r.status))
|
|
78
|
+
if (['passed', 'partial'].includes(r.status)) {
|
|
79
|
+
for (const name of ['host-install', 'normal-admission', 'candidate-installation']) assert(r.stages.some(s => s.name === name && s.status === 'passed'), `Missing SDK stage ${name}`);
|
|
80
|
+
if (target.published) {
|
|
81
|
+
assert.deepEqual(r.candidatePhases, ['admitted', 'host-contracts', 'web-settings-and-native-window']);
|
|
82
|
+
assert.equal(r.package?.sha256, r.archiveSha256);
|
|
83
|
+
assert.equal(r.package?.sourceCommit, sourceCommit);
|
|
84
|
+
assert.match(r.package?.integrity, /^sha512-[A-Za-z0-9+/]{86}==$/);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
59
87
|
}
|
|
60
88
|
if (['passed', 'partial'].includes(r.status)) assert(/^[a-f\d]{64}$/.test(r.archiveSha256));
|
|
61
89
|
return r;
|
|
@@ -70,12 +98,14 @@ export function completedComponents(target, reports, previous, { run, sourceComm
|
|
|
70
98
|
continue;
|
|
71
99
|
}
|
|
72
100
|
const rows = reports.filter(r => key === 'desktop' ? r.kind === 'desktop' : !r.kind);
|
|
73
|
-
|
|
74
|
-
|
|
101
|
+
const published = reports.find(r => r.kind === 'published');
|
|
102
|
+
const hasPublished = key === 'sdk' && Boolean(target.published);
|
|
103
|
+
let status = hasPublished ? aggregate([...rows, published], 4) : aggregate(rows, key === 'desktop' ? 1 : 3);
|
|
104
|
+
if (rows.length > 1 && new Set(rows.map(r => r.archiveSha256)).size !== 1) status = 'failed';
|
|
75
105
|
components[key] = { identity: identities[key], status,
|
|
76
106
|
attempts: old?.identity === identities[key] ? old.attempts + (old.run === run ? 0 : 1) : 1,
|
|
77
107
|
run, sourceCommit, updatedAt: now,
|
|
78
|
-
reason: key === 'desktop' && rows[0]?.reason ? safe(rows[0].reason) : `${rows.length}/${key === 'desktop' ? 1 : 3} component reports received`,
|
|
108
|
+
reason: key === 'desktop' && rows[0]?.reason ? safe(rows[0].reason) : `${rows.length}/${key === 'desktop' ? 1 : 3} component reports received${hasPublished ? `; published npm: ${published?.admission ?? published?.status ?? 'missing'}` : ''}`,
|
|
79
109
|
...(key === 'desktop' && rows[0]?.artifact ? { artifactSha256: rows[0].artifact.sha256 } : {}) };
|
|
80
110
|
}
|
|
81
111
|
return validComponents(components);
|
|
@@ -150,17 +180,17 @@ export async function readArtifacts(directory, target, sourceCommit) {
|
|
|
150
180
|
const candidateDirectory = single?.kind === 'prepare' ? directory : join(directory, 'dsh-candidate-' + target.version);
|
|
151
181
|
try { candidate = JSON.parse(await readFile(join(candidateDirectory, 'candidate.json'), 'utf8')); } catch {}
|
|
152
182
|
const entries = (await readdir(directory).catch(() => [])).map(name => ({ name,
|
|
153
|
-
kind: name.startsWith('dsh-desktop-') ? 'desktop' : name.startsWith('dsh-check-') ? 'sdk' : null }));
|
|
154
|
-
if (single && single.kind !== 'prepare') entries.push({ name: '.', kind: single.kind
|
|
183
|
+
kind: name.startsWith('dsh-desktop-') ? 'desktop' : name.startsWith('dsh-check-') ? 'sdk' : name.startsWith('dsh-published-') ? 'published' : null }));
|
|
184
|
+
if (single && single.kind !== 'prepare') entries.push({ name: '.', kind: single.kind ?? 'sdk' });
|
|
155
185
|
for (const { name, kind } of entries) {
|
|
156
186
|
if (!kind) continue;
|
|
157
187
|
try {
|
|
158
188
|
const r = validateReport(JSON.parse(await readFile(join(directory, name, 'report.json'), 'utf8')), target, sourceCommit, kind);
|
|
159
|
-
if (['passed', 'partial'].includes(r.status)) {
|
|
189
|
+
if (kind !== 'published' && ['passed', 'partial'].includes(r.status)) {
|
|
160
190
|
assert.equal(candidate?.sourceCommit, sourceCommit); assert.equal(candidate?.targetIdentity, target.identity);
|
|
161
191
|
assert.equal(r.archiveSha256, candidate?.archiveSha256, 'All component reports must consume the prepared archive');
|
|
162
192
|
}
|
|
163
|
-
assert(!reports.some(old =>
|
|
193
|
+
assert(!reports.some(old => old.kind === r.kind && old.platform === r.platform && old.arch === r.arch));
|
|
164
194
|
reports.push(r);
|
|
165
195
|
} catch (error) { console.error(`Incomplete report ${name}: ${safe(error.message)}`); }
|
|
166
196
|
}
|
|
@@ -30,7 +30,7 @@ export async function isolatedEnv(scratch) {
|
|
|
30
30
|
return env;
|
|
31
31
|
}
|
|
32
32
|
export class StageError extends Error { constructor(name, status) { super(`${name}: ${status}`); this.status = status; } }
|
|
33
|
-
export async function command(report, output, name, file, args, { cwd = root, env = process.env, setup = false, captureStdout = false, timeout = 15 * 60000 } = {}) {
|
|
33
|
+
export async function command(report, output, name, file, args, { cwd = root, env = process.env, setup = false, captureStdout = false, expectedRefusal, timeout = 15 * 60000 } = {}) {
|
|
34
34
|
await mkdir(output, { recursive: true });
|
|
35
35
|
let log = '', stdout = '', timedOut = false, error;
|
|
36
36
|
const result = await new Promise(done => {
|
|
@@ -49,11 +49,14 @@ export async function command(report, output, name, file, args, { cwd = root, en
|
|
|
49
49
|
});
|
|
50
50
|
log = log.replace(/(token|password|authorization)\s*[=:]\s*[^\s]+/gi, '$1=[redacted]');
|
|
51
51
|
await writeFile(join(output, name + '.log'), log);
|
|
52
|
-
const
|
|
52
|
+
const refused = result.code > 0 && !result.signal && !error && !timedOut && expectedRefusal?.(log);
|
|
53
|
+
let status = subprocessStatus({ ...result, error, timedOut, setup, log });
|
|
54
|
+
if (refused) status = 'refused-as-expected';
|
|
55
|
+
else if (expectedRefusal && status === 'passed') status = 'failed';
|
|
53
56
|
report.stages.push({ name, status, exitCode: result.code, signal: result.signal, timedOut });
|
|
54
57
|
await writeFile(join(output, 'report.json'), JSON.stringify(report, null, 2) + '\n');
|
|
55
58
|
console.log(`${name}: ${status}`);
|
|
56
|
-
if (status !== 'passed') { console.error(log.slice(-6000)); throw new StageError(name, status); }
|
|
59
|
+
if (status !== 'passed' && status !== 'refused-as-expected') { console.error(log.slice(-6000)); throw new StageError(name, status); }
|
|
57
60
|
return captureStdout ? stdout : log;
|
|
58
61
|
}
|
|
59
62
|
export const npmCli = () => { if (!process.env.npm_execpath) throw new Error('Run through npm run compat:<command>'); return process.env.npm_execpath; };
|
|
@@ -7,7 +7,7 @@ if [[ $# -ne 3 ]]; then
|
|
|
7
7
|
fi
|
|
8
8
|
|
|
9
9
|
root="$(cd "$(dirname "$0")/.." && pwd -P)"
|
|
10
|
-
engineering_commit=
|
|
10
|
+
engineering_commit=9ed36752356975cd7d47c11d63744220443c1bf7
|
|
11
11
|
targets="$root/tests/engineering-targets.json"
|
|
12
12
|
probe="$root/tests/engineering-web-probe.mjs"
|
|
13
13
|
report_dir=$3
|
|
@@ -274,3 +274,35 @@ test('Desktop resolution preserves package subpath exports, relative chunks and
|
|
|
274
274
|
const result = spawnSync(process.execPath, ['--import='+bootstrap, probe], { env: { ...process.env, COOPANION_ASAR_SDK: sdk }, encoding: 'utf8' });
|
|
275
275
|
assert.equal(result.status, 0, result.stderr); assert.deepEqual(JSON.parse(result.stdout), ['asar','asar-operation','asar']);
|
|
276
276
|
});
|
|
277
|
+
|
|
278
|
+
test('published npm evidence binds the selected artifact and does not substitute for the candidate', () => {
|
|
279
|
+
const published = { name: baseline.name, version: '0.4.20', integrity: 'sha512-test-publication' };
|
|
280
|
+
const observedTarget = { ...target, published };
|
|
281
|
+
assert.notEqual(componentIdentities(observedTarget).sdk, componentIdentities(target).sdk);
|
|
282
|
+
const report = {
|
|
283
|
+
kind: 'published', platform: 'linux', arch: 'x64', sourceCommit, version, target: observedTarget,
|
|
284
|
+
status: 'passed', admission: 'refused-as-expected',
|
|
285
|
+
package: { ...published, sha256: 'c'.repeat(64), sourceCommit: 'd'.repeat(40) },
|
|
286
|
+
stages: [{ name: 'admission', status: 'refused-as-expected' }],
|
|
287
|
+
};
|
|
288
|
+
assert.equal(validateReport(report, observedTarget, sourceCommit, 'published'), report);
|
|
289
|
+
assert.throws(() => validateReport({ ...report, package: { ...report.package, integrity: 'other' } }, observedTarget, sourceCommit, 'published'));
|
|
290
|
+
const candidates = Array.from({ length: 3 }, () => ({ status: 'partial', archiveSha256: 'e'.repeat(64) }));
|
|
291
|
+
const outcome = reports => completedComponents(observedTarget, reports, {}, { run: '123', sourceCommit }).sdk.status;
|
|
292
|
+
assert.equal(outcome(candidates), 'retry');
|
|
293
|
+
assert.equal(outcome([report]), 'retry');
|
|
294
|
+
assert.equal(outcome([...candidates, report]), 'partial');
|
|
295
|
+
assert.equal(outcome([...candidates, { ...report, status: 'failed' }]), 'failed');
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
test('only an actual Host refusal counts as expected', async t => {
|
|
299
|
+
const directory = await mkdtemp(join(tmpdir(), 'coopanion-refusal-'));
|
|
300
|
+
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
301
|
+
const report = { stages: [] };
|
|
302
|
+
const opts = { expectedRefusal: log => log.includes('engines.dsh rejection') };
|
|
303
|
+
const run = source => command(report, directory, 'admission', process.execPath, ['-e', source], opts);
|
|
304
|
+
await run('console.error("engines.dsh rejection"); process.exitCode = 1');
|
|
305
|
+
await assert.rejects(run('console.error("engines.dsh rejection")'), { status: 'failed' });
|
|
306
|
+
await assert.rejects(run('console.error("ECONNRESET"); process.exitCode = 1'), { status: 'retry' });
|
|
307
|
+
assert.deepEqual(report.stages.map(stage => stage.status), ['refused-as-expected', 'failed', 'retry']);
|
|
308
|
+
});
|
package/tests/install.mjs
CHANGED
|
@@ -94,6 +94,13 @@ let hostUrl;
|
|
|
94
94
|
let settingsPage;
|
|
95
95
|
const uiErrors = [];
|
|
96
96
|
const consoleErrors = [];
|
|
97
|
+
const phaseFile = process.env.DSH_TEST_PHASE_FILE;
|
|
98
|
+
const phases = [];
|
|
99
|
+
async function recordPhase(phase) {
|
|
100
|
+
if (!phaseFile) return;
|
|
101
|
+
phases.push(phase);
|
|
102
|
+
await writeFile(phaseFile, JSON.stringify(phases) + '\n');
|
|
103
|
+
}
|
|
97
104
|
let hostLog = '';
|
|
98
105
|
|
|
99
106
|
async function run(command, args, cwd = project, timeoutMs = 240000) {
|
|
@@ -177,11 +184,14 @@ try {
|
|
|
177
184
|
assert.equal(existsSync(join(profile, 'compatibility.json')), false, 'no risk exemption is used');
|
|
178
185
|
const installed = join(profile, 'node_modules', manifest.name);
|
|
179
186
|
assert.equal(JSON.parse(await readFile(join(installed, 'package.json'), 'utf8')).version, manifest.version);
|
|
187
|
+
await recordPhase('admitted');
|
|
180
188
|
await run(process.execPath, [join(project, 'tests/notification-host-contract.mjs'), '--runtime', runtime, '--version', version]);
|
|
181
189
|
|
|
182
190
|
await run(process.execPath, [join(project, 'tests/goal-host-contract.mjs'), '--runtime', runtime, '--version', version, '--package', archive]);
|
|
183
191
|
await run(process.execPath, [join(project, 'tests/session-host-contract.mjs'), '--verify-plugin', '--runtime', runtime, '--version', version, '--package', archive]);
|
|
184
192
|
|
|
193
|
+
await recordPhase('host-contracts');
|
|
194
|
+
|
|
185
195
|
// Keep the observer in its own package. The Client loader identifies packages
|
|
186
196
|
// from ancestor manifests; a fixture inside this repository can be mistaken
|
|
187
197
|
// for a second active copy of the installed dsh-coopanion client.
|
|
@@ -334,6 +344,7 @@ try {
|
|
|
334
344
|
await settings.getByRole('navigation', { name: '会话层级', exact: true }).filter({ hasText: '安装验证' }).waitFor();
|
|
335
345
|
assert.equal(await page.locator('#chat-session-name').innerText(), '安装验证');
|
|
336
346
|
await openPetSettings(settings);
|
|
347
|
+
await recordPhase('web-settings-and-native-window');
|
|
337
348
|
const surface = settings.getByTestId('coopanion-settings');
|
|
338
349
|
await surface.waitFor();
|
|
339
350
|
console.log('Official DSH settings page loaded; checking controls and persisted preferences…');
|