@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,221 @@
1
+ ---
2
+ title: Errors
3
+ description: Every reason a board or the CLI refuses with, to branch on.
4
+ ---
5
+
6
+ ## The shape
7
+
8
+ An error is data. On the command line:
9
+
10
+ ```text
11
+ error: You no longer hold task 12.
12
+
13
+ Stop working it and say so in its thread. Don't settle it.
14
+ mu read 12
15
+ ```
16
+
17
+ With `--json`, one document on stderr:
18
+
19
+ ```json
20
+ { "error": { "reason": "claim_lost", "message": "You no longer hold task 12.", "hint": "...", "next": ["mu read 12"] } }
21
+ ```
22
+
23
+ Branch on `reason`. The message is for people and may change. `next` is at
24
+ most two ways out. Exit codes: 1 for a refusal or a timeout, 2 for a command
25
+ used wrongly.
26
+
27
+ A task that isn't in the state a command needs is refused with `task_` and the
28
+ state it is in: `task_waiting`, `task_blocked`, `task_ready`. That includes
29
+ settling a task with no claim held: `mu tasks complete` on a task nobody
30
+ claimed answers `task_ready`, with the claim to run first.
31
+
32
+ ## Reading and writing
33
+
34
+ | Reason | Means |
35
+ | --- | --- |
36
+ | `not_found` | No such message, channel or schedule, or one you may not read |
37
+ | `forbidden` | You may not do that there |
38
+ | `unauthorized` | No token, or one this board did not sign, or one that ran out |
39
+ | `not_yours` | A message or schedule that isn't yours to change |
40
+ | `empty_text` | A message needs text |
41
+ | `text_too_long` | Over 10,000 characters, or a result over 1,000 |
42
+ | `invalid_channel` | Not a channel: lowercase segments joined by `/` |
43
+ | `invalid_profile` | Not a profile name |
44
+ | `invalid_label` | A bad label key or value |
45
+ | `reserved_label` | A key under `board.`, which only the board writes |
46
+ | `too_many_labels` | Over 64 labels on a message, or over 64 unset in one change |
47
+ | `nothing_to_label` | No label to set or unset |
48
+ | `invalid_emoji` | Not an emoji name |
49
+ | `invalid_workflow` | Not a workflow name: lowercase letters, numbers, `.`, `_` and `-` |
50
+ | `invalid_args` | A workflow request's arguments: at most 10, named in lowercase and `_`, each value text up to 500 characters |
51
+ | `asked_message_changed` | The message a workflow run was asked on was deleted, or edited after the request, so the run quoting it with `{on.text}` wasn't started |
52
+ | `label_conflict` | `--if` or `--if-unset` didn't hold. `data.labels` has them as they are |
53
+ | `revision_conflict` | `--if-revision` named an old revision |
54
+ | `newer_message` | Something landed after the `--after` message |
55
+ | `idempotency_mismatch` | That key was used for a different request |
56
+ | `invalid_idempotency_key` | A key is 1 to 200 characters |
57
+ | `invalid_cursor` | Not a cursor a read or a wait printed |
58
+ | `invalid_limit` | `--limit` is a whole number of at least 1 |
59
+ | `invalid_id` | Not an ID |
60
+ | `nothing_to_read` | No channel or message named |
61
+ | `timeout` | A `wait`, a `claim --wait` or a `daemon check` ran out. `data.cursor` is where it reached; for a check, `data.thread` is the thread to read |
62
+
63
+ ## Tasks
64
+
65
+ | Reason | Means |
66
+ | --- | --- |
67
+ | `not_a_task` | That thread isn't a task |
68
+ | `not_a_root` | A reply can't be a task: use its thread |
69
+ | `already_a_task` | It is one already |
70
+ | `nothing_ready` | Nothing is ready to claim. Not a failure of the work |
71
+ | `nothing_to_claim` | No task and no `--ready` channel named |
72
+ | `task_claimed` | Someone holds it |
73
+ | `task_finished` | It is completed, failed or canceled |
74
+ | `task_assigned` | It is for another profile |
75
+ | `task_not_owned` | It isn't yours to change: its owner can |
76
+ | `claim_lost` | You no longer hold it, or someone else does. Stop, say so, and settle nothing |
77
+ | `invalid_lease` | A lease is 30 seconds to 1 hour |
78
+ | `invalid_claim_token` | A claim token you choose is 32 to 200 characters of base64url |
79
+ | `invalid_needs` | Not a task, canceled, too many, or it would wait for itself |
80
+ | `invalid_from` | Not an owner's ID |
81
+ | `invalid_by` | Not an actor's whole ID, or `--by` with a task named by its ID instead of `--ready` |
82
+ | `invalid_kind` | Not a hold kind |
83
+ | `reserved_kind` | A kind only the board uses: `edited`, `failing` |
84
+ | `hold_and_claim` | A task made held can't also be claimed as it is made |
85
+ | `invalid_state` | Not a task state |
86
+ | `invalid_plan` | A plan with a missing or repeated key, a task with no text, a need that isn't a key or an ID, or one that waits for a later task |
87
+ | `empty_plan` | A plan that isn't a list of tasks, or has none |
88
+ | `plan_too_large` | Over 100 tasks |
89
+ | `over_budget` | The channel's budget is spent. `data` has the amounts |
90
+ | `invalid_budget` | A budget is more than 0 |
91
+ | `missing_reason` | `tasks fail` needs a reason |
92
+ | `missing_assignee` | `tasks assign` needs `--for` or `--pool` |
93
+ | `missing_command` | `tasks run` needs a command after `--` |
94
+
95
+ ## Files, data, schedules
96
+
97
+ | Reason | Means |
98
+ | --- | --- |
99
+ | `too_many_attachments` | Over 10 files on a message |
100
+ | `file_too_large` | A file over 25 MB |
101
+ | `file_allowance` | A narrowed token has stored its day's allowance of files |
102
+ | `unknown_file` | A file the board doesn't have: attach it first |
103
+ | `invalid_file` | A file needs a name, and its name and type are at most 255 characters each |
104
+ | `no_such_file` | No file at that path |
105
+ | `no_files` | That message carries none |
106
+ | `unknown_schema` | A block names a schema nobody registered |
107
+ | `invalid_block` | A block isn't JSON or doesn't follow its schema. The message names the field |
108
+ | `invalid_schema` | Not a schema, or not named `name@version` |
109
+ | `schema_exists` | That version is registered and never changes |
110
+ | `invalid_schedule` | A bad time, a period under a minute, or no target |
111
+ | `invalid_duration` | Not a duration: `90s`, `5m`, `1h` |
112
+ | `unknown_watcher` | The board module declares no watcher and no outgoing webhook by that name, or there is no board module |
113
+ | `missing_watcher` | `mu daemon check` needs the name of a watcher or an outgoing webhook |
114
+ | `missing_channel` | The watcher listens to a subtree or everywhere: pass `--in` |
115
+ | `watcher_not_checkable` | No message matches the watcher's filter: it listens for task events, to a platform's users, or to its own profile |
116
+ | `watcher_not_running` | `mu daemon check` on a watcher a board module declares, and nothing holds its lease: it is declared but not started |
117
+ | `daemon_stopped` | The daemon crashed on start too often and stopped restarting. It tries again after an hour; fix what its log says, then `mu daemon reset` to try now |
118
+ | `allow_host_required` | `mu serve --host` beyond this machine needs `--allow-host`, or `MUSTER_ALLOW_HOSTS` |
119
+ | `wake_failed` | The watcher ran its command five times and it failed each time. Its log says why |
120
+ | `hook_failed` | `mu daemon check` sent a signed ping to an outgoing webhook, and nothing answered or the receiver refused it. `data.status` is the HTTP status, or null |
121
+
122
+ ## The board itself
123
+
124
+ | Reason | Means |
125
+ | --- | --- |
126
+ | `invalid_base` | A `serve.base` given to `board()` isn't a path like `/api/board`: it starts with `/` and doesn't end with one |
127
+ | `invalid_board` | Not a board name |
128
+ | `no_store` | The board's file couldn't be opened |
129
+ | `no_wal` | The filesystem can't keep a write-ahead log: use a local disk |
130
+ | `store_corrupt` | The file can't be read. A copy was set aside |
131
+ | `store_too_new` | A newer muster made it |
132
+ | `sqlite_too_old` | This Node embeds a SQLite too old to trust |
133
+ | `busy` | Other writers held the board too long: run it again |
134
+ | `exists` | A backup or a download won't write over a file |
135
+ | `missing_path` | A command needs a path |
136
+ | `no_skills` | This install doesn't carry the skills |
137
+ | `invalid_config` | A variable a module's hook names with `env()` isn't set or is too short, or a watcher or hook in a board module is named like a workflow in `workflows.json`. The message says what |
138
+ | `config_retired` | A `watchers.json`, `sync.json` or `hooks.json` is left in `~/.config/muster/` from before board modules. None is read: `mu daemon run` (which exits 0) and `mu serve` refuse to start until it is moved into a board module and deleted. The hint shows a module that does what it did; [Porting](./07-porting.md) has each field |
139
+ | `missing_env` | `daemon install --env` named a variable that is not set |
140
+ | `invalid_env` | `env()` was given something that isn't an environment variable's name |
141
+ | `invalid_sync` | A sync given to `board({ sync })` is wrong: a key that isn't a sync name, a value that isn't `github()`, `linear()` or `slack()`, a missing `secret`, a bad `filter` or `filesPerDayMB`, or a `sync` beside a `backend` |
142
+ | `invalid_hook` | A hook given to `board({ hooks })` is wrong: a bad name, a key it doesn't take, a URL that isn't https, a secret not named with `env()`, a filter that isn't one, or a name a watcher in the module has. The message names the hook |
143
+ | `invalid_watch` | A watcher given to `board({ watch })` is wrong: a bad name, a key it doesn't take, a filter that isn't one. The message names the watcher |
144
+ | `watch_aborted` | A watcher's run wrote after its `timeout`, or after it was aborted. Its writes are refused, and the try counted as failed |
145
+ | `watch_started` | This process already runs the watchers of that board from another `board()` handle with other watchers. Declare them all on one handle |
146
+ | `watch_remote` | Watchers were started on a board reached over HTTP. They run where the board's file is |
147
+ | `unhealthy` | `GET /health` on a board whose sync can't run, such as a secret named with `env()` that isn't set. Its owner's log says what |
148
+ | `sync_not_started` | A provider whose secrets are named with `env()` was used on its own. Give it to `board({ sync })`, which reads them when it starts |
149
+
150
+ ## Serving and running
151
+
152
+ | Reason | Means |
153
+ | --- | --- |
154
+ | `network_error` | The board at `MUSTER_URL` couldn't be reached |
155
+ | `bad_answer` | It answered with something that isn't a board's answer |
156
+ | `port_in_use` | The port is taken |
157
+ | `invalid_permission` | Not a permission |
158
+ | `body_too_large` | A request body over 36 MB, or a webhook body over 1 MB |
159
+ | `invalid_json` | A request body that isn't JSON |
160
+ | `method_not_allowed` | Board routes take POST |
161
+ | `unknown_agent` | No agent by that name |
162
+ | `unknown_runner` | No runner by that name |
163
+ | `runner_not_installed` | The runner's package isn't installed |
164
+ | `agent_token_missing` | A cloud run was started with no name for the agent and no token made for it |
165
+ | `agent_token_too_wide` | The agent's token isn't held to a profile and to named channels |
166
+ | `agent_token_unmarked` | An E2B run's token wasn't made for a sandbox (`mu token create --sandbox`), or the board that made it is older than this `mu` |
167
+ | `model_key_unscoped` | An E2B run has a model key and `MUSTER_E2B_KEY_ANY_PATH=1` isn't set: E2B adds the key to every request to its provider's host |
168
+ | `too_many_tokens` | The board already keeps as many live tokens as it will |
169
+ | `too_many_schedules` | A token held to channels has 20 schedules going already: cancel one |
170
+ | `invalid_token` | A token was asked for that isn't held to a profile and named channels, or reaches too far |
171
+ | `invalid_ttl` | A token's lifetime is too short, or over a day for one made from another machine |
172
+ | `not_a_terminal_command` | `mu mcp` was typed at a terminal; it is started by an agent |
173
+ | `invalid_repo` | A repository address that isn't HTTPS, or has a credential in it |
174
+ | `runner_too_old` | The runner's package can't close the setup's hosts before the agent starts, or a worker's run can't be waited on |
175
+ | `runner_not_configured` | The runner's settings are missing |
176
+ | `runner_start_failed` | A `--ready --loop` cloud worker couldn't run a task: the runner refused the start, the start's outcome is unknown, or three runs in a row failed to start or ended without saying how. The task's claim was given back |
177
+ | `runner_too_many_hosts` | An E2B sandbox reaches 10 hosts at most, and the run names more |
178
+ | `runner_secrets_full` | The E2B project holds as many secrets as its plan allows, so this run's credential couldn't be stored |
179
+ | `detach_unsupported` | `--detach` was asked of an E2B run, whose stored credentials only `mu run` removes |
180
+ | `timeout_too_long` | The run wouldn't fit in the longest an E2B sandbox lives: an hour, or `MUSTER_E2B_MAX_LIFETIME` |
181
+ | `runner_setup_failed` | A step that prepares the sandbox failed; the sandbox was removed |
182
+ | `push_unsupported` | `--push` was asked of a run that can't push: `--runner local`, `--detach`, `--ready` without `--loop`, or an SDK or runner Worker too old |
183
+ | `push_failed` | Pushing the agent's branch from the sandbox failed |
184
+ | `push_conflict` | The task's branch moved while the agent worked, or the agent's change doesn't build on where its checkout started: the branch was left as it was, and the tasks that wait on it are held |
185
+ | `pull_request_failed` | The branch is pushed, and GitHub didn't open the pull request |
186
+ | `github_app_not_installed` | The GitHub App isn't installed on the run's repository |
187
+ | `github_app_failed` | GitHub refused the App's request: its ID and key don't match, or it lacks a permission the run needs |
188
+ | `board_not_reachable` | A sandbox can't reach that board: it needs an HTTPS address |
189
+ | `invalid_session` | Not a session ID |
190
+ | `platform_refused` | A platform didn't do what was asked |
191
+ | `file_refused` | A synced file wasn't fetched: too big, not on the platform's own file host, or refused. Never shown to you: the message names the file instead |
192
+ | `joins_closed` | The board wasn't served with `--allow-joins`: ask its owner for a token |
193
+ | `insecure_url` | A token goes to a board, and a run's credentials to a runner Worker, over https, or plain http to this machine. `MUSTER_INSECURE_HTTP=1` lets your own token cross plain http on a network that is private some other way; a job's token for `mu token exchange` never does |
194
+ | `exchange_closed` | The board's owner named no workload in `oidc.json`, or the board is on this machine and needs no token |
195
+ | `issuer_unreachable` | The board couldn't fetch the keys of a workload's issuer. It asks again after a minute |
196
+ | `too_many_joins` | 20 requests to join are waiting already: try again in a few minutes |
197
+ | `unknown_join` | No request is waiting under that code, or the secret doesn't match. A request lasts 15 minutes |
198
+ | `join_answered` | That request was already approved or refused |
199
+ | `join_denied` | The board's owner refused the request |
200
+ | `invalid_code` | Not a join code, which looks like `K7Q4-M2XD` |
201
+ | `invalid_note` | A note to the owner is one line of plain text, at most 200 characters |
202
+ | `invalid_join` | `mu join` needs a board's URL, or `list`, `approve` or `deny` |
203
+ | `missing_profile` | Say the name to join under: `--as <name>` |
204
+
205
+ ## The command line
206
+
207
+ | Reason | Means |
208
+ | --- | --- |
209
+ | `unknown_command` | No such command, with `--help` too. The hint names the one that was likely meant |
210
+ | `unknown_flag` | No such flag for that command |
211
+ | `missing_value` | A flag needs a value |
212
+ | `module_not_found` | No board module at the path given with `--module` or `MUSTER_MODULE` |
213
+ | `module_failed` | The board module didn't load: Node's message, and what to change in the module. `mu daemon run` says so and exits 0, so a service manager leaves it stopped; `mu serve` serves the board without it |
214
+ | `module_not_a_board` | The board module exports no board: `export default board({ ... })`, or `export const team` |
215
+ | `module_two_copies` | The board module's board was made by a second copy of muster: give the project one |
216
+ | `module_version_skew` | The first `node_modules/muster` above the board module can't run a module: update it there, or remove it. The message names where it is |
217
+ | `module_and_board` | `--dir`, `--board` or `--url` beside a module named with `--module` or `MUSTER_MODULE`, which names its own board. The default `~/.config/muster/board.ts` is left out instead whenever a flag or `MUSTER_DIR`, `MUSTER_BOARD` or `MUSTER_URL` names the board |
218
+ | `module_and_profile` | `--as` or `MUSTER_PROFILE` beside a board module: the module says who its board and watchers write as |
219
+ | `module_and_no_module` | `--module` and `--no-module` together |
220
+ | `module_not_absolute` | `MUSTER_MODULE` isn't an absolute path |
221
+ | `module_broken_install` | The board module's project has a muster whose `mu` isn't there, or is outside its package: install it again, or remove it |
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: Conformance
3
+ description: The checks every backend passes, and how to run them.
4
+ ---
5
+
6
+ ## Run it
7
+
8
+ ```bash
9
+ mu conformance
10
+ mu conformance --dir ./scratch
11
+ ```
12
+
13
+ It runs the checks through whatever board the command points at, in a channel
14
+ of its own named `conformance/<something>`. It writes real messages and tasks:
15
+ point it at a scratch board. It exits 1 if any check fails.
16
+
17
+ ```text
18
+ pass a post is a thread root written by its caller
19
+ pass a reply to a reply lands on the root
20
+ ...
21
+ 19 of 19 passed
22
+ ```
23
+
24
+ ## What it checks
25
+
26
+ - A post is a thread root, written by its caller; a reply to a reply lands on
27
+ the root; a thread reads back in order.
28
+ - An idempotency key posts once and refuses a different request.
29
+ - `reply --after` refuses when something landed since.
30
+ - A conditional label has one winner; the board keeps its own labels.
31
+ - An edit raises the revision; a stale one is refused; a profile can't change
32
+ another's message.
33
+ - A cursor shows only what came after it; the feed resumes with no gap or
34
+ repeat.
35
+ - A task is ready, or waits for what it needs; one claim at a time; a write
36
+ without the claim's token changes nothing; completing readies what waited.
37
+ - A claim's secret is not in the feed.
38
+ - A block holds a task with a kind; unblock readies it.
39
+ - The last active tasks are listed on request, the latest last.
40
+ - What does not exist is not found.
41
+
42
+ ## From code
43
+
44
+ ```ts conformance.test.ts
45
+ import { board, conformance } from '@openmuster/muster'
46
+
47
+ const checks = await conformance(board({ memory: true }))
48
+ const failed = checks.filter((check) => !check.ok)
49
+ ```
50
+
51
+ Both of muster's backends pass it, and the larger test suite runs against both
52
+ as well. A backend of your own is right when it passes too.
@@ -0,0 +1,116 @@
1
+ ---
2
+ title: Porting from the JSON files
3
+ description: What watchers.json, sync.json and hooks.json become in a board module.
4
+ ---
5
+
6
+ ## What changed
7
+
8
+ Watchers, sync and outgoing webhooks are declared in a board module: a
9
+ TypeScript file that exports `board({ watch, sync, hooks })`. The three JSON
10
+ files in `~/.config/muster/` that held them before are no longer read.
11
+
12
+ A `watchers.json`, `sync.json` or `hooks.json` left there makes
13
+ `mu daemon run` and `mu serve` refuse to start, with `config_retired`, so
14
+ nothing it listed stops without a word. `mu daemon run` exits 0, so a service
15
+ manager leaves it stopped. `mu daemon status` names the file. Move what it
16
+ lists into a module, then delete it.
17
+
18
+ The module is `~/.config/muster/board.ts` when nothing else names one, or
19
+ the file `--module` or `MUSTER_MODULE` names. `workflows.json` and
20
+ `oidc.json` stay where they are, and are read as before.
21
+
22
+ Secrets were named `"env:NAME"`; in a module they are `env('NAME')`, and the
23
+ board reads them when it starts. `mu daemon install --env NAME` carries them
24
+ into the service as before.
25
+
26
+ ## watchers.json
27
+
28
+ ```ts board.ts
29
+ import { board, command } from '@openmuster/muster'
30
+
31
+ export default board({
32
+ watch: {
33
+ lead: {
34
+ tail: { channel: 'work/' },
35
+ as: 'lead',
36
+ run: command(({ event }) => ['/srv/wake.sh', String(event.thread)]),
37
+ },
38
+ },
39
+ })
40
+ ```
41
+
42
+ | `watchers.json` | Board module |
43
+ | --- | --- |
44
+ | `{ "watchers": [ ... ] }`, or a bare array | `board({ watch: { ... } })`, an object by name |
45
+ | `"name": "lead"` | The key: `lead: { ... }` |
46
+ | `"tail": { ... }` | `tail: { ... }`, the same filter, checked when `board()` is called. It also takes `root: true` |
47
+ | `"run": ["/srv/wake.sh", "{thread}"]` | `run: command(({ event }) => ['/srv/wake.sh', String(event.thread)])` |
48
+ | `{channel}`, `{seq}`, `{type}` in `run` | `event.channel ?? ''`, `String(event.seq)`, `event.type` |
49
+ | `"gate": ["/srv/gate.sh"]` | `command(..., { gate: ['/srv/gate.sh'] })`, a list or a function of the event |
50
+ | `"env": ["ANTHROPIC_API_KEY"]` | `command(..., { env: ['ANTHROPIC_API_KEY'] })` |
51
+ | `"as": "lead"` | `as: 'lead'` |
52
+ | `"every": 30` | `coalesce: '30s'`, to gather a thread's events into one run. Left out, each event is its own run, within a second |
53
+ | none | `timeout: '60s'`, the most one run may take. Then it is stopped and counted as a failed try |
54
+ | none | A function: `run: async ({ event, board }) => { ... }`, your own code in the host's process |
55
+
56
+ What a woken command gets is the same: `MUSTER_THREAD`, `MUSTER_CHANNEL`,
57
+ `MUSTER_EVENT`, `MUSTER_EVENT_TYPE` and `MUSTER_PROFILE`, now with
58
+ `MUSTER_WATCHER` and `MUSTER_ATTEMPT`, in a clean environment. What differs:
59
+
60
+ - **Each thread on its own.** A failed event holds back only its thread's
61
+ later events; other threads go on. It is tried 5 times, 10 seconds apart
62
+ and doubling, then noted on its thread as before.
63
+ - **Each watcher in a loop of its own,** under its own lease `watch:<name>`,
64
+ where the JSON watchers ran one after another in the daemon's tick. A slow
65
+ one holds up no other, and any host can run it: `mu daemon run`,
66
+ `mu serve`, or `team.start()` in your own process.
67
+ - **Its place carries over.** A watcher keeps its cursor, `watch:<name>`,
68
+ under the same name, so a ported watcher goes on from where the JSON one
69
+ stopped.
70
+
71
+ ## sync.json
72
+
73
+ ```ts board.ts
74
+ import { board, env, github } from '@openmuster/muster'
75
+
76
+ export default board({
77
+ sync: {
78
+ gh: github({ secret: env('GITHUB_WEBHOOK_SECRET'), repos: { 'acme/web': 'web' } }),
79
+ },
80
+ })
81
+ ```
82
+
83
+ | `sync.json` | Board module |
84
+ | --- | --- |
85
+ | `"gh": { "type": "github", ... }` | `sync: { gh: github({ ... }) }`, and `linear()` or `slack()` for the others |
86
+ | `"secret": "env:NAME"` | `secret: env('NAME')` |
87
+ | `"token": "env:NAME"` | `token: env('NAME')`. Unset, it is refused; in `sync.json` it was left out |
88
+ | `"bot"`, `"repos"`, `"teams"`, `"channels"` | The same, as they are |
89
+ | `"filter": ["/path/cmd"]` | `filter: ['/path/cmd']`, or a function `(text) => string \| null` |
90
+ | `"filesPerDayMB": 100` | `filesPerDayMB: 100` |
91
+
92
+ Its webhook URL, `/api/board/webhooks/<name>`, is the same. See
93
+ [Sync](../02-sync/01-overview.md#in-a-board-module).
94
+
95
+ ## hooks.json
96
+
97
+ ```ts board.ts
98
+ import { board, env } from '@openmuster/muster'
99
+
100
+ export default board({
101
+ hooks: [{ name: 'audit', url: 'https://hooks.example.com/in', secret: env('AUDIT_SECRET'), tail: { channel: 'work/' } }],
102
+ })
103
+ ```
104
+
105
+ | `hooks.json` | Board module |
106
+ | --- | --- |
107
+ | `{ "hooks": [ ... ] }`, or a bare array | `board({ hooks: [ ... ] })` |
108
+ | `"name": "phone"` | `name: 'phone'` |
109
+ | `"url": "https://..."` | `url: 'https://...'` |
110
+ | `"secret": "env:MUSTER_HOOK_PHONE"` | `secret: env('MUSTER_HOOK_PHONE')` |
111
+ | `"tail": { ... }` | `tail: { ... }`, checked like a watcher's |
112
+ | `"body": "event"` | `body: 'event'` |
113
+
114
+ Deliveries, signatures and tries are the same, and a hook keeps its cursor,
115
+ `hook:<name>`, so a ported hook goes on from where it was. See
116
+ [Outgoing webhooks](../01-concepts/15-outgoing-webhooks.md).
package/docs/index.md ADDED
@@ -0,0 +1,103 @@
1
+ ---
2
+ title: muster
3
+ description: A work queue for coding agents, with the threads people read, in one SQLite file.
4
+ ---
5
+
6
+ ## What it is
7
+
8
+ A board is a queue of tasks that agents claim under a lease, and the threads
9
+ around them: channels, replies, labels and reactions. Agents use it with one
10
+ CLI, `mu`. People read the same
11
+ threads, in a terminal or in a browser. Nothing depends on a particular agent,
12
+ terminal, or vendor: anything that can run a command can use a board.
13
+
14
+ ```bash
15
+ mu post general "kickoff: build the storage engine" --as lead
16
+ mu tasks create db/storage "Write-ahead log" --as lead
17
+ mu run --ready db/ --agent claude --as worker-1
18
+ mu inspect
19
+ ```
20
+
21
+ ## What a board gives you
22
+
23
+ - **Work that can't be taken twice.** A task is claimed under a lease, and
24
+ every write by its holder is checked against the claim.
25
+ - **One record.** Every fact is an event in one log. A reader with a cursor
26
+ misses nothing, and a restart loses nothing.
27
+ - **Waiting for an answer.** `mu wait` blocks until something matches. It
28
+ checks the board's log, at most a second apart.
29
+ - **Things that happen while nobody types.** Schedules send messages later;
30
+ watchers wake an agent when something happens.
31
+ - **The outside world.** GitHub, Linear and Slack threads sync in and out.
32
+ All three have been run against the live services.
33
+ - **Agents started for you.** `mu run` starts Claude Code, Codex, or any
34
+ command on a task, here or, experimentally, in a cloud sandbox.
35
+
36
+ ## Where to start
37
+
38
+ - [Quickstart](./01-quickstart.md): a board on this machine in a minute.
39
+ - [Concepts](./01-concepts/01-overview.md): what a board is made of.
40
+ - [Give it to your coding agents](./03-guides/01-coding-agents.md).
41
+ - [Run a swarm](./03-guides/02-swarm.md): several agents on one queue.
42
+
43
+ ## Concepts
44
+
45
+ - [Overview: the shape of a board](./01-concepts/01-overview.md)
46
+ - [Boards and backends](./01-concepts/02-boards.md)
47
+ - [Channels](./01-concepts/03-channels.md)
48
+ - [Threads and messages](./01-concepts/04-threads.md)
49
+ - [Labels](./01-concepts/05-labels.md)
50
+ - [Actors](./01-concepts/06-actors.md)
51
+ - [Events and waiting](./01-concepts/07-events.md)
52
+ - [Tasks](./01-concepts/08-tasks.md)
53
+ - [Watchers and the daemon](./01-concepts/09-watchers.md)
54
+ - [Schedules](./01-concepts/10-schedules.md)
55
+ - [Access: trust modes, tokens, private channels](./01-concepts/11-access.md)
56
+ - [Files and typed data](./01-concepts/12-files-and-data.md)
57
+ - [Budgets](./01-concepts/13-budgets.md)
58
+ - [Runners](./01-concepts/14-runners.md)
59
+ - [Outgoing webhooks](./01-concepts/15-outgoing-webhooks.md)
60
+ - [Workflows](./01-concepts/16-workflows.md)
61
+ - [The board module and hosts](./01-concepts/17-board-module.md)
62
+
63
+ ## Sync
64
+
65
+ - [Overview](./02-sync/01-overview.md)
66
+ - [GitHub](./02-sync/02-github.md)
67
+ - [Linear](./02-sync/03-linear.md)
68
+ - [Slack](./02-sync/04-slack.md)
69
+ - [Notion](./02-sync/05-notion.md)
70
+
71
+ ## Guides
72
+
73
+ - [Coding agents](./03-guides/01-coding-agents.md)
74
+ - [A swarm](./03-guides/02-swarm.md)
75
+ - [A software factory](./03-guides/03-factory.md)
76
+ - [The inspector](./03-guides/04-inspector.md)
77
+ - [Running agents](./03-guides/05-running-agents.md)
78
+ - [Agents in cloud sandboxes](./03-guides/06-sandboxed-agents.md)
79
+ - [Build a UI](./03-guides/07-build-a-ui.md)
80
+ - [CI](./03-guides/08-ci.md)
81
+ - [Keep the daemon running](./03-guides/09-daemon.md)
82
+ - [Two agents: one builds, one reviews](./03-guides/10-two-agents.md)
83
+ - [A person in the loop](./03-guides/11-person-in-the-loop.md)
84
+ - [Running unattended](./03-guides/12-unattended.md)
85
+ - [With your terminal: tmux, Herdr, Rex](./03-guides/13-terminals.md)
86
+ - [With no cloud at all](./03-guides/14-no-cloud.md)
87
+ - [Several repositories, several boards](./03-guides/15-several-boards.md)
88
+ - [Work that isn't code](./03-guides/16-non-code.md)
89
+ - [An agent with no shell: MCP](./03-guides/17-mcp.md)
90
+ - [A board on a server](./03-guides/18-a-board-on-a-server.md)
91
+ - [A card queue](./03-guides/19-a-card-queue.md)
92
+ - [A feedback loop](./03-guides/20-a-feedback-loop.md)
93
+ - [Running the feedback loop](./03-guides/21-running-the-loop.md)
94
+
95
+ ## Reference
96
+
97
+ - [CLI](./04-reference/01-cli.md)
98
+ - [The handle](./04-reference/02-handle.md)
99
+ - [HTTP](./04-reference/03-http.md)
100
+ - [Events](./04-reference/04-events.md)
101
+ - [Errors](./04-reference/05-errors.md)
102
+ - [Conformance](./04-reference/06-conformance.md)
103
+ - [Porting from the JSON files](./04-reference/07-porting.md)
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@openmuster/muster",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.3.1-alpha.2",
4
+ "description": "A local-first work queue for coding agents, with the threads people read: leased tasks, one log, wait and tail, schedules and watchers.",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/openmuster/muster.git",
9
+ "directory": "packages/muster"
10
+ },
11
+ "homepage": "https://github.com/openmuster/muster#readme",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "type": "module",
16
+ "engines": {
17
+ "node": "^22.22.3 || >=24.15"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "docs",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "musterModule": 1,
26
+ "bin": {
27
+ "muster": "./dist/cli.js",
28
+ "mu": "./dist/cli.js"
29
+ },
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^24.0.0",
39
+ "@types/react": "^19.3.0",
40
+ "@types/react-dom": "^19.3.0",
41
+ "lucide-react": "^1.77.0",
42
+ "playwright": "^1.65.1",
43
+ "react": "^19.3.1",
44
+ "react-dom": "^19.3.1",
45
+ "tsdown": "^0.15.0",
46
+ "typescript": "^5.9.0",
47
+ "vitest": "^4.1.12"
48
+ },
49
+ "scripts": {
50
+ "build": "tsdown && node scripts/copy-skills.mjs",
51
+ "typecheck": "tsc --noEmit -p tsconfig.json",
52
+ "test:browser": "vitest run -c vitest.browser.config.ts",
53
+ "test": "vitest run && MUSTER_BACKEND=http vitest run test/messages.test.ts test/reading.test.ts test/tasks.test.ts test/daemon.test.ts test/blocks.test.ts test/hooks.test.ts test/inbox.test.ts -t '^(messages|reading|tasks|schedules|typed blocks|outgoing webhooks|events for one profile) '"
54
+ }
6
55
  }