hilos-agent 0.11.2 → 0.11.3
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/README.md +83 -60
- package/bin/hilos-agent.mjs +3 -3
- package/package.json +2 -2
- package/src/handler.mjs +2 -1
package/README.md
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# hilos-agent
|
|
2
2
|
|
|
3
|
-
Run **your own** coding agent — Claude Code, Codex, Cursor, opencode,
|
|
3
|
+
Run **your own** coding agent — Claude Code, Codex, Cursor, opencode,
|
|
4
|
+
Antigravity, Hermes, or any command — as
|
|
4
5
|
an autonomous teammate inside a [hilos](https://hilos.sh) channel.
|
|
5
6
|
|
|
6
7
|
It connects to hilos over MCP, watches for `@mentions` of your agent in a
|
|
7
8
|
git-linked channel (including thread replies) and for **every message in a DM
|
|
8
9
|
with your agent — no tag needed there**, runs your coding agent in a
|
|
9
|
-
**local** checkout, and — by default — **opens a PR for review**.
|
|
10
|
-
your git
|
|
10
|
+
**local** checkout, and — by default — **opens a PR for review**. The checkout
|
|
11
|
+
and your coding-provider/git credentials stay on your machine. Changes go to the
|
|
12
|
+
configured Git remote; hilos receives bounded plans, progress, reports, and—when
|
|
13
|
+
the pre-push gate is enabled—the proposal diff.
|
|
11
14
|
|
|
12
15
|
```
|
|
13
16
|
hilos channel ──MCP/HTTPS──▶ hilos-agent (your laptop)
|
|
@@ -19,13 +22,13 @@ hilos channel ──MCP/HTTPS──▶ hilos-agent (your laptop)
|
|
|
19
22
|
Changes ▶ agent re-works with your note
|
|
20
23
|
```
|
|
21
24
|
|
|
22
|
-
Prefer **approve-before-push**? Set `"gate": true` — the agent
|
|
23
|
-
proposed diff as a card
|
|
24
|
-
|
|
25
|
+
Prefer **approve-before-push**? Set `"gate": true` — the agent posts a bounded
|
|
26
|
+
proposed diff to hilos as a card, then pushes the change to the Git remote only
|
|
27
|
+
after you Approve.
|
|
25
28
|
|
|
26
29
|
## Quick start
|
|
27
30
|
|
|
28
|
-
In hilos: open your agent's profile → **Connect** → **Run in channel**. Copy the
|
|
31
|
+
In hilos: open your agent's profile → **Connect agent** → **Run in channel**. Copy the
|
|
29
32
|
terminal command and run it from inside your repo's folder. It waits at a hidden
|
|
30
33
|
prompt; copy the private join code from Hilos and paste it there. The daemon
|
|
31
34
|
matches the repo by its git remote, so no config is needed, and the reusable
|
|
@@ -39,30 +42,42 @@ npx hilos-agent@latest --join-stdin # then paste the private join code when ask
|
|
|
39
42
|
Previously copied `--join <blob>` commands remain compatible. New commands use
|
|
40
43
|
stdin because the blob contains the agent token and should not live in argv.
|
|
41
44
|
|
|
42
|
-
Running from elsewhere, or want to map several repos explicitly?
|
|
45
|
+
Running from elsewhere, or want to map several repos explicitly? Save this as
|
|
46
|
+
`~/.hilos/agent.json` (or `./hilos-agent.json`). The file is strict JSON, so it
|
|
47
|
+
cannot contain comments:
|
|
43
48
|
|
|
44
|
-
```
|
|
45
|
-
// ~/.hilos/agent.json (or ./hilos-agent.json)
|
|
49
|
+
```json
|
|
46
50
|
{
|
|
47
51
|
"url": "https://hilos.sh/api/mcp",
|
|
48
52
|
"token": "mgo_…",
|
|
49
53
|
"repos": { "your-org/your-repo": "/Users/you/code/your-repo" },
|
|
50
|
-
"codingCmd": "claude -p --permission-mode acceptEdits",
|
|
51
|
-
"codingModel": "",
|
|
52
|
-
"chatCmd": "",
|
|
53
|
-
"webSearch": true,
|
|
54
|
+
"codingCmd": "claude -p --permission-mode acceptEdits",
|
|
55
|
+
"codingModel": "",
|
|
56
|
+
"chatCmd": "",
|
|
57
|
+
"webSearch": true,
|
|
54
58
|
"defaultBranch": "main",
|
|
55
|
-
"gate": false,
|
|
56
|
-
"heartbeatMs": 180000,
|
|
57
|
-
"chatTimeoutMs": 90000,
|
|
58
|
-
"longPollMs": 20000,
|
|
59
|
-
"catchupMs": 86400000
|
|
59
|
+
"gate": false,
|
|
60
|
+
"heartbeatMs": 180000,
|
|
61
|
+
"chatTimeoutMs": 90000,
|
|
62
|
+
"longPollMs": 20000,
|
|
63
|
+
"catchupMs": 86400000
|
|
60
64
|
}
|
|
61
65
|
```
|
|
62
66
|
|
|
67
|
+
`codingCmd` above is the safe default; it can also be `codex exec`,
|
|
68
|
+
`cursor-agent -p --output-format text --trust`, `opencode run`, `agy -p`, or a
|
|
69
|
+
custom command. `codingModel` accepts the Codex tiers `most-capable`, `balanced`,
|
|
70
|
+
or `fastest`; empty uses the tool's default. Empty `chatCmd` derives a fast chat
|
|
71
|
+
command from `codingCmd`. `webSearch: false` disables hilos's web-search
|
|
72
|
+
enablement, and `gate: true` switches to approve-before-push. `heartbeatMs: 0`
|
|
73
|
+
disables the heartbeat (minimum nonzero value 15 seconds); `longPollMs: 0` uses
|
|
74
|
+
plain five-second polling; `catchupMs: 0` restarts at now instead of replaying
|
|
75
|
+
the default 24-hour window.
|
|
76
|
+
|
|
63
77
|
**Staying responsive.** Every code task posts an **instant acknowledgement**
|
|
64
|
-
(under a second), and — if your server exposes `edit_message` and a
|
|
65
|
-
|
|
78
|
+
(under a second), and — if your server exposes `edit_message` and a fast chat
|
|
79
|
+
command can be resolved (explicit `chatCmd` or one derived from `codingCmd`) —
|
|
80
|
+
a quick **plan** ("On it — I'll do X, then open a PR") edits into it. On a
|
|
66
81
|
run longer than `heartbeatMs` (default 3 min; env `HILOS_HEARTBEAT_MS`, `0`
|
|
67
82
|
disables, clamped to ≥15s) the agent posts **one progress reply** in the thread
|
|
68
83
|
then edits it in place with elapsed time + the CLI's latest line — so the channel
|
|
@@ -98,7 +113,7 @@ The local daemon can give its coding and chat agents a narrow bridge to
|
|
|
98
113
|
third-party WebMCP sites. It is off until you name exact origins and exact read
|
|
99
114
|
tools in the machine's config:
|
|
100
115
|
|
|
101
|
-
```
|
|
116
|
+
```json
|
|
102
117
|
{
|
|
103
118
|
"webMcp": {
|
|
104
119
|
"origins": {
|
|
@@ -152,8 +167,10 @@ access its operator granted. See the complete contract in
|
|
|
152
167
|
it", "approved", or "go for it" after a request, in any language → a code run.
|
|
153
168
|
- **Repo resolution** — the channel's linked repo is mapped to a local path via
|
|
154
169
|
`repos`. No mapping → the agent says so and stops.
|
|
155
|
-
- **Run** — it
|
|
156
|
-
`codingCmd` with the task,
|
|
170
|
+
- **Run** — it temporarily stashes a dirty checkout, branches off
|
|
171
|
+
`defaultBranch`, runs `codingCmd` with the task, stages the result, and attempts
|
|
172
|
+
to restore the person's pre-existing work on every exit path. If `stash pop`
|
|
173
|
+
conflicts, the stash stays intact and the room gets the recovery command.
|
|
157
174
|
- **Continue the thread's PR** — when the mention lands in a thread hilos says is
|
|
158
175
|
about a pull request, the daemon works on *that* PR instead of opening a second
|
|
159
176
|
one: it fetches the PR's head branch, commits there, and the same PR updates.
|
|
@@ -192,8 +209,7 @@ to a plain **local folder** and the agent works in it **directly** — it edits
|
|
|
192
209
|
files in place (no branch, no commit, no PR), then posts a report of what changed.
|
|
193
210
|
It's your own machine, so this is the same trust as running the CLI yourself.
|
|
194
211
|
|
|
195
|
-
```
|
|
196
|
-
// hilos-agent.json
|
|
212
|
+
```json
|
|
197
213
|
{
|
|
198
214
|
"folders": { "<channelId>": "/Users/you/notes-site" }
|
|
199
215
|
}
|
|
@@ -227,7 +243,7 @@ It's your own machine, so this is the same trust as running the CLI yourself.
|
|
|
227
243
|
|
|
228
244
|
Add an optional per-channel deploy target next to `folders`:
|
|
229
245
|
|
|
230
|
-
```
|
|
246
|
+
```json
|
|
231
247
|
{
|
|
232
248
|
"folders": { "<channelId>": "/Users/you/notes-site" },
|
|
233
249
|
"deploy": { "<channelId>": { "provider": "vercel", "prod": false } }
|
|
@@ -282,30 +298,29 @@ touching the token.
|
|
|
282
298
|
|
|
283
299
|
## Permissions / autonomy
|
|
284
300
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
"codingCmd": "claude -p --dangerously-skip-permissions"
|
|
301
|
+
There are two separate gates:
|
|
302
|
+
|
|
303
|
+
- **Room runtime permissions.** When the workspace has granted runtime
|
|
304
|
+
permissions, current daemons put Claude Code, Codex, Cursor, and OpenCode
|
|
305
|
+
behind the same server-authorized card flow. A tool ask pauses mechanically
|
|
306
|
+
and resumes only after an eligible channel member chooses **Allow once**, an
|
|
307
|
+
exact harness-suggested **Always** rule, or **Deny**. Cursor and OpenCode use
|
|
308
|
+
ACP; Claude Code uses its permission-prompt tool; Codex uses `codex
|
|
309
|
+
mcp-server` because `codex exec` has no approval transport. Once a relay is
|
|
310
|
+
active, authority loss, expiry, cancellation, and transport failure all fail
|
|
311
|
+
closed. A positively unavailable old-CLI transport is the compatibility
|
|
312
|
+
exception: the daemon warns the room, then starts the ungated fallback.
|
|
313
|
+
Explicit vendor bypass modes such as `opencode run --auto` or Claude Code's
|
|
314
|
+
`--dangerously-skip-permissions` deliberately opt out of the cards.
|
|
315
|
+
- **The CLI's own mode.** Without a workspace runtime grant, `codingCmd` remains
|
|
316
|
+
authoritative. The default Claude Code command uses
|
|
317
|
+
`--permission-mode acceptEdits`: it may edit without prompting, but a headless
|
|
318
|
+
command that needs additional approval can stall. For a fully independent
|
|
319
|
+
local agent, `--dangerously-skip-permissions` can run any command in the repo
|
|
320
|
+
you point it at, so use it only where that trust is acceptable.
|
|
321
|
+
|
|
322
|
+
```json
|
|
323
|
+
{ "codingCmd": "claude -p --dangerously-skip-permissions" }
|
|
309
324
|
```
|
|
310
325
|
|
|
311
326
|
- **Approve-before-push (`gate:true`), most cautious.** Independent of the two
|
|
@@ -314,9 +329,9 @@ safest first:
|
|
|
314
329
|
|
|
315
330
|
The default stays `acceptEdits`. Reach for `--dangerously-skip-permissions` when
|
|
316
331
|
you want a truly hands-off teammate, and keep `gate:true` if you'd rather review
|
|
317
|
-
before anything is pushed.
|
|
318
|
-
|
|
319
|
-
|
|
332
|
+
before anything is pushed. Runtime cards and the push gate are independent: one
|
|
333
|
+
governs tools during the run, the other governs when the resulting code leaves
|
|
334
|
+
the machine.
|
|
320
335
|
|
|
321
336
|
## Hooks — keep a raw Codex, Claude Code, or Cursor session in the room
|
|
322
337
|
|
|
@@ -365,8 +380,9 @@ npx hilos-agent@latest hooks print
|
|
|
365
380
|
live card. The normal one-line `--join` flow does not need that file for
|
|
366
381
|
replies: its token stays in daemon memory, and Hilos signs each session
|
|
367
382
|
binding so the daemon can verify it before resuming local code.
|
|
368
|
-
- Keep `hilos-agent` running to pick replies up. Hooks
|
|
369
|
-
|
|
383
|
+
- Keep `hilos-agent` running to pick replies up. Hooks only emit lifecycle
|
|
384
|
+
events; the daemon is the consumer that waits on the server's wake/long-poll
|
|
385
|
+
path and resumes the local session.
|
|
370
386
|
|
|
371
387
|
**What you get:**
|
|
372
388
|
- Team members see "Editing lib/x.ts" or "Running pnpm test" on the agent's live
|
|
@@ -422,8 +438,9 @@ An older server simply leaves it off.
|
|
|
422
438
|
### Run transcripts are opt-in
|
|
423
439
|
|
|
424
440
|
The room gets what a teammate needs to see: a plan, live progress, a report, a
|
|
425
|
-
PR. The coding tool's
|
|
426
|
-
|
|
441
|
+
PR. The coding tool's raw stream is **not** part of that by default. Current
|
|
442
|
+
servers do keep a bounded, redacted set of structured activity facts through
|
|
443
|
+
the runtime-neutral event protocol described above; that is not a transcript.
|
|
427
444
|
|
|
428
445
|
Set `"uploadTranscripts": true` and the daemon, after posting its report, sends
|
|
429
446
|
the tail of that run's stream to hilos, where it becomes the same transcript a
|
|
@@ -457,8 +474,14 @@ arguments can be visible to other processes on the machine, so use
|
|
|
457
474
|
Likewise, prefer `--join-stdin` over the legacy `--join <blob>` form for a new
|
|
458
475
|
connection.
|
|
459
476
|
|
|
460
|
-
|
|
461
|
-
|
|
477
|
+
See `hilos-agent --help` for the `init`, `webmcp`, `web doctor`, and `hooks`
|
|
478
|
+
subcommands.
|
|
479
|
+
|
|
480
|
+
Env: `HILOS_TOKEN`, `HILOS_URL`, `HILOS_CHANNEL`, `CODING_CMD`,
|
|
481
|
+
`HILOS_CODING_MODEL`, `HILOS_CHAT_CMD`, `HILOS_WEB_SEARCH=1|0`,
|
|
482
|
+
`HILOS_ACP=1|0`, `HILOS_HEARTBEAT_MS`, `HILOS_PROGRESS_MS`,
|
|
483
|
+
`HILOS_CHAT_TIMEOUT_MS`, `HILOS_REPLY_BRIDGE=1|0`, `HILOS_ONCE=1`,
|
|
484
|
+
`HILOS_BACKFILL=1`, and `HILOS_UPLOAD_TRANSCRIPTS=1|0`.
|
|
462
485
|
|
|
463
486
|
## Releasing
|
|
464
487
|
|
package/bin/hilos-agent.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// hilos-agent — run your coding agent as an autonomous teammate in a hilos
|
|
3
|
-
// channel. Picks up @mentions and opens a PR by default;
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// channel. Picks up @mentions and opens a PR by default; an optional pre-push
|
|
4
|
+
// gate waits for a person's approval. The checkout and credentials stay local;
|
|
5
|
+
// changes go to the configured Git remote and bounded run state goes to hilos.
|
|
6
6
|
//
|
|
7
7
|
// Usage:
|
|
8
8
|
// hilos-agent --join <blob> connect with a copy-paste link from hilos
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hilos-agent",
|
|
3
|
-
"version": "0.11.
|
|
4
|
-
"description": "Run your own coding agent (Claude Code, Codex, Cursor, OpenCode, Hermes, or any command) as a teammate in a hilos room.
|
|
3
|
+
"version": "0.11.3",
|
|
4
|
+
"description": "Run your own coding agent (Claude Code, Codex, Cursor, OpenCode, Hermes, or any command) as a teammate in a hilos room. The checkout and credentials stay local; changes go to your configured Git remote as a PR for human review, and bounded progress and reports go to hilos.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"hilos-agent": "bin/hilos-agent.mjs"
|
package/src/handler.mjs
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
//
|
|
6
6
|
// Turn an @mention in a git-linked channel into a branch + a coding-agent run.
|
|
7
7
|
// By default it opens a PR for review; with gate:true it posts a proposed diff
|
|
8
|
-
// and pushes only after approval.
|
|
8
|
+
// and pushes only after approval. The checkout and credentials stay local;
|
|
9
|
+
// bounded progress/reports go to hilos and changes go to the Git remote.
|
|
9
10
|
|
|
10
11
|
import { spawnSync } from "node:child_process";
|
|
11
12
|
import { randomBytes, randomUUID } from "node:crypto";
|