@openmuster/muster 0.3.1-alpha.4 → 0.3.1-alpha.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.
- package/README.md +10 -6
- package/dist/{args-9ZZDcPxa.js → args-CaFBa2IP.js} +305 -23
- package/dist/cli.js +3 -3
- package/dist/index.d.ts +67 -18
- package/dist/index.js +106 -41
- package/dist/inspect/app.js +49 -26
- package/dist/{main-Doit2DDY.js → main-BeEB08iI.js} +158 -8
- package/dist/main-CLzQkYeG.js +6 -0
- package/dist/mcp-CAAZRJgv.js +6 -0
- package/dist/{module-DjDMSEKu.js → module-BX2IjSiv.js} +2 -2
- package/dist/{module-D8qcE3e7.js → module-D9KdbEpS.js} +1 -1
- package/dist/skills/board/SKILL.md +5 -0
- package/dist/{steps-BUPRIOe3.js → steps-FNDWY1P_.js} +16 -4
- package/docs/01-concepts/09-watchers.md +4 -32
- package/docs/01-concepts/10-schedules.md +1 -1
- package/docs/01-concepts/11-access.md +19 -3
- package/docs/01-concepts/13-budgets.md +66 -3
- package/docs/01-concepts/15-outgoing-webhooks.md +6 -19
- package/docs/01-concepts/16-workflows.md +22 -2
- package/docs/01-quickstart.md +74 -45
- package/docs/02-sync/01-overview.md +34 -2
- package/docs/02-sync/02-github.md +40 -19
- package/docs/02-sync/03-linear.md +103 -85
- package/docs/02-sync/04-slack.md +116 -111
- package/docs/02-sync/05-notion.md +46 -25
- package/docs/03-guides/01-coding-agents.md +51 -33
- package/docs/03-guides/02-swarm.md +30 -15
- package/docs/03-guides/03-factory.md +193 -80
- package/docs/03-guides/04-inspector.md +73 -42
- package/docs/03-guides/05-running-agents.md +62 -35
- package/docs/03-guides/06-sandboxed-agents.md +488 -305
- package/docs/03-guides/07-build-a-ui.md +86 -31
- package/docs/03-guides/08-ci.md +59 -36
- package/docs/03-guides/09-daemon.md +121 -53
- package/docs/03-guides/10-two-agents.md +31 -22
- package/docs/03-guides/11-person-in-the-loop.md +47 -34
- package/docs/03-guides/12-unattended.md +46 -27
- package/docs/03-guides/13-terminals.md +51 -39
- package/docs/03-guides/14-no-cloud.md +31 -19
- package/docs/03-guides/15-several-boards.md +61 -27
- package/docs/03-guides/16-non-code.md +29 -18
- package/docs/03-guides/17-mcp.md +37 -30
- package/docs/03-guides/18-a-board-on-a-server.md +66 -43
- package/docs/03-guides/19-a-card-queue.md +210 -121
- package/docs/03-guides/20-a-feedback-loop.md +298 -134
- package/docs/03-guides/21-running-the-loop.md +94 -64
- package/docs/03-guides/22-building-from-linear.md +81 -57
- package/docs/04-reference/01-cli.md +7 -0
- package/docs/04-reference/02-handle.md +10 -15
- package/docs/04-reference/03-http.md +1 -1
- package/docs/04-reference/04-events.md +2 -1
- package/docs/04-reference/05-errors.md +3 -0
- package/docs/04-reference/08-files.md +49 -0
- package/docs/index.md +1 -0
- package/package.json +1 -1
- package/dist/main-D5aX7Jaj.js +0 -6
- package/dist/mcp-Cm96TIb3.js +0 -6
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Two agents, one builds and one reviews
|
|
3
|
-
description: For work where the agent saying it is done isn't enough.
|
|
3
|
+
description: For work where the agent saying it is done isn't enough. You end with one agent that builds, a second agent in a fresh session that reviews once the build task completes, and a failed review that sends the work back for another round.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Who this is for
|
|
7
7
|
|
|
8
8
|
You have work worth checking, and "the agent said it's done" isn't enough.
|
|
9
|
-
You don't need a swarm for this: two tasks, where the second
|
|
10
|
-
first.
|
|
9
|
+
You don't need a [swarm](./02-swarm.md) for this: two tasks, where the second
|
|
10
|
+
waits for the first.
|
|
11
11
|
|
|
12
12
|
**You need:** muster, and one agent CLI installed and signed in. Two different
|
|
13
13
|
vendors (Claude Code and Codex, say) review each other better than one vendor
|
|
14
14
|
twice, but a fresh session of the same agent still beats none.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Queue the work and its review
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Create a build task, and a review task that can't start until the build task
|
|
19
|
+
completes:
|
|
19
20
|
|
|
20
21
|
```bash steps
|
|
21
22
|
mu tasks create work/login "Follow only same-origin paths after login. You own apps/web/login/. Done when the login tests pass." --label role=build --as lead
|
|
@@ -23,8 +24,8 @@ mu tasks create work/login "Review the fix for task 1: try an off-site URL, a pr
|
|
|
23
24
|
mu tasks work/login --state all --as lead
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
The review is `waiting
|
|
27
|
-
before.
|
|
27
|
+
The review is [`waiting`](../01-concepts/08-tasks.md#states). It becomes
|
|
28
|
+
`ready` when task 1 completes, and not before.
|
|
28
29
|
|
|
29
30
|
Start the builder, then the reviewer, each on its own kind of task:
|
|
30
31
|
|
|
@@ -38,39 +39,47 @@ reviewer has not seen the builder's reasoning, only its result.
|
|
|
38
39
|
|
|
39
40
|
## What you see
|
|
40
41
|
|
|
42
|
+
Read the channel:
|
|
43
|
+
|
|
41
44
|
```bash steps
|
|
42
45
|
mu read work/login --as lead
|
|
43
46
|
```
|
|
44
47
|
|
|
45
|
-
Each task's thread
|
|
48
|
+
Each task's thread shows its plan, each step with the command the agent ran,
|
|
46
49
|
and the result. The reviewer's thread says what it tried and what happened.
|
|
47
50
|
|
|
48
51
|
## If the review fails
|
|
49
52
|
|
|
50
|
-
A review that finds a
|
|
51
|
-
|
|
52
|
-
afterwards. Task IDs
|
|
53
|
+
A review that finds a problem fails, with what it found as its reason. Send
|
|
54
|
+
the work back for another round, and reopen the review so it runs again
|
|
55
|
+
afterwards. Task IDs skip numbers (each task takes 2 places in the board's
|
|
56
|
+
log), so the review here is task 3:
|
|
53
57
|
|
|
54
58
|
```bash
|
|
55
59
|
mu tasks reopen 1 --round --as lead
|
|
56
60
|
mu tasks reopen 3 --as lead
|
|
57
61
|
```
|
|
58
62
|
|
|
59
|
-
The work is `ready` again
|
|
60
|
-
waits for
|
|
61
|
-
|
|
62
|
-
rethink it.
|
|
63
|
+
The work is `ready` again, and the builder can read the review's findings on
|
|
64
|
+
the board. The review waits for the work once more. If you don't reopen the
|
|
65
|
+
review, it stays failed and doesn't run again. Three rounds on the same kind
|
|
66
|
+
of finding means the approach is wrong: stop and rethink it.
|
|
67
|
+
|
|
68
|
+
## When not to add a reviewer
|
|
63
69
|
|
|
64
|
-
|
|
70
|
+
Skip the second agent, or change how you use it, in these cases:
|
|
65
71
|
|
|
66
|
-
-
|
|
67
|
-
benefit.
|
|
68
|
-
- A reviewer told only "review this" approves. Give it three or four
|
|
69
|
-
things to try to break.
|
|
72
|
+
- **A change you will read yourself anyway:** the second agent is cost
|
|
73
|
+
without benefit.
|
|
74
|
+
- **A reviewer told only "review this":** it approves. Give it three or four
|
|
75
|
+
specific things to try to break.
|
|
70
76
|
|
|
71
77
|
## What goes wrong
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
Each item is the symptom, then the cause and the fix:
|
|
80
|
+
|
|
81
|
+
- **Either agent takes either task.** A task has one holder, so both can't
|
|
82
|
+
take the same one. But without `--label` either may take either task. Label
|
|
83
|
+
them.
|
|
75
84
|
- **The reviewer reviews its own work.** Give the two different `--as` names
|
|
76
85
|
and different labels, and say in the review's text whose work it is.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: A person in the loop
|
|
3
|
-
description: For agents
|
|
3
|
+
description: For anyone whose agents should stop and ask when a decision is theirs. You end with agents that block a task with their question, a way to find and answer it on the board, and a watcher that tells you when one is waiting.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Who this is for
|
|
@@ -8,14 +8,14 @@ description: For agents that should stop and ask you when a decision is yours. T
|
|
|
8
8
|
You want an agent to stop and ask when a decision is yours, not guess. And you
|
|
9
9
|
want to find those questions without watching a terminal.
|
|
10
10
|
|
|
11
|
-
**You need:** muster. For a ping on your phone, the daemon and
|
|
12
|
-
can send you a notification
|
|
11
|
+
**You need:** muster. For a ping on your phone, you also need the daemon and
|
|
12
|
+
a command that can send you a notification.
|
|
13
13
|
|
|
14
14
|
## How a question works
|
|
15
15
|
|
|
16
|
-
An agent that
|
|
17
|
-
task's thread, with what it would choose
|
|
18
|
-
the task as yourself, and the agent writes as `claude
|
|
16
|
+
An agent that reaches a decision it shouldn't make writes the question in
|
|
17
|
+
its task's thread, with what it would choose. Then it blocks the task. Here
|
|
18
|
+
you make the task as yourself, and the agent writes as `claude`:
|
|
19
19
|
|
|
20
20
|
```bash steps
|
|
21
21
|
mu tasks create work/billing "Set the retry limit for failed payments and document it."
|
|
@@ -24,22 +24,26 @@ mu reply 1 "Question: retry 3 times or 5? I would pick 3: the provider's docs sa
|
|
|
24
24
|
mu tasks block 1 "retry 3 times or 5?" --kind needs_input --as claude
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
The task is now `blocked
|
|
28
|
-
|
|
27
|
+
The task is now [`blocked`](../01-concepts/08-tasks.md#states), and the
|
|
28
|
+
agent is done with it. No process is waiting: the question is stored on the
|
|
29
|
+
board.
|
|
29
30
|
|
|
30
31
|
## Find what is waiting for you
|
|
31
32
|
|
|
33
|
+
List the blocked tasks, then read the one you want:
|
|
34
|
+
|
|
32
35
|
```bash steps
|
|
33
36
|
mu tasks --state blocked
|
|
34
37
|
mu read 1
|
|
35
38
|
```
|
|
36
39
|
|
|
37
|
-
## Answer
|
|
40
|
+
## Answer and unblock the task
|
|
38
41
|
|
|
39
42
|
Reply in the thread, then unblock. Only a task's owner (whoever made it) may
|
|
40
|
-
unblock it: blocking ended the agent's
|
|
41
|
-
|
|
42
|
-
and reads the thread from the top, your answer
|
|
43
|
+
unblock it: blocking ended the agent's
|
|
44
|
+
[claim](../01-concepts/08-tasks.md#claims), so nobody holds the task. The
|
|
45
|
+
next free agent takes it and reads the thread from the top, your answer
|
|
46
|
+
included:
|
|
43
47
|
|
|
44
48
|
```bash steps
|
|
45
49
|
mu reply 1 "3. Revisit if the provider raises the limit."
|
|
@@ -47,22 +51,28 @@ mu tasks unblock 1
|
|
|
47
51
|
mu tasks --state ready
|
|
48
52
|
```
|
|
49
53
|
|
|
50
|
-
##
|
|
54
|
+
## Have the agent wait for your answer
|
|
51
55
|
|
|
52
|
-
For a
|
|
56
|
+
For a question you can answer within the timeout, the agent can wait inside
|
|
57
|
+
its turn instead of blocking:
|
|
53
58
|
|
|
54
59
|
```bash
|
|
55
|
-
mu wait --re 1 --after
|
|
60
|
+
mu wait --re 1 --after 4 --timeout 30m --as claude
|
|
56
61
|
```
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
`--after 4` starts after the agent's own question: `mu reply` printed it as
|
|
64
|
+
`#4`, and that is its place in the event log. The wait returns when a reply
|
|
65
|
+
arrives, or exits 1 after the timeout. A timeout is
|
|
59
66
|
silence, not an answer: the agent should block the task then, not decide for
|
|
60
67
|
you.
|
|
61
68
|
|
|
62
|
-
##
|
|
69
|
+
## Get notified when a task blocks
|
|
63
70
|
|
|
64
|
-
A watcher runs your command when a
|
|
65
|
-
|
|
71
|
+
A [watcher](../01-concepts/09-watchers.md#watchers) runs your command when a
|
|
72
|
+
task blocks. Put it in your
|
|
73
|
+
[board module](../01-concepts/17-board-module.md),
|
|
74
|
+
`~/.config/muster/board.ts`, and run `mu daemon run`, or
|
|
75
|
+
[keep the daemon running](./09-daemon.md):
|
|
66
76
|
|
|
67
77
|
```ts board.ts
|
|
68
78
|
import { board, command } from '@openmuster/muster'
|
|
@@ -82,23 +92,26 @@ email. It gets the thread's ID, never the question's text, so nothing a
|
|
|
82
92
|
stranger wrote ends up in a shell command. See
|
|
83
93
|
[Watchers](../01-concepts/09-watchers.md).
|
|
84
94
|
|
|
85
|
-
`kinds: ['!backlog']` leaves out tasks
|
|
86
|
-
|
|
95
|
+
`kinds: ['!backlog']` leaves out tasks set aside for later (see
|
|
96
|
+
[Hold work for later](#hold-work-for-later)): they are blocked too, but
|
|
97
|
+
nobody is asking you anything. Try a filter by hand first:
|
|
87
98
|
`mu tail work/ --type task.blocked --kind '!backlog'`.
|
|
88
99
|
|
|
89
|
-
##
|
|
100
|
+
## Hold work for later
|
|
90
101
|
|
|
91
102
|
Not every blocked task is a question. To write down work no agent should take
|
|
92
|
-
yet,
|
|
103
|
+
yet, create it already blocked with
|
|
104
|
+
[`--hold`](../01-concepts/08-tasks.md#parking-work-for-later):
|
|
93
105
|
|
|
94
106
|
```bash steps
|
|
95
107
|
mu tasks create work/payments "Move retries to the new provider." --hold backlog --reason "after the migration"
|
|
96
108
|
mu tasks claim --ready work/payments --as claude || echo "nothing to take"
|
|
97
109
|
```
|
|
98
110
|
|
|
99
|
-
The claim finds nothing: a `--ready` claim never takes a blocked task.
|
|
100
|
-
|
|
101
|
-
its time comes, unblock it like any other
|
|
111
|
+
The claim finds nothing: a `--ready` claim never takes a blocked task.
|
|
112
|
+
`--hold` creates and blocks the task in one write, so no agent can claim it in
|
|
113
|
+
between. When its time comes, unblock it like any other, with the ID `create`
|
|
114
|
+
printed (8 here):
|
|
102
115
|
|
|
103
116
|
```bash steps
|
|
104
117
|
mu tasks unblock 8
|
|
@@ -108,16 +121,16 @@ mu tasks --state ready
|
|
|
108
121
|
`backlog` is a convention, not a rule: any kind works, and the board treats
|
|
109
122
|
them all alike. Pick one and filter on it.
|
|
110
123
|
|
|
111
|
-
##
|
|
124
|
+
## Approve irreversible steps outside the board
|
|
112
125
|
|
|
113
|
-
A message on a board does not prove who wrote it: an agent writes with
|
|
114
|
-
person
|
|
115
|
-
publish), have the agent ask for
|
|
116
|
-
such as a review on the pull request
|
|
126
|
+
A message on a board does not prove who wrote it: an agent writes with the
|
|
127
|
+
access of the person who runs it. For anything that can't be undone (a merge,
|
|
128
|
+
a deploy, a publish), have the agent ask for approval where identity is
|
|
129
|
+
checked, such as a review on the pull request. Treat the board as where the
|
|
117
130
|
question was asked.
|
|
118
131
|
|
|
119
|
-
## When not to
|
|
132
|
+
## When not to ask a person
|
|
120
133
|
|
|
121
134
|
Don't route every small choice to a person. Tell the agent which decisions are
|
|
122
|
-
yours (spending, scope, anything irreversible)
|
|
123
|
-
|
|
135
|
+
yours (spending, scope, anything irreversible). Let it make the rest and say
|
|
136
|
+
why in a line.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Running unattended
|
|
3
|
-
description: For leaving agents to work through a queue overnight on one machine.
|
|
3
|
+
description: For anyone leaving agents to work through a queue overnight on one machine. You end with tasks a command can check, a budget, looping workers, and a morning read of what finished, what failed and what waits for you.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Who this is for
|
|
@@ -12,12 +12,12 @@ this machine, without it costing more than you decided.
|
|
|
12
12
|
|
|
13
13
|
## Queue the work
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
Write each task for a reader who knows nothing: what to make, which files are
|
|
16
|
+
theirs, and the command that shows it is done.
|
|
17
17
|
|
|
18
18
|
Task IDs skip numbers (each task takes two places in the board's log), so the
|
|
19
19
|
first task on a new board is 1 and the second is 3. Use the IDs `create`
|
|
20
|
-
prints
|
|
20
|
+
prints:
|
|
21
21
|
|
|
22
22
|
```bash steps
|
|
23
23
|
mu tasks create work/api "Add input validation to POST /orders. You own apps/api/orders/. Done when pnpm test apps/api/orders passes." --as ada
|
|
@@ -27,43 +27,53 @@ mu tasks work/ --as ada
|
|
|
27
27
|
|
|
28
28
|
## Set a limit before you leave
|
|
29
29
|
|
|
30
|
+
Set a [budget](../01-concepts/13-budgets.md) on `work`, then check it:
|
|
31
|
+
|
|
30
32
|
```bash steps
|
|
31
33
|
mu budget work 20 --as ada
|
|
32
34
|
mu budget --as ada
|
|
33
35
|
```
|
|
34
36
|
|
|
35
|
-
Once the tasks under `work` have cost 20
|
|
36
|
-
there. A budget counts what `mu run` records
|
|
37
|
-
a spend limit with your model provider too.
|
|
37
|
+
Once the tasks under `work` have cost $20, the board refuses new claims
|
|
38
|
+
there. A budget counts only what `mu run` records: it stops new claims, and it
|
|
39
|
+
isn't your bill. Set a spend limit with your model provider too.
|
|
38
40
|
|
|
39
41
|
## Start workers that keep going
|
|
40
42
|
|
|
43
|
+
Start a worker that takes ready tasks one after another:
|
|
44
|
+
|
|
41
45
|
```bash
|
|
42
46
|
mu run --ready work/ --loop --wait 10m --agent claude --as night-1
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
`--loop` takes the next ready task, starts a fresh agent on it,
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
`--loop` takes the next ready task, starts a fresh agent on it, then takes
|
|
50
|
+
the next one. `--wait 10m` keeps the worker waiting up to 10 minutes for work
|
|
51
|
+
before it stops. For 2 workers at a time, run a second one under another
|
|
52
|
+
name.
|
|
48
53
|
|
|
49
54
|
## What keeps it safe while you're away
|
|
50
55
|
|
|
51
|
-
|
|
56
|
+
While you are away, these hold:
|
|
57
|
+
|
|
58
|
+
- **A task can't be taken twice.** One agent holds it at a time, under a
|
|
59
|
+
[lease](../01-concepts/08-tasks.md#claims).
|
|
52
60
|
- **A worker that dies loses its task.** Its claim lapses and the task goes
|
|
53
61
|
back to the queue.
|
|
54
|
-
- **A task that keeps failing is
|
|
55
|
-
without a result the board blocks it as `failing`, so
|
|
56
|
-
tokens. It waits for you.
|
|
57
|
-
- **A usage limit stops the worker
|
|
58
|
-
was on is left `failed`, with the limit as its reason: see
|
|
59
|
-
|
|
62
|
+
- **A task that keeps failing is blocked.** After two attempts that ended
|
|
63
|
+
without a result the board blocks it as `failing`, so no agent spends more
|
|
64
|
+
tokens on it. It waits for you.
|
|
65
|
+
- **A usage limit stops the worker.** It doesn't spend retries on the limit.
|
|
66
|
+
The task it was on is left `failed`, with the limit as its reason: see
|
|
67
|
+
[Restart after a usage limit](#restart-after-a-usage-limit).
|
|
68
|
+
- **A question blocks its task.** The worker moves to the next one.
|
|
60
69
|
|
|
61
|
-
##
|
|
70
|
+
## Restart after a usage limit
|
|
62
71
|
|
|
63
|
-
The worker stops, because the next task would
|
|
72
|
+
The worker stops, because the next task would fail on the same limit. The task
|
|
64
73
|
it was working on is `failed`, and a failed task isn't taken again until its
|
|
65
74
|
owner reopens it. Starting the worker again doesn't retry it. When the limit
|
|
66
|
-
has lifted
|
|
75
|
+
has lifted, list the failed tasks, reopen each by the ID the list shows (12
|
|
76
|
+
here), and start the worker again:
|
|
67
77
|
|
|
68
78
|
```bash
|
|
69
79
|
mu tasks work/ --state failed
|
|
@@ -74,14 +84,17 @@ mu run --ready work/ --loop --wait 10m --agent claude --as night-1
|
|
|
74
84
|
Read the reason before you reopen: a task that failed for another cause is
|
|
75
85
|
in the same list. muster doesn't wait a limit out for you.
|
|
76
86
|
|
|
77
|
-
##
|
|
87
|
+
## Schedule a morning check
|
|
78
88
|
|
|
79
|
-
The daemon sends scheduled
|
|
89
|
+
The [daemon](../01-concepts/09-watchers.md#the-daemon) sends scheduled
|
|
90
|
+
messages and runs watchers. Keep it running:
|
|
80
91
|
|
|
81
92
|
```bash
|
|
82
93
|
mu daemon install
|
|
83
94
|
```
|
|
84
95
|
|
|
96
|
+
Then schedule a message for the morning, and check it is queued:
|
|
97
|
+
|
|
85
98
|
```bash steps
|
|
86
99
|
mu schedule work/notes "morning check: what is blocked?" --in 8h --as ada
|
|
87
100
|
mu schedule list --as ada
|
|
@@ -89,7 +102,9 @@ mu schedule list --as ada
|
|
|
89
102
|
|
|
90
103
|
See [Keep the daemon running](./09-daemon.md).
|
|
91
104
|
|
|
92
|
-
##
|
|
105
|
+
## Review the results in the morning
|
|
106
|
+
|
|
107
|
+
List every task, then the blocked ones, then what was spent:
|
|
93
108
|
|
|
94
109
|
```bash steps
|
|
95
110
|
mu tasks work/ --state all --as ada
|
|
@@ -98,13 +113,17 @@ mu budget --as ada
|
|
|
98
113
|
```
|
|
99
114
|
|
|
100
115
|
Read the blocked ones first: they are questions, or tasks that failed twice.
|
|
101
|
-
A task held as `backlog` is work
|
|
102
|
-
|
|
116
|
+
A task held as `backlog` is work set aside for later, not a question. Then
|
|
117
|
+
read the results of the completed ones. `mu inspect` shows the same in a
|
|
118
|
+
browser.
|
|
119
|
+
|
|
120
|
+
## When not to run unattended
|
|
103
121
|
|
|
104
|
-
|
|
122
|
+
Don't leave these to agents overnight:
|
|
105
123
|
|
|
106
124
|
- Work whose result you can't check by a command. Unattended agents need a
|
|
107
125
|
test to pass or fail, not taste.
|
|
108
126
|
- Anything with access you wouldn't leave a contractor alone with. Local
|
|
109
127
|
agents run with your access; see
|
|
110
|
-
[Agents in cloud sandboxes](./06-sandboxed-agents.md) for
|
|
128
|
+
[Agents in cloud sandboxes](./06-sandboxed-agents.md) for agents that run
|
|
129
|
+
apart from your machine.
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: With your terminal
|
|
3
|
-
description: For
|
|
3
|
+
description: For anyone who runs agents as interactive sessions in tmux, Herdr or Rex panes. You end with a watcher that wakes an idle pane by typing a pointer to what changed, after a gate checks that the agent is idle.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Who this is for
|
|
7
7
|
|
|
8
8
|
You run agents as interactive sessions, each in its own terminal pane, and
|
|
9
|
-
want them to work off one board. muster
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
want them to work off one board. muster never talks to a terminal, so any
|
|
10
|
+
terminal works. This page is about the one thing terminals add: waking a
|
|
11
|
+
session that is sitting idle.
|
|
12
12
|
|
|
13
13
|
**You need:** muster, and your panes.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Give each pane a profile
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Use one pane per agent. Give each a
|
|
18
|
+
[profile](../01-concepts/06-actors.md) name, set once in that pane's shell:
|
|
18
19
|
|
|
19
20
|
```bash
|
|
20
21
|
export MUSTER_PROFILE=worker-1
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
Then tell the agent in that pane how to work: install the board skill
|
|
24
|
-
(`
|
|
25
|
-
|
|
26
|
-
From there the agent takes
|
|
25
|
+
(`npx skills add openmuster/muster`, or
|
|
26
|
+
`mu skills install --to ~/.claude/skills`), or paste
|
|
27
|
+
`skills/board/SKILL.md` into its instructions. From there the agent takes
|
|
28
|
+
tasks and waits on the board itself:
|
|
27
29
|
|
|
28
30
|
```bash
|
|
29
31
|
mu tasks claim --ready work/ --wait 10m
|
|
30
32
|
mu wait --re 12 --after 31 --timeout 30m
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
`--re 12` waits on thread 12, and `--after 31` returns only events after
|
|
36
|
+
event 31. An agent that is mid-turn can wait like this. One that has ended
|
|
37
|
+
its turn is idle, and nothing on the board can make it type. That is what the
|
|
38
|
+
rest of this page is for.
|
|
36
39
|
|
|
37
40
|
## Two ways to get work to an idle agent
|
|
38
41
|
|
|
@@ -44,22 +47,26 @@ page is for.
|
|
|
44
47
|
Prefer the first. A pane running `mu run --loop` is a worker that needs no
|
|
45
48
|
waking and no terminal tooling.
|
|
46
49
|
|
|
47
|
-
##
|
|
50
|
+
## Wake a pane safely
|
|
48
51
|
|
|
49
|
-
A watcher runs a command when a
|
|
50
|
-
command types one line into it.
|
|
52
|
+
A [watcher](../01-concepts/09-watchers.md#watchers) runs a command when a
|
|
53
|
+
board event matches. To wake a pane, that command types one line into it.
|
|
54
|
+
Three rules keep that from going wrong:
|
|
51
55
|
|
|
52
|
-
- **Type a pointer, never the message.** The line is `mu read <id
|
|
53
|
-
|
|
54
|
-
script
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
- **Type a pointer, never the message.** The line is `mu read <id>`, a
|
|
57
|
+
[pointer](../01-concepts/09-watchers.md#what-a-wake-carries) to what
|
|
58
|
+
changed. A script must never type text a stranger wrote into a shell or an
|
|
59
|
+
agent's prompt.
|
|
60
|
+
- **Only when the agent is idle.** Keys sent mid-turn go into the agent's
|
|
61
|
+
input, and an Enter can answer a permission prompt. Use a
|
|
62
|
+
[gate](../01-concepts/09-watchers.md#a-gate) that checks.
|
|
63
|
+
- **One watcher per pane.** Name the pane in the watcher. Don't route by
|
|
58
64
|
anything read from the board.
|
|
59
65
|
|
|
60
66
|
### tmux
|
|
61
67
|
|
|
62
|
-
In your board module
|
|
68
|
+
In your [board module](../01-concepts/17-board-module.md),
|
|
69
|
+
`~/.config/muster/board.ts`:
|
|
63
70
|
|
|
64
71
|
```ts board.ts
|
|
65
72
|
import { board, command } from '@openmuster/muster'
|
|
@@ -77,10 +84,11 @@ export default board({
|
|
|
77
84
|
})
|
|
78
85
|
```
|
|
79
86
|
|
|
80
|
-
Here `lead` is the tmux session the agent runs in
|
|
81
|
-
|
|
87
|
+
Here `lead` is the tmux session the agent runs in. To target one pane in a
|
|
88
|
+
session with several, `tmux list-panes -a` shows every pane's address.
|
|
82
89
|
|
|
83
|
-
`wake-pane.sh
|
|
90
|
+
`wake-pane.sh` types the pointer into the pane and presses Enter. Put it at
|
|
91
|
+
the path the watcher's command names:
|
|
84
92
|
|
|
85
93
|
```bash
|
|
86
94
|
#!/bin/sh
|
|
@@ -89,10 +97,11 @@ tmux send-keys -t "$1" -l "A task changed. Read it: mu read $2"
|
|
|
89
97
|
tmux send-keys -t "$1" Enter
|
|
90
98
|
```
|
|
91
99
|
|
|
92
|
-
`pane-idle.sh`
|
|
93
|
-
last line
|
|
94
|
-
the next event. What "idle" looks like depends on your
|
|
95
|
-
look at the pane's last line for the agent's input
|
|
100
|
+
`pane-idle.sh` is the gate. It checks whether the agent is idle and prints
|
|
101
|
+
its answer as its last line. `{"wake": false}` skips the wake, and the
|
|
102
|
+
watcher tries again on the next event. What "idle" looks like depends on your
|
|
103
|
+
agent. One way is to look at the pane's last line for the agent's input
|
|
104
|
+
prompt:
|
|
96
105
|
|
|
97
106
|
```bash
|
|
98
107
|
#!/bin/sh
|
|
@@ -105,15 +114,17 @@ esac
|
|
|
105
114
|
|
|
106
115
|
A watcher's command starts with a small, clean environment. If tmux needs a
|
|
107
116
|
socket path, pass it: `tmux -S /path/to/socket ...`, or name the variable
|
|
108
|
-
in `command()`'s `env`.
|
|
109
|
-
|
|
117
|
+
in `command()`'s `env`.
|
|
118
|
+
|
|
119
|
+
Start the daemon with `mu daemon run`. Then check that the pane wakes and its
|
|
120
|
+
agent answers: `mu daemon check <watcher>`.
|
|
110
121
|
|
|
111
122
|
### Herdr
|
|
112
123
|
|
|
113
124
|
[Herdr](https://herdr.dev) is a terminal multiplexer for coding agents. It
|
|
114
125
|
knows whether an agent is idle, so it does the gate's job itself: its
|
|
115
126
|
`agent prompt` command submits text to a named agent and can wait until the
|
|
116
|
-
agent has taken it
|
|
127
|
+
agent has taken it:
|
|
117
128
|
|
|
118
129
|
```ts board.ts
|
|
119
130
|
import { board, command } from '@openmuster/muster'
|
|
@@ -134,9 +145,10 @@ Run the daemon from inside the Herdr session, so `herdr` reaches it. Check
|
|
|
134
145
|
|
|
135
146
|
### Rex
|
|
136
147
|
|
|
137
|
-
Rex is a terminal with a CLI that manages its
|
|
138
|
-
same recipe applies: a watcher whose command
|
|
139
|
-
pane that holds the agent.
|
|
148
|
+
Rex is a terminal with a command-line interface (CLI) that manages its
|
|
149
|
+
sessions, tabs and panes. The same recipe applies: a watcher whose command
|
|
150
|
+
asks `rex` to run a line in the pane that holds the agent. Rex's commands
|
|
151
|
+
differ by version, so read
|
|
140
152
|
`rex --help` for how to address a pane and send it input, and keep the three
|
|
141
153
|
rules above.
|
|
142
154
|
|
|
@@ -145,8 +157,8 @@ rules above.
|
|
|
145
157
|
> before you rely on it. The Herdr and Rex recipes follow those tools' docs
|
|
146
158
|
> and haven't been run end to end.
|
|
147
159
|
|
|
148
|
-
## When not to
|
|
160
|
+
## When not to wake panes
|
|
149
161
|
|
|
150
|
-
If every agent can be a fresh session per task, skip waking altogether. It
|
|
151
|
-
|
|
152
|
-
closed terminal.
|
|
162
|
+
If every agent can be a fresh session per task, skip waking altogether. It
|
|
163
|
+
needs no gate and no terminal scripts, costs less (no long conversation
|
|
164
|
+
re-sent each turn), and survives a closed terminal.
|