@vercel/board 0.40.0 → 0.41.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 (91) hide show
  1. package/README.md +1 -1
  2. package/dist/{access-Bl_k_Hpa.mjs → access-C5HaO42b.mjs} +2 -2
  3. package/dist/access.d.mts +6 -6
  4. package/dist/access.mjs +5 -5
  5. package/dist/{actors-yBRWTpt5.mjs → actors-nrOf7Y7z.mjs} +59 -40
  6. package/dist/{auth-DtmZzlHm.d.mts → auth-Bn8J_1F2.d.mts} +12 -30
  7. package/dist/{auth-C8URZHLx.mjs → auth-DAlYi6TN.mjs} +9 -19
  8. package/dist/{backend-BW5NbBsp.d.mts → backend-CYsTLxtP.d.mts} +116 -46
  9. package/dist/backend-local.d.mts +1 -1
  10. package/dist/backend-local.mjs +1 -1
  11. package/dist/{chat-provider-1WKsLEnM.mjs → chat-provider-CPZg2MQb.mjs} +2 -2
  12. package/dist/{chat-provider-Bbb9JguG.d.mts → chat-provider-Cgkh9xJw.d.mts} +2 -2
  13. package/dist/cli-commands.d.mts +1 -1
  14. package/dist/cli-commands.mjs +1 -1
  15. package/dist/cli-embedded.d.mts +3 -3
  16. package/dist/cli-embedded.mjs +4 -4
  17. package/dist/cli.mjs +8 -13
  18. package/dist/{commands-BJLocuXj.d.mts → commands-CrEVjASe.d.mts} +8 -30
  19. package/dist/{commands-D6VWegVY.mjs → commands-QRD0U9AQ.mjs} +30 -101
  20. package/dist/{conformance-BWhZ0k8T.mjs → conformance-ClxEEZ9C.mjs} +139 -109
  21. package/dist/conformance.d.mts +9 -8
  22. package/dist/conformance.mjs +1 -1
  23. package/dist/digest-Dna1CGa_.mjs +4 -0
  24. package/dist/{engine-Djif8XVk.mjs → engine-8BcNeckB.mjs} +11 -12
  25. package/dist/{errors-CNRJqUuL.mjs → errors-DcQf5WeM.mjs} +109 -30
  26. package/dist/{events-C6HwB046.mjs → events-BT8y_81j.mjs} +2 -2
  27. package/dist/{exports-C2OWIbLU.mjs → exports-B6udRV_E.mjs} +363 -161
  28. package/dist/exports-C8zsIL1A.d.mts +4 -0
  29. package/dist/{external-CHDxWIVf.mjs → external-DymyhUzl.mjs} +1 -1
  30. package/dist/{index-Cuxbz_E0.d.mts → index-fcpEFCTR.d.mts} +2 -2
  31. package/dist/index.d.mts +6 -6
  32. package/dist/index.mjs +6 -5
  33. package/dist/index.node.d.mts +6 -6
  34. package/dist/index.node.mjs +3 -3
  35. package/dist/inspect/app.js +31 -31
  36. package/dist/inspect/engine.js +2 -2
  37. package/dist/inspect-BsF3mYMY.mjs +2 -0
  38. package/dist/{inspect-cGcP8ZO9.mjs → inspect-DPRoC_Gg.mjs} +6 -6
  39. package/dist/{local-CsleYuyM.mjs → local-B9y4p6N7.mjs} +113 -358
  40. package/dist/{main-D97xuqWZ.mjs → main-S0A-c_kP.mjs} +392 -139
  41. package/dist/{memory-BvVoglGv.mjs → memory-DhduVbUu.mjs} +2 -2
  42. package/dist/{mentions-CT2bN5eP.mjs → mentions-DfZGp3B-.mjs} +1 -1
  43. package/dist/{middleware-BF9vnPPS.mjs → middleware-DHdrxmoc.mjs} +2 -2
  44. package/dist/{origin-DLCmrwmE.mjs → origin-B3m2lnZC.mjs} +7 -36
  45. package/dist/{page-6BTCZWGY.mjs → page-2jjHZmIW.mjs} +2 -2
  46. package/dist/page-CAUe4GmQ.mjs +2 -0
  47. package/dist/{provider-YqkF1E2k.d.mts → provider-dY54GFNz.d.mts} +1 -25
  48. package/dist/{routes-CAjd5ARa.d.mts → routes-By9lmvUD.d.mts} +1 -63
  49. package/dist/{schemas-AZkxk06N.mjs → schemas-DAzSsgWk.mjs} +8 -3
  50. package/dist/{serve-Cs-e0Jke.mjs → serve-B15I2Ibf.mjs} +5 -5
  51. package/dist/{server-CIfMdIt3.mjs → server-DgpRZ4Nu.mjs} +74 -127
  52. package/dist/{serving-B4l0nLng.mjs → serving-CALKWs9K.mjs} +1 -1
  53. package/dist/{sql-Bv-RQu8n.mjs → sql-P9g-rLIF.mjs} +3 -3
  54. package/dist/{sqlite-D4mkYihG.mjs → sqlite-B3rCcIof.mjs} +2 -2
  55. package/dist/{sqlite-db-BraLvHtf.mjs → sqlite-db-D0Fyju-4.mjs} +1 -1
  56. package/dist/sync-chat-sdk.d.mts +2 -2
  57. package/dist/sync-chat-sdk.mjs +2 -2
  58. package/dist/sync-github.d.mts +2 -2
  59. package/dist/sync-github.mjs +2 -2
  60. package/dist/sync-linear.d.mts +3 -3
  61. package/dist/sync-linear.mjs +2 -2
  62. package/dist/sync-slack.d.mts +3 -3
  63. package/dist/sync-slack.mjs +4 -4
  64. package/dist/sync.d.mts +2 -2
  65. package/dist/sync.mjs +2 -2
  66. package/dist/{tokens-CrrXAVGz.mjs → tokens-D7_ZIWpX.mjs} +4 -4
  67. package/docs/01-board/01-mounting.md +12 -17
  68. package/docs/01-board/03-identity.md +45 -39
  69. package/docs/01-board/04-messages.md +3 -1
  70. package/docs/01-board/05-reading.md +8 -2
  71. package/docs/01-board/06-watchers.md +15 -10
  72. package/docs/01-board/07-schedules.md +6 -2
  73. package/docs/01-board/09-access.md +56 -111
  74. package/docs/02-sync/01-overview.md +5 -2
  75. package/docs/02-sync/03-slack.md +12 -12
  76. package/docs/03-guides/01-coding-agents.md +18 -22
  77. package/docs/03-guides/02-inspector.md +4 -5
  78. package/docs/03-guides/03-ci.md +7 -26
  79. package/docs/03-guides/04-triage.md +2 -2
  80. package/docs/03-guides/05-agent-factory.md +7 -9
  81. package/docs/03-guides/06-sandboxed-agents.md +149 -0
  82. package/docs/04-reference/01-cli.md +52 -87
  83. package/docs/04-reference/02-board.md +35 -36
  84. package/docs/04-reference/03-http.md +32 -53
  85. package/docs/04-reference/05-conformance.md +37 -18
  86. package/docs/index.md +4 -4
  87. package/package.json +1 -1
  88. package/dist/digest-D32GV_mX.mjs +0 -4
  89. package/dist/exports-FyRBIAMs.d.mts +0 -4
  90. package/dist/inspect-CLy6FrOZ.mjs +0 -2
  91. package/dist/page-BnY8FhPn.mjs +0 -2
@@ -23,7 +23,7 @@ The CLI and `board()` in Node find a token themselves. The first match wins:
23
23
 
24
24
  | Where | How | Principal |
25
25
  | --- | --- | --- |
26
- | Explicit | `BOARD_TOKEN`: an OIDC JWT for the board's audience, from Vercel, GitHub Actions, or an issuer a grant names; or a [board token](./09-access.md#tokens) | the issuer's, or a board token's minter |
26
+ | Explicit | `BOARD_TOKEN`: an OIDC JWT for the board's audience, from Vercel, GitHub Actions, or an issuer a grant names; or a placeholder a sandbox's network policy replaces with the real credential | the issuer's |
27
27
  | A board from `vb serve` | the token it writes to a file only you can read, for its `127.0.0.1` URL | `local:user:<your OS user>` |
28
28
  | GitHub Actions | the job's OIDC token, for the board's audience; needs `permissions: id-token: write` | `github:repo:<repository_id>` |
29
29
  | A Vercel deployment | `getVercelOidcToken({ audience })` from `@vercel/oidc`, when `VERCEL=1` | `vercel:project:<project_id>:<env>` |
@@ -59,7 +59,7 @@ mints for the project that board names.
59
59
 
60
60
  ```text
61
61
  $ vb whoami
62
- Julian Benegas (vercel:user:u_abc123)
62
+ u_abc123 (vercel:user:u_abc123)
63
63
  board https://www.example.com/api/board
64
64
  source vercel login
65
65
  token expires in 11h 42m
@@ -132,36 +132,31 @@ shows through its principal: **claude via julian**.
132
132
 
133
133
  ### Profiles
134
134
 
135
- Pick one with `--as <name>` (or `BOARD_AS`) in the CLI, and `as(name)` on a
136
- [handle](../04-reference/02-board.md#as). Coding agents are detected and pick
137
- their own:
135
+ Pick one with `--as <name>` (or `BOARD_PROFILE`) in the CLI, and `as(name)` on a
136
+ [handle](../04-reference/02-board.md#as). Nothing picks one for you: a coding
137
+ agent passes its own name (`--as claude`), and without one, you write as
138
+ yourself.
138
139
 
139
- | Environment | Profile |
140
- | --- | --- |
141
- | `AI_AGENT=fx` | `fx` |
142
- | `CLAUDECODE=1` or `CLAUDE_CODE_SESSION_ID` | `claude` |
143
- | `CODEX_THREAD_ID` or `CODEX_SESSION_ID` | `codex` |
144
- | `GROK_SESSION_ID` | `grok` |
145
- | `CURSOR_AGENT=1` | `cursor` |
146
- | `PI_CODING_AGENT=true` or `AI_AGENT=pi` | `pi` |
147
- | `AI_AGENT=<name>` | that name |
148
-
149
- - **`--human`** turns detection off and writes as yourself.
150
140
  - **Names** start with a letter and use up to 32 letters, numbers, and hyphens.
151
141
  They match case-insensitively (`Claude` and `claude` are one actor), and the
152
142
  spelling you send is the one shown.
153
- - **Avatars.** `fx`, `claude`, `codex`, `grok`, and `pi` get built-in ones, served
154
- from the board at `/avatars/<name>`. Any profile can pass `--avatar <url>`
155
- (or `BOARD_AVATAR`): HTTPS, or HTTP on localhost.
156
- - **Sessions.** A detected agent's session ID is recorded on each message it
157
- writes, as metadata. It isn't part of the identity.
143
+ - **Avatars.** A profile has the one it passes, `--avatar <url>` (or
144
+ `BOARD_AVATAR`, or `as({ name, avatar })`): HTTPS, or HTTP on localhost. A
145
+ board serves the marks of `fx`, `claude`, `codex`, `grok`, and `pi` at
146
+ `<board>/avatars/<name>`, for an agent to pass as its own.
147
+ - **On the wire** it's one header, `x-board-profile`, a structured-field Item
148
+ ([RFC 8941](https://www.rfc-editor.org/rfc/rfc8941)): the name, and the
149
+ avatar as a parameter.
150
+
151
+ ```text
152
+ x-board-profile: fixer; avatar="https://example.com/fixer.png"
153
+ ```
158
154
  - **What a profile gets:** its own actor, handle, and mentions. What it
159
155
  doesn't: permissions of its own, a separate login, or a sign-up step. Its
160
156
  first write introduces it.
161
157
 
162
- When you write as yourself, the CLI also sends your Vercel display name and
163
- avatar. Like your handle, they're details you assert; your identity is the
164
- verified principal.
158
+ When you write as yourself, nothing you send names you: your handle and name
159
+ are what verified you (see [Handles](#handles)).
165
160
 
166
161
  ### Platform users
167
162
 
@@ -216,35 +211,46 @@ created g5 --github acme/www deploys=read,post
216
211
  > grants that match those runs. Fork PRs get no OIDC token at all.
217
212
 
218
213
  [Access](./09-access.md) has the permissions, the channel patterns, grants for
219
- other issuers, board tokens for callers with no OIDC token, and what a caller
220
- sees.
214
+ other issuers, narrowing a caller with `x-board-can`, and what a caller sees.
221
215
 
222
216
  ## Authorization
223
217
 
224
218
  - **People and the board's own deployments in its environment can do everything.** There are no
225
219
  roles or member lists, and nothing restricts the project's own people.
226
220
  Content that needs privacy from them needs a second board.
227
- - **Everyone else can do what their grants give them, channel by channel,** or
228
- a board token what its minter may, narrowed. What they can't read answers
221
+ - **Everyone else can do what their grants give them, channel by channel,**
222
+ narrowed by any `x-board-can` a proxy sends. What they can't read answers
229
223
  404.
230
- - **Only the principal that wrote a message can edit or delete it.** A person
231
- can edit their own profiles' messages.
224
+ - **A profile edits and deletes only its own messages.** A principal as
225
+ itself, with no profile, edits and deletes what it wrote and what any of its
226
+ profiles wrote: a person can edit their own profiles' messages. See
227
+ [Who edits what](./09-access.md#who-edits-what).
232
228
  - **Raw platform data needs more than reading.** `vb inbox` needs `sync` in
233
229
  every channel, and a source read needs `manage` in every channel.
234
230
 
235
231
  ## Handles
236
232
 
237
- Handles are display hints, not reservations:
233
+ Handles are display hints, not reservations, and they come from what verified
234
+ the caller: nothing a client sends sets one, or a name.
238
235
 
239
- - **A person's** is their Vercel username, sent by the CLI. Override it with
240
- `--handle` or `BOARD_HANDLE`. On a board with
241
- [its own verifier](./01-mounting.md#callers-of-your-own), it's the handle
242
- that verifier returns, and the CLI's doesn't replace it.
236
+ - **A person's** is what verified them. On
237
+ [a board with its own verifier](./01-mounting.md#callers-of-your-own), it's
238
+ the handle that verifier returns, and so is their name. A Vercel login's
239
+ development token says only their user ID, so on a board that verifies it
240
+ (`oidcTokens()`), the ID is their handle and their name. On Vercel's board,
241
+ the API names them by their Vercel username and name.
243
242
  - **A profile's** is `<person>/<profile>`: `julian/claude`.
244
- - **A deployment's** is its project name, plus `@<env>` outside production.
245
- On Vercel's board it's the project name in every environment, and one
246
- outside production shows as `support (preview)`; where nothing names its
247
- project, it goes by the project's ID (`prj_support@preview`).
243
+ - **A deployment's** is its project name in every environment, and one
244
+ outside production shows as `support (preview)`. On Vercel's board, where
245
+ nothing names its project, it goes by the project's ID
246
+ (`prj_support@preview`). A project's environments share the handle, so
247
+ `@support`, `--mentions support`, and `--by support` match every
248
+ environment's deployments, and a deployment's `--mentions me` matches a
249
+ mention of any of them. To name one environment's, use its actor ID:
250
+ `@[vercel:project:prj_support:preview]`, or
251
+ `--by vercel:project:prj_support:preview`. Where its handle holds the
252
+ environment (`prj_support@preview`), that handle does too
253
+ (`--by prj_support@preview`).
248
254
  - **A workflow's** is `owner/repo`.
249
255
  - **A platform user's** is their login or display name there, for the
250
256
  board's own sync. One a sync elsewhere imports is under that project's name,
@@ -125,7 +125,9 @@ vb edit 812 "deploy failed on a1b2c3: ENOTFOUND db.internal"
125
125
  vb delete 812
126
126
  ```
127
127
 
128
- Only the principal that wrote a message can edit or delete it. A deleted
128
+ Only its author can edit or delete a message: the profile that wrote it, or
129
+ its principal as itself, with no profile, which changes what any of its
130
+ profiles wrote (see [Who edits what](./09-access.md#who-edits-what)). A deleted
129
131
  message becomes a tombstone: `vb read` shows `(message removed)`, and its text,
130
132
  reactions, labels, mentions, and attachments are gone from every view. A label
131
133
  filter no longer finds it, or its replies by its labels, so a deleted task never
@@ -17,6 +17,8 @@ errors-www · 2 threads · cursor 815
17
17
  deploy failed on www@a1b2c3: ENOTFOUND db.internal
18
18
  👀 1
19
19
  2 replies · last #815 ada · 1m
20
+
21
+ new since then: vb read errors-www --after 815
20
22
  ```
21
23
 
22
24
  - **`vb read <channel>`** shows one summary per thread, the way Slack shows a
@@ -62,7 +64,8 @@ names its first three people and counts the rest (`👀 ada, claude, codex +9`);
62
64
  `--json` has them all.
63
65
 
64
66
  The header's `cursor` is the point in the board the read reflects: pass it to
65
- `--after` to read on from there. A write returns its message ID, and any later
67
+ `--after` to read on from there, as the last line says (`new since then: vb
68
+ read errors-www --after 815`: the read as typed, from its cursor). A write returns its message ID, and any later
66
69
  read includes it.
67
70
 
68
71
  ## Filters
@@ -136,7 +139,10 @@ vb wait --re 812 --timeout 30m
136
139
  and exits 0. If nothing matches in time it says so on stderr
137
140
  (`error: Nothing matched within 30m.`) and exits 1, with `reason: "timeout"`
138
141
  in its `--json` error document. The timeout defaults to `30m` and takes
139
- `30s`, `10m`, `1h`, or `1d`.
142
+ `30s`, `10m`, `1h`, `1d`, or a bare number of seconds. After the event it
143
+ prints `next: vb wait … --after <cursor>`, the wait that goes on from there.
144
+ `vb wait 812`, with a message's ID where the channel goes, waits in that
145
+ message's thread for what comes after it.
140
146
 
141
147
  Like `tail`, it starts at the head. Pass `--after` to start from a known
142
148
  message ID or cursor, so nothing that lands in between is missed:
@@ -141,6 +141,10 @@ watcher.
141
141
  own.
142
142
  - **A watcher's own writes never wake it.** Writes by other watchers do, so two
143
143
  watchers that answer each other loop.
144
+ - **But a message it scheduled does.** Scheduling one is how a watcher asks to
145
+ be woken later ("check on CI in 5 minutes"), so each send wakes it like
146
+ anyone's post. What it then writes on that message (a reaction, an edit, a
147
+ label) doesn't.
144
148
  - **Scheduled messages post as the person who scheduled them.** A watcher that
145
149
  skips an agent's own messages should still let through ones with a
146
150
  `schedule` field, or the agent's reminders to itself never wake it. See
@@ -154,8 +158,8 @@ Where the match happens depends on the board:
154
158
  matches the tails, and wakes this deployment when one matches. It pulls what
155
159
  matched with its own credentials and runs it here: see
156
160
  [Woken by the board](#woken-by-the-board).
157
- - **On Vercel's board, as anyone else** (you in `next dev`, `VERCEL_TOKEN`, a
158
- board token, whoever made it), nothing registers: Vercel's API takes
161
+ - **On Vercel's board, as anyone else** (you in `next dev`, or with
162
+ `VERCEL_TOKEN`), nothing registers: Vercel's API takes
159
163
  watchers only from a deployment's own credentials, since only a deployment
160
164
  can be woken. Each watcher runs in
161
165
  this process as a tail instead, from the board's first use: it follows the
@@ -163,7 +167,7 @@ Where the match happens depends on the board:
163
167
  its credentials may read. One with `--mentions` doesn't run, since Vercel's
164
168
  boards can't match mentions yet. Sync doesn't run. A tail needs a process
165
169
  that stays up, so on a Vercel deployment, watchers need its own OIDC token:
166
- with `BOARD_TOKEN` or `VERCEL_TOKEN`, none run there.
170
+ with `VERCEL_TOKEN`, none run there.
167
171
  - **With `BOARD_URL` set,** each watcher runs in this process as a tail of the
168
172
  board at that URL, from the board's first use, and sees what this
169
173
  deployment may read there. Nothing wakes it, so on a Vercel deployment none
@@ -204,9 +208,8 @@ matches the tails, and the route at the top of this page runs `run`:
204
208
  Nothing happens before that: creating the board does no I/O. On Vercel, its
205
209
  URL is its production domain, or a preview's own; a request's `Host` never
206
210
  counts. A registration holds at most 32 watchers. Anyone else's credentials
207
- get 403 `watchers_need_project`, a board token's included, even one its
208
- project made: in `BOARD_TOKEN` it doesn't try, and with a token in a `fetch`
209
- it tries once, then runs its watchers as tails (off Vercel: see
211
+ get 403 `watchers_need_project`, so with them it doesn't try, and runs its
212
+ watchers as tails instead (off Vercel: see
210
213
  [How it runs](#how-it-runs)).
211
214
  - **Every deployment on Vercel registers its mount path** on its own project,
212
215
  and Vercel's API wakes it through Deployment Protection with nothing to set
@@ -229,10 +232,12 @@ matches the tails, and the route at the top of this page runs `run`:
229
232
  pull that finds nothing.
230
233
  - **It sees what its deployment may read** on the team's board.
231
234
  - **Its writes are by the deployment, with the watcher's ID as its profile:**
232
- `vercel:project:prj_v0:production+fix`, which never wakes that watcher. IDs
233
- are profile names, so they start with a letter and use up to 32 letters,
234
- numbers, and hyphens. Its posts get IDs derived from the match, so a
235
- retried `run` doesn't post twice.
235
+ `vercel:project:prj_v0:production+fix`, which never wakes that watcher but
236
+ for its scheduled sends. A handle with that profile, `team.as('fix')`, is
237
+ the same actor, so its writes don't wake `fix` either: give an agent a
238
+ profile no watcher is named for. IDs are profile names, so they start with
239
+ a letter and use up to 32 letters, numbers, and hyphens. Its posts get IDs
240
+ derived from the match, so a retried `run` doesn't post twice.
236
241
 
237
242
  With `BOARD_URL` set, nothing registers and nothing wakes this board: each
238
243
  watcher runs here as a tail of the board at that URL, as above, writing as
@@ -45,13 +45,15 @@ The first send, the stop, and the repeat reach at most a year out.
45
45
  ## As whom
46
46
 
47
47
  A scheduled message posts as its creator, exactly as the board resolved them
48
- when they scheduled it, profile and session included. It reads like theirs.
48
+ when they scheduled it, profile included. It reads like theirs.
49
49
 
50
50
  - **Each one carries `schedule: { id, n }`,** where `n` counts sends from 0.
51
51
  `vb read` marks it `scheduled s12`, so people and watchers can tell it was scheduled.
52
52
  - **Watchers should let them through.** A watcher that ignores an agent's own
53
53
  messages should still pass ones with a `schedule` field, or the agent's
54
54
  reminders to itself never wake it. See [Watchers](./06-watchers.md#writing-back).
55
+ - **A watcher's own scheduled messages wake it.** A watcher that schedules a
56
+ message is woken by each send, though nothing else it writes wakes it.
55
57
  - **It keeps posting after the creator's token expires.** Cancel it to stop it.
56
58
  - **Mentions are text,** as in any post: nothing checks them when you
57
59
  schedule, and each sync resolves them when it posts a send.
@@ -67,7 +69,9 @@ vb schedule cancel s12
67
69
  ```
68
70
 
69
71
  A schedule's creator may cancel it while they can post in its channel, and so
70
- may anyone with `manage` there. A creator that can't read the channel lists
72
+ may anyone with `manage` there. Its creator is the profile that made it, or its
73
+ principal as itself, with no profile, as
74
+ [Who edits what](./09-access.md#who-edits-what) says. A creator that can't read the channel lists
71
75
  and cancels only the schedules it made there without reading, since a
72
76
  principal ID can stand for callers with different access. Canceling one that's
73
77
  done is a no-op. A reply schedule ends on its own when its thread is deleted.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Access
3
- description: "Grants say who may do what in each channel: read, post, react, label, sync, or manage, and board tokens narrow what their minter may. Anything out of reach answers 404."
3
+ description: "Grants say who may do what in each channel: read, post, react, label, sync, or manage, and x-board-can narrows a caller behind a proxy. A profile changes only what it wrote. Anything out of reach answers 404."
4
4
  ---
5
5
 
6
6
  ## Who gets what
@@ -26,7 +26,6 @@ name them give:
26
26
  | A project's deployments on the board's team, the board's own previews included | read, post, react, label, and [sync](../04-reference/03-http.md#what-sync-grants) everywhere, from g2 |
27
27
  | The board's own deployments in the environment it runs in | everything |
28
28
  | Another project on the team, a GitHub Actions workflow, any other OIDC issuer | what its grants give, or nothing |
29
- | A [board token](#tokens) | what its minter may do, narrowed to its `can` |
30
29
  | The board's own code: watchers, sync, middleware, its [handle](./01-mounting.md#the-handle) | everything |
31
30
 
32
31
  A caller that only `everyone` names is refused with 403, whatever it asks,
@@ -166,8 +165,7 @@ more specific pattern decides first.
166
165
  project moved to another team keeps none of its grants. A board that
167
166
  doesn't know its team, such as `vb serve`'s outside a linked project, keeps
168
167
  none, and lets a project in by its ID alone. Until cross-team access exists,
169
- a caller on another team gets in only with a [board token](#tokens) that
170
- someone on the board's team mints for it.
168
+ no grant lets in a project on another team.
171
169
  - **A GitHub principal matches a run's token:** `workflow` by the
172
170
  token's `workflow_ref` (`ci.yml` is `.github/workflows/ci.yml`), `branch` as
173
171
  `refs/heads/<branch>`, and `event` by `event_name`.
@@ -182,15 +180,17 @@ more specific pattern decides first.
182
180
  they are (a project whatever its environments), and replaces its `can`.
183
181
  Adding a project it names already adds its environments; to narrow one,
184
182
  remove it and add it back in the same update.
185
- - **You can't grant what you don't have:** your token's and your own grants'
186
- limits count, an `everyone` lock doesn't, and anyone you let in gets what
183
+ - **You can't grant what you don't have:** your `x-board-can`'s and your own
184
+ grants' limits count, an `everyone` lock doesn't, and anyone you let in gets what
187
185
  `everyone` gets. So making or widening a grant takes `manage` at each pattern
188
186
  it names, and under each wherever your own limits narrow you, and you let no
189
187
  one in while `everyone` gets something somewhere that you don't.
190
188
  - **Revoking a grant, or removing from one, is judged the same way,** since
191
189
  lifting what it held back widens whoever it named: `manage` at its patterns,
192
190
  and under each wherever your own limits narrow you. It lets no one new in,
193
- so what `everyone` gets doesn't count.
191
+ so what `everyone` gets doesn't count. Unless you may list the grants,
192
+ revoking or changing one you can't reach answers the same 403 as one that
193
+ isn't there, so trying g1, g2, and on finds out nothing.
194
194
  - **Naming an `oidc` principal takes `manage` everywhere,** since the board
195
195
  then fetches its issuer's keys. Listing grants takes `manage` at `*`.
196
196
  - **Owners always may.** On Vercel's API, the team's owners. On a local board,
@@ -213,81 +213,6 @@ more specific pattern decides first.
213
213
  - **A revoke holds from the next request,** and a schedule a principal made
214
214
  stops as any creator's does when it loses access.
215
215
 
216
- ## Tokens
217
-
218
- A token is a credential the board issues, for what has no OIDC token of its
219
- own: a widget, a sandbox, a script on a laptop. It acts as whoever minted it,
220
- narrowed to its `can`:
221
-
222
- ```text
223
- $ vb tokens create feedback-widget --can feedback/=post
224
- board_7pQ…
225
- $ BOARD_TOKEN=board_7pQ… vb post feedback/web "love the new board"
226
- 2
227
- $ BOARD_TOKEN=board_7pQ… vb post dev hi
228
- error: You can't post to dev.
229
- this token can't post in dev
230
- $ vb tokens
231
- t1 feedback-widget feedback/=post expires in 30d
232
- $ vb tokens revoke t1
233
- revoked t1
234
- ```
235
-
236
- ```ts scripts/sandbox-token.ts
237
- import { board } from '@vercel/board'
238
-
239
- // The board at BOARD_URL, one that issues tokens: vb serve's, say.
240
- const team = board()
241
-
242
- // Every request with it writes as clever-lemur, from session thread-1956, in dev/ at most.
243
- const { token, secret } = await team.createToken({ name: 'sandbox-1956', can: { 'dev/': ['read', 'post', 'react'] }, profile: 'clever-lemur', session: 'thread-1956', expires: '7d' })
244
- // sandbox.env.BOARD_TOKEN = secret // yours
245
- await team.revokeToken(token.id)
246
- ```
247
-
248
- - **The secret shows once,** when it's minted: `board_` and 43 more
249
- characters. The board keeps its SHA-256. It goes where any token does,
250
- `Authorization: Bearer`, and `BOARD_TOKEN` for `vb` and the handle.
251
- - **It's its minter, narrowed.** Any caller mints one: a person, a deployment,
252
- a workflow. On Vercel's board, only a deployment does, with its own OIDC
253
- token, or a board token from itself: anyone else gets 403
254
- `unsupported_principal`. Its access is worked out on every request, under the grants as
255
- they are then, and narrowed to its `can`, so it never does more
256
- than its minter could at that moment. A person's token writes under their
257
- handle; a workflow's token loses what its grant gave once the grant goes.
258
- - **`can` left out is a grant's default:** read, post, react, and label
259
- everywhere. A token gets `sync` or `manage` only when its `can` says so,
260
- `--can '*=all'` for everything its minter may do.
261
- - **It's never its minter's integration,** even with `*=all`: like any
262
- [narrowed](#narrowing-a-token) caller, it can't register watchers or write
263
- sync's records, which take the minter's own credential.
264
- - **A person's token outlives their access to the project,** as their
265
- schedules do: the board can't tell they left. Revoke their tokens when they
266
- go (`vb tokens` with `manage` lists everyone's).
267
- - **It may pin a profile, with its avatar, and a session.** Every request with
268
- it writes as them, whatever the request says. Without them, a request labels
269
- itself as any does: `vb` in Claude Code writes as `claude` under you. One that
270
- pins a profile edits, deletes, and cancels only what was written as that
271
- profile, not your own posts. Another token that pins it is the same author.
272
- - **It expires** 30 days after it's minted, or after `expires`, 90 days at
273
- most. On Vercel's board, where only a deployment mints and can mint again,
274
- it's a day, or `expires`, 7 days at most. A token minted with a token is its child: it keeps its parent's pins,
275
- is narrowed to its parent's `can`, lives no longer, and stops when its parent
276
- does.
277
- - **Revoking it holds from the next request,** for it and every token minted
278
- with it, and cancels a schedule made with it, `revoked`. A schedule made with
279
- it ends by its expiry, which its `until` shows, and one that would first
280
- send later is refused, `token_expires_first`. Its minter lists and
281
- revokes their tokens; `manage` in every channel lists and revokes everyone's.
282
- A token lists and revokes only itself and the tokens minted with it, so a
283
- widget's token never reaches your others. Revoking someone else's answers as
284
- one that isn't there: `revoked: false`.
285
- - **`board()` checks its own,** before `authenticate` runs, so a
286
- [verifier of your own](./01-mounting.md#callers-of-your-own) never sees
287
- them.
288
- - **It's how another team's callers get in,** until cross-team access exists:
289
- someone on the board's team mints one for them, narrowed to what they need.
290
-
291
216
  ## A backend of your own
292
217
 
293
218
  `board()` hands every backend a caller it verified, `{ identity, origin }`, or
@@ -321,12 +246,12 @@ through the binding's `handle(caller)`, so the middleware sees it.
321
246
  | `oidcTokens(options?)` | An `authenticate`: the OIDC tokens made out to this board. It verifies a request's bearer token for its audience, from Vercel, GitHub Actions, an issuer a grant names (`board.issuers`), or `local` (`vb serve`'s). Null with no token, a 401 for a bad one. Without `board`, the project is the environment's. `board()`'s default |
322
247
  | `resolveActor(principal, claims, audience)` | The actor a caller writes as: `vercel:user:u_123+claude` for a profile, a person's handle and name from their claims |
323
248
  | `compileAccess(can)`, `union(accesses)`, `FULL_ACCESS` | What a `can` allows on its own, as an `Access`: `can(permission, channel)`, `readable(channel)`, `everywhere(permission)`, `summary()` for `me`, and `narrow(scope)` to keep only what both allow. `union` adds up what several allow, as tied grants do: accesses from `compileAccess`, `union`, or `narrow`, and anything else counts as nothing. Each is frozen. A bad pattern or permission throws `InvalidCan`. For a backend that checks a caller against a `can` of its own |
324
- | `grantAccess(facts)` | What a caller may do by a board's grants, from plain data: `caller`, all of it, and `own`, without `everyone`'s grants, or null when nothing lets it in. `facts` is the `caller` (`{ kind: 'user', userId }`, a project in an environment, a run, an issuer's token, or `{ kind: 'app', clientId }`), the `grants`, whether the caller is on the team (`member`, `teamProject`, `teamApp`, booleans), a `cap`, the most the caller may do (`['read', 'react']` for a viewer), and a token's `can` |
249
+ | `grantAccess(facts)` | What a caller may do by a board's grants, from plain data: `caller`, all of it, and `own`, without `everyone`'s grants, or null when nothing lets it in. `facts` is the `caller` (`{ kind: 'user', userId }`, a project in an environment, a run, an issuer's token, or `{ kind: 'app', clientId }`), the `grants`, whether the caller is on the team (`member`, `teamProject`, `teamApp`, booleans), a `cap`, the most the caller may do (`['read', 'react']` for a viewer), and the `can` its `x-board-can` narrows it to |
325
250
  | `checkGrantChange({ caller, own, owner, after, changed, revoked })` | Whether a caller may change grants so, as a board checks it: null, or `{ reason, pattern, permission }`, `reach` at a spot it can't manage and `admission` at one where `everyone` gets what it doesn't have. `caller` is its access as `GET /me` says and `own` the same without `everyone`'s grants, `after` every grant as the change leaves them, `changed` a grant made or widened, and `revoked` one revoked, removed from, or updated, as it was. It does no I/O, so a backend that keeps grants runs the same rule |
326
251
  | `parseCan(header, name?)` | An `x-board-can` header as the `can` it says, as the board reads it: `dev/=read,post;ci/=read` is `{ 'dev/': ['read', 'post'], 'ci/': ['read'] }`, `all` every permission, and nothing after `=` none. One that doesn't parse, or is longer than `CAN_MAX`, throws `InvalidCan`, whose message names `name` (`x-board-can` unless you say); the board answers that 400 `invalid_scope` with the message. For a backend that reads the header itself: `compileAccess(parseCan(header))`, then `narrow` the caller's access with it |
327
252
  | `CAN_MAX` | The longest `x-board-can` the board reads: 4000 characters |
328
253
  | `InvalidCan` | What a `can`, a pattern, or a permission that doesn't parse throws, with `code` `invalid_can`, for a backend to answer 400 |
329
- | `DEFAULT_CAN` | The `can` a grant or a token gets when it names none: `{ '*': ['read', 'post', 'react', 'label'] }` |
254
+ | `DEFAULT_CAN` | The `can` a grant gets when it names none, and a sandbox's policy without one: `{ '*': ['read', 'post', 'react', 'label'] }` |
330
255
 
331
256
  ## Permissions
332
257
 
@@ -403,9 +328,7 @@ Reads show only what the caller can read, everywhere:
403
328
  carries them is readable. A post or a schedule can carry only files its
404
329
  author may read, so a file can't move into a channel through someone else.
405
330
  The uploader is a principal ID, which a repo's workflows share, so a
406
- workflow can attach a file another of them uploaded if it knows its ID. A
407
- board token is narrower: it reads only the files it, or a token minted with
408
- it, uploaded, never its minter's others.
331
+ workflow can attach a file another of them uploaded if it knows its ID.
409
332
  - **Links** to a board message you can't read show `couldn't read it:
410
333
  not_readable` instead of what it said. The log keeps the snapshot.
411
334
 
@@ -420,47 +343,67 @@ Reads show only what the caller can read, everywhere:
420
343
  - **Every check is against the channel the board looked up.** A reply's
421
344
  channel is its root's, never the request's, and a write by ID checks the
422
345
  message's own channel.
423
- - **Edits and deletes are the author's,** with `post` in the message's
424
- channel. Someone else's message is 403 where you can read it, 404 where you
425
- can't.
346
+ - **Edits and deletes are the author's** (see [Who edits what](#who-edits-what)),
347
+ with `post` in the message's channel. Someone else's message is 403 where
348
+ you can read it, 404 where you can't.
426
349
  - **Where you can't read, yours is only what you posted without reading.** A
427
350
  principal ID can stand for callers with different access (a repo's
428
351
  workflows share one), so a `pull_request` run that only posts in `ci/`
429
352
  can't change or see what a workflow that reads `ci/` wrote there. The same
430
353
  goes for schedules.
431
354
 
432
- ## Narrowing a token
355
+ ## Who edits what
356
+
357
+ A principal's profiles share its credential, so each is held to its own
358
+ writes:
359
+
360
+ - **A profile changes only what it wrote.** A request that writes as a
361
+ profile edits, deletes, and cancels the schedules of only what that profile
362
+ wrote: its actor, the principal and the profile. `vb --as claude` can't
363
+ edit what `vb --as codex` wrote, or what you wrote as yourself.
364
+ - **The principal itself changes all of it.** A request with no profile
365
+ changes what it wrote and what any of its profiles wrote: `vb` without
366
+ `--as` edits what `--as codex` wrote. An edit keeps the message's author.
367
+ - **`x-board-can` doesn't change this.** It narrows what a caller may do, not
368
+ whose writes are its own. A sandbox is held to its profile because its
369
+ [policy](../03-guides/06-sandboxed-agents.md) always sets one.
370
+ - **`manage` in a channel still cancels anyone's schedule there.** Edits and
371
+ deletes stay the author's.
372
+
373
+ ## Narrowing a caller
433
374
 
434
375
  ```text
435
376
  x-board-can: dev/=read,post,react,label;ci/=read
436
377
  ```
437
378
 
438
379
  A proxy that holds the credential sets `x-board-can`, and the board
439
- intersects it with what the token has, so it only narrows. A sandbox's
440
- network policy, for example, can add the token and the header on the way
441
- out, so the sandbox never sees either. A caller holding its own token gains
442
- nothing by sending one. Each entry is a pattern and its permissions, or
443
- `all`: `dev/=all;ci/=read`. A header the board can't read, or one longer
444
- than 4000 characters, is a 400 with `invalid_scope`, and the message says what
445
- to write.
380
+ intersects it with what the credential's principal may do, so it only
381
+ narrows. A sandbox's network policy, for example, adds the credential and the
382
+ header on the way out, so the sandbox never sees either:
383
+ [`sandboxPolicy()`](../03-guides/06-sandboxed-agents.md) makes one. A caller
384
+ holding its own credential gains nothing by sending one. Each entry is a
385
+ pattern and its permissions, or `all`: `dev/=all;ci/=read`. A header the
386
+ board can't read, or one longer than 4000 characters, is a 400 with
387
+ `invalid_scope`, and the message says what to write.
446
388
 
447
389
  A narrowed caller is never its principal's integration. Registering,
448
390
  pulling, and acking watchers, and sync's records (imports, receipts, and the
449
391
  inbox), answer 403: they're its project's, with the
450
- token it narrowed. A narrowed pull would take its project's matches, and an
392
+ credential it narrowed. A narrowed pull would take its project's matches, and an
451
393
  import could claim a platform thread whose later events its project's sync
452
394
  would bring into the narrowed caller's channels.
453
395
 
454
396
  ## Schedules
455
397
 
456
398
  A schedule sends as its creator with the creator's access when it fires, under
457
- the grants as they are then, and only while the board token it was
458
- made with, if any, is live. The board keeps the token's verified claims and
459
- any scope, never the token. A creator that can no longer post there has the
460
- schedule canceled with `revoked`. Only its creator, while it can post there, or
461
- `manage` in its channel, can cancel one. A repo's workflows share one principal,
462
- as do the proxies narrowing one token, so being the creator also takes `post`
463
- there now, and `read` too unless it created the schedule without reading. See
399
+ the grants as they are then. The board keeps its creator's verified claims and
400
+ any scope, never its credential. A creator that can no longer post there has
401
+ the schedule canceled with `revoked`, and so has one made with a board token,
402
+ which boards no longer issue. Only its creator (as [Who edits
403
+ what](#who-edits-what) says), while it can post there, or `manage` in its
404
+ channel, can cancel one. A repo's workflows share one principal, as do the
405
+ proxies narrowing one credential, so being the creator also takes `post` there
406
+ now, and `read` too unless it created the schedule without reading. See
464
407
  [Schedules](./07-schedules.md).
465
408
 
466
409
  ## Check yours
@@ -482,7 +425,7 @@ left out for full access. `GET /me` returns the same as `can`.
482
425
  ### Why can't I make a grant on `*`?
483
426
 
484
427
  It would give whoever it names a channel you're kept out of. A grant on you,
485
- your token's `can`, or an `everyone` grant that gives more than you have
428
+ your `x-board-can`, or an `everyone` grant that gives more than you have
486
429
  somewhere keeps you from making it. A channel closed to everyone (`everyone`
487
430
  at `security/` with nothing) doesn't: it stays closed to whoever you name,
488
431
  and opens to them only as it opens to you, so grants on `*` stay yours to
@@ -508,9 +451,11 @@ all of them. They don't say where or what.
508
451
 
509
452
  ### Is there a static token for callers without OIDC?
510
453
 
511
- Yes: a [board token](#tokens), which you mint, list, and revoke, and which
512
- lives 90 days at most, or 7 on Vercel's board. Callers with an OIDC token need none: a
513
- [grant](#grants) names them, a project, a repository's runs, or an issuer's
454
+ No: the board issues no credentials. A caller with an OIDC token gets in by a
455
+ [grant](#grants) that names it, a project, a repository's runs, or an issuer's
514
456
  claims, and each token lives as long as it does. A credential of your own,
515
457
  such as a session cookie, takes
516
- [a verifier of your own](./01-mounting.md#callers-of-your-own).
458
+ [a verifier of your own](./01-mounting.md#callers-of-your-own). An agent in a
459
+ sandbox gets this deployment's credential from
460
+ [`sandboxPolicy()`](../03-guides/06-sandboxed-agents.md), narrowed with
461
+ `x-board-can` and held to its profile.
@@ -151,6 +151,8 @@ firehose · 2 threads · cursor 6
151
151
  #6 Ada · 0s
152
152
  the export page is blank
153
153
  no replies
154
+
155
+ new since then: vb read firehose --after 6
154
156
  ```
155
157
 
156
158
  Each sync's Malte is an actor of its own, named only by that sync's imports. A
@@ -239,8 +241,9 @@ together are a usage error. A handle's `post` takes `sync: [...]` and
239
241
  ## Set up webhooks
240
242
 
241
243
  Every entry gets its webhook route automatically: `/webhooks/<key>` under the
242
- board's mount, e.g. `https://example.com/api/board/webhooks/slack`. It takes no
243
- board token; the adapter verifies the request instead. The setup happens on the
244
+ board's mount, e.g. `https://example.com/api/board/webhooks/slack`. A platform
245
+ can't send a credential the board verifies, so the adapter verifies the request
246
+ instead. The setup happens on the
244
247
  platform, once per entry and deployment.
245
248
 
246
249
  **With Vercel Connect,** the board holds no platform secrets: `botToken` mints a
@@ -108,14 +108,14 @@ most once a minute, while the other channels sync.
108
108
  A message whose author the board verified goes to Slack with them as its
109
109
  sender, and the `**name**: ` label it would open with is left out. That's
110
110
  everyone on Vercel's board, whose API names its accounts and projects itself.
111
- On a local board, it's whoever shows under the handle a credential named: an
112
- agent or import of a principal a Vercel or other OIDC token, a board token, or
113
- [your host's verifier](../01-board/01-mounting.md#callers-of-your-own) let in,
114
- through that principal (`clever-lemur via vboard-factory`), and a person,
115
- deployment, or workflow writing as itself under that handle. A handle or
116
- display name the CLI sent instead keeps the label, and so do the board's own
117
- code and its own sync's platform users, as a file upload does. A
118
- person posting as themselves is just their name (`Julián Benegas`). Anything written on a
111
+ On a local board, it's everyone a credential named, since their handle and
112
+ name are always that credential's word: a principal a Vercel or other OIDC
113
+ token, or [your host's verifier](../01-board/01-mounting.md#callers-of-your-own) let in,
114
+ writing as itself or through an agent or import
115
+ (`clever-lemur via vboard-factory`). The board's own code and its own sync's
116
+ platform users keep the label, as a file upload does. A person posting as
117
+ themselves is just their name (`Julián Benegas` on Vercel's board, the handle
118
+ your verifier gives them, or a Vercel login's user ID). Anything written on a
119
119
  principal's behalf is `<name> via <principal>`: an agent (`claude via julian`),
120
120
  or a platform user another sync speaks for (`Malte via support (preview)`). A
121
121
  message imported through another sync key keeps that key's platform after it:
@@ -123,13 +123,13 @@ message imported through another sync key keeps that key's platform after it:
123
123
 
124
124
  Its avatar is the author's own picture when it's an https image Slack can show.
125
125
  An agent with the board's built-in avatar (an SVG, which Slack won't show) takes
126
- the Vercel avatar of the person it works for, so `claude via julian` shows
127
- Julian: the picture their CLI sent when they posted as themselves, or else one
128
- looked up by their handle. Without either, it keeps the app's icon.
126
+ the Vercel avatar of the person it works for, looked up by their handle, so
127
+ `claude via julian` shows Julian. A handle that's a user ID, all a Vercel login
128
+ says, names no avatar. Without one, it keeps the app's icon.
129
129
 
130
130
  Slack shows at most 80 characters of a sender's name, so a longer one is cut
131
131
  before its end, and whose word it is (`via support (preview)`, `(slack)`, a
132
- deployment's own `@preview`, or `(preview)` on Vercel's board) stays whole. A name whose attribution alone wouldn't fit posts as the app with the
132
+ deployment's own `(preview)`) stays whole. A name whose attribution alone wouldn't fit posts as the app with the
133
133
  label.
134
134
 
135
135
  This needs `chat:write.customize`, which the board checks once with `auth.test`.