@vercel/board 0.38.0 → 0.40.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 +5 -3
- package/dist/{access-CVkjSfxj.mjs → access-Bl_k_Hpa.mjs} +1 -1
- package/dist/access.d.mts +2 -2
- package/dist/access.mjs +4 -4
- package/dist/{actors-kfMejhaw.mjs → actors-yBRWTpt5.mjs} +38 -53
- package/dist/{auth-B3bBYOqf.mjs → auth-C8URZHLx.mjs} +2 -2
- package/dist/{auth-BXLCkeB0.d.mts → auth-DtmZzlHm.d.mts} +5 -2
- package/dist/{backend-BkQlF1LQ.d.mts → backend-BW5NbBsp.d.mts} +37 -11
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/blocks-CVoBC7ur.mjs +402 -0
- package/dist/blocks-DGvh2alZ.d.mts +33 -0
- package/dist/{chat-provider-DyNy5xdC.d.mts → chat-provider-Bbb9JguG.d.mts} +2 -2
- 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 +3 -3
- package/dist/cli.mjs +5 -5
- package/dist/{commands-B5d-lmNN.d.mts → commands-BJLocuXj.d.mts} +10 -0
- package/dist/{commands-BLS7erNu.mjs → commands-D6VWegVY.mjs} +88 -8
- package/dist/{conformance-qJF96jZI.mjs → conformance-BWhZ0k8T.mjs} +256 -13
- package/dist/conformance.d.mts +4 -3
- package/dist/conformance.mjs +1 -1
- package/dist/data-values-C-Cq80hz.mjs +176 -0
- package/dist/digest-D32GV_mX.mjs +4 -0
- package/dist/{engine-eUgO5jTM.mjs → engine-Djif8XVk.mjs} +191 -77
- package/dist/{errors-rYDxZEuN.mjs → errors-CNRJqUuL.mjs} +16 -14
- package/dist/{exports-BsfcChdp.mjs → exports-C2OWIbLU.mjs} +639 -258
- package/dist/exports-FyRBIAMs.d.mts +4 -0
- package/dist/{index-DpVyZa9b.d.mts → index-Cuxbz_E0.d.mts} +2 -2
- package/dist/index.d.mts +7 -6
- package/dist/index.mjs +6 -5
- package/dist/index.node.d.mts +7 -6
- package/dist/index.node.mjs +5 -4
- package/dist/inspect/app.js +110 -109
- package/dist/inspect/engine.js +5 -5
- package/dist/inspect-CLy6FrOZ.mjs +2 -0
- package/dist/{inspect-DtCbBtOW.mjs → inspect-cGcP8ZO9.mjs} +4 -4
- package/dist/{local-Bo3XzEKB.mjs → local-CsleYuyM.mjs} +664 -752
- package/dist/{main-0nvLgajF.mjs → main-D97xuqWZ.mjs} +177 -59
- package/dist/{memory-DkoqhxIH.mjs → memory-BvVoglGv.mjs} +2 -2
- package/dist/{mentions-CB6ShY4R.mjs → mentions-CT2bN5eP.mjs} +17 -3
- package/dist/{middleware-CPqAuRtp.mjs → middleware-BF9vnPPS.mjs} +70 -2
- package/dist/{targets-B4Uikw0J.mjs → origin-DLCmrwmE.mjs} +47 -39
- package/dist/{page-UsfvSIWc.mjs → page-6BTCZWGY.mjs} +2 -2
- package/dist/page-BnY8FhPn.mjs +2 -0
- package/dist/{provider-D5yVFisj.d.mts → provider-YqkF1E2k.d.mts} +23 -13
- package/dist/{routes-BffuaoTX.d.mts → routes-CAjd5ARa.d.mts} +101 -25
- package/dist/schemas.d.mts +37 -0
- package/dist/schemas.mjs +3 -0
- package/dist/{serve-D7I3KisQ.mjs → serve-Cs-e0Jke.mjs} +4 -4
- package/dist/{server-Cc3nYq3H.mjs → server-CIfMdIt3.mjs} +43 -98
- package/dist/{serving-DJMcG0dT.mjs → serving-B4l0nLng.mjs} +1 -1
- package/dist/{sql-l3ysn4O5.mjs → sql-Bv-RQu8n.mjs} +73 -10
- package/dist/{sqlite-CAwNHbQD.mjs → sqlite-D4mkYihG.mjs} +2 -2
- package/dist/{sqlite-db-cm5yhrD-.mjs → sqlite-db-BraLvHtf.mjs} +1 -1
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-slack.d.mts +14 -8
- package/dist/sync-slack.mjs +42 -15
- package/dist/sync.d.mts +2 -2
- package/dist/{tokens-DA9ipsZ-.mjs → tokens-CrrXAVGz.mjs} +2 -2
- package/docs/01-board/01-mounting.md +7 -5
- package/docs/01-board/03-identity.md +71 -39
- package/docs/01-board/04-messages.md +58 -1
- package/docs/01-board/05-reading.md +3 -3
- package/docs/01-board/06-watchers.md +10 -14
- package/docs/01-board/07-schedules.md +2 -4
- package/docs/01-board/08-middleware.md +1 -1
- package/docs/01-board/09-access.md +25 -22
- package/docs/02-sync/01-overview.md +72 -7
- package/docs/02-sync/02-functions.md +11 -6
- package/docs/02-sync/03-slack.md +40 -16
- package/docs/02-sync/06-providers.md +9 -4
- package/docs/04-reference/01-cli.md +110 -18
- package/docs/04-reference/02-board.md +63 -10
- package/docs/04-reference/03-http.md +157 -31
- package/docs/04-reference/05-conformance.md +13 -6
- package/docs/index.md +1 -1
- package/package.json +5 -1
- package/dist/digest-DAxy9Ula.mjs +0 -4
- package/dist/exports-BJ3wmEMY.d.mts +0 -4
- package/dist/inspect-5mkjJYMS.mjs +0 -2
- package/dist/page-R0RoE_gM.mjs +0 -2
|
@@ -74,8 +74,7 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
|
|
|
74
74
|
[How it runs](./06-watchers.md#how-it-runs).
|
|
75
75
|
- **What Vercel's API doesn't keep yet answers 501 `not_supported`:** files on
|
|
76
76
|
a scheduled message, labels on a scheduled reply, and a post's `sync`
|
|
77
|
-
targets. A
|
|
78
|
-
channel's message and thread counts are left out.
|
|
77
|
+
targets. A channel's message and thread counts are left out.
|
|
79
78
|
|
|
80
79
|
A request's caller is who `board()` verified it is: `authenticate` checks its
|
|
81
80
|
credential for the board's URL, which a token's audience must equal, works out
|
|
@@ -315,7 +314,7 @@ What a backend has:
|
|
|
315
314
|
| --- | --- |
|
|
316
315
|
| `discovery`, `me`, `messages`, `post`, … | One method per protocol route, `(caller, input, signal)`, named for it: the [HTTP reference](../04-reference/03-http.md#routes) lists them, and the `Protocol` type from `@vercel/board` says what each takes and answers |
|
|
317
316
|
| `routes` | Routes of its own beside the protocol: `{ method, path, handle(request, { caller, param }) }`. One at a protocol route's path takes its place. `board()` verifies nothing for them: `caller` is null for a request, or the handle's own when its call reaches one |
|
|
318
|
-
| `keeps` | Whether the board lives here. `true` serves its callers: the board's people, its own deployments, and whoever grants and board tokens let in. `false
|
|
317
|
+
| `keeps` | Whether the board lives here. `true` serves its callers: the board's people, its own deployments, and whoever grants and board tokens let in. `false` serves no requests: on Vercel's board, only wake-ups and webhooks, and at `BOARD_URL`, nothing |
|
|
319
318
|
| `trust` | Its [grants](./09-access.md#grants) and [board tokens](./09-access.md#tokens), for a backend that keeps them: `grants()`, `token(hash)`, and `live(id)`. `board()` checks each request against them as they are then. Without it, they let no one in |
|
|
320
319
|
| `bind(binding)` | Called once, when `board()` is created, before any request. It does no I/O. `binding.name` and `binding.team` are `board({ name, team })`'s, or null |
|
|
321
320
|
|
|
@@ -405,7 +404,10 @@ write.
|
|
|
405
404
|
optionally `expiresAt`. Its handle stands: the one the CLI sends doesn't
|
|
406
405
|
replace it, so a verifier that wants it returns `request.claims.handle`
|
|
407
406
|
itself. The name, profile, and `x-board-can` the caller sends still apply
|
|
408
|
-
on top of it.
|
|
407
|
+
on top of it. The board takes the handle as checked: a person posts to Slack
|
|
408
|
+
under it as a plain sender ([who posts under a name](../02-sync/03-slack.md#messages-post-under-their-authors-name)),
|
|
409
|
+
so a verifier that echoes the caller's handle lets them pick the name they
|
|
410
|
+
post under.
|
|
409
411
|
- **`kind: 'person'` is a person on the team:** it gets what grants give
|
|
410
412
|
people, as the board's own people do (g1 gives everything), and a channel
|
|
411
413
|
closed to `everyone` keeps it out unless a grant names it. So your verifier
|
|
@@ -462,7 +464,7 @@ curl https://www.example.com/api/board
|
|
|
462
464
|
`board()` knows its project from `VERCEL_PROJECT_ID` on Vercel, or
|
|
463
465
|
`.vercel/project.json` locally. Run `vercel link` in the app once, so a local
|
|
464
466
|
board can verify the development tokens people send it. A route with no
|
|
465
|
-
backend answers no discovery: it serves only wake-ups and webhooks.
|
|
467
|
+
backend answers no discovery: it serves only wake-ups and webhooks, and with `BOARD_URL` set, nothing.
|
|
466
468
|
|
|
467
469
|
The CLI doesn't take discovery's word for it. It mints a person's token only
|
|
468
470
|
for the project Vercel says the board's host is a deployment of, so a board
|
|
@@ -14,7 +14,7 @@ a host can recognize its own credentials too: see
|
|
|
14
14
|
|
|
15
15
|
Only a few routes take no token: discovery, the built-in avatars, the OpenAPI
|
|
16
16
|
document, and `/webhooks/:key`, which the platform's adapter authenticates instead. A
|
|
17
|
-
route whose watchers
|
|
17
|
+
route whose watchers Vercel's board runs also answers
|
|
18
18
|
`POST /wake` without one: a wake-up only says to pull.
|
|
19
19
|
|
|
20
20
|
## Where tokens come from
|
|
@@ -121,13 +121,14 @@ A **principal** is who holds the credential. It's a readable string:
|
|
|
121
121
|
| `vercel:project:prj_x:production` | a deployment of a Vercel project |
|
|
122
122
|
| `github:repo:123456` | a GitHub Actions workflow in that repo |
|
|
123
123
|
| `oidc:gitlab.com:project_path:acme/api:ref_type:branch:ref:main` | another issuer's token, by its `sub` |
|
|
124
|
-
| `slack:user:U0456`, `github:user:583231` | a platform user
|
|
124
|
+
| `slack:user:U0456`, `github:user:583231` | a platform user the board's own [sync](../02-sync/01-overview.md) checked, under the sync key they came through |
|
|
125
125
|
| `board:watch:triage`, `board:client`, `board:client:deploys` | a [local board](./10-local.md)'s own [watchers](./06-watchers.md) and [handle](./01-mounting.md#the-handle), with `as()`'s profile |
|
|
126
126
|
|
|
127
127
|
A **profile** is a named identity within a principal: an agent acting for a
|
|
128
|
-
person
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
person, or a [platform user](#platform-users) a sync speaks for. An **actor**
|
|
129
|
+
is what a message is attributed to: the principal alone, or
|
|
130
|
+
`principal+profile`, like `vercel:user:u_abc123+claude`. One with a profile
|
|
131
|
+
shows through its principal: **claude via julian**.
|
|
131
132
|
|
|
132
133
|
### Profiles
|
|
133
134
|
|
|
@@ -162,9 +163,32 @@ When you write as yourself, the CLI also sends your Vercel display name and
|
|
|
162
163
|
avatar. Like your handle, they're details you assert; your identity is the
|
|
163
164
|
verified principal.
|
|
164
165
|
|
|
166
|
+
### Platform users
|
|
167
|
+
|
|
168
|
+
A Slack, GitHub, or Linear user arrives through [sync](../02-sync/01-overview.md),
|
|
169
|
+
named under the sync key they came through: `slack:user:U0456` through the key
|
|
170
|
+
`slack`, `slack-eu:user:U0456` through a key `slack-eu` registered for Slack. The
|
|
171
|
+
key is the connection, so renaming one changes its users' IDs; the platform shows
|
|
172
|
+
as their logo. The board's own sync checks each platform webhook itself, so what
|
|
173
|
+
it imports is by the user, shown by name. Any other sync, a project that
|
|
174
|
+
registers one on the board or any sync on Vercel's board, only says who wrote a
|
|
175
|
+
message, so what it imports is by a profile of that project, named
|
|
176
|
+
`<sync key>:<user>`: `vercel:project:prj_support:preview+slack:user:U0456`.
|
|
177
|
+
It shows through the project, with its environment outside production:
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
#2 Malte via support (preview) · 2m
|
|
181
|
+
ship it, I checked
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Each sync's profile of a user is an actor of its own: two syncs' Malte don't
|
|
185
|
+
group, react, or match `--by` together, and only a sync's own imports change
|
|
186
|
+
its profile's name and avatar.
|
|
187
|
+
|
|
165
188
|
## Machines outside the project
|
|
166
189
|
|
|
167
|
-
g2 lets every project on the board's team read, post, react, and
|
|
190
|
+
g2 lets every project on the board's team read, post, react, label, and
|
|
191
|
+
[sync](../04-reference/03-http.md#what-sync-grants).
|
|
168
192
|
Anything else outside the board's project needs a
|
|
169
193
|
[grant](./09-access.md#grants), which says what it may do in each channel.
|
|
170
194
|
Someone with `manage` where it reaches creates it on the board, and it holds
|
|
@@ -218,8 +242,19 @@ Handles are display hints, not reservations:
|
|
|
218
242
|
that verifier returns, and the CLI's doesn't replace it.
|
|
219
243
|
- **A profile's** is `<person>/<profile>`: `julian/claude`.
|
|
220
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`).
|
|
221
248
|
- **A workflow's** is `owner/repo`.
|
|
222
|
-
- **A platform user's** is their login or display name there
|
|
249
|
+
- **A platform user's** is their login or display name there, for the
|
|
250
|
+
board's own sync. One a sync elsewhere imports is under that project's name,
|
|
251
|
+
in every environment: support's Malte is `support/malte`, and www's
|
|
252
|
+
`www/malte`. The part after `/` is made typable: accents taken off,
|
|
253
|
+
lowercased, every run of anything but letters, digits, `.`, `_`, and `-` as
|
|
254
|
+
one `-`, and the ends trimmed, so "Jürgen Ubl" is `support/jurgen-ubl`. When
|
|
255
|
+
nothing is left, it's their ID on the platform, without the sync key, the same
|
|
256
|
+
way (`T_EU:U0MALTE` is `t_eu-u0malte`). A handle holds 128 characters, so a
|
|
257
|
+
longer one is cut to fit, its ends trimmed again.
|
|
223
258
|
|
|
224
259
|
`vb actors` lists them.
|
|
225
260
|
|
|
@@ -229,37 +264,34 @@ Handles are display hints, not reservations:
|
|
|
229
264
|
vb reply 812 "@ada can you look? cc @julian/claude"
|
|
230
265
|
```
|
|
231
266
|
|
|
232
|
-
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
267
|
+
- **A mention is text.** The board posts it as written and stores nothing
|
|
268
|
+
else: no handle or actor ID fails a write, whether no one has it, several
|
|
269
|
+
share it, or the board has never seen them. An edit is just new text.
|
|
270
|
+
- **`@handle` and `@person/profile`** name whoever has that handle.
|
|
271
|
+
- **`@[actor-id]`** names an exact actor: `@[slack:user:U0456]`. It's how to
|
|
272
|
+
name one of several who share a handle.
|
|
236
273
|
- **`@[ada@vercel.com]`** names whoever has that email on a synced platform,
|
|
237
|
-
even someone the board hasn't seen.
|
|
238
|
-
renders natively. An email no platform knows stays plain text. A writer that
|
|
239
|
-
can't read the channel gets back what it wrote, and never sees who an email
|
|
240
|
-
turned out to be.
|
|
274
|
+
even someone the board hasn't seen.
|
|
241
275
|
- **Mentions in inline code or code blocks don't count.**
|
|
242
|
-
- **
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
name there: mention a Slack user in Slack by their actor
|
|
265
|
-
(`@[slack:user:U0456]`) or their email (`@[ada@vercel.com]`).
|
|
276
|
+
- **Each sync resolves them when it posts,** and only against its own users:
|
|
277
|
+
the platform users it brought in under the key it posts through. On Slack:
|
|
278
|
+
- `@ada` becomes `<@U0456>` when exactly one of its users goes by `ada`, or
|
|
279
|
+
by `<its project>/ada`: `@support/ada` reaches only support's Ada, and
|
|
280
|
+
`@ada` is the shorthand each sync reads as its own. Of several, it's the
|
|
281
|
+
one who wrote in the thread, if exactly one did. Otherwise it stays `@ada`.
|
|
282
|
+
- `@[actor-id]` becomes `<@U0456>` when it's one of its users, and their
|
|
283
|
+
name for anyone else, a board person included.
|
|
284
|
+
- `@[ada@vercel.com]` is looked up as it posts (it needs `users:read.email`):
|
|
285
|
+
`<@U0456>` when Slack finds her, and the plain email when it doesn't.
|
|
286
|
+
|
|
287
|
+
So `@malte` reaches each sync's own Malte, and neither two syncs that each
|
|
288
|
+
bring in a Malte nor a sync allowed only one channel makes it fail anywhere.
|
|
289
|
+
GitHub mentions its users as `@login`.
|
|
290
|
+
- **Filters read the text.** `--mentions @ada` finds `@ada`, and
|
|
291
|
+
`@[<actor id>]` for anyone who goes by `ada`. A name covers what's under it:
|
|
292
|
+
a person's agents (`@julian/claude`), and a project's imports
|
|
293
|
+
(`--mentions support` finds `@support/malte`). `--mentions` alone is your
|
|
294
|
+
handle and ID. A caller
|
|
295
|
+
that can't read every channel gets what it names as written, and its agents,
|
|
296
|
+
since who goes by what is for readers of every channel. See
|
|
297
|
+
[Reading](./05-reading.md#filters).
|
|
@@ -59,7 +59,64 @@ await team.reply(message.id, 'rolled back to d4e5f6')
|
|
|
59
59
|
Text is markdown (GFM), up to 10,000 characters. It may be empty only when the
|
|
60
60
|
message has attachments. Sync converts it for each platform, so `**bold**`
|
|
61
61
|
arrives in Slack as bold, and stores what platforms send as markdown too.
|
|
62
|
-
`@mentions`
|
|
62
|
+
`@mentions` stay as you write them, and each sync resolves them when it posts;
|
|
63
|
+
see [Mentions](./03-identity.md#mentions).
|
|
64
|
+
|
|
65
|
+
## Data
|
|
66
|
+
|
|
67
|
+
A message can carry data: a JSON object in a code fence that names its
|
|
68
|
+
schema, a block. The board checks it against that schema when the message is
|
|
69
|
+
written, and reads show it parsed.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
vb post deploys --schema sandbox@1 '{"id":"sbx-123","action":"started"}' # a message that is only its data
|
|
73
|
+
echo "$EVENT" | vb reply "$id" --schema sandbox@1 - # the JSON from stdin
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`--schema` takes the text as that schema's JSON, from wherever text comes: the
|
|
77
|
+
argument, `-` for stdin, or `--text-file`. To say something beside the data,
|
|
78
|
+
write the fence yourself. The text is still the message:
|
|
79
|
+
|
|
80
|
+
````text
|
|
81
|
+
sandbox sbx-123 stopped
|
|
82
|
+
|
|
83
|
+
```json#sandbox@1
|
|
84
|
+
{ "id": "sbx-123", "action": "stopped" }
|
|
85
|
+
```
|
|
86
|
+
````
|
|
87
|
+
|
|
88
|
+
- **The fence names the schema,** `json#<name>@<version>`: one the board has,
|
|
89
|
+
which `vb schemas` lists and `vb schemas create` registers. A message can
|
|
90
|
+
hold several blocks.
|
|
91
|
+
- **A write that doesn't match isn't written.** A block that isn't a JSON
|
|
92
|
+
object, or doesn't match its schema, is 400 `invalid_block`, and the message
|
|
93
|
+
says which field is wrong. One that names a schema the board doesn't have is
|
|
94
|
+
400 `schema_not_found`. An edit and a schedule are checked as a post is.
|
|
95
|
+
- **Reads show the data.** Every message has `blocks`, each `{ schema, version,
|
|
96
|
+
data }`, in the order they're written. `vb read` prints a block as one line,
|
|
97
|
+
`data sandbox@1 · {…}`, and `--json` has the data itself, so a program never
|
|
98
|
+
parses the text.
|
|
99
|
+
- **Only what's written on the board carries blocks.** A message a sync brings
|
|
100
|
+
in from Slack or GitHub is a platform's text: it's never refused, and it has
|
|
101
|
+
no blocks, whatever it says.
|
|
102
|
+
- **To show a block without posting one,** put it in a longer fence, of four
|
|
103
|
+
backticks, in a quote, or under a list item. Only a fence at the top level
|
|
104
|
+
of the message is a block.
|
|
105
|
+
|
|
106
|
+
In code, `block()` writes the fence:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
// anywhere in Node:
|
|
110
|
+
import { board, block } from '@vercel/board'
|
|
111
|
+
|
|
112
|
+
const team = board()
|
|
113
|
+
const message = await team.post('deploys', block('sandbox@1', { id: 'sbx-123', action: 'started' }))
|
|
114
|
+
await team.reply(message.id, `it stopped\n\n${block('sandbox@1', { id: 'sbx-123', action: 'stopped' })}`)
|
|
115
|
+
// message.blocks: [{ schema: 'sandbox', version: 1, data: { id: 'sbx-123', action: 'started' } }]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
See [schemas](../04-reference/01-cli.md#schemas) for registering one, and
|
|
119
|
+
[Schemas](../04-reference/03-http.md#schemas) for what a definition may use.
|
|
63
120
|
|
|
64
121
|
## Editing and deleting
|
|
65
122
|
|
|
@@ -74,8 +74,8 @@ read includes it.
|
|
|
74
74
|
| `<channel>` | that channel; `www/` with a trailing slash for the subtree |
|
|
75
75
|
| `--re <id>` | the thread rooted at `<id>`: the root and its replies |
|
|
76
76
|
| `--by <handle>` | messages by that actor: a handle without the `@`, or an exact actor ID |
|
|
77
|
-
| `--mentions` | messages
|
|
78
|
-
| `--source <source>` | where it was written: a sync key (`slack`, `github`), or `board` |
|
|
77
|
+
| `--mentions` | messages whose text mentions you, by handle or actor ID; `--mentions @ada` for someone else (a person's covers their agents), or `--mentions ada@vercel.com` for `@[ada@vercel.com]` |
|
|
78
|
+
| `--source <source>` | where it was written: a sync key (`slack`, `github`), or `board`. On Vercel's board, another project's key is `www/slack`, or by its ID, `prj_…/slack` |
|
|
79
79
|
| `--label <key>` | messages with that label; `key=value`, or `key=a\|b` for either |
|
|
80
80
|
| `--text <words>` | text containing the words, case-insensitive (a substring, not search) |
|
|
81
81
|
| `--after <id>` | messages after that message ID or cursor; for `read`, threads with activity after it |
|
|
@@ -84,7 +84,7 @@ read includes it.
|
|
|
84
84
|
vb read prs --label state=open # what's pending
|
|
85
85
|
vb read issues --label tag.bug --source github
|
|
86
86
|
vb read --mentions # everywhere I'm mentioned
|
|
87
|
-
vb tail --mentions julian
|
|
87
|
+
vb tail --mentions @julian/claude # my agent's pings, as they land
|
|
88
88
|
vb read errors-www --by ada --text ENOTFOUND
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -43,9 +43,8 @@ A channel (or `prefix/` for a subtree) and the shared
|
|
|
43
43
|
- **Positions aren't filters.** A watcher starts at the head when it's deployed
|
|
44
44
|
and sees every match after it, so `--after` fails the boot.
|
|
45
45
|
- **A watcher has no "me".** `--mentions` alone fails; name a handle:
|
|
46
|
-
`--mentions @ada`, or `--mentions @julian/claude` for an agent
|
|
47
|
-
|
|
48
|
-
(`--mentions slack:user:U0456`).
|
|
46
|
+
`--mentions @ada`, or `--mentions @julian/claude` for an agent, or an actor:
|
|
47
|
+
`--mentions slack:user:U0456`. It matches the text, as `vb tail` does.
|
|
49
48
|
- **A bad id or expression fails the boot** with the CLI's error:
|
|
50
49
|
`watch triage: --after isn't a filter`.
|
|
51
50
|
- **Ids** are lowercase letters, numbers, `-`, and `_`.
|
|
@@ -165,8 +164,10 @@ Where the match happens depends on the board:
|
|
|
165
164
|
boards can't match mentions yet. Sync doesn't run. A tail needs a process
|
|
166
165
|
that stays up, so on a Vercel deployment, watchers need its own OIDC token:
|
|
167
166
|
with `BOARD_TOKEN` or `VERCEL_TOKEN`, none run there.
|
|
168
|
-
- **With `BOARD_URL` set,**
|
|
169
|
-
|
|
167
|
+
- **With `BOARD_URL` set,** each watcher runs in this process as a tail of the
|
|
168
|
+
board at that URL, from the board's first use, and sees what this
|
|
169
|
+
deployment may read there. Nothing wakes it, so on a Vercel deployment none
|
|
170
|
+
run.
|
|
170
171
|
- **On [`local()`](./10-local.md),** everything happens in this process. Each
|
|
171
172
|
event is matched against every watcher on its thread's lane, and `run`
|
|
172
173
|
happens on that lane too.
|
|
@@ -233,12 +234,7 @@ matches the tails, and the route at the top of this page runs `run`:
|
|
|
233
234
|
numbers, and hyphens. Its posts get IDs derived from the match, so a
|
|
234
235
|
retried `run` doesn't post twice.
|
|
235
236
|
|
|
236
|
-
With `BOARD_URL` set,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
left public (Standard Protection), or a Deployment Protection Exception for
|
|
241
|
-
the domain it registers. A wake-up reveals nothing and is trusted for
|
|
242
|
-
nothing: it only makes this board pull with its own credentials.
|
|
243
|
-
- **A board without an `https` URL pulls on its own** from its first use,
|
|
244
|
-
each pull held open until something matches: a dev server, say.
|
|
237
|
+
With `BOARD_URL` set, nothing registers and nothing wakes this board: each
|
|
238
|
+
watcher runs here as a tail of the board at that URL, as above, writing as
|
|
239
|
+
this deployment with the watcher's ID as its profile. A tail needs a process
|
|
240
|
+
that stays up, so on a Vercel deployment none run.
|
|
@@ -53,10 +53,8 @@ when they scheduled it, profile and session included. It reads like theirs.
|
|
|
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
55
|
- **It keeps posting after the creator's token expires.** Cancel it to stop it.
|
|
56
|
-
- **Mentions are
|
|
57
|
-
|
|
58
|
-
then. At send time, one
|
|
59
|
-
that's become ambiguous stays plain text.
|
|
56
|
+
- **Mentions are text,** as in any post: nothing checks them when you
|
|
57
|
+
schedule, and each sync resolves them when it posts a send.
|
|
60
58
|
|
|
61
59
|
## Listing and canceling
|
|
62
60
|
|
|
@@ -66,7 +66,7 @@ it's made, as the caller's post.
|
|
|
66
66
|
| | |
|
|
67
67
|
| --- | --- |
|
|
68
68
|
| `write` | `{ kind: 'post', channel, re, text, labels, attachments }` or `{ kind: 'edit', id, channel, re, text }`. `re` is the thread's root, or null for a root; IDs are strings, as clients see them |
|
|
69
|
-
| `author` | Who's writing: the actor, with `kind` (`person`, `agent`, `deployment`, `workflow`, `external`) |
|
|
69
|
+
| `author` | Who's writing: the actor, with `kind` (`person`, `agent`, `deployment`, `workflow`, `external`). An import's is the actor it lands as: a profile of its sync's principal, unless it's the board's own sync's ([platform users](./03-identity.md#platform-users)) |
|
|
70
70
|
| `source` | Where it came from (below) |
|
|
71
71
|
| `respond(text)` | What to tell the author when it drops the write, where they wrote from |
|
|
72
72
|
| `board` | The board's handle, acting as `board:middleware` |
|
|
@@ -11,7 +11,7 @@ Vercel's board says who may use it in Vercel's API: the team's people, and the
|
|
|
11
11
|
projects it grants the board to (see
|
|
12
12
|
[A board by its name](./01-mounting.md#a-board-by-its-name)). A route on
|
|
13
13
|
Vercel's board, or on the board at `BOARD_URL`, serves no callers of its own:
|
|
14
|
-
it answers only wake-ups and webhooks.
|
|
14
|
+
on Vercel's it answers only wake-ups and webhooks, and at `BOARD_URL` nothing.
|
|
15
15
|
|
|
16
16
|
Every caller is an OIDC principal. `board()` verifies it with its
|
|
17
17
|
`authenticate` (see [Identity](./03-identity.md)), works out what it may do,
|
|
@@ -23,7 +23,7 @@ name them give:
|
|
|
23
23
|
| Caller | On a new board |
|
|
24
24
|
| --- | --- |
|
|
25
25
|
| A person: your `vercel login`, or `vb serve`'s local user | everything, from g1 |
|
|
26
|
-
| A project's deployments on the board's team, the board's own previews included | read, post, react, and
|
|
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
29
|
| A [board token](#tokens) | what its minter may do, narrowed to its `can` |
|
|
@@ -139,17 +139,19 @@ more specific pattern decides first.
|
|
|
139
139
|
names. A caller nothing else names is refused.
|
|
140
140
|
- **Every board starts with three grants,** as a team's board in Vercel's API
|
|
141
141
|
does. g1 names `all-users` with `*` at `all`, capped by role. g2 names
|
|
142
|
-
`all-projects` in production, preview, and development,
|
|
143
|
-
`all-apps
|
|
144
|
-
board has no apps, so g3 lets no one
|
|
145
|
-
any other.
|
|
142
|
+
`all-projects` in production, preview, and development with read, post,
|
|
143
|
+
react, label, and sync everywhere. g3 names `all-apps` with read, post,
|
|
144
|
+
react, and label everywhere. A local board has no apps, so g3 lets no one
|
|
145
|
+
in there. Revoke or change them like any other.
|
|
146
146
|
- **A person's role, and an app's scopes, cap what grants give:** a viewer
|
|
147
147
|
reads and reacts, and an app with only `read:messageboard` only reads.
|
|
148
148
|
|
|
149
149
|
> [!WARNING]
|
|
150
150
|
> g2 lets in every project on the team, previews included, and a preview runs
|
|
151
|
-
> any branch's code.
|
|
152
|
-
>
|
|
151
|
+
> any branch's code. With its `sync`, each can write as any user of a platform
|
|
152
|
+
> it says it syncs. Revoke g2, narrow it, or close the channels it shouldn't
|
|
153
|
+
> reach, when that's too much (see
|
|
154
|
+
> [What `sync` grants](../04-reference/03-http.md#what-sync-grants)).
|
|
153
155
|
|
|
154
156
|
- **A grant names principals by what people type.** Vercel's API looks up an
|
|
155
157
|
email, a project's name, and a repository, and keeps their IDs: views show
|
|
@@ -347,11 +349,12 @@ through the binding's `handle(caller)`, so the middleware sees it.
|
|
|
347
349
|
`{ '*': 'all', 'security/': [] }` can do neither.
|
|
348
350
|
- **`sync` speaks for platform users.** A caller with it in a channel can write
|
|
349
351
|
there as any Slack, GitHub, or Linear user it names, which is what a
|
|
350
|
-
deployment that syncs onto this board needs.
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
deployment that syncs onto this board needs. They're its word, so they're its
|
|
353
|
+
own [profiles](./03-identity.md#platform-users) of those users and show
|
|
354
|
+
through it (`Malte via support`): no sync renames another's, or the board's
|
|
355
|
+
own sync's. g2 gives it to every project on the team:
|
|
356
|
+
[what `sync` grants](../04-reference/03-http.md#what-sync-grants) says how
|
|
357
|
+
to keep it to the deployments that sync.
|
|
355
358
|
- **`sync` attaches only a platform thread no other board thread has.** Taking
|
|
356
359
|
one over would send its replies to a channel its readers may not be in, so
|
|
357
360
|
it's a 409 with `already_synced`. A caller that reads the other thread's
|
|
@@ -384,15 +387,15 @@ Reads show only what the caller can read, everywhere:
|
|
|
384
387
|
filter. A schedule you created without reading its channel also shows,
|
|
385
388
|
while you can post there.
|
|
386
389
|
- **People.** `vb actors` lists everyone for a caller that reads every
|
|
387
|
-
channel. Anyone else sees the authors,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
390
|
+
channel. Anyone else sees the authors, the actors mentioned by ID
|
|
391
|
+
(`@[actor-id]`), and the reactors of what they can read, and themselves. A
|
|
392
|
+
post in a channel you can't read comes back with the text you sent, and
|
|
393
|
+
read back later (`GET /posts/:id`, your schedules), each actor it mentions
|
|
394
|
+
but you shows as `@…`. A mention is text no write checks, so a handle that's
|
|
395
|
+
shared, one no one has, and an actor ID the board doesn't know all post
|
|
396
|
+
alike: no write says which ones exist. Nor does `--mentions`: it finds
|
|
397
|
+
someone through their other name (their handle for their ID, or the other
|
|
398
|
+
way round) only for a caller that reads every channel.
|
|
396
399
|
- **Events about no message** (who's who, a thread's sync targets) reach only
|
|
397
400
|
a caller that reads every channel. Events you can't see still advance an SSE
|
|
398
401
|
stream's cursor with a bare `id:`.
|
|
@@ -29,11 +29,8 @@ it works the same on Vercel's board, on `local()`, and on a
|
|
|
29
29
|
|
|
30
30
|
### With `BOARD_URL` set
|
|
31
31
|
|
|
32
|
-
`board()` with `BOARD_URL` set
|
|
33
|
-
|
|
34
|
-
there as this deployment. That board must let this deployment `sync` in those
|
|
35
|
-
channels, and each sync entry's key must be one its own sync doesn't have:
|
|
36
|
-
registering a key it has answers 409 `sync_key_taken`.
|
|
32
|
+
Sync runs where the board's log is. `board()` with `BOARD_URL` set and `sync`
|
|
33
|
+
throws: configure sync on the board at that URL, or on Vercel's board.
|
|
37
34
|
|
|
38
35
|
## Configure it
|
|
39
36
|
|
|
@@ -61,8 +58,8 @@ export const GET = team.fetch, POST = team.fetch
|
|
|
61
58
|
|
|
62
59
|
> [!NOTE]
|
|
63
60
|
> On Vercel's board, sync runs as this deployment's project, and Vercel's API
|
|
64
|
-
> keeps its records and wakes this route to retry what failed.
|
|
65
|
-
>
|
|
61
|
+
> keeps its records and wakes this route to retry what failed. A file posted on a
|
|
62
|
+
> platform comes over as an attachment on the board, uploaded as this project.
|
|
66
63
|
|
|
67
64
|
To pass your own Chat SDK adapter instead of a connector, see
|
|
68
65
|
[Slack](./03-slack.md#your-own-adapter) and [GitHub](./04-github.md#setup). Any
|
|
@@ -132,6 +129,74 @@ Board labels never sync out to platforms. Messages from other bots (Sentry,
|
|
|
132
129
|
Vercel alerts) sync like anyone's; only the board's own posts are skipped, so
|
|
133
130
|
nothing echoes.
|
|
134
131
|
|
|
132
|
+
## Who an import is by
|
|
133
|
+
|
|
134
|
+
A platform user is named under the sync key they came through, not the
|
|
135
|
+
platform: `slack:user:U0456` through key `slack`, `slack-eu:user:U0456` through a
|
|
136
|
+
key `slack-eu` for a second Slack workspace, shown with Slack's logo either way.
|
|
137
|
+
On `local()`, the board's own sync checks each platform webhook itself, so what
|
|
138
|
+
it imports is by the platform user: `slack:user:U0456`. Every other sync, a
|
|
139
|
+
project that registers one on the board and every sync on Vercel's board, only
|
|
140
|
+
says who wrote a message, so what it imports is by that project's profile of the
|
|
141
|
+
user, `<project>+<sync key>:<user>`, and shows through the project:
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
$ vb read firehose
|
|
145
|
+
firehose · 2 threads · cursor 6
|
|
146
|
+
|
|
147
|
+
#2 Malte via support (preview) · 0s
|
|
148
|
+
ship it, I checked
|
|
149
|
+
no replies
|
|
150
|
+
|
|
151
|
+
#6 Ada · 0s
|
|
152
|
+
the export page is blank
|
|
153
|
+
no replies
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Each sync's Malte is an actor of its own, named only by that sync's imports. A
|
|
157
|
+
mention resolves as each sync posts it, against its own users: support's Malte
|
|
158
|
+
is `@support/malte`, `@malte` renders natively (`<@U0456>`) through the sync
|
|
159
|
+
whose Malte it is, and a
|
|
160
|
+
platform user named by actor only through the key they came through, and of a
|
|
161
|
+
sync elsewhere's only through that sync; any other posts their name. Renaming a key changes its users' IDs. See
|
|
162
|
+
[platform users](../01-board/03-identity.md#platform-users).
|
|
163
|
+
|
|
164
|
+
## Each project's keys
|
|
165
|
+
|
|
166
|
+
On Vercel's board, a project's sync keys are its own. Support's `slack` and
|
|
167
|
+
www's `slack` are two keys on one board: each project imports and delivers
|
|
168
|
+
through its own, and an import through one reaches the other's Slack threads
|
|
169
|
+
like any message on the board, but never goes back through the key it came by.
|
|
170
|
+
|
|
171
|
+
Within a project, one deployment holds each key, so a message never goes out
|
|
172
|
+
twice. Production takes a key over from the project's previews and development;
|
|
173
|
+
otherwise the first deployment to register a key keeps it. A deployment that
|
|
174
|
+
doesn't hold a key runs nothing through it: its webhook for that key answers 200
|
|
175
|
+
before its adapter reads anything, and it pulls, imports, starts, and delivers
|
|
176
|
+
nothing there.
|
|
177
|
+
Its watchers run as usual. It says once who holds the key:
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
[board] slack is synced by production
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Another project's key reads `<project>/<key>`, by the name its deployments go
|
|
184
|
+
by on the board, or its ID where Vercel's API doesn't name it: in a message's
|
|
185
|
+
`from`, in `vb sync <id>`, and in `--source`, which takes either. A
|
|
186
|
+
deployment's own project's keys are bare, and a person sees each key under its
|
|
187
|
+
project:
|
|
188
|
+
|
|
189
|
+
```text
|
|
190
|
+
$ vb read general --source www/slack --json # trimmed to text and from
|
|
191
|
+
{"text": "checkout is down", "from": "www/slack"}
|
|
192
|
+
|
|
193
|
+
$ vb sync 812
|
|
194
|
+
support/slack C0C8XN8SQRG message 1792780353.701549
|
|
195
|
+
www/slack C0D2K4R7Q1M message 1792780391.118204
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Only the project's own sync links its copies, since it has the platform's app.
|
|
199
|
+
|
|
135
200
|
## Targets
|
|
136
201
|
|
|
137
202
|
A target is `<key>:<channel or thread>`. A channel target starts a new thread
|
|
@@ -301,7 +301,9 @@ reply, react, label, or attach:
|
|
|
301
301
|
|
|
302
302
|
Its writes (a reply, a label, a reaction, an edit or delete of the user's own
|
|
303
303
|
message) are authored by the platform actor who triggered the event, like
|
|
304
|
-
`slack:user:U0456
|
|
304
|
+
`slack:user:U0456` (on Vercel's board, this project's profile of them: see
|
|
305
|
+
[platform users](../01-board/03-identity.md#platform-users)), with the same
|
|
306
|
+
provenance as the import, and go through the
|
|
305
307
|
[middleware](../01-board/08-middleware.md) like it. Its reads, and anything else
|
|
306
308
|
it does, are sync's own. It holds no token: `board()` makes its calls. It works
|
|
307
309
|
the same on any backend that runs sync.
|
|
@@ -320,10 +322,12 @@ slack('slack/acme', render(({ message }) => message.text, channels({ '#prs': 'pr
|
|
|
320
322
|
```
|
|
321
323
|
|
|
322
324
|
The default is `**${label}**: ${message.text}`, where the label is the author's
|
|
323
|
-
name
|
|
324
|
-
came from
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
name, through their principal when they have a profile, and the platform a message
|
|
326
|
+
came from: `claude via julian`, `ada (slack)`, or `Malte via support (slack)` for
|
|
327
|
+
a platform user another sync speaks for. board still adds a line per attachment the platform
|
|
328
|
+
didn't take, and resolves mentions to the platform's own form after your
|
|
329
|
+
renderer runs, against this sync's own users
|
|
330
|
+
([mentions](../01-board/03-identity.md#mentions)).
|
|
327
331
|
|
|
328
332
|
Each channel can render its own way, since `render` wraps any function:
|
|
329
333
|
|
|
@@ -347,7 +351,8 @@ renders to, board edits that copy, so a PR's root in Slack can show its state:
|
|
|
347
351
|
```
|
|
348
352
|
|
|
349
353
|
`mentionOf(actor)` returns how the platform mentions one of its own actors
|
|
350
|
-
(`<@U0456>` in Slack), or null for anyone else
|
|
354
|
+
(`<@U0456>` in Slack), or null for anyone else, a platform user another sync
|
|
355
|
+
speaks for included: only that sync mentions them natively. The default label is
|
|
351
356
|
the author's name, so nobody gets pinged unless a renderer asks:
|
|
352
357
|
|
|
353
358
|
```ts
|