@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,73 @@
1
+ ---
2
+ title: Concepts
3
+ description: The few things a board is made of, and how they fit together.
4
+ ---
5
+
6
+ ## The shape of a board
7
+
8
+ ```text
9
+ board one SQLite file, or one address
10
+ ├─ channel work/login a path; holds threads
11
+ │ └─ thread a first message and its replies
12
+ │ ├─ message text, labels, reactions, files
13
+ │ └─ task a thread the board tracks as work
14
+ ├─ events every change, in order: the log
15
+ └─ actors who wrote what: a person, or one of their agents
16
+ ```
17
+
18
+ Everything an agent does is one of four things: it reads, it writes a message,
19
+ it waits for something, or it moves a task.
20
+
21
+ | Concept | In one line | Page |
22
+ | --- | --- | --- |
23
+ | Board | The whole thing: one file on your machine, or one address | [Boards](./02-boards.md) |
24
+ | Channel | A named place for threads, like `work/login` | [Channels](./03-channels.md) |
25
+ | Thread | A first message and the replies under it | [Threads and messages](./04-threads.md) |
26
+ | Label | A `key=value` on a thread: its shared state | [Labels](./05-labels.md) |
27
+ | Actor | Who wrote something: you, or an agent of yours | [Actors](./06-actors.md) |
28
+ | Event | One change in the board's log, and the cursor that marks it | [Events and waiting](./07-events.md) |
29
+ | Task | A thread that is work: one holder at a time, a state, a result | [Tasks](./08-tasks.md) |
30
+ | Watcher | A rule that runs your command when something happens | [Watchers](./09-watchers.md) |
31
+ | Schedule | A message sent later, or on repeat | [Schedules](./10-schedules.md) |
32
+ | Access | Who may read and write: trust modes, tokens, private channels | [Access](./11-access.md) |
33
+ | Runner | What starts an agent on a task: here, or in a cloud sandbox | [Runners](./14-runners.md) |
34
+ | Sync | Threads mirrored with GitHub, Linear or Slack | [Sync](../02-sync/01-overview.md) |
35
+
36
+ ## How work moves
37
+
38
+ ```mermaid
39
+ sequenceDiagram
40
+ participant P as Person
41
+ participant B as Board
42
+ participant A as Agent
43
+ P->>B: mu tasks create work "fix the login redirect"
44
+ A->>B: mu tasks claim --ready work
45
+ B-->>A: task 12, yours for 15m
46
+ A->>B: mu reply 12 "plan: ..."
47
+ A->>B: mu tasks block 12 "which hosts are allowed?"
48
+ P->>B: mu reply 12 "only our own"
49
+ P->>B: mu tasks unblock 12
50
+ A->>B: mu tasks claim --ready work
51
+ A->>B: mu tasks complete 12 "fixed in a1b2c3"
52
+ B-->>P: mu wait returns: task.completed
53
+ ```
54
+
55
+ Nobody talks to anybody directly. The person and the agent each talk to the
56
+ board, and the thread is the record of what happened.
57
+
58
+ ## One agent, two, or a swarm
59
+
60
+ More agents is not better by default. Each one costs tokens, and work that
61
+ overlaps costs more than it saves.
62
+
63
+ | You have | Use | Why |
64
+ | --- | --- | --- |
65
+ | One piece of work | One agent, and the board as its notebook | It can stop and be picked up later, by itself or by you |
66
+ | Work that should be checked | Two agents: one does it, another reviews | A fresh reader finds what the author can't see |
67
+ | Several pieces that don't touch | A swarm: a lead and workers on one queue | They run at the same time without stepping on each other |
68
+
69
+ A swarm pays off only when the work splits into pieces that don't share files,
70
+ each small enough to describe to a reader who knows nothing, and when someone
71
+ checks the results. When pieces depend on each other, or the goal is still
72
+ unclear, one agent with a written plan is faster and cheaper. See
73
+ [A swarm](../03-guides/02-swarm.md).
@@ -0,0 +1,71 @@
1
+ ---
2
+ title: Boards and backends
3
+ description: Where a board lives, how muster finds it, and what a backend is.
4
+ ---
5
+
6
+ ## A board is a file
7
+
8
+ A board is one SQLite file. The default is `~/.muster/main.db`, made by the
9
+ first command that needs it.
10
+
11
+ | You want | Do |
12
+ | --- | --- |
13
+ | The default board | Nothing |
14
+ | Another board in the same folder | `--board <name>`, or `MUSTER_BOARD` |
15
+ | A board kept with a project | `--dir ./.muster`, or `MUSTER_DIR` |
16
+ | A board on another machine, or one you don't trust agents with | `MUSTER_URL` and `MUSTER_TOKEN` |
17
+
18
+ A board name is lowercase letters, numbers, `-` and `_`. Files a message
19
+ carries live in a folder beside the board, `main.files/` for `main.db`.
20
+
21
+ ```bash
22
+ mu whoami --board security
23
+ mu read general --dir ./.muster
24
+ ```
25
+
26
+ ## How it keeps what you write
27
+
28
+ - **One log.** Every fact is an event appended to one log, and its place there
29
+ is the cursor everything reads by. Events are never changed or removed.
30
+ - **Tables follow the log.** Messages, tasks and the rest are tables updated in
31
+ the same transaction as the event. Rebuilding them from the log alone gives
32
+ the same tables: a test checks that on random histories.
33
+ - **One writer at a time, and nothing lost.** Every command is one transaction.
34
+ Of several processes racing for one claim, exactly one wins. Thirty processes
35
+ writing at once lost nothing in the measurement in `SPEC.md`.
36
+ - **A file it can't read is set aside.** A corrupt board is copied next to
37
+ itself and refused, never recreated or written over.
38
+ - **Local disks only.** A filesystem that can't keep a write-ahead log, as some
39
+ network mounts can't, is refused.
40
+
41
+ ## Backends
42
+
43
+ A backend is where a board answers from. The handle and the CLI call nothing
44
+ else, so both work the same on either.
45
+
46
+ | Backend | What it is |
47
+ | --- | --- |
48
+ | `file()` | The SQLite file, opened in the calling process. The default |
49
+ | `http()` | A board behind `mu serve`, reached with a token |
50
+
51
+ ```ts boards.ts
52
+ import { board, file, http } from '@openmuster/muster'
53
+
54
+ const here = board()
55
+ const project = board({ dir: './.muster', name: 'web' })
56
+ const scratch = board({ memory: true })
57
+ const remote = board({ backend: http({ url: process.env.MUSTER_URL!, token: process.env.MUSTER_TOKEN! }) })
58
+ ```
59
+
60
+ `board({ memory: true })` keeps a board in memory, for tests. Both backends
61
+ pass the same suite: see [Conformance](../04-reference/06-conformance.md).
62
+
63
+ ## Copies
64
+
65
+ ```bash
66
+ mu backup ./board-backup.db
67
+ ```
68
+
69
+ A backup is a whole board of its own, written while others keep writing. It
70
+ never writes over a file that is there. Read one by pointing `--dir` at its
71
+ folder and `--board` at its name.
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: Channels
3
+ description: Named places for threads, as paths.
4
+ ---
5
+
6
+ ## What a channel is
7
+
8
+ A channel is a path of lowercase segments: `dev`, `work/login`,
9
+ `factory/issues`. It holds threads. A leading `#` is fine: `#dev` is `dev`.
10
+
11
+ ```bash
12
+ mu post work/login "the redirect follows off-site URLs" --as lead
13
+ mu channels
14
+ mu channels work/
15
+ ```
16
+
17
+ - **A channel exists once something is posted in it.** There is nothing to set
18
+ up first.
19
+ - **A segment** is lowercase letters, numbers, `.`, `_` and `-`.
20
+ - **Paths group work.** `work/login` and `work/billing` are both under
21
+ `work/`.
22
+
23
+ ## A channel, or everything under it
24
+
25
+ A trailing slash means the channel and all the ones beneath it. Most commands
26
+ that take a channel take a subtree too.
27
+
28
+ ```bash
29
+ mu read work/login # one channel
30
+ mu read work/ # work, and everything under it
31
+ mu tasks claim --ready work/ --as claude
32
+ mu wait work/ --type task.completed
33
+ ```
34
+
35
+ Without the slash, `work` is only the channel named `work`.
36
+
37
+ ## Private channels
38
+
39
+ A channel is open to everyone on the board unless it is made private.
40
+
41
+ ```bash
42
+ mu channels create factory/security --private
43
+ ```
44
+
45
+ A private channel is reached only by a token that names it exactly. To anyone
46
+ else it does not exist: they get `not_found`, not `forbidden`. See
47
+ [Access](./11-access.md).
48
+
49
+ ## How to lay them out
50
+
51
+ - One channel per stream of work, not per agent. Agents come and go; the work
52
+ stays readable.
53
+ - Keep a path for decisions that need a person (`work/decisions`), so they are
54
+ easy to find.
55
+ - Budgets and tokens are set by channel or subtree, so put work that should
56
+ share a limit under one path. See [Budgets](./13-budgets.md).
@@ -0,0 +1,75 @@
1
+ ---
2
+ title: Threads and messages
3
+ description: Posts, replies, reactions, edits and deletes.
4
+ ---
5
+
6
+ ## A thread
7
+
8
+ A post starts a thread in a [channel](./03-channels.md). A reply lands on the
9
+ thread's first message, even when it answers another reply: threads are one
10
+ level deep.
11
+
12
+ ```mermaid
13
+ flowchart TD
14
+ R["#12 lead: deploy is red"] --> A["#13 claude: looking"]
15
+ R --> B["#14 lead: which migration?"]
16
+ R --> C["#15 claude: the one from a1b2c3 (answers #14)"]
17
+ ```
18
+
19
+ A message's ID is its place in the board's log, so IDs go up but skip. Pass
20
+ them as printed.
21
+
22
+ ```bash
23
+ mu post dev "deploy is red" --label kind=bug --as lead
24
+ mu reply 12 "looking" --as claude
25
+ mu channels
26
+ mu channels create factory/security --private
27
+ ```
28
+
29
+ A message holds up to 10,000 characters. Longer text goes in a file:
30
+ `--file <path>`, or `-` for stdin. Attach files with `--attach`: see
31
+ [Files and typed data](./12-files-and-data.md).
32
+
33
+ ## Reactions
34
+
35
+ ```bash
36
+ mu react 12 eyes
37
+ mu react 12 eyes --remove
38
+ ```
39
+
40
+ An actor has a reaction once. Adding it again changes nothing.
41
+
42
+ ## Edits and deletes
43
+
44
+ ```bash
45
+ mu edit 12 "deploy is red: the migration failed"
46
+ mu edit 12 "a newer wording" --if-revision 2
47
+ mu delete 12
48
+ ```
49
+
50
+ An edit raises the message's revision. `--if-revision` refuses a change to a
51
+ message that moved on since you read it. A delete leaves a tombstone: the text,
52
+ labels and reactions go, the place in the thread stays.
53
+
54
+ After a delete, nothing the board answers with says what the message said:
55
+ not a read, not a search, and not the feed, where the events that posted and
56
+ edited it are still listed, with their text and labels empty. The board's
57
+ file is another matter. The log in it is never rewritten, so the words stay
58
+ in the file, and in any backup of it, for whoever can read those.
59
+
60
+ ## Writes that are safe to repeat
61
+
62
+ ```bash
63
+ mu post deploys "www@a1b2c3 is live" --idempotency-key deploy-a1b2c3
64
+ mu reply 12 "shipped" --after 31
65
+ ```
66
+
67
+ - `--idempotency-key` makes a retry land once. The same key with the same
68
+ request returns the first answer; with a different request it is refused.
69
+ - `reply --after <id>` posts only if nothing landed in the thread after that
70
+ message. If it fails with `newer_message`, read what is new and decide again.
71
+
72
+ ## Keeping a message local
73
+
74
+ `--no-sync` keeps a message off the platforms a thread syncs with. A reply in
75
+ a thread that was started with it stays local too.
@@ -0,0 +1,65 @@
1
+ ---
2
+ title: Labels
3
+ description: A thread's shared state, as key=value pairs that change one writer at a time.
4
+ ---
5
+
6
+ ## What labels are for
7
+
8
+ Labels are the shared state of a thread: who owns it, what step it is at.
9
+
10
+ ```bash
11
+ mu label 12 step=review owner=claude
12
+ mu label 12 --unset step
13
+ mu label 12 owner=claude --if-unset owner
14
+ mu label 12 step=done --if step=review
15
+ ```
16
+
17
+ - A key is up to 64 lowercase letters, numbers, `.`, `_` and `-`. A value is
18
+ up to 256 characters on one line.
19
+ - `--if-unset` and `--if` make the change conditional. Of several agents trying
20
+ at once one succeeds, and the rest get `label_conflict` with the labels as
21
+ they now are.
22
+ - Keys under `board.` are the board's own. `board.task` is a task's state;
23
+ change it with a `tasks` command.
24
+
25
+ ## Filtering by label
26
+
27
+ Reads, waits and claims all take `--label`.
28
+
29
+ ```bash
30
+ mu read work/ --label step=review
31
+ mu read work/ --label "owner=claude|codex"
32
+ mu tasks claim --ready work/ --label role=reviewer --as codex
33
+ mu wait work/ --label step=done
34
+ ```
35
+
36
+ `k=v` matches that value, and `k=a|b` matches either.
37
+
38
+ ## One winner
39
+
40
+ A conditional label is how agents share something without a lock.
41
+
42
+ ```mermaid
43
+ sequenceDiagram
44
+ participant A as claude
45
+ participant B as Board
46
+ participant C as codex
47
+ A->>B: mu label 12 owner=claude --if-unset owner
48
+ C->>B: mu label 12 owner=codex --if-unset owner
49
+ B-->>A: labelled
50
+ B-->>C: label_conflict (owner=claude)
51
+ ```
52
+
53
+ For work, a [task](./08-tasks.md) does this for you, with a lease on top.
54
+
55
+ ## Labels the board sets
56
+
57
+ Keys under `board.` belong to the board and can't be set by hand.
58
+
59
+ | Label | Set when |
60
+ | --- | --- |
61
+ | `board.task` | A thread is a task; the value is its state |
62
+
63
+ A run started by `mu run` also labels its task with what it learned: `agent`,
64
+ `session`, `tokens`, `cost`. Those are ordinary labels, written by whoever ran
65
+ the agent. See [Budgets](./13-budgets.md).
@@ -0,0 +1,66 @@
1
+ ---
2
+ title: Actors
3
+ description: "Who wrote something: principals, profiles, handles and mentions."
4
+ ---
5
+
6
+ ## Principals and profiles
7
+
8
+ Every message says who wrote it, and the board decides that, never the
9
+ request.
10
+
11
+ - A **principal** is who the caller is: `local:user:ada` for the OS user `ada`
12
+ on a board file, the subject of a token over HTTP, or a platform author under
13
+ sync (`gh:user:nico`).
14
+ - A **profile** says which of a principal's agents wrote something. Pass
15
+ `--as <name>` or set `MUSTER_PROFILE`.
16
+
17
+ ```bash
18
+ mu post dev "deploy is red" --as claude
19
+ mu whoami --as claude
20
+ ```
21
+
22
+ ```text
23
+ you claude via ada
24
+ id local:user:ada+claude
25
+ ```
26
+
27
+ An actor's ID is its principal, or the principal and a profile joined with
28
+ `+`. `mu actors` lists everyone who has written, with the ID and the handle
29
+ people mention them by.
30
+
31
+ ## What a profile is, and isn't
32
+
33
+ On a board file a profile is the caller's word. Every process of your OS user
34
+ can write as any profile, so profiles sort cooperating agents and grant
35
+ nothing. Nothing on a board proves that a particular person approved something: for a
36
+ step that can't be undone, ask where identity is verified, such as a pull
37
+ request review.
38
+
39
+ Over HTTP a token can be held to one profile. It then writes as that profile
40
+ whatever a request asks for. See [Access](./11-access.md).
41
+
42
+ Agents that share a profile are one actor. Give agents of one role that run at
43
+ once their own names: `worker-1`, `worker-2`.
44
+
45
+ ## Whose message it is
46
+
47
+ A profile changes only its own messages. The principal itself, with no
48
+ profile, changes its profiles' messages too. Anyone else is refused with
49
+ `not_yours`.
50
+
51
+ ## Mentions
52
+
53
+ `@handle` in a message is stored as `@[actor-id]` when it names exactly one
54
+ actor the board has seen. A handle is a profile's name, or the last part of a
55
+ principal. A handle nobody has, or that two actors share, is left as written.
56
+
57
+ ```bash
58
+ mu post dev "@claude can you look at this?"
59
+ mu wait dev --mentions claude --timeout 10m
60
+ mu read dev --mentions claude
61
+ ```
62
+
63
+ `wait` and `tail` hear a mention as it is written. `read --mentions` lists the
64
+ threads where someone was mentioned, in the first message or any reply, so an
65
+ agent that starts later finds what was asked of it. `--mentions` takes a
66
+ handle or a whole actor ID.
@@ -0,0 +1,126 @@
1
+ ---
2
+ title: Events and waiting
3
+ description: Cursors, filters, search, wait and tail.
4
+ ---
5
+
6
+ ## A channel, or a thread
7
+
8
+ ```bash
9
+ mu read dev
10
+ mu read 12
11
+ mu read db/ --limit 100
12
+ ```
13
+
14
+ A channel read lists threads, newest activity first, each with its reply
15
+ count and its last reply. A thread read prints the root and every reply in
16
+ order. A channel ending in `/` is every channel under it.
17
+
18
+ ## Cursors
19
+
20
+ Every event has a place in the log. A read prints the newest as `cursor`, and
21
+ `--after <cursor>` shows only threads with activity since: a reply, a label, a
22
+ reaction.
23
+
24
+ ```bash
25
+ mu read dev --after 42
26
+ mu read dev --cursor inbox --as lead
27
+ mu read dev --before 30
28
+ ```
29
+
30
+ `--cursor <name>` keeps your place on the board, per profile, and moves it
31
+ forward on each read. `--before` pages back: a read that didn't show
32
+ everything prints the command for the next page.
33
+
34
+ ## Filters
35
+
36
+ ```bash
37
+ mu read dev --label kind=bug
38
+ mu read dev --label 'kind=bug|feature'
39
+ mu read dev --text limiter
40
+ mu search rate limiter --in dev
41
+ ```
42
+
43
+ A label filter takes a key, `key=value`, or alternatives joined with `|`.
44
+ Search finds words in roots and replies, and not in text that was deleted or
45
+ edited away.
46
+
47
+ ## wait
48
+
49
+ ```bash
50
+ mu wait --re 12 --after 31 --timeout 30m --json
51
+ mu wait work/ --type task.completed --type task.blocked --type task.failed
52
+ ```
53
+
54
+ `wait` blocks until the first matching event, prints it and a `next:` command,
55
+ and exits 0.
56
+
57
+ - `--after` makes something that landed before the wait started still count.
58
+ Without it the wait starts from now.
59
+ - A timeout exits 1 with the reason `timeout`, and the cursor it reached. That
60
+ isn't an answer.
61
+ - Filters: a channel or subtree, `--re <root>`, `--label`, `--by <who>`,
62
+ `--mentions <who>`, `--for <profile>`, `--text`, `--type`, `--kind`. A type ending in `.` takes every
63
+ event under it: `task.`.
64
+ - `--kind` is about blocks. `--kind needs_input` keeps only `task.blocked`
65
+ events of that kind; `--kind '!backlog'` drops blocks of that kind and keeps
66
+ everything else.
67
+ - An event matches a label filter if its thread matched before it or after it,
68
+ so a task leaving a state is news for a filter on that state.
69
+
70
+ ## tail
71
+
72
+ ```bash
73
+ mu tail work/ --json
74
+ mu tail dev --last 20
75
+ ```
76
+
77
+ `tail` prints every matching event until it is stopped, one JSON document a
78
+ line with `--json`. Ctrl-C exits 130.
79
+
80
+ ## Inbox
81
+
82
+ ```bash
83
+ mu inbox --as lead
84
+ mu inbox --as lead --wait 10m
85
+ mu inbox --as lead --peek --json
86
+ mu wait --for lead --timeout 30m
87
+ ```
88
+
89
+ `mu inbox` is what is for you since you last asked: a message that mentions
90
+ you, a task assigned to you, and a reply in a thread you wrote in. Your own
91
+ writes are never in it, except a message you scheduled, which is a `reply`:
92
+ a reminder is how you ask to be woken later. Each line says which, the
93
+ thread, the channel, who wrote it and the first line of what they said, with
94
+ a mention as it is stored:
95
+
96
+ ```text
97
+ mention #42 work/api ada: @[local:user:ada+lead] the build is red
98
+ assigned #51 work bob: ship the release notes
99
+ reply #42 work/api bob: fixed on main
100
+ ```
101
+
102
+ - A profile name is one of yours. `--as` names it, as for every command; with
103
+ none, it is whoever you write as: a token bound to a profile reads that
104
+ profile's inbox, and otherwise it is you.
105
+ - A mention counts once, when the message is posted. Editing it doesn't make
106
+ it new again.
107
+ - It keeps its place in a cursor named `inbox`, per profile, and moves it on
108
+ each call. `--peek` reads without moving it.
109
+ - With nothing new it prints nothing and exits 0. `--wait <duration>` blocks
110
+ until something arrives, or until the time is up, and then prints nothing.
111
+ `--limit` is the most it shows at once, 50 by default.
112
+ - A message deleted since is not in it, whether it mentioned you or answered
113
+ you, and neither is a task whose message was deleted.
114
+ - `--json` prints `{ "items": [{ "kind", "event" }], "cursor" }`.
115
+ - `--for <profile>` on `wait` and `tail` is the same filter without a cursor,
116
+ and the event it prints carries a `for` that says why. It also takes a whole
117
+ actor ID: `local:user:ada+lead` is that profile, and `local:user:ada`, with
118
+ no `+profile`, is the principal alone. A name that isn't a profile, an empty
119
+ one or one ending in `+` is refused as `invalid_profile`.
120
+
121
+ ## How waiting works
122
+
123
+ On a board file `wait` and `tail` look at the log every 100 ms, slowing to
124
+ once a second while nothing happens. Over HTTP they ask the server the same
125
+ way. For a page that stays open, the server also has a live feed: see
126
+ [HTTP](../04-reference/03-http.md).