dsh-deeppilot 0.9.4 → 0.9.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/COMPATIBILITY.md +83 -11
- package/PRIVACY.md +2 -2
- package/README.md +28 -33
- package/README.zh-CN.md +24 -26
- package/SECURITY.md +2 -1
- package/cordis.patch.yml +1 -1
- package/docs/DEVICE_REGISTRY_RECOVERY.md +87 -0
- package/docs/DEVICE_REGISTRY_RECOVERY.zh-CN.md +73 -0
- package/docs/DSH_RELEASE_MEMORY.md +544 -13
- package/docs/NPM_PUBLISHING.md +88 -0
- package/docs/SECURITY_ROADMAP.md +9 -4
- package/docs/SECURITY_ROADMAP.zh-CN.md +9 -4
- package/lib/client.js +5 -5
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +57 -6
- package/lib/index.js.map +1 -1
- package/locale/en.json +1 -1
- package/package.json +19 -15
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# npm 可信发布说明
|
|
2
|
+
|
|
3
|
+
## 一、发布方式
|
|
4
|
+
|
|
5
|
+
1. `.github/workflows/publish.yml` 使用 GitHub 托管的运行器,通过
|
|
6
|
+
OpenID Connect(OIDC,开放身份连接)向 npm 获取临时发布凭据;无需配置
|
|
7
|
+
`NPM_TOKEN` 或 `NODE_AUTH_TOKEN`。来源证明(Provenance)将关联公开仓库、
|
|
8
|
+
工作流和本次运行的源码提交。
|
|
9
|
+
2. 工作流仅由 `workflow_dispatch`(手动触发)启动;推送提交、标签或创建
|
|
10
|
+
GitHub Release(发布页)不会自动上传 npm 包。手动运行须使用对应版本标签,
|
|
11
|
+
不能在 `main` 上运行后另行检出标签,否则来源证明的提交会与源码不一致。
|
|
12
|
+
3. 发布环境使用 Node.js 22 与固定的 npm `11.21.0`;npm 官方要求可信发布至少使用
|
|
13
|
+
npm `11.5.1` 和 Node.js `22.14.0`。稳定版使用 `latest`(稳定分发标签),
|
|
14
|
+
预发布版使用 `alpha`(预发布分发标签),与原有发布策略一致。
|
|
15
|
+
|
|
16
|
+
## 二、npm 网站绑定
|
|
17
|
+
|
|
18
|
+
1. 将工作流合入默认分支 `main` 后,打开
|
|
19
|
+
[dsh-deeppilot 包设置](https://www.npmjs.com/package/dsh-deeppilot/access),
|
|
20
|
+
在 Trusted Publisher(可信发布者)区域选择 GitHub Actions(GitHub 工作流)。
|
|
21
|
+
2. 按下表配置,字段大小写必须一致:
|
|
22
|
+
|
|
23
|
+
| npm 字段 | 含义 | 填写值 |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| Organization or user | GitHub 组织或用户 | `Mars-Sea` |
|
|
26
|
+
| Repository | 仓库名称 | `dsh-deeppilot` |
|
|
27
|
+
| Workflow filename | 工作流文件名 | `publish.yml` |
|
|
28
|
+
| Environment name | 部署环境名称 | 留空,本工作流未使用部署环境 |
|
|
29
|
+
| Allow npm publish | 允许直接发布 | 勾选 |
|
|
30
|
+
| Allow npm dist-tag | 允许独立修改分发标签 | 无需勾选,工作流通过发布命令设置标签 |
|
|
31
|
+
|
|
32
|
+
3. 工作流文件名只填 `publish.yml`,不填 `.github/workflows/` 前缀。
|
|
33
|
+
新建绑定默认只允许暂存发布(`npm stage publish`),须明确允许 `npm publish`。
|
|
34
|
+
npm 不在保存配置时验证绑定;首次发布成功才证明认证可用。
|
|
35
|
+
4. 新绑定必须在 **2 天内完成首次成功发布**。因此准备好新版本后再绑定;若过期,
|
|
36
|
+
删除过期绑定并重新创建。先验证可信发布成功,再按需调整原有令牌发布权限。
|
|
37
|
+
|
|
38
|
+
## 三、每次发布
|
|
39
|
+
|
|
40
|
+
1. 按项目 `AGENTS.md` 的发布清单完成验证,同时更新 `package.json`、
|
|
41
|
+
`package-lock.json` 顶层与根包条目的版本;提交并推送,等待持续集成(CI)通过。
|
|
42
|
+
版本提交必须已经进入 `main`,且该提交包含 `publish.yml`。
|
|
43
|
+
2. 经用户授权发布该版本后,从精确的发布提交创建并推送附注标签 `v<版本>`,
|
|
44
|
+
准备包含英文与简体中文说明的 GitHub 发布草稿。
|
|
45
|
+
3. 在对应标签上手动运行工作流。下例的 `0.9.5` 仅为示例,替换为已授权发布的版本:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
gh workflow run publish.yml --repo Mars-Sea/dsh-deeppilot --ref v0.9.5 \
|
|
49
|
+
-f version=0.9.5 -f dist_tag=latest
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
预发布示例:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
gh workflow run publish.yml --repo Mars-Sea/dsh-deeppilot --ref v0.9.5-alpha.1 \
|
|
56
|
+
-f version=0.9.5-alpha.1 -f dist_tag=alpha
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
4. 工作流验证输入、标签、两处锁文件版本、包仓库与运行提交一致;拒绝轻量标签、
|
|
60
|
+
尚未合入 `main` 的提交、分发标签错配和构建元数据。随后执行依赖安全检查、
|
|
61
|
+
插件测试、类型检查、构建产物一致性检查、DSH 配置校验、Go 测试和辅助程序校验和。
|
|
62
|
+
5. 工作流检查包内容并生成压缩包,再发布该压缩包,显式要求来源证明。
|
|
63
|
+
压缩包发布跳过生命周期脚本(`--ignore-scripts`);测试、类型检查和构建已在前序
|
|
64
|
+
步骤执行,打包仍执行 `prepack`(打包前构建)。发布后核对版本、分发标签、
|
|
65
|
+
压缩包完整性和来源证明元数据。
|
|
66
|
+
6. 确认 npm 包可安装,在全新 DSH 配置中完成安装验证后,再公开 GitHub 发布草稿。
|
|
67
|
+
工作流不自动公开发布草稿;npm 上传和发布后的核对分别记录在步骤中。
|
|
68
|
+
|
|
69
|
+
## 四、失败处理与证据边界
|
|
70
|
+
|
|
71
|
+
1. 认证失败先核对 npm 绑定中的仓库、大小写、`publish.yml` 和直接发布权限。
|
|
72
|
+
`npm whoami`(当前账号查询)不能验证 OIDC 发布权限。
|
|
73
|
+
2. 若 npm 上传成功而后续核对失败,先检查注册表;已存在的版本不能通过重跑覆盖。
|
|
74
|
+
排查来源证明或分发标签后再决定下一步,禁止把核对失败直接当作上传失败。
|
|
75
|
+
发布核对会绕过元数据缓存并有限重试;人工查询使用 `npm view --prefer-online`,
|
|
76
|
+
以免继续读取发布前的旧版本列表或缓存的 404 响应。
|
|
77
|
+
3. 本地语法检查、测试和打包不能证明 npm 绑定已生效;真实 OIDC 认证与来源证明
|
|
78
|
+
需要首次获授权的新版本发布才能验证。已有旧版本的认证状态不因新增工作流改变。
|
|
79
|
+
4. `0.9.5` 已完成首次 OIDC 身份认证发布;npm 绑定显示 `Valid`(有效),
|
|
80
|
+
来源证明签名、压缩包摘要与两个支持宿主的注册表安装核验通过。首次运行的末尾
|
|
81
|
+
核对因缓存失败,其上传步骤成功;发布证据及边界见 `docs/DSH_RELEASE_MEMORY.md`。
|
|
82
|
+
|
|
83
|
+
## 五、官方资料
|
|
84
|
+
|
|
85
|
+
1. [npm 可信发布配置与限制](https://docs.npmjs.com/trusted-publishers/)
|
|
86
|
+
2. [npm 来源证明要求](https://docs.npmjs.com/generating-provenance-statements/)
|
|
87
|
+
3. [GitHub 手动运行工作流](https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow)
|
|
88
|
+
4. [GitHub 工作流调度接口:运行引用支持分支或标签](https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event)
|
package/docs/SECURITY_ROADMAP.md
CHANGED
|
@@ -14,11 +14,16 @@ Status: implemented on the development branch. `PROTOCOL.md` is normative. Proto
|
|
|
14
14
|
- minimal unauthenticated health response; no Bearer or URL credentials;
|
|
15
15
|
- privacy-preserving audit identifiers, a global connection switch, and per-device deletion; scopes remain enforced at the protocol layer.
|
|
16
16
|
|
|
17
|
+
- shared canonical/signature vectors (`tests/fixtures/auth-vectors.json`) read by both the TypeScript tests and the iOS tests, with signatures from Node and from CryptoKit;
|
|
18
|
+
- abuse tests for malformed requests, connection churn, replay, expired and altered challenges, and many-source pressure (`tests/auth-hardening.test.ts`);
|
|
19
|
+
- documented local recovery when `devices-v2.json` is lost ([DEVICE_REGISTRY_RECOVERY.md](./DEVICE_REGISTRY_RECOVERY.md)).
|
|
20
|
+
|
|
21
|
+
## Decided
|
|
22
|
+
|
|
23
|
+
- High-impact approval responses do **not** require a fresh local biometric/user-presence confirmation (decided 2026-10-12). Revisit if the threat model changes, for example a phone shared between people.
|
|
24
|
+
|
|
17
25
|
## Remaining release validation
|
|
18
26
|
|
|
19
|
-
- share fixed canonical/signature vectors between TypeScript and Swift tests;
|
|
20
27
|
- exercise pairing, reconnect/resume, and per-device deletion through both real LAN and Funnel paths;
|
|
21
|
-
-
|
|
22
|
-
- document local recovery when `devices-v2.json` is lost;
|
|
23
|
-
- decide whether high-impact approval responses should require fresh local biometric/user-presence confirmation;
|
|
28
|
+
- an authenticated socket still accepts a second `c2s.auth.prove` and answers it with another welcome and resume replay; the gate should answer `E_PROTOCOL` instead (tracked as a `todo` test);
|
|
24
29
|
- keep dependency scanning and CodeQL green, then sign and notarize every distributed helper before claiming production readiness.
|
|
@@ -14,11 +14,16 @@
|
|
|
14
14
|
- 最小化匿名探活响应,不接受 Bearer 或 URL 凭据;
|
|
15
15
|
- 隐私化审计标识、全局连接开关和逐设备删除入口;scope 继续由协议层强制执行。
|
|
16
16
|
|
|
17
|
+
- TypeScript 与 Swift 测试共用的固定规范化编码/签名向量(`tests/fixtures/auth-vectors.json`),签名分别来自 Node 与 CryptoKit;
|
|
18
|
+
- 畸形请求、连接抖动、重放、挑战过期/被篡改和多来源压力的滥用测试(`tests/auth-hardening.test.ts`);
|
|
19
|
+
- `devices-v2.json` 丢失后的本机恢复流程([DEVICE_REGISTRY_RECOVERY.zh-CN.md](./DEVICE_REGISTRY_RECOVERY.zh-CN.md))。
|
|
20
|
+
|
|
21
|
+
## 已决定
|
|
22
|
+
|
|
23
|
+
- 高影响审批响应**不**要求新的本地生物识别/用户在场确认(2026-10-12 决定)。如威胁模型变化(例如手机多人共用)再重新评估。
|
|
24
|
+
|
|
17
25
|
## 发布前剩余验证
|
|
18
26
|
|
|
19
|
-
- 在 TypeScript 与 Swift 测试间共享固定的规范化编码/签名向量;
|
|
20
27
|
- 通过真实 LAN 与 Funnel 验证配对、重连/恢复和逐设备删除;
|
|
21
|
-
-
|
|
22
|
-
- 记录 `devices-v2.json` 丢失后的本机恢复流程;
|
|
23
|
-
- 决定高影响审批是否要求新的本地生物识别/用户在场确认;
|
|
28
|
+
- 已认证的 socket 仍会接受第二次 `c2s.auth.prove`,并再回一次 welcome 与重放;门应改为回 `E_PROTOCOL`(以 `todo` 测试跟踪);
|
|
24
29
|
- 保持依赖扫描与 CodeQL 通过,并在宣称生产可用前签名、公证所有分发 helper。
|
package/lib/client.js
CHANGED
|
@@ -545,7 +545,7 @@ window.__ModuleLoader__.load({
|
|
|
545
545
|
"push.testPush": "发送测试通知",
|
|
546
546
|
"push.relayTesting": "测试中…",
|
|
547
547
|
"push.pushSending": "发送中…",
|
|
548
|
-
"push.relayDefault": "
|
|
548
|
+
"push.relayDefault": "验证这台电脑到推送中继的连通性与自动注册是否正常。",
|
|
549
549
|
"push.pushDefault": "向所有已注册设备强制发送一条真实推送(不受在线状态与分类开关影响)。",
|
|
550
550
|
"push.relayOk": "通过",
|
|
551
551
|
"push.relayBad": "存在问题",
|
|
@@ -656,7 +656,7 @@ window.__ModuleLoader__.load({
|
|
|
656
656
|
en: {
|
|
657
657
|
"nav": "DeepPilot",
|
|
658
658
|
"meta.title": "DeepPilot",
|
|
659
|
-
"meta.intro": "Connect your iPhone to DeepSeek Harness (DSH) on this
|
|
659
|
+
"meta.intro": "Connect your iPhone to DeepSeek Harness (DSH) on this computer (protocol v2).",
|
|
660
660
|
"meta.refresh": "Refresh",
|
|
661
661
|
"master.title": "DeepPilot connection",
|
|
662
662
|
"master.loading": "Loading settings…",
|
|
@@ -763,7 +763,7 @@ window.__ModuleLoader__.load({
|
|
|
763
763
|
"push.testPush": "Send test notification",
|
|
764
764
|
"push.relayTesting": "Testing…",
|
|
765
765
|
"push.pushSending": "Sending…",
|
|
766
|
-
"push.relayDefault": "Verify
|
|
766
|
+
"push.relayDefault": "Verify this computer → push relay connectivity and zero-touch enrollment.",
|
|
767
767
|
"push.pushDefault": "Force one real push to every registered device (ignores online state and category switches).",
|
|
768
768
|
"push.relayOk": "OK",
|
|
769
769
|
"push.relayBad": "Issues found",
|
|
@@ -814,7 +814,7 @@ window.__ModuleLoader__.load({
|
|
|
814
814
|
"help.step2": "When the status shows \"Awaiting Tailscale authorization\", click \"Open authorization page\".",
|
|
815
815
|
"help.step3": "Sign in with an account that can manage this Tailnet and follow the on-page prompts to enable Funnel. Owner / Admin / Network admin is usually required.",
|
|
816
816
|
"help.step4": "Come back to this page and click \"Refresh\". When a green dot appears next to the remote title, scan the QR code below to add your phone.",
|
|
817
|
-
"help.funnelHint": "The plugin bundles the Tailscale networking stack, so neither this
|
|
817
|
+
"help.funnelHint": "The plugin bundles the Tailscale networking stack, so neither this computer nor the phone needs the Tailscale app — but a Tailnet administrator must approve first-time use.",
|
|
818
818
|
"help.httpsTitle": "If authorization does not complete: enable HTTPS",
|
|
819
819
|
"help.httpsStep1": "Open the Tailscale admin console → Network → DNS.",
|
|
820
820
|
"help.httpsStep2": "Confirm MagicDNS is enabled.",
|
|
@@ -826,7 +826,7 @@ window.__ModuleLoader__.load({
|
|
|
826
826
|
"help.faqTitle": "Frequently asked questions",
|
|
827
827
|
"help.faq1": "\"HTTPS must be enabled\" — finish the HTTPS Certificates steps above.",
|
|
828
828
|
"help.faq2": "\"Funnel not available\" — make sure the nodeAttrs snippet is saved and this node is in the rule's target.",
|
|
829
|
-
"help.faq3": "Public URL exists but the phone times out: wait a few minutes, confirm the
|
|
829
|
+
"help.faq3": "Public URL exists but the phone times out: wait a few minutes, confirm the computer is awake and DSH is running, then re-scan the latest QR code.",
|
|
830
830
|
"help.faq4": "No public URL: check that Tailscale authorization completed, then click \"Refresh\" or restart DSH.",
|
|
831
831
|
"help.securityTitle": "Security notes",
|
|
832
832
|
"help.security1": "A Funnel URL is public, but every connection requires a signature from a paired device P-256 private key. Do not share a pairing QR while it is valid.",
|