@openmuster/muster 0.3.1-alpha.5 → 0.3.1-alpha.7

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 (33) hide show
  1. package/README.md +2 -2
  2. package/dist/{args-CaFBa2IP.js → args-C_XaUVTS.js} +456 -65
  3. package/dist/cli.js +3 -3
  4. package/dist/index.d.ts +231 -85
  5. package/dist/index.js +156 -10
  6. package/dist/main-C-3gchLr.js +6 -0
  7. package/dist/{main-BeEB08iI.js → main-D8R2IP1C.js} +1080 -119
  8. package/dist/mcp-uFonN-GE.js +6 -0
  9. package/dist/{module-BX2IjSiv.js → module-D6Kgl3Do.js} +2 -2
  10. package/dist/{module-D9KdbEpS.js → module-DkA_1NkG.js} +1 -1
  11. package/dist/skills/loop-card/SKILL.md +22 -3
  12. package/dist/{steps-FNDWY1P_.js → steps-DVxqtI61.js} +405 -9
  13. package/docs/01-concepts/06-actors.md +3 -1
  14. package/docs/01-concepts/08-tasks.md +3 -0
  15. package/docs/01-concepts/10-schedules.md +9 -1
  16. package/docs/01-concepts/11-access.md +86 -2
  17. package/docs/01-concepts/12-files-and-data.md +139 -6
  18. package/docs/01-concepts/16-workflows.md +20 -0
  19. package/docs/01-concepts/17-board-module.md +3 -1
  20. package/docs/01-quickstart.md +1 -1
  21. package/docs/02-sync/04-slack.md +5 -0
  22. package/docs/03-guides/06-sandboxed-agents.md +47 -0
  23. package/docs/03-guides/17-mcp.md +44 -7
  24. package/docs/03-guides/20-a-feedback-loop.md +114 -1
  25. package/docs/03-guides/22-building-from-linear.md +19 -6
  26. package/docs/04-reference/01-cli.md +10 -1
  27. package/docs/04-reference/02-handle.md +1 -0
  28. package/docs/04-reference/03-http.md +56 -5
  29. package/docs/04-reference/05-errors.md +8 -1
  30. package/docs/04-reference/06-conformance.md +17 -5
  31. package/package.json +2 -2
  32. package/dist/main-CLzQkYeG.js +0 -6
  33. package/dist/mcp-CAAZRJgv.js +0 -6
@@ -181,7 +181,9 @@ What the example has:
181
181
  - **A way for the agent to see its work:** a demo mode with sample data lets
182
182
  an agent build, test and screenshot in a sandbox with no credentials. The
183
183
  work agent takes the screenshots the spec asks for, and no others: a spec
184
- that asks for none gets none.
184
+ that asks for none gets none. To show them in the pull request too, and
185
+ have the review check them, see
186
+ [Screenshots in pull requests](./20-a-feedback-loop.md#screenshots-in-pull-requests).
185
187
 
186
188
  ## Plan a feature with an agent
187
189
 
@@ -217,10 +219,17 @@ What helps an agent finish an issue:
217
219
  - **Say how to check it.** The triage writes the spec as a title, what to
218
220
  change and why, and how to check it works. The closer the issue is to that,
219
221
  the less the triage has to guess.
220
- - **Order dependent issues yourself.** Every issue in Todo gets its own run,
221
- at once, each starting from the default branch. Move an issue that builds
222
- on another to Todo once the other's pull request is merged. Issues that
223
- touch different code can go together.
222
+ - **Mark what an issue depends on as "blocked by".** Every issue in Todo
223
+ gets its own run, each starting from the default branch, unless Linear
224
+ says another issue blocks it. Its card then waits, held `waiting-on`, and
225
+ says which issues it waits on. An issue the loop worked is done once its
226
+ pull request is merged: the newest pull request from its work's branch,
227
+ `mu/task-<id>`, merged into the repository's default branch, and none open
228
+ from that branch. The loop writes Done to Linear when the review approves,
229
+ before the merge, so it reads GitHub for these. Any other issue is done
230
+ once it is Done or Canceled in Linear
231
+ ([Wait for the issues a card depends on](./20-a-feedback-loop.md#wait-for-the-issues-a-card-depends-on)).
232
+ Issues that touch different code can go together.
224
233
  - **Cap the spend.** `mu budget cards 50` stops new work on cards once they
225
234
  have cost $50 in all.
226
235
  - **Linear's labels and fields are for your own filters.** Labels, the
@@ -244,7 +253,11 @@ Move the issue to Todo. On the issue you see, in order:
244
253
  `agent: true` is set.
245
254
  4. **The summary:** when the run ends, each step's result and the pull
246
255
  request's address. The work pushes `mu/task-<id>` and opens the pull
247
- request, titled with the card's title.
256
+ request, titled with the card's title. Its body ends with `Refs ENG-123`,
257
+ the issue's key, so Linear's GitHub integration shows the pull request on
258
+ the issue. It says `Refs`, never `Fixes`: the loop sets the issue's status
259
+ itself, and a closing word would have Linear set it to Done on merge too.
260
+ An issue key the agent writes in its description links nothing.
248
261
  5. **The screenshots:** the round's, uploaded to Linear and linked from the
249
262
  comment. Experimental: files sent through an OAuth app haven't been
250
263
  checked against a live workspace.
@@ -46,6 +46,7 @@ tasks
46
46
  [--limit n] [--latest]
47
47
  tasks create <channel> <text> [--label k=v]... [--needs <id>]...
48
48
  [--for <profile>] [--claim] [--hold <kind> [--reason <text>]]
49
+ [--attach <path>]...
49
50
  tasks create <id> make a thread a task
50
51
  tasks create <channel> --file plan.json
51
52
  tasks claim <id> | --ready <channel> [--label k=v]... [--from <owner>]...
@@ -93,7 +94,7 @@ agents
93
94
 
94
95
  schedules and the daemon
95
96
  schedule <channel|id> <text> --in 30m | --at <time> | --every 30m
96
- [--times n] [--until <time>]
97
+ [--times n] [--until <time>] [--no-sync]
97
98
  schedule list | schedule cancel <id>
98
99
  daemon run send what is due; run watchers and hooks
99
100
  daemon check <watcher> write what it listens for; wait for a reply
@@ -172,3 +173,11 @@ mu help lists every command.
172
173
  ## Output
173
174
 
174
175
  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.
176
+
177
+ What a board says is printed as text, never as terminal controls. A message
178
+ can carry ESC and the other control characters, synced from a platform
179
+ or posted by anyone who can post, and they would clear your screen, move the
180
+ cursor or retitle the window. `mu` shows each one but tab and newline as its
181
+ picture (`␛` for ESC), a C1 control as `�`, and a Windows line end as a
182
+ newline. `--json` parses to what the board said: a control character JSON
183
+ would leave as it is, such as a C1 control, is written as its `\u` escape.
@@ -403,3 +403,4 @@ serves the board without it. Both say why, loudly.
403
403
  | `vercel`, `cloudflare`, `e2b`, `boardPolicy` | Running one in a cloud sandbox |
404
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 |
405
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` |
@@ -80,11 +80,62 @@ Authorization: Bearer mu1...
80
80
  ```
81
81
 
82
82
  MCP's HTTP transport, one JSON-RPC message per `POST`, answered in the
83
- response. A notification gets `202` and no body; `GET` gets `405`, since
84
- there is no stream. The token and the profile header work as on every other
85
- route, and a request with an `Origin` from a host the board doesn't answer
86
- for is refused. The tool is the one `mu mcp` offers: see
87
- [An agent with no shell](../03-guides/17-mcp.md).
83
+ response. A notification gets `202` and no body; `GET` gets `405`. An answer
84
+ that streams is sent on its own `POST` as `text/event-stream`, one message
85
+ per `data:` frame, with the final response last. The token and the profile
86
+ header work as on every other route, and a request with an `Origin` from a
87
+ host the board doesn't answer for is refused. The tool is the one `mu mcp`
88
+ offers: see [An agent with no shell](../03-guides/17-mcp.md).
89
+
90
+ Closing the connection cancels the request: the command stops, and a claim
91
+ that hadn't taken a task yet takes nothing.
92
+
93
+ ### Protocol revisions
94
+
95
+ Both `mu mcp` and the route speak revision 2026-07-28 and the earlier
96
+ 2025-11-25, 2025-06-18 and 2025-03-26:
97
+
98
+ - **2026-07-28:** no `initialize`. Every request carries
99
+ `io.modelcontextprotocol/protocolVersion` and
100
+ `io.modelcontextprotocol/clientCapabilities` in `params._meta`, and
101
+ `server/discover` answers which revisions and extensions there are. Over
102
+ HTTP, the headers `MCP-Protocol-Version`, `Mcp-Method` and, where the
103
+ method has one, `Mcp-Name` repeat the body: the tool name for
104
+ `tools/call`, the event name for `events/*`, the task ID for `tasks/*`.
105
+ - **Earlier revisions:** a request with no version in `_meta` is answered as
106
+ before, after `initialize`, with neither extension.
107
+
108
+ ### Events and tasks
109
+
110
+ These methods are offered to 2026-07-28 clients only:
111
+
112
+ | Method | What it does |
113
+ | --- | --- |
114
+ | `events/list` | Names `board.event`, `message.posted` and `task.changed`, each with the filters `mu tail` takes as its `inputSchema` |
115
+ | `events/poll` | What matched after a cursor: at most `maxEvents` (100, up to 200), with `hasMore`. A `null` cursor starts from now |
116
+ | `events/stream` | `notifications/events/active`, then each event as it is written, and a heartbeat every `heartbeatMs` (30s, within 5s and 60s) while quiet |
117
+ | `tasks/get` | A task's status, and its tool result once completed |
118
+ | `tasks/cancel` | Stops a task. A finished one nobody read gives back what it claimed |
119
+ | `tasks/update` | Accepted; these tasks never ask for input |
120
+ | `subscriptions/listen` | With `notifications.taskIds`: acknowledged, then `notifications/tasks` for each change, ending once every task it follows has finished |
121
+
122
+ A tool call that waits answers with `resultType: "task"` when the request
123
+ declares `io.modelcontextprotocol/tasks` in its capabilities. A token runs at
124
+ most 16 tasks at once, whatever profile each names; past that, a call waits
125
+ inside itself as it would without the extension. A token holds at most 8
126
+ streams. An event's
127
+ `eventId` and cursor are its place in the board's log. A cursor the board
128
+ never gave starts again from now, with `truncated: true`.
129
+
130
+ | Code | When |
131
+ | --- | --- |
132
+ | `-32020` | A header disagrees with the body, or one the method needs is missing |
133
+ | `-32021` | A `tasks/*` request from a client that doesn't declare the tasks extension |
134
+ | `-32022` | A revision the server doesn't speak; `data.supported` lists those it does |
135
+ | `-32023` | An event name `events/list` doesn't give |
136
+ | `-32024` | The token may not read what the subscription asks for, or was revoked: a stream ends with `notifications/events/terminated` |
137
+ | `-32025` | A ninth stream for one token |
138
+ | `-32602` | A malformed request, an argument an event doesn't take, or a task ID that names none of the caller's |
88
139
 
89
140
  A request body is at most 36 MB, the room one file needs. A webhook's body,
90
141
  which is read before anything can say who sent it, is at most 1 MB.
@@ -101,8 +101,12 @@ claimed answers `task_ready`, with the claim to run first.
101
101
  | `too_many_attachments` | Over 10 files on a message |
102
102
  | `file_too_large` | A file over 25 MB |
103
103
  | `file_allowance` | A narrowed token has stored its day's allowance of files |
104
- | `unknown_file` | A file the board doesn't have: attach it first |
104
+ | `unknown_file` | A file the board doesn't have, or one this token may not attach: attach it with `--attach` |
105
105
  | `invalid_file` | A file needs a name, and its name and type are at most 255 characters each |
106
+ | `files_elsewhere` | The board keeps its files in a store this process wasn't given, or in another: use the server that has it |
107
+ | `files_unreachable` | The board's file store couldn't be reached. Try again |
108
+ | `file_corrupt` | The file store gave back bytes that aren't the file |
109
+ | `invalid_files` | `s3Files()` was given a bucket, prefix or endpoint that isn't one, or plain http to another machine |
106
110
  | `no_such_file` | No file at that path |
107
111
  | `no_files` | That message carries none |
108
112
  | `unknown_schema` | A block names a schema nobody registered |
@@ -185,8 +189,11 @@ claimed answers `task_ready`, with the claim to run first.
185
189
  | `push_failed` | Pushing the agent's branch from the sandbox failed |
186
190
  | `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 |
187
191
  | `pull_request_failed` | The branch is pushed, and GitHub didn't open the pull request |
192
+ | `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 |
188
193
  | `github_app_not_installed` | The GitHub App isn't installed on the run's repository |
189
194
  | `github_app_failed` | GitHub refused the App's request: its ID and key don't match, or it lacks a permission the run needs |
195
+ | `github_app_missing` | `pullRequests` was given no token, and there is no GitHub App in the environment to ask one of |
196
+ | `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 |
190
197
  | `board_not_reachable` | A sandbox can't reach that board: it needs an HTTPS address |
191
198
  | `invalid_session` | Not a session ID |
192
199
  | `platform_refused` | A platform didn't do what was asked |
@@ -11,14 +11,16 @@ mu conformance --dir ./scratch
11
11
  ```
12
12
 
13
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.
14
+ of its own named `conformance/<something>`. It writes real messages, tasks and
15
+ a file: point it at a scratch board. It cancels the schedule it makes, and
16
+ leaves the schema `conformance@1` registered, because a schema version is never
17
+ removed. It exits 1 if any check fails.
16
18
 
17
19
  ```text
18
20
  pass a post is a thread root written by its caller
19
21
  pass a reply to a reply lands on the root
20
22
  ...
21
- 21 of 21 passed
23
+ 29 of 29 passed
22
24
  ```
23
25
 
24
26
  ## What it checks
@@ -32,6 +34,14 @@ pass a reply to a reply lands on the root
32
34
  another's message.
33
35
  - A cursor shows only what came after it; the feed resumes with no gap or
34
36
  repeat.
37
+ - A channel's threads page back by `older`, each thread once; the channel is
38
+ listed under its parent.
39
+ - Search finds a message by a word in it, in any case, within a channel; a
40
+ delete leaves a tombstone that search no longer finds.
41
+ - A file reads back as it was stored, only through the message that carries
42
+ it.
43
+ - A schedule is listed until it is canceled.
44
+ - A schema version is registered once and never changes.
35
45
  - A task is ready, or waits for what it needs; one claim at a time; a write
36
46
  without the claim's token changes nothing; completing readies what waited.
37
47
  - A claim's secret is not in the feed.
@@ -39,6 +49,7 @@ pass a reply to a reply lands on the root
39
49
  - A task made held is blocked from the start, and no claim takes it.
40
50
  - A feed keeps or leaves out blocks by their kind.
41
51
  - The last active tasks are listed on request, the latest last.
52
+ - A file is never named as a dotfile, on its own or on a message.
42
53
  - What does not exist is not found.
43
54
 
44
55
  ## From code
@@ -50,5 +61,6 @@ const checks = await conformance(board({ memory: true }))
50
61
  const failed = checks.filter((check) => !check.ok)
51
62
  ```
52
63
 
53
- Both of muster's backends pass it, and the larger test suite runs against both
54
- as well. A backend of your own is right when it passes too.
64
+ Both of muster's backends pass it: `pnpm test` runs it, with the larger test
65
+ suite, against a board on a file and against the same board behind
66
+ `mu serve`. A backend of your own is right when it passes too.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmuster/muster",
3
- "version": "0.3.1-alpha.5",
3
+ "version": "0.3.1-alpha.7",
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": {
@@ -50,6 +50,6 @@
50
50
  "build": "tsdown && node scripts/copy-skills.mjs",
51
51
  "typecheck": "tsc --noEmit -p tsconfig.json",
52
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) '"
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 test/conformance.test.ts -t '^(messages|reading|tasks|schedules|typed blocks|outgoing webhooks|events for one profile|conformance) '"
54
54
  }
55
55
  }
@@ -1,6 +0,0 @@
1
- import { D as VERSION } from "./args-CaFBa2IP.js";
2
- import "./steps-FNDWY1P_.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-BeEB08iI.js";
4
- import "./module-D9KdbEpS.js";
5
-
6
- export { SPECS, VERSION, agentPrompt, agentToken, attend, main, meantCommand, repoUrl };
@@ -1,6 +0,0 @@
1
- import "./args-CaFBa2IP.js";
2
- import "./steps-FNDWY1P_.js";
3
- import { c as answer, l as mcp, u as refusal } from "./main-BeEB08iI.js";
4
- import "./module-D9KdbEpS.js";
5
-
6
- export { answer, mcp, refusal };