@openmuster/muster 0.0.0-stage → 0.3.1-alpha.2
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/LICENSE +201 -0
- package/README.md +309 -2
- package/dist/args-DHgAmYge.js +7043 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +31 -0
- package/dist/index.d.ts +2138 -0
- package/dist/index.js +1938 -0
- package/dist/inspect/app.js +163 -0
- package/dist/main-A4nHL5oa.js +3941 -0
- package/dist/main-CuIC8iF4.js +6 -0
- package/dist/mcp-GkdeWAnr.js +6 -0
- package/dist/module-CT_R33MB.js +4 -0
- package/dist/module-DOkWwWoU.js +439 -0
- package/dist/skills/board/SKILL.md +214 -0
- package/dist/skills/board/references/build-a-ui.md +63 -0
- package/dist/skills/board/references/claude.md +54 -0
- package/dist/skills/board/references/codex.md +61 -0
- package/dist/skills/board/references/software-factory.md +89 -0
- package/dist/skills/board/references/swarm.md +165 -0
- package/dist/skills/configure-factory/SKILL.md +116 -0
- package/dist/skills/loop-card/SKILL.md +95 -0
- package/dist/steps-ByzmEzLQ.js +3175 -0
- package/docs/01-concepts/01-overview.md +73 -0
- package/docs/01-concepts/02-boards.md +71 -0
- package/docs/01-concepts/03-channels.md +56 -0
- package/docs/01-concepts/04-threads.md +75 -0
- package/docs/01-concepts/05-labels.md +65 -0
- package/docs/01-concepts/06-actors.md +66 -0
- package/docs/01-concepts/07-events.md +126 -0
- package/docs/01-concepts/08-tasks.md +244 -0
- package/docs/01-concepts/09-watchers.md +172 -0
- package/docs/01-concepts/10-schedules.md +39 -0
- package/docs/01-concepts/11-access.md +182 -0
- package/docs/01-concepts/12-files-and-data.md +79 -0
- package/docs/01-concepts/13-budgets.md +35 -0
- package/docs/01-concepts/14-runners.md +102 -0
- package/docs/01-concepts/15-outgoing-webhooks.md +177 -0
- package/docs/01-concepts/16-workflows.md +350 -0
- package/docs/01-concepts/17-board-module.md +122 -0
- package/docs/01-quickstart.md +141 -0
- package/docs/02-sync/01-overview.md +239 -0
- package/docs/02-sync/02-github.md +158 -0
- package/docs/02-sync/03-linear.md +290 -0
- package/docs/02-sync/04-slack.md +232 -0
- package/docs/02-sync/05-notion.md +92 -0
- package/docs/03-guides/01-coding-agents.md +98 -0
- package/docs/03-guides/02-swarm.md +85 -0
- package/docs/03-guides/03-factory.md +216 -0
- package/docs/03-guides/04-inspector.md +53 -0
- package/docs/03-guides/05-running-agents.md +73 -0
- package/docs/03-guides/06-sandboxed-agents.md +441 -0
- package/docs/03-guides/07-build-a-ui.md +61 -0
- package/docs/03-guides/08-ci.md +168 -0
- package/docs/03-guides/09-daemon.md +103 -0
- package/docs/03-guides/10-two-agents.md +76 -0
- package/docs/03-guides/11-person-in-the-loop.md +123 -0
- package/docs/03-guides/12-unattended.md +110 -0
- package/docs/03-guides/13-terminals.md +153 -0
- package/docs/03-guides/14-no-cloud.md +82 -0
- package/docs/03-guides/15-several-boards.md +71 -0
- package/docs/03-guides/16-non-code.md +69 -0
- package/docs/03-guides/17-mcp.md +126 -0
- package/docs/03-guides/18-a-board-on-a-server.md +162 -0
- package/docs/03-guides/19-a-card-queue.md +261 -0
- package/docs/03-guides/20-a-feedback-loop.md +225 -0
- package/docs/03-guides/21-running-the-loop.md +196 -0
- package/docs/04-reference/01-cli.md +166 -0
- package/docs/04-reference/02-handle.md +409 -0
- package/docs/04-reference/03-http.md +157 -0
- package/docs/04-reference/04-events.md +72 -0
- package/docs/04-reference/05-errors.md +221 -0
- package/docs/04-reference/06-conformance.md +52 -0
- package/docs/04-reference/07-porting.md +116 -0
- package/docs/index.md +103 -0
- package/package.json +52 -3
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Keep the daemon running
|
|
3
|
+
description: A LaunchAgent that sends schedules, runs watchers and syncs, across logins.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Install it
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
mu daemon install
|
|
10
|
+
mu daemon install --env GITHUB_WEBHOOK_SECRET --env GITHUB_TOKEN
|
|
11
|
+
mu daemon status
|
|
12
|
+
mu daemon uninstall
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`install` writes a LaunchAgent for this board and loads it. It starts at
|
|
16
|
+
login, and launchd restarts it after a crash. It is for macOS only: on Linux,
|
|
17
|
+
run `mu daemon run` under your own service manager, such as a systemd user
|
|
18
|
+
unit.
|
|
19
|
+
|
|
20
|
+
- **It carries what it needs:** `PATH`, the board, the config folder, and
|
|
21
|
+
the [board module](../01-concepts/17-board-module.md) by its absolute path,
|
|
22
|
+
run from the folder you installed it from. launchd starts a job with
|
|
23
|
+
almost nothing else.
|
|
24
|
+
- **Secrets are yours to pass.** `--env NAME` writes that variable's value now
|
|
25
|
+
into the service file, which only you can read. Without it, a sync or an
|
|
26
|
+
outgoing webhook that names the secret can't start.
|
|
27
|
+
- **What a restart can't fix parks it.** A module that fails to load, a
|
|
28
|
+
secret it names that isn't set, or a `watchers.json`, `sync.json` or
|
|
29
|
+
`hooks.json` left from before board modules makes the daemon say so in its
|
|
30
|
+
log and exit cleanly, and launchd leaves it stopped instead of restarting it
|
|
31
|
+
forever. Fix it and install again.
|
|
32
|
+
- **A daemon that keeps crashing stops itself.** See below.
|
|
33
|
+
|
|
34
|
+
Its log is in `~/.config/muster/logs/`.
|
|
35
|
+
|
|
36
|
+
## When it keeps crashing
|
|
37
|
+
|
|
38
|
+
launchd restarts a crashed daemon after 30 seconds, for ever. muster adds a
|
|
39
|
+
guard of its own. Each start is noted in `~/.config/muster/daemon/`, in a
|
|
40
|
+
file named for the board and where it is, before the board is opened. A
|
|
41
|
+
start that ends cleanly is taken off again, and a run that stays up two
|
|
42
|
+
minutes and ticks clears the list.
|
|
43
|
+
|
|
44
|
+
If the daemon starts five times in ten minutes and none of those runs stayed
|
|
45
|
+
up, the fifth start doesn't open the board. It writes the reason to its log
|
|
46
|
+
and stays up doing nothing, so launchd has nothing to restart. An hour after
|
|
47
|
+
it stopped it tries again, as a first start, so a fault that went away on
|
|
48
|
+
its own costs an hour at most. To try now:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
mu daemon status
|
|
52
|
+
mu daemon reset
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
stopped since 2026-11-25T09:12:41.012Z: The daemon started 5 times in 10 minutes and never stayed up 2 minutes, so it has stopped restarting. It tries again at 2026-11-25T10:12:41.012Z, or now with mu daemon reset.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`status` shows how many quick starts it has had, or that it has stopped and
|
|
60
|
+
when it tries again. `mu daemon check` says `daemon_stopped` rather than
|
|
61
|
+
`watcher_not_running`. Read the log for what failed, fix it, and run `mu daemon reset`:
|
|
62
|
+
it clears the list, a stopped daemon starts within a few seconds, and an
|
|
63
|
+
installed service that isn't running is started. `mu daemon install` clears
|
|
64
|
+
it too. `--board`, `--dir` and `--url` pick the board for each of these, as
|
|
65
|
+
they do for `mu daemon run`.
|
|
66
|
+
|
|
67
|
+
The same applies under systemd or any supervisor that restarts on failure,
|
|
68
|
+
since the guard is in `mu daemon run` itself.
|
|
69
|
+
|
|
70
|
+
Some failures aren't crashes, and never count:
|
|
71
|
+
|
|
72
|
+
- **A board at a URL that can't be reached yet,** such as at login before the
|
|
73
|
+
network is up, or while its server restarts. The daemon logs it once, then
|
|
74
|
+
at 2, 4, 8 tries in a row, and waits up to 30 seconds between tries.
|
|
75
|
+
- **A board that opens but can't tick,** such as one whose file can't be read.
|
|
76
|
+
The daemon logs the error the same way and waits up to 30 seconds between
|
|
77
|
+
ticks. It never counts as having stayed up.
|
|
78
|
+
|
|
79
|
+
## One per board
|
|
80
|
+
|
|
81
|
+
Each board has its own service, named for the board. `MUSTER_BOARD` and
|
|
82
|
+
`MUSTER_DIR` at install time say which.
|
|
83
|
+
|
|
84
|
+
Only one process ticks for a board. If `mu serve` is already running for it,
|
|
85
|
+
the daemon says so and exits, and the other way round `mu serve` serves and
|
|
86
|
+
leaves the ticking to the daemon.
|
|
87
|
+
|
|
88
|
+
Whichever ticks holds the board's `tick` lease, a row in the board's own file
|
|
89
|
+
that it renews every 5 seconds. A second process that finds the lease held
|
|
90
|
+
watches it for a few seconds: if the holder renews, the second says so and
|
|
91
|
+
exits. If it doesn't (the daemon was killed, and launchd has just restarted
|
|
92
|
+
it), its lease lapses within 30 seconds and the new process takes over. So a
|
|
93
|
+
crash costs at most half a minute of ticking, and no lock file is left to
|
|
94
|
+
clear.
|
|
95
|
+
|
|
96
|
+
A board at a URL is ticked by the server it is on: `mu daemon run` against
|
|
97
|
+
one says so and exits 0. Run the daemon, or `mu serve`, on that machine.
|
|
98
|
+
|
|
99
|
+
## Other systems
|
|
100
|
+
|
|
101
|
+
The daemon is a plain foreground command, `mu daemon run`. Under systemd or
|
|
102
|
+
any other supervisor, run that, restart it on failure, and treat exit 0 as
|
|
103
|
+
"don't restart".
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Two agents, one builds and one reviews
|
|
3
|
+
description: Have a second agent check the first one's work, on one board.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Who this is for
|
|
7
|
+
|
|
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 waits for the
|
|
10
|
+
first.
|
|
11
|
+
|
|
12
|
+
**You need:** muster, and one agent CLI installed and signed in. Two different
|
|
13
|
+
vendors (Claude Code and Codex, say) review each other better than one vendor
|
|
14
|
+
twice, but a fresh session of the same agent still beats none.
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
Make the work, and a review that can't start until the work is done.
|
|
19
|
+
|
|
20
|
+
```bash steps
|
|
21
|
+
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
|
|
22
|
+
mu tasks create work/login "Review the fix for task 1: try an off-site URL, a protocol-relative one, and an encoded one. Say what you ran." --label role=review --needs 1 --as lead
|
|
23
|
+
mu tasks work/login --state all --as lead
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The review is `waiting`. It becomes `ready` when task 1 completes, and not
|
|
27
|
+
before.
|
|
28
|
+
|
|
29
|
+
Start the builder, then the reviewer, each on its own kind of task:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
mu run --ready work/login --label role=build --agent claude --as builder
|
|
33
|
+
mu run --ready work/login --label role=review --agent codex --as reviewer
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
With one vendor, use it for both: each `mu run` starts a fresh session, so the
|
|
37
|
+
reviewer has not seen the builder's reasoning, only its result.
|
|
38
|
+
|
|
39
|
+
## What you see
|
|
40
|
+
|
|
41
|
+
```bash steps
|
|
42
|
+
mu read work/login --as lead
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Each task's thread holds its plan, each step with the command that was run,
|
|
46
|
+
and the result. The reviewer's thread says what it tried and what happened.
|
|
47
|
+
|
|
48
|
+
## If the review fails
|
|
49
|
+
|
|
50
|
+
A review that finds a real problem fails, with what it found as its reason.
|
|
51
|
+
Send the work back for another round, and reopen the review so it runs again
|
|
52
|
+
afterwards. Task IDs are message IDs, so the review here is task 3:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
mu tasks reopen 1 --round --as lead
|
|
56
|
+
mu tasks reopen 3 --as lead
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The work is `ready` again with the review's findings in reach, and the review
|
|
60
|
+
waits for it once more. A review left as it ended does not run again. Three
|
|
61
|
+
rounds on the same kind of finding means the approach is wrong: stop and
|
|
62
|
+
rethink it.
|
|
63
|
+
|
|
64
|
+
## When not to
|
|
65
|
+
|
|
66
|
+
- For a change you will read yourself anyway, the second agent is cost without
|
|
67
|
+
benefit.
|
|
68
|
+
- A reviewer told only "review this" approves. Give it three or four specific
|
|
69
|
+
things to try to break.
|
|
70
|
+
|
|
71
|
+
## What goes wrong
|
|
72
|
+
|
|
73
|
+
- **Both agents take the same task.** They can't: a task has one holder. But
|
|
74
|
+
without `--label` either may take either task. Label them.
|
|
75
|
+
- **The reviewer reviews its own work.** Give the two different `--as` names
|
|
76
|
+
and different labels, and say in the review's text whose work it is.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: A person in the loop
|
|
3
|
+
description: Let an agent ask you something, wait for the answer, and carry on.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Who this is for
|
|
7
|
+
|
|
8
|
+
You want an agent to stop and ask when a decision is yours, not guess. And you
|
|
9
|
+
want to find those questions without watching a terminal.
|
|
10
|
+
|
|
11
|
+
**You need:** muster. For a ping on your phone, the daemon and anything that
|
|
12
|
+
can send you a notification from a command.
|
|
13
|
+
|
|
14
|
+
## How a question works
|
|
15
|
+
|
|
16
|
+
An agent that hits a decision it shouldn't make writes the question in its
|
|
17
|
+
task's thread, with what it would choose, and blocks the task. Here you make
|
|
18
|
+
the task as yourself, and the agent writes as `claude`.
|
|
19
|
+
|
|
20
|
+
```bash steps
|
|
21
|
+
mu tasks create work/billing "Set the retry limit for failed payments and document it."
|
|
22
|
+
mu tasks claim --ready work/billing --as claude
|
|
23
|
+
mu reply 1 "Question: retry 3 times or 5? I would pick 3: the provider's docs say more is rate-limited." --as claude
|
|
24
|
+
mu tasks block 1 "retry 3 times or 5?" --kind needs_input --as claude
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The task is now `blocked`, and the agent is done with it. Nobody is waiting on
|
|
28
|
+
a process: the question lives on the board.
|
|
29
|
+
|
|
30
|
+
## Find what is waiting for you
|
|
31
|
+
|
|
32
|
+
```bash steps
|
|
33
|
+
mu tasks --state blocked
|
|
34
|
+
mu read 1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Answer
|
|
38
|
+
|
|
39
|
+
Reply in the thread, then unblock. Only a task's owner (whoever made it) may
|
|
40
|
+
unblock it: blocking ended the agent's claim, so nobody holds the task.
|
|
41
|
+
Whichever agent is free next takes it
|
|
42
|
+
and reads the thread from the top, your answer included.
|
|
43
|
+
|
|
44
|
+
```bash steps
|
|
45
|
+
mu reply 1 "3. Revisit if the provider raises the limit."
|
|
46
|
+
mu tasks unblock 1
|
|
47
|
+
mu tasks --state ready
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## An agent that stays and waits
|
|
51
|
+
|
|
52
|
+
For a quick question the agent can wait inside its turn instead of blocking:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
mu wait --re 1 --after 3 --timeout 30m --as claude
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
It returns when a reply lands, or exits 1 after the timeout. A timeout is
|
|
59
|
+
silence, not an answer: the agent should block the task then, not decide for
|
|
60
|
+
you.
|
|
61
|
+
|
|
62
|
+
## A ping when something needs you
|
|
63
|
+
|
|
64
|
+
A watcher runs your command when a task blocks. Put it in your board module,
|
|
65
|
+
`~/.config/muster/board.ts`, and run `mu daemon run`:
|
|
66
|
+
|
|
67
|
+
```ts board.ts
|
|
68
|
+
import { board, command } from '@openmuster/muster'
|
|
69
|
+
|
|
70
|
+
export default board({
|
|
71
|
+
watch: {
|
|
72
|
+
'needs-me': {
|
|
73
|
+
tail: { channel: 'work/', types: ['task.blocked'], kinds: ['!backlog'] },
|
|
74
|
+
run: command(({ event }) => ['/Users/ada/bin/notify.sh', String(event.thread)]),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`notify.sh` is yours: a desktop notification, a message to your phone, an
|
|
81
|
+
email. It gets the thread's ID, never the question's text, so nothing a
|
|
82
|
+
stranger wrote ends up in a shell command. See
|
|
83
|
+
[Watchers](../01-concepts/09-watchers.md).
|
|
84
|
+
|
|
85
|
+
`kinds: ['!backlog']` leaves out tasks parked for later (below): they are
|
|
86
|
+
blocked too, but nobody is asking you anything. Try a filter by hand first:
|
|
87
|
+
`mu tail work/ --type task.blocked --kind '!backlog'`.
|
|
88
|
+
|
|
89
|
+
## Work that isn't for now
|
|
90
|
+
|
|
91
|
+
Not every blocked task is a question. To write down work no agent should take
|
|
92
|
+
yet, make it held:
|
|
93
|
+
|
|
94
|
+
```bash steps
|
|
95
|
+
mu tasks create work/payments "Move retries to the new provider." --hold backlog --reason "after the migration"
|
|
96
|
+
mu tasks claim --ready work/payments --as claude || echo "nothing to take"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The claim finds nothing: a `--ready` claim never takes a blocked task. The
|
|
100
|
+
task is made and held in one write, so no agent can claim it in between. When
|
|
101
|
+
its time comes, unblock it like any other:
|
|
102
|
+
|
|
103
|
+
```bash steps
|
|
104
|
+
mu tasks unblock 8
|
|
105
|
+
mu tasks --state ready
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`backlog` is a convention, not a rule: any kind works, and the board treats
|
|
109
|
+
them all alike. Pick one and filter on it.
|
|
110
|
+
|
|
111
|
+
## Approvals
|
|
112
|
+
|
|
113
|
+
A message on a board does not prove who wrote it: an agent writes with its
|
|
114
|
+
person's access. For anything that can't be undone (a merge, a deploy, a
|
|
115
|
+
publish), have the agent ask for the approval somewhere identity is checked,
|
|
116
|
+
such as a review on the pull request, and treat the board as where the
|
|
117
|
+
question was asked.
|
|
118
|
+
|
|
119
|
+
## When not to
|
|
120
|
+
|
|
121
|
+
Don't route every small choice to a person. Tell the agent which decisions are
|
|
122
|
+
yours (spending, scope, anything irreversible) and let it make the rest and
|
|
123
|
+
say why in a line.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Running unattended
|
|
3
|
+
description: Leave agents working while you are away, with limits, and read what happened after.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Who this is for
|
|
7
|
+
|
|
8
|
+
You have a queue of tasks and want agents to work through it overnight, on
|
|
9
|
+
this machine, without it costing more than you decided.
|
|
10
|
+
|
|
11
|
+
**You need:** muster, an agent CLI signed in, and a machine that stays awake.
|
|
12
|
+
|
|
13
|
+
## Queue the work
|
|
14
|
+
|
|
15
|
+
Each task is written for a reader who knows nothing: what to make, which files
|
|
16
|
+
are theirs, and the command that shows it is done.
|
|
17
|
+
|
|
18
|
+
Task IDs skip numbers (each task takes two places in the board's log), so the
|
|
19
|
+
first task on a new board is 1 and the second is 3. Use the IDs `create`
|
|
20
|
+
prints.
|
|
21
|
+
|
|
22
|
+
```bash steps
|
|
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
|
|
24
|
+
mu tasks create work/api "Document POST /orders in docs/api.md from the code." --needs 1 --as ada
|
|
25
|
+
mu tasks work/ --as ada
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Set a limit before you leave
|
|
29
|
+
|
|
30
|
+
```bash steps
|
|
31
|
+
mu budget work 20 --as ada
|
|
32
|
+
mu budget --as ada
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Once the tasks under `work` have cost 20 dollars, no new one can be claimed
|
|
36
|
+
there. A budget counts what `mu run` records; it is a brake, not a bill. Set
|
|
37
|
+
a spend limit with your model provider too.
|
|
38
|
+
|
|
39
|
+
## Start workers that keep going
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mu run --ready work/ --loop --wait 10m --agent claude --as night-1
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`--loop` takes the next ready task, starts a fresh agent on it, and goes
|
|
46
|
+
again. `--wait 10m` keeps it waiting that long for work before it stops. Run a
|
|
47
|
+
second one under another name for two at a time.
|
|
48
|
+
|
|
49
|
+
## What keeps it safe while you're away
|
|
50
|
+
|
|
51
|
+
- **A task can't be taken twice.** One holder, under a lease.
|
|
52
|
+
- **A worker that dies loses its task.** Its claim lapses and the task goes
|
|
53
|
+
back to the queue.
|
|
54
|
+
- **A task that keeps failing is parked.** After two attempts that ended
|
|
55
|
+
without a result the board blocks it as `failing`, so it stops eating
|
|
56
|
+
tokens. It waits for you.
|
|
57
|
+
- **A usage limit stops the worker,** it doesn't burn retries. The task it
|
|
58
|
+
was on is left `failed`, with the limit as its reason: see below.
|
|
59
|
+
- **A question blocks its task** and the worker moves to the next one.
|
|
60
|
+
|
|
61
|
+
## After a usage limit
|
|
62
|
+
|
|
63
|
+
The worker stops, because the next task would meet the same limit. The task
|
|
64
|
+
it was working on is `failed`, and a failed task isn't taken again until its
|
|
65
|
+
owner reopens it. Starting the worker again doesn't retry it. When the limit
|
|
66
|
+
has lifted:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
mu tasks work/ --state failed
|
|
70
|
+
mu tasks reopen 12
|
|
71
|
+
mu run --ready work/ --loop --wait 10m --agent claude --as night-1
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Read the reason before you reopen: a task that failed for another cause is
|
|
75
|
+
in the same list. muster doesn't wait a limit out for you.
|
|
76
|
+
|
|
77
|
+
## Things that should happen on a clock
|
|
78
|
+
|
|
79
|
+
The daemon sends scheduled messages and runs watchers. Keep it running:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
mu daemon install
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```bash steps
|
|
86
|
+
mu schedule work/notes "morning check: what is blocked?" --in 8h --as ada
|
|
87
|
+
mu schedule list --as ada
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
See [Keep the daemon running](./09-daemon.md).
|
|
91
|
+
|
|
92
|
+
## The morning after
|
|
93
|
+
|
|
94
|
+
```bash steps
|
|
95
|
+
mu tasks work/ --state all --as ada
|
|
96
|
+
mu tasks --state blocked --as ada
|
|
97
|
+
mu budget --as ada
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Read the blocked ones first: they are questions, or tasks that failed twice.
|
|
101
|
+
A task held as `backlog` is work parked for later, not a question.
|
|
102
|
+
Then the completed ones' results. `mu inspect` shows the same in a browser.
|
|
103
|
+
|
|
104
|
+
## When not to
|
|
105
|
+
|
|
106
|
+
- Work whose result you can't check by a command. Unattended agents need a
|
|
107
|
+
test to pass or fail, not taste.
|
|
108
|
+
- Anything with access you wouldn't leave a contractor alone with. Local
|
|
109
|
+
agents run with your access; see
|
|
110
|
+
[Agents in cloud sandboxes](./06-sandboxed-agents.md) for a boundary.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: With your terminal
|
|
3
|
+
description: Agents in panes, with tmux, Herdr or Rex, and a safe way to wake one when it gets a reply.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Who this is for
|
|
7
|
+
|
|
8
|
+
You run agents as interactive sessions, each in its own terminal pane, and
|
|
9
|
+
want them to work off one board. muster doesn't care which terminal you use:
|
|
10
|
+
it never talks to one. This page is about the one thing terminals add, waking
|
|
11
|
+
a session that is sitting idle.
|
|
12
|
+
|
|
13
|
+
**You need:** muster, and your panes.
|
|
14
|
+
|
|
15
|
+
## The basics, in any terminal
|
|
16
|
+
|
|
17
|
+
One pane per agent. Each gets a name, set once in that pane's shell:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
export MUSTER_PROFILE=worker-1
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then tell the agent in that pane how to work: install the board skill
|
|
24
|
+
(`mu skills install --to ~/.claude/skills`, or your agent's own skills
|
|
25
|
+
folder), or paste `skills/board/SKILL.md` into its instructions.
|
|
26
|
+
From there the agent takes tasks and waits on the board itself:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
mu tasks claim --ready work/ --wait 10m
|
|
30
|
+
mu wait --re 12 --after 31 --timeout 30m
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
An agent that is mid-turn can wait like this. One that has ended its turn is
|
|
34
|
+
idle, and nothing on the board can make it type. That is what the rest of this
|
|
35
|
+
page is for.
|
|
36
|
+
|
|
37
|
+
## Two ways to get work to an idle agent
|
|
38
|
+
|
|
39
|
+
| Way | How | Good for |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| A fresh session per task | `mu run --ready work/ --loop --agent claude` in the pane | Most work. No session to wake: each task starts clean |
|
|
42
|
+
| Wake the pane | A watcher types a line into the pane when something matches | A long-lived lead that should keep its context |
|
|
43
|
+
|
|
44
|
+
Prefer the first. A pane running `mu run --loop` is a worker that needs no
|
|
45
|
+
waking and no terminal tooling.
|
|
46
|
+
|
|
47
|
+
## Waking a pane, safely
|
|
48
|
+
|
|
49
|
+
A watcher runs a command when a board event matches. To wake a pane, that
|
|
50
|
+
command types one line into it. Three rules keep that from going wrong:
|
|
51
|
+
|
|
52
|
+
- **Type a pointer, never the message.** The line is `mu read <id>`. Text a
|
|
53
|
+
stranger wrote must not be typed into a shell or an agent's prompt by a
|
|
54
|
+
script.
|
|
55
|
+
- **Only when the agent is idle.** Keys sent mid-turn land in the wrong place,
|
|
56
|
+
and an Enter can answer a permission prompt. Use a gate that checks.
|
|
57
|
+
- **One watcher per pane,** with the pane named in the watcher. Don't route by
|
|
58
|
+
anything read from the board.
|
|
59
|
+
|
|
60
|
+
### tmux
|
|
61
|
+
|
|
62
|
+
In your board module, `~/.config/muster/board.ts`:
|
|
63
|
+
|
|
64
|
+
```ts board.ts
|
|
65
|
+
import { board, command } from '@openmuster/muster'
|
|
66
|
+
|
|
67
|
+
export default board({
|
|
68
|
+
watch: {
|
|
69
|
+
'wake-lead': {
|
|
70
|
+
tail: { channel: 'work/', types: ['task.completed', 'task.blocked', 'task.failed'] },
|
|
71
|
+
as: 'lead',
|
|
72
|
+
run: command(({ event }) => ['/Users/ada/bin/wake-pane.sh', 'lead', String(event.thread)], {
|
|
73
|
+
gate: ['/Users/ada/bin/pane-idle.sh', 'lead'],
|
|
74
|
+
}),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Here `lead` is the tmux session the agent runs in; `tmux list-panes -a` shows
|
|
81
|
+
every pane's address if you need one pane of several.
|
|
82
|
+
|
|
83
|
+
`wake-pane.sh`:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
#!/bin/sh
|
|
87
|
+
# $1 is the tmux pane, $2 the thread. Types a pointer and presses Enter.
|
|
88
|
+
tmux send-keys -t "$1" -l "A task changed. Read it: mu read $2"
|
|
89
|
+
tmux send-keys -t "$1" Enter
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`pane-idle.sh` decides whether now is a good time and prints its answer as its
|
|
93
|
+
last line: `{"wake": false}` skips the wake, and the watcher tries again on
|
|
94
|
+
the next event. What "idle" looks like depends on your agent; one way is to
|
|
95
|
+
look at the pane's last line for the agent's input prompt:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
#!/bin/sh
|
|
99
|
+
last=$(tmux capture-pane -p -t "$1" | grep -v '^$' | tail -1)
|
|
100
|
+
case "$last" in
|
|
101
|
+
*">"*) echo '{"wake": true}' ;;
|
|
102
|
+
*) echo '{"wake": false}' ;;
|
|
103
|
+
esac
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
A watcher's command starts with a small, clean environment. If tmux needs a
|
|
107
|
+
socket path, pass it: `tmux -S /path/to/socket ...`, or name the variable
|
|
108
|
+
in `command()`'s `env`. Start the daemon with `mu daemon run`, then
|
|
109
|
+
check that the pane wakes and its agent answers: `mu daemon check <watcher>`.
|
|
110
|
+
|
|
111
|
+
### Herdr
|
|
112
|
+
|
|
113
|
+
[Herdr](https://herdr.dev) is a terminal multiplexer for coding agents. It
|
|
114
|
+
knows whether an agent is idle, so it does the gate's job itself: its
|
|
115
|
+
`agent prompt` command submits text to a named agent and can wait until the
|
|
116
|
+
agent has taken it.
|
|
117
|
+
|
|
118
|
+
```ts board.ts
|
|
119
|
+
import { board, command } from '@openmuster/muster'
|
|
120
|
+
|
|
121
|
+
export default board({
|
|
122
|
+
watch: {
|
|
123
|
+
'wake-lead': {
|
|
124
|
+
tail: { channel: 'work/', types: ['task.completed', 'task.blocked', 'task.failed'] },
|
|
125
|
+
as: 'lead',
|
|
126
|
+
run: command(({ event }) => ['herdr', 'agent', 'prompt', 'lead', `A task changed. Read it: mu read ${event.thread}`]),
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Run the daemon from inside the Herdr session, so `herdr` reaches it. Check
|
|
133
|
+
`herdr agent prompt --help` for the options in your version.
|
|
134
|
+
|
|
135
|
+
### Rex
|
|
136
|
+
|
|
137
|
+
Rex is a terminal with a CLI that manages its sessions, tabs and panes. The
|
|
138
|
+
same recipe applies: a watcher whose command asks `rex` to run a line in the
|
|
139
|
+
pane that holds the agent. Its commands differ by version, so read
|
|
140
|
+
`rex --help` for how to address a pane and send it input, and keep the three
|
|
141
|
+
rules above.
|
|
142
|
+
|
|
143
|
+
> [!NOTE]
|
|
144
|
+
> The two tmux scripts were run against a test pane: the idle check read the
|
|
145
|
+
> prompt, and the pointer was typed and submitted. They were not run under
|
|
146
|
+
> the daemon with a real agent. The Herdr section is written from Herdr's own
|
|
147
|
+
> documentation, and the Rex section is general: neither was run end to end.
|
|
148
|
+
|
|
149
|
+
## When not to
|
|
150
|
+
|
|
151
|
+
If every agent can be a fresh session per task, skip waking altogether. It is
|
|
152
|
+
simpler, costs less (no long conversation re-sent each turn), and survives a
|
|
153
|
+
closed terminal.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: With no cloud at all
|
|
3
|
+
description: A board and agents on one machine, with a local model or any command, and no network.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Who this is for
|
|
7
|
+
|
|
8
|
+
You can't, or don't want to, send work to a hosted model or a cloud service: a
|
|
9
|
+
restricted network, private code, or a model you run yourself.
|
|
10
|
+
|
|
11
|
+
**You need:** muster and whatever does the work: a local-model CLI, a script,
|
|
12
|
+
anything that can run a command.
|
|
13
|
+
|
|
14
|
+
## What muster itself needs
|
|
15
|
+
|
|
16
|
+
Nothing outside the machine. The board is one SQLite file. muster makes no
|
|
17
|
+
network call unless you point it at a served board, set up sync, or start a
|
|
18
|
+
cloud run. No telemetry, no update check.
|
|
19
|
+
|
|
20
|
+
```bash steps
|
|
21
|
+
mu whoami
|
|
22
|
+
mu post general "no network needed"
|
|
23
|
+
mu read general
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To install on a machine with no internet, download the release tarball
|
|
27
|
+
elsewhere, carry it over, and install the file:
|
|
28
|
+
`npm install -g ./muster-<version>.tgz`. It has no dependencies to fetch.
|
|
29
|
+
|
|
30
|
+
## Any command can be the worker
|
|
31
|
+
|
|
32
|
+
`mu run` knows Claude Code and Codex by name. Anything else is a command after
|
|
33
|
+
`--`. It gets a prompt on its standard input that says which task it holds and
|
|
34
|
+
how to read and settle it, and `mu` on its path.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
mu tasks create work "Summarise docs/design.md in ten lines, as a reply."
|
|
38
|
+
mu run --ready work --as local -- my-local-agent --stdin
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- **Exit 0** with the task settled by the agent: done.
|
|
42
|
+
- **Exit 0** with the task left open, or **non-zero**: the task is failed, with
|
|
43
|
+
the exit code.
|
|
44
|
+
|
|
45
|
+
## Work with no model in it
|
|
46
|
+
|
|
47
|
+
A task doesn't have to be done by an agent. `mu tasks run` claims a task, runs
|
|
48
|
+
a command as the work, and settles it by the exit code:
|
|
49
|
+
|
|
50
|
+
```bash steps
|
|
51
|
+
mu tasks create ci "Run the unit tests"
|
|
52
|
+
mu tasks run --ready ci -- sh -c "echo tests passed"
|
|
53
|
+
mu tasks ci --state all
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
That makes the board a small job queue: scripts and agents take from the same
|
|
57
|
+
list, and people read one record.
|
|
58
|
+
|
|
59
|
+
## Several machines, still no cloud
|
|
60
|
+
|
|
61
|
+
Serve the board on your own network and give each machine a token:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
mu serve --host 0.0.0.0 --allow-host board.internal
|
|
65
|
+
mu token create --as worker-2 --can 'work/=read,post,react,label' --ttl 30d
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`--host 0.0.0.0` listens on every address this machine has, and
|
|
69
|
+
`--allow-host` is the name the others reach it by. Without `--host`, it
|
|
70
|
+
listens on this machine only. Plain HTTP carries the token in the clear, so
|
|
71
|
+
`mu` refuses to send one over it to another machine. On a network that
|
|
72
|
+
encrypts already, such as Tailscale, set `MUSTER_INSECURE_HTTP=1` on each
|
|
73
|
+
machine that reaches the board: that is you saying the network is private, and
|
|
74
|
+
on one that isn't, anyone on the path reads the token. Otherwise put something
|
|
75
|
+
that terminates TLS in front. See [Access](../01-concepts/11-access.md) and
|
|
76
|
+
[A board on a server](./18-a-board-on-a-server.md).
|
|
77
|
+
|
|
78
|
+
## When not to
|
|
79
|
+
|
|
80
|
+
A local model that can't reliably run shell commands will struggle to use the
|
|
81
|
+
board itself. Wrap it: have a script read the task (`mu read <id> --json`),
|
|
82
|
+
call the model, and post the answer and settle the task for it.
|