device-center 0.2.0-beta.4 → 0.2.0-beta.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.
Files changed (50) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/README.md +25 -8
  3. package/SECURITY.md +14 -2
  4. package/bin/device-center.mjs +29 -5
  5. package/docs/agent-install.md +5 -5
  6. package/docs/cli.md +97 -0
  7. package/docs/driver-binding.md +5 -5
  8. package/docs/friend-trial.md +5 -5
  9. package/docs/hosted-access.md +1 -1
  10. package/docs/npm.md +12 -10
  11. package/docs/onboarding.md +4 -4
  12. package/docs/remote-access.md +2 -2
  13. package/docs/roadmap.md +13 -1
  14. package/docs/security-and-sync.md +2 -0
  15. package/docs/troubleshooting.md +11 -0
  16. package/docs/windows-acceptance.md +57 -0
  17. package/login.html +1 -1
  18. package/npm-shrinkwrap.json +2 -2
  19. package/package.json +4 -2
  20. package/scripts/access.mjs +0 -1
  21. package/scripts/driver.mjs +2 -3
  22. package/scripts/service.mjs +42 -16
  23. package/server/cli/commands.mjs +181 -0
  24. package/server/cloudAccess.mjs +1 -1
  25. package/server/drivers/access.mjs +15 -14
  26. package/server/drivers/browserPairing.mjs +9 -4
  27. package/server/drivers/cliClient.mjs +87 -0
  28. package/server/drivers/cliManagement.mjs +119 -0
  29. package/server/drivers/cloudLink.mjs +19 -20
  30. package/server/drivers/cloudRegistry.mjs +6 -0
  31. package/server/drivers/privateFiles.mjs +57 -0
  32. package/server/drivers/windowsSecurity.mjs +119 -0
  33. package/server/drivers/windowsService.mjs +77 -0
  34. package/server/index.mjs +36 -8
  35. package/server/unifiedAccess.mjs +24 -4
  36. package/src/api.js +2 -0
  37. package/src/cli-approval.js +49 -0
  38. package/src/cli-handoff.js +19 -0
  39. package/src/install-prompt.js +2 -2
  40. package/src/install-walkthrough.js +6 -6
  41. package/src/login-flow.js +37 -0
  42. package/src/login.css +3 -1
  43. package/src/login.js +15 -10
  44. package/src/main.js +7 -6
  45. package/src/messages.js +359 -117
  46. package/src/onboarding.js +35 -15
  47. package/src/pairing-handoff.js +6 -2
  48. package/src/start.js +10 -2
  49. package/src/styles.css +1 -0
  50. package/start.html +12 -4
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.6)
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.6**,提供统一 CLI 管理与 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.6 start
38
40
  ```
39
41
 
40
42
  打开 `http://127.0.0.1:5174`,将 `/mcp` 添加到本机智能体。侧栏“开始使用”按管理电脑 → 智能体 → 设备引导;导入 SSH 后检查一次连通性。没有可用 Agent/SSH 的设备保持未知;资源快照过期显示“待刷新”,不代表密钥过期。列表刷新不主动连接 SSH。
@@ -42,17 +44,32 @@ 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.6 plan
48
+ npx --yes device-center@0.2.0-beta.6 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
 
54
56
  ## 能做什么
55
57
 
58
+ ### CLI 管理(beta.6 起)
59
+
60
+ 设备列表/详情、命名/标签/用途/声明服务、手动采集、连接诊断、SSH 引用管理及 MCP 工具调用,供人和 Agent 共用。这些命令需要 beta.6 或更新版;beta.5 不包含。安装前核对 npm 公开版本,源码验收可使用下方命令。完整示例、错误码与权限说明见 [CLI 手册](docs/cli.md)。
61
+
62
+ ```sh
63
+ node bin/device-center.mjs capabilities --json
64
+ node bin/device-center.mjs devices list --port 5174 --json
65
+ node bin/device-center.mjs doctor --port 5174
66
+ # 云端管理需要本人在浏览器另行批准最长 8 小时的权限
67
+ node bin/device-center.mjs auth login --confirm
68
+ node bin/device-center.mjs devices list --cloud --json
69
+ ```
70
+
71
+ `auth logout --confirm` 撤销 CLI 管理权限,保留资源回报。CLI 可调用已有的指定日志授权功能;不能替目标设备批准日志或获得任意远程执行权限。
72
+
56
73
  | 能力 | 当前实现 |
57
74
  | --- | --- |
58
75
  | 资源清单 | 本机真实资源;已有 SSH 主机经用户触发检查;云端只显示获准回报 |
@@ -60,7 +77,7 @@ npx --yes device-center@0.2.0-beta.3 connect --confirm
60
77
  | 日志 | 指定标签/绝对文件/管理设备/有效期,最大64KiB;本机审计 |
61
78
  | 访问路径 | Agent 精确私网入口优先,网络失败回退官方/自建 HTTPS 密文中转;证书错误停止 |
62
79
  | 中转额度 | 每账号100MiB/UTC日、全实例1GiB/日,持久计数、并发与速率限制 |
63
- | 尚未提供 | 任意远程命令、通用文件传输、Windows 原生 Agent、云端 MCP、CF 专用适配器、计费、自动迁移 |
80
+ | 尚未提供 | 任意远程命令、通用文件传输、云端 MCP、CF 专用适配器、计费、自动迁移 |
64
81
 
65
82
  日志操作通过 `device_center_read_log` 请求,不能用 MCP 授权自身。用户自己的智能体仍需在目标设备单独配置授权。已有 SSH 路径独立使用,SSH“连接计划”不会自动改成新 Agent 通道。Docker 代表容器自身,不能当作宿主机;宿主运行原生 Driver 与本机智能体交互。
66
83
 
package/SECURITY.md CHANGED
@@ -1,10 +1,22 @@
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
+ ## CLI management (beta.6 and later)
10
+
11
+ Cloud CLI management is a separate capability, never implied by telemetry binding or log grants. The account owner approves a five-minute, one-time browser handoff after comparing the full device fingerprint. Approval permits account device metadata reads, descriptive profile edits and requests for previously approved resource fields, for at most eight hours. It does not permit account administration, SSH configuration changes, log grants, arbitrary commands or file access. Browser tickets are hashed at rest, removed from the URL before login, and omitted from automated CLI results. CLI requests are signed by the existing device identity and checked for path, origin, time, nonce, tenant, revocation and grant expiry. No browser cookies or long-lived cloud tokens are exported to the CLI.
12
+
13
+ The grant belongs to the approved device identity, not an isolated OS process. Other software with access to that user's private identity can use its active scope; same-user compromise remains outside this boundary. Logout or owner revocation cancels pending requests and invalidates CLI management immediately, while preserving device telemetry. Device revocation invalidates both. Descriptive names, purposes, tags and services are untrusted data, never Agent instructions or grants. Profile changes require an optimistic revision. Local CLI calls only fixed loopback routes; SSH checks and mutations need explicit confirmation. Added grant tables are backward-compatible; rollback does not erase identity or device data, and grant records are not transferable credentials.
14
+
15
+ ## Windows candidate
16
+
17
+ 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).
18
+
19
+ 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
20
 
9
21
  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
22
 
@@ -1,15 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync, realpathSync } from 'node:fs';
3
3
  import { fileURLToPath, pathToFileURL } from 'node:url';
4
+ import { parseManagement } from '../server/cli/commands.mjs';
4
5
 
5
6
  const ROOT = fileURLToPath(new URL('..', import.meta.url));
6
7
  const version = () => JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
8
+ const MANAGEMENT = ['devices', 'auth', 'doctor', 'ssh', 'mcp', 'capabilities'];
7
9
  export function parseCli(argv = []) {
8
10
  const command = argv[0] ?? 'help';
9
11
  if (['help', '--help', '-h', '--version', '-v'].includes(command)) {
10
12
  if (argv.length > 1) throw new Error('帮助和版本命令不接受其他参数。');
11
13
  return { command: command === '-v' ? '--version' : ['-h', '--help'].includes(command) ? 'help' : command };
12
14
  }
15
+ if (MANAGEMENT.includes(command)) { parseManagement(argv); return { command, args: argv.slice(1) }; }
13
16
  if (!['start', 'plan', 'connect', 'run', 'status', 'disconnect', 'service', 'access'].includes(command)) throw new Error('未知命令。运行 device-center --help 查看用法。');
14
17
  const args = argv.slice(1);
15
18
  if (command === 'start') {
@@ -30,7 +33,7 @@ export function parseCli(argv = []) {
30
33
  export function helpText() {
31
34
  return `Device Center ${version()} · 只读管理 Driver 源码原型
32
35
 
33
- 需要 Node.js 24;管理 Driver 支持 macOS / Linux。
36
+ 需要 Node.js 24;管理 Driver 支持 macOS / Linux / Windows 11(候选,待实机验收)。
34
37
 
35
38
  device-center start [--port 5174] 启动本机面板与只读 MCP
36
39
  device-center plan --cloud https://你的域名 预览回报范围,不生成身份或联网
@@ -41,21 +44,37 @@ device-center status 查看已有绑定,不显示私
41
44
  device-center run [--port 5174] 前台恢复已绑定 Driver
42
45
  device-center disconnect --confirm 通知云端撤销,保留本机身份
43
46
  device-center service plan|status|install|uninstall [--port 5174] [--confirm]
47
+ device-center devices help 列表、详情、命名、标签、用途、服务与手动采集
48
+ device-center auth login --confirm 本人另行批准限时云端 CLI 管理权限
49
+ device-center auth status|logout 查看/撤销 CLI 权限,保留设备绑定
50
+ device-center doctor [--cloud] 检查本机服务和已绑定控制面,不扫描
51
+ device-center ssh help 导入本机 SSH 引用、显式检查及移除
52
+ device-center mcp setup|tools|call 接入说明与现有只读工具
53
+ device-center capabilities --json Agent 可读命令能力、权限和退出码
54
+
55
+ 新管理命令支持 --json,默认本机;devices --cloud 使用已绑定的控制面。
56
+ 详情和资料修改使用不可变 ID;--revision 防止覆盖并发修改。变更需 --confirm。
44
57
 
45
58
  默认端口5174,数据位于本用户的应用数据目录。关闭网页不会停止前台进程。
46
59
  默认回报本机名称、系统、内存和磁盘;--share-ssh 需命令申请及面板另行批准。
47
60
  本机无需平台注册;connect 默认申请接入 https://devices.owenshen.top,需登录自己的账号核对批准。
48
61
  --cloud 可使用自建域名。device-center access help 查看受限日志授权与可选局域网直连。
49
62
  支持 TLS 1.3 双向认证的日志读取与密文中转,默认100MiB/账号/日;不会自动获得操作权限。
50
- 任意远程命令、通用文件传输和 Windows 原生 Driver 尚未提供。安装包不含身份或配对码。
63
+ Windows 身份由 DPAPI 当前用户保护,后台在当前用户登录后启动;注销或休眠会停止回报。
64
+ 任意远程命令和通用文件传输尚未提供。安装包不含身份或配对码。
51
65
  使用 npx 时只运行前台;常驻请先将本包固定版本安装到长期目录,再单独 install。
52
66
  `;
53
67
  }
54
68
  export async function main(argv = process.argv.slice(2)) {
69
+ if (argv.includes('--json')) {
70
+ if (argv.filter(v => v === '--json').length !== 1 || ![...MANAGEMENT, 'access', 'status', 'plan', '--version'].includes(argv[0])) throw Object.assign(new Error('--json 适用于设备管理、access、status、plan 和 --version。'), { cliCode: 'invalid_arguments', statusCode: 400 });
71
+ argv = argv.filter(v => v !== '--json');
72
+ }
55
73
  const plan = parseCli(argv);
56
74
  if (plan.command === 'help') return helpText();
57
75
  if (plan.command === '--version') return version();
58
76
  if (Number(process.versions.node.split('.')[0]) < 24) throw new Error('需要 Node.js 24 或更高版本。');
77
+ if (MANAGEMENT.includes(plan.command)) return (await import('../server/cli/commands.mjs')).main([plan.command, ...plan.args]);
59
78
  if (plan.command === 'access') return (await import('../scripts/access.mjs')).main(plan.args);
60
79
  if (plan.command === 'service') {
61
80
  if (plan.args[0] === 'install' && /(?:^|[\\/])_npx[\\/]/.test(ROOT)) throw new Error('npx 缓存会被清理,不能用作常驻目录。请先 npm install -g device-center@固定版本,再运行 device-center service install --confirm。');
@@ -63,15 +82,20 @@ export async function main(argv = process.argv.slice(2)) {
63
82
  }
64
83
  const driver = await import('../scripts/driver.mjs');
65
84
  if (plan.command === 'start') {
66
- if (process.platform === 'win32') throw new Error('Windows 原生管理 Driver 尚未支持。');
67
85
  await driver.runLocal({ port: plan.port }); return;
68
86
  }
69
87
  return driver.main([plan.command, ...plan.args]);
70
88
  }
71
89
  // npm links bin entries through a symlink; compare the actual script, not the link path.
72
90
  if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
91
+ const json = process.argv.includes('--json');
73
92
  try {
74
93
  const result = await main();
75
- if (result != null) console.log(typeof result === 'string' ? result : JSON.stringify(result, null, 2));
76
- } catch (error) { console.error(error.message); process.exitCode = 1; }
94
+ if (result != null) console.log(json ? JSON.stringify({ schemaVersion: 1, ok: true, data: result }) : typeof result === 'string' ? result : JSON.stringify(result, null, 2));
95
+ } catch (error) {
96
+ const { safeCode, exitCode } = await import('../server/cli/commands.mjs');
97
+ if (json) console.log(JSON.stringify({ schemaVersion: 1, ok: false, error: { code: safeCode(error), status: error.statusCode ?? null } }));
98
+ else console.error(error.cliCode ? `${error.cliCode}: ${error.message}` : error.message);
99
+ process.exitCode = MANAGEMENT.includes(process.argv[2]) ? exitCode(error) : 1;
100
+ }
77
101
  }
@@ -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.6`(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.6
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`。
package/docs/cli.md ADDED
@@ -0,0 +1,97 @@
1
+ # CLI 与 Agent 使用手册
2
+
3
+ 本手册中的统一管理命令需要 `0.2.0-beta.6` 或更新版,beta.5 不包含。需要 Node.js 24;安装前核对 npm 公开版本,源码验收使用 `node bin/device-center.mjs` 代替下文的 `device-center`。云端 CLI 管理还需要同版或更新的控制面;网页指南只在新包公开安装验证通过后更新版本。
4
+
5
+ ## 从一台电脑开始
6
+
7
+ ```sh
8
+ device-center --help
9
+ device-center service status --port 5174
10
+ # 没有运行服务时,在另一个终端前台启动;保持窗口打开
11
+ device-center start --port 5174
12
+ device-center devices list
13
+ device-center doctor
14
+ ```
15
+
16
+ 本机模式不需要账号、绑定或云端。Docker 里看到的是容器,不能代表宿主机。CLI 不自动安装、启动服务或改 Agent 配置。
17
+
18
+ ## 云端管理
19
+
20
+ ```sh
21
+ # 尚未绑定这台管理电脑时执行,浏览器中由本人核对指纹批准
22
+ device-center connect --cloud https://devices.owenshen.top --browser --confirm
23
+ # 设备绑定只回报资源;CLI 管理权限需要再单独批准
24
+ device-center auth login --minutes 480 --confirm
25
+ device-center auth status
26
+ device-center devices list --cloud
27
+ device-center doctor --cloud
28
+ ```
29
+
30
+ 浏览器打开后本人核对终端的完整公钥指纹,批准一次,CLI 自动继续。不需要把配对码交给 Agent,也不需要回对话回复“已批准”。没有浏览器的管理电脑可在本机交互终端执行 `auth login --no-browser --confirm`,自己打开一次性链接;链接不放进 prompt、脚本、工单或聊天记录。
31
+
32
+ 此授权最长 8 小时,允许查看本账号设备、编辑说明、请求已授权的资源采集。不包含日志、SSH 登录或任意远程命令。私钥仍留在管理电脑;每次请求有签名、时限和防重放校验。自建控制面使用绑定时的 `--cloud` 域名,不导出网页 cookie 或登录令牌。
33
+
34
+ `device-center auth logout --confirm` 立即撤销本机 CLI 权限,保留设备绑定和回报。也可在控制面 `/cli` 查看并撤销授权。解绑设备后其 CLI 权限立即失效。
35
+
36
+ ## 设备名称、用途和服务
37
+
38
+ 先从列表复制完整 `id`,再查看详情中的 `profile.revision`。名字和标签不是身份凭据。
39
+
40
+ ```sh
41
+ device-center devices show --id '完整设备ID' --cloud
42
+ device-center devices update --id '完整设备ID' --revision 0 \
43
+ --name '公司 Windows' --type workstation --purpose 'Windows 构建和日志验收' \
44
+ --tags 'windows,company' --services 'build-server' --cloud --confirm
45
+ device-center devices list --cloud --state online --tag windows
46
+ ```
47
+
48
+ 类型支持 `personal`、`server`、`workstation`、`other`、`unspecified`。字段长度和数量沿用网页限制。只更新提供的字段;`--tags ''`、`--services ''` 清空对应列表。并发修改返回 `device_profile_conflict`,重新查看后再决定。服务是用户声明,未扫描安装列表;用途和标签是描述,Agent 应作为不可信数据读取,不能把它们当指令或操作授权。
49
+
50
+ ## 手动采集与“过期”
51
+
52
+ ```sh
53
+ device-center devices collect --id '完整设备ID' --cloud --wait 75 --confirm
54
+ ```
55
+
56
+ 不带 `--cloud` 采集本机或明确关联的 SSH 主机。云端采集只请求在线 Driver 重新回报已批准的内存、磁盘字段;不安装软件、不执行自由命令。`--wait` 最多 90 秒,不填则返回排队状态。
57
+
58
+ “过期”是最近没有有效资源回报,不是私钥或账号过期。休眠、注销、断网、后台停止都会暂停回报。采集不能唤醒离线设备;先 `doctor`、`service status` 检查,再 `show` 核对回报时间。超时不代表解绑,不要重复绑定。
59
+
60
+ ## 已有 SSH 与连接路径
61
+
62
+ ```sh
63
+ device-center ssh candidates
64
+ device-center ssh import --aliases 'build-host,linux-box' --confirm
65
+ device-center ssh check --alias build-host --confirm
66
+ device-center devices show --id 'ssh:build-host'
67
+ device-center ssh remove --aliases linux-box --confirm
68
+ ```
69
+
70
+ 候选检查和导入只读本机 SSH 配置引用,不读私钥或连接网络。`ssh check` 明确建立 SSH 连接,使用既有本机认证与严格 known_hosts,执行固定、有限的只读资源检查。Windows 原生固定 SSH 采集暂不支持。移除只影响面板引用,保留系统配置。`show` 区分配置路径与最近验证路径;不扫描网段、复制云端私钥或自动建立隧道。
71
+
72
+ ## Agent 与日志
73
+
74
+ ```sh
75
+ device-center capabilities --json
76
+ device-center mcp setup
77
+ device-center mcp tools --json
78
+ device-center mcp call --tool device_center_list_resources --json
79
+ device-center access help
80
+ ```
81
+
82
+ 日志使用现有 `access trust / grant / read / revoke`,需要管理端固定目标完整指纹、目标设备主人单独授权具体日志路径与时限。`access read --peer 完整指纹 --label app --bytes 16384 --json` 返回实际 LAN 或加密中转路径;不自动增加目标权限。参见 [远程访问](remote-access.md)。
83
+
84
+ ## 自动化契约
85
+
86
+ 新增管理命令支持 `--json`:成功输出一个 `{schemaVersion:1,ok:true,data:…}`,失败输出 `{schemaVersion:1,ok:false,error:{code,status}}`。进度写 stderr;不把私钥、一次性浏览器凭据或原始网络错误放进 JSON。云端列表分页传输,CLI 自动汇总(每账号最多 256 条资源)。本机端口只允许 `127.0.0.1`,不接受任意 API URL,拒绝重定向。
87
+
88
+ | 退出码 | 含义 |
89
+ | --- | --- |
90
+ | 0 | 命令完成;诊断结果还需检查 `healthy` |
91
+ | 1 | 操作失败或未知错误 |
92
+ | 2 | 新管理命令参数错误 |
93
+ | 3 | 缺少确认、绑定或授权 |
94
+ | 4 | 并发冲突或当前能力不可用 |
95
+ | 5 | 网络、服务、限流或等待超时 |
96
+
97
+ 原有 `connect/run/service` 终端交互保持兼容;`connect` 不支持 `--json`,避免把绑定凭据当自动化输出。状态、plan 与 access 可使用 JSON;旧命令失败仍保持退出码 1。
@@ -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.6`,发布状态以 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.6 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.6`,支持 macOS/Linux,并提供 Windows 11 预览接入。使用 npm `beta` 渠道;`latest` 仍可能是旧版本,安装请写明版本,实际发布状态以公开 registry 为准。
4
4
 
5
- 本地 `0.2.0-beta.4` 候选新增 `connect --browser --confirm` 与普通终端安装脚本,尚未发布。必须先发布新 CLI,再将指南切到对应版本并部署新版控制面;只更新网页不能让已安装的旧 CLI 获得新参数。新控制面继续支持旧版手动填码。回退网页与旧 CLI 不会删除既有身份,新增加的登记摘要列可保留。以下仍为当前已发布版命令。
5
+ beta.6 增加统一 CLI 与独立云端管理授权,见 [CLI 手册](cli.md)。沿用 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.6 --help
9
+ npx --yes device-center@0.2.0-beta.6 plan
10
+ # 主动接入默认官方服务;有浏览器时加 --browser 自动打开本次绑定页
11
+ npx --yes device-center@0.2.0-beta.6 connect --browser --confirm
12
+ # 无浏览器:在终端与另一台电脑的面板之间核对配对码
13
+ npx --yes device-center@0.2.0-beta.6 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.6 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.6 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.6
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. 面板是否还能打开?打不开时先确认前台进程或后台服务在运行。