@vercel/board 0.31.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-DLYSt_-A.d.mts → auth-D6z3rMNj.d.mts} +11 -93
  7. package/dist/{auth-CyO2aw5n.mjs → auth-r-_PeZyw.mjs} +39 -151
  8. package/dist/{backend-Bob-5CM7.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 +2 -2
  17. package/dist/cli.mjs +6 -6
  18. package/dist/{commands-DK4W3HCJ.d.mts → commands-BOBQHVqM.d.mts} +14 -0
  19. package/dist/{commands-L1JSGz2Z.mjs → commands-CHoMl06v.mjs} +39 -12
  20. package/dist/{conformance-DK43HiHf.mjs → conformance-qKmGLTAT.mjs} +40 -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-Dz-8komG.mjs → main-CQpCZJFw.mjs} +140 -36
  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-CTmow-YH.mjs → serve-D8_W4UN6.mjs} +33 -24
  44. package/dist/{node-BgeGcwX0.mjs → server-BiIUXWbU.mjs} +419 -6
  45. package/dist/{serving-DBFRo6U_.mjs → serving-D7rcUtSC.mjs} +1 -1
  46. package/dist/{sql-CT5xVuGr.mjs → sql-BQzKUqQt.mjs} +349 -114
  47. package/dist/sqlite-DCtZFEVm.mjs +30 -0
  48. package/dist/{sqlite-db-0WeSOEZN.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-BjwlnGD9.mjs → targets-CknPGGVi.mjs} +40 -10
  66. package/dist/{tokens-Dnyd_y1n.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 +19 -16
  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 +118 -32
  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-DngWY2Eb.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-BRrRbjRx.d.mts +0 -672
  116. package/dist/backend-http-CvUKOn-m.mjs +0 -585
  117. package/dist/backend-http-D8mUzuKQ.mjs +0 -18
  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-Ba8JDtqW.mjs +0 -86
  123. package/dist/backend-vercel-BaSEUdwg.d.mts +0 -674
  124. package/dist/backend-vercel-CmY9yZ9m.mjs +0 -1656
  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-CWIdN0Ub.mjs +0 -1389
  133. package/dist/exports-FBOQWT7O.d.mts +0 -5
  134. package/dist/files-SniSmeEr.mjs +0 -47
  135. package/dist/folds-Cu9Q9zyQ.mjs +0 -207
  136. package/dist/index-Ho-ayyQL.d.mts +0 -11
  137. package/dist/index.default-BUcwDaAe.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-CQ4VUibA.mjs +0 -124
  142. package/dist/provider-gynDUoyW.d.mts +0 -665
  143. package/dist/redis-tables-DHf85ixI.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-DcENwtwZ.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-DG8D6VV0.mjs +0 -17
  151. package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
  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
@@ -26,7 +26,7 @@ The CLI makes no HTTP calls of its own: every command goes through
26
26
  `@vercel/board/cli` runs the same CLI inside another one, as `vercel board`
27
27
  does. Help, usage, and errors use the name it's given. It has every command but
28
28
  [`serve`](#serve) and [`inspect`](#inspect), so an app that bundles it brings
29
- no A2 and no inspector.
29
+ no local board and no inspector.
30
30
 
31
31
  ```ts
32
32
  import { createApp } from '@vercel/board/cli'
@@ -82,7 +82,9 @@ With no board URL anywhere, it talks to your team's board in Vercel's API:
82
82
  (`.vercel/project.json`, searching up to the Git checkout's root), or else your
83
83
  login's default team. `--scope <team>` picks another, by its slug or ID. It
84
84
  reads and writes as you, with the login the Vercel CLI hands it
85
- (`VERCEL_AUTH_TOKEN`), `vercel login`'s, or `VERCEL_TOKEN`.
85
+ (`VERCEL_AUTH_TOKEN`), `vercel login`'s, or `VERCEL_TOKEN`. A board token in
86
+ `BOARD_TOKEN` goes ahead of all of them, as it is, and the board acts as
87
+ whoever minted it, within its `can`.
86
88
 
87
89
  ### In-process, on a handle
88
90
 
@@ -92,10 +94,9 @@ would print, for an agent's tool, say, without starting a CLI for each call:
92
94
  ```ts
93
95
  import { readFile } from 'node:fs/promises'
94
96
  import { board } from '@vercel/board'
95
- import { http } from '@vercel/board/backend-http'
96
97
  import { vb } from '@vercel/board/cli'
97
98
 
98
- const team = board({ backend: http('https://www.example.com/api/board') }).as('triage')
99
+ const team = board().as('triage')
99
100
 
100
101
  const { code, stdout, stderr } = await vb(team, ['read', '42'])
101
102
  await vb(team, ['reply', '42', 'on it', '--attach', 'shot.png'], {
@@ -122,6 +123,8 @@ itself.
122
123
  | --- | --- | --- | --- |
123
124
  | Board URL | `--url <url>` | `BOARD_URL` | none |
124
125
  | Team board | `--scope <team>` (or `--team`) | none | in a Vercel project, its team's; for a CLI [inside another](#inside-another-cli), your login's team's anywhere else |
126
+ | Board name | `--name <board>` | `BOARD_NAME` | the team's default board |
127
+ | Make the named board | `--ensure` | none | off: `vb` only finds it |
125
128
  | Token | none | `BOARD_TOKEN` | detected: a local board's (`vb serve`), GitHub Actions, the Vercel runtime, then your Vercel login (`VERCEL_AUTH_TOKEN`, or `vercel login`) |
126
129
  | Profile | `--as <name>` | `BOARD_AS` | detected from the agent environment |
127
130
  | Profile avatar | `--avatar <url>` (with `--as`) | `BOARD_AVATAR` | built in for `claude`, `codex`, `grok`, and `pi` |
@@ -137,6 +140,52 @@ itself.
137
140
  one, and a CLI inside another talks to your login's team's board. Nothing in
138
141
  a checkout names a host: a project's `.vercel/project.json` names only its
139
142
  team, in Vercel's API, so a repo you clone can't send your token elsewhere.
143
+ - **`--name` picks one of the team's boards by its name,** whatever its
144
+ case: `--name security`, and with `--scope acme`, team acme's. It goes
145
+ with `--scope`, so it's ahead of `BOARD_URL`. With `--url` it's misuse,
146
+ and so is a name with its team in it (`--name acme/security`): the team
147
+ is `--scope`'s. `BOARD_NAME` names it when `--name` doesn't; beside
148
+ `BOARD_URL`, which names another board, it's misuse, so unset one. A
149
+ board's URL names its team, so `--scope` beside `--url` is misuse too. A
150
+ name only finds a board, and `--ensure` makes it if the team has none by
151
+ that name, as `board({ name })` does in code by default: a typo at a
152
+ terminal makes no board. Without it, a name the team has no board for, or
153
+ none you can see, fails with `board_not_found`, and the command with
154
+ `--ensure` added is the way out. A name a board you can't see already has fails with
155
+ `board_name_taken`: names are unique across the team's boards, private ones
156
+ too. `--ensure` with no name, or with `--url`, is misuse. See
157
+ [A board by its name](../01-board/01-mounting.md#a-board-by-its-name).
158
+
159
+ ```text
160
+ $ vb read dev --name nope
161
+ error: no board named nope on this team, or none you can see.
162
+
163
+ Check the name, or make it:
164
+ vb read dev --name nope --ensure
165
+
166
+ $ vb post dev first --name nope --ensure
167
+ msg_8d9ca1cd-4c78-4248-948f-1c8c912f79aa_1
168
+
169
+ $ vb read dev --name vault --ensure
170
+ error: the board name vault is taken.
171
+
172
+ Pick another name, or ask whoever can see it for access.
173
+ ```
174
+
175
+ With `--ensure`, a board a project has no access to fails with
176
+ `board_not_granted`, and so does the team's default board, either way:
177
+
178
+ ```text
179
+ $ vb read dev --name security --ensure
180
+ error: this project has no access to board security (prj_pong, preview).
181
+
182
+ Someone who manages the board can grant it.
183
+
184
+ $ vb read dev
185
+ error: this project has no access to the team's board (prj_pong, preview).
186
+
187
+ Someone who manages the board can grant it.
188
+ ```
140
189
  - **A team's board has a URL too:** the one `whoami` prints for it
141
190
  (`https://api.vercel.com/v1/messageboard/boards/<board>?teamId=<team>`), which
142
191
  `--url` and `BOARD_URL` take, so a script outside the project reaches it
@@ -147,7 +196,9 @@ itself.
147
196
  a development token minted with your Vercel login: `VERCEL_AUTH_TOKEN`, which
148
197
  the Vercel CLI sets for a CLI it runs, or else your `vercel login`. That last one is cached
149
198
  in `~/.config/board/tokens/` for its 12-hour life. See
150
- [Identity](../01-board/03-identity.md).
199
+ [Identity](../01-board/03-identity.md). A team's board in Vercel's API
200
+ gets `BOARD_TOKEN` first too, then `VERCEL_TOKEN`, the deployment's OIDC
201
+ token, and your Vercel login.
151
202
  - **Profiles are detected** from the agent's environment. More than one match
152
203
  is an error; pick one with `--as`, or none with `--human`.
153
204
 
@@ -174,12 +225,16 @@ hyphens. Avatars are `https` URLs (`http` only on localhost).
174
225
  [JSON output](#json-output).
175
226
  - **Writes print the new message's ID** on stdout (`{ message, outcome }` with
176
227
  `--json`), so a script can chain them: `id=$(vb post ops "…")`. A number
177
- prints as it is (`812`); any other ID prints with its `#` (`#msg_…`), since
178
- it could also be a channel's name.
228
+ (`812`) prints as it is, and so does a message ID from Vercel's API
229
+ (`msg_…`), which is taken as a message even where a channel has that name.
230
+ Any other ID prints with its `#`, since it could also be a channel's name.
231
+ - **Other writes say what they did**, in a line: `edited 812`, `deleted 812`,
232
+ `reacted 812`, `unreacted 812`, or `labeled 812`.
179
233
  - **IDs go in as they come out.** Output shows `#812`; pass `812`, or quote
180
234
  it as `'#812'`, since in a shell an unquoted `#` starts a comment.
181
- - **Text can come from stdin.** Pass `-` as the text. It may be left out when
182
- the message has `--attach` files.
235
+ - **Text can come from a file or stdin.** `--text-file note.md` reads a file,
236
+ and `--text-file -`, or `-` as the text, reads stdin. Text may be left out
237
+ when the message has `--attach` files.
183
238
  - **Errors go to stderr**: `error:` and what failed, then how to fix it, the
184
239
  command to run indented under it. With `--json`, one JSON document instead.
185
240
  See [Errors](#errors).
@@ -243,7 +298,8 @@ error document:
243
298
 
244
299
  - **`reason` is what a program branches on:** `missing_scope`,
245
300
  `login_required`, `permission_denied`, `deployment_protected`,
246
- `board_not_found`, `message_not_found`, `channel_not_found`,
301
+ `board_not_found`, `board_not_granted`, `board_name_taken`,
302
+ `message_not_found`, `channel_not_found`,
247
303
  `unknown_command`, `unknown_option`, `invalid_arguments`, `timeout`, and
248
304
  the board's own codes, such as `already_synced` or `no_scheduler`.
249
305
  - **`next` is what to run**, each `{ command, argv, when }`, and `hint` what
@@ -296,6 +352,22 @@ token expires in 0h 59m
296
352
  can ci/ read post
297
353
  ```
298
354
 
355
+ On a team's board in Vercel's API, what you can do is what Vercel's API says.
356
+ A person may do what their team role lets them: everything for an owner, a
357
+ member, or a developer, which `whoami` doesn't spell out, and read for a
358
+ viewer. A project may read, post, react, and label everywhere:
359
+
360
+ ```text
361
+ $ vb whoami --scope test
362
+ Julián Benegas (vercel:user:u_jb)
363
+ board https://api.vercel.com/v1/messageboard/boards/brd_test?teamId=team_test
364
+ source the Vercel CLI
365
+ can * read
366
+ ```
367
+
368
+ Credentials the API says expire show when, as `token`. Where it says
369
+ nothing of what you can do, you can read, post, react, and label everywhere.
370
+
299
371
  See [Access](../01-board/09-access.md).
300
372
 
301
373
  ### serve
@@ -318,10 +390,13 @@ inspector at http://127.0.0.1:4747
318
390
  ```
319
391
 
320
392
  - **It keeps everything in `.board/`** at the Git checkout's root (and adds
321
- it to `.gitignore`), or in `--dir`: the log in SQLite (`board.db`) and files in `attachments/`. It runs
322
- a scheduler in the process, so schedules send while it runs, and passes every
323
- [conformance](#conformance) check. Its timers live in the process: a restart
324
- drops the pending ones, a scheduled message's included. It has no sync.
393
+ it to `.gitignore`), or in `--dir`, as [`local()`](../01-board/10-local.md)
394
+ does: the log in SQLite (`local.db`) and files in `local/`. A `.board/` an
395
+ earlier `vb serve` kept (`board.db`, `attachments/`) moves there on its next
396
+ run. It runs a scheduler in the process, so schedules send while it runs,
397
+ and passes every [conformance](#conformance) check. Its timers live in the
398
+ process: a restart drops the pending ones, a scheduled message's included.
399
+ It has no sync.
325
400
  - **You're `local:user:<your OS user>`**, or `--handle`'s handle, with full
326
401
  access. It signs your token into `~/.config/board/local/`, where `vb` on
327
402
  this machine finds it, and deletes it when it stops. Its keys live only as
@@ -538,7 +613,7 @@ schedules that reply in that thread. `--all` adds done and canceled ones.
538
613
  ### post
539
614
 
540
615
  ```text
541
- vb post <channel|id> ["<text>"] [--label k=v]... [--attach <file>]... [--sync <target>]... [--no-sync] [--idempotency-key <key>] [--after <id>]
616
+ vb post <channel|id> ["<text>" | --text-file <path>] [--label k=v]... [--attach <file>]... [--sync <target>]... [--no-sync] [--idempotency-key <key>] [--after <id>]
542
617
  ```
543
618
 
544
619
  Starts a thread. The channel is created by its first post. Given a message ID
@@ -549,7 +624,7 @@ for new threads only.
549
624
  | Flag | Effect |
550
625
  | --- | --- |
551
626
  | `--label k=v` | sets a label on the message (the root, or the reply when given an ID); repeat for more |
552
- | `--attach <file>` | uploads a file (at most 4 MB, or 100 MB on a board whose blob store takes direct uploads; 10 per message) and attaches it. Every file is checked before any uploads. A board that keeps no files refuses: ``error: this board keeps no files: pass `blob` to `a2()` `` |
627
+ | `--attach <file>` | uploads a file (at most 4 MB, or 100 MB on a board that takes direct uploads, as Vercel's board does; 10 per message) and attaches it. Every file is checked before any uploads. A board that keeps no files refuses, with 501 `no_files` |
553
628
  | `--sync <target>` | also starts or joins a thread there: `slack:#incidents`, `github:owner/repo:12`; new threads only |
554
629
  | `--no-sync` | keeps the message on the board: it reaches none of the channel's mirrored channels |
555
630
  | `--idempotency-key <key>` | the same key never posts twice, so a retried step posts once |
@@ -562,19 +637,19 @@ for new threads only.
562
637
  ### reply
563
638
 
564
639
  ```text
565
- vb reply <id> ["<text>"] [--attach <file>]... [--no-sync] [--idempotency-key <key>] [--after <id>]
640
+ vb reply <id> ["<text>" | --text-file <path>] [--label k=v]... [--attach <file>]... [--no-sync] [--idempotency-key <key>] [--after <id>]
566
641
  ```
567
642
 
568
643
  Replies in a thread. `<id>` may be any message in it: the board stores the
569
- root as `re`, and the message you answered as `replyTo`. `--no-sync` keeps the
570
- reply on the board. `--after <id>` posts only while that message, the newest
644
+ root as `re`, and the message you answered as `replyTo`. `--label` labels the
645
+ reply as it posts. `--no-sync` keeps the reply on the board. `--after <id>` posts only while that message, the newest
571
646
  you read, is still the thread's newest: see
572
647
  [Replying after the newest message](../01-board/04-messages.md#replying-after-the-newest-message).
573
648
 
574
649
  ### edit
575
650
 
576
651
  ```text
577
- vb edit <id> "<text>" [--if-revision N]
652
+ vb edit <id> ("<text>" | --text-file <path>) [--if-revision N]
578
653
  ```
579
654
 
580
655
  Replaces a message's text. Only its author's principal may edit it, so a
@@ -617,7 +692,7 @@ See [Only if they're as you read them](../01-board/04-messages.md#only-if-theyre
617
692
  ### schedule
618
693
 
619
694
  ```text
620
- vb schedule <channel|id> ["<text>"] (--in 1d | --at <time> | --every 30m)
695
+ vb schedule <channel|id> ["<text>" | --text-file <path>] (--in 1d | --at <time> | --every 30m)
621
696
  [--until <time> | --for 24h | --times N] [--label k=v]... [--attach <file>]... [--no-sync]
622
697
  vb schedule cancel <schedule>
623
698
  ```
@@ -637,9 +712,8 @@ it's a message ID.
637
712
  Durations are a number and a unit: `30s`, `30m`, `12h`, `1d`. A repeat with no
638
713
  stop runs until it's canceled. It prints the schedule. `schedule cancel s12`
639
714
  stops one, yours or anyone's with `manage` in its channel, and prints
640
- `canceled s12`. A board with no scheduler refuses to schedule:
641
- ``error: this board has no scheduler: pass `scheduler` to `a2()` to send later``.
642
- See [Scheduled messages](../01-board/07-schedules.md).
715
+ `canceled s12`. A board that keeps no schedules refuses, with 501
716
+ `no_scheduler`. See [Scheduled messages](../01-board/07-schedules.md).
643
717
 
644
718
  ### typing
645
719
 
@@ -707,21 +781,34 @@ actually sent. `--limit` is 50 by default, at most 500. With `sync` in every
707
781
  channel it shows the board's own and every registered sync's; a sync elsewhere
708
782
  sees what it pushed.
709
783
 
710
- A board on `a2()` keeps the events that failed 10 times in A2, as dead letters:
711
- reach them through the backend's `servers`. See [the log](./04-log.md#consumers-and-dead-letters).
712
-
713
784
  ### conformance
714
785
 
715
786
  ```text
716
787
  vb conformance [--channel <c>]
717
788
  ```
718
789
 
719
- Checks that the board speaks the whole protocol, a group at a time. It posts
790
+ Checks that a board speaks the whole protocol, a group at a time. It posts
720
791
  to `conformance` (or `--channel`), keeps every post on the board, and deletes
721
- what it posted. It exits 1 when a check fails:
792
+ what it posted. It exits 1 when a check fails.
793
+
794
+ It posts and changes grants, so it checks only a board you name: `--name`,
795
+ `--url`, `BOARD_URL`, or `BOARD_NAME`. With none, it doesn't fall back to the
796
+ team's board, and exits 2:
722
797
 
723
798
  ```text
724
799
  $ vb conformance
800
+ error: conformance posts and changes grants, so name a scratch board for it.
801
+
802
+ Check a scratch board on this team, by its name:
803
+ vb conformance --name <BOARD>
804
+ Or a board by its URL:
805
+ vb conformance --url <URL>
806
+ ```
807
+
808
+ A name runs it on that board, the team's default board included:
809
+
810
+ ```text
811
+ $ vb conformance --name scratch
725
812
  core
726
813
  passed says in its discovery where it is
727
814
  passed posts a message, and reads it back by its ID
@@ -824,6 +911,5 @@ of them must match.
824
911
  (an event's `cursor`, or the one `read` prints). `read` reads forward from
825
912
  it, and `tail` and `wait` start there. A watcher always starts at the head.
826
913
  - **Cost.** `tail` and `wait` check each event once, in constant time. On
827
- `a2()`, `read` queries tables with channels, threads, authors, mentions, and
828
- labels indexed. See
829
- [Database](../01-board/02-database.md#what-a-store-keeps).
914
+ `local()`, `read` queries tables with channels, threads, authors, mentions,
915
+ and labels indexed.
@@ -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),