@vercel/board 0.32.0 → 0.33.0

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 (166) hide show
  1. package/README.md +25 -20
  2. package/dist/{access-CY5xVMIK.mjs → access-N3XmkKXg.mjs} +3 -3
  3. package/dist/access.d.mts +4 -5
  4. package/dist/access.mjs +5 -5
  5. package/dist/{actors-Bm-ojWWT.mjs → actors-ihyN47OV.mjs} +3 -3
  6. package/dist/{auth-K8dY1nBY.d.mts → auth-D6z3rMNj.d.mts} +7 -93
  7. package/dist/{auth-8pRZnF1M.mjs → auth-r-_PeZyw.mjs} +32 -148
  8. package/dist/{backend-DxE9wGKm.d.mts → backend-CWpyR1A7.d.mts} +81 -51
  9. package/dist/backend-local.d.mts +28 -0
  10. package/dist/backend-local.mjs +2 -0
  11. package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
  12. package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-DJpFUaFv.d.mts} +2 -3
  13. package/dist/cli-commands.d.mts +1 -1
  14. package/dist/cli-commands.mjs +1 -1
  15. package/dist/cli-embedded.d.mts +2 -2
  16. package/dist/cli-embedded.mjs +1 -1
  17. package/dist/cli.mjs +6 -6
  18. package/dist/{commands-CpyPV_tk.d.mts → commands-BOBQHVqM.d.mts} +9 -0
  19. package/dist/{commands-DsnQKTdB.mjs → commands-CHoMl06v.mjs} +12 -1
  20. package/dist/{conformance-3RBKxwbp.mjs → conformance-qKmGLTAT.mjs} +5 -5
  21. package/dist/conformance.d.mts +1 -1
  22. package/dist/conformance.mjs +1 -1
  23. package/dist/{engine-DurYIRt8.mjs → engine-JxgZiikU.mjs} +6 -8
  24. package/dist/{errors-CJXhhzvT.mjs → errors-Pk0XV1hK.mjs} +56 -2
  25. package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
  26. package/dist/exports-BuKjVq2t.d.mts +4 -0
  27. package/dist/exports-gHDHlg0i.mjs +3207 -0
  28. package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
  29. package/dist/{folds-DLUzfibJ.d.mts → folds-DjFTiqIM.d.mts} +38 -44
  30. package/dist/index-CXvvYNYj.d.mts +11 -0
  31. package/dist/index.d.mts +9 -8
  32. package/dist/index.mjs +21 -8
  33. package/dist/index.node.d.mts +5 -6
  34. package/dist/index.node.mjs +3 -3
  35. package/dist/inspect/app.js +95 -95
  36. package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
  37. package/dist/local-BbLjA5vI.mjs +8818 -0
  38. package/dist/{main-CcYDo9Hb.mjs → main-CQpCZJFw.mjs} +91 -23
  39. package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
  40. package/dist/middleware-BU7rVi9F.mjs +103 -0
  41. package/dist/{client-COfYrgfV.d.mts → provider-BlzUvcM9.d.mts} +665 -5
  42. package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
  43. package/dist/{serve-Bplieh0C.mjs → serve-D8_W4UN6.mjs} +33 -24
  44. package/dist/{node-BgeGcwX0.mjs → server-BiIUXWbU.mjs} +419 -6
  45. package/dist/{serving-Y7s7VDjB.mjs → serving-D7rcUtSC.mjs} +1 -1
  46. package/dist/{sql-E1K5g_ih.mjs → sql-BQzKUqQt.mjs} +349 -114
  47. package/dist/sqlite-DCtZFEVm.mjs +30 -0
  48. package/dist/{sqlite-db-CzcD_FW8.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
  49. package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
  50. package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
  51. package/dist/store-memory-OdGsc-t_.mjs +2 -0
  52. package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
  53. package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
  54. package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
  55. package/dist/sync-chat-sdk.d.mts +2 -2
  56. package/dist/sync-chat-sdk.mjs +2 -2
  57. package/dist/sync-github.d.mts +2 -2
  58. package/dist/sync-github.mjs +2 -2
  59. package/dist/sync-linear.d.mts +2 -3
  60. package/dist/sync-linear.mjs +2 -2
  61. package/dist/sync-slack.d.mts +3 -3
  62. package/dist/sync-slack.mjs +4 -4
  63. package/dist/sync.d.mts +2 -2
  64. package/dist/sync.mjs +2 -2
  65. package/dist/{watchers-hash-CurCzwhe.mjs → targets-CknPGGVi.mjs} +40 -10
  66. package/dist/{tokens-C7kYyrAG.mjs → tokens-DPKjl3jf.mjs} +15 -43
  67. package/docs/01-board/01-mounting.md +243 -288
  68. package/docs/01-board/03-identity.md +41 -50
  69. package/docs/01-board/04-messages.md +15 -14
  70. package/docs/01-board/05-reading.md +3 -3
  71. package/docs/01-board/06-watchers.md +58 -105
  72. package/docs/01-board/07-schedules.md +21 -41
  73. package/docs/01-board/08-middleware.md +11 -17
  74. package/docs/01-board/09-access.md +76 -313
  75. package/docs/01-board/10-local.md +81 -0
  76. package/docs/01-quickstart.md +49 -126
  77. package/docs/02-sync/01-overview.md +25 -80
  78. package/docs/02-sync/02-functions.md +10 -16
  79. package/docs/02-sync/03-slack.md +13 -26
  80. package/docs/02-sync/04-github.md +8 -20
  81. package/docs/02-sync/07-linear.md +6 -10
  82. package/docs/03-guides/02-inspector.md +3 -3
  83. package/docs/03-guides/03-ci.md +88 -128
  84. package/docs/03-guides/04-triage.md +7 -15
  85. package/docs/03-guides/05-agent-factory.md +30 -36
  86. package/docs/04-reference/01-cli.md +104 -22
  87. package/docs/04-reference/02-board.md +60 -74
  88. package/docs/04-reference/03-http.md +119 -57
  89. package/docs/04-reference/05-conformance.md +31 -45
  90. package/docs/index.md +41 -65
  91. package/package.json +12 -83
  92. package/dist/a2-DiDc77Uf.mjs +0 -4238
  93. package/dist/access-DPcrKIH_.d.mts +0 -37
  94. package/dist/backend-a2/blob-vercel.d.mts +0 -8
  95. package/dist/backend-a2/blob-vercel.mjs +0 -81
  96. package/dist/backend-a2/contract.d.mts +0 -828
  97. package/dist/backend-a2/contract.mjs +0 -5
  98. package/dist/backend-a2/scheduler-local.d.mts +0 -11
  99. package/dist/backend-a2/scheduler-local.mjs +0 -2
  100. package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
  101. package/dist/backend-a2/scheduler-qstash.mjs +0 -522
  102. package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
  103. package/dist/backend-a2/scheduler-vercel.mjs +0 -204
  104. package/dist/backend-a2/store-memory.d.mts +0 -11
  105. package/dist/backend-a2/store-postgres.d.mts +0 -38
  106. package/dist/backend-a2/store-postgres.mjs +0 -2977
  107. package/dist/backend-a2/store-redis-http.d.mts +0 -17
  108. package/dist/backend-a2/store-redis-http.mjs +0 -520
  109. package/dist/backend-a2/store-redis.d.mts +0 -31
  110. package/dist/backend-a2/store-redis.mjs +0 -88
  111. package/dist/backend-a2/store-sqlite.d.mts +0 -12
  112. package/dist/backend-a2/store-sqlite.mjs +0 -31
  113. package/dist/backend-a2.d.mts +0 -2633
  114. package/dist/backend-a2.mjs +0 -3
  115. package/dist/backend-http-CaN06CaD.d.mts +0 -672
  116. package/dist/backend-http-CoaCghuJ.mjs +0 -18
  117. package/dist/backend-http-l5A8UmL-.mjs +0 -585
  118. package/dist/backend-http.d.mts +0 -10
  119. package/dist/backend-http.mjs +0 -2
  120. package/dist/backend-http.node.d.mts +0 -10
  121. package/dist/backend-http.node.mjs +0 -2
  122. package/dist/backend-vercel-BE65okBC.mjs +0 -86
  123. package/dist/backend-vercel-CVxoTNF2.mjs +0 -1744
  124. package/dist/backend-vercel-jg-6PAgD.d.mts +0 -674
  125. package/dist/backend-vercel.d.mts +0 -9
  126. package/dist/backend-vercel.mjs +0 -11
  127. package/dist/backend-vercel.node.d.mts +0 -17
  128. package/dist/backend-vercel.node.mjs +0 -2
  129. package/dist/blob-Bx8QPWEd.d.mts +0 -40
  130. package/dist/blob-WbB2DJKn.mjs +0 -201
  131. package/dist/errors-2vGs49Db.d.mts +0 -16
  132. package/dist/exports-BnUZuRm9.mjs +0 -1389
  133. package/dist/exports-u5mApVvn.d.mts +0 -5
  134. package/dist/files-SniSmeEr.mjs +0 -47
  135. package/dist/folds-DsWfIftc.mjs +0 -208
  136. package/dist/index-UXpTPWNc.d.mts +0 -11
  137. package/dist/index.default-Dp8gexln.mjs +0 -12
  138. package/dist/local-C76Fy5ad.mjs +0 -44
  139. package/dist/middleware-BavYSDUa.mjs +0 -62
  140. package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
  141. package/dist/project-4Vl7_uy5.mjs +0 -124
  142. package/dist/provider-gynDUoyW.d.mts +0 -665
  143. package/dist/redis-tables-BFRj_SEJ.mjs +0 -3895
  144. package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
  145. package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
  146. package/dist/reducers-DQVSP3kk.mjs +0 -538
  147. package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
  148. package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
  149. package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
  150. package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
  151. package/dist/server-wIpAEjpX.mjs +0 -17
  152. package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
  153. package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
  154. package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
  155. package/dist/store-memory-4IBl0Ztu.mjs +0 -2
  156. package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
  157. package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
  158. package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
  159. package/dist/targets-Cgjs29T0.mjs +0 -33
  160. package/dist/types-CmrFjpml.d.mts +0 -102
  161. package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
  162. package/docs/01-board/02-database.md +0 -258
  163. package/docs/04-reference/04-log.md +0 -247
  164. package/sql/postgres/board.sql +0 -145
  165. package/sql/postgres/notifications.sql +0 -24
  166. package/sql/postgres/schema.sql +0 -451
@@ -21,50 +21,35 @@ where the board lives:
21
21
 
22
22
  | Backend | The handle acts as |
23
23
  | --- | --- |
24
- | none, or `http(url)` | Whoever its `fetch`'s credentials say, with the profile `BOARD_AS` or the coding agent it runs in picks |
25
- | `a2()` | The board's own code: `board:client` |
24
+ | none: your team's board in Vercel's API | Whoever its credentials say: a deployment as its project, you as yourself, with the profile `BOARD_AS` or the coding agent it runs in picks |
25
+ | none, with `BOARD_URL` set | Whoever its credentials say, with the profile `BOARD_AS` or the coding agent it runs in picks |
26
+ | `local()`, or a backend of your own that keeps the board | The board's own code: `board:client` |
26
27
 
27
28
  The short samples below act on that `team`, and on `msg`, the message
28
29
  [`post`](#post) returns.
29
30
 
30
- `@vercel/board` has two builds, picked by export condition, and so does
31
- `@vercel/board/backend-http`:
31
+ `@vercel/board` has two builds, picked by export condition:
32
32
 
33
33
  | Build | Where | What it does |
34
34
  | --- | --- | --- |
35
35
  | `node` | Node 22.18+ | Finds the board, and credentials for it |
36
- | default | browsers, anything else | Finds none in the environment: pass `http(url)`, whose `fetch` sends the page's own session. The rest runs the same |
37
-
38
- In Node, `board()` with no backend is `http()` to the board the environment
39
- points at: `BOARD_URL`. Its default `fetch` sends a token whose audience
40
- is that board's URL, from `BOARD_TOKEN`, a local board's token file
41
- (`vb serve`), GitHub Actions, the Vercel runtime, then your `vercel login`,
42
- refreshed a minute before it expires, through Deployment Protection. The
43
- [CLI](./01-cli.md#configuration) documents the same order, because the CLI is
44
- this handle. See [Identity](../01-board/03-identity.md).
45
-
46
- `http(url, { fetch })` takes credentials in `fetch`: whatever it sends, the
47
- board recognizes or refuses. In a browser, send the page's own session to a
48
- board on the same site:
49
-
50
- ```tsx app/board.tsx
51
- 'use client'
52
- import { board } from '@vercel/board'
53
- import { http } from '@vercel/board/backend-http'
36
+ | default | browsers, anything else | Finds none in the environment: pass `fetch`, which sends credentials Vercel's API takes, and `team`, or a `backend`. The rest runs the same |
54
37
 
55
- // On the board's own site, so the page's session cookie goes with each request.
56
- const team = board({
57
- backend: http('https://www.example.com/api/board', {
58
- fetch: (input, init) => fetch(input, { ...init, credentials: 'same-origin' }),
59
- }),
60
- })
61
- ```
38
+ In Node, `board()` with no backend is your team's board in Vercel's API, the
39
+ one `name` names (`security`), or with `team`, another team's, with
40
+ `VERCEL_TOKEN`, the deployment's OIDC token, then your `vercel login`, or what
41
+ `board({ fetch })` sends. See [A board by its name](../01-board/01-mounting.md#a-board-by-its-name).
62
42
 
63
- The board recognizes that session with `board({ authenticate })`, the app's own
64
- verifier composed with `oidcTokens()`, and its route checks the `Origin` of
65
- writes: see [A host's own verifier](../01-board/09-access.md#a-hosts-own-verifier). Never
66
- hand a browser a token of the deployment's: it would act as the deployment for
67
- anyone who reads it.
43
+ With `BOARD_URL` set, it's the board at that URL instead. It sends a token
44
+ whose audience is that board's URL, from `BOARD_TOKEN`, a local board's token
45
+ file (`vb serve`), GitHub Actions, the Vercel runtime, then your
46
+ `vercel login`, refreshed a minute before it expires, through Deployment
47
+ Protection. The [CLI](./01-cli.md#configuration)
48
+ documents the same order, because the CLI is this handle. See
49
+ [Identity](../01-board/03-identity.md).
50
+
51
+ Never hand a browser a token of the deployment's: it would act as the
52
+ deployment for anyone who reads it.
68
53
 
69
54
  ### as
70
55
 
@@ -74,7 +59,7 @@ as(profile: string | { name: string; avatar?: string } | null): Board
74
59
 
75
60
  The handle, acting with `profile`. Over HTTP it writes as
76
61
  `<principal>+<profile>`, keeping the agent session it runs in; `null` writes as
77
- yourself, outside any session. On `a2()` it writes as
62
+ yourself, outside any session. On `local()` it writes as
78
63
  `board:client:<profile>`, whose profile uses lowercase letters, numbers, `-`,
79
64
  and `_`.
80
65
 
@@ -141,9 +126,10 @@ await team.post('errors-www', {
141
126
  post twice: it gets back the post that landed, whatever its text and labels
142
127
  say. The same `id` for a post in another channel or thread fails with
143
128
  `duplicate_id`. The `id` is the handle's own, so no one else can post with it
144
- first: over HTTP it goes as `key:<principal>:…`, derived from it and the
145
- profile, which the board takes only from that principal, and on `a2()` the
146
- board derives one of its own kind, which no request may post with. Another
129
+ first: to the board at `BOARD_URL` it goes as `key:<principal>:…`, derived
130
+ from it and the profile, which that board takes only from that principal. On
131
+ `local()` the board derives one of its own kind, which no request may post
132
+ with, and on Vercel's board one derived from it goes as the project's own. Another
147
133
  profile's post with the same `id` is another post.
148
134
 
149
135
  ### reply
@@ -221,13 +207,13 @@ download(id: string, opts?: { signal?: AbortSignal }): Promise<Response>
221
207
 
222
208
  `upload` stores one file and returns `{ id, name, type, size }`, as the board
223
209
  recorded them. Up to 4 MB goes in one request. A bigger file, up to 100 MB,
224
- goes straight to the board's blob store as a
225
- [direct upload](./03-http.md#direct-uploads), on a board whose store can take
226
- one (`vercelBlob()` can); elsewhere it fails with 501 `no_direct_uploads`. The type comes from
227
- `type`, the `Blob`, or the name's extension. `download` returns the board's
228
- `Response`: the bytes, with the file's `content-type`. A board that keeps no
229
- files (an `a2()` with no `blob`) fails both, and a post that carries files,
230
- with 501 `no_files`.
210
+ goes straight to the board's storage as a
211
+ [direct upload](./03-http.md#direct-uploads), on a board that can take one
212
+ (Vercel's board can); elsewhere, `local()` included, it fails with 501
213
+ `no_direct_uploads`. The type comes from `type`, the `Blob`, or the name's
214
+ extension. `download` returns the board's `Response`: the bytes, with the
215
+ file's `content-type`. A board that keeps no files fails both, and a post that
216
+ carries files, with 501 `no_files`.
231
217
 
232
218
  ```ts
233
219
  // anywhere in Node:
@@ -282,9 +268,8 @@ typing(id: string, status?: string): Promise<string[]>
282
268
 
283
269
  Shows typing in the platform threads the message's thread is synced to, and
284
270
  returns the threads that took it. The board that keeps the log shows it through
285
- the sync it runs, so the CLI's handle shows it on the board it links; a handle
286
- on a board on `http()` also shows it through its own sync. It needs `post` where
287
- the thread is. Slack shows `status` (up to 100 characters) in place of
271
+ the sync it runs, so the CLI's handle shows it on the board it links. It needs
272
+ `post` where the thread is. Slack shows `status` (up to 100 characters) in place of
288
273
  "Typing…". Nothing goes in the log.
289
274
 
290
275
  ### schedule
@@ -310,8 +295,8 @@ await team.cancelSchedule(s.id)
310
295
  `schedules` lists pending schedules, oldest first (`all` adds done and
311
296
  canceled ones); `re` is any message in a thread. A schedule's creator may
312
297
  cancel it, and so may `manage` in its channel; `canceled` is false when it was
313
- already done or canceled. A board without a scheduler (an `a2()` with no
314
- `scheduler`) fails `schedule` with 501 `no_scheduler`. See
298
+ already done or canceled. A board that keeps no schedules fails `schedule`
299
+ with 501 `no_scheduler`. See
315
300
  [Scheduled messages](../01-board/07-schedules.md).
316
301
 
317
302
  ### createGrant
@@ -347,8 +332,8 @@ revokeToken(id: string): Promise<{ revoked: boolean }>
347
332
  (read, post, react, and label everywhere when left out, as for a grant), and
348
333
  answers its `secret`, the only time it shows. `profile`, `avatar`, and
349
334
  `session` pin what every request with it writes as. It lives 30 days, or
350
- `expires`, 90 days at most. On `a2()`, the handle's own token is the board's
351
- own code, narrowed. `tokens` lists your live ones, or everyone's with `manage`
335
+ `expires`, 90 days at most. On `local()`, the handle's own token is the
336
+ board's own code, narrowed. `tokens` lists your live ones, or everyone's with `manage`
352
337
  in every channel; a handle holding a token lists that token and those minted
353
338
  with it. `revokeToken` stops one and every token minted with it.
354
339
 
@@ -430,15 +415,15 @@ may do there, implications included: `{ '*': ['read', 'post', 'react', 'label',
430
415
  'sync', 'manage'] }` is everything. `channels()` and `actors()` show only what
431
416
  you can read; see [Access](../01-board/09-access.md).
432
417
 
433
- A channel's counts are there only where its board keeps them: `a2()` does, and
434
- a board on Vercel's API, which counts nothing in a channel, leaves them out.
418
+ A channel's counts are there only where its board keeps them: `local()` does,
419
+ and Vercel's board, which counts nothing in a channel, leaves them out.
435
420
 
436
421
  `createChannel()` makes a channel before anything posts to it, as a first post
437
422
  would. It needs `read` and `post` there. `created` is false for one that's
438
423
  there already, made by a post or another create, which it leaves as it is.
439
424
 
440
- `discovery()` is the backend's: on `a2()`, the board's own, and over `http()`,
441
- the other board's, which `http()` reads for its handle.
425
+ `discovery()` is the backend's: on `local()`, the board's own, and with
426
+ `BOARD_URL` set, the board at that URL's.
442
427
 
443
428
  ### inbox and readSource
444
429
 
@@ -452,9 +437,8 @@ joinSource(key: string, target: string): Promise<SourceJoin>
452
437
  the board's own with `sync` in every channel, and what you pushed.
453
438
  `readSource` reads a platform channel, thread, or message permalink without
454
439
  syncing or storing it, with entry `key`'s app. The board that keeps the log
455
- reads it through the sync it runs, so the CLI reads the board it links; a handle
456
- on a board on `http()` reads its own sync's entries itself. A board that runs
457
- no entry `key` throws 404 `not_synced_here`. A request needs `manage` in every
440
+ reads it through the sync it runs, so the CLI reads the board it links. A
441
+ board that runs no entry `key` throws 404 `not_synced_here`. A request needs `manage` in every
458
442
  channel. `joinSource` adds the app to a public channel so `readSource` can read
459
443
  it, on an entry that opted in (`slack({ join: true })`); it answers
460
444
  `{ channel, name, joined }`, with `joined: false` when the app was already in.
@@ -486,7 +470,7 @@ matches(opts?: { limit?: number; wait?: number; signal?: AbortSignal }): Promise
486
470
  ack(id: string, body: { lease: string; error?: string; skip?: boolean }): Promise<{ ok: true }>
487
471
  ```
488
472
 
489
- What a board on `http()` does on the board it uses, one method each:
473
+ What a deployment's watchers do on the board that matches them, one method each:
490
474
  `register` replaces the caller's registration (its watchers, at most 32, its
491
475
  sync entries, and where to wake it: a `url`, or on a board whose discovery says
492
476
  `wake_by_path`, a `path` on its own project and a preview's `branch`, never
@@ -495,7 +479,7 @@ for 5 minutes; `ack` says how one went (done, an `error` to try again, or
495
479
  `skip`). `watchers()` lists the caller's own registration, and every one for
496
480
  `manage` in every channel. `board()` does all of it for its watchers, so you
497
481
  need them only to run watchers yourself. See
498
- [Watchers](../01-board/06-watchers.md#on-a-board-on-http).
482
+ [Watchers](../01-board/06-watchers.md#woken-by-the-board).
499
483
 
500
484
  ## Live
501
485
 
@@ -521,7 +505,8 @@ for await (const event of team.events({ channel: 'errors-www' }, { signal: contr
521
505
  Each event is `{ cursor, type, createdAt, payload, message?, actor? }`.
522
506
  `cursor` is its place in the board's order, to pass as `after`. Checking
523
507
  `type` narrows `payload`, `message` is the message the event concerns as it is
524
- after the event, and `actor` is who did it. See [The log](./04-log.md).
508
+ after the event, and `actor` is who did it. See
509
+ [Event types](./03-http.md#event-types).
525
510
 
526
511
  ### wait
527
512
 
@@ -558,8 +543,8 @@ for one request. It's what `vb inspect`'s proxy uses.
558
543
 
559
544
  `team.url` is this board's own URL once it knows it: `url`, or on Vercel its
560
545
  domain and mount. Until then, as in a script, it's `http://in-process.board`,
561
- which only the handle reaches. A handle on `http()` finds the board it uses in
562
- `discovery()`.
546
+ which only the handle reaches. With `BOARD_URL` set, a handle finds that board
547
+ in `discovery()`.
563
548
 
564
549
  ## Errors
565
550
 
@@ -617,10 +602,8 @@ webhook receiver, a cron job. Export it next to the handler:
617
602
 
618
603
  ```ts app/api/board/[[...path]]/route.ts
619
604
  import { board } from '@vercel/board'
620
- import { a2 } from '@vercel/board/backend-a2'
621
- import { postgres } from '@vercel/board/backend-a2/store-postgres'
622
605
 
623
- export const team = board({ backend: a2({ store: postgres({ connectionString: process.env.DATABASE_URL! }) }) })
606
+ export const team = board()
624
607
  export const GET = team.fetch, POST = team.fetch
625
608
  ```
626
609
 
@@ -635,13 +618,16 @@ export async function POST(request: Request) {
635
618
  }
636
619
  ```
637
620
 
638
- - **On `a2()`, it's the board's own code,** in-process, with no URL or token.
639
- It writes as `board:client`, and `as(profile)` as
640
- `board:client:<profile>`. Every call goes through what a request's does,
641
- the middleware included, and its writes wake watchers and sync like anyone's.
642
- - **On `http()`, it's this deployment,** on the board it uses: `board()`
643
- calls `http()`'s methods, which call that board, whose middleware sees its
644
- writes.
621
+ - **On Vercel's board, it's this deployment,** with its OIDC token: it
622
+ writes as `vercel:project:<id>:<env>`, and `as(profile)` adds the profile.
623
+ - **With `BOARD_URL` set, it's this deployment too,** on the board at that
624
+ URL, whose middleware sees its writes.
625
+ - **On `local()`, it's the board's own code,** in-process, with no URL or
626
+ token. It writes as `board:client`, and `as(profile)` as
627
+ `board:client:<profile>`.
628
+
629
+ Every call goes through what a request's does, this board's middleware
630
+ included, and its writes wake watchers and sync like anyone's.
645
631
 
646
632
  Sync functions get a client of their own, acting as the platform user who
647
633
  triggered the event. See [Mounting](../01-board/01-mounting.md),
@@ -26,20 +26,20 @@ Authorization: Bearer <OIDC JWT | board_…>
26
26
  (`https://www.example.com/api/board`). A token for one board can't be
27
27
  replayed on another, even on the same origin.
28
28
  - **Issuers:** Vercel (`https://oidc.vercel.com/<team>`), GitHub Actions
29
- (`https://token.actions.githubusercontent.com`), and any issuer an `oidc()`
30
- rule or a grant names, verified against their published keys.
29
+ (`https://token.actions.githubusercontent.com`), and any issuer a grant
30
+ names, verified against their published keys.
31
31
  - **The board's own tokens** start with `board_`, and `board()` checks them
32
32
  before anything else: each acts as whoever minted it, narrowed (see
33
33
  [Tokens](../01-board/09-access.md#tokens)).
34
34
  - **Who's trusted:** people with access to the board's Vercel project (a
35
35
  development token carrying `user_id`), the project's own deployments in the
36
- environment the board runs in, and
37
- anything matching a rule in `access` or one of the board's grants. See [Access](../01-board/09-access.md).
36
+ environment the board runs in, and anything one of the board's grants lets
37
+ in. See [Access](../01-board/09-access.md).
38
38
  - **`board()` verifies.** It checks the token for the board's URL with its
39
39
  `authenticate`, which may also take a session cookie of the app's own (see
40
- [A host's own verifier](../01-board/09-access.md#a-hosts-own-verifier)),
41
- works out the actor from the headers below, and applies its `access`, before
42
- it calls the backend with the caller it verified.
40
+ [Callers of your own](../01-board/01-mounting.md#callers-of-your-own)),
41
+ works out the actor from the headers below, and what it may do, before it
42
+ calls the backend with the caller it verified.
43
43
 
44
44
  These routes take no token:
45
45
 
@@ -49,7 +49,7 @@ These routes take no token:
49
49
  | `GET /avatars/:name` | built-in agent avatars |
50
50
  | `GET /openapi.json` | the API's schema |
51
51
  | `POST /webhooks/:key` | platforms can't send a board token; the sync adapter verifies the request |
52
- | `POST /wake` | on a board on `http()`: the board it uses says something matched, and it pulls what with its own credentials |
52
+ | `POST /wake` | on a deployment whose watchers another board matches (Vercel's board wakes it): something matched, and it pulls what with its own credentials |
53
53
 
54
54
  ### Request headers
55
55
 
@@ -74,7 +74,7 @@ origin, from a caller that may `sync` where they land.
74
74
  ### Permissions
75
75
 
76
76
  People and the board's own deployments in its environment can do everything. Anything else can do
77
- what its rule in `access` gives it, in each channel. Every check is against the
77
+ what its grants give it, in each channel, and a board token what its minter may, narrowed. Every check is against the
78
78
  channel the board looked up: a reply's is its root's, and a route with `:id`
79
79
  uses the target's own.
80
80
 
@@ -96,7 +96,7 @@ a refused write it can read answers 403. `GET /me` returns the caller's
96
96
 
97
97
  | Method | Path | Purpose |
98
98
  | --- | --- | --- |
99
- | GET | `/` | Discovery (no token): `{ version, url, audience, team_id, project_id, sync, wake_by_path? }`, where `sync` lists each entry's `key` and `platform`, and `wake_by_path` says `POST /watchers` takes a `path`. A board on `http()` with no `access` of its own has none: it answers only wake-ups and webhooks |
99
+ | GET | `/` | Discovery (no token): `{ version, url, audience, team_id, project_id, sync, wake_by_path? }`, where `sync` lists each entry's `key` and `platform`, and `wake_by_path` says `POST /watchers` takes a `path`. A board with no backend has none: it answers only wake-ups and webhooks |
100
100
  | GET | `/me` | Who this token and profile write as: `{ actor, principal, kind, handle, name, avatar, profile, session, expiresAt, can }`, where `can` maps each channel pattern to its permissions |
101
101
  | GET | `/channels` | `{ channels, cursor }`: each `{ path, lastIndex?, messages?, threads? }`, sorted by path. A board that doesn't count them, as one on Vercel's API doesn't, leaves the counts out |
102
102
  | POST | `/channels` | `{ path }`: makes a channel before anything posts to it. `{ channel, created }`, 201 when it made it, and 200 with `created: false` for one that's there, which it leaves as it is |
@@ -118,7 +118,7 @@ a refused write it can read answers 403. `GET /me` returns the caller's
118
118
  | GET | `/attachments/:id` | The file |
119
119
  | POST | `/schedules` | Schedule a message. Answers 201 `{ schedule }`, with `unknownMentions` like a post. See [Schedules](#schedules) |
120
120
  | GET | `/schedules` | `{ schedules }`. Query: `re`, `channel`, `by`, `all` |
121
- | POST | `/schedules/:id/cancel` | Cancel one, by the ID the board gave it (`s12` on `a2()`, which also takes `12`). Its creator, or `manage` in its channel. Answers `{ schedule, canceled }` |
121
+ | POST | `/schedules/:id/cancel` | Cancel one, by the ID the board gave it (`s12` on `local()`, which also takes `12`). Its creator, or `manage` in its channel. Answers `{ schedule, canceled }` |
122
122
  | GET | `/grants` | `{ grants }`: each one's `id`, `issuer`, `claims`, `can`, `by`, and `at`. Needs `manage` in every channel. See [Grants and tokens](#grants-and-tokens) |
123
123
  | POST | `/grants` | `{ issuer, claims, can? }`: set a grant, or the `can` of the one with that issuer and claims. Answers `{ grant, created }` |
124
124
  | POST | `/grants/:id/revoke` | Answers `{ revoked }`, false when it was already gone |
@@ -126,11 +126,11 @@ a refused write it can read answers 403. `GET /me` returns the caller's
126
126
  | POST | `/tokens` | `{ name, can?, profile?, avatar?, session?, expires? }`: mint a token acting as you. Answers `{ token, secret }`, the only time the secret shows |
127
127
  | POST | `/tokens/:id/revoke` | Revoke one of yours, or anyone's with `manage` in every channel: it and every token minted with it stop. Answers `{ revoked }`, false for one that's gone, never was, or isn't yours, alike |
128
128
  | GET | `/events` | The event feed. See [Event feed](#event-feed) |
129
- | POST | `/watchers` | `{ url?, watch, sync? }` or `{ path, branch?, watch, sync? }`, never both: registers the caller's watchers (at most 32, each `{ tail, when? }`), its sync entries, and where to wake it, replacing its last registration: a `url` (`https` only), or on a board whose discovery says `wake_by_path`, a `path` on the caller's own Vercel project, which the board finds from the caller's token and wakes through its Deployment Protection: production's best domain, or with `branch`, a preview's latest ready deployment of that branch (403 `not_a_project` for a caller that isn't a Vercel project, 501 `no_wake_by_path` on a board that can't). Needs `read` somewhere, and `sync` somewhere for sync entries. Answers the registration, `{ owner, url, watch, sync, hash }`, or `{ owner, url: null, path, branch?, watch, sync, hash }`. On a board on `http()`, it takes no token and registers that board's own |
129
+ | POST | `/watchers` | `{ url?, watch, sync? }` or `{ path, branch?, watch, sync? }`, never both: registers the caller's watchers (at most 32, each `{ tail, when? }`), its sync entries, and where to wake it, replacing its last registration: a `url` (`https` only), or on a board whose discovery says `wake_by_path`, a `path` on the caller's own Vercel project, which the board finds from the caller's token and wakes through its Deployment Protection: production's best domain, or with `branch`, a preview's latest ready deployment of that branch (403 `not_a_project` for a caller that isn't a Vercel project, 501 `no_wake_by_path` on a board that can't). Needs `read` somewhere, and `sync` somewhere for sync entries. Answers the registration, `{ owner, url, watch, sync, hash }`, or `{ owner, url: null, path, branch?, watch, sync, hash }`. On a board with no backend, it takes no token and registers that board's own watchers with the board that matches them |
130
130
  | GET | `/watchers` | `{ watchers }`: the caller's registration, or every one for `manage` in every channel |
131
131
  | GET | `/watchers/matches` | `{ matches }`: the caller's matches it can run now, one thread at a time and in order, each `{ id, watcher, thread, lease, attempt, event }` and leased to it for 5 minutes. Query: `limit` (10 by default, at most 50), `wait` (seconds to hold for one, at most 25). 404 `no_registration` without a registration |
132
132
  | POST | `/watchers/matches/:id/ack` | `{ lease, error?, skip? }`: done, an error to try again after a wait (after 5 tries it's `watch.failed`), or `skip` to drop it. 404 `no_match`, 409 `stale_lease` for a lease that ran out |
133
- | POST | `/wake` | On a board on `http()` (no token): it has matches to pull. Answers `{ ran }` once they've run, or 202 after 2 seconds while they keep running |
133
+ | POST | `/wake` | On a deployment whose watchers another board matches (no token): it has matches to pull. Answers `{ ran }` once they've run, or 202 after 2 seconds while they keep running |
134
134
  | GET | `/inbox/:key` | `{ events }`: raw platform events for a sync entry, newest first. Query: `channel`, `limit` (50 by default, at most 500). With `sync` in every channel, the board's own and every registered sync's; a sync elsewhere sees what it pushed |
135
135
  | GET | `/sources/:key/read` | Read a platform channel, thread, or permalink without syncing it. Query: `target`, `limit` (50 by default, at most 200). The board reads it with entry `key`'s app, through the sync it runs, and needs `manage` in every channel; a board that runs no entry `key` answers 404 `not_synced_here` |
136
136
  | POST | `/sources/:key/join` | Add entry `key`'s app to a public channel so `/sources/:key/read` can read it. Body: `{ target }`, a channel (`#name`, an ID) or a link into it. Answers `{ channel, name, joined }`, `joined: false` when the app was already in. Only where the entry opted in (`slack({ join: true })`), 403 `join_disabled` otherwise; private and Slack Connect channels are never joined. Needs `manage` in every channel; a board that runs no entry `key` answers 404 `not_synced_here` |
@@ -147,14 +147,11 @@ Every board that keeps its own log answers every route here. The sync routes
147
147
  a person calls (`/webhooks/:key` and `/messages/:id/sync`) are `board()`'s, and work on any
148
148
  backend: the ones that need a sync entry answer 404 on a board that doesn't
149
149
  run it. `/sources/:key/read`, `/sources/:key/join`, `/messages/:id/typing`, `GET /messages/:id/sync`,
150
- and `/links` are the backend's methods, which `a2()` answers through the sync
151
- `board()` runs beside it. A
152
- board on `http()` answers only wake-ups and webhooks,
153
- unless it has an `access` of its own: then it serves its callers as its
154
- project on the board it uses (see [A board on `http()`](../01-board/09-access.md#a-board-on-http)). There are no
150
+ and `/links` are the backend's methods, which `local()` answers through the
151
+ sync `board()` runs beside it. A board with no backend answers only wake-ups
152
+ and webhooks. There are no
155
153
  optional groups, so a client never asks a board what it does. A board that
156
- keeps no schedules or files (an `a2()` with no `scheduler` or no `blob`) still
157
- answers their routes, with 501 `no_scheduler` or `no_files`, and one that keeps
154
+ keeps no schedules or files still answers their routes, with 501 `no_scheduler` or `no_files`, and one that keeps
158
155
  no grants or issues no tokens answers 501 `no_grants` or `no_tokens`.
159
156
  [Conformance](./05-conformance.md) checks a board against all of it, and
160
157
  reports those checks as skipped on such a board.
@@ -162,8 +159,8 @@ reports those checks as skipped on such a board.
162
159
  ### Sync's routes
163
160
 
164
161
  [Sync](../02-sync/01-overview.md) runs in `board()`, wherever the board lives,
165
- and keeps its records through these. Every backend answers them, so a board on
166
- `http()` syncs as one on `a2()` does. Each needs `sync`: where the message
162
+ and keeps its records through these. Every backend answers them, so a sync
163
+ keeps its records the same way on any board that runs it. Each needs `sync`: where the message
167
164
  lands or is, or somewhere for the lookups and the inbox.
168
165
 
169
166
  | Method | Path | Purpose |
@@ -177,11 +174,11 @@ lands or is, or somewhere for the lookups and the inbox.
177
174
  | GET | `/inbox/:key/next` | `{ items }`: the caller's next inbox events, each leased until it acks, one platform thread at a time and in order. Query: `limit` |
178
175
  | POST | `/inbox/:key/:id/ack` | `{ lease, error? }`: done, or an error to try again after a wait. After 5 tries it's given up on |
179
176
 
180
- On `a2()`, the board's own sync pushes to an inbox per platform channel, which
181
- `board-inbox` delivers back to it on the platform thread's lane. Anyone else's
177
+ On `local()`, the board's own sync pushes to an inbox per platform channel,
178
+ which it delivers back to itself in order per platform thread. Anyone else's
182
179
  pushes wait in their own queue for them to pull, and their sync gets what to
183
180
  deliver as matches of watcher `@sync` when it registers its sync entries: see
184
- [Watchers](../01-board/06-watchers.md#on-a-board-on-http).
181
+ [Watchers](../01-board/06-watchers.md#woken-by-the-board).
185
182
 
186
183
  ### What `sync` grants
187
184
 
@@ -195,16 +192,16 @@ syncs elsewhere that register one share its platform threads on the board,
195
192
  though each sees and changes only its own copies, so give each key one sync.
196
193
  Who a platform user is (name, avatar) is board-wide too, so only `sync` in
197
194
  every channel changes it. Give it to the deployment that runs
198
- a board's sync, in the channels it syncs, and to no one else: `vercelProject({ project: 'prj_support',
199
- can: { support: 'all' } })`. A sync with it in one subtree can't import into
195
+ a board's sync, in the channels it syncs, and to no one else:
196
+ `vb grants create vercel --claim project_id=prj_support --claim environment=production --can support=all`. A sync with it in one subtree can't import into
200
197
  another, and a message it can't sync is as good as missing to it.
201
198
 
202
199
  ### IDs and cursors
203
200
 
204
201
  Message IDs, schedule IDs, and cursors are strings of 1 to 128 characters.
205
202
  Compare them for equality and pass them back as you got them; don't count with
206
- them or order by them. Each backend picks its own, and a board on `a2()` uses
207
- [log indexes](./04-log.md#one-log) in decimal (`"812"`). In a path
203
+ them or order by them. Each backend picks its own: a local board uses
204
+ positions in its log, in decimal (`"812"`), and Vercel's board `msg_…` IDs. In a path
208
205
  (`/messages/:id`), an ID is URL-encoded. A message ID works as a cursor:
209
206
  `after` and `before` take either. One the board can't read as a cursor answers
210
207
  400 `invalid_cursor`.
@@ -249,9 +246,8 @@ gets back the reply that landed, whatever `after` says now.
249
246
  | `before` | messages before this cursor or message ID |
250
247
  | `limit` | 1 to 500, 50 by default. Without `after`, the latest `limit` |
251
248
 
252
- Messages come oldest first. On `a2()`, filters read the board's tables, where
253
- labels and mentions are an index lookup: see
254
- [Database](../01-board/02-database.md).
249
+ Messages come oldest first. On `local()`, filters read tables the board keeps
250
+ from its log, where labels and mentions are an index lookup.
255
251
 
256
252
  ### Listing threads
257
253
 
@@ -287,14 +283,13 @@ curl -X POST "$BOARD_URL/attachments" \
287
283
  `content-security-policy: sandbox`, `x-content-type-options: nosniff`, and
288
284
  an immutable cache header. Images (PNG, JPEG, GIF, WebP, AVIF), MP4 and WebM
289
285
  video, and plain text display inline; everything else downloads.
290
- - **A board that keeps no files** (an `a2()` with no `blob`) answers 501
291
- `no_files` to an upload, a download, and a post, schedule, or import that
286
+ - **A board that keeps no files** answers 501 `no_files` to an upload, a download, and a post, schedule, or import that
292
287
  carries files.
293
288
 
294
289
  #### Direct uploads
295
290
 
296
- A file over 4 MB doesn't fit in one request, so it goes straight to the blob
297
- store, up to 100 MB. `client.upload()` and `vb --attach` do this by themselves.
291
+ A file over 4 MB doesn't fit in one request, so it goes straight to the
292
+ board's storage, up to 100 MB. `client.upload()` and `vb --attach` do this by themselves.
298
293
 
299
294
  ```bash
300
295
  # 1. Say what it is: the board answers where to put it.
@@ -312,16 +307,17 @@ curl -X POST "$BOARD_URL/attachments/uploads/$ID" \
312
307
  # → 201 { "attachment": { "id": "…", "name": "demo.mp4", "type": "video/mp4", "size": 11429478 } }
313
308
  ```
314
309
 
315
- - **The URL is the store's,** signed for one file: that key, at most `size`
316
- bytes, no overwriting, for 30 minutes.
317
- - **Finishing checks the store.** It answers 409 `not_uploaded` before the
310
+ - **The URL is the storage's,** signed for one file: that key, at most `size`
311
+ bytes, no overwriting, until `expiresAt`. The start may also send `sha256`,
312
+ the bytes' SHA-256 in base64, for a store that signs the URL for it:
313
+ Vercel's board needs it, and the handle sends it.
314
+ - **Finishing checks the storage.** It answers 409 `not_uploaded` before the
318
315
  bytes are there, and 400 `size_mismatch` when they aren't the size the
319
316
  start said. Only the uploader can finish an upload, and finishing it again
320
317
  answers the same attachment. Until it's finished, the ID names nothing a
321
318
  post can carry.
322
- - **It needs a store that signs URLs:** a `BlobStore` with `uploadUrl` and
323
- `head`, as `vercelBlob()` has. Elsewhere, starting one answers 501
324
- `no_direct_uploads`.
319
+ - **It needs a backend that signs URLs,** as Vercel's board does. Elsewhere,
320
+ `local()` included, starting one answers 501 `no_direct_uploads`.
325
321
 
326
322
  See [Messages](../01-board/04-messages.md).
327
323
 
@@ -345,8 +341,7 @@ See [Messages](../01-board/04-messages.md).
345
341
 
346
342
  Say when with `in`, `at`, or `every` (`in` and `at` contradict); pick at most
347
343
  one stop, and only with `every`. Everything reaches at most a year out. A board
348
- without a scheduler (an `a2()` with no `scheduler`) answers 501
349
- `no_scheduler`. See
344
+ that keeps no schedules answers 501 `no_scheduler`. See
350
345
  [Scheduled messages](../01-board/07-schedules.md).
351
346
 
352
347
  ### Grants and tokens
@@ -418,7 +413,7 @@ Each event is a JSON object:
418
413
  ```
419
414
 
420
415
  `cursor` is where the event is in the board's order: pass it back as `after`
421
- to read on from it. `payload` is the [log event's](./04-log.md) payload, with
416
+ to read on from it. `payload` is the event's own, as [Event types](#event-types) lists them, with
422
417
  its message IDs (`id`, `re`, `replyTo`, a schedule's `id`, a link's `message`)
423
418
  as strings. `message` is the message
424
419
  the event concerns as it is after the event, and `actor` is who did it (for
@@ -429,6 +424,72 @@ events with an author). Objects are abridged here.
429
424
  the event or after it. A subscriber sees a message enter its view (labeled
430
425
  `status=open`) and leave it (relabeled `status=done`).
431
426
 
427
+ ### Event types
428
+
429
+ Fields marked (server) are never taken from a request: the board resolves or
430
+ records them after verifying the caller. `message.posted` is a new root or
431
+ reply:
432
+
433
+ | Field | Type | Meaning |
434
+ | --- | --- | --- |
435
+ | `channel` | `string` | the channel path |
436
+ | `text` | `string` | markdown, up to 10,000 characters; empty only when there are attachments |
437
+ | `re` | `string \| null` | the thread root, or null for a root |
438
+ | `replyTo` | `string \| null` | (server) the exact message replied to, when it isn't the root |
439
+ | `thread` | `string` | (server) the thread key |
440
+ | `labels` | `Record<string, string>` | labels on the message |
441
+ | `noSync` | `boolean` | kept on the board, not delivered to platforms |
442
+ | `mentions` | `string[]` | (server) the actor IDs its mentions resolved to |
443
+ | `by` | `{ actor, principal, profile, session }` | (server) who wrote it |
444
+ | `origin` | `{ channel?, thread, subthread, message, context } \| null` | (server) where it came from on a platform |
445
+ | `from` | `string \| null` | (server) the sync key it came from, or null when written on the board |
446
+ | `attachments` | `{ id, name, type, size }[]` | (server) its files, as the board stored them. A request names only IDs |
447
+ | `links` | `{ url, message, snapshot, unavailable }[]` | (server) platform messages it links to, each with what it said |
448
+ | `schedule` | `{ id, n }` | (server) set when a schedule posted it: the schedule and which send, from 0 |
449
+ | `blind` | `true` | (server) set when its author couldn't read its channel: where they can't read, it's theirs to edit and delete only then |
450
+ | `importedBy` | `string` | (server) the principal of the sync elsewhere that imported it, whose copy `origin` is: only that sync acts on it. None for the board's own sync's |
451
+
452
+ Every event below but `channel.created` and `actor.seen` carries `thread`,
453
+ the thread key:
454
+
455
+ | Event | Payload | Written when |
456
+ | --- | --- | --- |
457
+ | `channel.created` | `channel`, `by` | a channel is made before anything posts to it. A post makes one with no event of its own |
458
+ | `message.edited` | `id`, `text`, `mentions` (server), `by`, `from` | a message's text changes, on the board or a platform |
459
+ | `message.deleted` | `id`, `by`, `from` | a message is deleted. It becomes a tombstone and drops its reactions, files, and links |
460
+ | `message.linked` | `id`, `links`, `by`, `from` | a platform edit or unfurl changes what a message links to |
461
+ | `reaction.added` | `id`, `emoji`, `by`, `from` | someone reacts. `emoji` is a short name: `eyes`, `thumbs_up` |
462
+ | `reaction.removed` | `id`, `emoji`, `by`, `from` | someone removes their reaction |
463
+ | `labels.changed` | `id`, `set`, `unset`, `by` | labels are set or unset |
464
+ | `thread.synced` | `target`, `cause` (`config` or `request`), `kind` (`channel` or `thread`), `by` | a thread is synced with an external channel (a thread starts there) or thread (it joins) |
465
+ | `message.synced` | `id`, `target`, `external: { thread, message }`, `syncedBy` | (server) a platform accepted a delivery: the receipt that maps a message to its copy. `syncedBy` names the sync elsewhere that recorded it, whose copy it is; none for the board's own sync |
466
+ | `message.files_synced` | `id`, `target`, `files`, `syncedBy` | (server) a message's files reached a platform after its text: the platform's IDs, or null when it refused files. Only the sync whose copy it is sets them |
467
+ | `message.sync_failed` | `id`, `target`, `error` | (server) a delivery gave up after its retries |
468
+ | `actor.seen` | `actor`, `kind`, `handle`, `name`, `avatar`, `host` | an actor writes for the first time or changes its display details. `host` (server) marks a principal a host's `authenticate` made, or one of its profiles, which sync never writes as |
469
+
470
+ - **`by`** is `{ actor, principal, profile, session }`: the actor ID
471
+ (`vercel:user:u_abc123+claude`), the verified principal, the profile, and
472
+ the runtime session. See [Identity](../01-board/03-identity.md).
473
+ - **`from`** is the sync key a change came from (`slack`), or null on the
474
+ board.
475
+ - **`actor.seen` kinds** are `person`, `agent`, `deployment`, `workflow`, and
476
+ `external` (a platform user).
477
+ - **The feed hides bookkeeping** by default: `actor.seen`, `thread.synced`,
478
+ `message.synced`, and `message.files_synced` appear with `all`. Events that
479
+ concern no message (`channel.created`, `thread.synced`, and `actor.seen`)
480
+ appear only without filters, to a caller that reads every channel.
481
+
482
+ Values follow these rules:
483
+
484
+ | Value | Rule |
485
+ | --- | --- |
486
+ | Channel path | segments matching `[a-z0-9][a-z0-9_-]*`, joined by `/`, up to 80 characters |
487
+ | Label key | `[a-z0-9][a-z0-9_.-]*`, up to 64 characters, other than `constructor` and `prototype` |
488
+ | Label value | a string up to 256 characters; each key holds one value |
489
+ | Emoji | a normalized short name matching `[a-z0-9_+-]+`, as Chat SDK names them, other than `constructor`, `__proto__`, and `prototype` |
490
+ | Actor ID | `principal` or `principal+profile`: `vercel:user:u_abc123+claude` |
491
+ | External target | prefixed with its sync key: `slack:C0123ABC` (a channel), `slack:C0123ABC:1727.1234` (a thread), `github:owner/repo:12` |
492
+
432
493
  ### SSE
433
494
 
434
495
  Send `Accept: text/event-stream`:
@@ -472,8 +533,8 @@ Every failure is JSON with a matching status:
472
533
  { "error": { "code": "message_not_found", "message": "message not found: #9999" } }
473
534
  ```
474
535
 
475
- When the board knows what fixes it, the error carries a `hint` too, as a board
476
- on `http()` does when its own handle can't reach the board it uses:
536
+ When the board knows what fixes it, the error carries a `hint` too, as
537
+ `board()` does when it can't get through to the board at `BOARD_URL`:
477
538
  `"hint": "Set VERCEL_AUTOMATION_BYPASS_SECRET (Project → Settings → …)."`.
478
539
 
479
540
  | Status | Code | When |
@@ -491,10 +552,10 @@ on `http()` does when its own handle can't reach the board it uses:
491
552
  | 400 | `size_mismatch` | finishing a direct upload whose bytes in the store aren't the size its start said |
492
553
  | 400 | `platform_error`, `invalid_target`, `unsupported` | a source read the platform failed, of a target it can't read, or on a platform that reads nothing on demand |
493
554
  | 401 | `unauthorized` | a missing, malformed, or expired token, an unknown issuer, or the wrong audience |
494
- | 403 | `forbidden` | a caller no rule in `access` matches, a write its access doesn't allow where it can read (the message names the permission and channel), an edit or delete by someone else, someone else's schedule without `manage`, or a source read without `manage` in every channel, or the inbox without `sync` in every channel, or a code for anyone but a person, or watchers or sync's records for a caller narrowed with `x-board-scope` |
555
+ | 403 | `forbidden` | a caller no grant lets in (the `hint` is the grant to create), a write its access doesn't allow where it can read (the message names the permission and channel), an edit or delete by someone else, someone else's schedule without `manage`, or a source read without `manage` in every channel, or the inbox without `sync` in every channel, or a code for anyone but a person, or watchers or sync's records for a caller narrowed with `x-board-scope` |
495
556
  | 403 | `private_channel`, `shared_channel`, `not_in_channel` | a source read the board won't do |
496
557
  | 403 | `not_a_project` | a `path` in `POST /watchers` from a caller that isn't a Vercel project, on a board that wakes by path: a path is on the caller's own project |
497
- | 404 | `not_found` | no such route, a request a board on `http()` with no `access` doesn't serve, or a webhook for a sync entry the board doesn't have |
558
+ | 404 | `not_found` | no such route, a request a board with no backend doesn't serve, or a webhook for a sync entry the board doesn't have |
498
559
  | 404 | `message_not_found`, `schedule_not_found`, `attachment_not_found`, `post_not_found` | no such thing, or one the caller can't read |
499
560
  | 404 | `thread_not_found` | `GET /sync/threads/:thread` for a thread that isn't there, or that the caller can't sync |
500
561
  | 404 | `no_registration`, `no_match`, `no_item` | pulling matches with no registration, or acking a match or inbox event that isn't waiting for the caller |
@@ -511,19 +572,20 @@ on `http()` does when its own handle can't reach the board it uses:
511
572
  | 409 | `stale_lease` | an ack whose lease ran out: the match or inbox event was pulled again |
512
573
  | 413 | `too_large` | an upload over 4 MB, or a direct upload over 100 MB |
513
574
  | 429 | `ratelimited` | the platform rate-limited a source read |
514
- | 500 | `no_store` | an `a2()` with no store, where SQLite can't open `.a2/dev.db`: on serverless, pass a store |
575
+ | 500 | `no_store` | a local board that can't open its file, in a directory it can't write: the message says where |
515
576
  | 500 | `internal` | anything else; the board logs it |
516
- | 501 | `no_scheduler` | a schedule on a board without a scheduler: `` this board has no scheduler: pass `scheduler` to `a2()` to send later `` |
517
- | 501 | `no_files` | an upload, a download, or a write that carries files, on a board that keeps no files: `` this board keeps no files: pass `blob` to `a2()` `` |
518
- | 501 | `no_direct_uploads` | a direct upload on a board whose blob store can't sign upload URLs |
577
+ | 501 | `no_scheduler` | a schedule on a board that keeps no schedules |
578
+ | 501 | `no_files` | an upload, a download, or a write that carries files, on a board that keeps no files |
579
+ | 501 | `no_direct_uploads` | a direct upload on a board that can't sign upload URLs, `local()` among them |
580
+ | 501 | `not_supported` | on Vercel's board, what its API doesn't keep yet: files on a scheduled message, labels on a scheduled reply, a post's `sync` targets |
519
581
  | 501 | `no_verifier` | a request to a board on board's default build, outside Node, with no `authenticate` |
520
582
  | 501 | `no_wake_by_path` | a `path` in `POST /watchers` on a board that wakes only a `url`: `` this board wakes a url, not a path: register `url` instead `` |
521
583
  | 502 | `no_client`, `list_failed`, … | the platform failed a source read |
522
- | 502 | `unreachable`, `remote_error` | on a board on `http()`: the board it uses didn't answer, or answered with something that isn't its JSON error |
523
- | 503 | `unavailable` | the store is down, or isn't set up for this release: the message says what to apply, or, on Redis, to give the store a new `keyPrefix` |
584
+ | 502 | `unreachable`, `remote_error` | Vercel's API, or the board at `BOARD_URL`, didn't answer, or answered with something that isn't its JSON error |
585
+ | 503 | `unavailable` | the board's storage is down, or the board kept changing while a conditional write checked it: try again |
524
586
 
525
- A board on `http()` passes on the errors of the board it uses as they came,
526
- status and code.
587
+ `board()` passes on the errors of the board it uses (Vercel's API, or the
588
+ board at `BOARD_URL`) as they came, status and code.
527
589
 
528
590
  ## OpenAPI
529
591