homeagent-runner 0.4.15 → 0.4.18
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/CHANGELOG.md +41 -0
- package/README.md +203 -159
- package/README.zh-CN.md +341 -0
- package/dist/runner/lsp.js +999 -0
- package/dist/runner/patch.js +66 -11
- package/dist/runner/permissions.js +24 -11
- package/dist/runner/shells.js +305 -0
- package/dist/runner/tools.js +19 -2
- package/dist/shared/protocol.js +1 -1
- package/dist/shared/tools.js +24 -4
- package/docs/OPEN_SOURCE.md +8 -8
- package/docs/TOOLS.md +17 -4
- package/docs/WEBCODEX_CODE_AUDIT.md +3 -3
- package/package.json +2 -2
- package/README.en.md +0 -383
package/docs/OPEN_SOURCE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 开源仓库与源码发布
|
|
2
2
|
|
|
3
|
-
本仓库以 MIT 开放原始代码,版本为 0.4.
|
|
3
|
+
本仓库以 MIT 开放原始代码,版本为 0.4.18,npm 发布拆成 `homeagent-server` 和 `homeagent-runner` 两个包。Server 包只包含编译后的 Server、Dashboard 和 Server 资源;Runner 包只包含 Runner、共享协议和 Windows 进程树辅助代码。CLI 和源码采用相同许可证;两个 npm 包都通过文件白名单只包含运行所需文件、文档和许可证。包名是否可用及账号发布权限以发布当时的 registry 为准。
|
|
4
4
|
|
|
5
5
|
## 文件划分
|
|
6
6
|
|
|
@@ -53,7 +53,7 @@ npm run release:source
|
|
|
53
53
|
|
|
54
54
|
输出位于被忽略的 release/:
|
|
55
55
|
|
|
56
|
-
- `HomeAgent-v0.4.
|
|
56
|
+
- `HomeAgent-v0.4.18-source.tar.gz`
|
|
57
57
|
- 对应 `.sha256` 校验文件
|
|
58
58
|
- 对应 `.manifest.txt`,包括版本、Git 提交和全部发布路径
|
|
59
59
|
|
|
@@ -65,8 +65,8 @@ npm run release:source
|
|
|
65
65
|
|
|
66
66
|
`npm run release:npm` 构建 JavaScript、以 `--ignore-scripts` 分别打包两个包,并检查归档文件白名单、运行资源及 SHA-512 完整性,输出:
|
|
67
67
|
|
|
68
|
-
- `release/homeagent-server-0.4.
|
|
69
|
-
- `release/homeagent-runner-0.4.
|
|
68
|
+
- `release/homeagent-server-0.4.18.tgz`
|
|
69
|
+
- `release/homeagent-runner-0.4.18.tgz`
|
|
70
70
|
- 两个归档各自的 `.sha256`
|
|
71
71
|
- `release/npm-packages.json`:两个包的名称、版本、Git commit、校验、dist-tag 和路径清单
|
|
72
72
|
|
|
@@ -76,20 +76,20 @@ npm run release:source
|
|
|
76
76
|
|
|
77
77
|
`.github/workflows/release.yml` 支持两种入口:
|
|
78
78
|
|
|
79
|
-
1. 推送版本标签,例如 `v0.4.
|
|
79
|
+
1. 推送版本标签,例如 `v0.4.18`。
|
|
80
80
|
2. 在 Actions → release → Run workflow 中填写**已经存在**的版本标签。
|
|
81
81
|
|
|
82
82
|
先按下一节配置 `NPM_TOKEN`。首次推送源码、配置真实 `origin` 并确认 Actions 可用后,可以按下面方式发布:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
85
|
# 先提交本次版本的源码和文档,工作区保持干净
|
|
86
|
-
git tag -a v0.4.
|
|
87
|
-
git push origin v0.4.
|
|
86
|
+
git tag -a v0.4.18 -m "HomeAgent v0.4.18"
|
|
87
|
+
git push origin v0.4.18
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
本文只是发布说明,准备脚本不会替操作者执行这些命令。
|
|
91
91
|
|
|
92
|
-
标签必须与 package.json、package-lock.json 及 runtime VERSION 一致,CHANGELOG.md 必须有对应版本的非空条目。预发布可用 `v0.4.
|
|
92
|
+
标签必须与 package.json、package-lock.json 及 runtime VERSION 一致,CHANGELOG.md 必须有对应版本的非空条目。预发布可用 `v0.4.18-rc.1`(相关版本文件也必须为 `0.4.18-rc.1`)。禁止把普通分支或不匹配版本伪装成发布。
|
|
93
93
|
|
|
94
94
|
发布流水线按次序执行:
|
|
95
95
|
|
package/docs/TOOLS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 工具与配置参考
|
|
2
2
|
|
|
3
|
-
v0.3 新增的 13 个开发工具、命令别名/环境配置、批量编辑恢复和安全提交的完整说明见 [日常开发工作流](DEVELOPMENT_WORKFLOW.md)。v0.4 增加受控 Git
|
|
3
|
+
v0.3 新增的 13 个开发工具、命令别名/环境配置、批量编辑恢复和安全提交的完整说明见 [日常开发工作流](DEVELOPMENT_WORKFLOW.md)。v0.4 增加受控 Git 网络操作、Web 权限编辑器、统一 diff 模糊重定位、持久 Shell 会话与轻量 LSP 集成,当前共 45 个 MCP 工具。下列 v0.2 原有 API 继续保留;Git add 和 diff 的排除策略有所收紧。
|
|
4
4
|
|
|
5
5
|
## 权限组合
|
|
6
6
|
|
|
@@ -8,9 +8,9 @@ v0.3 新增的 13 个开发工具、命令别名/环境配置、批量编辑恢
|
|
|
8
8
|
|
|
9
9
|
| scope | 工具 | 本地额外条件 |
|
|
10
10
|
| --- | --- | --- |
|
|
11
|
-
| read | list_directory/read_file/search_files/get_file_info/read_process_output/list_processes/git_status/git_diff/git_log |
|
|
12
|
-
| write | write_file/create_directory/move_file/edit_block | readOnly=false |
|
|
13
|
-
| execute | start_process/write_process_input/stop_process | readOnly=false;启动时需满足程序名单/别名,或设备项目与客户端均允许全部程序 |
|
|
11
|
+
| read | list_directory/read_file/read_files/search_files/get_file_info/get_edit_transactions/read_process_output/tail_process_output/wait_process/list_processes/list_shells/lsp_document_symbols/lsp_workspace_symbols/lsp_definition/lsp_references/lsp_hover/lsp_diagnostics/git_status/git_diff/git_log/git_branches | 项目存在,文件未被排除;进程与 Shell 会话必须属于当前主体 |
|
|
12
|
+
| write | write_file/create_directory/move_file/edit_block/edit_files/apply_unified_diff/recover_edit_transaction/save_project_note | readOnly=false |
|
|
13
|
+
| execute | start_process/run_command/write_process_input/stop_process/start_shell/run_shell/stop_process/stop_shell | readOnly=false;启动时需满足程序名单/别名,或设备项目与客户端均允许全部程序 |
|
|
14
14
|
| git | git_add/git_commit/git_commit_paths/git_switch_branch/git_fetch/git_pull/git_push | readOnly=false,allowGitWrite=true;网络操作还需对应设备开关 |
|
|
15
15
|
|
|
16
16
|
`readOnly` 禁止所有写入和执行入口;对可写项目的 read token 仍不允许写入。git scope 不自动包含 read。新 OAuth grant 必须选择具体设备/项目,存入 `projectGrants[deviceId]`;新增项目不自动获得访问,刷新保持原范围。PAT 同时支持全局 projects 和设备限定 projectGrants,两者取交集。v0.1 旧 OAuth grant 需撤销重授权才能收紧。
|
|
@@ -37,6 +37,16 @@ v0.3 新增的 13 个开发工具、命令别名/环境配置、批量编辑恢
|
|
|
37
37
|
- `get_file_info(path)`:大小、修改时间和文件/目录类型。
|
|
38
38
|
- `search_files(path=".",query,content=false,caseSensitive=false,limit=100,include=[],exclude=[],contextLines=0,respectGitIgnore=true)`:字面量匹配,支持 Node glob 过滤和最多 5 行上下文;Git 项目使用 tracked/untracked 非 ignored 源;非 Git 有界遍历并明确报告 ignore 未应用。最多约 10000 路径、500 结果和 256 KiB 内容结果。
|
|
39
39
|
- `edit_block(path,oldText,newText,expectedSha256?)`:oldText 必须唯一精确匹配;同项目内修改序列化,不让两个客户端的内置修改相互交错。外部编辑器或运行中的命令仍可能并发修改,不能把应用锁当作文件系统事务。
|
|
40
|
+
- `apply_unified_diff(diff,expectedSha256,dryRun=false,fuzz=20,ignoreWhitespace=false)`:通过带恢复日志的编辑器应用文本 unified diff,支持 `fuzz`(0–200 行)有界上下文行重定位及 `ignoreWhitespace` 行首尾水平空白容错;当模糊窗口内出现多处匹配时以 `ambiguous_patch` 拒绝,并返回 `relocatedHunks` 记录偏移详情。
|
|
41
|
+
|
|
42
|
+
## LSP 与代码智能工具
|
|
43
|
+
|
|
44
|
+
- `lsp_document_symbols(path)`:提取源文件结构化符号(类、接口、类型、枚举、函数、方法、常量、变量等)、精确行列范围、文档注释与模块导入关系。
|
|
45
|
+
- `lsp_workspace_symbols(path=".",query?,kind?,exportedOnly=false,limit=100,respectGitIgnore=true)`:跨工作区检索符号定义,按精确匹配、前缀匹配和子串匹配排序。
|
|
46
|
+
- `lsp_definition(path,line?,column?,symbol?,respectGitIgnore=true)`:根据 1-based 行列坐标或符号名定位定义,支持当前文件、相对模块导入(含 TypeScript `.js` → `.ts` 映射及 Python 模块)与工作区导出符号跳转。
|
|
47
|
+
- `lsp_references(path,line?,column?,symbol?,includeDeclaration=true,contextLines=0,limit=100,respectGitIgnore=true)`:按标识符词边界查找整个工作区内的符号引用,自动过滤注释并区分声明、导入与普通引用。
|
|
48
|
+
- `lsp_hover(path,line?,column?,symbol?,respectGitIgnore=true)`:返回指定位置或名称符号的声明签名、提取的 JSDoc/Docstring 文档注释、定义位置与代码预览。
|
|
49
|
+
- `lsp_diagnostics(path?,limit=100,respectGitIgnore=true,serverExecutable?,serverArgs=[])`:在 `read` 权限下提供零外部进程的内置语法、JSON、TypeScript AST 与未解析相对导入诊断;传入 `serverExecutable` 时(需 `execute` 权限及命令策略允许)可通过 stdio JSON-RPC 2.0 查询外部语言服务器诊断。
|
|
40
50
|
|
|
41
51
|
路径可以是项目相对路径或项目内绝对路径。拒绝 `..` 越界、所有路径组件中的符号链接/Windows junction、硬链接普通文件,以及 deniedNames。Windows 额外拒绝设备保留名、NTFS alternate data streams 和尾随点/空格别名。
|
|
42
52
|
|
|
@@ -56,6 +66,9 @@ v0.3 可选择本机 environmentProfiles 名称与 commandAliases 别名;配
|
|
|
56
66
|
- `write_process_input(processId,input,close=false)`:输入最多 65536 个字符,close=true 发送 EOF。
|
|
57
67
|
- `list_processes()`:仅当前主体、当前项目的历史与运行任务。
|
|
58
68
|
- `stop_process(processId)`:先进入 stopping 并继续占槽,实际树结束后才终结。Linux 向组发 SIGTERM,超时 SIGKILL,leader 提前结束时也清理剩余组;Windows 用 suspended admission 的 Job Object supervisor 托管整个树,并通过 taskkill 停止 supervisor。
|
|
69
|
+
- `start_shell(shell?,cwd=".",timeoutMs=3600000,environment?)`:启动受 `Processes` 监管的持久状态化 Shell 会话(Windows 默认 `powershell.exe`,POSIX 默认 `sh`/`bash`,仍须满足命令允许列表或全部程序策略)。
|
|
70
|
+
- `run_shell(command,sessionId?,shell?,cwd=".",timeoutMs=3600000,environment?,waitMs=10000)`:在持久 Shell 会话中执行命令(省略 `sessionId` 时自动复用空闲会话或新建会话),跨命令保留工作目录(`cd`)与 Shell/环境变量,返回本次命令隔离后的 `output`、`exitCode` 和更新后的 `cwd`。
|
|
71
|
+
- `list_shells()` / `stop_shell(sessionId)`:查看当前项目的持久 Shell 会话状态(`ready`/`running`、当前 `cwd`、最近退出码)或终止会话及其进程树。
|
|
59
72
|
|
|
60
73
|
状态包括 starting/running/stopping/exited/failed/stopped/timed_out/interrupted。默认最多 8 个运行进程、单进程输出 8 MiB、约 500 个历史任务。Server 重连不重启任务,Runner 重启把未结束记录标记 interrupted。Windows supervisor 会在 Runner 死亡时终止其 Job;Linux 强制杀死 Runner 的清理由 systemd/容器负责。没有 PTY 或跨 Runner 的任务迁移。
|
|
61
74
|
|
|
@@ -56,9 +56,9 @@ v0.2 功能基线的 Linux 回归为 24 通过、1 个 Windows 专用测试跳
|
|
|
56
56
|
| discovery | 有设备、上下文/manifest/指令、Git/任务和交接摘要;无动态项目注册/创建、project_ref、Workbench、自适应发现。 |
|
|
57
57
|
| files | 有目录分页、字节/行范围、批量读取、globs/ignore/上下文、SHA;无 regex、多查询 batch 与上游完整 snapshot continuation。 |
|
|
58
58
|
| edits | 有恢复日志、预检、失败回滚、重启恢复和精确块编辑;无跨文件快照隔离、完整 range 编辑器。 |
|
|
59
|
-
| patches |
|
|
59
|
+
| patches | 有文本 unified diff、有界模糊行重定位(fuzz)、可选空白容错、创建/删除与版本校验;未实现 Codex Patch、二进制/rename/mode-only diff。 |
|
|
60
60
|
| git | 有指定文件安全提交、branch inspect/switch、显式 linked worktree;无冻结 review snapshot、hunk 游标和自动 worktree 注册/派生授权。 |
|
|
61
|
-
| jobs | 有短命令返回、任务等待、环形尾部、alias/profile
|
|
61
|
+
| jobs | 有短命令返回、任务等待、环形尾部、alias/profile、持久状态化 Shell 会话(start_shell/run_shell/list_shells/stop_shell);无 detached supervisor、语义 readiness 和 Host continuation App。 |
|
|
62
62
|
| testing | 可执行明确允许的真实测试工具;无结构化 Rust/Go/Python 验证计划与测试计数证明。 |
|
|
63
63
|
| hygiene | 批量编辑可按摘要删除/回滚文件;无 Git restore/discard 等专用域。 |
|
|
64
64
|
| runner_config | 有本地 check-config;无远程 CAS/热重载。 |
|
|
@@ -68,7 +68,7 @@ v0.2 功能基线的 Linux 回归为 24 通过、1 个 Windows 专用测试跳
|
|
|
68
68
|
| documents | **未实现** PDF App 阅读器。 |
|
|
69
69
|
| docx | **未实现** DOCX App 阅读器。 |
|
|
70
70
|
| resource_references | **未实现** 统一资源引用、Workbench。 |
|
|
71
|
-
| lsp |
|
|
71
|
+
| lsp | 有文档符号、工作区符号、跨文件定义跳转、引用查找、hover 签名/文档与内置及外部 stdio LSP 诊断;未实现 call hierarchy。 |
|
|
72
72
|
| skills | **未实现** 可信 Skill 来源、安装/版本/激活/执行。 |
|
|
73
73
|
| plugins | **未实现** Runner 本地 MCP provider gateway。 |
|
|
74
74
|
| ssh_resources | **未实现** 命名 SSH 资源及持久 SSH shell。允许 ssh 程序不算同等实现。 |
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist/shared/**/*.js",
|
|
28
28
|
"runtime/",
|
|
29
29
|
"public/icon.png",
|
|
30
|
-
"README.
|
|
30
|
+
"README.zh-CN.md",
|
|
31
31
|
"CONTRIBUTING.md",
|
|
32
32
|
"SECURITY.md",
|
|
33
33
|
"CHANGELOG.md",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"ws": "8.22.0",
|
|
44
44
|
"zod": "4.6.7"
|
|
45
45
|
},
|
|
46
|
-
"version": "0.4.
|
|
46
|
+
"version": "0.4.18"
|
|
47
47
|
}
|
package/README.en.md
DELETED
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="public/icon.png" width="128" height="128" alt="HomeAgent icon">
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
<h1 align="center">HomeAgent</h1>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
<strong>Connect AI to your development machines.</strong><br>
|
|
9
|
-
Self-hosted MCP relay · Local execution · Permissions you control
|
|
10
|
-
</p>
|
|
11
|
-
|
|
12
|
-
<p align="center">
|
|
13
|
-
<a href="https://github.com/jhxxr/HomeAgent/actions/workflows/ci.yml"><img src="https://github.com/jhxxr/HomeAgent/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
14
|
-
<a href="https://www.npmjs.com/package/homeagent-server"><img src="https://img.shields.io/npm/v/homeagent-server?label=server&color=0755ff" alt="Server npm version"></a>
|
|
15
|
-
<a href="https://www.npmjs.com/package/homeagent-runner"><img src="https://img.shields.io/npm/v/homeagent-runner?label=runner&color=0755ff" alt="Runner npm version"></a>
|
|
16
|
-
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-147a57" alt="MIT License"></a>
|
|
17
|
-
<a href="CONTRIBUTING.md"><img src="https://img.shields.io/badge/Node.js-%E2%89%A524.14-339933" alt="Node.js 24.14 or newer"></a>
|
|
18
|
-
</p>
|
|
19
|
-
|
|
20
|
-
<p align="center">
|
|
21
|
-
<a href="README.md">简体中文</a> · English
|
|
22
|
-
</p>
|
|
23
|
-
|
|
24
|
-
<p align="center">
|
|
25
|
-
<a href="#quick-start">Quick start</a> ·
|
|
26
|
-
<a href="docs/DEPLOYMENT.md">Deployment</a> ·
|
|
27
|
-
<a href="docs/CLIENTS.md">AI clients</a> ·
|
|
28
|
-
<a href="docs/README.md">Documentation</a> ·
|
|
29
|
-
<a href="CHANGELOG.md">Changelog</a>
|
|
30
|
-
</p>
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
HomeAgent lets Claude, ChatGPT, Cursor and other MCP clients work on your own Linux / Windows development machines through a relay you host. Runners connect outbound and execute authorized file, command and Git operations locally, without opening inbound ports.
|
|
35
|
-
|
|
36
|
-
The execution system requires no model API key, hosted relay, telemetry or paid cloud service. Tool results are sent to the AI client you choose. Version **v0.4.15** supports one administrator and multiple devices.
|
|
37
|
-
|
|
38
|
-
## Remote Assist
|
|
39
|
-
|
|
40
|
-
Create a short-lived invitation in the Dashboard for one existing client authorization. The device owner selects multiple projects, per-project permissions and a shared duration in their local Runner before access is activated, and can stop it immediately. Personal/work pairing remains unchanged. No administrator account or model API key is needed on the assisted device; program allowlists are not an OS sandbox. See the [Remote Assist guide](docs/REMOTE_ASSIST.md).
|
|
41
|
-
|
|
42
|
-
## Why HomeAgent
|
|
43
|
-
|
|
44
|
-
| Your machines, your control | Built for everyday development |
|
|
45
|
-
| --- | --- |
|
|
46
|
-
| **Self-hosted relay**: keep the Server, SQLite and audit records on your server or local network. | **Files and code**: 35 tools for project context, line-based batch reads, search, strict diffs and journaled multi-file edits. |
|
|
47
|
-
| **Outbound runners**: authenticated WebSocket connections from Linux / Windows machines. | **Observable jobs**: immediate results for short commands; wait, read output, stop and retain records for longer tasks. |
|
|
48
|
-
| **Project-level access**: manage device and client permissions, with temporary elevation and automatic expiry. | **Git workflows**: review diffs, commit selected files safely, and separately control fetch / pull / push. |
|
|
49
|
-
|
|
50
|
-
## Screenshots
|
|
51
|
-
|
|
52
|
-
The overview maps **clients → MCP Server → Runners** and brings together jobs, permission reminders, audit activity and recent events. Device search, status filters, action confirmations, project permissions and job output remain available in their management views. The current interface is in Chinese.
|
|
53
|
-
|
|
54
|
-

|
|
55
|
-
|
|
56
|
-
Screenshots are rendered by a real browser using demo devices and projects in an isolated local environment, not production data. Statistics describe the audit sample returned by the Server.
|
|
57
|
-
|
|
58
|
-
<details>
|
|
59
|
-
<summary><strong>View the mobile layout</strong></summary>
|
|
60
|
-
|
|
61
|
-
On phones, a compact live topology keeps clients, the central MCP Server and Runners on the same screen, including the activity ring and call paths. Tap a node for its full settings; the segmented navigation opens the remaining management views.
|
|
62
|
-
|
|
63
|
-
<img src="docs/screenshots/dashboard-mobile.png" width="360" alt="HomeAgent mobile Dashboard: compact live client-to-MCP-to-Runner topology">
|
|
64
|
-
|
|
65
|
-
</details>
|
|
66
|
-
|
|
67
|
-
<details>
|
|
68
|
-
<summary><strong>Explore device permissions and task output</strong></summary>
|
|
69
|
-
|
|
70
|
-
**Device permissions** · Configure project paths, access levels, Git permissions and grant duration in the browser.
|
|
71
|
-
|
|
72
|
-

|
|
73
|
-
|
|
74
|
-
**Jobs and output** · Filter jobs by status, inspect execution records and read command output.
|
|
75
|
-
|
|
76
|
-

|
|
77
|
-
|
|
78
|
-
</details>
|
|
79
|
-
|
|
80
|
-
## How it works
|
|
81
|
-
|
|
82
|
-
```mermaid
|
|
83
|
-
flowchart TB
|
|
84
|
-
Clients["Claude / ChatGPT / Cursor"] -->|"HTTPS · MCP · OAuth / Token"| Server["HomeAgent Server"]
|
|
85
|
-
Server --- Console["Web Dashboard · SQLite · Audit"]
|
|
86
|
-
Runner["Linux / Windows Runner"] -->|"Outbound · WSS"| Server
|
|
87
|
-
Runner --- Files["Project files and code edits"]
|
|
88
|
-
Runner --- Commands["Local commands and jobs"]
|
|
89
|
-
Runner --- Git["Git workflows"]
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Built on the official MCP SDK v2 with Streamable HTTP `/mcp`, 2026-07-28 discovery/envelopes and legacy 2025 compatibility. Authentication includes OAuth authorization-code flow with S256 PKCE, scoped Bearer tokens and one-time device pairing. Deployment options include Docker Compose, Caddy/Nginx, optional Cloudflare Tunnel and native runner service installers.
|
|
93
|
-
|
|
94
|
-
This is an early self-hosted release, not a claim of feature parity with WebCodex or an independently audited operating-system sandbox. Persistent shells/PTY, detached tasks surviving runner replacement, automatic worktree registration, preview tunnels and a full workflow-session system are not implemented.
|
|
95
|
-
|
|
96
|
-
## Quick start
|
|
97
|
-
|
|
98
|
-
The Server and Runner are separate npm packages. Install them on the relay server
|
|
99
|
-
and the development machines you want to control:
|
|
100
|
-
|
|
101
|
-
| Component | npm package | Command |
|
|
102
|
-
| --- | --- | --- |
|
|
103
|
-
| Server / Web Dashboard | `homeagent-server` | `homeagent-server` |
|
|
104
|
-
| Runner | `homeagent-runner` | `homeagent` |
|
|
105
|
-
|
|
106
|
-
| Environment | Deployment |
|
|
107
|
-
| --- | --- |
|
|
108
|
-
| Linux server for continuous use | Docker Compose, your own domain and Caddy HTTPS |
|
|
109
|
-
| Existing Node.js installation or local evaluation | npm and `homeagent-server` |
|
|
110
|
-
| Existing Nginx / Caddy | Keep the Server on loopback and use your reverse proxy |
|
|
111
|
-
|
|
112
|
-
Follow this order: **start the Server → open the Dashboard → pair a Runner →
|
|
113
|
-
connect your AI client to `/mcp`**. The Server uses built-in SQLite and does not
|
|
114
|
-
need a separate database service.
|
|
115
|
-
|
|
116
|
-
### 1. Deploy the Server
|
|
117
|
-
|
|
118
|
-
**Option A: Docker Compose with Caddy for a public Linux server.**
|
|
119
|
-
|
|
120
|
-
Install Docker Engine, Compose v2 and Git. Point your domain at the server and
|
|
121
|
-
allow inbound TCP ports 80/443. Replace `mcp.example.com` below with your domain.
|
|
122
|
-
|
|
123
|
-
```sh
|
|
124
|
-
git clone --branch v0.4.15 --depth 1 https://github.com/jhxxr/HomeAgent.git
|
|
125
|
-
cd HomeAgent
|
|
126
|
-
|
|
127
|
-
# Generate random secrets without installing Node.js on the host.
|
|
128
|
-
docker run --rm --user "$(id -u):$(id -g)" \
|
|
129
|
-
-v "$PWD:/work" -w /work \
|
|
130
|
-
node:24.22.1-bookworm-slim node scripts/init.mjs
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Edit the generated `.env`. Keep its random `ADMIN_PASSWORD` and `SESSION_SECRET`;
|
|
134
|
-
change or add:
|
|
135
|
-
|
|
136
|
-
```dotenv
|
|
137
|
-
PUBLIC_URL=https://mcp.example.com
|
|
138
|
-
DOMAIN=mcp.example.com
|
|
139
|
-
TRUST_PROXY_HOPS=1
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
```sh
|
|
143
|
-
docker compose --profile proxy up -d --build
|
|
144
|
-
docker compose --profile proxy ps
|
|
145
|
-
docker compose logs --tail=100 server
|
|
146
|
-
curl --fail https://mcp.example.com/health
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Caddy obtains the certificate and proxies HTTP/WebSocket connections. Open
|
|
150
|
-
`https://mcp.example.com` and sign in with `ADMIN_PASSWORD` from `.env`. Port
|
|
151
|
-
`3210` is bound only to the host's loopback interface; it does not need public
|
|
152
|
-
access. Images build locally from source.
|
|
153
|
-
|
|
154
|
-
SQLite persists in the `server-data` named volume, and Compose configures
|
|
155
|
-
`restart: unless-stopped`. Back up the database and `.env` before upgrades,
|
|
156
|
-
retain `SESSION_SECRET`, and use ordinary restarts without deleting volumes.
|
|
157
|
-
See [deployment](docs/DEPLOYMENT.md) for backups, restore and an existing Nginx.
|
|
158
|
-
|
|
159
|
-
**Option B: npm on Linux / Windows or an existing Node.js server.**
|
|
160
|
-
|
|
161
|
-
Use Node.js 24 (minimum 24.14.0; `.nvmrc` contains the checked patch version)
|
|
162
|
-
and npm. These commands work in a Linux shell or Windows PowerShell:
|
|
163
|
-
|
|
164
|
-
```sh
|
|
165
|
-
npm install -g homeagent-server@latest
|
|
166
|
-
mkdir homeagent-server
|
|
167
|
-
cd homeagent-server
|
|
168
|
-
homeagent-server init
|
|
169
|
-
homeagent-server
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Open `http://localhost:3210`. The generated `.env` contains `ADMIN_PASSWORD`;
|
|
173
|
-
initialization does not print the password or overwrite an existing file.
|
|
174
|
-
The database defaults to `data/server.sqlite` in this directory.
|
|
175
|
-
|
|
176
|
-
For public access, set `PUBLIC_URL` in `.env` to your fixed HTTPS origin. Set
|
|
177
|
-
`TRUST_PROXY_HOPS=1` for one trusted proxy and proxy Nginx/Caddy to
|
|
178
|
-
`127.0.0.1:3210`. The command runs in the foreground and reads `.env` from its
|
|
179
|
-
**current working directory**. Use a service manager for continuous operation;
|
|
180
|
-
a Linux user systemd example is in [native Server deployment](docs/DEPLOYMENT.md#原生部署-server).
|
|
181
|
-
|
|
182
|
-
### 2. Install and pair a Runner
|
|
183
|
-
|
|
184
|
-
Install Node.js 24 and npm on the development machine. Git operations also need
|
|
185
|
-
a local Git installation. Everyday use has a single entry point:
|
|
186
|
-
|
|
187
|
-
```sh
|
|
188
|
-
npm install -g homeagent-runner@latest
|
|
189
|
-
homeagent
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
Even before login, the full-screen welcome page explains that the device is not
|
|
193
|
-
signed in. Press Enter to provide the Web URL and device name and create the
|
|
194
|
-
private `$HOME/.homeagent/runner.json`. Press `o` on the approval screen to open
|
|
195
|
-
the browser; the link is valid for 10 minutes. Confirm the device name and project
|
|
196
|
-
directory in your signed-in browser. After approval, the Runner connects
|
|
197
|
-
automatically. You can also add projects later in the Dashboard.
|
|
198
|
-
|
|
199
|
-
**The Server stores project directories and permissions.** New local Runner
|
|
200
|
-
configurations contain no `projects/root`. The local `stateDir` holds device
|
|
201
|
-
credentials and job state. Until you configure a project, no project access is
|
|
202
|
-
available. The first project setting is permanent by default; temporary access
|
|
203
|
-
remains available in the permission editor.
|
|
204
|
-
|
|
205
|
-
```sh
|
|
206
|
-
# Use the same entry point next time; login is detected automatically:
|
|
207
|
-
homeagent
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
Successful login or startup remembers the configuration location, so
|
|
211
|
-
`homeagent` also works from another directory. Press `s` for settings: device name,
|
|
212
|
-
process limits, output and history limits, login or Server switching,
|
|
213
|
-
configuration selection, autostart and logout. Changes that replace credentials
|
|
214
|
-
or require reconnection ask for confirmation. Press `a` for activity, `o` for the
|
|
215
|
-
Dashboard, `p` to pause or reconnect, Esc to go back, and `q` or Ctrl+C to quit.
|
|
216
|
-
|
|
217
|
-
Terminals supporting SGR mouse reports can click the login entry, footer buttons
|
|
218
|
-
and menu choices, scroll long menus and activity with the wheel, and position the
|
|
219
|
-
input cursor by clicking. Press `m` outside text fields, or click the mouse toggle,
|
|
220
|
-
to disable tracking for normal terminal selection and copying. Set
|
|
221
|
-
`HOMEAGENT_MOUSE=0` to start with tracking disabled. Pasted text cannot trigger
|
|
222
|
-
shortcuts or submit a form. Keyboard navigation remains available.
|
|
223
|
-
|
|
224
|
-
Clickable controls receive a shaded background on hover and a stronger blue
|
|
225
|
-
background while pressed. Moving away restores their normal appearance;
|
|
226
|
-
monochrome terminals use inverse text instead.
|
|
227
|
-
|
|
228
|
-
Use `homeagent --config <path>` to select another configuration. Lookup order:
|
|
229
|
-
explicit path, saved location, `~/.homeagent/runner.json`. A stale location stays
|
|
230
|
-
in the full-screen app until you select a configuration explicitly.
|
|
231
|
-
The `login`, `run`, `check-config`, `service-install` and `service-uninstall`
|
|
232
|
-
commands remain available for scripts and services.
|
|
233
|
-
|
|
234
|
-
In an interactive terminal, startup enters a full-screen Runner interface that
|
|
235
|
-
temporarily hides earlier shell commands and output. It shows the app mark,
|
|
236
|
-
device and Server details, recent activity and live connection state. The layout
|
|
237
|
-
adapts to terminal resizing, and stopping with `Ctrl+C` restores the previous
|
|
238
|
-
shell screen. Piped output, services and `homeagent run --plain` keep ordinary
|
|
239
|
-
logs for systemd, scheduled tasks and scripts.
|
|
240
|
-
|
|
241
|
-

|
|
242
|
-
|
|
243
|
-
*The v0.4.11 startup card, before the full-screen redesign: actual terminal output from an isolated demo environment, using a demo device and project directory.*
|
|
244
|
-
|
|
245
|
-
Enter Windows project paths such as `E:/Projects/my-app` in the Dashboard.
|
|
246
|
-
Keep configuration and state outside every exposed project. Local settings accept only connection and runtime options; project policies
|
|
247
|
-
come exclusively from the Server.
|
|
248
|
-
|
|
249
|
-
For automatic startup, select Enable autostart in settings. After confirmation,
|
|
250
|
-
the app closes the foreground connection before handing over to the background
|
|
251
|
-
Runner. Advanced users can still stop the foreground Runner and use
|
|
252
|
-
`homeagent service-install`.
|
|
253
|
-
Linux installs a user systemd service; Windows installs a current-user login
|
|
254
|
-
task. The installer discovers the configuration and pins the service to that
|
|
255
|
-
path. This command manages the Runner only.
|
|
256
|
-
|
|
257
|
-
Command execution and Git writes are disabled by default. Enable them in the
|
|
258
|
-
Dashboard's device policy and grant the corresponding client scopes. Command aliases and environment profiles are configured in the Web editor.
|
|
259
|
-
Windows `.cmd` wrappers are not implicitly run through a shell. See the
|
|
260
|
-
[development workflow](docs/DEVELOPMENT_WORKFLOW.md) for executable aliases
|
|
261
|
-
and environment profiles.
|
|
262
|
-
|
|
263
|
-
The Dashboard manages device policies and existing PAT/OAuth grants. Device
|
|
264
|
-
policy controls the upper limit; client grants separately control devices,
|
|
265
|
-
projects, scopes, individual tools, device-wide file access and unrestricted
|
|
266
|
-
execution. Either layer can be temporary. Expiration stops managed jobs and
|
|
267
|
-
restores the permanent Server policy. Disconnecting revokes all project access
|
|
268
|
-
until the Server policy is synchronized again. Upgrade the Server and Runner to the same version.
|
|
269
|
-
|
|
270
|
-
### 3. Connect an AI client
|
|
271
|
-
|
|
272
|
-
| Purpose | Public deployment example |
|
|
273
|
-
| --- | --- |
|
|
274
|
-
| Dashboard | `https://mcp.example.com` |
|
|
275
|
-
| Client MCP endpoint | `https://mcp.example.com/mcp` |
|
|
276
|
-
| Runner `server` configuration | `https://mcp.example.com`, without `/mcp` |
|
|
277
|
-
| Health check | `https://mcp.example.com/health`, returns `version` and `runnerProtocol` |
|
|
278
|
-
|
|
279
|
-
Check versions with `homeagent-server --version` and `homeagent --version`; both
|
|
280
|
-
print the version, Node and platform, and `homeagent check-config` also lists the
|
|
281
|
-
Runner version. The Dashboard header, footer and Settings → 版本信息 show the
|
|
282
|
-
Server version plus each Runner's reported version and a match/upgrade hint. Keep
|
|
283
|
-
the Server and Runner on the same release when upgrading.
|
|
284
|
-
|
|
285
|
-
Use OAuth and approve the device/project permissions in your browser, or issue
|
|
286
|
-
a client token in the Dashboard with the intended `read / write / execute / git`
|
|
287
|
-
scopes and connect with Bearer authentication. Tokens are shown once; device
|
|
288
|
-
credentials are not client tokens.
|
|
289
|
-
|
|
290
|
-
For a local trial, use `http://localhost:3210`. Remote access requires a fixed
|
|
291
|
-
HTTPS origin, and the Server must be hosted at the origin root rather than a
|
|
292
|
-
URL subpath. See [client setup](docs/CLIENTS.md) for individual clients.
|
|
293
|
-
|
|
294
|
-
### Develop from source
|
|
295
|
-
|
|
296
|
-
Use a source checkout to change the code. npm or Compose handles ordinary
|
|
297
|
-
installation:
|
|
298
|
-
|
|
299
|
-
```sh
|
|
300
|
-
git clone https://github.com/jhxxr/HomeAgent.git
|
|
301
|
-
cd HomeAgent
|
|
302
|
-
npm ci
|
|
303
|
-
npm run build
|
|
304
|
-
npm run init
|
|
305
|
-
npm run server
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
The source Runner commands are
|
|
309
|
-
`npm run runner -- login` and `npm run runner -- run`, with the same
|
|
310
|
-
configuration and approval flow.
|
|
311
|
-
|
|
312
|
-
## Typical development workflow
|
|
313
|
-
|
|
314
|
-
1. `list_devices` and `get_project_context`.
|
|
315
|
-
2. `search_files` and `read_files` for relevant code and full-file hashes.
|
|
316
|
-
3. `edit_files` or `apply_unified_diff` with explicit expected hashes.
|
|
317
|
-
4. `run_command`, then `wait_process` for long executions.
|
|
318
|
-
5. `git_diff`, `git_branches` and `git_commit_paths`.
|
|
319
|
-
6. `save_project_note` for a bounded handoff to the same client identity.
|
|
320
|
-
|
|
321
|
-
For a temporary maintenance task, open the device in the Dashboard, select the
|
|
322
|
-
needed project and capability preset, then edit the existing client
|
|
323
|
-
authorization if it also needs device-wide files or unrestricted execution.
|
|
324
|
-
Revoke the temporary grant early when finished; otherwise its expiry performs
|
|
325
|
-
the same cleanup.
|
|
326
|
-
|
|
327
|
-
Multiple online devices require an explicit `deviceId`. Machine tools also
|
|
328
|
-
require `projectId`. A job UUID is an identifier, not permission to access it.
|
|
329
|
-
|
|
330
|
-
## Documentation
|
|
331
|
-
|
|
332
|
-
Detailed operational documents are currently in Chinese; the examples use the
|
|
333
|
-
same command and configuration names on all platforms.
|
|
334
|
-
|
|
335
|
-
| Document | Purpose |
|
|
336
|
-
| --- | --- |
|
|
337
|
-
| [Documentation index](docs/README.md) | All guides |
|
|
338
|
-
| [Deployment](docs/DEPLOYMENT.md) | Docker, proxies, pairing, services and backups |
|
|
339
|
-
| [Client setup](docs/CLIENTS.md) | ChatGPT, Claude, Cursor and SDK clients |
|
|
340
|
-
| [Development workflow](docs/DEVELOPMENT_WORKFLOW.md) | Tools, profiles, recovery and known limits |
|
|
341
|
-
| [Tool reference](docs/TOOLS.md) | Arguments, scopes and admin endpoints |
|
|
342
|
-
| [Architecture](docs/ARCHITECTURE.md) | Protocol and persistence |
|
|
343
|
-
| [Security](SECURITY.md) | Trust boundaries and reporting |
|
|
344
|
-
| [Validation](docs/VALIDATION.md) | Tests performed and unverified environments |
|
|
345
|
-
| [Source audit](docs/WEBCODEX_CODE_AUDIT.md) | Explicit differences from WebCodex |
|
|
346
|
-
|
|
347
|
-
## Development
|
|
348
|
-
|
|
349
|
-
```sh
|
|
350
|
-
npm ci
|
|
351
|
-
npm run verify
|
|
352
|
-
npm run notices:check
|
|
353
|
-
npm audit --omit=dev --audit-level=high
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
Tests use temporary directories and local HTTP/WebSocket servers. Python is
|
|
357
|
-
optional; its workflow test reports a skip if no interpreter is available.
|
|
358
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for environment details.
|
|
359
|
-
|
|
360
|
-
## Security and license
|
|
361
|
-
|
|
362
|
-
An allowed interpreter, shell or build tool runs with the runner account's
|
|
363
|
-
permissions. File-root checks constrain built-in file tools; they do not sandbox
|
|
364
|
-
arbitrary code. Use a dedicated low-privilege account or container/VM.
|
|
365
|
-
|
|
366
|
-
Original source is available under the [MIT License](LICENSE). Dependencies retain
|
|
367
|
-
their own terms in [third-party notices](THIRD_PARTY_NOTICES.md). The release
|
|
368
|
-
produces two public npm packages: `homeagent-server` contains the Server and
|
|
369
|
-
Dashboard, while `homeagent-runner` contains the Runner, shared protocol and Windows
|
|
370
|
-
helpers. Each package has an explicit file list and license notices.
|
|
371
|
-
|
|
372
|
-
See [release preparation](docs/OPEN_SOURCE.md) to generate a reviewed source
|
|
373
|
-
archive. Nothing in the release commands automatically publishes or pushes it.
|
|
374
|
-
|
|
375
|
-
The `v0.4.15` release configuration produces separate `homeagent-server` and
|
|
376
|
-
`homeagent-runner` packages; local release commands do not upload to npm or push a
|
|
377
|
-
GitHub Release. For subsequent releases, increment the version and update the
|
|
378
|
-
version files and changelog before pushing a matching `vX.Y.Z` tag. Configure
|
|
379
|
-
the repository's `NPM_TOKEN` Actions secret for token publishing. Prereleases use
|
|
380
|
-
the npm `next` tag; stable versions use `latest`. Existing npm versions must match
|
|
381
|
-
the verified tarball integrity to resume a failed GitHub Release. See the release
|
|
382
|
-
guide for required token permissions and migration to OIDC trusted publishing
|
|
383
|
-
with the `NPM_AUTH_MODE=oidc` repository variable.
|