@openmuster/muster 0.3.1-alpha.4 → 0.3.1-alpha.6

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 (58) hide show
  1. package/README.md +11 -7
  2. package/dist/{args-9ZZDcPxa.js → args-CaFBa2IP.js} +305 -23
  3. package/dist/cli.js +3 -3
  4. package/dist/index.d.ts +98 -19
  5. package/dist/index.js +107 -42
  6. package/dist/inspect/app.js +49 -26
  7. package/dist/{main-Doit2DDY.js → main-3kE64MlN.js} +195 -12
  8. package/dist/main-o4m_lGDG.js +6 -0
  9. package/dist/mcp-D6Xt2ixk.js +6 -0
  10. package/dist/{module-DjDMSEKu.js → module-BX2IjSiv.js} +2 -2
  11. package/dist/{module-D8qcE3e7.js → module-D9KdbEpS.js} +1 -1
  12. package/dist/skills/board/SKILL.md +5 -0
  13. package/dist/skills/loop-card/SKILL.md +22 -3
  14. package/dist/{steps-BUPRIOe3.js → steps-cnWo2Wvx.js} +299 -12
  15. package/docs/01-concepts/09-watchers.md +4 -32
  16. package/docs/01-concepts/10-schedules.md +1 -1
  17. package/docs/01-concepts/11-access.md +19 -3
  18. package/docs/01-concepts/13-budgets.md +66 -3
  19. package/docs/01-concepts/15-outgoing-webhooks.md +6 -19
  20. package/docs/01-concepts/16-workflows.md +42 -2
  21. package/docs/01-quickstart.md +74 -45
  22. package/docs/02-sync/01-overview.md +34 -2
  23. package/docs/02-sync/02-github.md +40 -19
  24. package/docs/02-sync/03-linear.md +103 -85
  25. package/docs/02-sync/04-slack.md +116 -111
  26. package/docs/02-sync/05-notion.md +46 -25
  27. package/docs/03-guides/01-coding-agents.md +51 -33
  28. package/docs/03-guides/02-swarm.md +30 -15
  29. package/docs/03-guides/03-factory.md +193 -80
  30. package/docs/03-guides/04-inspector.md +73 -42
  31. package/docs/03-guides/05-running-agents.md +62 -35
  32. package/docs/03-guides/06-sandboxed-agents.md +535 -305
  33. package/docs/03-guides/07-build-a-ui.md +86 -31
  34. package/docs/03-guides/08-ci.md +59 -36
  35. package/docs/03-guides/09-daemon.md +121 -53
  36. package/docs/03-guides/10-two-agents.md +31 -22
  37. package/docs/03-guides/11-person-in-the-loop.md +47 -34
  38. package/docs/03-guides/12-unattended.md +46 -27
  39. package/docs/03-guides/13-terminals.md +51 -39
  40. package/docs/03-guides/14-no-cloud.md +31 -19
  41. package/docs/03-guides/15-several-boards.md +61 -27
  42. package/docs/03-guides/16-non-code.md +29 -18
  43. package/docs/03-guides/17-mcp.md +37 -30
  44. package/docs/03-guides/18-a-board-on-a-server.md +66 -43
  45. package/docs/03-guides/19-a-card-queue.md +210 -121
  46. package/docs/03-guides/20-a-feedback-loop.md +412 -135
  47. package/docs/03-guides/21-running-the-loop.md +94 -64
  48. package/docs/03-guides/22-building-from-linear.md +100 -63
  49. package/docs/04-reference/01-cli.md +7 -0
  50. package/docs/04-reference/02-handle.md +11 -15
  51. package/docs/04-reference/03-http.md +1 -1
  52. package/docs/04-reference/04-events.md +2 -1
  53. package/docs/04-reference/05-errors.md +6 -0
  54. package/docs/04-reference/08-files.md +49 -0
  55. package/docs/index.md +1 -0
  56. package/package.json +1 -1
  57. package/dist/main-D5aX7Jaj.js +0 -6
  58. package/dist/mcp-Cm96TIb3.js +0 -6
@@ -201,7 +201,7 @@ returns the host already running. One on another handle with other watchers
201
201
  for a board this process already runs fails with `watch_started`, naming
202
202
  both: declare every watcher on one handle.
203
203
 
204
- `board({ hooks })` declares [outgoing webhooks](../01-concepts/15-outgoing-webhooks.md#in-a-board-module)
204
+ `board({ hooks })` declares [outgoing webhooks](../01-concepts/15-outgoing-webhooks.md#what-one-is)
205
205
  the same way, each secret named with `env('NAME')`: `start()` reads the
206
206
  secrets and sends them, under one lease, `hooks`.
207
207
 
@@ -279,20 +279,18 @@ writes a test makes, so the watchers have their place.
279
279
 
280
280
  ## Mounting it in a web app
281
281
 
282
- `team.fetch` takes a web `Request` and returns a `Response`: what `mu serve`
283
- serves for this board, from the same code. That covers the routes in
284
- [the HTTP reference](./03-http.md), the live feed, `health`, and webhooks for
285
- the handle's `sync`. Every request needs a token, and the key is the one
282
+ `team.fetch(request)` takes a web `Request` and returns a promise of a
283
+ `Response`: what `mu serve` serves for this board, from the same code. That
284
+ covers the routes in [the HTTP reference](./03-http.md), the live feed,
285
+ `health`, and webhooks for the handle's `sync`. Every request needs a token, and the key is the one
286
286
  `mu serve` uses, so a token from `mu token create` works on both and
287
287
  `mu token revoke` stops it on both. That key is kept in muster's config
288
288
  folder, so the app must run with the same `HOME` or `MUSTER_CONFIG` as the
289
289
  `mu` that made the token. There is no mode without a token.
290
290
 
291
- ```ts app/api/board/[...path]/route.ts
292
- import { team } from '@/lib/board'
293
-
294
- export const GET = team.fetch, POST = team.fetch
295
- ```
291
+ To mount it on a route in a Next.js app, see
292
+ [Serve the board from your web app](../03-guides/07-build-a-ui.md#serve-the-board-from-your-web-app).
293
+ It takes its options from `board({ serve })`:
296
294
 
297
295
  | Option | Default | What it does |
298
296
  | --- | --- | --- |
@@ -310,11 +308,7 @@ It opens nothing until its first request. It serves only a board on this
310
308
  machine: on a handle for a board at a URL, every request gets 403. MCP over
311
309
  HTTP, `tokenExchange` and requests to join are not served here: those stay
312
310
  with `mu serve`. It runs only in Node, never on an edge runtime, because the
313
- board is a SQLite file. With Next.js, keep `serverExternalPackages: ['@openmuster/muster']`
314
- in `next.config.ts`, so the process has one copy of muster. If the app has a
315
- `proxy.ts` (or `middleware.ts`), leave the board's routes out of its
316
- `matcher`: Next.js reads a body that passes through it into memory and cuts
317
- it at 10 MB, under the board's limit for a file.
311
+ board is a SQLite file.
318
312
 
319
313
  ### Running the watchers beside it
320
314
 
@@ -396,6 +390,7 @@ serves the board without it. Both say why, loudly.
396
390
  | `filePut`, `fileGet` | [Files](../01-concepts/12-files-and-data.md): data as base64 |
397
391
  | `schemaAdd`, `schemaList` | Typed blocks |
398
392
  | `budgetSet`, `budgets` | [Budgets](../01-concepts/13-budgets.md) |
393
+ | `taskReport` | [How work went](../01-concepts/13-budgets.md#see-how-work-went): `{ channel?, since }`, `since` an ISO time |
399
394
 
400
395
  ## Other exports
401
396
 
@@ -408,3 +403,4 @@ serves the board without it. Both say why, loudly.
408
403
  | `vercel`, `cloudflare`, `e2b`, `boardPolicy` | Running one in a cloud sandbox |
409
404
  | `github`, `linear`, `slack`, `notion`, `env`, `LINEAR_SCOPES` | Sync: the platforms, a secret named by `env('NAME')`, and the scopes a Linear app's token asks for unless you say |
410
405
  | `workflowResult(team, id, owner)` | A workflow step's result, for code that goes on from it: `{ workflow, step, request, thread, on, result }` only when the daemon made the task and the run's own worker completed it, as a result is checked before it is quoted. Null otherwise, whatever the task's labels say |
406
+ | `pullRequests({ repo, head, token?, env?, api?, fetch? })` | The pull requests opened from branch `head` on a github.com repository (its HTTPS address), newest first, each `{ number, state, merged, mergedAt, base, createdAt, url }`, and the repository's `defaultBranch`. Read-only. Without `token`, it reads with a token the GitHub App in `env` (`GITHUB_APP_ID`, and its key) makes for Pull requests: read on that repository alone. Refuses with `github_app_missing` or `github_read_failed` |
@@ -35,7 +35,7 @@ The routes are the handle's methods: `post`, `reply`, `edit`, `remove`,
35
35
  `label`, `react`, `createChannel`, `workflowRequest`, `readChannel`, `readThread`, `events`,
36
36
  `channels`, `search`, `actors`, `head`, `cursorGet`, `cursorSet`, the `task*`
37
37
  methods, the `schedule*` methods, `schemaAdd`, `schemaList`, `filePut`,
38
- `fileGet`, `budgetSet`, `budgets`. See [The handle](./02-handle.md) for what
38
+ `fileGet`, `budgetSet`, `budgets`, `taskReport`. See [The handle](./02-handle.md) for what
39
39
  each takes.
40
40
 
41
41
  `GET /api/board/whoami` says who the token is: `{ principal, profile, can }`.
@@ -58,7 +58,8 @@ A claim's token never appears in an event a reader gets.
58
58
  | `schedule.canceled` | `id` |
59
59
  | `schedule.skipped` | `id`, `slot`: a slot too late to send |
60
60
  | `sync.delivered` | `id`, `key`, `external`: a message reached a platform. `files`: the platform's IDs for the files sent with it, if any |
61
- | `sync.failed` | `id`, `key`, `error`: it didn't, after five tries |
61
+ | `sync.failed` | `id`, `key`, `error`: it didn't, after five tries or a day of the platform being down. `error` is a short code, such as `platform_422`, or `unconfirmed` when the platform may have it and there is no way to look |
62
+ | `sync.dropped` | `key`, `id`, `error`: an event from a platform given up before it was imported, on the thread it was about |
62
63
  | `schema.registered` | `name`, `version`, `schema` |
63
64
  | `budget.set` | `channel`, `usd` |
64
65
 
@@ -55,6 +55,7 @@ claimed answers `task_ready`, with the claim to run first.
55
55
  | `idempotency_mismatch` | That key was used for a different request |
56
56
  | `invalid_idempotency_key` | A key is 1 to 200 characters |
57
57
  | `invalid_cursor` | Not a cursor a read or a wait printed |
58
+ | `cursor_ahead` | `--after`, or a live feed's `Last-Event-ID`, is past the board's last event: most likely the board was restored from a backup since. `data.head` is where it is now |
58
59
  | `invalid_limit` | `--limit` is a whole number of at least 1 |
59
60
  | `invalid_id` | Not an ID |
60
61
  | `nothing_to_read` | No channel or message named |
@@ -88,6 +89,7 @@ claimed answers `task_ready`, with the claim to run first.
88
89
  | `plan_too_large` | Over 100 tasks |
89
90
  | `over_budget` | The channel's budget is spent. `data` has the amounts |
90
91
  | `invalid_budget` | A budget is more than 0 |
92
+ | `invalid_since` | `taskReport` takes `since` as an ISO time |
91
93
  | `missing_reason` | `tasks fail` needs a reason |
92
94
  | `missing_assignee` | `tasks assign` needs `--for` or `--pool` |
93
95
  | `missing_command` | `tasks run` needs a command after `--` |
@@ -183,12 +185,16 @@ claimed answers `task_ready`, with the claim to run first.
183
185
  | `push_failed` | Pushing the agent's branch from the sandbox failed |
184
186
  | `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
187
  | `pull_request_failed` | The branch is pushed, and GitHub didn't open the pull request |
188
+ | `comment_failed` | A later round's change is pushed, and GitHub didn't take the agent's description as a comment on the pull request. Never an error: `mu run` warns and replies on the task, and the run goes on |
186
189
  | `github_app_not_installed` | The GitHub App isn't installed on the run's repository |
187
190
  | `github_app_failed` | GitHub refused the App's request: its ID and key don't match, or it lacks a permission the run needs |
191
+ | `github_app_missing` | `pullRequests` was given no token, and there is no GitHub App in the environment to ask one of |
192
+ | `github_read_failed` | `pullRequests` couldn't read the repository's default branch or a branch's pull requests: the App lacks Pull requests: read, GitHub didn't answer, or there were more than 500 |
188
193
  | `board_not_reachable` | A sandbox can't reach that board: it needs an HTTPS address |
189
194
  | `invalid_session` | Not a session ID |
190
195
  | `platform_refused` | A platform didn't do what was asked |
191
196
  | `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 |
197
+ | `unconfirmed` | A message's send got no answer, and the platform has no way for the board to look whether it took it. Never shown to you: it is the `error` of a `sync.failed` event |
192
198
  | `joins_closed` | The board wasn't served with `--allow-joins`: ask its owner for a token |
193
199
  | `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
200
  | `exchange_closed` | The board's owner named no workload in `oidc.json`, or the board is on this machine and needs no token |
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: Files muster keeps
3
+ description: Every file and folder muster writes on your machine, what each holds, whether it is secret, and whether mu backup copies it. Read it before you back up, move or wipe a board.
4
+ ---
5
+
6
+ muster keeps two folders. Both are readable only by your OS user.
7
+
8
+ - **The board folder** is `~/.muster`, or the folder `--dir` or `MUSTER_DIR`
9
+ names. It holds the boards.
10
+ - **The config folder** is `~/.config/muster`, or `$XDG_CONFIG_HOME/muster`,
11
+ or the folder `MUSTER_CONFIG` names. It holds everything else.
12
+
13
+ ## The board folder
14
+
15
+ | Path | What it holds | Secret | `mu backup` copies it |
16
+ | --- | --- | --- | --- |
17
+ | `<name>.db` | The board: its log and the tables made from it, the tokens it made (as records, never the tokens), and sync bookkeeping | Yes: everything anyone wrote | Yes |
18
+ | `<name>.files/` | The files messages carry, each stored once by what it holds | Yes | Yes |
19
+ | `<name>.db-wal`, `<name>.db-shm` | SQLite's write-ahead log, part of the board while it is open | Yes | Yes, as part of the board |
20
+
21
+ ## The config folder
22
+
23
+ | Path | What it holds | Secret | `mu backup` copies it |
24
+ | --- | --- | --- | --- |
25
+ | `keys/` | Each board's signing key for tokens, and keys retired by `mu token rotate-key` | Yes: anyone with a key can make tokens the board accepts | No |
26
+ | `claims/` | The token for each task you hold, one file per board | Yes | No |
27
+ | `board.ts` | The default board module: watchers, sync and outgoing webhooks | No, if its secrets are named with `env()` | No |
28
+ | `workflows.json` | The workflows the daemon starts | No | No |
29
+ | `oidc.json` | The workloads a served board trusts, and what each gets | No | No |
30
+ | `daemon/` | The daemon's restart guard, per board | No | No |
31
+ | `logs/` | The daemon's logs, one per board | Can hold what commands printed | No |
32
+ | `runs/` | An agent run's log, kept 30 days | Can hold what the agent printed | No |
33
+ | `e2b-bases.json`, `vercel-bases.json` | The sandbox snapshots this machine made | No | No |
34
+ | `update-check.json` | When `MUSTER_UPDATE_CHECK=1` last asked for the latest version, and the answer | No | No |
35
+
36
+ `mu daemon install` also writes a service file outside both folders: on macOS
37
+ `~/Library/LaunchAgents/<label>.plist`.
38
+
39
+ ## Back up and move a board
40
+
41
+ `mu backup ./board.db` copies a board and its files while it runs. To move a
42
+ board to another machine with everything it needs, copy these too:
43
+
44
+ - `keys/`, or the tokens you gave out stop working there.
45
+ - `board.ts`, `workflows.json` and `oidc.json`, if you use them.
46
+
47
+ A restored board refuses tokens it made after the backup was taken, and a
48
+ reader whose place in the log is past the restored board's last event gets
49
+ `cursor_ahead`: see [errors](./05-errors.md).
package/docs/index.md CHANGED
@@ -137,3 +137,4 @@ You run several agents when there is more than one thing to do:
137
137
  - [Errors](./04-reference/05-errors.md)
138
138
  - [Conformance](./04-reference/06-conformance.md)
139
139
  - [Porting from the JSON files](./04-reference/07-porting.md)
140
+ - [Files muster keeps](./04-reference/08-files.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmuster/muster",
3
- "version": "0.3.1-alpha.4",
3
+ "version": "0.3.1-alpha.6",
4
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
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,6 +0,0 @@
1
- import { D as VERSION } from "./args-9ZZDcPxa.js";
2
- import "./steps-BUPRIOe3.js";
3
- import { a as main, i as attend, n as agentPrompt, o as meantCommand, r as agentToken, s as repoUrl, t as SPECS } from "./main-Doit2DDY.js";
4
- import "./module-D8qcE3e7.js";
5
-
6
- export { SPECS, VERSION, agentPrompt, agentToken, attend, main, meantCommand, repoUrl };
@@ -1,6 +0,0 @@
1
- import "./args-9ZZDcPxa.js";
2
- import "./steps-BUPRIOe3.js";
3
- import { c as answer, l as mcp, u as refusal } from "./main-Doit2DDY.js";
4
- import "./module-D8qcE3e7.js";
5
-
6
- export { answer, mcp, refusal };