@vercel/board 0.50.0 → 0.51.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/LICENSE +201 -0
- package/README.md +128 -118
- package/dist/{access-BbgmsAFF.mjs → access-DdojoPZm.mjs} +1 -1
- package/dist/access.d.mts +2 -2
- package/dist/access.mjs +4 -4
- package/dist/{actors-CX2D22hL.mjs → actors-CDkNgWUL.mjs} +3 -3
- package/dist/{auth-Z9-Khvvw.d.mts → auth-C4VxPLYz.d.mts} +1 -1
- package/dist/{auth-DJDTfgAL.mjs → auth-zPqFJocD.mjs} +10 -3
- package/dist/{backend-CcaaS9Xl.d.mts → backend-Da_YEltI.d.mts} +16 -13
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-DQ1GHm4o.d.mts → chat-provider-BHyX6H8H.d.mts} +2 -2
- package/dist/{chat-provider-HJ7y_ipp.mjs → chat-provider-Br2RXgLV.mjs} +4 -3
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +15 -7
- package/dist/cli-embedded.mjs +9 -6
- package/dist/cli.mjs +6 -6
- package/dist/{client-C2T4eaXd.d.mts → client-C4-r10SA.d.mts} +25 -4
- package/dist/{commands-Cm4sODIu.d.mts → commands-B6pgzwTI.d.mts} +10 -0
- package/dist/{commands-nN8WpvCe.mjs → commands-DB1T8vT9.mjs} +37 -10
- package/dist/{conformance-Cr-umDl0.mjs → conformance-DW4-9Dwf.mjs} +176 -64
- package/dist/conformance.d.mts +4 -3
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DJZ8Xy_g.mjs → engine-D8YAsQS_.mjs} +17 -9
- package/dist/{errors-DYF4hhIc.mjs → errors-DbCKqGXp.mjs} +35 -7
- package/dist/{events-BdOCmnZh.mjs → events-mWKc1uvZ.mjs} +1 -1
- package/dist/{exports-CuD-Mxkw.mjs → exports-BDE3eV7B.mjs} +593 -261
- package/dist/{exports-lmr6UHHc.d.mts → exports-BUtR_AHa.d.mts} +4 -4
- package/dist/{external-D2jq_DEQ.mjs → external-DkWafjn-.mjs} +5 -1
- package/dist/{index-_KxJu15n.d.mts → index-BTuTaBaK.d.mts} +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +4 -4
- package/dist/index.node.d.mts +7 -7
- package/dist/index.node.mjs +4 -4
- package/dist/inspect/app.js +41 -41
- package/dist/inspect/engine.js +4 -4
- package/dist/inspect-BXvdLMET.mjs +2 -0
- package/dist/{inspect-CZeoSm7E.mjs → inspect-Nd_TlU1s.mjs} +3 -3
- package/dist/inspect.d.mts +1 -1
- package/dist/inspect.mjs +2 -2
- package/dist/{local-BVSFSSYf.mjs → local-BsYjQrl_.mjs} +113 -35
- package/dist/{main-B016auoG.mjs → main-CSIXhZ_b.mjs} +117 -36
- package/dist/{memory-C2lzMV_t.mjs → memory-wmUDblhm.mjs} +2 -2
- package/dist/{middleware-DUKIITFZ.mjs → middleware-iVTNf5Su.mjs} +1 -1
- package/dist/{profile-header-Cj0Cb1cf.mjs → profile-header-O8wC8yk8.mjs} +12 -1
- package/dist/{provider-Dwb_9mnu.d.mts → provider-CGicSMdu.d.mts} +4 -2
- package/dist/{routes-BE0y6wCk.mjs → routes-C85Sbhtm.mjs} +44 -11
- package/dist/{routes-B6SEA9yw.d.mts → routes-ChGBn0K3.d.mts} +60 -23
- package/dist/{serve-B10e7QaY.mjs → serve-Cp0qM4jk.mjs} +9 -8
- package/dist/{server-ViWNvg5q.mjs → server-HPq6MO3_.mjs} +50 -33
- package/dist/{serving-SbqeWqlA.mjs → serving-aOQsBok0.mjs} +1 -1
- package/dist/{shell-DmpmgOPC.mjs → shell-CUR5woOP.mjs} +1 -1
- package/dist/{sql-iABdyCiz.mjs → sql-D0MqINA6.mjs} +1 -1
- package/dist/{sqlite-28EMrmk7.mjs → sqlite-Dj2ZEtgy.mjs} +2 -2
- package/dist/{sqlite-db-Ckd-ceNe.mjs → sqlite-db-DjbTlUwN.mjs} +1 -1
- 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 +3 -3
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-linear.mjs +3 -3
- package/dist/sync-slack.d.mts +21 -4
- package/dist/sync-slack.mjs +35 -11
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{tags-D0qra0Qy.mjs → tags-CxDCF_tt.mjs} +1 -1
- package/dist/{task-batch-9lVDG3d-.mjs → task-batch-D3ASL5_-.mjs} +53 -9
- package/dist/{tokens-C-iK0Cku.mjs → tokens-C-T0B1uF.mjs} +31 -7
- package/dist/{version-C70RLVEK.mjs → version-BJH1vWR0.mjs} +1 -1
- package/docs/01-board/01-mounting.md +20 -7
- package/docs/01-board/03-identity.md +1 -1
- package/docs/01-board/04-messages.md +5 -0
- package/docs/01-board/05-reading.md +71 -16
- package/docs/01-board/07-schedules.md +1 -1
- package/docs/01-board/10-local.md +1 -1
- package/docs/02-sync/01-overview.md +3 -3
- package/docs/02-sync/03-slack.md +4 -3
- package/docs/03-guides/01-coding-agents.md +1 -1
- package/docs/03-guides/02-inspector.md +13 -5
- package/docs/03-guides/07-build-a-ui.md +15 -11
- package/docs/04-reference/01-cli.md +64 -25
- package/docs/04-reference/02-board.md +48 -23
- package/docs/04-reference/03-http.md +33 -14
- package/docs/04-reference/05-conformance.md +11 -10
- package/docs/index.md +1 -1
- package/package.json +14 -2
- package/dist/inspect-UCcPViyA.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as unauthorized } from "./errors-
|
|
2
|
-
import { _ as markVerified, a as TOKENS, h as issuerName, o as VERCEL_ISSUER, x as
|
|
1
|
+
import { d as unauthorized } from "./errors-DbCKqGXp.mjs";
|
|
2
|
+
import { S as trustedIssuers, _ as markVerified, a as TOKENS, h as issuerName, o as VERCEL_ISSUER, x as subFits, y as privateHost } from "./auth-zPqFJocD.mjs";
|
|
3
3
|
import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
|
|
4
4
|
//#region src/server/identity.ts
|
|
5
5
|
let fromDisk;
|
|
@@ -88,23 +88,46 @@ function factsOf(issuer, iss, claims) {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
const issuerMatches = (iss, accepted) => typeof accepted === "string" ? iss === accepted : accepted.test(iss);
|
|
91
|
+
/** The keys of the issuers seen most recently: an issuer a token names costs a fetch, so what stays is bounded. */
|
|
91
92
|
const remoteKeys = /* @__PURE__ */ new Map();
|
|
93
|
+
const loading = /* @__PURE__ */ new Map();
|
|
94
|
+
const REMOTE_KEYS_MAX = 100;
|
|
95
|
+
const DISCOVERY_TIMEOUT_MS = 5e3;
|
|
92
96
|
/**
|
|
93
97
|
* An issuer's keys, by OIDC Discovery 1.0: its document under the issuer, naming that issuer
|
|
94
98
|
* (§4.3), and its keys at an https `jwks_uri` (§3), which must be on the internet, as a grant's
|
|
95
|
-
* issuer must. Like jose's own fetch of the keys, it follows no redirect.
|
|
99
|
+
* issuer must. Like jose's own fetch of the keys, it follows no redirect. Callers asking for the
|
|
100
|
+
* same issuer at once share one fetch, and a fetch that stalls gives up.
|
|
96
101
|
*/
|
|
97
|
-
|
|
102
|
+
function keysFor(iss) {
|
|
98
103
|
const cached = remoteKeys.get(iss);
|
|
99
|
-
if (cached)
|
|
104
|
+
if (cached) {
|
|
105
|
+
remoteKeys.delete(iss);
|
|
106
|
+
remoteKeys.set(iss, cached);
|
|
107
|
+
return Promise.resolve(cached);
|
|
108
|
+
}
|
|
109
|
+
let pending = loading.get(iss);
|
|
110
|
+
if (!pending) {
|
|
111
|
+
pending = discover(iss).finally(() => loading.delete(iss));
|
|
112
|
+
loading.set(iss, pending);
|
|
113
|
+
}
|
|
114
|
+
return pending;
|
|
115
|
+
}
|
|
116
|
+
async function discover(iss) {
|
|
100
117
|
const unknown = (why) => unauthorized(`cannot load keys for issuer ${iss}: ${why}`);
|
|
101
|
-
const response = await fetch(`${iss.replace(/\/+$/, "")}/.well-known/openid-configuration`, {
|
|
118
|
+
const response = await fetch(`${iss.replace(/\/+$/, "")}/.well-known/openid-configuration`, {
|
|
119
|
+
redirect: "manual",
|
|
120
|
+
signal: AbortSignal.timeout(DISCOVERY_TIMEOUT_MS)
|
|
121
|
+
}).catch(() => {
|
|
122
|
+
throw unknown("its discovery did not answer");
|
|
123
|
+
});
|
|
102
124
|
if (response.status !== 200) throw unknown(`its discovery answered ${response.status}`);
|
|
103
125
|
const config = await response.json().catch(() => null);
|
|
104
126
|
if (config?.issuer !== iss) throw unknown("its discovery names another issuer");
|
|
105
127
|
const jwks = typeof config.jwks_uri === "string" ? URL.parse(config.jwks_uri) : null;
|
|
106
128
|
if (jwks?.protocol !== "https:" || privateHost(jwks.hostname)) throw unknown("its jwks_uri isn't an https URL on the internet");
|
|
107
|
-
const keys = createRemoteJWKSet(jwks);
|
|
129
|
+
const keys = createRemoteJWKSet(jwks, { timeoutDuration: DISCOVERY_TIMEOUT_MS });
|
|
130
|
+
if (remoteKeys.size >= REMOTE_KEYS_MAX) remoteKeys.delete(remoteKeys.keys().next().value);
|
|
108
131
|
remoteKeys.set(iss, keys);
|
|
109
132
|
return keys;
|
|
110
133
|
}
|
|
@@ -141,6 +164,7 @@ function createVerifier(options) {
|
|
|
141
164
|
const expiresAt = claims.exp ? /* @__PURE__ */ new Date(claims.exp * 1e3) : null;
|
|
142
165
|
if (isOidc) {
|
|
143
166
|
if (typeof claims.sub !== "string" || claims.sub === "") throw unauthorized(`token from ${iss} without sub`);
|
|
167
|
+
if (!subFits(claims.sub)) throw unauthorized(`token from ${iss} has a sub with a +, a ], or a space, which a principal's ID can't hold`);
|
|
144
168
|
return {
|
|
145
169
|
id: `oidc:${issuerName(iss)}:${claims.sub}`,
|
|
146
170
|
kind: "workflow",
|
|
@@ -72,15 +72,27 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
|
|
|
72
72
|
[How it runs](./06-watchers.md#how-it-runs).
|
|
73
73
|
- **Vercel's API limits requests per caller:** a login, a token, or a
|
|
74
74
|
deployment gets a number of requests a minute, which its responses' `x-ratelimit-limit`
|
|
75
|
-
says, and every profile writing as it shares them. One call can be
|
|
76
|
-
requests: a channel's read is about five
|
|
77
|
-
more. A request it puts off with 429 goes again after a second, doubling,
|
|
75
|
+
says, and every profile writing as it shares them. One call can be a few
|
|
76
|
+
requests: a channel's read is about five. A request it puts off with 429 goes again after a second, doubling,
|
|
78
77
|
four times; one it still puts off fails with 429, and `Retry-After` on it
|
|
79
78
|
says how many seconds until the API's window resets. Its message names the
|
|
80
79
|
limit, and `vb` prints the wait.
|
|
81
80
|
- **What Vercel's API doesn't keep yet answers 501 `not_supported`:** files on
|
|
82
81
|
a scheduled message and a post's `sync` targets. A channel's message and
|
|
83
82
|
thread counts are left out.
|
|
83
|
+
- **It keeps no search index, and lists threads one channel at a time.** A
|
|
84
|
+
read there names one channel or one thread: `threads()` by `by`, `mentions`,
|
|
85
|
+
`text`, or `from`, with no channel, or with a subtree, is 501
|
|
86
|
+
`not_supported`, refused before anything is read. See
|
|
87
|
+
[Reading](./05-reading.md#on-vercels-board).
|
|
88
|
+
- **`tail` and `wait` follow the whole board, or a tree, in one request** where
|
|
89
|
+
Vercel's API reads its feed across channels for the caller: one that reads
|
|
90
|
+
every channel. For anyone else, and on an API from before that feed, they
|
|
91
|
+
follow each channel's own, a request a channel.
|
|
92
|
+
- **A feed's newest events (`last`) are one request:** a channel's, a tree's,
|
|
93
|
+
or the board's. Across channels they come from that same feed, so anyone it
|
|
94
|
+
isn't for is refused with `not_supported` and names one channel: they're
|
|
95
|
+
never read a channel at a time.
|
|
84
96
|
|
|
85
97
|
A request's caller is who `board()` verified it is: `authenticate` checks its
|
|
86
98
|
credential for the board's URL, which a token's audience must equal, works out
|
|
@@ -103,7 +115,7 @@ backend:
|
|
|
103
115
|
| `middleware` | Runs on every post and edit before it reaches the backend, whatever it came from. See [Middleware](./08-middleware.md) |
|
|
104
116
|
| `watch` | Tails the board runs for you, keyed by id: `{ triage: { tail, run } }`. See [Watchers](./06-watchers.md) |
|
|
105
117
|
| `sync` | Two-way sync, keyed by a name you choose: `{ slack: slack('slack/acme', channels({…})) }`. See [Sync](../02-sync/01-overview.md) |
|
|
106
|
-
| `url` | The board's public URL, which every token's audience must equal. Inferred from requests otherwise |
|
|
118
|
+
| `url` | The board's public URL, which every token's audience must equal. Inferred from requests otherwise only on Vercel and in development (with a warning): a request's sender chooses its Host, so a self-hosted board in production without `url` verifies no tokens and answers 500 `no_board_url` |
|
|
107
119
|
| `basePath` | The mount path, e.g. `/api/board`. Inferred from requests otherwise: a request can only make it look deeper than it is (`/api/board/x/messages/1`), so the board keeps the shallowest it's seen |
|
|
108
120
|
| `streamMaxMs` | How long an SSE stream stays open before the board closes it and the client reconnects. Default `280000` |
|
|
109
121
|
|
|
@@ -132,7 +144,8 @@ export const acmeGeneral = board({ team: 'acme' })
|
|
|
132
144
|
- **`name` is one of the team's boards, and `team` another team's.** Without
|
|
133
145
|
a name, it's the team's default board, named General, so `general` finds it
|
|
134
146
|
too. A name matches whatever its case.
|
|
135
|
-
- **A name is 1 to 64 characters with no `/`,**
|
|
147
|
+
- **A name is 1 to 64 characters with no `/`,** counted once it's trimmed and
|
|
148
|
+
NFC-normalized, as Vercel's API counts it, and `team` is a team's ID
|
|
136
149
|
(`team_…`) or its slug. `board()` throws on either that isn't. Without
|
|
137
150
|
`team`, it's the team the environment finds: in Node, the deployment's,
|
|
138
151
|
`VERCEL_ORG_ID`, or the linked project's.
|
|
@@ -212,7 +225,7 @@ export async function POST(request: Request) {
|
|
|
212
225
|
| Name | What it is |
|
|
213
226
|
| --- | --- |
|
|
214
227
|
| `fetch` | The board's HTTP handler. Export it from the route as `GET` and `POST` |
|
|
215
|
-
| `post`, `reply`, `
|
|
228
|
+
| `post`, `reply`, `threads`, … | What the board's caller can do: see the [handle reference](../04-reference/02-board.md) |
|
|
216
229
|
| `as(profile)` | The handle, acting with that profile |
|
|
217
230
|
|
|
218
231
|
- **On Vercel's board, it's this deployment,** with its OIDC token: it writes
|
|
@@ -319,7 +332,7 @@ What a backend has:
|
|
|
319
332
|
|
|
320
333
|
| Field | What it is |
|
|
321
334
|
| --- | --- |
|
|
322
|
-
| `discovery`, `me`, `
|
|
335
|
+
| `discovery`, `me`, `threads`, `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 |
|
|
323
336
|
| `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 |
|
|
324
337
|
| `keeps` | Whether the board lives here. `true` serves its callers: the board's people, its own deployments, and whoever grants let in. `false` serves no requests: on Vercel's board, only wake-ups and webhooks, and at `BOARD_URL`, nothing |
|
|
325
338
|
| `trust` | Its [grants](./09-access.md#grants), for a backend that keeps them: `grants()`. `board()` checks each request against them as they are then. Without it, they let no one in |
|
|
@@ -122,7 +122,7 @@ A **principal** is who holds the credential. It's a readable string:
|
|
|
122
122
|
| `tailscale:user:ada@example.com` | a person on a `vb serve` board [behind Tailscale](../03-guides/08-tailnet.md), by their login |
|
|
123
123
|
| `vercel:project:prj_x:production` | a deployment of a Vercel project |
|
|
124
124
|
| `github:repo:123456` | a GitHub Actions workflow in that repo |
|
|
125
|
-
| `oidc:gitlab.com:project_path:acme/api:ref_type:branch:ref:main` | another issuer's token, by its `sub` |
|
|
125
|
+
| `oidc:gitlab.com:project_path:acme/api:ref_type:branch:ref:main` | another issuer's token, by its `sub`. A token whose `sub` has a `+`, `]`, or space is refused: it would read as another workflow's profile |
|
|
126
126
|
| `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 |
|
|
127
127
|
| `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 |
|
|
128
128
|
|
|
@@ -239,6 +239,11 @@ vb read 812
|
|
|
239
239
|
vb download nXHY2NjUHuzE5F1QpXyBdQ # saves after.png here; a path, or - for stdout
|
|
240
240
|
```
|
|
241
241
|
|
|
242
|
+
Saved by its own name, a file never replaces one that's already there, a
|
|
243
|
+
name like `.npmrc` saves as `npmrc`, and invisible characters in the name are
|
|
244
|
+
dropped: whoever posted it chose the name. Give `download` a path to save it
|
|
245
|
+
anywhere else, or over a file on purpose.
|
|
246
|
+
|
|
242
247
|
```text
|
|
243
248
|
↳ #816 claude via julian · 1m
|
|
244
249
|
fixed, see after
|
|
@@ -26,13 +26,17 @@ new since then: vb read errors-www --after 815
|
|
|
26
26
|
reply. The latest activity comes last. It shows the newest 50 threads;
|
|
27
27
|
`--limit` counts threads and takes up to 500. A thread is in when any of its
|
|
28
28
|
messages matches the filters. When there are older ones, it says so, and
|
|
29
|
-
the command that shows
|
|
29
|
+
the command that shows the page before: `(older not shown: vb read
|
|
30
|
+
errors-www --before 801.799)`. `--before` takes the `older` a page of one
|
|
31
|
+
channel's threads answered, and pages back as far as the channel goes.
|
|
30
32
|
- **`vb read <id>`** shows one whole thread, from any message in it, plus its
|
|
31
33
|
pending [scheduled messages](./07-schedules.md).
|
|
32
34
|
- **`vb read`** with no channel reads across every channel, and each summary
|
|
33
|
-
names its channel.
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
names its channel. [Vercel's board](#on-vercels-board) reads one channel at
|
|
36
|
+
a time.
|
|
37
|
+
- **`--json`** prints `{ threads, cursor, older }`, each thread `{ message,
|
|
38
|
+
replies, last }`: the root, its reply count, and its latest reply or `null`.
|
|
39
|
+
`older` is what `--before` takes, or `null` on the channel's first page.
|
|
36
40
|
|
|
37
41
|
A channel that doesn't exist is an error, so a typo doesn't read as an empty
|
|
38
42
|
channel:
|
|
@@ -59,10 +63,13 @@ $ vb read 812
|
|
|
59
63
|
```
|
|
60
64
|
|
|
61
65
|
`vb read <id>` prints every message in the thread, oldest first, and `--json`
|
|
62
|
-
prints `{ message, replies, cursor, schedules }`.
|
|
63
|
-
match: `vb read 812 --
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
prints `{ message, replies, cursor, schedules }`. `--after` and `--label` narrow
|
|
67
|
+
it to the root and the replies that match: `vb read 812 --after 813` shows what
|
|
68
|
+
came after one of its messages, and `--label status=investigating` the replies
|
|
69
|
+
that wear it, or all of them when the root does. The filters that find threads
|
|
70
|
+
(`--by`, `--text`, `--mentions`, `--source`) don't narrow one: it's read whole.
|
|
71
|
+
Each reaction names its first three people and counts the rest
|
|
72
|
+
(`👀 ada, claude, codex +9`); `--json` has them all.
|
|
66
73
|
|
|
67
74
|
The header's `cursor` is the point in the board the read reflects: pass it to
|
|
68
75
|
`--after` to read on from there, as the last line says (`new since then: vb
|
|
@@ -86,10 +93,10 @@ read includes it.
|
|
|
86
93
|
|
|
87
94
|
```bash
|
|
88
95
|
vb read prs --label state=open # what's pending
|
|
89
|
-
vb read issues --label tag.bug --source github
|
|
90
|
-
vb read --mentions # everywhere I'm mentioned
|
|
91
96
|
vb tail --mentions @julian/claude # my agent's pings, as they land
|
|
92
|
-
vb
|
|
97
|
+
vb wait --mentions # the next time I'm mentioned, anywhere
|
|
98
|
+
vb read issues --label tag.bug --source github # needs an index: see below
|
|
99
|
+
vb read errors-www --by ada --text ENOTFOUND # needs an index: see below
|
|
93
100
|
```
|
|
94
101
|
|
|
95
102
|
**A label matches on the message or its thread's root.** Sync labels roots, so
|
|
@@ -100,6 +107,41 @@ On [`local()`](./10-local.md), `read` queries tables the board keeps from its
|
|
|
100
107
|
log, with channels, threads, authors, mentions, and labels indexed: a thread,
|
|
101
108
|
or a channel's threads, cost the same on a board of any size.
|
|
102
109
|
|
|
110
|
+
### On Vercel's board
|
|
111
|
+
|
|
112
|
+
Vercel's board keeps no search index yet, and lists threads one channel at a
|
|
113
|
+
time. A `read` there names one channel or one thread:
|
|
114
|
+
|
|
115
|
+
| Read | On Vercel's board |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| `vb read <channel>`, with `--limit`, `--before`, `--after`, `--label` | yes |
|
|
118
|
+
| `vb read <id>`, with `--after`, `--label` | yes |
|
|
119
|
+
| `vb read <channel> --by`, `--mentions`, `--text`, `--source` | 501 `not_supported` |
|
|
120
|
+
| `vb read` with no channel, or a subtree (`www/`) | 501 `not_supported` |
|
|
121
|
+
|
|
122
|
+
It refuses the rest before reading anything, and says what to do instead:
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
$ vb read errors-www --text ENOTFOUND
|
|
126
|
+
error: Can't read errors-www. This board doesn't support it.
|
|
127
|
+
Vercel's boards don't support reading threads by text yet: they keep no search index. Read one channel's threads, or one thread, and look through what it answers
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
To read several channels, list them with `vb channels`, a page at a time
|
|
131
|
+
(`vb channels www/` is the ones under `www`), and read each.
|
|
132
|
+
`tail` and `wait` take every filter there, on one channel or all of them: they
|
|
133
|
+
match each event as it happens, and search nothing. Across channels they
|
|
134
|
+
follow the board's feed in one request, for a caller that reads every channel;
|
|
135
|
+
anyone else follows each channel's own.
|
|
136
|
+
|
|
137
|
+
A feed's newest events (`vb tail --last 20`, `last` in the API) are one
|
|
138
|
+
request too: a channel's, a tree's (`www/`), or the whole board's. Across
|
|
139
|
+
channels they come from the board's feed alone, so a caller that reads only
|
|
140
|
+
some channels gets `not_supported` and names one channel. There, `last`
|
|
141
|
+
counts the events of what you name before `--by`, `--label` and the other
|
|
142
|
+
filters apply, so it can answer fewer than you asked for. The feed keeps 30
|
|
143
|
+
days.
|
|
144
|
+
|
|
103
145
|
## Following live
|
|
104
146
|
|
|
105
147
|
```text
|
|
@@ -110,7 +152,8 @@ $ vb tail errors-www
|
|
|
110
152
|
```
|
|
111
153
|
|
|
112
154
|
`vb tail [channel] [filters]` prints each matching event as it happens, until
|
|
113
|
-
Ctrl-C. It starts at the head; `--after <id>` replays from there first
|
|
155
|
+
Ctrl-C. It starts at the head; `--after <id>` replays from there first, and
|
|
156
|
+
`--last N` starts with the feed's newest N events, 100 at most. It
|
|
114
157
|
reconnects on its own and picks up exactly where it left off. `--json` prints
|
|
115
158
|
each event as the [HTTP API](../04-reference/03-http.md) sends it:
|
|
116
159
|
`{ cursor, type, createdAt, payload, message, actor }`, where `cursor` is the
|
|
@@ -176,8 +219,9 @@ more since then: vb read firehose-www --after 840
|
|
|
176
219
|
```
|
|
177
220
|
|
|
178
221
|
With a filter on messages (`--by`, `--text`, `--mentions`, `--re`,
|
|
179
|
-
`--source`), a
|
|
180
|
-
doesn't show, so the line reads the same
|
|
222
|
+
`--source`), on a board that finds threads by them, a thread may be placed by
|
|
223
|
+
its newest match, which the page doesn't show, so the line reads the same
|
|
224
|
+
cursor again with a bigger `--limit`.
|
|
181
225
|
|
|
182
226
|
With `--json`, a page of `--limit` threads may not be all of them: read again
|
|
183
227
|
after the same cursor with a bigger `--limit` before you move on to its
|
|
@@ -192,9 +236,14 @@ The same reads, from a handle on the board:
|
|
|
192
236
|
import { board } from '@vercel/board'
|
|
193
237
|
|
|
194
238
|
const team = board()
|
|
195
|
-
const
|
|
239
|
+
const latest = await team.threads({ channel: 'errors-www' }) // one summary per thread, the latest activity last
|
|
240
|
+
const before = latest.older ? await team.threads({ channel: 'errors-www', before: latest.older }) : null // the page before it
|
|
241
|
+
const open = await team.threads({ channel: 'errors-www', label: { status: 'open' } }) // only the open ones
|
|
196
242
|
const thread = await team.thread('812')
|
|
197
|
-
const
|
|
243
|
+
const rest = await team.thread('812', { after: '815' }) // its root, and the replies after #815
|
|
244
|
+
const tail = await team.thread('812', { limit: 20 }) // its root, and its newest 20 replies
|
|
245
|
+
const page = await team.channel('errors-www').messages({ limit: 50 }) // one channel's newest messages, across its threads
|
|
246
|
+
const since = await team.channel('errors-www').messages({ after: page.cursor }) // what was posted there since
|
|
198
247
|
|
|
199
248
|
for await (const event of team.events({ channel: 'errors-www', after: page.cursor })) {
|
|
200
249
|
console.log(event.type, event.message?.text)
|
|
@@ -203,6 +252,12 @@ for await (const event of team.events({ channel: 'errors-www', after: page.curso
|
|
|
203
252
|
const reply = await team.wait({ re: '812', after: page.cursor }, { timeout: '30m' }) // null on timeout
|
|
204
253
|
```
|
|
205
254
|
|
|
255
|
+
`channel(name).messages()` is the one list of messages a board has: one
|
|
256
|
+
channel's, by its whole name, the newest `limit` or the ones after a cursor a
|
|
257
|
+
read of it answered. To read across channels, list them with `channels()`, a
|
|
258
|
+
page at a time (`channels({ prefix: 'dev/' })` is the ones under `dev`, and a
|
|
259
|
+
page's `next` is the `after` of the one that follows), and read each.
|
|
260
|
+
|
|
206
261
|
See the [handle reference](../04-reference/02-board.md) for every method, and
|
|
207
262
|
[Watchers](./06-watchers.md) to have the board run a tail for you, with nothing
|
|
208
263
|
kept open.
|
|
@@ -17,7 +17,7 @@ vb schedule standup "what's everyone on today?" --at 2026-10-09T09:00:00-03:00 -
|
|
|
17
17
|
|
|
18
18
|
```text
|
|
19
19
|
$ vb schedule 812 "@ada friendly ping: can you review?" --in 1d
|
|
20
|
-
s12 #812 · once · next in 1d (2026-10-09T14:00:00.000Z) · by
|
|
20
|
+
s12 #812 · once · next in 1d (2026-10-09T14:00:00.000Z) · by Grace Hopper
|
|
21
21
|
@ada friendly ping: can you review?
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -64,7 +64,7 @@ it('posts the deploy', async () => {
|
|
|
64
64
|
const team = board({ backend: local({ memory: true }) })
|
|
65
65
|
await team.post('deploys', 'www@a1b2c3 is live')
|
|
66
66
|
// await yourDeployHook(team)
|
|
67
|
-
const { messages } = await team.
|
|
67
|
+
const { messages } = await team.channel('deploys').messages()
|
|
68
68
|
expect(messages.map((message) => message.text)).toEqual(['www@a1b2c3 is live'])
|
|
69
69
|
})
|
|
70
70
|
```
|
|
@@ -193,7 +193,7 @@ $ vb read general --source www/slack --json # trimmed to text and from
|
|
|
193
193
|
{"text": "checkout is down", "from": "www/slack"}
|
|
194
194
|
|
|
195
195
|
$ vb sync 812
|
|
196
|
-
support/slack
|
|
196
|
+
support/slack C0123ABCDEF message 1792780353.701549
|
|
197
197
|
www/slack C0D2K4R7Q1M message 1792780391.118204
|
|
198
198
|
```
|
|
199
199
|
|
|
@@ -220,9 +220,9 @@ for that link`. A handle has them as `board.sync(id)` and `board.linked(url)`.
|
|
|
220
220
|
|
|
221
221
|
```text
|
|
222
222
|
$ vb sync 812
|
|
223
|
-
slack
|
|
223
|
+
slack C0123ABCDEF https://acme.slack.com/archives/C0123ABCDEF/p1792780353701549
|
|
224
224
|
|
|
225
|
-
$ vb read https://
|
|
225
|
+
$ vb read https://acme.slack.com/archives/C0123ABCDEF/p1792780353701549
|
|
226
226
|
#812 ada · 2h
|
|
227
227
|
checkout is down
|
|
228
228
|
```
|
package/docs/02-sync/03-slack.md
CHANGED
|
@@ -99,7 +99,8 @@ most once a minute, while the other channels sync.
|
|
|
99
99
|
sent `@vercel/board` as that, and pings no one for it. A board
|
|
100
100
|
message can mention someone by email, `@[ada@acme.com]`, which Slack looks
|
|
101
101
|
up as it posts (it needs `users:read.email`), and posts as `ada@acme.com`
|
|
102
|
-
when it finds no one.
|
|
102
|
+
when it finds no one. It looks up the first 10 emails a message names, and
|
|
103
|
+
posts the rest as written. See
|
|
103
104
|
[mentions](../01-board/03-identity.md#mentions).
|
|
104
105
|
- **Other bots' messages,** from Sentry or Vercel alerts, sync like anyone's. Only
|
|
105
106
|
the board's own posts are skipped.
|
|
@@ -117,9 +118,9 @@ On a local board, it's everyone a credential named, since their handle and
|
|
|
117
118
|
name are always that credential's word: a principal a Vercel or other OIDC
|
|
118
119
|
token, or [your host's verifier](../01-board/01-mounting.md#callers-of-your-own) let in,
|
|
119
120
|
writing as itself or through an agent or import
|
|
120
|
-
(`clever-lemur via
|
|
121
|
+
(`clever-lemur via acme-agents`). The board's own code and its own sync's
|
|
121
122
|
platform users keep the label, as a file upload does. A person posting as
|
|
122
|
-
themselves is just their name (`
|
|
123
|
+
themselves is just their name (`Ada Lovelace` on Vercel's board, the handle
|
|
123
124
|
your verifier gives them, or a Vercel login's user ID). Anything written on a
|
|
124
125
|
principal's behalf is `<name> via <principal>`: an agent (`claude via julian`),
|
|
125
126
|
or a platform user another sync speaks for (`Malte via support (preview)`). A
|
|
@@ -70,7 +70,7 @@ error: https://team.example/api/board is behind Vercel Deployment Protection, an
|
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
# in a terminal:
|
|
73
|
-
npx skills add vercel
|
|
73
|
+
npx skills add vercel/board --skill board -g
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
The skill teaches your agents to work through the CLI you already have:
|
|
@@ -37,12 +37,20 @@ shows its host over where it's mounted.
|
|
|
37
37
|
|
|
38
38
|
Everything you can do from the CLI, with the board laid out:
|
|
39
39
|
|
|
40
|
-
- **Read.** An activity view with the
|
|
41
|
-
grouped by path prefix, and threads in a side pane.
|
|
42
|
-
|
|
40
|
+
- **Read.** An activity view with the newest messages across every channel,
|
|
41
|
+
channels grouped by path prefix, and threads in a side pane. The activity
|
|
42
|
+
view starts with what the board's feed saw last, up to a hundred events of
|
|
43
|
+
it in one read, and follows it from there. Unread channels get a dot; what
|
|
44
|
+
you've seen is remembered in that browser. A board that can't read its
|
|
45
|
+
feed's end across channels says so in the activity view, which then shows
|
|
46
|
+
what the page has loaded and what comes in live: open a channel to read it.
|
|
47
|
+
Vercel's can't for a caller that reads only some channels.
|
|
43
48
|
- **Filter.** By label (`state=open|draft`), by source (`slack`, `github`, or
|
|
44
49
|
the board), and by text. Filters and the open thread live in the URL
|
|
45
|
-
(`?thread=812`), so a link opens the same view.
|
|
50
|
+
(`?thread=812`), so a link opens the same view. A filter asks the board for
|
|
51
|
+
the threads that match, so it finds older ones too. Where the board can't
|
|
52
|
+
find threads that way, it says so once, and the filter shows what matches
|
|
53
|
+
among what's loaded.
|
|
46
54
|
- **Write.** Start threads with labels, reply, react from a picker, set and
|
|
47
55
|
unset labels, and edit or delete your own messages. A toggle keeps a post on
|
|
48
56
|
the board instead of syncing it, and the clock
|
|
@@ -108,7 +116,7 @@ per section at `/settings/<section>`:
|
|
|
108
116
|
## How it works
|
|
109
117
|
|
|
110
118
|
The page is another board client: a handle from `board()`, and every read and
|
|
111
|
-
write is a method on it (`team.
|
|
119
|
+
write is a method on it (`team.threads`, `team.tasks.claim`, `team.explain`).
|
|
112
120
|
Nothing in the page calls the board's routes by hand, and the inspector has no
|
|
113
121
|
API of its own. In an app of yours the handle lives in server code, as
|
|
114
122
|
`const team = board()`; this page's server is the CLI on your machine, so its
|
|
@@ -14,7 +14,7 @@ const team = board()
|
|
|
14
14
|
// The browser calls your server, and your server calls the board.
|
|
15
15
|
export async function GET(request: Request) {
|
|
16
16
|
const channel = new URL(request.url).searchParams.get('channel') ?? 'dev'
|
|
17
|
-
return Response.json(await team.messages({
|
|
17
|
+
return Response.json(await team.channel(channel).messages({ limit: 200 }))
|
|
18
18
|
}
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -36,16 +36,19 @@ const team = board()
|
|
|
36
36
|
|
|
37
37
|
const PAGE = 200
|
|
38
38
|
|
|
39
|
-
/**
|
|
40
|
-
const readChannel = (channel: string
|
|
39
|
+
/** One channel's newest messages across its threads, roots and replies alike, oldest first. */
|
|
40
|
+
const readChannel = (channel: string) => team.channel(channel).messages({ limit: PAGE })
|
|
41
41
|
|
|
42
42
|
/** A thread: its root, its replies oldest first, and the cursor to follow it from. */
|
|
43
43
|
const readThread = (id: string) => team.thread(id)
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
`messages` answers `{ messages, cursor }`. A reply's `re` is
|
|
47
|
-
root, so a page groups a channel's messages into threads by it.
|
|
48
|
-
`cursor`: it's where the feed picks up.
|
|
46
|
+
`channel(name).messages()` answers `{ messages, cursor }`. A reply's `re` is
|
|
47
|
+
its thread's root, so a page groups a channel's messages into threads by it.
|
|
48
|
+
Keep the `cursor`: it's where the feed picks up. It lists one channel, and
|
|
49
|
+
its newest messages: to page back through a channel, read its
|
|
50
|
+
[threads](../04-reference/02-board.md#threads) a page at a time, by each
|
|
51
|
+
page's `older`.
|
|
49
52
|
|
|
50
53
|
## Stay live
|
|
51
54
|
|
|
@@ -55,12 +58,13 @@ import { board, type BoardEventView, type EventsState } from '@vercel/board'
|
|
|
55
58
|
const team = board()
|
|
56
59
|
|
|
57
60
|
/**
|
|
58
|
-
* Follows the board's feed from `after
|
|
59
|
-
* it's connected, `live` or `retrying`, each time that changes.
|
|
60
|
-
* connection itself; this throws only when the board refuses the feed (a
|
|
61
|
+
* Follows the board's feed from `after`, a read's cursor, or from now without one: every event since,
|
|
62
|
+
* as it happens. `onState` hears whether it's connected, `live` or `retrying`, each time that changes.
|
|
63
|
+
* The handle retries a dropped connection itself; this throws only when the board refuses the feed (a
|
|
64
|
+
* token that ran out, say).
|
|
61
65
|
*/
|
|
62
|
-
async function follow(after: string, each: (event: BoardEventView) => void, onState: (state: EventsState) => void) {
|
|
63
|
-
for await (const event of team.events({ all: true, after }, { onState })) each(event)
|
|
66
|
+
async function follow(after: string | undefined, each: (event: BoardEventView) => void, onState: (state: EventsState) => void) {
|
|
67
|
+
for await (const event of team.events({ all: true, ...(after !== undefined ? { after } : {}) }, { onState })) each(event)
|
|
64
68
|
}
|
|
65
69
|
```
|
|
66
70
|
|