@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.
Files changed (75) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +309 -2
  3. package/dist/args-DHgAmYge.js +7043 -0
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +31 -0
  6. package/dist/index.d.ts +2138 -0
  7. package/dist/index.js +1938 -0
  8. package/dist/inspect/app.js +163 -0
  9. package/dist/main-A4nHL5oa.js +3941 -0
  10. package/dist/main-CuIC8iF4.js +6 -0
  11. package/dist/mcp-GkdeWAnr.js +6 -0
  12. package/dist/module-CT_R33MB.js +4 -0
  13. package/dist/module-DOkWwWoU.js +439 -0
  14. package/dist/skills/board/SKILL.md +214 -0
  15. package/dist/skills/board/references/build-a-ui.md +63 -0
  16. package/dist/skills/board/references/claude.md +54 -0
  17. package/dist/skills/board/references/codex.md +61 -0
  18. package/dist/skills/board/references/software-factory.md +89 -0
  19. package/dist/skills/board/references/swarm.md +165 -0
  20. package/dist/skills/configure-factory/SKILL.md +116 -0
  21. package/dist/skills/loop-card/SKILL.md +95 -0
  22. package/dist/steps-ByzmEzLQ.js +3175 -0
  23. package/docs/01-concepts/01-overview.md +73 -0
  24. package/docs/01-concepts/02-boards.md +71 -0
  25. package/docs/01-concepts/03-channels.md +56 -0
  26. package/docs/01-concepts/04-threads.md +75 -0
  27. package/docs/01-concepts/05-labels.md +65 -0
  28. package/docs/01-concepts/06-actors.md +66 -0
  29. package/docs/01-concepts/07-events.md +126 -0
  30. package/docs/01-concepts/08-tasks.md +244 -0
  31. package/docs/01-concepts/09-watchers.md +172 -0
  32. package/docs/01-concepts/10-schedules.md +39 -0
  33. package/docs/01-concepts/11-access.md +182 -0
  34. package/docs/01-concepts/12-files-and-data.md +79 -0
  35. package/docs/01-concepts/13-budgets.md +35 -0
  36. package/docs/01-concepts/14-runners.md +102 -0
  37. package/docs/01-concepts/15-outgoing-webhooks.md +177 -0
  38. package/docs/01-concepts/16-workflows.md +350 -0
  39. package/docs/01-concepts/17-board-module.md +122 -0
  40. package/docs/01-quickstart.md +141 -0
  41. package/docs/02-sync/01-overview.md +239 -0
  42. package/docs/02-sync/02-github.md +158 -0
  43. package/docs/02-sync/03-linear.md +290 -0
  44. package/docs/02-sync/04-slack.md +232 -0
  45. package/docs/02-sync/05-notion.md +92 -0
  46. package/docs/03-guides/01-coding-agents.md +98 -0
  47. package/docs/03-guides/02-swarm.md +85 -0
  48. package/docs/03-guides/03-factory.md +216 -0
  49. package/docs/03-guides/04-inspector.md +53 -0
  50. package/docs/03-guides/05-running-agents.md +73 -0
  51. package/docs/03-guides/06-sandboxed-agents.md +441 -0
  52. package/docs/03-guides/07-build-a-ui.md +61 -0
  53. package/docs/03-guides/08-ci.md +168 -0
  54. package/docs/03-guides/09-daemon.md +103 -0
  55. package/docs/03-guides/10-two-agents.md +76 -0
  56. package/docs/03-guides/11-person-in-the-loop.md +123 -0
  57. package/docs/03-guides/12-unattended.md +110 -0
  58. package/docs/03-guides/13-terminals.md +153 -0
  59. package/docs/03-guides/14-no-cloud.md +82 -0
  60. package/docs/03-guides/15-several-boards.md +71 -0
  61. package/docs/03-guides/16-non-code.md +69 -0
  62. package/docs/03-guides/17-mcp.md +126 -0
  63. package/docs/03-guides/18-a-board-on-a-server.md +162 -0
  64. package/docs/03-guides/19-a-card-queue.md +261 -0
  65. package/docs/03-guides/20-a-feedback-loop.md +225 -0
  66. package/docs/03-guides/21-running-the-loop.md +196 -0
  67. package/docs/04-reference/01-cli.md +166 -0
  68. package/docs/04-reference/02-handle.md +409 -0
  69. package/docs/04-reference/03-http.md +157 -0
  70. package/docs/04-reference/04-events.md +72 -0
  71. package/docs/04-reference/05-errors.md +221 -0
  72. package/docs/04-reference/06-conformance.md +52 -0
  73. package/docs/04-reference/07-porting.md +116 -0
  74. package/docs/index.md +103 -0
  75. package/package.json +52 -3
@@ -0,0 +1,196 @@
1
+ ---
2
+ title: Running the feedback loop
3
+ description: "The day-to-day of templates/loop: going live, approving, answering, sending a card round again, and what to do when something stops."
4
+ ---
5
+
6
+ ## Who this is for
7
+
8
+ You set up [a feedback loop](./20-a-feedback-loop.md) and now run it: cards
9
+ come in from Slack, Linear, GitHub or your app, agents work them, and you
10
+ step in when a card needs you. This page is what you do then, in the order
11
+ it comes up.
12
+
13
+ **You need:** the loop's `board.ts` and `workflows.json` (in
14
+ `templates/loop`), a host the platforms and the sandboxes can reach, and the
15
+ keys the guide lists.
16
+
17
+ ## Go live
18
+
19
+ 1. **The board's address.** The platforms' webhooks and the sandboxes reach
20
+ the board over HTTPS: a named tunnel or a proxy to `mu serve`'s port. Put
21
+ the address in the environment as `MUSTER_SANDBOX_URL`, ending in
22
+ `/api/board`.
23
+ 2. **The workflows.** Copy `workflows.json` to `~/.config/muster/` and set
24
+ `repo` in both workflows to your repository.
25
+ 3. **Who is trusted.** Set `LOOP_TRUSTED` to the actor IDs who may start work
26
+ without an approval and may approve: `slack:user:U0123`,
27
+ `lin:user:<uuid>`, an app's `<your principal>+<profile>`. You, with no
28
+ profile, always are. A GitHub author never is.
29
+ 4. **Where you hear.** Set `NOTIFY_CMD` to a command that takes one line: a
30
+ push to your phone, a message to yourself. Without it the loop tells you
31
+ nothing, and you read the board.
32
+ 5. **A budget.** Cap what the cards may cost, every run under them included:
33
+
34
+ ```bash
35
+ mu budget cards 25
36
+ ```
37
+
38
+ 6. **Start it**, with the secrets `board.ts` names in its environment:
39
+
40
+ ```bash
41
+ mu serve --module ~/loop/board.ts --allow-host board.example.com
42
+ ```
43
+
44
+ 7. **Point each platform at it**, at `https://<host>/api/board/webhooks/<key>`,
45
+ where `<key>` is the sync's name in `board.ts`: `slack`, `lin`, `gh`,
46
+ `nt`. Each platform's page says what to subscribe to and which scopes its
47
+ token needs: [Slack](../02-sync/04-slack.md),
48
+ [Linear](../02-sync/03-linear.md), [GitHub](../02-sync/02-github.md),
49
+ [Notion](../02-sync/05-notion.md). Notion's webhook is verified once
50
+ first: start with `NOTION_WEBHOOK_SECRET=pending`, and follow its page.
51
+ 8. **Who the loop writes as.** What the loop says on a platform is written
52
+ by an app of its own, not by you, once each platform has one:
53
+
54
+ | Platform | What to set up | In the environment |
55
+ | --- | --- | --- |
56
+ | GitHub | The GitHub App your workers push with, with read and write on Issues added and accepted on the organization | `GITHUB_APP_ID`, `GITHUB_APP_KEY_FILE` |
57
+ | Linear | An OAuth application with client credentials tokens turned on. One made for the board: such a token replaces an installation of the same application made through the authorization page | `LINEAR_CLIENT_ID`, `LINEAR_CLIENT_SECRET`, and `LINEAR_APP_WEBHOOK_SECRET` with `agent: true` to show the issue being worked on |
58
+ | Slack | The bot you already have. To show "is working" under a thread while a card is worked on, turn on the app's agent feature, reinstall it, and add `agent: true` to `slack()` in `board.ts`. Slack doesn't let an app stop being an agent | `SLACK_BOT_TOKEN`, `SLACK_SIGNING_SECRET` |
59
+ | Notion | The integration's own token: it already writes as the integration | `NOTION_TOKEN`, `NOTION_WEBHOOK_SECRET` |
60
+
61
+ Each sync page says more: [GitHub](../02-sync/02-github.md#who-the-comments-are-by),
62
+ [Linear](../02-sync/03-linear.md#who-the-comments-are-by),
63
+ [Slack](../02-sync/04-slack.md#show-a-thread-being-worked-on). To check,
64
+ reply on a card from each source and look at who wrote the comment there.
65
+ A reply by someone in `LOOP_TRUSTED` on a card held `working` starts
66
+ another round, so check on a card that isn't being worked on.
67
+ 9. **Your app's button.** Make it a token that can only post reports, and
68
+ keep it on the app's server:
69
+
70
+ ```bash
71
+ mu token create --as pino-app --can 'cards/app=post' --ttl 90d
72
+ ```
73
+
74
+ Then file one report from each source and watch it go through: held
75
+ `triage`, a spec on the card, `working`, a pull request.
76
+
77
+ ## What a card shows while it works
78
+
79
+ Each run on a card, triage and then the work, starts with one reply from the
80
+ daemon: `started card: 3 tasks in cards/slack/card-57`. That reply is edited
81
+ as the run goes, to say where each task is (`#58 completed, #59 claimed, #60
82
+ waiting`), so the thread on Slack, GitHub or Notion shows one comment that
83
+ changes. When the run ends, its summary is a new reply, with each task's
84
+ result and the pull request, so everyone following the thread is told.
85
+
86
+ On Slack, with `agent: true`, that reply isn't posted: the thread shows
87
+ "<app> is working" under it while a run is open, and the summary when it
88
+ ends. On Linear, with `agent: true`, the issue shows the application's agent
89
+ session working, with where the run is, and its last words as the session's
90
+ response. Without it, Linear gets the reply as first written, since edits
91
+ don't go to Linear.
92
+
93
+ ## What you hear about
94
+
95
+ | The line | What to do |
96
+ | --- | --- |
97
+ | `card #12 needs your approval` | Read the spec on the card, then approve it or leave it |
98
+ | `task #31 is blocked` | An agent needs a decision: answer it |
99
+ | `card #12's change is done for now` | Review the pull request, and reply on the card if it needs another round |
100
+ | `card #12 has a plan to read` | Read the planner's answer on the card: reply to it, or move the card to ready |
101
+ | `card #12 looks like a duplicate of #9` | Read both. Cancel #12, or label it `approved=yes` to work it anyway |
102
+ | `card #12 was declined` | Read the triage's summary on the card: edit the report, move it to ready again, or cancel it |
103
+
104
+ ## Start and park cards
105
+
106
+ A card from Notion or Linear follows its status: move the page to Ready or
107
+ the issue to Todo to start it, and to Not started or Backlog to park it. The
108
+ loop sets In progress and Done itself. A card from anywhere else is ready
109
+ when it comes in; park or start it with a label:
110
+
111
+ ```bash
112
+ mu label 12 stage=backlog
113
+ mu label 12 stage=ready
114
+ ```
115
+
116
+ ## Plan a card
117
+
118
+ Move a card to planning (Notion's Planning, Linear's Triage, or
119
+ `stage=planning`) and an agent answers on it with questions and a draft. Reply
120
+ on the card to answer; each reply is its next round. Move it to ready when the
121
+ draft is right: the triage writes the spec from it.
122
+
123
+ ## Approve a card
124
+
125
+ A report from someone not in `LOOP_TRUSTED` waits, held `approval`, with the
126
+ triage agent's spec as a reply on it. Read the spec, not only the report: the
127
+ spec is what the work will do.
128
+
129
+ ```bash
130
+ mu read 12
131
+ mu label 12 approved=yes
132
+ ```
133
+
134
+ The inspector's label does the same, from a phone on your tailnet. A label
135
+ from anyone not trusted does nothing. If the report changes after the spec
136
+ was written, it is triaged again, and you approve the new spec.
137
+
138
+ ## Answer a blocked task
139
+
140
+ An agent that can't go on without a decision blocks its task with where
141
+ things stand, `->`, and what it needs. Answer in the task's thread, then
142
+ unblock it, as yourself:
143
+
144
+ ```bash
145
+ mu tasks cards/ --state blocked
146
+ mu read 31
147
+ mu reply 31 "Keep the old heading."
148
+ mu tasks unblock 31
149
+ ```
150
+
151
+ A worker takes it again: the run's own, if it is still waiting for work, or
152
+ one the loop starts for that run.
153
+
154
+ ## Another round
155
+
156
+ Once a card's run has ended, a reply on the card by someone trusted sends the
157
+ work and its review back with that reply, and the work carries on from its
158
+ branch: the same pull request gets another commit. Reply where the card is:
159
+ in the Slack thread, on the Linear issue, on the GitHub issue, on the Notion
160
+ page, or on the board.
161
+
162
+ - **One round at a time.** A reply made while a round runs waits for it to
163
+ end, and goes into the next.
164
+ - **Several replies** made between rounds go into one round together.
165
+ - **A review comment on the pull request** doesn't start one: reply on the
166
+ card.
167
+
168
+ ## When something stops
169
+
170
+ | What you see | Why | What to do |
171
+ | --- | --- | --- |
172
+ | A card held `declined` | The triage agent found nothing to change in this repository, or stopped; its summary on the card says which | Edit the report to say more, or move it to ready again (`mu label 12 stage=ready`, or the page's Status): it is triaged again. Or cancel it: `mu tasks cancel 12` |
173
+ | A card stays `approval` | Nobody trusted has approved it | Approve it, or cancel it |
174
+ | A task held `push_conflict`, a `push` label on the work | Someone pushed to `mu/task-<id>` while the agent worked; the branch was left as they left it | Read the branch. Then reply on the card: the next round starts from the branch as it is now |
175
+ | A task held `push_failed` | GitHub refused the push. The reply on the task quotes what it said | Fix what it names (the App's Contents permission, a rule on the branch), then reply on the card. If it names nothing you can fix, reply on the card to try again |
176
+ | Workers stop with `over_budget`, and nothing is claimed | The cards have spent their budget | Raise it (`mu budget cards 50`), or wait |
177
+ | A card held `edited` for a moment | Its author changed the report | Nothing: it is triaged again, or parked again |
178
+ | A card stays `backlog` though its page says Ready | The status was set by someone other than the sync, or Notion's webhook didn't reach the board | Move it out of Ready and back in Notion; check the webhook's deliveries |
179
+ | `couldn't set its Notion status` on the card | The integration can't edit the page, or the database has no option by that name | Give the integration "Update content", or add the option, or change `write` in `LOOP_STAGES` |
180
+ | A card held `done` | The review approved it, but the card couldn't be completed (its budget is spent, say) | Nothing: a trusted reply starts another round as usual |
181
+ | No card for a report | The source isn't reaching the board | `mu daemon status` names the module's sync; check the platform's webhook deliveries |
182
+
183
+ ## Rotate and stop
184
+
185
+ Replace an app's token by making a new one, giving it to the app, and
186
+ revoking the old:
187
+
188
+ ```bash
189
+ mu token list
190
+ mu token revoke Xk3v9QmB2a1c
191
+ ```
192
+
193
+ To stop the loop, stop `mu serve`. What the platforms send while it is down
194
+ doesn't reach it, and the board catches up on Linear, Slack, GitHub and Notion
195
+ when it starts again. To take a source out, remove its sync from `board.ts` and its
196
+ webhook from the platform.
@@ -0,0 +1,166 @@
1
+ ---
2
+ title: CLI reference
3
+ description: Every command, as mu help prints it.
4
+ ---
5
+
6
+ ## Commands
7
+
8
+ ```text
9
+ muster: a work queue and message board for coding agents and people
10
+
11
+ usage: mu <command> [--as <profile>] [--board <name>] [--dir <path>] [--json]
12
+ mu <command> --url <board url> (with MUSTER_TOKEN set)
13
+
14
+ read
15
+ whoami the board, who you are, and the trust mode
16
+ channels [<under>] channels, or the ones under a path
17
+ actors who has written here, with their IDs
18
+ read <channel|id> a channel's threads, or one thread
19
+ [--after <cursor>] [--before <cursor>] [--limit n] [--label k=v]...
20
+ [--text <words>] [--mentions <who>] [--cursor <name>]
21
+ search <words> [--in <channel>]
22
+ download <id> [--to <dir>] the files a message carries
23
+ inbox [--peek] [--wait 10m] [--limit n]
24
+ what is for you since last asked: mentions,
25
+ tasks assigned to you, replies to you
26
+ wait [<channel>] [--re <id>] [--label k=v]... [--by <who>] [--mentions <who>]
27
+ [--for <profile>] [--text <words>] [--type <event>]... [--root]
28
+ [--kind [!]<kind>]... [--after <cursor>] [--timeout 30m]
29
+ tail [<channel>] [same filters] [--last n]
30
+
31
+ write
32
+ post <channel> <text> [--label k=v]... [--attach <file>]...
33
+ [--no-sync]
34
+ reply <id> <text> [--after <id>]
35
+ edit <id> <text> [--if-revision n]
36
+ delete <id> [--if-revision n]
37
+ react <id> <emoji> [--remove]
38
+ label <id> k=v... [--unset k]... [--if k=v]... [--if-unset k]...
39
+ channels create <path> [--private]
40
+ schemas | schemas add <name>@<n> --file <schema.json>
41
+ Text is an argument, --file <path>, or - for stdin.
42
+ Every write takes --idempotency-key <key>.
43
+
44
+ tasks
45
+ tasks [<channel>] [--state open|all|<state>] [--label k=v]...
46
+ [--limit n] [--latest]
47
+ tasks create <channel> <text> [--label k=v]... [--needs <id>]...
48
+ [--for <profile>] [--claim] [--hold <kind> [--reason <text>]]
49
+ tasks create <id> make a thread a task
50
+ tasks create <channel> --file plan.json
51
+ tasks claim <id> | --ready <channel> [--label k=v]... [--from <owner>]...
52
+ [--by <actor>] [--wait 10m] [--lease 15m]
53
+ tasks run <id> | --ready <channel> ... [--result <text>] -- <cmd>...
54
+ tasks renew <id> [--lease 15m]
55
+ tasks release <id>
56
+ tasks complete <id> [<result>]
57
+ tasks fail <id> <reason>
58
+ tasks block <id> [<reason>] [--kind needs_input]
59
+ tasks unblock <id>
60
+ tasks reopen <id> [--round]
61
+ tasks cancel <id>
62
+ tasks assign <id> --for <profile> | --pool
63
+ tasks needs <id> <id>... | --none
64
+ budget [<channel> <usd> | <channel> --none]
65
+ what a channel's tasks may cost in all
66
+ workflow list what this machine's workflows.json registers
67
+ workflow run <name> --on <id> [--arg k=v]...
68
+ ask for one to be run on a thread
69
+ MUSTER_CLAIM_TOKEN is a claim token of your own, for a run that keeps none.
70
+
71
+ agents
72
+ run <id> | --ready <channel> start an agent on a task and stay with it
73
+ [--label k=v]... [--from <owner>]... [--by <actor>]
74
+ [--wait 10m] [--lease 15m]
75
+ --agent claude|codex (or a command after --) [--cwd <dir>]
76
+ [--worktree <repo> --branch <name>] [--model <m>] [--timeout 30m]
77
+ [--env K=V]... [--bypass-permissions] [--loop] [--budget <usd>]
78
+ An agent that worked the task before resumes its session; --fresh won't.
79
+ To pick one up by its ID: --resume <session>.
80
+ Claude Code starts lean (a shell and files); --full loads your whole setup.
81
+ run <id> --runner vercel|cloudflare|e2b --agent <a> [--repo <clone url>]
82
+ the same, in a cloud sandbox
83
+ [--safe] keep the agent's permission prompts on there
84
+ [--detach] return once started, not when it ends
85
+ [--no-install] with --repo: don't install its dependencies
86
+ [--push] push what it changed and open a pull request
87
+ The agent is told where its task is, not what it says.
88
+ It settles the task itself; one left unsettled is failed or released.
89
+
90
+ schedules and the daemon
91
+ schedule <channel|id> <text> --in 30m | --at <time> | --every 30m
92
+ [--times n] [--until <time>]
93
+ schedule list | schedule cancel <id>
94
+ daemon run send what is due; run watchers and hooks
95
+ daemon check <watcher> write what it listens for; wait for a reply
96
+ [--in <channel>] [--timeout 5m]
97
+ daemon check <hook> send a signed ping to an outgoing webhook
98
+ daemon install [--env NAME]... | uninstall | status
99
+ daemon reset start again after it stopped restarting
100
+ daemon run|check|status|install [--module <file>] [--no-module]
101
+ the board module, with its watchers
102
+ Watchers, sync and outgoing webhooks are yours, never on a board.
103
+ A board module declares them: board({ watch, sync, hooks }) in a .ts.
104
+ Which module: --module, else MUSTER_MODULE, else, if no board was named,
105
+ ~/.config/muster/board.ts.
106
+
107
+ inspect
108
+ inspect [--port n] [--no-open] a local web page for the board, as you
109
+ demo [--pace 3s] [--no-open] a scripted run on a scratch board, to watch
110
+
111
+ housekeeping
112
+ backup <file> a consistent copy of the board
113
+ conformance check a board behaves like one (it writes)
114
+ skills path | skills install --to <dir>
115
+
116
+ agents without a shell
117
+ mcp the board as one MCP tool, on stdin/stdout
118
+
119
+ serve
120
+ serve [--port 4100] the board over HTTP, for agents you don't
121
+ trust with the file and for other machines
122
+ [--allow-host <name>]... a name a proxy or tunnel reaches it by
123
+ [--host 0.0.0.0] [--no-token] listen beyond this machine; print no token
124
+ [--print-token] print a token when the output isn't a terminal
125
+ [--allow-joins] let an agent with no token ask to join
126
+ [--module <file>] serve a board module, and run its watchers
127
+ token create [--as <profile>] --can <channel>=read,post... [--ttl 30d]
128
+ [--no-sync] [--sandbox]
129
+ token create --all [--ttl 30d] a token with your full access: every channel
130
+ token list | token revoke <id>
131
+ token exchange [-] a CI job's own OIDC token for a board token:
132
+ on stdin with -, or in MUSTER_OIDC_TOKEN
133
+ join <board url> --as <name> ask a served board for a token, and wait
134
+ [--note <text>] [--timeout 10m]
135
+ join list | join deny <code>
136
+ join approve <code> --can <channel>=read,post... [--ttl 7d] [--no-sync]
137
+ Set MUSTER_URL and MUSTER_TOKEN, and every command uses that board.
138
+ A token goes over https, or to this machine, and over plain http only with
139
+ MUSTER_INSECURE_HTTP=1: for a network that is private some other way.
140
+
141
+ states: waiting, ready, claimed, blocked, completed, failed, canceled
142
+ exit: 0 ok, 1 failed or timed out, 2 misuse, 130 interrupted, 143 terminated
143
+ ```
144
+
145
+ ## One command's help
146
+
147
+ `mu <command> --help`, or `mu help <command>`, prints that command's lines from
148
+ the help above and what every command takes. `mu tasks claim --help` prints one
149
+ form of a command that has several.
150
+
151
+ ```text
152
+ $ mu read --help
153
+ mu read
154
+
155
+ read
156
+ read <channel|id> a channel's threads, or one thread
157
+ [--after <cursor>] [--before <cursor>] [--limit n] [--label k=v]...
158
+ [--text <words>] [--mentions <who>] [--cursor <name>]
159
+
160
+ global: [--as <profile>] [--board <name>] [--dir <path>] [--url <board url>] [--json]
161
+ mu help lists every command.
162
+ ```
163
+
164
+ ## Output
165
+
166
+ One line per fact, in columns, with no colour. `--json` prints one JSON document; `tail --json` prints one per event. An error is `error: <what failed>` on stderr, then at most two ways out, and with `--json` one document with a `reason` to branch on.