device-center 0.2.0-beta.4 → 0.2.0-beta.5

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/CONTRIBUTING.md CHANGED
@@ -8,4 +8,4 @@ Preserve the compact sidebar, optional MCP setup, truthful device states, and se
8
8
 
9
9
  Never add real secrets to prompts, packages, fixture data or logs. SSH observation is an explicit owner action using a fixed script, isolated configuration, existing authentication and strict host trust; GET and MCP must never trigger connections. Tests inject subprocess results and do not contact real hosts. Resource enrollment, Agent installation, network discovery, tunnels, cloud deployment and remote tasks require separately scoped implementation and review. Do not run service installation or Docker deployment merely to validate a UI change. Keep user data and unrelated services intact.
10
10
 
11
- Pull requests run the existing checks and tests on GitHub-hosted macOS and Ubuntu. Main pushes additionally validate and build on the repository's dedicated MBM-24 and MBP-16 runners. These runners reject PR jobs and hold no production credentials. After the complete main CI succeeds, a separate GitHub-hosted production job builds the exact SHA, deploys through a restricted receiver, verifies public bytes and login protection, and confirms health or restores the previous code. See [delivery configuration](docs/development/delivery-profile.md) for the authorized channel, activation evidence, credentials boundary and recovery. npm publication remains a separate release.
11
+ Pull requests run the existing checks and tests on GitHub-hosted macOS and Ubuntu. Main pushes additionally validate and build on two dedicated self-hosted macOS runners registered only to this repository. These runners reject PR jobs and hold no production credentials. After the complete main CI succeeds, a separate GitHub-hosted production job builds the exact SHA, deploys through a restricted receiver, verifies public bytes and login protection, and confirms health or restores the previous code. See [delivery configuration](docs/development/delivery-profile.md) for the authorized channel, activation evidence, credentials boundary and recovery. npm publication remains a separate release.
package/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  界面与 Agent 安装说明支持简中、繁中、英、日、韩、西、法、德、巴西葡语。页面顶部可切换,也可分享 `/start?lang=en`、`/start?lang=ja`。详见[多语言说明](docs/i18n.md)。
4
4
 
5
- 让主力电脑上的智能体,使用自己的闲置设备。MIT · Node.js 24 · macOS / Linux · beta。
5
+ 让主力电脑上的智能体,使用自己的闲置设备。MIT · Node.js 24 · macOS / Linux / Windows 11 预览 · beta。
6
6
 
7
7
  一个本机连接器,加一个可选的云端控制面。真实本机内存、磁盘分别展示;已有 SSH 配置可一键关联并执行固定只读检查;设备 Agent 可通过域名绑定账号,主动回报状态。指定日志经设备主人单独授权后,以双向 TLS 1.3 直连或密文中转读取。没有默认示例设备或虚构在线状态。
8
8
 
9
9
  ## 快速使用
10
10
 
11
- ### 简化接入(beta.4 开发候选,尚未发布)
11
+ ### 简化接入(0.2.0-beta.5)
12
12
 
13
13
  一页指南明确提供 **交给 Agent/手动安装**,目标设备不需要先安装 AI Agent:
14
14
 
@@ -21,10 +21,12 @@
21
21
 
22
22
  有浏览器的设备无需搬运配对码,也不需要回 Agent 回复“已批准”。无浏览器服务器可选手动安装:目标终端运行脚本,在另一台电脑登录控制面,填入终端码、核对指纹并批准。全新安装脚本会配置用户级后台服务;已有安装时停止并保留设置。AI Agent/MCP 仅是管理电脑的可选能力。身份私钥留在设备;安装绑定只允许资源回报,远程日志仍需另外授权。[手动步骤与排查](docs/agent-install.md#手动安装目标设备没有-ai-agent)
23
23
 
24
- 当前公开 npm 仍为 **0.2.0-beta.3**;下面的已发布命令保持可用。新流程需要新版控制面与 CLI 一起交付。
24
+ 本指南固定 **0.2.0-beta.5**,新增 Windows 11 预览接入。无需 AI Agent 或 AD 域,使用普通用户 PowerShell、Node.js 24+,按 [Windows 11 验收](docs/windows-acceptance.md)操作;安装前以公开 npm registry 的版本记录为准。Windows 11 后台与真实绑定仍需实机验收。官方控制面已包含登录恢复修复,旧客户端仍可终端填码。
25
25
 
26
26
  希望交给本机 Agent 安装时,按[Agent 安装指南](docs/agent-install.md)选择本机、官方托管或已有自建服务。“交给 Agent 安装”可直接复制完整说明;登录和设备绑定仍由用户核对。朋友试用从[一页指南](https://devices.owenshen.top/start)开始,无需先登录。
27
27
 
28
+ 0.2.0-beta.4 增加 `connect --browser --confirm` 浏览器交接、并列的 Agent/手动安装脚本与图形指引;无浏览器设备仍可终端填码。
29
+
28
30
  0.2.0-beta.3 增加九语言界面与安装说明,语言菜单支持键盘、窄屏与输入保留。长文档和 CLI 仍以中文为主。
29
31
 
30
32
  0.2.0-beta.2 增加设备命名、类型、用途、标签、手动服务清单及“采集一次”,见[设备说明与手动采集](docs/device-profiles.md)。旧 Driver 需升级后才能响应云端手动采集;服务与应用仍由用户手动登记。
@@ -34,7 +36,7 @@
34
36
  只用本机,不注册账号:
35
37
 
36
38
  ```sh
37
- npx --yes device-center@0.2.0-beta.3 start
39
+ npx --yes device-center@0.2.0-beta.5 start
38
40
  ```
39
41
 
40
42
  打开 `http://127.0.0.1:5174`,将 `/mcp` 添加到本机智能体。侧栏“开始使用”按管理电脑 → 智能体 → 设备引导;导入 SSH 后检查一次连通性。没有可用 Agent/SSH 的设备保持未知;资源快照过期显示“待刷新”,不代表密钥过期。列表刷新不主动连接 SSH。
@@ -42,12 +44,12 @@ npx --yes device-center@0.2.0-beta.3 start
42
44
  需要在外查看设备、使用日志中转:
43
45
 
44
46
  ```sh
45
- npx --yes device-center@0.2.0-beta.3 plan
46
- npx --yes device-center@0.2.0-beta.3 connect --confirm
47
+ npx --yes device-center@0.2.0-beta.5 plan
48
+ npx --yes device-center@0.2.0-beta.5 connect --browser --confirm
47
49
  # 自建控制面可指定 --cloud https://devices.example.com
48
50
  ```
49
51
 
50
- 默认 [官方控制面](https://devices.owenshen.top),登录自己的 App Services/个人站统一账号。在面板输入终端的五分钟配对码,核对完整公钥指纹和回报范围并批准。私钥留在设备,不放进脚本、prompt 或压缩包。默认不分享 SSH 信息、不开 LAN 端口、不安装后台服务。配对只授权资源回报。
52
+ 默认 [官方控制面](https://devices.owenshen.top),浏览器自动打开本次申请,登录自己的 App Services/个人站统一账号,核对终端的完整公钥指纹和回报范围并批准一次。没有浏览器时去掉 `--browser`,在另一台电脑填写终端的五分钟配对码。私钥留在设备,不放进脚本、prompt 或压缩包。默认不分享 SSH 信息、不开 LAN 端口、不安装后台服务。配对只授权资源回报。
51
53
 
52
54
  [远程日志:两端授权、直连与中转](docs/remote-access.md) · [常驻与 npm](docs/npm.md) · [账号模式与自建](docs/hosted-access.md) · [故障排查](docs/troubleshooting.md)
53
55
 
@@ -60,7 +62,7 @@ npx --yes device-center@0.2.0-beta.3 connect --confirm
60
62
  | 日志 | 指定标签/绝对文件/管理设备/有效期,最大64KiB;本机审计 |
61
63
  | 访问路径 | Agent 精确私网入口优先,网络失败回退官方/自建 HTTPS 密文中转;证书错误停止 |
62
64
  | 中转额度 | 每账号100MiB/UTC日、全实例1GiB/日,持久计数、并发与速率限制 |
63
- | 尚未提供 | 任意远程命令、通用文件传输、Windows 原生 Agent、云端 MCP、CF 专用适配器、计费、自动迁移 |
65
+ | 尚未提供 | 任意远程命令、通用文件传输、云端 MCP、CF 专用适配器、计费、自动迁移 |
64
66
 
65
67
  日志操作通过 `device_center_read_log` 请求,不能用 MCP 授权自身。用户自己的智能体仍需在目标设备单独配置授权。已有 SSH 路径独立使用,SSH“连接计划”不会自动改成新 Agent 通道。Docker 代表容器自身,不能当作宿主机;宿主运行原生 Driver 与本机智能体交互。
66
68
 
package/SECURITY.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # Security
2
2
 
3
- Device Center 0.2.0-beta.1 is a beta for macOS/Linux and Node.js 24. Local HTTP/MCP is loopback-only with Host/Origin checks; do not expose it publicly. Cloud deployment requires an exact HTTPS origin, a proxy overwriting Host/scheme, and a private authentication config. App Services identities are verified against the configured upstream; tenant scope comes from verified stable issuer/subject. Authentication outages fail closed.
3
+ Device Center beta.5 supports macOS/Linux and adds Windows 11 preview support with Node.js 24. Check the npm registry for publication status; Windows 11 end-user acceptance is still pending. Local HTTP/MCP is loopback-only with Host/Origin checks; do not expose it publicly. Cloud deployment requires an exact HTTPS origin, a proxy overwriting Host/scheme, and a private authentication config. App Services identities are verified against the configured upstream; tenant scope comes from verified stable issuer/subject. Authentication outages fail closed.
4
4
 
5
5
  Device keys remain in owner-private local files. Pairing is short-lived, one-time and separately approved after a full fingerprint comparison. Binding permits telemetry, not operations. Remote log access requires local pinned peer certificates plus a target-owned file/label/expiry grant. Node/OpenSSL TLS 1.3 mutually authenticates both devices over an approved LAN endpoint or opaque HTTPS relay; certificate and hostname verification remain enabled. The control plane sees metadata and ciphertext, not log plaintext or private keys. First-use fingerprint verification requires a trusted channel.
6
6
 
7
- Only bounded log tail reads are available. No arbitrary commands, generic file transfer, Windows native Agent or cloud MCP. Symlink/multiple-hardlink/non-regular log files are rejected. Cloud revocation is checked on both routes. Local audit is bounded and fails closed at capacity. OS administrators, compromised endpoints and already-authorized readers remain trust boundaries. Keys are not TPM/Keychain wrapped. See [permissions, quotas, certificate renewal and limitations](docs/remote-access.md).
7
+ Only bounded log tail reads are available. No arbitrary commands, generic file transfer or cloud MCP. Symlink/multiple-hardlink/non-regular log files are rejected. Cloud revocation is checked on both routes. Local audit is bounded and fails closed at capacity. OS administrators, compromised endpoints and already-authorized readers remain trust boundaries. Keys are not TPM/Keychain wrapped. See [permissions, quotas, certificate renewal and limitations](docs/remote-access.md).
8
+
9
+ ## Windows candidate
10
+
11
+ Windows identity JSON is encrypted using local DPAPI CurrentUser, never LocalMachine; only ciphertext is persisted. The application directory and newly created private files allow the current user and SYSTEM only, with owner and reparse-point checks. Existing insecure directories are rejected rather than silently repaired. POSIX owner/mode checks remain unchanged. Windows ACL checks are refreshed on metadata changes and at least every 30 seconds; decrypted identity is cached only in the running process. This does not defend against malicious software running as the same user or an OS administrator, and copying the file to another computer/user is not a supported migration method. See [Microsoft DPAPI](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.protecteddata.protect).
12
+
13
+ The optional background task uses the current user's InteractiveToken and Limited run level, at logon only. No passwords, AD domain, elevation, execution-policy changes, firewall changes or boot/SYSTEM service are needed. Existing tasks are not overwritten, and uninstall validates the exact task and checks that its listener stopped before removing the config. A policy restriction fails closed with a foreground option; reports cannot continue during logoff, sleep or loss of network. Windows log grants reject UNC paths and alternate data streams. Windows CI checks PowerShell parsing, DPAPI/NTFS fixtures and isolated npm/foreground installation. Windows 11 task lifecycle, restart and real cloud pairing still require end-user acceptance; CI is not proof of those results.
8
14
 
9
15
  Telemetry inventory never initiates SSH. Explicit local checks use bounded fixed scripts and strict known-host verification; private-key contents and raw SSH output are not imported. Containers do not read host SSH or claim host metrics.
10
16
 
@@ -30,7 +30,7 @@ export function parseCli(argv = []) {
30
30
  export function helpText() {
31
31
  return `Device Center ${version()} · 只读管理 Driver 源码原型
32
32
 
33
- 需要 Node.js 24;管理 Driver 支持 macOS / Linux。
33
+ 需要 Node.js 24;管理 Driver 支持 macOS / Linux / Windows 11(候选,待实机验收)。
34
34
 
35
35
  device-center start [--port 5174] 启动本机面板与只读 MCP
36
36
  device-center plan --cloud https://你的域名 预览回报范围,不生成身份或联网
@@ -47,7 +47,8 @@ device-center service plan|status|install|uninstall [--port 5174] [--confirm]
47
47
  本机无需平台注册;connect 默认申请接入 https://devices.owenshen.top,需登录自己的账号核对批准。
48
48
  --cloud 可使用自建域名。device-center access help 查看受限日志授权与可选局域网直连。
49
49
  支持 TLS 1.3 双向认证的日志读取与密文中转,默认100MiB/账号/日;不会自动获得操作权限。
50
- 任意远程命令、通用文件传输和 Windows 原生 Driver 尚未提供。安装包不含身份或配对码。
50
+ Windows 身份由 DPAPI 当前用户保护,后台在当前用户登录后启动;注销或休眠会停止回报。
51
+ 任意远程命令和通用文件传输尚未提供。安装包不含身份或配对码。
51
52
  使用 npx 时只运行前台;常驻请先将本包固定版本安装到长期目录,再单独 install。
52
53
  `;
53
54
  }
@@ -63,7 +64,6 @@ export async function main(argv = process.argv.slice(2)) {
63
64
  }
64
65
  const driver = await import('../scripts/driver.mjs');
65
66
  if (plan.command === 'start') {
66
- if (process.platform === 'win32') throw new Error('Windows 原生管理 Driver 尚未支持。');
67
67
  await driver.runLocal({ port: plan.port }); return;
68
68
  }
69
69
  return driver.main([plan.command, ...plan.args]);
@@ -2,7 +2,7 @@
2
2
 
3
3
  目标设备只需要 Device Center Driver,不要求已经安装 AI Agent。一页指南提供 **交给 Agent** 和 **手动安装** 两个入口。网页只复制内容,安装发生在你执行脚本的目标设备上。
4
4
 
5
- **beta.4 是本地开发候选,尚未发布到 npm。** 当前公开版为 `device-center@0.2.0-beta.3`。新流程需要控制面与 CLI 一起升级;下列 `--browser` 指新版源码能力,不应交给旧客户端执行。
5
+ **本指南固定 `device-center@0.2.0-beta.5`(npm `beta`)**。macOS/Linux 使用下方终端命令;Windows 11 预览版按 [PowerShell 安装图示](windows-acceptance.md)操作。实际发布状态以 npm registry 为准;旧 beta.4 不支持原生 Windows。
6
6
 
7
7
  ## 用户只需要选择一种方式
8
8
 
@@ -20,7 +20,7 @@
20
20
 
21
21
  复制按钮下方的三张窗口示意按选择切换:**目标电脑的终端/Agent 对话 → 浏览器绑定(本机模式为安装检查)→ 设备列表**。点“看下一步”可预看后续动作;切图不会执行安装、批准绑定或表示操作成功。无浏览器模式会画出“目标终端 → 另一台电脑的浏览器”;本机面板地址则明确要求在刚安装的那台电脑打开。
22
22
 
23
- 1. **准备环境**:macOS / Linux、Node.js 24+ 和 npm。缺少 Node.js 时先从官方来源安装;Windows 原生 Driver 暂未支持。脚本只支持全新安装,发现已有 CLI 会停止,不覆盖身份或配置。
23
+ 1. **准备环境**:macOS / Linux、Node.js 24+ 和 npm。缺少 Node.js 时先从官方来源安装;Windows 11 使用指南中的 PowerShell 脚本(无需管理员或 AD),不要粘贴下方 macOS/Linux 命令。脚本只支持全新安装,发现已有 CLI 会停止,不覆盖身份或配置。
24
24
  2. **在目标设备执行**:Mac 打开“终端”;Linux 使用终端,或你已经建立的 SSH 会话。粘贴整块脚本并执行。不需要把它发给 AI Agent,也不会替你建立 SSH 连接。
25
25
  3. **本机使用**:不登录、不申请云端绑定。安装结束后在这台设备打开 `http://127.0.0.1:5174` 查看资源。
26
26
  4. **托管/自建接入**:复制前选择目标设备有没有浏览器:
@@ -48,7 +48,7 @@ AI Agent 和 MCP 是管理端的可选能力:只有以后想让某台电脑上
48
48
 
49
49
  ### 1. 检查现有环境
50
50
 
51
- - 当前版只支持 macOS / Linux,需要 Node.js 24 或更高版本与 npm。缺少运行环境时使用官方来源;系统授权或管理员操作交由用户处理。Windows 原生 Driver 尚未支持,不能假称已安装成功。
51
+ - 下方命令用于 macOS / Linux,需要 Node.js 24 或更高版本与 npm。缺少运行环境时使用官方来源;系统授权或管理员操作交由用户处理。Windows 11 预览版请按专用指南选择 PowerShell;不能假称未执行的安装已成功。
52
52
  - 检查已有 CLI、用户级服务、本机端口和绑定。已安装在下面固定位置时,可以运行 `"$HOME/.local/bin/device-center" status` 与 `"$HOME/.local/bin/device-center" service status --port 5174`,不要直接打开身份私钥文件。配置一致则复用;版本、控制面或启动方式冲突时解释,让用户选择。保留已有身份、数据库、MCP 配置和其他程序。
53
53
  - 默认端口 `5174`。若已被其他程序占用,选择明确的可用本机端口,并同步后面的面板、MCP、服务命令。不要停止其他监听进程,不扫描网络。
54
54
 
@@ -57,7 +57,7 @@ AI Agent 和 MCP 是管理端的可选能力:只有以后想让某台电脑上
57
57
  全新安装可以使用:
58
58
 
59
59
  ```sh
60
- npm install --global --prefix "$HOME/.local" --ignore-scripts device-center@0.2.0-beta.4
60
+ npm install --global --prefix "$HOME/.local" --ignore-scripts device-center@0.2.0-beta.5
61
61
  "$HOME/.local/bin/device-center" --version
62
62
  ```
63
63
 
@@ -118,7 +118,7 @@ http://127.0.0.1:5174/mcp
118
118
 
119
119
  必须检查实际结果:
120
120
 
121
- 1. `/api/health` 返回 `ok: true` 且为本机模式;用 CLI `--version` 检查安装版本,并核对服务计划引用的安装目录。健康接口本身不提供版本号。
121
+ 1. `/api/health` 返回 `ok: true` 且为本机模式,其中 `version` 应与 CLI `--version` 一致;并核对服务计划引用的安装目录。npm 安装的 `sourceSha` 为 `null`,属正常。
122
122
  2. `/api/overview` 的本机内存、磁盘为真实采集,失败项如实报告。
123
123
  3. 选择后台模式时,核实服务实际运行,而不仅是配置文件存在。
124
124
  4. 当前智能体实际调用 `device_center_list_resources`。
@@ -1,11 +1,11 @@
1
1
  # 通过域名连接管理电脑
2
2
 
3
- > 0.2.0-beta.1 更新:账号隔离、TLS 1.3 双向认证密文中转、独立授权的日志尾读及获准精确 LAN 优先已实现。旧文中的“尚未实现”传输描述属于此前阶段;实际操作与边界以 [远程日志](remote-access.md) 和 README 为准。通用远程命令、文件传输、Windows 原生 Agent 与自动迁移仍未提供。
4
- 当前支持个人控制面与 macOS / Linux 管理 Driver 的配对、只读资源回报和撤销。它不是远程终端或隧道;Windows Driver、独立安装器、系统钥匙串封装、远程任务和自动选路仍待实现。
3
+ > 0.2.0-beta.1 更新:账号隔离、TLS 1.3 双向认证密文中转、独立授权的日志尾读及获准精确 LAN 优先已实现。旧文中的“尚未实现”传输描述属于此前阶段;实际操作与边界以 [远程日志](remote-access.md) 和 README 为准。通用远程命令、文件传输、自动迁移仍未提供;Windows 11 提供 beta.5 预览接入,见 [Windows 验收](windows-acceptance.md)。
4
+ 当前支持个人控制面与 macOS / Linux 管理 Driver 的配对、只读资源回报和撤销。它不是远程终端或隧道;Windows 11 候选的 PowerShell 安装、DPAPI/NTFS 身份与用户登录任务已实现,实机验证待完成;系统钥匙串/TPM封装与任意远程任务仍未实现。
5
5
 
6
6
  ## 三步接入
7
7
 
8
- ### beta.4 简化接入候选(尚未发布)
8
+ ### beta.4 简化接入(已发布)
9
9
 
10
10
  新版一页指南并列提供 Agent 说明和手动安装脚本。目标设备有浏览器时共用 `connect --browser --confirm`:自动打开 `/pair`,本人登录并核对完整公钥指纹、批准一次;CLI 自动检测结果并核验首次回报。无需手动搬运配对码,也不用回 Agent 回复“已批准”。手动模式还可选“无浏览器/服务器”,脚本生成不带 `--browser` 的命令,通过另一台电脑完成下面的填码流程。目标设备不需要 AI Agent 或 MCP。已有安装脚本停止保留设置;Agent 可核对后复用已有绑定,不重复登记。
11
11
 
@@ -74,6 +74,6 @@ npm run service -- install --confirm --port 5174
74
74
 
75
75
  当前测试验证隔离环境中的协议和 HTTP 接口。实际身份生成、用户批准、目标平台常驻、真实网络下连续回报需要由使用者执行接入后验收;不能以测试数据冒充已绑定设备。远程命令、文件传输与中继任务权限没有因配对而授予。
76
76
 
77
- ## 账号归属与候选版本
77
+ ## 账号归属与版本兼容
78
78
 
79
- 显式多用户隔离已在 beta.3 上线;beta.4 浏览器交接仍是本地开发候选,旧客户端的手动配对与签名协议保持兼容。个人模式仍为默认;多用户批准需同时提交配对码或短时浏览器票据,以及完整指纹,归属只取服务核验的账号,不接受客户端 tenantId。历史个人记录不自动转移;多账号数据不能交给旧的无隔离服务器读取。详见[托管接入、迁移与回退](hosted-access.md)。
79
+ 显式多用户隔离已在 beta.3 上线;beta.4 浏览器交接已随 npm 与官方控制面发布,旧客户端的手动配对与签名协议保持兼容。个人模式仍为默认;多用户批准需同时提交配对码或短时浏览器票据,以及完整指纹,归属只取服务核验的账号,不接受客户端 tenantId。历史个人记录不自动转移;多账号数据不能交给旧的无隔离服务器读取。详见[托管接入、迁移与回退](hosted-access.md)。
@@ -1,8 +1,8 @@
1
1
  # Device Center · 朋友试用指南
2
2
 
3
- 让本机 Agent 看见自己的电脑与闲置设备:真实内存、磁盘、设备用途,以及单独授权的指定日志。当前为 `0.2.0-beta.3` 公开试用版。
3
+ 让本机 Agent 看见自己的电脑与闲置设备:真实内存、磁盘、设备用途,以及单独授权的指定日志。本指南版本 `0.2.0-beta.5`,发布状态以 npm registry 为准。
4
4
 
5
- **入口:https://devices.owenshen.top/start**。支持 macOS / Linux,需要 Node.js 24+;Windows 原生版尚未支持。
5
+ **入口:https://devices.owenshen.top/start**。支持 macOS / Linux,需要 Node.js 24+;Windows 11 提供 PowerShell 预览版,可选择“手动安装”,不需要 AI Agent 或 AD。
6
6
 
7
7
  ## 1. 把安装交给本机 Agent
8
8
 
@@ -14,11 +14,11 @@
14
14
 
15
15
  Agent 按说明检查已有配置、固定版本安装、设置用户级后台服务、配置 MCP 并核验结果。已有配置冲突时解释并让你选择,不自动覆盖。系统授权或当前 Agent 无法配置 MCP 时,会请你完成对应一步。
16
16
 
17
- 不使用 Agent 时,可在全新环境运行 `npx --yes device-center@0.2.0-beta.3 start` 体验本机面板;这是前台方式,终端关闭后停止。长期使用按[完整安装指南](https://devices.owenshen.top/install/agent.md)固定安装。
17
+ 不使用 Agent 时,可在全新环境运行 `npx --yes device-center@0.2.0-beta.5 start` 体验本机面板;这是前台方式,终端关闭后停止。长期使用按[完整安装指南](https://devices.owenshen.top/install/agent.md)固定安装。
18
18
 
19
19
  ## 2. 托管模式才需要登录绑定
20
20
 
21
- 在官方面板使用**自己的 App Services/个人站账号**登录;没有账号时在账号页注册。终端给出五分钟配对码和完整公钥指纹,在面板输入并核对后批准。
21
+ 在官方面板使用**自己的 App Services/个人站账号**登录;没有账号时在账号页注册。有浏览器的设备会自动打开本次绑定页,登录后核对完整公钥指纹并批准一次;无浏览器的设备在终端给出五分钟配对码和完整公钥指纹,在另一台电脑的面板输入并核对后批准。
22
22
 
23
23
  密码、私钥和配对码不发给朋友、不放入 Agent 对话。若 Agent 工具会把终端配对码记录进对话,仅在本机终端自行完成 `connect` 这一步。绑定只允许说明中的资源回报,不授予远程命令或日志权限。
24
24
 
@@ -39,4 +39,4 @@ Agent 按说明检查已有配置、固定版本安装、设置用户级后台
39
39
 
40
40
  把**系统、版本、所选模式、失败步骤、预期与实际结果**发给邀请你的人。附错误或截图前去掉私钥、配对码、cookie、设备地址及日志正文。
41
41
 
42
- **当前边界:**未提供任意远程命令、通用文件传输、Windows 原生 Driver、自动扫描、离线局域网授权、本机与云端说明同步。官方试用中转每账号每日 100 MiB(UTC),每方向 16 KiB/s。MIT npm 源码包公开;GitHub 仓库可见性独立管理。
42
+ **当前边界:**未提供任意远程命令、通用文件传输、自动扫描、离线局域网授权、本机与云端说明同步。官方试用中转每账号每日 100 MiB(UTC),每方向 16 KiB/s。MIT npm 源码包公开;GitHub 仓库可见性独立管理。
@@ -1,6 +1,6 @@
1
1
  # 本机、官方与自建接入
2
2
 
3
- 本版本 0.2.0-beta.3 使用同一 CLI 支持官方与自建 HTTPS 控制面;每个账号独立管理自己的设备。安装不自动接入,connect --confirm 默认申请官方服务,用户登录并核对批准后才绑定。
3
+ 本版本 0.2.0-beta.4 使用同一 CLI 支持官方与自建 HTTPS 控制面;每个账号独立管理自己的设备。安装不自动接入,connect --confirm 默认申请官方服务,用户登录并核对批准后才绑定。
4
4
 
5
5
  ## 用户流程
6
6
 
package/docs/npm.md CHANGED
@@ -1,18 +1,20 @@
1
1
  # npm / npx 分发
2
2
 
3
- MIT,Node.js 24,macOS/Linux。当前版本 `0.2.0-beta.3`,使用 npm `beta` 渠道;是否上架以公开 registry 为准。
3
+ MIT,Node.js 24。本指南固定 `0.2.0-beta.5`,支持 macOS/Linux,并提供 Windows 11 预览接入。使用 npm `beta` 渠道;`latest` 仍可能是旧版本,安装请写明版本,实际发布状态以公开 registry 为准。
4
4
 
5
- 本地 `0.2.0-beta.4` 候选新增 `connect --browser --confirm` 与普通终端安装脚本,尚未发布。必须先发布新 CLI,再将指南切到对应版本并部署新版控制面;只更新网页不能让已安装的旧 CLI 获得新参数。新控制面继续支持旧版手动填码。回退网页与旧 CLI 不会删除既有身份,新增加的登记摘要列可保留。以下仍为当前已发布版命令。
5
+ beta.5 新增 PowerShell 安装、DPAPI CurrentUser 身份保护与当前用户登录后台任务,详见 [Windows 验收](windows-acceptance.md)。发布先后顺序是新 CLI → 匿名下载验包 → 对应指南与控制面上线。旧客户端的终端填码仍兼容;回退网页或旧 CLI 不删除既有身份。
6
6
 
7
7
  ```sh
8
- npx --yes device-center@0.2.0-beta.3 --help
9
- npx --yes device-center@0.2.0-beta.3 plan
10
- # 主动接入默认官方服务,执行后在终端与面板之间核对配对
11
- npx --yes device-center@0.2.0-beta.3 connect --confirm
8
+ npx --yes device-center@0.2.0-beta.5 --help
9
+ npx --yes device-center@0.2.0-beta.5 plan
10
+ # 主动接入默认官方服务;有浏览器时加 --browser 自动打开本次绑定页
11
+ npx --yes device-center@0.2.0-beta.5 connect --browser --confirm
12
+ # 无浏览器:在终端与另一台电脑的面板之间核对配对码
13
+ npx --yes device-center@0.2.0-beta.5 connect --confirm
12
14
  # 自建服务
13
- npx --yes device-center@0.2.0-beta.3 connect --cloud https://你的控制面域名 --confirm
15
+ npx --yes device-center@0.2.0-beta.5 connect --cloud https://你的控制面域名 --confirm
14
16
  # 仅本机,无账号要求
15
- npx --yes device-center@0.2.0-beta.3 start
17
+ npx --yes device-center@0.2.0-beta.5 start
16
18
  ```
17
19
 
18
20
  安装与无参/help/version/plan 不生成身份,不配对,不自动启动后台进程。复制命令不含凭据。只有 connect --confirm 才生成本机身份并申请绑定;默认官方地址不会自动批准,用户需登录自己的账号。SSH 缓存分享须 --share-ssh 与面板再次批准。
@@ -20,13 +22,13 @@ npx --yes device-center@0.2.0-beta.3 start
20
22
  面板和本机 MCP:`http://127.0.0.1:5174/`、`/mcp`。常驻先固定安装:
21
23
 
22
24
  ```sh
23
- npm install -g device-center@0.2.0-beta.3
25
+ npm install -g device-center@0.2.0-beta.5
24
26
  device-center service plan --port 5174
25
27
  # 自行停止同端口前台进程,再主动安装
26
28
  device-center service install --port 5174 --confirm
27
29
  ```
28
30
 
29
- 数据在用户应用数据目录,更新包不重置身份或数据库;npx 缓存不得用作常驻目录。Windows 原生身份存储和用户服务尚未提供。
31
+ 数据在用户应用数据目录,更新包不重置身份或数据库;npx 缓存不得用作常驻目录。Windows 11 候选使用本机 DPAPI CurrentUser 加密及 NTFS ACL、当前用户任务计划程序;注销或休眠时不回报,实机验收待完成。
30
32
 
31
33
  远程指定日志需两端各自明确授权,见[远程日志](remote-access.md)。无通用远程命令或文件传输。
32
34
 
@@ -1,6 +1,6 @@
1
1
  # 从首次使用到添加设备
2
2
 
3
- > 0.2.0-beta.1 更新:账号隔离、TLS 1.3 双向认证密文中转、独立授权的日志尾读及获准精确 LAN 优先已实现。旧文中的“尚未实现”传输描述属于此前阶段;实际操作与边界以 [远程日志](remote-access.md) 和 README 为准。通用远程命令、文件传输、Windows 原生 Agent 与自动迁移仍未提供。
3
+ > 0.2.0-beta.1 更新:账号隔离、TLS 1.3 双向认证密文中转、独立授权的日志尾读及获准精确 LAN 优先已实现。旧文中的“尚未实现”传输描述属于此前阶段;实际操作与边界以 [远程日志](remote-access.md) 和 README 为准。通用远程命令、文件传输与自动迁移仍未提供;Windows 11 预览接入见 [PowerShell 指南](windows-acceptance.md)。
4
4
  目标是让用户只完成必要的复制、粘贴和确认。面板统一用“管理电脑 → 智能体 → 设备”三步引导;部署、协议、常驻服务和排查放到文档或展开说明。下面区分已实现与待实现,不能把目标流程当成已接通。
5
5
 
6
6
  ## 当前本机原型
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## 服务器 / Docker 部署后的接入
15
15
 
16
- beta.4 本地候选提供并列的 Agent/手动安装入口,目标设备不要求 AI Agent 或 MCP。手动安装可选有浏览器自动交接,或无浏览器终端填码。有浏览器时申请自动带入,本人登录、核对指纹并批准一次;CLI 自动等待与验证首次回报,不要求用户回 Agent 回复“已批准”。无浏览器服务器在另一台电脑完成下列手动流程。此候选尚未发布,当前公开 beta.3 的行为仍如下。
16
+ 0.2.0-beta.4(已发布到 npm `beta`,官方控制面已上线)提供并列的 Agent/手动安装入口,目标设备不要求 AI Agent 或 MCP。手动安装可选有浏览器自动交接,或无浏览器终端填码。有浏览器时申请自动带入,本人登录、核对指纹并批准一次;CLI 自动等待与验证首次回报,不要求用户回 Agent 回复“已批准”。无浏览器服务器和旧版 CLI 在另一台电脑完成下列手动流程。
17
17
 
18
18
  控制面与管理电脑可能是两台机器。当前服务只读取自己所在机器的配置;服务器配置不能代替用户电脑的配置,Docker 也不会取得宿主 SSH 权限。
19
19
 
@@ -25,7 +25,7 @@ beta.4 本地候选提供并列的 Agent/手动安装入口,目标设备不
25
25
 
26
26
  Driver 主动建立获准的安全出站连接。短时一次性登记凭据应由用户单独交互输入,不嵌入 prompt、脚本、压缩包或日志。身份私钥在设备生成并保留,SSH 私钥、身份路径、局域网端点与认证留在管理电脑。云端只同步经用户批准的非秘密登记信息和明确可见范围的回报;导入不转移任务权限、主机信任或在线状态。
27
27
 
28
- 个人云端面板的 HTTPS、所有者登录、管理 Driver 配对、签名回报与撤销已经实现;未绑定时显示空列表,不读取服务器 SSH。默认仅回报本机指标,SSH 名称与缓存状态需要双重显式批准。**尚未实现:** 独立资源设备 Agent、Windows Driver、签名安装包、系统钥匙串封装与配置迁移。完整操作与排查见[域名绑定](driver-binding.md)。没有演示绑定成功。管理电脑离线时,依赖它的 SSH 路径不可用;云端面板在线不会替代它完成认证。
28
+ 个人云端面板的 HTTPS、所有者登录、管理 Driver 配对、签名回报与撤销已经实现;未绑定时显示空列表,不读取服务器 SSH。默认仅回报本机指标,SSH 名称与缓存状态需要双重显式批准。**尚未实现:** 独立资源设备 Agent、签名安装包、系统钥匙串封装与配置迁移。完整操作与排查见[域名绑定](driver-binding.md)。没有演示绑定成功。管理电脑离线时,依赖它的 SSH 路径不可用;云端面板在线不会替代它完成认证。
29
29
 
30
30
  本机侧栏也可点“云端面板”,选择官方控制面或自己的 HTTPS 域名后复制命令。0.2 系列已支持显式多账号隔离,官方服务使用 multi-user 模式。账号模式和历史数据迁移见[托管接入说明](hosted-access.md)。
31
31
 
@@ -34,7 +34,7 @@ Driver 主动建立获准的安全出站连接。短时一次性登记凭据应
34
34
  | 目标设备条件 | 用户最少操作 | 结果条件 |
35
35
  | --- | --- | --- |
36
36
  | 管理电脑已有可用 SSH 配置 | 一键导入引用 | 导入后自动检查一次,取得真实资源后才显示近期在线与资源 |
37
- | 目标设备已有智能体 | 复制安装指导,交给目标机智能体;确认安装与绑定 | 0.2.0-beta.3 可复制完整安装说明,本机生成身份并核对配对与真实回报;签名安装器待实现 |
37
+ | 目标设备已有智能体 | 复制安装指导,交给目标机智能体;确认安装与绑定 | 0.2.0-beta.4 可复制完整安装说明,本机生成身份,有浏览器时自动交接批准并核验真实回报;签名安装器待实现 |
38
38
  | 目标设备没有智能体 | 下载对应平台的验签安装包,在目标机运行并批准绑定 | 与智能体辅助方式使用同一接入协议;待实现 |
39
39
  | 不能安装 Agent,也没有可用 SSH | 明示缺少接入条件 | 保持未知,不伪装接通 |
40
40
 
@@ -1,13 +1,13 @@
1
1
  # 远程日志:明确授权后使用
2
2
 
3
- 本版本 0.2.0-beta.3 支持 macOS / Linux、Node.js 24。两台设备主动连接同一 HTTPS 控制面,默认使用 `https://devices.owenshen.top`;可用 `--cloud https://你的域名` 替换。安装或查看帮助不会产生身份、配对或运行远程操作。
3
+ 本指南版本 0.2.0-beta.5,下方命令用于 macOS / Linux、Node.js 24;Windows 11 预览版见 [专用指南](windows-acceptance.md),跨平台日志仍需实机验收。两台设备主动连接同一 HTTPS 控制面,默认使用 `https://devices.owenshen.top`;可用 `--cloud https://你的域名` 替换。安装或查看帮助不会产生身份、配对或运行远程操作。
4
4
 
5
5
  ## 最短流程
6
6
 
7
7
  在管理电脑和目标设备分别运行:
8
8
 
9
9
  ```sh
10
- npm install -g device-center@0.2.0-beta.3
10
+ npm install -g device-center@0.2.0-beta.5
11
11
  device-center connect --confirm
12
12
  ```
13
13
 
package/docs/roadmap.md CHANGED
@@ -20,10 +20,22 @@
20
20
  - 统一语言菜单、浏览器偏好和分享链接,切换保留未保存输入;命令与设备数据保持原样。
21
21
  - 长文档和 CLI 仍以中文为主,翻译尚待母语者校对。
22
22
 
23
+ ## 0.2.0-beta.4
24
+
25
+ - `connect --browser --confirm`:自动打开本次绑定页,登录后本人核对指纹并批准一次,CLI 自动核验首次回报;无浏览器设备与旧客户端保留终端填码。
26
+ - 指南并列“交给 Agent/手动安装”,手动安装提供普通终端脚本;目标设备不需要 AI Agent 或 MCP。
27
+ - 接入步骤的窗口示意图;主面板提供手动指南入口。
28
+
29
+ ## 0.2.0-beta.5 预览
30
+
31
+ - Windows 11 PowerShell 手动安装与图形指引,不需要 AI Agent 或 AD。
32
+ - 本机 DPAPI CurrentUser 身份保护、NTFS 私有数据目录、当前用户登录后台任务。
33
+ - Windows CI 验证脚本、安全存储与隔离 npm/前台启动;Windows 11 实机后台/重启/配对仍待验收。
34
+
23
35
  ## 后续候选
24
36
 
25
37
  1. 验证各平台真实常驻、升级和恢复;减少 Node 与终端依赖。
26
- 2. Windows 原生身份安全存储与用户服务;签名安装器。
38
+ 2. Windows 11 真实后台生命周期验收与签名安装器。
27
39
  3. 本机与云端非秘密说明的同步及冲突处理,不迁移私钥或自动扩大授权。
28
40
  4. 更多单独授权的能力,例如 Windows 构建验收;当前没有任意远程命令或通用文件传输。
29
41
  5. 公开 GitHub 仓库与私密安全报告渠道,由项目主人分别决定。
@@ -8,6 +8,8 @@ App Services 账号由固定 HTTPS `/v1/me` 核验,不解码自报 JWT 作为
8
8
 
9
9
  云端允许从个人站或其它网站打开 `/`、`/index.html`、`/login`、`/start` 和 `/start.html`,仅限浏览器顶层 GET 页面导航(`Sec-Fetch-Mode: navigate`、`Sec-Fetch-Dest: document`)。面板仍需登录,匿名根页面跳转登录;API、脚本、iframe 和写请求不适用此例外。同父域 `same-site` 也不等于 `same-origin`,不能用于跨来源操作设备。Host、HTTPS 代理标记与显式 Origin 校验始终保留,本机模式不变。
10
10
 
11
+ `GET /api/health` 免登录,只返回 `ok`、`mode`、`runtime`、包版本 `version` 和部署源码 `sourceSha`(部署归档 `release.json` 中的完整提交 SHA;npm 或源码安装为 `null`),用于部署核验与外部拨测;不含账号、设备、配置或数据库信息。跨站请求仍按上面的规则拒绝。
12
+
11
13
  远程日志使用 Node/OpenSSL TLS 1.3 双向认证,两端固定经核对的证书/指纹。目标本机 grant 只允许指定管理身份、标签、规范化文件路径和截止时间;每次最多64KiB。禁止任意命令、任意路径、符号链接/多硬链接/非普通文件。直连和云中转都核验当前云端成员,撤销后拒绝新操作。
12
14
 
13
15
  云端中转只见密文与账号/设备/流量元数据。配额每日持久计数,队列、帧、会话、速率和并发均有界。两端本机审计不保存日志内容;超容量拒绝,不自动清理。详见[授权与额度](remote-access.md)。
@@ -1,5 +1,16 @@
1
1
  # 接入排查
2
2
 
3
+ ## 官方控制面登录后又回到登录页
4
+
5
+ 先在控制面的原标签页点击“进入控制面”。已有统一账号会话会先恢复并验证,无需反复从个人站应用中心打开新标签页。
6
+
7
+ - **账号服务连接失败或校验超时**:这是控制面向统一账号服务核验身份失败,不等于密码错误。程序合并同一会话的并发核验,并对短暂网络故障最多重试一次;仍失败时留在当前页面,稍后点击“进入控制面”重试。不会因为故障放行或改用其它账号。
8
+ - **登录会话未能保存**:核对账号页与控制面是否在同一个浏览器、同一浏览器配置中,检查本站 Cookie 是否被阻止。登录请求成功后还会做一次受保护的会话核验;核验失败不会继续跳转。
9
+ - **进入后立即退回登录页**:短时回跳保护会暂停自动跳转。它只在当前标签页存一个时间戳,不存凭据,也不清除设备配对申请。确认网络恢复后主动点击“进入控制面”重试。
10
+ - **提示先登录或账号无权限**:按页面提示完成邮箱/Google 等受支持的统一登录;个人部署仍只允许配置的面板所有者。服务不可用与身份拒绝分别处理。
11
+
12
+ 排查时只提供失败提示、发生时间和页面路径;不要分享 Cookie、访问令牌或带设备配对票据的链接。服务端核验诊断不记录凭据。
13
+
3
14
  ## 本机智能体没接上
4
15
 
5
16
  1. 面板是否还能打开?打不开时先确认前台进程或后台服务在运行。
@@ -0,0 +1,57 @@
1
+ # Windows 11 手动接入验收
2
+
3
+ **0.2.0-beta.5 · Windows 11 预览版。** 安装前可用 `npm.cmd view device-center@0.2.0-beta.5 version` 确认发布状态。Windows CI 的脚本、安全存储及安装检查不能替代你的 Windows 11 实机验收。
4
+
5
+ ## 准备与安装
6
+
7
+ 需要 Windows 11、当前普通用户、Windows PowerShell 5.1+、官方 [Node.js 24+](https://nodejs.org/)(含 npm),能访问 npm registry 和选定 HTTPS 控制面。无需 AI Agent、MCP、AD 域或管理员窗口;不使用 WSL。
8
+
9
+ 在**目标 Windows 电脑**打开[手动安装指南](https://devices.owenshen.top/start?lang=zh-CN&method=manual&mode=official&os=windows#install-title),选择官方托管、Windows 11、手动安装,再复制 PowerShell 脚本。不需要下载 ZIP,也不需要目标电脑有 AI Agent。
10
+
11
+ ```text
12
+ 在目标 Windows 电脑打开手动安装指南、复制脚本
13
+ → 开始菜单搜索 PowerShell,点“打开”(不用管理员)
14
+ → 粘贴到 PowerShell,回车
15
+ → 浏览器自动打开本次绑定申请
16
+ → 登录自己的账号,对照终端完整指纹,批准一次
17
+ → 终端自动确认首次资源回报;无需回 Agent 说“已批准”
18
+ ```
19
+
20
+ 选择“本机使用”只安装本机面板,不申请云端绑定。已有 CLI、服务配置、任务或占用端口时停止,保留原状态;不要反复运行安装脚本。缺少 Node.js 时从官网安装后重开 PowerShell。安装需要联网访问 npm;复制文本执行不需要修改 PowerShell 执行策略。
21
+
22
+ **电脑在国内公司、不在身边:** 把上述指南发给能操作它的同事。可选“无浏览器/服务器”,让同事在那台 Windows 的 PowerShell 执行脚本,保持窗口打开;你在自己的电脑登录官方控制面,输入终端配对码,核对完整指纹并批准。代码只在实际运行时生成,不预放在脚本里,也不要发给 AI Agent。目标电脑仍需出站 HTTPS、npm 连通;不要求两台电脑在同一局域网或开放入站端口。
23
+
24
+ ## 验收清单
25
+
26
+ 1. `--version` 是 `0.2.0-beta.5`;后台状态显示 `windows-task`,本机面板 `http://127.0.0.1:5174` 正常加载,页面脚本无 404。
27
+ 2. 浏览器只批准刚由本机发起的申请;完整指纹与终端一致。终端有“云端已接收首次资源回报”,`firstReport.verified=true`。仅 `configured=true` 不算连通。
28
+ 3. 云端出现这台 Windows 电脑,内存和用户目录所在卷磁盘分别显示真实数值;没有测试设备或伪造在线。可填写设备名、用途与标签。
29
+ 4. 点击云端“采集一次”,采集时间在约 30–75 秒内更新。关闭安装终端后仍更新;注销/休眠会停止回报,登录/唤醒且网络恢复后继续。
30
+ 5. 在 Windows 任务计划程序中查看 `DeviceCenter-…`:当前用户、用户登录时触发、非最高权限。重启并登录后不重新安装也能恢复;长期停在登录界面不会运行。
31
+ 6. 本机身份文件在 `%USERPROFILE%\AppData\Local\Device Center\driver-link.json`,只存 DPAPI 密文,目录访问限当前用户与 SYSTEM。**不要打开或分享私钥,也不要把身份文件搬到其他电脑/用户。** DPAPI 不防同账号恶意程序或管理员控制。
32
+ 7. 不接 AI Agent 也可使用设备回报。需要管理端 AI 时,在有 Agent 的管理电脑添加它自己的 loopback `/mcp`;目标 Windows 不需要 MCP 客户端。
33
+
34
+ ## 状态与排查
35
+
36
+ 在普通用户 PowerShell 执行:
37
+
38
+ ```powershell
39
+ & "$HOME\AppData\Local\Programs\Device Center\cli\device-center.cmd" --version
40
+ & "$HOME\AppData\Local\Programs\Device Center\cli\device-center.cmd" status
41
+ & "$HOME\AppData\Local\Programs\Device Center\cli\device-center.cmd" service status --port 5174
42
+ ```
43
+
44
+ - **打不开网页**:核对 Node 版本、5174 是否被占用、服务状态;不停止别的程序。若选择另一端口,要让服务与 connect 使用同一端口。
45
+ - **任务被策略阻止**:保留错误。可显式选择 `start --port 5174` 前台运行并保持终端;不改组策略、执行策略或防火墙。
46
+ - **安全存储失败**:确认当前用户、用户目录在支持 NTFS ACL 的本地卷、系统 PowerShell 可用;目录被共享或变为链接时程序会拒绝。不要把权限放宽到 Everyone 来解决。
47
+ - **绑定成功但没有回报**:检查电脑唤醒、网络、系统时间、HTTPS 可达与后台日志。不要重复绑定;没有入站端口要求。
48
+ - **未回报/待刷新**:表示近期没收到状态,不是设备身份私钥过期。睡眠、注销、断网时无法采集。
49
+ - **后续读 Windows 日志**:需两端核对指纹并单独 `access trust` / `access grant`。仅允许显式本地盘文件,例如 `C:\Logs\app.log`,不接受 UNC 共享或备用数据流。绑定不开放任意命令,也不授予日志权限。本轮先验收安装/配对/后台,真实跨平台日志再独立确认。
50
+
51
+ 需要停止并卸载本次后台任务时,由用户明确执行,默认保留数据和身份:
52
+
53
+ ```powershell
54
+ & "$HOME\AppData\Local\Programs\Device Center\cli\device-center.cmd" service uninstall --port 5174 --confirm
55
+ ```
56
+
57
+ 卸载仅处理与当前计划完全一致的任务;不能确认监听已停止时保留配置并报错,不杀其他程序。反馈只需系统版本、CLI 版本、失败步骤和已去敏的错误;不附账号凭据、配对码、身份文件或日志正文。
package/login.html CHANGED
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
2
  <html lang="zh-CN">
3
3
  <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.svg" type="image/svg+xml"><title data-i18n="login.title">登录 · Device Center</title><link rel="stylesheet" href="/src/login.css"><link rel="stylesheet" href="/src/i18n.css"></head>
4
- <body class="login-page"><main><div class="language-picker" data-language-picker></div><div class="mark">DC</div><h1>Device Center</h1><p data-i18n="login.subtitle">登录你的设备控制面</p><p id="loading" role="status" data-i18n="login.loading">正在读取登录方式…</p><form id="login" hidden><label><span data-i18n="login.username">用户名</span><input name="username" autocomplete="username" required maxlength="64"></label><label><span data-i18n="login.password">密码</span><input name="password" type="password" autocomplete="current-password" required maxlength="256"></label><button type="submit" data-i18n="login.submit">登录</button><p id="message" role="alert"></p></form><section id="unified" hidden><p data-i18n="login.unified">使用 App Services/个人站的统一账号。</p><a id="unified-login" class="login-link" target="_blank" rel="noopener noreferrer" data-i18n="login.link">使用统一账号登录 ↗</a><p class="help" data-i18n="login.help">在新页面用邮箱或 Google 完成登录,回到这里会自动进入设备面板。</p><button id="continue-login" type="button" data-i18n="login.continue">我已登录,继续</button><p id="unified-message" role="status"></p></section><p class="install-help"><span data-i18n="login.notInstalled">还未安装?</span><a href="/start" target="_blank" rel="noopener noreferrer" data-language-link data-i18n="login.guide">查看一页试用指南 ↗</a><br><span data-i18n="login.installHint">本机使用无需账号;官方托管需登录并核对绑定。</span></p><small id="access-notes" data-i18n="login.multi">账号设备隔离 · HTTPS 保护</small></main><script type="module" src="/src/login.js"></script></body>
4
+ <body class="login-page"><main><div class="language-picker" data-language-picker></div><div class="mark">DC</div><h1>Device Center</h1><p data-i18n="login.subtitle">登录你的设备控制面</p><p id="loading" role="status" data-i18n="login.loading">正在读取登录方式…</p><form id="login" hidden><label><span data-i18n="login.username">用户名</span><input name="username" autocomplete="username" required maxlength="64"></label><label><span data-i18n="login.password">密码</span><input name="password" type="password" autocomplete="current-password" required maxlength="256"></label><button type="submit" data-i18n="login.submit">登录</button><p id="message" role="alert"></p></form><section id="unified" hidden><p data-i18n="login.unified">使用 App Services/个人站的统一账号。</p><button id="continue-login" type="button" data-i18n="login.continue">进入控制面</button><p id="unified-message" role="status" aria-live="polite"></p><p class="help" data-i18n="login.help">已有登录会自动进入。需要登录时打开下方账号页,完成后回到这里继续。</p><a id="unified-login" class="login-link" target="_blank" rel="noopener noreferrer" data-i18n="login.link">使用统一账号登录 ↗</a></section><p class="install-help"><span data-i18n="login.notInstalled">还未安装?</span><a href="/start" target="_blank" rel="noopener noreferrer" data-language-link data-i18n="login.guide">查看一页试用指南 ↗</a><br><span data-i18n="login.installHint">本机使用无需账号;官方托管需登录并核对绑定。</span></p><small id="access-notes" data-i18n="login.multi">账号设备隔离 · HTTPS 保护</small></main><script type="module" src="/src/login.js"></script></body>
5
5
  </html>
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "device-center",
3
- "version": "0.2.0-beta.4",
3
+ "version": "0.2.0-beta.5",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "device-center",
9
- "version": "0.2.0-beta.4",
9
+ "version": "0.2.0-beta.5",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@peculiar/x509": "2.1.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "device-center",
3
- "version": "0.2.0-beta.4",
3
+ "version": "0.2.0-beta.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local device connector with account-bound pairing, TLS encrypted relay and explicitly authorized log access",
@@ -39,7 +39,8 @@
39
39
  "start.html",
40
40
  "favicon.svg",
41
41
  "docs/friend-trial.md",
42
- "docs/i18n.md"
42
+ "docs/i18n.md",
43
+ "docs/windows-acceptance.md"
43
44
  ],
44
45
  "publishConfig": {
45
46
  "access": "public",
@@ -21,7 +21,6 @@ export async function main(argv = []) {
21
21
  const allowed={peers:[],status:[],enable:['confirm'],renew:['confirm'],trust:['peer','lan','port','confirm'],grant:['peer','log','label','minutes','confirm'],revoke:['peer','confirm'],listen:['bind','port','confirm'],'listen-off':['confirm'],read:['peer','label','bytes']}[action];
22
22
  const options={};
23
23
  for(let i=1;i<argv.length;i++){const key=argv[i].slice(2);if(!argv[i].startsWith('--')||!allowed.includes(key)||Object.hasOwn(options,key))throw new Error(usage);if(key==='confirm')options[key]=true;else{if(!argv[i+1]||argv[i+1].startsWith('--'))throw new Error(usage);options[key]=argv[++i];}}
24
- if(process.platform==='win32')throw new Error('Windows 原生私钥权限与服务尚未验收;本版支持 macOS/Linux。');
25
24
  const file=defaultLinkFile(),local=accessFile(file);
26
25
  if(action==='status'){const a=readAccess(local);return {trusts:a.trusts.map(({certificate,...p})=>p),grants:a.grants.map(({certificate,...p})=>p),listen:a.listen};}
27
26
  const state=readLink(file);if(!state?.driverId||state.disabled)throw new Error('先 connect 并在云端核对批准。');
@@ -24,7 +24,7 @@ export function driverPlan(argv = []) {
24
24
  }
25
25
  if (!['plan', 'connect', 'run', 'status', 'disconnect'].includes(command) || !Number.isInteger(port) || port < 1024 || port > 65535) throw new Error(usage);
26
26
  cloudOrigin(origin);
27
- return { command, origin, port, confirm, shareSsh, browser, fields: ['管理电脑名称', '系统类型', '内存', '用户目录卷磁盘', ...(shareSsh ? ['至多15个已关联SSH主机的名称和缓存资源状态(不含地址、用户、路径或配置)'] : [])], keyStorage: '仅本机私有目录/0600文件;当前不是Keychain/TPM封装', tasksAuthorized: false, backgroundInstalled: false };
27
+ return { command, origin, port, confirm, shareSsh, browser, fields: ['管理电脑名称', '系统类型', '内存', '用户目录卷磁盘', ...(shareSsh ? ['至多15个已关联SSH主机的名称和缓存资源状态(不含地址、用户、路径或配置)'] : [])], keyStorage: process.platform === 'win32' ? '本机 DPAPI CurrentUser 加密与当前用户/SYSTEM NTFS ACL;非 TPM,不防同账号恶意程序' : '仅本机私有目录/0600文件;当前不是Keychain/TPM封装', tasksAuthorized: false, backgroundInstalled: false };
28
28
  }
29
29
  export async function runLocal(plan) {
30
30
  // Reuse only a running native Driver that implements this protocol; never stop another listener.
@@ -49,7 +49,6 @@ export async function main(argv = process.argv.slice(2), { file = defaultLinkFil
49
49
  const plan = driverPlan(argv);
50
50
  if (Number(process.versions.node.split('.')[0]) < 24) throw new Error('需要 Node.js 24 或更高版本。');
51
51
  if (plan.command === 'plan') return plan; // No files, key generation, network or installation.
52
- if (process.platform === 'win32') throw new Error('Windows 身份文件的安全存储尚未实现,当前管理 Driver 只支持 macOS/Linux。');
53
52
  let state = readLink(file);
54
53
  if (plan.command === 'status') return linkSummary(state);
55
54
  if (plan.command === 'run') { if (!state?.driverId || state.disabled) throw new Error('请先 connect 完成配对。'); await runLocal(plan); return linkSummary(state); }
@@ -69,7 +68,7 @@ export async function main(argv = process.argv.slice(2), { file = defaultLinkFil
69
68
  }
70
69
  if (!state.certificate) { state.certificate = await issueCertificate(state); writeLink(file, state); }
71
70
  let pending;
72
- try { pending = await post(plan.origin, '/api/driver/pair/start', { publicKey: state.publicKey, certificate: state.certificate, name: hostname().slice(0,80), platform: ({ darwin: 'macOS', linux: 'Linux' })[platform()], shareSsh: plan.shareSsh, ...(plan.browser ? { browser: true } : {}) }); }
71
+ try { pending = await post(plan.origin, '/api/driver/pair/start', { publicKey: state.publicKey, certificate: state.certificate, name: hostname().slice(0,80), platform: ({ darwin: 'macOS', linux: 'Linux', win32: 'Windows' })[platform()] ?? platform(), shareSsh: plan.shareSsh, ...(plan.browser ? { browser: true } : {}) }); }
73
72
  catch (error) {
74
73
  if (plan.browser && error.statusCode === 400 && error.message === 'invalid_driver_input') throw new Error('控制面尚不支持浏览器接入,请升级控制面;或在本机终端使用不带 --browser 的 connect。未自动输出配对凭据。');
75
74
  throw error;