homeagent-runner 0.0.0-stage → 0.4.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/CONTRIBUTING.md +65 -0
  3. package/LICENSE +21 -0
  4. package/README.en.md +329 -0
  5. package/README.md +271 -2
  6. package/SECURITY.md +59 -0
  7. package/THIRD_PARTY_NOTICES.md +45 -0
  8. package/bin/runner.mjs +2 -0
  9. package/dist/runner/agent.js +254 -0
  10. package/dist/runner/cli.js +66 -0
  11. package/dist/runner/config-location.js +67 -0
  12. package/dist/runner/config.js +43 -0
  13. package/dist/runner/context.js +86 -0
  14. package/dist/runner/credentials.js +68 -0
  15. package/dist/runner/editor.js +262 -0
  16. package/dist/runner/files.js +298 -0
  17. package/dist/runner/git.js +333 -0
  18. package/dist/runner/lock.js +28 -0
  19. package/dist/runner/output-log.js +59 -0
  20. package/dist/runner/patch.js +103 -0
  21. package/dist/runner/permissions.js +93 -0
  22. package/dist/runner/policy.js +87 -0
  23. package/dist/runner/process-tree.js +28 -0
  24. package/dist/runner/processes.js +367 -0
  25. package/dist/runner/service.js +53 -0
  26. package/dist/runner/setup.js +79 -0
  27. package/dist/runner/tools.js +118 -0
  28. package/dist/shared/permissions.js +40 -0
  29. package/dist/shared/protocol.js +98 -0
  30. package/dist/shared/tools.js +108 -0
  31. package/docs/ARCHITECTURE.md +92 -0
  32. package/docs/CLIENTS.md +130 -0
  33. package/docs/COMPARISON.md +36 -0
  34. package/docs/DEPLOYMENT.md +295 -0
  35. package/docs/DEVELOPMENT_WORKFLOW.md +126 -0
  36. package/docs/OPEN_SOURCE.md +129 -0
  37. package/docs/README.md +26 -0
  38. package/docs/TOOLS.md +105 -0
  39. package/docs/VALIDATION.md +172 -0
  40. package/docs/WEBCODEX_CODE_AUDIT.md +107 -0
  41. package/docs/screenshots/dashboard.png +0 -0
  42. package/docs/screenshots/jobs.png +0 -0
  43. package/docs/screenshots/permissions.png +0 -0
  44. package/docs/webcodex-parity-map.json +75 -0
  45. package/docs/webcodex-source-inventory.json +2254 -0
  46. package/licenses/npm-runtime.txt +3673 -0
  47. package/package.json +45 -4
  48. package/public/icon.png +0 -0
  49. package/runtime/windows-process-tree.cs +105 -0
  50. package/runtime/windows-process-tree.ps1 +19 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,137 @@
1
+ # Changelog
2
+
3
+ ## 0.4.5 — Project identity, documentation and OAuth UI
4
+
5
+ - Introduce the blue terminal and orange agent icon across the Dashboard header,
6
+ browser favicon, touch icon and project documentation.
7
+ - Refresh the Chinese and English READMEs with a centered project identity,
8
+ package and CI badges, feature overview, architecture diagram and real
9
+ Dashboard, permission-editor and task-output screenshots.
10
+ - Refresh OAuth authorization and result screens with grouped permissions,
11
+ clearer project selection and a live authorization summary.
12
+ - Remove a stray CSS separator so the consent-page header style applies.
13
+ - Include README image assets in both npm packages, and explicitly allow only
14
+ reviewed PNG assets in source release checks with format and size limits.
15
+
16
+ ## 0.4.4 — Runner package publishing and dependency updates
17
+
18
+ - Publish the Runner as `homeagent-runner`, retaining the `homeagent` command.
19
+ The npm package named `homeagent` belongs to another maintainer; install
20
+ `homeagent-runner` to use this project's Runner.
21
+ - Update release validation, package installation checks and installation
22
+ documentation for the available Runner package name.
23
+ - Upgrade Docker images to Node.js 26.12.1 and development dependencies to
24
+ TypeScript 7.0.2 and Node.js 26 type definitions.
25
+ - Update the pinned GitHub Actions used for checkout, Node.js and Python setup,
26
+ and release artifact upload and download.
27
+
28
+ ## 0.4.3 — Split Server and Runner npm packages
29
+
30
+ - Publish the Web Dashboard and relay as `homeagent-server`.
31
+ - Publish the outbound Runner as the simplified `homeagent` package and
32
+ command.
33
+ - Update npm packaging, release verification, Docker packaging and deployment
34
+ documentation for the two-package distribution.
35
+
36
+ ## 0.4.2 — Server-owned Runner configuration and Web permission UX
37
+
38
+ - Add `homeagent run` and automatic configuration discovery, remembering custom
39
+ locations after successful login or startup.
40
+ - Store project paths for new devices on the Server, with an optional initial
41
+ project in browser approval and no project paths in the generated local config.
42
+ - Allow a Runner to connect with no local projects; keep project access disabled
43
+ until a Web policy applies and report effective directories in the terminal.
44
+ - Remove local project policies, root environment overrides, current-directory
45
+ configuration fallback, the template initializer and manual pairing command.
46
+ - Require Runner protocol 2 with a Server policy on every connection. Disconnects
47
+ and policy failures revoke all project access; no local baseline is restored.
48
+ - Manage command aliases and environment profiles in the Web permission editor,
49
+ and recover interrupted edits only after Server projects are authorized.
50
+
51
+ ## 0.4.1 — Interactive Runner login and Dashboard refresh
52
+
53
+ ### Runner login and Dashboard
54
+
55
+ - Add interactive Runner login with automatic private configuration creation,
56
+ short-lived browser approval links and a fallback one-time pairing code.
57
+ - Refresh the Dashboard with a responsive monochrome layout, section navigation,
58
+ clearer status cards and more consistent controls.
59
+
60
+ ## 0.4.0 — Web-managed device and client permissions
61
+
62
+ ### Permissions and control plane
63
+
64
+ - Add Dashboard editors for device capability limits and existing PAT/OAuth
65
+ authorization grants; credentials do not need to be copied again.
66
+ - Add device-wide file access and unrestricted executable modes as separate
67
+ explicit grants. The Runner still protects its configuration and private
68
+ state from built-in file tools.
69
+ - Add temporary device and client permissions with expiry, revision checks,
70
+ automatic task cancellation and restoration of the previous policy.
71
+ - Add per-tool authorization filtering and live `tools/list` updates.
72
+ - Reject stale or incompatible Runner connections when a stored remote device
73
+ policy cannot be safely applied; provide a local-policy recovery path.
74
+ - Persist permission changes, expiry and application failures in the existing
75
+ audit and Dashboard state.
76
+
77
+ ### Git and packaging
78
+
79
+ - Add controlled `git_fetch`, fast-forward-only `git_pull` and separately
80
+ enabled `git_push` for configured HTTPS/SSH remotes, including nested
81
+ repositories.
82
+ - Add permission protocol negotiation, Runner acknowledgements and safe
83
+ cancellation of in-flight calls and managed jobs during policy changes.
84
+ - Expand npm packaging and installation checks for the permission Dashboard
85
+ asset.
86
+
87
+ ## 0.3.1 — OAuth consent callback fix
88
+
89
+ - Fix browser authorization appearing unresponsive when the form's redirect to
90
+ an external client callback is blocked by `form-action 'self'`.
91
+ - Complete the form navigation on the Server, then return to the registered
92
+ callback through a same-origin completion page with a manual link fallback.
93
+ - Show submission progress and prevent double clicks while preserving the
94
+ submitted allow/deny decision.
95
+ - Make identical consent retries return the same completion receipt for the
96
+ same browser session, without issuing additional authorization codes.
97
+ Callback URLs are encrypted at rest; codes remain short-lived and single-use.
98
+ - Preserve selections on validation errors, display actionable expiration
99
+ messages and recheck client revocation before granting access.
100
+ - Expand Chinese/English deployment instructions for npm, Compose, HTTPS,
101
+ Runner pairing and native Server service management.
102
+
103
+ ## 0.3.0 — Initial public release
104
+
105
+ ### Remote MCP
106
+
107
+ - Self-hosted relay with authenticated outbound WebSocket runners.
108
+ - Official MCP SDK serving both 2026-07-28 and legacy 2025 HTTP clients.
109
+ - Single-admin Dashboard, device pairing/revocation, OAuth with PKCE and scoped
110
+ personal tokens.
111
+ - Project authorization, local policy, bounded outputs and tool audit records.
112
+
113
+ ### Development workflow
114
+
115
+ - 32 MCP tools for project context, file/search/edit, commands, jobs and Git.
116
+ - Line-based batch reads, strict unified diffs and journaled multi-file edits.
117
+ - Local command aliases/environment profiles and short-command responses.
118
+ - Waitable jobs, idempotent starts, bounded prefix and rolling-tail logs.
119
+ - Selected-file commits that preserve unrelated staged entries; explicit linked
120
+ worktree configuration.
121
+ - Project handoff notes and Runner job reconciliation.
122
+
123
+ ### Deployment and validation
124
+
125
+ - Docker Compose, Caddy/Nginx examples and optional Cloudflare Tunnel.
126
+ - Linux user service and Windows login-task installers.
127
+ - Linux/Windows integration tests and reproducible Node/Python coding scenarios.
128
+ - Public npm packaging with `homeagent`, `homeagent-runner` and
129
+ `homeagent-server` commands, safe configuration initialization and isolated
130
+ installation checks.
131
+ - Version-tag automation for verified npm tarballs and GitHub Release assets,
132
+ token-based npm authentication and optional OIDC trusted publishing.
133
+
134
+ This is an early self-hosted release. PTY/persistent shells, a detached supervisor,
135
+ automatic worktree registration, preview tunnels and a complete workflow-session
136
+ subsystem are not implemented. See [the workflow limits](docs/DEVELOPMENT_WORKFLOW.md)
137
+ and [validation record](docs/VALIDATION.md).
@@ -0,0 +1,65 @@
1
+ # Contributing
2
+
3
+ Thanks for helping improve HomeAgent. Development currently targets a single
4
+ operator, self-hosted relay and Linux/Windows runners.
5
+
6
+ ## Local setup
7
+
8
+ Use Node.js 24 LTS (minimum 24.14; the checked version is in `.nvmrc`), npm and Git.
9
+ Python is optional for development, but required to run the Python workflow test.
10
+
11
+ ```sh
12
+ npm ci
13
+ npm run verify
14
+ npm audit --omit=dev --audit-level=high
15
+ ```
16
+
17
+ Tests start local servers and child processes in temporary directories. They do
18
+ not require a model API key, external MCP account or cloud VM. If Python is not on
19
+ PATH, set `HOMEAGENT_TEST_PYTHON` to the interpreter executable. The Windows Job
20
+ Object test is skipped on other platforms; Python tests clearly report a skip
21
+ when no interpreter is installed.
22
+
23
+ To run the relay locally:
24
+
25
+ ```sh
26
+ npm run init
27
+ npm run dev:server
28
+ ```
29
+
30
+ Create Runner configuration outside every shared project root; see
31
+ [deployment](docs/DEPLOYMENT.md). Do not expose this repository's working directory
32
+ while keeping private Runner configuration inside it.
33
+
34
+ ## Scope and changes
35
+
36
+ - Open an issue with a minimal reproduction for bugs. Include platform, Node
37
+ version and sanitized diagnostics.
38
+ - Keep changes focused. Update documentation when configuration or tool behavior
39
+ changes.
40
+ - New tools need input validation, a scope classification, Runner-side policy,
41
+ bounded results and meaningful integration/security coverage.
42
+ - Preserve existing user changes, staged files and credential boundaries. A
43
+ command allowlist is not an operating-system sandbox.
44
+ - Use the existing TypeScript/ES modules style and `npm run verify` before
45
+ submitting a pull request.
46
+ - Regenerate dependency notices after production dependency updates. Preserve
47
+ third-party attribution if incorporating third-party code.
48
+
49
+ Original contributions are submitted under this repository's MIT License. Do not
50
+ submit code or data you do not have permission to share.
51
+
52
+ ## Security reports
53
+
54
+ Follow [SECURITY.md](SECURITY.md). Use the hosting repository's private security
55
+ reporting facility when enabled; do not put credentials or an exploitable private
56
+ deployment in a public issue.
57
+
58
+ ## Releases
59
+
60
+ [Release preparation](docs/OPEN_SOURCE.md) describes the local checks and clean
61
+ source archive command. Run `npm run release:npm` and `npm run test:package` to
62
+ build the npm tarball and verify an isolated global installation without
63
+ publishing. Never put npm credentials in source files. The version-tag workflow
64
+ publishes the verified tarball using the `NPM_TOKEN` repository secret, or OIDC
65
+ when configured, only after all checks pass.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HomeAgent contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,329 @@
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&amp;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&amp;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.5** supports one administrator and multiple devices.
37
+
38
+ ## Why HomeAgent
39
+
40
+ | Your machines, your control | Built for everyday development |
41
+ | --- | --- |
42
+ | **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. |
43
+ | **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. |
44
+ | **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. |
45
+
46
+ ## Screenshots
47
+
48
+ Real Web Dashboard screenshots with example devices and projects in an isolated local environment. The current interface is in Chinese.
49
+
50
+ ![HomeAgent Dashboard: device status, MCP connection and project management](docs/screenshots/dashboard.png)
51
+
52
+ <details>
53
+ <summary><strong>Explore device permissions and task output</strong></summary>
54
+
55
+ **Device permissions** · Configure project paths, access levels, Git permissions and grant duration in the browser.
56
+
57
+ ![Device settings: project directory, development access and Git permissions](docs/screenshots/permissions.png)
58
+
59
+ **Jobs and output** · Observe commands running on a real Runner and read their test output.
60
+
61
+ ![Job management: execution records and test output](docs/screenshots/jobs.png)
62
+
63
+ </details>
64
+
65
+ ## How it works
66
+
67
+ ```mermaid
68
+ flowchart TB
69
+ Clients["Claude / ChatGPT / Cursor"] -->|"HTTPS · MCP · OAuth / Token"| Server["HomeAgent Server"]
70
+ Server --- Console["Web Dashboard · SQLite · Audit"]
71
+ Runner["Linux / Windows Runner"] -->|"Outbound · WSS"| Server
72
+ Runner --- Files["Project files and code edits"]
73
+ Runner --- Commands["Local commands and jobs"]
74
+ Runner --- Git["Git workflows"]
75
+ ```
76
+
77
+ 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.
78
+
79
+ 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.
80
+
81
+ ## Quick start
82
+
83
+ The Server and Runner are separate npm packages. Install them on the relay server
84
+ and the development machines you want to control:
85
+
86
+ | Component | npm package | Command |
87
+ | --- | --- | --- |
88
+ | Server / Web Dashboard | `homeagent-server` | `homeagent-server` |
89
+ | Runner | `homeagent-runner` | `homeagent` |
90
+
91
+ | Environment | Deployment |
92
+ | --- | --- |
93
+ | Linux server for continuous use | Docker Compose, your own domain and Caddy HTTPS |
94
+ | Existing Node.js installation or local evaluation | npm and `homeagent-server` |
95
+ | Existing Nginx / Caddy | Keep the Server on loopback and use your reverse proxy |
96
+
97
+ Follow this order: **start the Server → open the Dashboard → pair a Runner →
98
+ connect your AI client to `/mcp`**. The Server uses built-in SQLite and does not
99
+ need a separate database service.
100
+
101
+ ### 1. Deploy the Server
102
+
103
+ **Option A: Docker Compose with Caddy for a public Linux server.**
104
+
105
+ Install Docker Engine, Compose v2 and Git. Point your domain at the server and
106
+ allow inbound TCP ports 80/443. Replace `mcp.example.com` below with your domain.
107
+
108
+ ```sh
109
+ git clone --branch v0.4.5 --depth 1 https://github.com/jhxxr/HomeAgent.git
110
+ cd HomeAgent
111
+
112
+ # Generate random secrets without installing Node.js on the host.
113
+ docker run --rm --user "$(id -u):$(id -g)" \
114
+ -v "$PWD:/work" -w /work \
115
+ node:24.22.1-bookworm-slim node scripts/init.mjs
116
+ ```
117
+
118
+ Edit the generated `.env`. Keep its random `ADMIN_PASSWORD` and `SESSION_SECRET`;
119
+ change or add:
120
+
121
+ ```dotenv
122
+ PUBLIC_URL=https://mcp.example.com
123
+ DOMAIN=mcp.example.com
124
+ TRUST_PROXY_HOPS=1
125
+ ```
126
+
127
+ ```sh
128
+ docker compose --profile proxy up -d --build
129
+ docker compose --profile proxy ps
130
+ docker compose logs --tail=100 server
131
+ curl --fail https://mcp.example.com/health
132
+ ```
133
+
134
+ Caddy obtains the certificate and proxies HTTP/WebSocket connections. Open
135
+ `https://mcp.example.com` and sign in with `ADMIN_PASSWORD` from `.env`. Port
136
+ `3210` is bound only to the host's loopback interface; it does not need public
137
+ access. Images build locally from source.
138
+
139
+ SQLite persists in the `server-data` named volume, and Compose configures
140
+ `restart: unless-stopped`. Back up the database and `.env` before upgrades,
141
+ retain `SESSION_SECRET`, and use ordinary restarts without deleting volumes.
142
+ See [deployment](docs/DEPLOYMENT.md) for backups, restore and an existing Nginx.
143
+
144
+ **Option B: npm on Linux / Windows or an existing Node.js server.**
145
+
146
+ Use Node.js 24 (minimum 24.14.0; `.nvmrc` contains the checked patch version)
147
+ and npm. These commands work in a Linux shell or Windows PowerShell:
148
+
149
+ ```sh
150
+ npm install -g homeagent-server@latest
151
+ mkdir homeagent-server
152
+ cd homeagent-server
153
+ homeagent-server init
154
+ homeagent-server
155
+ ```
156
+
157
+ Open `http://localhost:3210`. The generated `.env` contains `ADMIN_PASSWORD`;
158
+ initialization does not print the password or overwrite an existing file.
159
+ The database defaults to `data/server.sqlite` in this directory.
160
+
161
+ For public access, set `PUBLIC_URL` in `.env` to your fixed HTTPS origin. Set
162
+ `TRUST_PROXY_HOPS=1` for one trusted proxy and proxy Nginx/Caddy to
163
+ `127.0.0.1:3210`. The command runs in the foreground and reads `.env` from its
164
+ **current working directory**. Use a service manager for continuous operation;
165
+ a Linux user systemd example is in [native Server deployment](docs/DEPLOYMENT.md#原生部署-server).
166
+
167
+ ### 2. Install and pair a Runner
168
+
169
+ Install Node.js 24 and npm on the development machine. Git operations also need
170
+ a local Git installation. The recommended flow is the interactive login:
171
+
172
+ ```sh
173
+ npm install -g homeagent-runner@latest
174
+ homeagent login
175
+ ```
176
+
177
+ The terminal asks only for the Web URL and device name, creates the private
178
+ `$HOME/.homeagent/runner.json`, and prints a browser approval link valid for
179
+ 10 minutes. In your signed-in browser, confirm the device name, enter its project
180
+ directory and approve it. You can also add projects later in the Dashboard.
181
+
182
+ **The Server stores project directories and permissions.** New local Runner
183
+ configurations contain no `projects/root`. The local `stateDir` holds device
184
+ credentials and job state. Until you configure a project, no project access is
185
+ available. The first project setting is permanent by default; temporary access
186
+ remains available in the permission editor.
187
+
188
+ ```sh
189
+ # Start the Runner after login:
190
+ homeagent run
191
+ ```
192
+
193
+ Successful login or startup remembers the configuration location, so
194
+ `homeagent run` also works from another directory. Use `--config <path>` to select
195
+ another configuration. Lookup order: explicit path, saved location,
196
+ `~/.homeagent/runner.json`.
197
+ For first-time setup and immediate startup, use `homeagent login --run`.
198
+
199
+ Enter Windows project paths such as `E:/Projects/my-app` in the Dashboard.
200
+ Keep configuration and state outside every exposed project. Local settings accept only connection and runtime options; project policies
201
+ come exclusively from the Server.
202
+
203
+ For automatic startup, finish pairing and stop the foreground Runner, then run
204
+ `homeagent service-install`.
205
+ Linux installs a user systemd service; Windows installs a current-user login
206
+ task. The installer discovers the configuration and pins the service to that
207
+ path. This command manages the Runner only.
208
+
209
+ Command execution and Git writes are disabled by default. Enable them in the
210
+ Dashboard's device policy and grant the corresponding client scopes. Command aliases and environment profiles are configured in the Web editor.
211
+ Windows `.cmd` wrappers are not implicitly run through a shell. See the
212
+ [development workflow](docs/DEVELOPMENT_WORKFLOW.md) for executable aliases
213
+ and environment profiles.
214
+
215
+ The Dashboard manages device policies and existing PAT/OAuth grants. Device
216
+ policy controls the upper limit; client grants separately control devices,
217
+ projects, scopes, individual tools, device-wide file access and unrestricted
218
+ execution. Either layer can be temporary. Expiration stops managed jobs and
219
+ restores the permanent Server policy. Disconnecting revokes all project access
220
+ until the Server policy is synchronized again. Upgrade the Server and Runner to the same version.
221
+
222
+ ### 3. Connect an AI client
223
+
224
+ | Purpose | Public deployment example |
225
+ | --- | --- |
226
+ | Dashboard | `https://mcp.example.com` |
227
+ | Client MCP endpoint | `https://mcp.example.com/mcp` |
228
+ | Runner `server` configuration | `https://mcp.example.com`, without `/mcp` |
229
+ | Health check | `https://mcp.example.com/health` |
230
+
231
+ Use OAuth and approve the device/project permissions in your browser, or issue
232
+ a client token in the Dashboard with the intended `read / write / execute / git`
233
+ scopes and connect with Bearer authentication. Tokens are shown once; device
234
+ credentials are not client tokens.
235
+
236
+ For a local trial, use `http://localhost:3210`. Remote access requires a fixed
237
+ HTTPS origin, and the Server must be hosted at the origin root rather than a
238
+ URL subpath. See [client setup](docs/CLIENTS.md) for individual clients.
239
+
240
+ ### Develop from source
241
+
242
+ Use a source checkout to change the code. npm or Compose handles ordinary
243
+ installation:
244
+
245
+ ```sh
246
+ git clone https://github.com/jhxxr/HomeAgent.git
247
+ cd HomeAgent
248
+ npm ci
249
+ npm run build
250
+ npm run init
251
+ npm run server
252
+ ```
253
+
254
+ The source Runner commands are
255
+ `npm run runner -- login` and `npm run runner -- run`, with the same
256
+ configuration and approval flow.
257
+
258
+ ## Typical development workflow
259
+
260
+ 1. `list_devices` and `get_project_context`.
261
+ 2. `search_files` and `read_files` for relevant code and full-file hashes.
262
+ 3. `edit_files` or `apply_unified_diff` with explicit expected hashes.
263
+ 4. `run_command`, then `wait_process` for long executions.
264
+ 5. `git_diff`, `git_branches` and `git_commit_paths`.
265
+ 6. `save_project_note` for a bounded handoff to the same client identity.
266
+
267
+ For a temporary maintenance task, open the device in the Dashboard, select the
268
+ needed project and capability preset, then edit the existing client
269
+ authorization if it also needs device-wide files or unrestricted execution.
270
+ Revoke the temporary grant early when finished; otherwise its expiry performs
271
+ the same cleanup.
272
+
273
+ Multiple online devices require an explicit `deviceId`. Machine tools also
274
+ require `projectId`. A job UUID is an identifier, not permission to access it.
275
+
276
+ ## Documentation
277
+
278
+ Detailed operational documents are currently in Chinese; the examples use the
279
+ same command and configuration names on all platforms.
280
+
281
+ | Document | Purpose |
282
+ | --- | --- |
283
+ | [Documentation index](docs/README.md) | All guides |
284
+ | [Deployment](docs/DEPLOYMENT.md) | Docker, proxies, pairing, services and backups |
285
+ | [Client setup](docs/CLIENTS.md) | ChatGPT, Claude, Cursor and SDK clients |
286
+ | [Development workflow](docs/DEVELOPMENT_WORKFLOW.md) | Tools, profiles, recovery and known limits |
287
+ | [Tool reference](docs/TOOLS.md) | Arguments, scopes and admin endpoints |
288
+ | [Architecture](docs/ARCHITECTURE.md) | Protocol and persistence |
289
+ | [Security](SECURITY.md) | Trust boundaries and reporting |
290
+ | [Validation](docs/VALIDATION.md) | Tests performed and unverified environments |
291
+ | [Source audit](docs/WEBCODEX_CODE_AUDIT.md) | Explicit differences from WebCodex |
292
+
293
+ ## Development
294
+
295
+ ```sh
296
+ npm ci
297
+ npm run verify
298
+ npm run notices:check
299
+ npm audit --omit=dev --audit-level=high
300
+ ```
301
+
302
+ Tests use temporary directories and local HTTP/WebSocket servers. Python is
303
+ optional; its workflow test reports a skip if no interpreter is available.
304
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for environment details.
305
+
306
+ ## Security and license
307
+
308
+ An allowed interpreter, shell or build tool runs with the runner account's
309
+ permissions. File-root checks constrain built-in file tools; they do not sandbox
310
+ arbitrary code. Use a dedicated low-privilege account or container/VM.
311
+
312
+ Original source is available under the [MIT License](LICENSE). Dependencies retain
313
+ their own terms in [third-party notices](THIRD_PARTY_NOTICES.md). The release
314
+ produces two public npm packages: `homeagent-server` contains the Server and
315
+ Dashboard, while `homeagent-runner` contains the Runner, shared protocol and Windows
316
+ helpers. Each package has an explicit file list and license notices.
317
+
318
+ See [release preparation](docs/OPEN_SOURCE.md) to generate a reviewed source
319
+ archive. Nothing in the release commands automatically publishes or pushes it.
320
+
321
+ The `v0.4.5` release configuration produces separate `homeagent-server` and
322
+ `homeagent-runner` packages; local release commands do not upload to npm or push a
323
+ GitHub Release. For subsequent releases, increment the version and update the
324
+ version files and changelog before pushing a matching `vX.Y.Z` tag. Configure
325
+ the repository's `NPM_TOKEN` Actions secret for token publishing. Prereleases use
326
+ the npm `next` tag; stable versions use `latest`. Existing npm versions must match
327
+ the verified tarball integrity to resume a failed GitHub Release. See the release
328
+ guide for required token permissions and migration to OIDC trusted publishing
329
+ with the `NPM_AUTH_MODE=oidc` repository variable.