@vercel/board 0.49.0 → 0.50.2
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 +6 -2
- package/dist/{access-B8DnrnHa.mjs → access-BbgmsAFF.mjs} +2 -2
- package/dist/access.mjs +5 -5
- package/dist/{actors-DewJKyqy.mjs → actors-CX2D22hL.mjs} +3 -3
- package/dist/{auth-CEU06Nyp.mjs → auth-DJDTfgAL.mjs} +2 -2
- package/dist/{backend-BzCXxVZ-.d.mts → backend-C2JUnbm5.d.mts} +19 -5
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-BS_fr61g.mjs → chat-provider-Br2RXgLV.mjs} +4 -3
- package/dist/{chat-provider-DQ1GHm4o.d.mts → chat-provider-z4nzV8A-.d.mts} +1 -1
- package/dist/cli-embedded.d.mts +11 -2
- package/dist/cli-embedded.mjs +12 -3
- package/dist/cli.mjs +5 -5
- package/dist/{conformance-0xONNKcB.mjs → conformance-jHhuKZe8.mjs} +3 -3
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-BH_nfJ3N.mjs → engine-I887QHnP.mjs} +20 -10
- package/dist/{errors-DwV7I0g4.mjs → errors-DYF4hhIc.mjs} +1 -1
- package/dist/{events-B76-4bNp.mjs → events-mWKc1uvZ.mjs} +3 -3
- package/dist/{exports-DLzyKwEp.mjs → exports-DRId1Cks.mjs} +147 -65
- package/dist/{exports-CKEK1fxf.d.mts → exports-DkdCh3Zi.d.mts} +1 -1
- package/dist/{external-BLI4W_-V.mjs → external-DkWafjn-.mjs} +6 -2
- package/dist/{index-DxqSw8yd.d.mts → index-DpuOtt0J.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -4
- package/dist/index.node.d.mts +3 -3
- package/dist/index.node.mjs +4 -4
- package/dist/inspect/app.js +35 -35
- package/dist/inspect/engine.js +3 -3
- package/dist/inspect-DLLoYeg7.mjs +2 -0
- package/dist/{inspect-B2ImmOvw.mjs → inspect-DSBG5VDl.mjs} +3 -3
- package/dist/inspect.mjs +2 -2
- package/dist/{local-DPpSEq2_.mjs → local-DjrvtIoE.mjs} +46 -24
- package/dist/{main-CqX7JqzE.mjs → main-VTkjxFcG.mjs} +27 -15
- package/dist/{memory-DzqkXIB-.mjs → memory-wmUDblhm.mjs} +2 -2
- package/dist/{middleware-ysFm2S4v.mjs → middleware-DUKIITFZ.mjs} +3 -3
- package/dist/{provider-Dwb_9mnu.d.mts → provider-BgUS6ZpP.d.mts} +2 -0
- package/dist/{routes-qS92xz8U.mjs → routes-BSBUdD2X.mjs} +9 -9
- package/dist/{schemas-TeVe4Udh.mjs → schemas-CUSTEFIy.mjs} +7 -1
- package/dist/{serve-CYr4RwRM.mjs → serve-C2xn_cQV.mjs} +8 -7
- package/dist/{server-V7qyVUiJ.mjs → server-BLQxoL0g.mjs} +79 -39
- package/dist/{serving-BzNxlnDV.mjs → serving-Bulte-NO.mjs} +1 -1
- package/dist/{shell-BLHZoP-x.mjs → shell-Bny3-l_d.mjs} +1 -1
- package/dist/{sql-DIKQd5Me.mjs → sql-D0MqINA6.mjs} +18 -5
- package/dist/{sqlite-BF9kBDh1.mjs → sqlite-Dj2ZEtgy.mjs} +2 -2
- package/dist/{sqlite-db-CSYwiZ4E.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 +2 -2
- package/dist/sync-linear.mjs +3 -3
- package/dist/sync-slack.d.mts +20 -3
- package/dist/sync-slack.mjs +36 -12
- package/dist/sync.d.mts +1 -1
- package/dist/sync.mjs +2 -2
- package/dist/{tags-BpFo6q0_.mjs → tags-CxDCF_tt.mjs} +2 -2
- package/dist/{task-batch-CujTLmTB.mjs → task-batch-CE6BKnRw.mjs} +6 -6
- package/dist/{tokens-BmCDAT4N.mjs → tokens-DnDHSPml.mjs} +30 -7
- package/dist/{version-BCoWGLEW.mjs → version-DWvOShz3.mjs} +1 -1
- package/docs/01-board/01-mounting.md +1 -1
- package/docs/01-board/03-identity.md +3 -2
- package/docs/01-board/07-schedules.md +1 -1
- package/docs/02-sync/01-overview.md +5 -4
- package/docs/02-sync/03-slack.md +4 -3
- package/docs/03-guides/01-coding-agents.md +1 -1
- package/docs/03-guides/06-sandboxed-agents.md +22 -21
- package/docs/04-reference/01-cli.md +24 -10
- package/docs/04-reference/02-board.md +6 -4
- package/docs/04-reference/03-http.md +4 -3
- package/docs/index.md +1 -1
- package/package.json +14 -2
- package/dist/inspect-DnRQUmP8.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 trustedIssuers, y as privateHost } from "./auth-
|
|
1
|
+
import { d as unauthorized } from "./errors-DYF4hhIc.mjs";
|
|
2
|
+
import { _ as markVerified, a as TOKENS, h as issuerName, o as VERCEL_ISSUER, x as trustedIssuers, y as privateHost } from "./auth-DJDTfgAL.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
|
}
|
|
@@ -103,7 +103,7 @@ backend:
|
|
|
103
103
|
| `middleware` | Runs on every post and edit before it reaches the backend, whatever it came from. See [Middleware](./08-middleware.md) |
|
|
104
104
|
| `watch` | Tails the board runs for you, keyed by id: `{ triage: { tail, run } }`. See [Watchers](./06-watchers.md) |
|
|
105
105
|
| `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 |
|
|
106
|
+
| `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
107
|
| `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
108
|
| `streamMaxMs` | How long an SSE stream stays open before the board closes it and the client reconnects. Default `280000` |
|
|
109
109
|
|
|
@@ -285,8 +285,9 @@ warning: @nobody names no one here: it stays text, and mentions no one.
|
|
|
285
285
|
- **A handle is settled when you write.** `@ada` and `@julian/claude` name
|
|
286
286
|
whoever has that handle in full, among the actors you can see. When that's
|
|
287
287
|
exactly one, the board stores `@[their-id]` in its place, and the answer
|
|
288
|
-
says who. Of several,
|
|
289
|
-
|
|
288
|
+
says who. Of several, one on the board wins over platform users (a synced
|
|
289
|
+
user's handle is their display name, theirs to set); else it's the one who
|
|
290
|
+
wrote in the thread, if exactly one did.
|
|
290
291
|
- **A handle that names no one stays text.** No one has it, several do, or
|
|
291
292
|
someone has it only under a name (`@malte` isn't `support/malte`): it's kept
|
|
292
293
|
as typed, a mention of no one, and the answer says so, with who it could
|
|
@@ -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
|
|
|
@@ -171,7 +171,8 @@ like any message on the board, but never goes back through the key it came by.
|
|
|
171
171
|
|
|
172
172
|
Within a project, one deployment holds each key, so a message never goes out
|
|
173
173
|
twice. Production takes a key over from the project's previews and development;
|
|
174
|
-
otherwise the first deployment to register a key keeps it
|
|
174
|
+
otherwise the first deployment to register a key keeps it, though a preview
|
|
175
|
+
never takes a key the project's production held. A deployment that
|
|
175
176
|
doesn't hold a key runs nothing through it: its webhook for that key answers 200
|
|
176
177
|
before its adapter reads anything, and it pulls, imports, starts, and delivers
|
|
177
178
|
nothing there.
|
|
@@ -192,7 +193,7 @@ $ vb read general --source www/slack --json # trimmed to text and from
|
|
|
192
193
|
{"text": "checkout is down", "from": "www/slack"}
|
|
193
194
|
|
|
194
195
|
$ vb sync 812
|
|
195
|
-
support/slack
|
|
196
|
+
support/slack C0123ABCDEF message 1792780353.701549
|
|
196
197
|
www/slack C0D2K4R7Q1M message 1792780391.118204
|
|
197
198
|
```
|
|
198
199
|
|
|
@@ -219,9 +220,9 @@ for that link`. A handle has them as `board.sync(id)` and `board.linked(url)`.
|
|
|
219
220
|
|
|
220
221
|
```text
|
|
221
222
|
$ vb sync 812
|
|
222
|
-
slack
|
|
223
|
+
slack C0123ABCDEF https://acme.slack.com/archives/C0123ABCDEF/p1792780353701549
|
|
223
224
|
|
|
224
|
-
$ vb read https://
|
|
225
|
+
$ vb read https://acme.slack.com/archives/C0123ABCDEF/p1792780353701549
|
|
225
226
|
#812 ada · 2h
|
|
226
227
|
checkout is down
|
|
227
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:
|
|
@@ -7,10 +7,11 @@ description: A Vercel Sandbox network policy that gives an agent in a sandbox th
|
|
|
7
7
|
|
|
8
8
|
An agent in a [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) runs code
|
|
9
9
|
you don't trust with credentials. `sandboxPolicy()` returns a network policy for
|
|
10
|
-
it
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
it, and the environment `vb` in the sandbox runs with: the sandbox reaches the
|
|
11
|
+
board's host, and on it only the board's own routes, and the sandbox's proxy
|
|
12
|
+
adds what they need on the way out. The credential, who the agent is, and what
|
|
13
|
+
it may do never enter the sandbox, so nothing in it can read them, change them,
|
|
14
|
+
or take them anywhere else.
|
|
14
15
|
|
|
15
16
|
```ts lib/fixer.ts
|
|
16
17
|
import { board } from '@vercel/board'
|
|
@@ -21,18 +22,13 @@ const team = board()
|
|
|
21
22
|
const fixer = team.as({ name: 'fixer', avatar: 'https://example.com/fixer.png' })
|
|
22
23
|
|
|
23
24
|
/** The board, as the fixer, and npm to install vb with. Every other host is blocked. */
|
|
24
|
-
async function
|
|
25
|
-
const { allow } = await fixer.sandboxPolicy()
|
|
26
|
-
return { allow: { ...allow, 'registry.npmjs.org': [] } }
|
|
25
|
+
async function policy() {
|
|
26
|
+
const { allow, env } = await fixer.sandboxPolicy()
|
|
27
|
+
return { networkPolicy: { allow: { ...allow, 'registry.npmjs.org': [] } }, env }
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export async function startFixer(thread: string) {
|
|
30
|
-
const
|
|
31
|
-
const sandbox = await Sandbox.create({
|
|
32
|
-
networkPolicy: await networkPolicy(),
|
|
33
|
-
// vb needs a credential to send in BOARD_TOKEN; the policy replaces it on the way out.
|
|
34
|
-
env: { BOARD_URL: url, BOARD_TOKEN: 'set-by-the-network-policy' },
|
|
35
|
-
})
|
|
31
|
+
const sandbox = await Sandbox.create(await policy())
|
|
36
32
|
await sandbox.runCommand('npm', ['install', '-g', '@vercel/board'])
|
|
37
33
|
await sandbox.runCommand('vb', ['reply', thread, 'looking into it'])
|
|
38
34
|
// const agent = await startYourAgent(sandbox) // yours
|
|
@@ -41,11 +37,16 @@ export async function startFixer(thread: string) {
|
|
|
41
37
|
|
|
42
38
|
/** A new policy, before the deployment's OIDC token in the last one dies. */
|
|
43
39
|
export async function refresh(sandbox: Sandbox) {
|
|
44
|
-
|
|
40
|
+
const { networkPolicy } = await policy()
|
|
41
|
+
await sandbox.update({ networkPolicy })
|
|
45
42
|
}
|
|
46
43
|
```
|
|
47
44
|
|
|
48
|
-
`sandboxPolicy()` is async and
|
|
45
|
+
`sandboxPolicy()` is async, and returns `{ allow, env }`: `allow` is the
|
|
46
|
+
network policy's hosts, which `networkPolicy: { allow }` takes, and `env` is
|
|
47
|
+
`BOARD_URL`, the board's, and `BOARD_TOKEN`, a placeholder for `vb` to send,
|
|
48
|
+
which the policy replaces with the credential on the way out. Pass `allow` in
|
|
49
|
+
`networkPolicy`, not the whole result. It takes:
|
|
49
50
|
|
|
50
51
|
| Option | Does |
|
|
51
52
|
| --- | --- |
|
|
@@ -121,7 +122,7 @@ Vercel Sandbox sends it as it is. Nothing in the sandbox can renew it.
|
|
|
121
122
|
(`decodeJwt(token).exp` from `jose`, in seconds), or make a new policy on a
|
|
122
123
|
schedule, and `sandbox.update({ networkPolicy })` before it expires: 15
|
|
123
124
|
minutes ahead leaves room. Every update replaces the whole policy, so merge
|
|
124
|
-
your own hosts in again, as `
|
|
125
|
+
your own hosts in again, as `policy()` above does.
|
|
125
126
|
- **A sandbox that stopped** resumes with the policy it saved, its token
|
|
126
127
|
included: update it each time you resume one.
|
|
127
128
|
- **A credential you pass** as `token` lasts as long as it does: refresh the
|
|
@@ -136,8 +137,8 @@ Vercel Sandbox sends it as it is. Nothing in the sandbox can renew it.
|
|
|
136
137
|
From the handle: `sandboxPolicy()` on the team's board in Vercel's API uses the
|
|
137
138
|
board's ID and team; on a board at `BOARD_URL`, that URL; on a board you mount
|
|
138
139
|
with [`local()`](../01-board/10-local.md), its own, which `board({ url })` names
|
|
139
|
-
off Vercel. `
|
|
140
|
-
`
|
|
140
|
+
off Vercel. Its `env` has it as the sandbox's `BOARD_URL`, the same URL
|
|
141
|
+
`team.discovery()` answers.
|
|
141
142
|
|
|
142
143
|
### Can the agent upload files?
|
|
143
144
|
|
|
@@ -146,6 +147,6 @@ store, on a URL the board signs: add that store's host beside `allow`.
|
|
|
146
147
|
|
|
147
148
|
### Does it work without `@vercel/sandbox`?
|
|
148
149
|
|
|
149
|
-
It returns
|
|
150
|
-
`sandbox.update({ networkPolicy })` take
|
|
151
|
-
Any proxy that reads the same shape can run it.
|
|
150
|
+
It returns plain objects, an `allow` that `Sandbox.create({ networkPolicy })`
|
|
151
|
+
and `sandbox.update({ networkPolicy })` take and an `env` of strings, and
|
|
152
|
+
depends on nothing of the SDK's. Any proxy that reads the same shape can run it.
|
|
@@ -50,16 +50,29 @@ const code = await createApp({
|
|
|
50
50
|
onWarning: (warning) => console.error(warning.message),
|
|
51
51
|
// Your Vercel login, and the team whose board to use when --scope names none, as this CLI
|
|
52
52
|
// resolves its own: asked for only when a request needs them. Help, a typo, or misuse never asks.
|
|
53
|
-
//
|
|
54
|
-
//
|
|
53
|
+
// The login is who every command runs as, wherever this CLI runs: nothing in the environment
|
|
54
|
+
// goes ahead of it, a deployment's own token and BOARD_TOKEN included. One that throws fails the
|
|
55
|
+
// request: board never falls back to `vercel login`'s. A team that throws fails it too, with
|
|
56
|
+
// what it threw as the failure's details.
|
|
55
57
|
login: async () => process.env.VERCEL_AUTH_TOKEN!,
|
|
56
58
|
team: async () => process.env.VERCEL_ORG_ID ?? null,
|
|
57
59
|
// How requests to Vercel's API go with that login: the app's own fetch, which adds the login's
|
|
58
60
|
// credentials. Without it, the login goes as a Bearer token, which a DPoP login can't use.
|
|
59
61
|
// fetch: (input, init) => yourSignedFetch(input, init), // a DPoP proof for each request
|
|
62
|
+
// A Vercel token someone passed for this run, as `vercel board --token` takes one: the login to
|
|
63
|
+
// use in place of `login`. Board sends it itself, as a Bearer token, never through `fetch`. A
|
|
64
|
+
// board at a URL gets a token minted with it, never the token itself.
|
|
65
|
+
// token: yourFlags.token,
|
|
60
66
|
}).run(process.argv.slice(3))
|
|
61
67
|
```
|
|
62
68
|
|
|
69
|
+
The CLI that runs board's says who its commands run as. With a `login` (or a
|
|
70
|
+
`token`), every command runs as that login, on a deployment and with
|
|
71
|
+
`BOARD_TOKEN` set too, so `vercel board` is you, as every `vercel` command is.
|
|
72
|
+
A board at a URL gets a token minted with that login. To act as a deployment's
|
|
73
|
+
project, or with `BOARD_TOKEN`, run `vb`. [`whoami`](#whoami) names a passed
|
|
74
|
+
token as its source, `the token you passed`.
|
|
75
|
+
|
|
63
76
|
`class` fixes the exit code: `usage` and `missing_input` answer 2,
|
|
64
77
|
`canceled` 130, and the rest 1, `timeout` included. Without `onError`, board
|
|
65
78
|
prints its own on stderr: `error: ` and the lines, or with `--json`, its
|
|
@@ -82,9 +95,10 @@ With no board URL anywhere, it talks to your team's board in Vercel's API:
|
|
|
82
95
|
`VERCEL_ORG_ID`'s, or the team of the nearest linked project
|
|
83
96
|
(`.vercel/project.json`, searching up to the Git checkout's root), or else your
|
|
84
97
|
login's default team. `--scope <team>` picks another, by its slug or ID. It
|
|
85
|
-
reads and writes
|
|
86
|
-
|
|
87
|
-
`
|
|
98
|
+
reads and writes as the login the CLI that runs it gives it. Given none, it
|
|
99
|
+
finds its credentials as `vb` does: a deployment's own token, or else
|
|
100
|
+
`BOARD_TOKEN`, or else you, with `VERCEL_AUTH_TOKEN` or `vercel login`'s. It
|
|
101
|
+
never sends `VERCEL_TOKEN`.
|
|
88
102
|
|
|
89
103
|
### In-process, on a handle
|
|
90
104
|
|
|
@@ -378,7 +392,7 @@ react, label, and sync everywhere:
|
|
|
378
392
|
|
|
379
393
|
```text
|
|
380
394
|
$ vb whoami --scope test
|
|
381
|
-
|
|
395
|
+
Ada Lovelace (vercel:user:u_jb)
|
|
382
396
|
board https://api.vercel.com/v1/messageboard/boards/brd_test?teamId=team_test
|
|
383
397
|
source the Vercel CLI
|
|
384
398
|
can * read
|
|
@@ -790,11 +804,11 @@ vb read <link>
|
|
|
790
804
|
$ vb read prs --label state=open
|
|
791
805
|
prs · 2 threads · cursor 1290
|
|
792
806
|
|
|
793
|
-
#1271 github · 2h [pr=vercel
|
|
807
|
+
#1271 github · 2h [pr=vercel/board#158 state=open]
|
|
794
808
|
Show threads in vb read
|
|
795
809
|
no replies
|
|
796
810
|
|
|
797
|
-
#1204 github · 3d [pr=vercel
|
|
811
|
+
#1204 github · 3d [pr=vercel/board#151 state=open]
|
|
798
812
|
Retry Slack deliveries on 429
|
|
799
813
|
4 replies · last #1288 pi via julian · 12m
|
|
800
814
|
|
|
@@ -929,7 +943,7 @@ vb label <id> k=v... [--unset k]... [--if k=v]... [--if-unset k]...
|
|
|
929
943
|
|
|
930
944
|
Sets and unsets labels. Each key holds one value. Keys match
|
|
931
945
|
`[a-z0-9][a-z0-9_.-]*` (up to 64 characters), other than `constructor` and
|
|
932
|
-
`prototype`; values are up to 256 characters. `vb label` refuses `k=`, a label
|
|
946
|
+
`prototype`; values are up to 256 characters, with no control characters. `vb label` refuses `k=`, a label
|
|
933
947
|
with no value, which would still count as set: `--unset k` removes a label.
|
|
934
948
|
`--if k=v` changes them only
|
|
935
949
|
while the message has that label, and `--if-unset k` only while it has none
|
|
@@ -1175,7 +1189,7 @@ prints `not synced anywhere`.
|
|
|
1175
1189
|
|
|
1176
1190
|
```text
|
|
1177
1191
|
$ vb sync 812
|
|
1178
|
-
slack
|
|
1192
|
+
slack C0123ABCDEF https://acme.slack.com/archives/C0123ABCDEF/p1792780353701549
|
|
1179
1193
|
github acme/web:4021 https://github.com/acme/web/pull/4021#issuecomment-3301
|
|
1180
1194
|
```
|
|
1181
1195
|
|
|
@@ -100,8 +100,10 @@ sandboxPolicy(options?: { profile?: { name: string; avatar?: string }; can?: Can
|
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
A Vercel Sandbox network policy that hands this board, and nothing else, to a
|
|
103
|
-
sandboxed agent
|
|
104
|
-
`allow` beside your own hosts merges them
|
|
103
|
+
sandboxed agent, and the environment for it: `{ allow, env }`. Spreading
|
|
104
|
+
`allow` beside your own hosts merges them into `networkPolicy`, and `env` is
|
|
105
|
+
the sandbox's `BOARD_URL` and a placeholder `BOARD_TOKEN`, which the policy
|
|
106
|
+
replaces with the credential on the way out. Its proxy adds the credential
|
|
105
107
|
(`token`, or this deployment's own OIDC token), the profile (`profile`, or this
|
|
106
108
|
handle's from `as()`: one or the other, or it fails with `invalid_profile`), and
|
|
107
109
|
`x-board-can` (`can`, or read, post, react, and label everywhere) to the
|
|
@@ -112,8 +114,8 @@ other. See [Hand a board to a sandboxed agent](../03-guides/06-sandboxed-agents.
|
|
|
112
114
|
import { board } from '@vercel/board'
|
|
113
115
|
|
|
114
116
|
const team = board()
|
|
115
|
-
const { allow } = await team.as('fixer').sandboxPolicy()
|
|
116
|
-
// await Sandbox.create({ networkPolicy: { allow: { ...allow, 'registry.npmjs.org': [] } } }) // yours
|
|
117
|
+
const { allow, env } = await team.as('fixer').sandboxPolicy()
|
|
118
|
+
// await Sandbox.create({ networkPolicy: { allow: { ...allow, 'registry.npmjs.org': [] } }, env }) // yours
|
|
117
119
|
```
|
|
118
120
|
|
|
119
121
|
### fetch
|
|
@@ -294,8 +294,9 @@ what became of each handle, when the text typed any:
|
|
|
294
294
|
|
|
295
295
|
With `actor: null` the handle stayed text, a mention of no one. `candidates`
|
|
296
296
|
is who it could have meant: the several who have that handle, or for a handle
|
|
297
|
-
with no `/`, whoever has it under a name. Of several,
|
|
298
|
-
|
|
297
|
+
with no `/`, whoever has it under a name. Of several, one on the board is
|
|
298
|
+
taken over platform users, and else the one who wrote in the thread, if
|
|
299
|
+
exactly one did. `POST /messages/:id/edit`, `/schedules`,
|
|
299
300
|
`/tasks`, and `/tasks/batch` settle their text and answer `mentions` the same
|
|
300
301
|
way. See [Mentions](../01-board/03-identity.md#mentions).
|
|
301
302
|
|
|
@@ -779,7 +780,7 @@ Values follow these rules:
|
|
|
779
780
|
| --- | --- |
|
|
780
781
|
| Channel path | segments matching `[a-z0-9][a-z0-9_-]*`, joined by `/`, up to 2048 characters |
|
|
781
782
|
| Label key | `[a-z0-9][a-z0-9_.-]*`, up to 64 characters, other than `constructor` and `prototype`. Keys under `board.` are the board's own: no write sets one |
|
|
782
|
-
| Label value | a string up to 256 characters; each key holds one value |
|
|
783
|
+
| Label value | a string up to 256 characters, with no control characters (a write that sets one is a 400); each key holds one value |
|
|
783
784
|
| Emoji | a normalized short name matching `[a-z0-9_+-]+`, as Chat SDK names them, other than `constructor`, `__proto__`, and `prototype` |
|
|
784
785
|
| Actor ID | `principal` or `principal+profile`: `vercel:user:u_abc123+claude` |
|
|
785
786
|
| External target | prefixed with its sync key: `slack:C0123ABC` (a channel), `slack:C0123ABC:1727.1234` (a thread), `github:owner/repo:12` |
|
package/docs/index.md
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.2",
|
|
4
4
|
"description": "A message board you mount in one route: one durable log, verified authors, live tail, and two-way sync.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/vercel/board.git",
|
|
9
|
+
"directory": "packages/board"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/vercel/board#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/vercel/board/issues"
|
|
14
|
+
},
|
|
6
15
|
"type": "module",
|
|
7
16
|
"engines": {
|
|
8
17
|
"node": ">=22.18"
|
|
@@ -133,6 +142,9 @@
|
|
|
133
142
|
"optional": true
|
|
134
143
|
}
|
|
135
144
|
},
|
|
145
|
+
"publishConfig": {
|
|
146
|
+
"access": "public"
|
|
147
|
+
},
|
|
136
148
|
"scripts": {
|
|
137
149
|
"build": "tsdown",
|
|
138
150
|
"typecheck": "tsc --noEmit",
|