@vercel/board 0.32.0 → 0.34.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.
- package/README.md +25 -20
- package/dist/{access-CY5xVMIK.mjs → access-CdBcYPQH.mjs} +170 -13
- package/dist/access.d.mts +4 -5
- package/dist/access.mjs +5 -5
- package/dist/{actors-Bm-ojWWT.mjs → actors-MrIEr9LI.mjs} +3 -3
- package/dist/auth-DjoJygbG.mjs +599 -0
- package/dist/{auth-K8dY1nBY.d.mts → auth-aaoKt5DK.d.mts} +133 -100
- package/dist/backend-local.d.mts +28 -0
- package/dist/backend-local.mjs +2 -0
- package/dist/{backend-DxE9wGKm.d.mts → backend-u1sVvybh.d.mts} +108 -55
- package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
- package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-De0iDnUB.d.mts} +2 -3
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +2 -2
- package/dist/cli-embedded.mjs +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/{commands-DsnQKTdB.mjs → commands-B8oZEByR.mjs} +37 -52
- package/dist/{commands-CpyPV_tk.d.mts → commands-BkVMdXP1.d.mts} +9 -6
- package/dist/{conformance-3RBKxwbp.mjs → conformance-gqYBkXFS.mjs} +79 -86
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DurYIRt8.mjs → engine-rtOVWsiF.mjs} +6 -8
- package/dist/{errors-CJXhhzvT.mjs → errors-D8ifv16L.mjs} +75 -6
- package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
- package/dist/exports-Bx2dGpzr.mjs +3252 -0
- package/dist/exports-uwRl5qIj.d.mts +4 -0
- package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
- package/dist/index-D6mK0Ial.d.mts +11 -0
- package/dist/index.d.mts +10 -9
- package/dist/index.mjs +21 -8
- package/dist/index.node.d.mts +6 -7
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +95 -95
- package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
- package/dist/local-CPz22MQ8.mjs +9225 -0
- package/dist/{main-CcYDo9Hb.mjs → main-DScDKwQN.mjs} +129 -54
- package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
- package/dist/middleware-BjYpk4yq.mjs +103 -0
- package/dist/{provider-gynDUoyW.d.mts → provider-hB8QNrwm.d.mts} +369 -3
- package/dist/{client-COfYrgfV.d.mts → routes-De4W6lEs.d.mts} +997 -367
- package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
- package/dist/{serve-Bplieh0C.mjs → serve-B1noQRkn.mjs} +33 -24
- package/dist/{node-BgeGcwX0.mjs → server-Ov6GBJ8j.mjs} +419 -6
- package/dist/{serving-Y7s7VDjB.mjs → serving-2s7lqSBS.mjs} +1 -1
- package/dist/{sql-E1K5g_ih.mjs → sql-BQzKUqQt.mjs} +349 -114
- package/dist/sqlite-DCtZFEVm.mjs +30 -0
- package/dist/{sqlite-db-CzcD_FW8.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
- package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
- package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
- package/dist/store-memory-OdGsc-t_.mjs +2 -0
- package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
- package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
- package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-chat-sdk.mjs +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-github.mjs +2 -2
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-linear.mjs +2 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync-slack.mjs +4 -4
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{watchers-hash-CurCzwhe.mjs → targets-aMdbp84G.mjs} +134 -16
- package/dist/{tokens-C7kYyrAG.mjs → tokens-LHLrnV_P.mjs} +15 -43
- package/docs/01-board/01-mounting.md +245 -288
- package/docs/01-board/03-identity.md +42 -50
- package/docs/01-board/04-messages.md +15 -14
- package/docs/01-board/05-reading.md +3 -3
- package/docs/01-board/06-watchers.md +58 -105
- package/docs/01-board/07-schedules.md +21 -41
- package/docs/01-board/08-middleware.md +11 -17
- package/docs/01-board/09-access.md +187 -343
- package/docs/01-board/10-local.md +81 -0
- package/docs/01-quickstart.md +49 -126
- package/docs/02-sync/01-overview.md +25 -80
- package/docs/02-sync/02-functions.md +10 -16
- package/docs/02-sync/03-slack.md +13 -26
- package/docs/02-sync/04-github.md +8 -20
- package/docs/02-sync/07-linear.md +6 -10
- package/docs/03-guides/02-inspector.md +3 -3
- package/docs/03-guides/03-ci.md +88 -128
- package/docs/03-guides/04-triage.md +7 -15
- package/docs/03-guides/05-agent-factory.md +29 -36
- package/docs/04-reference/01-cli.md +113 -38
- package/docs/04-reference/02-board.md +79 -82
- package/docs/04-reference/03-http.md +138 -69
- package/docs/04-reference/05-conformance.md +32 -46
- package/docs/index.md +41 -65
- package/package.json +12 -83
- package/dist/a2-DiDc77Uf.mjs +0 -4238
- package/dist/access-DPcrKIH_.d.mts +0 -37
- package/dist/auth-8pRZnF1M.mjs +0 -393
- package/dist/backend-a2/blob-vercel.d.mts +0 -8
- package/dist/backend-a2/blob-vercel.mjs +0 -81
- package/dist/backend-a2/contract.d.mts +0 -828
- package/dist/backend-a2/contract.mjs +0 -5
- package/dist/backend-a2/scheduler-local.d.mts +0 -11
- package/dist/backend-a2/scheduler-local.mjs +0 -2
- package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
- package/dist/backend-a2/scheduler-qstash.mjs +0 -522
- package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
- package/dist/backend-a2/scheduler-vercel.mjs +0 -204
- package/dist/backend-a2/store-memory.d.mts +0 -11
- package/dist/backend-a2/store-postgres.d.mts +0 -38
- package/dist/backend-a2/store-postgres.mjs +0 -2977
- package/dist/backend-a2/store-redis-http.d.mts +0 -17
- package/dist/backend-a2/store-redis-http.mjs +0 -520
- package/dist/backend-a2/store-redis.d.mts +0 -31
- package/dist/backend-a2/store-redis.mjs +0 -88
- package/dist/backend-a2/store-sqlite.d.mts +0 -12
- package/dist/backend-a2/store-sqlite.mjs +0 -31
- package/dist/backend-a2.d.mts +0 -2633
- package/dist/backend-a2.mjs +0 -3
- package/dist/backend-http-CaN06CaD.d.mts +0 -672
- package/dist/backend-http-CoaCghuJ.mjs +0 -18
- package/dist/backend-http-l5A8UmL-.mjs +0 -585
- package/dist/backend-http.d.mts +0 -10
- package/dist/backend-http.mjs +0 -2
- package/dist/backend-http.node.d.mts +0 -10
- package/dist/backend-http.node.mjs +0 -2
- package/dist/backend-vercel-BE65okBC.mjs +0 -86
- package/dist/backend-vercel-CVxoTNF2.mjs +0 -1744
- package/dist/backend-vercel-jg-6PAgD.d.mts +0 -674
- package/dist/backend-vercel.d.mts +0 -9
- package/dist/backend-vercel.mjs +0 -11
- package/dist/backend-vercel.node.d.mts +0 -17
- package/dist/backend-vercel.node.mjs +0 -2
- package/dist/blob-Bx8QPWEd.d.mts +0 -40
- package/dist/blob-WbB2DJKn.mjs +0 -201
- package/dist/errors-2vGs49Db.d.mts +0 -16
- package/dist/exports-BnUZuRm9.mjs +0 -1389
- package/dist/exports-u5mApVvn.d.mts +0 -5
- package/dist/files-SniSmeEr.mjs +0 -47
- package/dist/folds-DLUzfibJ.d.mts +0 -558
- package/dist/folds-DsWfIftc.mjs +0 -208
- package/dist/index-UXpTPWNc.d.mts +0 -11
- package/dist/index.default-Dp8gexln.mjs +0 -12
- package/dist/local-C76Fy5ad.mjs +0 -44
- package/dist/middleware-BavYSDUa.mjs +0 -62
- package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
- package/dist/project-4Vl7_uy5.mjs +0 -124
- package/dist/redis-tables-BFRj_SEJ.mjs +0 -3895
- package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
- package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
- package/dist/reducers-DQVSP3kk.mjs +0 -538
- package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
- package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
- package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
- package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
- package/dist/server-wIpAEjpX.mjs +0 -17
- package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
- package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
- package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
- package/dist/store-memory-4IBl0Ztu.mjs +0 -2
- package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
- package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
- package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
- package/dist/targets-Cgjs29T0.mjs +0 -33
- package/dist/types-CmrFjpml.d.mts +0 -102
- package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
- package/docs/01-board/02-database.md +0 -258
- package/docs/04-reference/04-log.md +0 -247
- package/sql/postgres/board.sql +0 -145
- package/sql/postgres/notifications.sql +0 -24
- 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
|
|
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(
|
|
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
|
|
|
@@ -247,7 +298,8 @@ error document:
|
|
|
247
298
|
|
|
248
299
|
- **`reason` is what a program branches on:** `missing_scope`,
|
|
249
300
|
`login_required`, `permission_denied`, `deployment_protected`,
|
|
250
|
-
`board_not_found`, `
|
|
301
|
+
`board_not_found`, `board_not_granted`, `board_name_taken`,
|
|
302
|
+
`message_not_found`, `channel_not_found`,
|
|
251
303
|
`unknown_command`, `unknown_option`, `invalid_arguments`, `timeout`, and
|
|
252
304
|
the board's own codes, such as `already_synced` or `no_scheduler`.
|
|
253
305
|
- **`next` is what to run**, each `{ command, argv, when }`, and `hint` what
|
|
@@ -300,6 +352,22 @@ token expires in 0h 59m
|
|
|
300
352
|
can ci/ read post
|
|
301
353
|
```
|
|
302
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
|
+
|
|
303
371
|
See [Access](../01-board/09-access.md).
|
|
304
372
|
|
|
305
373
|
### serve
|
|
@@ -322,10 +390,13 @@ inspector at http://127.0.0.1:4747
|
|
|
322
390
|
```
|
|
323
391
|
|
|
324
392
|
- **It keeps everything in `.board/`** at the Git checkout's root (and adds
|
|
325
|
-
it to `.gitignore`), or in `--dir
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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.
|
|
329
400
|
- **You're `local:user:<your OS user>`**, or `--handle`'s handle, with full
|
|
330
401
|
access. It signs your token into `~/.config/board/local/`, where `vb` on
|
|
331
402
|
this machine finds it, and deletes it when it stops. Its keys live only as
|
|
@@ -414,28 +485,21 @@ t1 feedback-widget feedback/=post expires in 30d
|
|
|
414
485
|
|
|
415
486
|
```text
|
|
416
487
|
vb grants [list]
|
|
417
|
-
vb grants create <issuer> --claim <name=value>... [--can <scope>]
|
|
418
488
|
vb grants revoke <grant>
|
|
419
489
|
```
|
|
420
490
|
|
|
421
|
-
`grants
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
them do. All three need `manage` in every channel. See
|
|
427
|
-
[Grants](../01-board/09-access.md#grants).
|
|
491
|
+
`vb grants` lists each grant's ID, the principals it names as the flags that
|
|
492
|
+
name them, and what it lets them do: `*` alone in words, any other pattern as
|
|
493
|
+
`pattern=permissions`, `none` for a closed one. It needs `manage` at `*`.
|
|
494
|
+
`grants revoke g3` stops one and prints `revoked g3`, and needs `manage` at
|
|
495
|
+
each pattern it names. See [Grants](../01-board/09-access.md#grants).
|
|
428
496
|
|
|
429
497
|
```text
|
|
430
|
-
$ vb grants create github --claim repository=acme/web --can ci/=read,post
|
|
431
|
-
granted g3
|
|
432
|
-
$ vb grants create vercel --claim project_id=prj_front --claim environment=production --can feedback/=post
|
|
433
|
-
granted g4
|
|
434
498
|
$ vb grants
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
$ vb grants revoke
|
|
438
|
-
revoked
|
|
499
|
+
g1 --all-users everything
|
|
500
|
+
g2 --all-projects --environment production,preview,development read post react label
|
|
501
|
+
$ vb grants revoke g2
|
|
502
|
+
revoked g2
|
|
439
503
|
```
|
|
440
504
|
|
|
441
505
|
## Reading
|
|
@@ -553,7 +617,7 @@ for new threads only.
|
|
|
553
617
|
| Flag | Effect |
|
|
554
618
|
| --- | --- |
|
|
555
619
|
| `--label k=v` | sets a label on the message (the root, or the reply when given an ID); repeat for more |
|
|
556
|
-
| `--attach <file>` | uploads a file (at most 4 MB, or 100 MB on a board
|
|
620
|
+
| `--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` |
|
|
557
621
|
| `--sync <target>` | also starts or joins a thread there: `slack:#incidents`, `github:owner/repo:12`; new threads only |
|
|
558
622
|
| `--no-sync` | keeps the message on the board: it reaches none of the channel's mirrored channels |
|
|
559
623
|
| `--idempotency-key <key>` | the same key never posts twice, so a retried step posts once |
|
|
@@ -641,9 +705,8 @@ it's a message ID.
|
|
|
641
705
|
Durations are a number and a unit: `30s`, `30m`, `12h`, `1d`. A repeat with no
|
|
642
706
|
stop runs until it's canceled. It prints the schedule. `schedule cancel s12`
|
|
643
707
|
stops one, yours or anyone's with `manage` in its channel, and prints
|
|
644
|
-
`canceled s12`. A board
|
|
645
|
-
|
|
646
|
-
See [Scheduled messages](../01-board/07-schedules.md).
|
|
708
|
+
`canceled s12`. A board that keeps no schedules refuses, with 501
|
|
709
|
+
`no_scheduler`. See [Scheduled messages](../01-board/07-schedules.md).
|
|
647
710
|
|
|
648
711
|
### typing
|
|
649
712
|
|
|
@@ -711,21 +774,34 @@ actually sent. `--limit` is 50 by default, at most 500. With `sync` in every
|
|
|
711
774
|
channel it shows the board's own and every registered sync's; a sync elsewhere
|
|
712
775
|
sees what it pushed.
|
|
713
776
|
|
|
714
|
-
A board on `a2()` keeps the events that failed 10 times in A2, as dead letters:
|
|
715
|
-
reach them through the backend's `servers`. See [the log](./04-log.md#consumers-and-dead-letters).
|
|
716
|
-
|
|
717
777
|
### conformance
|
|
718
778
|
|
|
719
779
|
```text
|
|
720
780
|
vb conformance [--channel <c>]
|
|
721
781
|
```
|
|
722
782
|
|
|
723
|
-
Checks that
|
|
783
|
+
Checks that a board speaks the whole protocol, a group at a time. It posts
|
|
724
784
|
to `conformance` (or `--channel`), keeps every post on the board, and deletes
|
|
725
|
-
what it posted. It exits 1 when a check fails
|
|
785
|
+
what it posted. It exits 1 when a check fails.
|
|
786
|
+
|
|
787
|
+
It posts and changes grants, so it checks only a board you name: `--name`,
|
|
788
|
+
`--url`, `BOARD_URL`, or `BOARD_NAME`. With none, it doesn't fall back to the
|
|
789
|
+
team's board, and exits 2:
|
|
726
790
|
|
|
727
791
|
```text
|
|
728
792
|
$ vb conformance
|
|
793
|
+
error: conformance posts and changes grants, so name a scratch board for it.
|
|
794
|
+
|
|
795
|
+
Check a scratch board on this team, by its name:
|
|
796
|
+
vb conformance --name <BOARD>
|
|
797
|
+
Or a board by its URL:
|
|
798
|
+
vb conformance --url <URL>
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
A name runs it on that board, the team's default board included:
|
|
802
|
+
|
|
803
|
+
```text
|
|
804
|
+
$ vb conformance --name scratch
|
|
729
805
|
core
|
|
730
806
|
passed says in its discovery where it is
|
|
731
807
|
passed posts a message, and reads it back by its ID
|
|
@@ -828,6 +904,5 @@ of them must match.
|
|
|
828
904
|
(an event's `cursor`, or the one `read` prints). `read` reads forward from
|
|
829
905
|
it, and `tail` and `wait` start there. A watcher always starts at the head.
|
|
830
906
|
- **Cost.** `tail` and `wait` check each event once, in constant time. On
|
|
831
|
-
`
|
|
832
|
-
labels indexed.
|
|
833
|
-
[Database](../01-board/02-database.md#what-a-store-keeps).
|
|
907
|
+
`local()`, `read` queries tables with channels, threads, authors, mentions,
|
|
908
|
+
and labels indexed.
|
|
@@ -21,50 +21,35 @@ where the board lives:
|
|
|
21
21
|
|
|
22
22
|
| Backend | The handle acts as |
|
|
23
23
|
| --- | --- |
|
|
24
|
-
| none
|
|
25
|
-
| `
|
|
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
|
|
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 `
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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 `
|
|
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:
|
|
145
|
-
profile, which
|
|
146
|
-
board derives one of its own kind, which no request may post
|
|
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
|
|
225
|
-
[direct upload](./03-http.md#direct-uploads), on a board
|
|
226
|
-
|
|
227
|
-
`type`, the `Blob`, or the name's
|
|
228
|
-
`
|
|
229
|
-
|
|
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
|
|
286
|
-
|
|
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,26 +295,37 @@ 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
|
|
314
|
-
|
|
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
|
|
318
303
|
|
|
319
304
|
```ts
|
|
320
|
-
createGrant(input: {
|
|
305
|
+
createGrant(input: { principals: PrincipalInput[]; can: GrantCan }): Promise<{ grant: GrantView }>
|
|
306
|
+
updateGrant(id: string, input: { add?: PrincipalInput[]; remove?: PrincipalInput[]; can?: GrantCan }): Promise<{ grant: GrantView }>
|
|
321
307
|
grants(): Promise<GrantView[]>
|
|
308
|
+
explain(channel: string, principal?: ExplainPrincipal): Promise<Explanation>
|
|
322
309
|
revokeGrant(id: string): Promise<{ revoked: boolean }>
|
|
323
310
|
```
|
|
324
311
|
|
|
325
|
-
`createGrant` lets
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
312
|
+
`createGrant` lets `principals` do what `can` says: a map from channel pattern
|
|
313
|
+
to `'all'` or a list of permissions, `[]` for none. The same principals again
|
|
314
|
+
are another grant. `updateGrant` adds principals (a project it names already
|
|
315
|
+
gets the new environments), removes them by who they are, and replaces `can`.
|
|
316
|
+
Making or widening one needs what you'd grant: `manage` at its patterns and
|
|
317
|
+
under them wherever your own limits narrow you, and what `everyone` gives, for
|
|
318
|
+
anyone it lets in. Revoking one, or removing from it, needs the same but what
|
|
319
|
+
`everyone` gives; `grants` needs `manage` at `*`. Owners always may.
|
|
320
|
+
`explain` says which grants decide a channel, and what they give, for you or,
|
|
321
|
+
with `manage` at `*`, for `{ user }`, `{ project, environment }`, `{ github,
|
|
322
|
+
workflow, branch, event }`, `{ oidc, claims }`, or `{ app }`. A local board has
|
|
323
|
+
no apps, so it explains one as nothing letting it in.
|
|
330
324
|
|
|
331
325
|
```ts
|
|
332
|
-
const { grant } = await team.createGrant({
|
|
326
|
+
const { grant } = await team.createGrant({ principals: [{ kind: 'github', repository: 'acme/web' }], can: { 'ci/': ['read', 'post'] } })
|
|
327
|
+
await team.updateGrant(grant.id, { add: [{ kind: 'user', email: 'ada@acme.com' }] })
|
|
328
|
+
const { pattern, grants, can } = await team.explain('ci/deploys', { user: 'ada@acme.com' })
|
|
333
329
|
await team.revokeGrant(grant.id)
|
|
334
330
|
```
|
|
335
331
|
|
|
@@ -344,11 +340,11 @@ revokeToken(id: string): Promise<{ revoked: boolean }>
|
|
|
344
340
|
```
|
|
345
341
|
|
|
346
342
|
`createToken` mints a token that acts as the handle's caller, narrowed to `can`
|
|
347
|
-
(read, post, react, and label everywhere when left out
|
|
343
|
+
(read, post, react, and label everywhere when left out), and
|
|
348
344
|
answers its `secret`, the only time it shows. `profile`, `avatar`, and
|
|
349
345
|
`session` pin what every request with it writes as. It lives 30 days, or
|
|
350
|
-
`expires`, 90 days at most. On `
|
|
351
|
-
own code, narrowed. `tokens` lists your live ones, or everyone's with `manage`
|
|
346
|
+
`expires`, 90 days at most. On `local()`, the handle's own token is the
|
|
347
|
+
board's own code, narrowed. `tokens` lists your live ones, or everyone's with `manage`
|
|
352
348
|
in every channel; a handle holding a token lists that token and those minted
|
|
353
349
|
with it. `revokeToken` stops one and every token minted with it.
|
|
354
350
|
|
|
@@ -430,15 +426,15 @@ may do there, implications included: `{ '*': ['read', 'post', 'react', 'label',
|
|
|
430
426
|
'sync', 'manage'] }` is everything. `channels()` and `actors()` show only what
|
|
431
427
|
you can read; see [Access](../01-board/09-access.md).
|
|
432
428
|
|
|
433
|
-
A channel's counts are there only where its board keeps them: `
|
|
434
|
-
|
|
429
|
+
A channel's counts are there only where its board keeps them: `local()` does,
|
|
430
|
+
and Vercel's board, which counts nothing in a channel, leaves them out.
|
|
435
431
|
|
|
436
432
|
`createChannel()` makes a channel before anything posts to it, as a first post
|
|
437
433
|
would. It needs `read` and `post` there. `created` is false for one that's
|
|
438
434
|
there already, made by a post or another create, which it leaves as it is.
|
|
439
435
|
|
|
440
|
-
`discovery()` is the backend's: on `
|
|
441
|
-
|
|
436
|
+
`discovery()` is the backend's: on `local()`, the board's own, and with
|
|
437
|
+
`BOARD_URL` set, the board at that URL's.
|
|
442
438
|
|
|
443
439
|
### inbox and readSource
|
|
444
440
|
|
|
@@ -452,9 +448,8 @@ joinSource(key: string, target: string): Promise<SourceJoin>
|
|
|
452
448
|
the board's own with `sync` in every channel, and what you pushed.
|
|
453
449
|
`readSource` reads a platform channel, thread, or message permalink without
|
|
454
450
|
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
|
|
456
|
-
|
|
457
|
-
no entry `key` throws 404 `not_synced_here`. A request needs `manage` in every
|
|
451
|
+
reads it through the sync it runs, so the CLI reads the board it links. A
|
|
452
|
+
board that runs no entry `key` throws 404 `not_synced_here`. A request needs `manage` in every
|
|
458
453
|
channel. `joinSource` adds the app to a public channel so `readSource` can read
|
|
459
454
|
it, on an entry that opted in (`slack({ join: true })`); it answers
|
|
460
455
|
`{ channel, name, joined }`, with `joined: false` when the app was already in.
|
|
@@ -486,7 +481,7 @@ matches(opts?: { limit?: number; wait?: number; signal?: AbortSignal }): Promise
|
|
|
486
481
|
ack(id: string, body: { lease: string; error?: string; skip?: boolean }): Promise<{ ok: true }>
|
|
487
482
|
```
|
|
488
483
|
|
|
489
|
-
What a
|
|
484
|
+
What a deployment's watchers do on the board that matches them, one method each:
|
|
490
485
|
`register` replaces the caller's registration (its watchers, at most 32, its
|
|
491
486
|
sync entries, and where to wake it: a `url`, or on a board whose discovery says
|
|
492
487
|
`wake_by_path`, a `path` on its own project and a preview's `branch`, never
|
|
@@ -495,7 +490,7 @@ for 5 minutes; `ack` says how one went (done, an `error` to try again, or
|
|
|
495
490
|
`skip`). `watchers()` lists the caller's own registration, and every one for
|
|
496
491
|
`manage` in every channel. `board()` does all of it for its watchers, so you
|
|
497
492
|
need them only to run watchers yourself. See
|
|
498
|
-
[Watchers](../01-board/06-watchers.md#
|
|
493
|
+
[Watchers](../01-board/06-watchers.md#woken-by-the-board).
|
|
499
494
|
|
|
500
495
|
## Live
|
|
501
496
|
|
|
@@ -521,7 +516,8 @@ for await (const event of team.events({ channel: 'errors-www' }, { signal: contr
|
|
|
521
516
|
Each event is `{ cursor, type, createdAt, payload, message?, actor? }`.
|
|
522
517
|
`cursor` is its place in the board's order, to pass as `after`. Checking
|
|
523
518
|
`type` narrows `payload`, `message` is the message the event concerns as it is
|
|
524
|
-
after the event, and `actor` is who did it. See
|
|
519
|
+
after the event, and `actor` is who did it. See
|
|
520
|
+
[Event types](./03-http.md#event-types).
|
|
525
521
|
|
|
526
522
|
### wait
|
|
527
523
|
|
|
@@ -558,8 +554,8 @@ for one request. It's what `vb inspect`'s proxy uses.
|
|
|
558
554
|
|
|
559
555
|
`team.url` is this board's own URL once it knows it: `url`, or on Vercel its
|
|
560
556
|
domain and mount. Until then, as in a script, it's `http://in-process.board`,
|
|
561
|
-
which only the handle reaches.
|
|
562
|
-
`discovery()`.
|
|
557
|
+
which only the handle reaches. With `BOARD_URL` set, a handle finds that board
|
|
558
|
+
in `discovery()`.
|
|
563
559
|
|
|
564
560
|
## Errors
|
|
565
561
|
|
|
@@ -617,10 +613,8 @@ webhook receiver, a cron job. Export it next to the handler:
|
|
|
617
613
|
|
|
618
614
|
```ts app/api/board/[[...path]]/route.ts
|
|
619
615
|
import { board } from '@vercel/board'
|
|
620
|
-
import { a2 } from '@vercel/board/backend-a2'
|
|
621
|
-
import { postgres } from '@vercel/board/backend-a2/store-postgres'
|
|
622
616
|
|
|
623
|
-
export const team = board(
|
|
617
|
+
export const team = board()
|
|
624
618
|
export const GET = team.fetch, POST = team.fetch
|
|
625
619
|
```
|
|
626
620
|
|
|
@@ -635,13 +629,16 @@ export async function POST(request: Request) {
|
|
|
635
629
|
}
|
|
636
630
|
```
|
|
637
631
|
|
|
638
|
-
- **On
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
- **On `
|
|
643
|
-
|
|
644
|
-
|
|
632
|
+
- **On Vercel's board, it's this deployment,** with its OIDC token: it
|
|
633
|
+
writes as `vercel:project:<id>:<env>`, and `as(profile)` adds the profile.
|
|
634
|
+
- **With `BOARD_URL` set, it's this deployment too,** on the board at that
|
|
635
|
+
URL, whose middleware sees its writes.
|
|
636
|
+
- **On `local()`, it's the board's own code,** in-process, with no URL or
|
|
637
|
+
token. It writes as `board:client`, and `as(profile)` as
|
|
638
|
+
`board:client:<profile>`.
|
|
639
|
+
|
|
640
|
+
Every call goes through what a request's does, this board's middleware
|
|
641
|
+
included, and its writes wake watchers and sync like anyone's.
|
|
645
642
|
|
|
646
643
|
Sync functions get a client of their own, acting as the platform user who
|
|
647
644
|
triggered the event. See [Mounting](../01-board/01-mounting.md),
|