diff --git a/README.md b/README.md index d9f399d..b7fd7da 100644 --- a/README.md +++ b/README.md @@ -605,7 +605,7 @@ nodeagent/ ├── scripts/ # install.cmd / control.cmd(一键入口)/ install.ps1 / control.ps1 / verify.mjs ├── tests/e2e/ # 端到端测试 ├── docs/ # 开发文档 -├── PRD.md # 产品需求文档 +├── docs/ # 项目文档(含 PRD) └── README.md ``` @@ -644,7 +644,7 @@ nodeagent/ - [`CHANGELOG.md`](CHANGELOG.md) —— **变更日志**(未发布版本的内容汇总 / 历史版本) - [`docs/ROADMAP.md`](docs/ROADMAP.md) —— **当前进度盘点与下一步路线**(2026-10-07 基线:待办收尾 / 语义可断言 / 状态采样 / 安全残余) -- [产品需求文档(PRD)](./PRD.md) +- [产品需求文档(PRD)](./docs/PRD.md) - [开发文档(DEVELOPMENT)](./docs/DEVELOPMENT.md) —— 协议细节、能力 schema、安全模型、各端实现指南 - [**跨机接管的边界与局限**](./docs/REMOTE-LIMITS.md) —— 哪些问题能远程修、哪些必须人工,附真实故障诊断案例 - [**实战复盘:短板与改进优先级**](./docs/RETROSPECTIVE.md) —— 基于真机使用的短板分析(GUI 语义 / 编码 / 自愈 / 可观测性)。**写于 2026-09-28(19 项能力时),多数 P0/P1 已解决 —— 最新状态见 [ROADMAP](./docs/ROADMAP.md) §3 对照表** diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 05d74f4..0e96089 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -10,7 +10,7 @@ | 日期 | 2026-09-27 | | 状态 | 开发阶段 | | 目标端 | macOS(控制端)/ Windows(被控端) | -| 配套文档 | [产品需求文档(PRD)](../PRD.md) | +| 配套文档 | [产品需求文档(PRD)](PRD.md) | --- @@ -745,7 +745,7 @@ nodeagent/ │ └── install.ps1 # Windows 一键安装脚本 ├── docs/ # 文档 ├── README.md -└── PRD.md +└── PRD.md(已移入 docs/) ``` | 包 | 职责 | 关键文件 | diff --git a/PRD.md b/docs/PRD.md similarity index 100% rename from PRD.md rename to docs/PRD.md diff --git a/scripts/pack.mjs b/scripts/pack.mjs index 75f3192..0ef7da1 100644 --- a/scripts/pack.mjs +++ b/scripts/pack.mjs @@ -131,7 +131,7 @@ async function main() { // 一键入口:.cmd 必须**纯 ASCII**。CMD 的代码页(中文 Windows = 936/GBK) // 无法可靠往返 UTF-8,中文提示一律交给带 BOM 的 .ps1 去输出。 - for (const cmd of ['install.cmd', 'control.cmd', 'run-temp.cmd']) { + for (const cmd of ['install.cmd', 'control.cmd', 'run-portable.cmd']) { copyFileSync(join(root, 'scripts', cmd), join(PKG_DIR, cmd)); } @@ -150,7 +150,7 @@ async function main() { log(' .ps1 BOM 检查通过(兼容 Windows PowerShell 5.1)'); // 防呆 B:.cmd 里出现非 ASCII 字节 = 中文乱码/命令截断的隐患。 - for (const cmd of ['install.cmd', 'control.cmd', 'run-temp.cmd']) { + for (const cmd of ['install.cmd', 'control.cmd', 'run-portable.cmd']) { const buf = readFileSync(join(PKG_DIR, cmd)); const bad = [...buf].findIndex((b) => b > 0x7f); if (bad >= 0) { @@ -190,17 +190,17 @@ async function main() { '【日常管理】双击 control.cmd', ' 1 状态 / 2 启动 / 3 停止 / 4 重启 / 5 日志 / 6 卸载 / 7 彻底卸载', '', - '【临时试用,不装也行】双击 run-temp.cmd', + '【免安装试用,不装也行】双击 run-portable.cmd', ' * 不需要管理员、不写计划任务、Ctrl+C 即停', ' * 首次运行自动生成配置与密钥(agent.json),并在控制台打印连接命令', - ' * run-temp.cmd background = 最小化后台启动;stop = 结束;status = 看状态', + ' * run-portable.cmd background = 最小化后台启动;stop = 结束;status = 看状态', ' * 适合临时测一下;长期用请走 install.cmd(有开机自启与进程守护)', '', '【密钥】本包**不含** PSK.txt(避免公开渠道泄露密钥)。密钥来源按序为:', ' 1) 若本目录已有 PSK.txt -> 直接用它', ' 2) 若本机已有 %USERPROFILE%\\.nodeagent\\agent.json -> 复用其中的 key', ' 3) 都没有 -> 自动生成一把随机密钥', - ' 装完 / 临时启动后,密钥会打印在屏幕上;也可用 run-temp.cmd status 查看', + ' 装完 / 免安装启动后,密钥会打印在屏幕上;也可用 run-portable.cmd status 查看', ' 这就是 Mac 端 --key 要填的值', '', '【注意】', diff --git a/scripts/run-temp.cmd b/scripts/run-portable.cmd similarity index 87% rename from scripts/run-temp.cmd rename to scripts/run-portable.cmd index 3fcc30c..73d9d5a 100644 --- a/scripts/run-temp.cmd +++ b/scripts/run-portable.cmd @@ -1,17 +1,17 @@ @echo off REM ============================================================================ -REM nodeagent - TEMPORARY launcher (no install, no admin, no scheduled task) +REM nodeagent - PORTABLE launcher (no install, no admin, no scheduled task) REM REM Purpose: bring the agent up for a quick test WITHOUT running install.cmd. REM The agent is zero-config: on first run it creates %USERPROFILE%\.nodeagent\ REM (agent.json with a random PSK + self-signed cert) and starts listening. REM REM Usage: -REM run-temp.cmd start in foreground (Ctrl+C to stop) -REM run-temp.cmd start same as above -REM run-temp.cmd background start hidden, then print status -REM run-temp.cmd stop stop the background instance -REM run-temp.cmd status show whether it is running +REM run-portable.cmd start in foreground (Ctrl+C to stop) +REM run-portable.cmd start same as above +REM run-portable.cmd background start hidden, then print status +REM run-portable.cmd stop stop the background instance +REM run-portable.cmd status show whether it is running REM REM IMPORTANT: the agent takes NO command-line arguments (it does not parse REM argv at all). The listen port comes from %USERPROFILE%\.nodeagent\ @@ -81,7 +81,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$cfg = Join-Path $env:USERPROFILE '.nodeagent\agent.json';" ^ "if (Test-Path $cfg) { Write-Host (' config : ' + $cfg); try { (Get-Content $cfg -Raw | ConvertFrom-Json) | ForEach-Object { Write-Host (' node_id : ' + $_.node_id); Write-Host (' key : ' + $_.key) } } catch {} } else { Write-Host ' config : (not yet created)' };" echo. -echo If the connect line above is empty, run: run-temp.cmd status +echo If the connect line above is empty, run: run-portable.cmd status pause exit /b 0