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

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 (57) hide show
  1. package/README.md +10 -6
  2. package/dist/{args-9ZZDcPxa.js → args-CaFBa2IP.js} +305 -23
  3. package/dist/cli.js +3 -3
  4. package/dist/index.d.ts +67 -18
  5. package/dist/index.js +106 -41
  6. package/dist/inspect/app.js +49 -26
  7. package/dist/{main-Doit2DDY.js → main-BeEB08iI.js} +158 -8
  8. package/dist/main-CLzQkYeG.js +6 -0
  9. package/dist/mcp-CAAZRJgv.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/{steps-BUPRIOe3.js → steps-FNDWY1P_.js} +16 -4
  14. package/docs/01-concepts/09-watchers.md +4 -32
  15. package/docs/01-concepts/10-schedules.md +1 -1
  16. package/docs/01-concepts/11-access.md +19 -3
  17. package/docs/01-concepts/13-budgets.md +66 -3
  18. package/docs/01-concepts/15-outgoing-webhooks.md +6 -19
  19. package/docs/01-concepts/16-workflows.md +22 -2
  20. package/docs/01-quickstart.md +74 -45
  21. package/docs/02-sync/01-overview.md +34 -2
  22. package/docs/02-sync/02-github.md +40 -19
  23. package/docs/02-sync/03-linear.md +103 -85
  24. package/docs/02-sync/04-slack.md +116 -111
  25. package/docs/02-sync/05-notion.md +46 -25
  26. package/docs/03-guides/01-coding-agents.md +51 -33
  27. package/docs/03-guides/02-swarm.md +30 -15
  28. package/docs/03-guides/03-factory.md +193 -80
  29. package/docs/03-guides/04-inspector.md +73 -42
  30. package/docs/03-guides/05-running-agents.md +62 -35
  31. package/docs/03-guides/06-sandboxed-agents.md +488 -305
  32. package/docs/03-guides/07-build-a-ui.md +86 -31
  33. package/docs/03-guides/08-ci.md +59 -36
  34. package/docs/03-guides/09-daemon.md +121 -53
  35. package/docs/03-guides/10-two-agents.md +31 -22
  36. package/docs/03-guides/11-person-in-the-loop.md +47 -34
  37. package/docs/03-guides/12-unattended.md +46 -27
  38. package/docs/03-guides/13-terminals.md +51 -39
  39. package/docs/03-guides/14-no-cloud.md +31 -19
  40. package/docs/03-guides/15-several-boards.md +61 -27
  41. package/docs/03-guides/16-non-code.md +29 -18
  42. package/docs/03-guides/17-mcp.md +37 -30
  43. package/docs/03-guides/18-a-board-on-a-server.md +66 -43
  44. package/docs/03-guides/19-a-card-queue.md +210 -121
  45. package/docs/03-guides/20-a-feedback-loop.md +298 -134
  46. package/docs/03-guides/21-running-the-loop.md +94 -64
  47. package/docs/03-guides/22-building-from-linear.md +81 -57
  48. package/docs/04-reference/01-cli.md +7 -0
  49. package/docs/04-reference/02-handle.md +10 -15
  50. package/docs/04-reference/03-http.md +1 -1
  51. package/docs/04-reference/04-events.md +2 -1
  52. package/docs/04-reference/05-errors.md +3 -0
  53. package/docs/04-reference/08-files.md +49 -0
  54. package/docs/index.md +1 -0
  55. package/package.json +1 -1
  56. package/dist/main-D5aX7Jaj.js +0 -6
  57. package/dist/mcp-Cm96TIb3.js +0 -6
@@ -1,55 +1,99 @@
1
1
  ---
2
2
  title: A software factory
3
- description: For a team that wants an agent to answer GitHub issues, Linear issues or Slack questions as they arrive. Sync brings each one in as a thread, a watcher wakes the agent, and it replies, asks or starts work there.
3
+ description: For a team that wants an agent to answer GitHub issues, Linear issues or Slack questions as they arrive. You end with sync bringing each one in as a thread and a watcher waking the agent, which replies, asks or starts work there.
4
4
  ---
5
5
 
6
- ## The parts
6
+ ## Who this is for
7
7
 
8
- | Part | What does it |
8
+ Your team takes questions and work as issues or chat messages, and you want
9
+ an agent to answer each one as it arrives. You start with one agent on one
10
+ GitHub repository. Later, when the answers need different instructions,
11
+ access or owners, you route each thread to a product's agent by label.
12
+
13
+ ## Before you begin
14
+
15
+ Do these first:
16
+
17
+ - Install muster: see the [quickstart](../01-quickstart.md).
18
+ - Copy `templates/factory` and run `pnpm install` in it. Outside this
19
+ repository, point its `@openmuster/muster` dependency at a release: its
20
+ README shows how.
21
+ - Have a GitHub repository and a webhook secret for it: see
22
+ [GitHub](../02-sync/02-github.md).
23
+ - Have a public HTTPS name that reaches this machine, through a proxy or a
24
+ tunnel.
25
+ - Install and sign in to Claude Code. `lib/wake.ts` runs `claude --print`
26
+ unless `FACTORY_AGENT` names another command. Of the host's model
27
+ credentials, the wake passes on only `ANTHROPIC_API_KEY`.
28
+
29
+ ## How it fits together
30
+
31
+ Each job has one part that does it:
32
+
33
+ | Job | Done by |
9
34
  | --- | --- |
10
- | Threads come in from GitHub, Linear, Slack | [Sync](../02-sync/01-overview.md) |
11
- | An agent is woken when a thread has news | A [watcher](../01-concepts/09-watchers.md) |
12
- | The agent is held to its channels | A [token](../01-concepts/11-access.md) |
13
- | Someone sees what is set up | The factory page |
35
+ | Brings threads in from GitHub, Linear, Slack | [Sync](../02-sync/01-overview.md) |
36
+ | Wakes an agent when a thread has news | A [watcher](../01-concepts/09-watchers.md) |
37
+ | Limits the agent to its channels | A [token](../01-concepts/11-access.md) |
38
+ | Shows what is set up | The factory page |
39
+
40
+ You wire up the plumbing: who is woken, as whom, and with which access. The
41
+ agent makes the decisions: it judges from each thread what the thread needs.
42
+
43
+ `templates/factory` has these pieces:
14
44
 
15
- Wire up the plumbing and leave the decisions to the agent: who is woken, as whom, with which
16
- access. What a thread needs is for the agent to judge from the thread.
45
+ - a [board module](../01-concepts/17-board-module.md) (`lib/board.ts`) with
46
+ the GitHub sync and the watcher
47
+ - a host that runs them (`host.ts`)
48
+ - a wake script (`lib/wake.ts`)
49
+ - the agent's instructions (`AGENT.md`)
50
+ - a page that also takes the webhooks
17
51
 
18
- ## Set it up
52
+ ## Connect GitHub issues to an agent
19
53
 
20
- `templates/factory` has the pieces: a board module (`lib/board.ts`) with
21
- the GitHub sync and the watcher, a host that runs them (`host.ts`), a wake
22
- script (`lib/wake.ts`), the agent's instructions, and a page that also takes
23
- the webhooks. Put your repository in place of `acme/web` in `lib/board.ts`,
24
- then start the page and the host, each in its own terminal, from
25
- `templates/factory`, with the webhook's secret in both:
54
+ ### Start the page and the host
55
+
56
+ Put your repository in place of `acme/web` in `lib/board.ts`. Then start the
57
+ page and the host from `templates/factory`, each in its own terminal, with
58
+ the webhook's secret in both:
26
59
 
27
60
  ```bash
28
- export GITHUB_WEBHOOK_SECRET=...
61
+ export GITHUB_WEBHOOK_SECRET=your_webhook_secret
29
62
  pnpm dev
30
63
  ```
31
64
 
32
65
  ```bash
33
- export GITHUB_WEBHOOK_SECRET=...
66
+ export GITHUB_WEBHOOK_SECRET=your_webhook_secret
34
67
  pnpm host
35
68
  ```
36
69
 
37
- The module names the secret with `env()`, so it is never written in the
38
- file: the page reads it on its first request, and `host.ts` when it starts,
39
- refusing to start while it is unset. Point GitHub's webhook at
70
+ The module names the secret with `env()`, so the secret is never in the
71
+ file. The page reads it on its first request. `host.ts` reads it when it
72
+ starts, and refuses to start while it is unset.
73
+
74
+ ### Point GitHub's webhook at the page
75
+
76
+ Point GitHub's webhook at
40
77
  `https://board.example.com/api/board/webhooks/gh`, and list
41
78
  `board.example.com` in `ALLOW_HOSTS`. The page listens on 127.0.0.1: the
42
- webhook reaches it through a proxy or a tunnel with a public HTTPS name. The
43
- webhook brings a thread in; `host.ts` runs the watcher, and the sync's
79
+ webhook reaches it through a proxy or a tunnel with a public HTTPS name.
80
+
81
+ The webhook brings a thread in. `host.ts` runs the watcher, and the sync's
44
82
  catch-up and sending.
45
83
 
46
- Schedules are sent by a daemon that holds `tick`. Run it without a module:
47
- `host.ts` runs this one.
84
+ ### Start the daemon for scheduled messages
85
+
86
+ A daemon that holds the
87
+ [`tick` lease](../01-concepts/09-watchers.md#the-daemon) sends scheduled
88
+ messages. Run it with `--no-module`, since `host.ts` already runs this
89
+ module:
48
90
 
49
91
  ```bash
50
92
  mu daemon run --no-module
51
93
  ```
52
94
 
95
+ ### Check that the agent answers
96
+
53
97
  With all three running, check from `templates/factory` that the watcher
54
98
  wakes the agent and that the agent answers:
55
99
 
@@ -57,17 +101,23 @@ wakes the agent and that the agent answers:
57
101
  mu daemon check factory --module "$PWD/lib/board.ts" --in factory/issues
58
102
  ```
59
103
 
60
- The template's sync brings threads in and sends nothing back. To have the
61
- agent's replies posted as comments, give the repository `mirror: true` and
104
+ ### Post the agent's replies back to GitHub
105
+
106
+ The template's sync brings threads in and sends nothing back. To have sync
107
+ post the agent's replies as comments, give the repository `mirror: true` and
62
108
  the sync a `token: env('GITHUB_TOKEN')`: see [GitHub](../02-sync/02-github.md)
63
109
  and [Sync](../02-sync/01-overview.md#in-a-board-module).
64
110
 
65
- The page lists what is set up and what isn't, with the command for each, who
66
- holds each role (`tick` for the daemon, `sync` and `watch:factory` for the
67
- host), and the recent threads. `/board` shows every thread, where you read
68
- and reply from a browser.
111
+ ## What you see
69
112
 
70
- ## How a thread goes
113
+ The page lists what is set up and what isn't, with the command for each. It
114
+ also shows who holds each role (`tick` for the daemon, `sync` and
115
+ `watch:factory` for the host), and the recent threads. `/board` shows every
116
+ thread, where you read and reply from a browser.
117
+
118
+ ### What happens to a thread
119
+
120
+ Each issue goes through these steps:
71
121
 
72
122
  1. Someone opens an issue. It becomes a thread in the mapped channel.
73
123
  2. The watcher wakes the agent with the thread's ID. The agent reads it.
@@ -100,7 +150,11 @@ flowchart LR
100
150
  A -->|reply| S
101
151
  ```
102
152
 
103
- In the board module:
153
+ ### Declare a router and a watcher per product
154
+
155
+ In the board module, declare the router's watcher and one watcher per
156
+ product. Each runs a [gate](../01-concepts/09-watchers.md#a-gate) before it
157
+ wakes its agent:
104
158
 
105
159
  ```ts board.ts
106
160
  import { board, command, type Watch } from '@openmuster/muster'
@@ -127,6 +181,25 @@ export default board({
127
181
  })
128
182
  ```
129
183
 
184
+ The module sets up these behaviours:
185
+
186
+ - **Each watcher has its own `as`.** A watcher never hears its own
187
+ [profile](../01-concepts/06-actors.md)'s writes. A product's agent that
188
+ writes as `router` can't hear the router's label.
189
+ - **It costs two agent sessions a question.** Each watcher runs in a loop of
190
+ its own. While idle, a loop looks for new events at least once a second.
191
+ The router's agent labels the thread, and the product's watcher hears the
192
+ label.
193
+ `coalesce` gathers the question and its label into one wake, once the
194
+ oldest is `30s` old.
195
+ - **A product's watcher hears more than the label arriving.** It also hears
196
+ later messages in the thread, the label being taken away, and any other
197
+ label changing on it. The gate handles the label leaving. Tell the agent to
198
+ reply only when the last message isn't its own. To answer the first
199
+ question only, drop `message.posted` from its `types`.
200
+
201
+ ### Have the router write one label
202
+
130
203
  The router's agent reads the thread and writes one label on it, and nothing
131
204
  else. Its instructions name the products and what each covers, and end with
132
205
  the command:
@@ -138,9 +211,12 @@ mu label <thread> product=billing --if-unset product
138
211
  `--if-unset` makes the first answer stand: a second try exits 1 with
139
212
  `label_conflict`, so have `route.sh` treat that as done. Use `product=none`
140
213
  for what isn't a product question. It is a label like the others: it stops
141
- the router from being asked again, and no watcher listens for it.
214
+ the router's gate from waking the router again, and no watcher listens for
215
+ it.
216
+
217
+ ### Gate each watcher
142
218
 
143
- The two gates keep a model from being started for nothing:
219
+ The two gates stop the watchers from starting a model for nothing:
144
220
 
145
221
  ```bash
146
222
  #!/bin/sh
@@ -154,11 +230,27 @@ mu read "$MUSTER_THREAD" --json | grep -q '"product":' && echo '{"wake": false}'
154
230
  mu read "$MUSTER_THREAD" --json | grep -q "\"product\": \"$1\"" || echo '{"wake": false}'
155
231
  ```
156
232
 
233
+ A gate says no in one way only: `{"wake": false}` on its last line. Its exit
234
+ code isn't read, so a gate that prints nothing wakes the agent. That is why
235
+ the two scripts fail in opposite directions when `mu read` fails and `grep`
236
+ finds nothing:
237
+
238
+ - **`unlabelled.sh` wakes the router.** Its `&&` prints `{"wake": false}`
239
+ only when `grep` finds a label, so on a failed read it prints nothing.
240
+ - **`has-product.sh` keeps its agent asleep.** Its `||` prints
241
+ `{"wake": false}` whenever `grep` finds no match.
242
+
243
+ ### Wake each agent with a pointer
244
+
157
245
  `route.sh` and `answer.sh` do what the factory's `lib/wake.ts` does, with
158
- other instructions: they pass a pointer, and the agent reads the thread
159
- itself.
246
+ other instructions: they pass a
247
+ [pointer](../01-concepts/09-watchers.md#what-a-wake-carries), and the agent
248
+ reads the thread itself.
160
249
 
161
- Try the plumbing by hand, with you as the router:
250
+ ### Try the plumbing by hand
251
+
252
+ Post a question and label it, with you as the router, then list the
253
+ threads that carry the billing label:
162
254
 
163
255
  ```bash steps
164
256
  mu post help "How do I change the card on my account?" --as ada
@@ -166,47 +258,68 @@ mu label 1 product=billing --if-unset product --as router
166
258
  mu read help --label product=billing --as ada
167
259
  ```
168
260
 
169
- What to know before you rely on it:
261
+ To check the watchers end to end, run `mu daemon check billing`. A
262
+ product's watcher builds its check message with its label; the router's
263
+ can't be checked this way (see [What goes wrong](#what-goes-wrong)).
264
+
265
+ ## What keeps it safe
266
+
267
+ The factory keeps three things apart: secrets, the text that arrives, and
268
+ who approves.
269
+
270
+ ### Keep secrets away from the agent
271
+
272
+ The wake command gets a pointer and a clean environment. It never gets the
273
+ secrets the sync names.
274
+
275
+ ### Treat what arrives as information, not orders
276
+
277
+ Text from a platform is data for the agent:
170
278
 
171
- - **Give each watcher its own `as`.** A watcher never hears its own profile's
172
- writes. A product's agent that writes as `router` can't hear the router's
173
- label.
174
- - **It costs two agent sessions a question.** Each watcher runs in a loop of
175
- its own: the router's agent labels the thread, and the product's watcher
176
- hears the label within a second or two. `coalesce` gathers the question and
177
- its label into one wake, once the oldest is 30 seconds old.
178
- - **A product's watcher hears more than the label arriving:** later messages
179
- in the thread, the label being taken away, and any other label changing on
180
- it. The gate handles the label leaving. Tell the agent to reply only when
181
- the last message isn't its own. To answer the first question only, drop
182
- `message.posted` from its `types`.
183
- - **A gate that fails wakes the agent.** Only `{"wake": false}` on its last
184
- line says no; its exit code isn't read. `unlabelled.sh` wakes the router
185
- when `mu read` fails, and `has-product.sh` doesn't wake its agent.
186
- - **An agent that exits 0 without writing a label isn't tried again.** The
187
- thread stays unsorted until someone posts in it or labels it by hand.
188
- - **Fix a wrong label by hand:** `mu label <thread> product=api`. The api
189
- agent is woken, and the gate keeps billing's asleep.
190
- - **`mu daemon check router` times out,** because the router labels and never
191
- replies. Check a product's watcher instead, which builds its message with
192
- the label: `mu daemon check billing`.
193
- - **"Label only" is an instruction, not a limit.** The router reads text
194
- strangers wrote. On a served board give it a
195
- [token](../01-concepts/11-access.md) held to that channel.
196
- - **Messages sent while the board is down come in late.** When the board
197
- starts again it reads what [Slack](../02-sync/04-slack.md) has since, with
198
- limits that page gives.
199
-
200
- ## Keep people in the loop
201
-
202
- Nothing on a board proves that a particular person approved something. For a merge, a deploy
203
- or a publish, have the agent ask where identity is verified: a review on the
204
- pull request.
205
-
206
- ## Keep it safe
207
-
208
- - The wake command gets a pointer and a clean environment. It never gets the
209
- secrets the sync names.
210
- - A `filter` on the sync can drop or rewrite text on its way in.
211
279
  - What arrives from a platform informs the agent; it never authorizes it.
212
- - A task whose brief is edited from outside is held for its owner.
280
+ - A `filter` on the sync can drop or rewrite text on its way in.
281
+ - "Label only" is an instruction to the router, not a limit. The router
282
+ reads text strangers wrote. On a served board give it a
283
+ [token](../01-concepts/11-access.md) limited to that channel.
284
+
285
+ ### Get approvals where identity is verified
286
+
287
+ Nothing on a board proves that a particular person approved something. For a
288
+ merge, a deploy or a publish, have the agent ask where identity is verified:
289
+ a review on the pull request.
290
+
291
+ ### Hold edited tasks for their owner
292
+
293
+ If someone other than a task's owner edits its brief, the board
294
+ [holds the task](../01-concepts/08-tasks.md#who-may-change-a-task) for its
295
+ owner.
296
+
297
+ ## What goes wrong
298
+
299
+ These are the failures routing by label runs into:
300
+
301
+ - **`mu daemon check router` times out.** The router labels and never
302
+ replies. Check a product's watcher instead: `mu daemon check billing`.
303
+ - **A thread stays unsorted.** The router's agent exited 0 without writing a
304
+ label, and the watcher doesn't retry an agent that exits 0. The thread
305
+ stays unsorted until someone posts in it or labels it by hand.
306
+ - **A thread has the wrong label.** Fix it by hand:
307
+ `mu label <thread> product=api`. The api watcher wakes its agent, and the
308
+ gate keeps billing's asleep.
309
+ - **Messages sent while the board was down come in late.** Slack retries an
310
+ unanswered event three times, within minutes. After that, when the board
311
+ starts again, it reads what [Slack](../02-sync/04-slack.md) has since.
312
+ Edits and deletes made meanwhile aren't read: see
313
+ [After downtime](../02-sync/04-slack.md#after-downtime) for the limits.
314
+
315
+ ## Related
316
+
317
+ Go further with these pages:
318
+
319
+ - [Watchers](../01-concepts/09-watchers.md): the daemon, gates and retries
320
+ - [Keep the daemon running](./09-daemon.md#check-that-a-watcher-wakes-something):
321
+ `mu daemon check`
322
+ - [GitHub](../02-sync/02-github.md) and [Slack](../02-sync/04-slack.md): what
323
+ each platform's sync brings in and sends back
324
+ - [Access](../01-concepts/11-access.md): tokens that limit an agent to its
325
+ channels
@@ -1,9 +1,11 @@
1
1
  ---
2
2
  title: The inspector
3
- description: For watching a board and acting on it from a browser on your machine. mu inspect opens a local page with tasks by state, channels, threads and live activity, where you can post, reply, start tasks and approve requests to join.
3
+ description: For people who want to watch a board and act on it from a browser on their own machine. You end with a local page from mu inspect that shows tasks by state, channels, threads and live activity, where you can post, reply, start tasks and approve requests to join.
4
4
  ---
5
5
 
6
- ## Open it
6
+ ## Open the inspector
7
+
8
+ Open the inspector, or a demo of it:
7
9
 
8
10
  ```bash
9
11
  mu inspect
@@ -11,42 +13,67 @@ mu inspect --port 4500 --no-open
11
13
  mu demo
12
14
  ```
13
15
 
14
- `mu inspect` opens the board in a browser. `mu demo` opens it on a scratch
15
- board and plays a run through every state, so you can watch one happen.
16
+ `mu inspect` opens the board in a browser. `--port 4500` serves it on port
17
+ 4500, and `--no-open` doesn't open a browser. `mu demo` opens the page on a
18
+ scratch board and plays a run through every state, so you can watch one
19
+ happen.
16
20
 
17
21
  ## What it shows
18
22
 
19
- - **Tasks**, by state: open, waiting, ready, claimed, blocked, completed,
23
+ The page shows:
24
+
25
+ - **Tasks by state:** open, waiting, ready, claimed, blocked, completed,
20
26
  failed, canceled, all. Each row has the task's labels, who holds it and how
21
- long the lease has left, what it waits for, or why it is held.
22
- - **Channels**, and the threads in each.
23
- - **Activity**: the newest events on the board.
24
- - **A thread pane** for any task or thread, with its labels and files.
25
- - **A composer**: post in a channel, reply in a thread, or start a task. The
26
- "as" field at the foot of the sidebar picks the profile you write as.
27
- - **Requests to join**: agents that asked for a token with `mu join`, each
27
+ long the [lease](../01-concepts/08-tasks.md#claims) has left, what it waits
28
+ for, or why it is [held](../01-concepts/08-tasks.md#states).
29
+ - **Channels:** each with its threads.
30
+ - **Activity:** the newest events on the board, each with its clock time.
31
+ - **A thread pane:** any task or thread, with its labels and files in full,
32
+ the whole date of each message, and who holds a task and until when.
33
+ - **A composer:** post in a channel, reply in a thread, or start a task. The
34
+ "as" field at the foot of the sidebar picks the
35
+ [profile](../01-concepts/06-actors.md) you write as.
36
+ - **Requests to join:** agents that asked for a token with `mu join`, each
28
37
  with its code and note. Approve one with a channel, its permissions and how
29
38
  long the token lasts, or deny it. See
30
39
  [Access](../01-concepts/11-access.md#let-an-agent-ask-to-join).
31
40
 
32
- It follows the board live. The view is in the URL, so a link opens the same
33
- place.
41
+ The page updates live as the board changes. The view is in the URL, so a link
42
+ opens the same place.
34
43
 
35
44
  Every view is a link: Tab reaches it, Enter opens it, and it opens in a new
36
- tab when you ask for one. Enter opens a row too. On a phone the sidebar is
37
- behind the menu button and a thread takes the whole screen; on a tablet a
38
- thread lies over the list.
39
-
40
- ## Notifications
41
-
42
- Press **notify me of mentions** in the sidebar and allow it, and the page
43
- shows a notification for each new message that mentions you, while it is
44
- open, in a background tab too. A mention of you is what `mu inbox` counts
45
- as one with no `--as`: `@` and your own handle, from anyone but you. A
46
- mention of a profile, such as the one in the "as" field, isn't one. What
47
- you write from the page, as any profile, never notifies you. Click a
45
+ tab when you ask for one. Enter opens a row too.
46
+
47
+ ## Work through a list from the keyboard
48
+
49
+ In tasks and activity, these keys move through the list one row at a time:
50
+
51
+ | Key | What it does |
52
+ | --- | --- |
53
+ | `j` or `↓` | Moves to the next row |
54
+ | `k` or `↑` | Moves to the previous row |
55
+ | `Enter` | Opens the thread of the row you are on |
56
+ | `Esc` | Closes the list of keys, the menu or the thread, in that order. Closing a thread puts you back on the row you opened it from |
57
+ | `?` | Shows every key |
58
+
59
+ While you type in the composer or the "as" field, every key is text and none
60
+ of these work. A key held with Cmd, Ctrl or Alt is left to the browser.
61
+
62
+ On a phone the sidebar is behind the menu button and a thread takes the whole
63
+ screen. On a tablet a thread opens over the list.
64
+
65
+ ## Get notified of mentions
66
+
67
+ Press **notify me of mentions** in the sidebar and allow notifications. The
68
+ page then shows a notification for each new message that mentions you. It
69
+ does this while the page is open, in a background tab too. Click a
48
70
  notification to open its thread.
49
71
 
72
+ A mention of you is `@` and your own handle, from anyone but you: what
73
+ `mu inbox` counts as a mention with no `--as`. A mention of a profile, such
74
+ as the one in the "as" field, isn't one. What you write from the page, as any
75
+ profile, never notifies you.
76
+
50
77
  The button is only there until you answer. To change your answer later, use
51
78
  the site settings of your browser for the page's address.
52
79
 
@@ -55,34 +82,38 @@ the site settings of your browser for the page's address.
55
82
  The page acts as you, so its server trusts nothing but its own page:
56
83
 
57
84
  - It listens on 127.0.0.1 only and answers only for its own host name.
58
- - Every board request needs a token made for that run. It is in the link
59
- `mu inspect` prints, after the `#`, and nowhere in what the server sends:
60
- anything on your machine can ask 127.0.0.1 for the page, and gets a page
61
- that can do nothing. Open the printed link once and your browser keeps the
62
- token for that address, so links to a view work after that.
85
+ - Every board request needs a token made for that run. The token is in the
86
+ link `mu inspect` prints, after the `#`, and nowhere in what the server
87
+ sends. Anything on your machine can ask 127.0.0.1 for the page, and gets a
88
+ page that can do nothing. Open the printed link once and your browser keeps
89
+ the token for that address, so links to a view work after that.
63
90
  - Writes must come from the page's own origin.
64
91
 
65
92
  Try writes against a scratch board first (`--dir`): on a board with sync, a
66
93
  reply in a mirrored thread reaches people.
67
94
 
68
- ## When not to
95
+ ## When not to use the inspector
96
+
97
+ Use something else for:
69
98
 
70
- - For someone on another machine. The inspector listens on 127.0.0.1 only;
71
- serve the board and give them a token, or
99
+ - **Someone on another machine:** the inspector listens on 127.0.0.1 only.
100
+ Serve the board and give them a token, or
72
101
  [build a page](./07-build-a-ui.md) for them.
73
- - For an agent or a script. `mu read`, `mu wait` and `mu tail` give it the
102
+ - **An agent or a script:** `mu read`, `mu wait` and `mu tail` give it the
74
103
  same board as text.
75
104
 
76
105
  ## What goes wrong
77
106
 
78
- - **"This page needs the link mu inspect printed".** The page was opened
107
+ Each item is the symptom, then the cause and the fix:
108
+
109
+ - **"This page needs the link mu inspect printed":** you opened the page
79
110
  without the token after the `#`, or with one from an earlier
80
111
  `mu inspect`: each run makes a new one. Open the link it printed this time.
81
- - **`The inspector doesn't answer for "<host>"`.** The page was reached
82
- under another host name. Use the printed address.
83
- - **No notifications, though the page asked and you allowed them.** The
84
- operating system has to allow your browser to show notifications too: on
85
- macOS in System Settings, Notifications. Chrome on Android shows none from
86
- a page like this one.
112
+ - **`The inspector doesn't answer for "<host>"`:** you reached the page under
113
+ another host name. Use the printed address.
114
+ - **You get no notifications, though the page asked and you allowed them.**
115
+ The operating system has to allow your browser to show notifications too:
116
+ on macOS in System Settings, Notifications. Chrome on Android shows none
117
+ from a page like this one.
87
118
  - **A notification comes a minute late.** A browser slows a tab it hasn't
88
119
  shown for a while; the page reads the board less often until you look.