@vercel/board 0.53.0 → 0.54.1
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 +4 -3
- package/dist/{access-Pcar1gwx.mjs → access-HzqFpgL_.mjs} +1 -1
- package/dist/access.d.mts +3 -3
- package/dist/access.mjs +5 -5
- package/dist/{actors-XKUrjOfO.mjs → actors-D-u6bitG.mjs} +2 -2
- package/dist/{auth-C2CxMl2p.mjs → auth-D9ycDQK0.mjs} +34 -12
- package/dist/{auth-BoYunD5t.d.mts → auth-ULldUvir.d.mts} +8 -2
- package/dist/{backend-DJobr4nr.d.mts → backend-BHN6GTjB.d.mts} +8 -7
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-BSHlV2lw.d.mts → chat-provider-F7UqWVZK.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 +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/{client-oYThy3CR.d.mts → client-CFHunEFn.d.mts} +8 -2
- package/dist/{commands-B_gbi2sU.mjs → commands-D8HctFGJ.mjs} +15 -10
- package/dist/{commands-B6pgzwTI.d.mts → commands-DLPIX7Jw.d.mts} +3 -1
- package/dist/{conformance-Cz1Elmgj.mjs → conformance-BNiLcKra.mjs} +34 -4
- package/dist/conformance.d.mts +3 -4
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-506f7GEM.mjs → engine-C8wCzkw-.mjs} +2 -2
- package/dist/{routes-GF5ukHYX.mjs → errors-DDfXnZ2b.mjs} +875 -4
- package/dist/{exports-CF_nUsT5.d.mts → exports-BBmjHyCB.d.mts} +4 -4
- package/dist/{exports-CBukc8T3.mjs → exports-D6Q99t_O.mjs} +144 -88
- package/dist/{index-CM2u0wGd.d.mts → index-Ce3SDZ3Y.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 +88 -88
- package/dist/inspect/engine.js +3 -3
- package/dist/{inspect-PQsEgXRQ.mjs → inspect-Cb1Sj8QV.mjs} +2 -2
- package/dist/inspect-DeY883DA.mjs +2 -0
- package/dist/inspect.d.mts +1 -1
- package/dist/inspect.mjs +1 -1
- package/dist/{local-CwcmqEoa.mjs → local-BtzF9fRs.mjs} +10 -10
- package/dist/{main-gNAS2WbP.mjs → main-Dicvkp6D.mjs} +360 -100
- package/dist/{middleware-DXiwepsR.mjs → middleware-BY4qqIh3.mjs} +1 -1
- package/dist/{provider-WjdBsRLR.d.mts → provider-DgGp4Zej.d.mts} +2 -2
- package/dist/{routes-BpvyXQwv.d.mts → routes-DNmQSOvQ.d.mts} +16 -1
- package/dist/{serve-Ci5KT11x.mjs → serve-BMOtQEiQ.mjs} +6 -6
- package/dist/{server-XsbC50nY.mjs → server--J1DfQjI.mjs} +68 -11
- package/dist/{serving-C6Ao7i-7.mjs → serving-C1mhZQqH.mjs} +1 -1
- package/dist/{shell-BiCBL1w_.mjs → shell-DsDyOFd1.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 +3 -3
- package/dist/sync.d.mts +2 -2
- package/dist/{task-batch-nqYGszDJ.mjs → task-batch-BviIruES.mjs} +4 -5
- package/dist/{tokens-tulRtEWx.mjs → tokens-B3gXkQCs.mjs} +2 -2
- package/dist/{version-CBjh_ogp.mjs → version-1isUFDyU.mjs} +1 -1
- package/docs/01-board/01-mounting.md +8 -6
- package/docs/01-board/03-identity.md +1 -1
- package/docs/01-board/05-reading.md +34 -7
- package/docs/01-board/09-access.md +11 -2
- package/docs/01-board/11-tasks.md +5 -3
- package/docs/01-quickstart.md +19 -5
- package/docs/03-guides/03-ci.md +71 -43
- package/docs/03-guides/04-triage.md +4 -4
- package/docs/04-reference/01-cli.md +30 -22
- package/docs/04-reference/02-board.md +8 -4
- package/docs/04-reference/03-http.md +14 -5
- package/docs/04-reference/05-conformance.md +1 -1
- package/docs/index.md +7 -5
- package/package.json +2 -2
- package/dist/errors-Cv0TGBt5.mjs +0 -857
- package/dist/inspect-SEaGzhvh.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as NewLabels, m as MESSAGE_TEXT_MAX } from "./schemas-CUSTEFIy.mjs";
|
|
2
|
-
import { t as HttpError } from "./errors-
|
|
2
|
+
import { t as HttpError } from "./errors-DDfXnZ2b.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/client/ids.ts
|
|
5
5
|
const hex = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BoardClient } from "./client-
|
|
1
|
+
import { Jn as ExternalEvent, Rt as SourceJoin, Vn as Actor, Vt as SourceRead, Xn as ExternalLink, Yn as ExternalFile, Zn as Link, qn as ExternalAuthor, u as BoardEventView, ut as MessageView } from "./routes-DNmQSOvQ.mjs";
|
|
2
|
+
import { t as BoardClient } from "./client-CFHunEFn.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/contract/bots.d.ts
|
|
5
5
|
/**
|
|
@@ -935,6 +935,12 @@ declare const ChannelsQuery: z.ZodObject<{
|
|
|
935
935
|
after: z.ZodOptional<z.ZodString>;
|
|
936
936
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
937
937
|
}, z.core.$strict>;
|
|
938
|
+
/** How many actors one read of them by ID names at most. */
|
|
939
|
+
declare const ACTORS_BY_ID_MAX = 100;
|
|
940
|
+
/** The board's actors, or with `id`, only the ones it names: someone it doesn't have is left out. */
|
|
941
|
+
declare const ActorsQuery: z.ZodObject<{
|
|
942
|
+
id: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>, z.ZodArray<z.ZodString>>>;
|
|
943
|
+
}, z.core.$strict>;
|
|
938
944
|
/**
|
|
939
945
|
* A thread read in part: the root, and of its replies the ones after one of its messages (`after`), `limit` of
|
|
940
946
|
* them. With `after` they're the first after it, to read on from; without, the newest.
|
|
@@ -1867,6 +1873,7 @@ type SyncFindInput = z.input<typeof SyncFindQuery>;
|
|
|
1867
1873
|
type ChannelMessagesQueryInput = z.input<typeof ChannelMessagesQuery>;
|
|
1868
1874
|
type ThreadQueryInput = z.input<typeof ThreadQuery>;
|
|
1869
1875
|
type ChannelsQueryInput = z.input<typeof ChannelsQuery>;
|
|
1876
|
+
type ActorsQueryInput = z.input<typeof ActorsQuery>;
|
|
1870
1877
|
type ThreadsQueryInput = z.input<typeof ThreadsQuery>;
|
|
1871
1878
|
type EventsQueryInput = z.input<typeof EventsQuery>;
|
|
1872
1879
|
type PostInput = z.input<typeof PostBody>;
|
|
@@ -2288,6 +2295,11 @@ type ThreadsPage = {
|
|
|
2288
2295
|
* threads backward sends it on every read without `after`; one from before it leaves it out.
|
|
2289
2296
|
*/
|
|
2290
2297
|
older?: string | null;
|
|
2298
|
+
/**
|
|
2299
|
+
* Set by a board that keeps no search index (Vercel's) on a read by `mentions` or `text`: how many threads of the
|
|
2300
|
+
* channel's page it looked through, matching each one's first and newest message. Its `older` pages back the same way.
|
|
2301
|
+
*/
|
|
2302
|
+
scanned?: number;
|
|
2291
2303
|
};
|
|
2292
2304
|
/** Tasks, oldest first, each as its thread's summary: `message.task` is the task. `cursor` reads the next page, as `after`. */
|
|
2293
2305
|
type TasksPage = {
|
|
@@ -2389,6 +2401,9 @@ declare const routes: {
|
|
|
2389
2401
|
readonly actors: {
|
|
2390
2402
|
readonly method: 'GET';
|
|
2391
2403
|
readonly path: '/actors';
|
|
2404
|
+
readonly query: z.ZodObject<{
|
|
2405
|
+
id: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>, z.ZodArray<z.ZodString>>>;
|
|
2406
|
+
}, z.core.$strict>;
|
|
2392
2407
|
};
|
|
2393
2408
|
/** One channel's messages across its threads: the newest, or those after one of its cursors. */
|
|
2394
2409
|
readonly channelMessages: {
|
|
@@ -3462,4 +3477,4 @@ declare const routes: {
|
|
|
3462
3477
|
};
|
|
3463
3478
|
type RouteName = keyof typeof routes;
|
|
3464
3479
|
//#endregion
|
|
3465
|
-
export {
|
|
3480
|
+
export { InboxNextQuery as $, SyncThreadView as $t, CreateTasksInput as A, GrantChangeRefusal as An, ScheduleInput as At, Explanation as B, union as Bn, SourceMessage as Bt, ClaimTaskBody as C, Access as Cn, ReleaseTaskBody as Ct, CreateTaskBody as D, FULL_ACCESS as Dn, RouteName as Dt, CreateGrantsBody as E, ChannelPattern as En, RevokeGrantBody as Et, EditBody as F, Permission as Fn, SchemaBody as Ft, GrantCan as G, CAN_MAX as Gn, SyncCopiesView as Gt, FiltersInput as H, ExternalCopy as Hn, SourceReadQuery as Ht, EventsPage as I, WrittenCan as In, SchemaInput as It, GrantWriteOptions as J, ExternalEvent as Jn, SyncFindView as Jt, GrantInput as K, Labels as Kn, SyncFindInput as Kt, EventsQuery as L, checkGrantChange as Ln, SchemaView as Lt, DeleteBody as M, InvalidCan as Mn, SchedulesQuery as Mt, Discovery as N, Level as Nn, SchedulesQueryInput as Nt, CreateTaskInput as O, Grant as On, ScheduleBody as Ot, EVENTS_LAST_MAX as P, PERMISSIONS as Pn, SchedulesQueryOutput as Pt, InboxItem as Q, SyncReceiptInput as Qt, EventsQueryInput as R, compileAccess as Rn, SourceJoin as Rt, ClaimReadyTaskInput as S, routes as Sn, RegistrationView as St, CreateChannelBody as T, Can as Tn, ResolvedSyncTarget as Tt, GRANT_BATCH_MAX as U, Attachment as Un, SyncBody as Ut, FailTaskBody as V, Actor as Vn, SourceRead as Vt, GrantBody as W, Author as Wn, SyncCopiesQuery as Wt, InboxAckBody as X, ExternalLink as Xn, SyncImportInput as Xt, INBOX_EVENT_ID_MAX as Y, ExternalFile as Yn, SyncImportBody as Yt, InboxEntry as Z, Link as Zn, SyncReceiptBody as Zt, ChannelView as _, TypingResult as _n, REGISTERED_WATCHERS_MAX as _t, ActorsQueryInput as a, TaskView as an, LinkView as at, ChannelsQueryInput as b, UploadStartBody as bn, RegisterBody as bt, BlockTaskBody as c, TasksQueryInput as cn, MatchesQuery as ct, CHANNELS_LIMIT_DEFAULT as d, ThreadSummaryView as dn, MessagesPage as dt, SyncedView as en, InboxPushBody as et, CHANNELS_LIMIT_MAX as f, ThreadView as fn, ParsedFilters as ft, ChannelMessagesQueryInput as g, TypingBody as gn, PrincipalView as gt, ChannelMessagesQuery as h, ThreadsQueryInput as hn, PrincipalInput as ht, ActorsQuery as i, TaskNeedsBody as in, LabelBody as it, CreatedTasksQuery as j, GrantShape as jn, ScheduleView as jt, CreateTasksBody as k, GrantChange as kn, ScheduleBodyOutput as kt, BlockView as l, ThreadQuery as ln, Me as lt, CancelTaskBody as m, ThreadsQuery as mn, PostInput as mt, AckBody as n, THREADS_LIMIT_MAX as nn, LABEL_CONDITIONS_MAX as nt, ApiError as o, TasksPage as on, LinkedQuery as ot, CanAt as p, ThreadsPage as pn, PostBody as pt, GrantView as q, ExternalAuthor as qn, SyncFindQuery as qt, ActorView as r, TaskClaim as rn, LEASE_DEFAULT_S as rt, AssignTaskBody as s, TasksQuery as sn, MatchView as st, ACTORS_BY_ID_MAX as t, THREADS_LIMIT_DEFAULT as tn, InboxQuery as tt, BoardEventView as u, ThreadQueryInput as un, MessageView as ut, ChannelsPage as v, UpdateGrantBody as vn, ReactBody as vt, CompleteTaskBody as w, AccessSummary as wn, RenewTaskBody as wt, ClaimReadyTaskBody as x, UploadTicket as xn, RegisterInput as xt, ChannelsQuery as y, UpdateGrantInput as yn, Ref as yt, ExplainQuery as z, parseCan as zn, SourceJoinBody as zt };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as BoardError, p as createBoardClient, t as HttpError } from "./errors-
|
|
2
|
-
import { i as hostCheckedBy } from "./exports-
|
|
3
|
-
import { i as LOGINS, r as LOGIN } from "./auth-
|
|
4
|
-
import { h as localTokenFile, t as board } from "./server
|
|
5
|
-
import { t as oidcTokens } from "./tokens-
|
|
6
|
-
import { t as local } from "./local-
|
|
1
|
+
import { f as BoardError, p as createBoardClient, t as HttpError } from "./errors-DDfXnZ2b.mjs";
|
|
2
|
+
import { i as hostCheckedBy } from "./exports-D6Q99t_O.mjs";
|
|
3
|
+
import { i as LOGINS, r as LOGIN } from "./auth-D9ycDQK0.mjs";
|
|
4
|
+
import { h as localTokenFile, t as board } from "./server--J1DfQjI.mjs";
|
|
5
|
+
import { t as oidcTokens } from "./tokens-B3gXkQCs.mjs";
|
|
6
|
+
import { t as local } from "./local-BtzF9fRs.mjs";
|
|
7
7
|
import { mkdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
8
8
|
import { userInfo } from "node:os";
|
|
9
9
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { n as formatProfileHeader } from "./profile-header-O8wC8yk8.mjs";
|
|
2
2
|
import "./schemas-CUSTEFIy.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { d as tailWatchers, f as deployedOnVercel, l as PROTOCOL_ROUTES, r as createBoard, s as createVercel, u as withoutToken } from "./exports-CBukc8T3.mjs";
|
|
3
|
+
import { f as BoardError, ht as routes, p as createBoardClient, t as HttpError } from "./errors-DDfXnZ2b.mjs";
|
|
4
|
+
import { g as keyId, p as DERIVED_ID } from "./middleware-BY4qqIh3.mjs";
|
|
5
|
+
import { l as METHODS, o as compileWatcher } from "./task-batch-BviIruES.mjs";
|
|
6
|
+
import { c as createVercel, d as withoutToken, f as tailWatchers, p as deployedOnVercel, r as createBoard, u as PROTOCOL_ROUTES } from "./exports-D6Q99t_O.mjs";
|
|
8
7
|
import { execFile } from "node:child_process";
|
|
9
8
|
import { createHash } from "node:crypto";
|
|
10
9
|
import { mkdir, readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -83,6 +82,7 @@ function localToken(url) {
|
|
|
83
82
|
return null;
|
|
84
83
|
}
|
|
85
84
|
}
|
|
85
|
+
/** When `token` expires, in milliseconds: its `exp`, or five minutes from now for one that says none. */
|
|
86
86
|
const expiry = (token) => {
|
|
87
87
|
try {
|
|
88
88
|
const { exp } = decodeJwt(token);
|
|
@@ -280,6 +280,9 @@ async function tokenFromVercelCli(project) {
|
|
|
280
280
|
throw new BoardError("not_logged_in", "You're not logged in to Vercel.", 0, { hint: "Run vercel login." });
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
+
/** Whether this is a GitHub Actions job that may ask GitHub for an OIDC token (`permissions: id-token: write`). */
|
|
284
|
+
const inGithubActions = () => !!process.env.ACTIONS_ID_TOKEN_REQUEST_URL && !!process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
|
|
285
|
+
/** The job's GitHub Actions OIDC token, made out to `audience`. */
|
|
283
286
|
async function githubActionsToken(audience) {
|
|
284
287
|
const url = new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);
|
|
285
288
|
url.searchParams.set("audience", audience);
|
|
@@ -356,7 +359,7 @@ function connect(url, options = {}) {
|
|
|
356
359
|
};
|
|
357
360
|
}
|
|
358
361
|
const discovered = await discover();
|
|
359
|
-
if (
|
|
362
|
+
if (inGithubActions()) {
|
|
360
363
|
const token = await githubActionsToken(url);
|
|
361
364
|
source = "GitHub Actions OIDC";
|
|
362
365
|
return {
|
|
@@ -963,12 +966,45 @@ function http(url, options = {}) {
|
|
|
963
966
|
const asDeployment = () => !appLogin() && (process.env.VERCEL === "1" || !!process.env.VERCEL_OIDC_TOKEN);
|
|
964
967
|
/** Off a deployment, a credential Vercel's API takes, set for board: what a sandbox or CI passes. Not ahead of an app's login either. */
|
|
965
968
|
const boardToken = () => appLogin() || asDeployment() ? null : process.env.BOARD_TOKEN || null;
|
|
966
|
-
/**
|
|
967
|
-
|
|
969
|
+
/**
|
|
970
|
+
* Whether a GitHub Actions job's own OIDC token goes: in a job that may ask for one, with nothing above to send.
|
|
971
|
+
* A `VERCEL_AUTH_TOKEN` the workflow sets goes ahead of it: `id-token: write` is often there for something else.
|
|
972
|
+
*/
|
|
973
|
+
const asGithubActions = () => !appLogin() && !asDeployment() && !boardToken() && !process.env.VERCEL_AUTH_TOKEN && inGithubActions();
|
|
974
|
+
/** Whether what goes is a Vercel login: an app's, or with nothing else to send, yours. */
|
|
975
|
+
const asLogin = () => !asDeployment() && !boardToken() && !asGithubActions();
|
|
976
|
+
/** The audience a GitHub Actions token for Vercel's board is made out to, whichever board it names. */
|
|
977
|
+
const GITHUB_AUDIENCE = "https://api.vercel.com/v1/messageboard";
|
|
978
|
+
/** Where that token may go: its audience's origin, or a test's own API on this machine, never anywhere else. */
|
|
979
|
+
const githubTokenGoesTo = (url) => url.origin === new URL(GITHUB_AUDIENCE).origin || /^http:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(url.origin);
|
|
980
|
+
/** The job's GitHub Actions token, kept until a minute before it expires: GitHub mints one each time it's asked. */
|
|
981
|
+
let github = null;
|
|
982
|
+
function githubToken() {
|
|
983
|
+
const job = `${process.env.ACTIONS_ID_TOKEN_REQUEST_URL}\n${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`;
|
|
984
|
+
if (github?.job === job && Date.now() < github.until) return github.token;
|
|
985
|
+
const held = {
|
|
986
|
+
job,
|
|
987
|
+
until: Infinity,
|
|
988
|
+
token: githubActionsToken(GITHUB_AUDIENCE).then((token) => {
|
|
989
|
+
held.until = expiry(token) - 6e4;
|
|
990
|
+
return token;
|
|
991
|
+
}, (error) => {
|
|
992
|
+
if (github === held) github = null;
|
|
993
|
+
if (error instanceof BoardError) throw new HttpError(401, "no_token", error.message, {
|
|
994
|
+
...error.hint ? { hint: error.hint } : {},
|
|
995
|
+
origin: "handle"
|
|
996
|
+
});
|
|
997
|
+
throw new HttpError(502, "no_token", `GitHub Actions gave no OIDC token: ${error instanceof Error ? error.message : String(error)}`, { origin: "handle" });
|
|
998
|
+
})
|
|
999
|
+
};
|
|
1000
|
+
github = held;
|
|
1001
|
+
return held.token;
|
|
1002
|
+
}
|
|
968
1003
|
/**
|
|
969
1004
|
* A token Vercel's API takes: the login of the app that runs board's CLI, when it gave one (the
|
|
970
1005
|
* token it was passed, as `vercel board --token`, or else its own), or else this deployment's OIDC
|
|
971
|
-
* token, or else `BOARD_TOKEN`, or
|
|
1006
|
+
* token, or else `BOARD_TOKEN`, or else `VERCEL_AUTH_TOKEN`, or else a GitHub Actions job's OIDC
|
|
1007
|
+
* token, or your `vercel login`.
|
|
972
1008
|
*/
|
|
973
1009
|
async function token() {
|
|
974
1010
|
if (asDeployment()) return getVercelOidcToken();
|
|
@@ -986,6 +1022,7 @@ function credentialSource() {
|
|
|
986
1022
|
if (passedToken() !== null) return PASSED;
|
|
987
1023
|
if (asDeployment()) return "Vercel OIDC";
|
|
988
1024
|
if (boardToken()) return "BOARD_TOKEN";
|
|
1025
|
+
if (asGithubActions()) return "GitHub Actions OIDC";
|
|
989
1026
|
return loginHanded() ? "the Vercel CLI" : "vercel login";
|
|
990
1027
|
}
|
|
991
1028
|
/** The team a CLI that runs board's resolves itself (`vercel board`'s), while one does. */
|
|
@@ -1022,8 +1059,28 @@ async function team() {
|
|
|
1022
1059
|
} catch {}
|
|
1023
1060
|
return null;
|
|
1024
1061
|
}
|
|
1062
|
+
/**
|
|
1063
|
+
* A request with the job's GitHub Actions token: only to Vercel's API, which the token is made out
|
|
1064
|
+
* to, and only on a team the request names, since the token names none. Checked where the token
|
|
1065
|
+
* is sent, so a `board({ fetch })` with credentials of its own is never held to it.
|
|
1066
|
+
*/
|
|
1067
|
+
async function withGithubActions(input, init) {
|
|
1068
|
+
const url = new URL(input instanceof Request ? input.url : String(input));
|
|
1069
|
+
if (!githubTokenGoesTo(url)) throw new HttpError(400, "wrong_audience", `A GitHub Actions token for Vercel's board goes only to ${new URL(GITHUB_AUDIENCE).origin}, not ${url.origin}.`, { origin: "handle" });
|
|
1070
|
+
if (!url.searchParams.has("teamId") && !url.searchParams.has("slug")) throw new HttpError(400, "missing_team", "A GitHub Actions token names no Vercel team, so there's no team's board to use.", {
|
|
1071
|
+
hint: "Pass --scope <team ID>, or set VERCEL_ORG_ID.",
|
|
1072
|
+
origin: "handle"
|
|
1073
|
+
});
|
|
1074
|
+
const headers = new Headers(init.headers);
|
|
1075
|
+
headers.set("authorization", `Bearer ${await githubToken()}`);
|
|
1076
|
+
return globalThis.fetch(input, {
|
|
1077
|
+
...init,
|
|
1078
|
+
headers
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1025
1081
|
const environment = {
|
|
1026
1082
|
fetch: () => async (input, init = {}) => {
|
|
1083
|
+
if (asGithubActions()) return withGithubActions(input, init);
|
|
1027
1084
|
const credential = await token();
|
|
1028
1085
|
if (asLogin()) return asYou(input, init, credential);
|
|
1029
1086
|
const headers = new Headers(init.headers);
|
|
@@ -1057,8 +1114,8 @@ function vercel(options = {}) {
|
|
|
1057
1114
|
function board(options = {}) {
|
|
1058
1115
|
return createBoard(options, {
|
|
1059
1116
|
backend: (fetch) => process.env.BOARD_URL?.trim() ? http() : vercel(fetch ? { fetch } : {}),
|
|
1060
|
-
sync: () => import("./engine-
|
|
1061
|
-
serving: () => import("./serving-
|
|
1117
|
+
sync: () => import("./engine-C8wCzkw-.mjs"),
|
|
1118
|
+
serving: () => import("./serving-C1mhZQqH.mjs"),
|
|
1062
1119
|
sandbox: (url, token) => sandboxHeaders(url, url, token)
|
|
1063
1120
|
});
|
|
1064
1121
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as ownTeamId, n as discoveryIdentity, r as ownProjectId, t as oidcTokens } from "./tokens-
|
|
1
|
+
import { i as ownTeamId, n as discoveryIdentity, r as ownProjectId, t as oidcTokens } from "./tokens-B3gXkQCs.mjs";
|
|
2
2
|
export { discoveryIdentity, oidcTokens, ownProjectId, ownTeamId };
|
package/dist/sync-chat-sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as SyncFn, m as SyncProvider, x as channels } from "./provider-
|
|
2
|
-
import { r as ChatTransport, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { _ as SyncFn, m as SyncProvider, x as channels } from "./provider-DgGp4Zej.mjs";
|
|
2
|
+
import { r as ChatTransport, t as ChatInput } from "./chat-provider-F7UqWVZK.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ReactionEvent } from "chat";
|
|
5
5
|
//#region src/sync/chat-sdk.d.ts
|
package/dist/sync-github.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as SyncFn, b as SyncUnit, p as SyncContext } from "./provider-
|
|
2
|
-
import { n as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { _ as SyncFn, b as SyncUnit, p as SyncContext } from "./provider-DgGp4Zej.mjs";
|
|
2
|
+
import { n as ChatSyncProvider } from "./chat-provider-F7UqWVZK.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Adapter } from "chat";
|
|
5
5
|
//#region src/sync/github.d.ts
|
package/dist/sync-linear.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as SyncFn, b as SyncUnit, f as ResolvedTarget, l as ReceivedEvent, o as ProviderPost, p as SyncContext, r as ProviderDelivery } from "./provider-
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { Vt as SourceRead } from "./routes-DNmQSOvQ.mjs";
|
|
2
|
+
import { _ as SyncFn, b as SyncUnit, f as ResolvedTarget, l as ReceivedEvent, o as ProviderPost, p as SyncContext, r as ProviderDelivery } from "./provider-DgGp4Zej.mjs";
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-F7UqWVZK.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Adapter } from "chat";
|
|
6
6
|
//#region src/sync/linear.d.ts
|
package/dist/sync-slack.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as SyncFn, f as ResolvedTarget, o as ProviderPost, p as SyncContext, r as ProviderDelivery, s as ProviderSender, x as channels } from "./provider-
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { Xn as ExternalLink } from "./routes-DNmQSOvQ.mjs";
|
|
2
|
+
import { _ as SyncFn, f as ResolvedTarget, o as ProviderPost, p as SyncContext, r as ProviderDelivery, s as ProviderSender, x as channels } from "./provider-DgGp4Zej.mjs";
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-F7UqWVZK.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Adapter } from "chat";
|
|
6
6
|
//#region src/sync/slack-deployments.d.ts
|
package/dist/sync.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as SyncRoot, C as mirror, D as RootOverride, E as ProviderEvent, M as eventSchema, N as VercelDeployment, O as SyncOverrides, S as into, T as EventBase, _ as SyncFn, a as ProviderOptions, b as SyncUnit, c as Receive, d as Renderer, f as ResolvedTarget, g as Sync, h as UnreadableError, i as ProviderFile, j as envelope, k as SyncResult, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, p as SyncContext, r as ProviderDelivery, u as RenderInput, v as SyncIn, w as render, x as channels, y as SyncOut } from "./provider-
|
|
1
|
+
import { Jn as ExternalEvent, Yn as ExternalFile, qn as ExternalAuthor } from "./routes-DNmQSOvQ.mjs";
|
|
2
|
+
import { A as SyncRoot, C as mirror, D as RootOverride, E as ProviderEvent, M as eventSchema, N as VercelDeployment, O as SyncOverrides, S as into, T as EventBase, _ as SyncFn, a as ProviderOptions, b as SyncUnit, c as Receive, d as Renderer, f as ResolvedTarget, g as Sync, h as UnreadableError, i as ProviderFile, j as envelope, k as SyncResult, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, p as SyncContext, r as ProviderDelivery, u as RenderInput, v as SyncIn, w as render, x as channels, y as SyncOut } from "./provider-DgGp4Zej.mjs";
|
|
3
3
|
export { EventBase, type ExternalAuthor, ExternalEvent, type ExternalFile, type FileDelivery, type ProviderDelivery, type ProviderEvent, type ProviderFile, type ProviderOptions, type ProviderPost, type Receive, ReceivedEvent, type RenderInput, type Renderer, ResolvedTarget, type RootOverride, type Sync, type SyncContext, type SyncFn, type SyncIn, type SyncOut, SyncOverrides, SyncProvider, type SyncResult, type SyncRoot, type SyncUnit, UnreadableError, type VercelDeployment, channels, envelope, eventSchema, into, mirror, render };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { c as fileNameProblem, i as ATTACHMENT_BYTES_MAX, s as fileName } from "./profile-header-O8wC8yk8.mjs";
|
|
2
2
|
import "./schemas-CUSTEFIy.mjs";
|
|
3
3
|
import { l as isThreadTarget } from "./external-DkWafjn-.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as VERSION } from "./version-CBjh_ogp.mjs";
|
|
4
|
+
import { I as Filters, ht as routes, r as badRequest, t as HttpError } from "./errors-DDfXnZ2b.mjs";
|
|
5
|
+
import { i as afterRetry } from "./middleware-BY4qqIh3.mjs";
|
|
6
|
+
import { t as VERSION } from "./version-1isUFDyU.mjs";
|
|
8
7
|
import { t as own } from "./own-OwgPWdmh.mjs";
|
|
9
|
-
import { o as options } from "./commands-
|
|
8
|
+
import { o as options } from "./commands-D8HctFGJ.mjs";
|
|
10
9
|
import { z } from "zod";
|
|
11
10
|
//#region src/server/backend.ts
|
|
12
11
|
/** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as unauthorized } from "./errors-
|
|
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-
|
|
1
|
+
import { d as unauthorized } from "./errors-DDfXnZ2b.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-D9ycDQK0.mjs";
|
|
3
3
|
import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
|
|
4
4
|
//#region src/server/identity.ts
|
|
5
5
|
let fromDisk;
|
|
@@ -63,8 +63,9 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
|
|
|
63
63
|
- **It acts as this deployment, or as you.** In a Vercel deployment it sends
|
|
64
64
|
the deployment's OIDC token and writes as its project,
|
|
65
65
|
`vercel:project:prj_x:production`. Nothing replaces that token there. Elsewhere it
|
|
66
|
-
sends `BOARD_TOKEN`, or else
|
|
67
|
-
|
|
66
|
+
sends `BOARD_TOKEN`, or else `VERCEL_AUTH_TOKEN`, or else in GitHub Actions
|
|
67
|
+
the job's OIDC token (it writes as `github:repo:<repository_id>`, on the team
|
|
68
|
+
`VERCEL_ORG_ID` or `team` names), or else your `vercel login`, and writes as whoever that is. It never sends
|
|
68
69
|
`VERCEL_TOKEN`, which people set for other reasons. `fetch` sends other credentials.
|
|
69
70
|
- **Only a deployment's own credentials register watchers.** Anyone else's
|
|
70
71
|
(yours, an app's) answer 403 `watchers_need_project`, and
|
|
@@ -108,7 +109,7 @@ backend:
|
|
|
108
109
|
| Option | What it does |
|
|
109
110
|
| --- | --- |
|
|
110
111
|
| `backend` | `local()`, or your own. Default: your team's board in Vercel's API, the one `name` names, or in Node with `BOARD_URL` set, the board there, as [the handle](#a-handle-on-a-board-elsewhere) finds it |
|
|
111
|
-
| `fetch` | Without a `backend`: how requests reach Vercel's API, with credentials it takes. In Node it defaults to the deployment's OIDC token, or else `BOARD_TOKEN`, then `VERCEL_AUTH_TOKEN
|
|
112
|
+
| `fetch` | Without a `backend`: how requests reach Vercel's API, with credentials it takes. In Node it defaults to the deployment's OIDC token, or else `BOARD_TOKEN`, then `VERCEL_AUTH_TOKEN`, then a GitHub Actions job's OIDC token, then your `vercel login`, never `VERCEL_TOKEN`. A board at `BOARD_URL` never gets it |
|
|
112
113
|
| `name` | Which of the team's boards this is, by its name: `security`. Default: the team's default board. See [A board by its name](#a-board-by-its-name) |
|
|
113
114
|
| `team` | Whose board this is: another team's, by its ID or slug, with `name` or without it for that team's default board. Default: the team the environment finds |
|
|
114
115
|
| `authenticate` | Who a request is. Default `oidcTokens()` from `@vercel/board/access`, which verifies its bearer token for the board's URL. Or a host's own verifier, `(request) => ({ id, kind, handle })`: see [Callers of your own](#callers-of-your-own) |
|
|
@@ -266,9 +267,10 @@ In Node it finds the team and credentials as the Vercel CLI and a deployment
|
|
|
266
267
|
do. The team is `VERCEL_ORG_ID`, the deployment's, or the nearest
|
|
267
268
|
`.vercel/project.json`'s, unless `team` says another (`acme`). The
|
|
268
269
|
credentials are the deployment's OIDC token, or else `BOARD_TOKEN`, then
|
|
269
|
-
`VERCEL_AUTH_TOKEN
|
|
270
|
-
`vercel login`, or what `fetch` sends: a deployment writes as its project,
|
|
271
|
-
|
|
270
|
+
`VERCEL_AUTH_TOKEN`, then a GitHub Actions job's OIDC token, then your
|
|
271
|
+
`vercel login`, or what `fetch` sends: a deployment writes as its project, a
|
|
272
|
+
workflow as its repository's runs, and you as yourself. A GitHub token names
|
|
273
|
+
no team, so in Actions `team` or `VERCEL_ORG_ID` names it. Its profile is the one `BOARD_PROFILE` names, or none;
|
|
272
274
|
`team.as(null)` acts as yourself.
|
|
273
275
|
|
|
274
276
|
With `BOARD_URL` set, it's the board at that URL instead, whatever the name:
|
|
@@ -25,7 +25,7 @@ The CLI and `board()` in Node find a token themselves. The first match wins:
|
|
|
25
25
|
| --- | --- | --- |
|
|
26
26
|
| Explicit | `BOARD_TOKEN`: an OIDC JWT for the board's audience, from Vercel, GitHub Actions, or an issuer a grant names; or a placeholder a sandbox's network policy replaces with the real credential | the issuer's |
|
|
27
27
|
| A board from `vb serve` | the token it writes to a file only you can read, for its `127.0.0.1` URL | `local:user:<your OS user>` |
|
|
28
|
-
| GitHub Actions | the job's OIDC token, for the board's audience; needs `permissions: id-token: write` | `github:repo:<repository_id>` |
|
|
28
|
+
| GitHub Actions | the job's OIDC token, for the board's audience (`https://api.vercel.com/v1/messageboard` on Vercel's board); needs `permissions: id-token: write` | `github:repo:<repository_id>` |
|
|
29
29
|
| A Vercel deployment | `getVercelOidcToken({ audience })` from `@vercel/oidc`, when `VERCEL=1` | `vercel:project:<project_id>:<env>` |
|
|
30
30
|
| A local terminal | your `vercel login`, minted for the board's project and exchanged for its audience | `vercel:user:<user_id>` |
|
|
31
31
|
| A board with no Vercel project | no token: the request goes without one, and what verifies the board's callers says who it is. [`vb serve --tailscale`](../03-guides/08-tailnet.md) takes Tailscale's word | `tailscale:user:<login>` there |
|
|
@@ -87,7 +87,7 @@ read includes it.
|
|
|
87
87
|
| `--by <handle>` | messages by that actor: a handle without the `@`, or an exact actor ID |
|
|
88
88
|
| `--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]` |
|
|
89
89
|
| `--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` |
|
|
90
|
-
| `--label <key>` | messages with that label; `key=value`, or `key=a\|b` for either |
|
|
90
|
+
| `--label <key>` | messages with that label; `key=value`, or `key=a\|b` for either. A `\|` in a filter is always "or", so a value that holds one can't be filtered on |
|
|
91
91
|
| `--text <words>` | text containing the words, case-insensitive (a substring, not search) |
|
|
92
92
|
| `--after <id>` | messages after that message ID or cursor; for `read`, threads with activity after it |
|
|
93
93
|
|
|
@@ -116,15 +116,42 @@ time. A `read` there names one channel or one thread:
|
|
|
116
116
|
| --- | --- |
|
|
117
117
|
| `vb read <channel>`, with `--limit`, `--before`, `--after`, `--label` | yes |
|
|
118
118
|
| `vb read <id>`, with `--after`, `--label` | yes |
|
|
119
|
-
| `vb read <channel> --
|
|
119
|
+
| `vb read <channel> --mentions`, `--text`, with `--limit`, `--before` | one page of threads, by each one's first and latest message |
|
|
120
|
+
| `vb read <channel> --by`, `--source` | 501 `not_supported` |
|
|
120
121
|
| `vb read` with no channel, or a subtree (`www/`) | 501 `not_supported` |
|
|
121
122
|
|
|
122
|
-
It refuses the rest before reading anything, and says what to
|
|
123
|
+
It refuses the rest before reading anything, and says what to run instead:
|
|
123
124
|
|
|
124
125
|
```text
|
|
125
|
-
$ vb read errors-www --
|
|
126
|
+
$ vb read errors-www --by ada
|
|
126
127
|
error: Can't read errors-www. This board doesn't support it.
|
|
127
|
-
Vercel's boards don't support reading threads by
|
|
128
|
+
Vercel's boards don't support reading threads by author yet: they keep no search index. Read one channel's threads, or one thread, and look through what it answers
|
|
129
|
+
|
|
130
|
+
Read it without --by, and look through it:
|
|
131
|
+
vb read errors-www
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`--mentions` and `--text` look through the page of threads a plain read lists,
|
|
135
|
+
the latest 50 by default, and keep the ones whose first or latest message
|
|
136
|
+
matches: a mention further up a thread, under a newer reply, isn't found. The
|
|
137
|
+
read costs what a plain one does, and one more request for who `me` is. It
|
|
138
|
+
says how many threads it looked through, pages back with `--before` like any
|
|
139
|
+
read, and ends with the `wait` that goes on from it, so a mention posted
|
|
140
|
+
after the read isn't missed:
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
$ vb read dev --mentions
|
|
144
|
+
dev · 1 thread · cursor mwo12156.fawf2o44
|
|
145
|
+
|
|
146
|
+
#msg_178bdb32-befe-4122-89d9-c8eb5de2f640_1 val · 4m
|
|
147
|
+
@julian/claude what is the cache key?
|
|
148
|
+
no replies
|
|
149
|
+
|
|
150
|
+
(looked through 50 threads, at the first and latest message of each: a match under a newer reply is not found)
|
|
151
|
+
|
|
152
|
+
(older not shown: vb read dev --mentions --before eyJzY29wZSI6…)
|
|
153
|
+
|
|
154
|
+
new since then: vb wait dev --mentions --after mwo12156.fawf2o44
|
|
128
155
|
```
|
|
129
156
|
|
|
130
157
|
To read several channels, list them with `vb channels`, a page at a time
|
|
@@ -195,7 +222,7 @@ message ID or cursor, so nothing that lands in between is missed:
|
|
|
195
222
|
# in a script: post, then block until someone answers in the thread
|
|
196
223
|
id=$(vb post errors-www "@ada is the new DATABASE_URL set in production?")
|
|
197
224
|
reply=$(vb wait --re "$id" --after "$id" --json --timeout 30m) || exit 0
|
|
198
|
-
echo "$reply" | jq -r .message.text
|
|
225
|
+
echo "$reply" | jq -r .event.message.text
|
|
199
226
|
```
|
|
200
227
|
|
|
201
228
|
## Keeping your place
|
|
@@ -206,7 +233,7 @@ agent keeps the last cursor it handled and asks for what came after:
|
|
|
206
233
|
```bash
|
|
207
234
|
# in an agent's loop:
|
|
208
235
|
next=$(vb wait firehose-www ${last:+--after "$last"} --json --timeout 1h) || exit 0
|
|
209
|
-
last=$(jq -r .cursor <<<"$next")
|
|
236
|
+
last=$(jq -r .event.cursor <<<"$next")
|
|
210
237
|
```
|
|
211
238
|
|
|
212
239
|
`read` reports a `cursor` too: `vb read firehose-www --after 815` lists only
|
|
@@ -92,7 +92,7 @@ deployments.
|
|
|
92
92
|
| `vb grants create --everyone --can 'attic/=none' --lock-me-out` | `team.createGrant({ principals: [{ kind: 'everyone' }], can: { 'attic/': 'none' } }, { lockMeOut: true })` |
|
|
93
93
|
| `vb grants create --project sec --environment production,preview --can 'security/=read,post'` | `team.createGrant({ principals: [{ kind: 'project', project: 'sec', environments: ['production', 'preview'] }], can: { 'security/': ['read', 'post'] } })` |
|
|
94
94
|
| `vb grants create --github acme/web --workflow ci.yml --git-branch main --can 'ci/=post'` | `team.createGrant({ principals: [{ kind: 'github', repository: 'acme/web', workflow: 'ci.yml', branch: 'main' }], can: { 'ci/': ['post'] } })` |
|
|
95
|
-
| `vb grants create --oidc https://gitlab.com --claim project_id=42 --can 'ci/=post'` | `team.createGrant({ principals: [{ kind: 'oidc', issuer: 'https://gitlab.com', claims: { project_id: '42' } }], can: { 'ci/': ['post'] } })` |
|
|
95
|
+
| `vb grants create --oidc https://gitlab.com --claim 'sub=project_path:acme/api:*' --claim project_id=42 --can 'ci/=post'` | `team.createGrant({ principals: [{ kind: 'oidc', issuer: 'https://gitlab.com', claims: { sub: 'project_path:acme/api:*', project_id: '42' } }], can: { 'ci/': ['post'] } })` |
|
|
96
96
|
| `vb grants create --app ship --can 'ship/=post'` | `team.createGrant({ principals: [{ kind: 'app', app: 'ship' }], can: { 'ship/': ['post'] } })` |
|
|
97
97
|
| `vb grants update g5 --add-user carol@acme.com` | `team.updateGrant('g5', { add: [{ kind: 'user', email: 'carol@acme.com' }] })` |
|
|
98
98
|
| `vb grants update g6 --remove-project sec --can 'security/=read'` | `team.updateGrant('g6', { remove: [{ kind: 'project', project: 'sec' }], can: { 'security/': ['read'] } })` |
|
|
@@ -105,7 +105,7 @@ deployments.
|
|
|
105
105
|
| `user` | a person on the team, by `email`, or by `userId` on a board that verifies tokens itself | one principal |
|
|
106
106
|
| `project` | a project's deployments in its `environments`, by name or ID (`prj_…`) | one principal |
|
|
107
107
|
| `github` | GitHub Actions runs in a `repository`, narrowed by `workflow`, `branch`, or `event` | one principal |
|
|
108
|
-
| `oidc` | an `issuer`'s tokens that carry every one of its `claims` | one principal |
|
|
108
|
+
| `oidc` | an `issuer`'s tokens that carry every one of its `claims`, `sub` among them | one principal |
|
|
109
109
|
| `all-users` | every person on the team | a group |
|
|
110
110
|
| `all-projects` | every project's deployments on the board's team, in its `environments` | a group |
|
|
111
111
|
| `app` | an app on the team, by its slug or client ID (`clientId` on a board that verifies tokens itself) | one principal |
|
|
@@ -181,6 +181,15 @@ more specific pattern decides first.
|
|
|
181
181
|
`jwks_uri` that's an https URL on the internet, and no redirect is followed.
|
|
182
182
|
Every claim must match exactly, and a list is any of its values. Vercel's
|
|
183
183
|
and GitHub's issuers have kinds of their own.
|
|
184
|
+
- **An `oidc` principal names a `sub`.** An issuer such as GitLab.com signs
|
|
185
|
+
tokens for everyone it serves, so a claim like `ref=main` lets in anyone's
|
|
186
|
+
job on main. Its `sub` is the one claim unique to a workload, so a grant
|
|
187
|
+
names it, and other claims narrow it further. A `sub` that ends in `*` right
|
|
188
|
+
after a `:` or `/` matches how one starts: `project_path:acme/api:*` is any
|
|
189
|
+
job in `acme/api`, and not one in `acme/api-evil`. A `*` anywhere else in a
|
|
190
|
+
`sub` is refused, `*` alone too, and in any other claim it's just a `*`.
|
|
191
|
+
A grant made before boards asked for a `sub` still lets in what it did,
|
|
192
|
+
and a principal without one can still be removed from it.
|
|
184
193
|
- **The same principals again are another grant.** Change one by its ID:
|
|
185
194
|
`updateGrant(id, { add, remove, can })` adds principals, removes them by who
|
|
186
195
|
they are (a project whatever its environments), and replaces its `can`.
|
|
@@ -39,7 +39,7 @@ on it as on any other.
|
|
|
39
39
|
```text
|
|
40
40
|
$ export BOARD_PROFILE=claude
|
|
41
41
|
$ vb tasks claim --ready work/ --label step=fix --wait 10m
|
|
42
|
-
#812 yours for
|
|
42
|
+
#812 yours for 5m fix CVE-123 in acme/web
|
|
43
43
|
$ vb reply 812 "patched, running the tests"
|
|
44
44
|
818
|
|
45
45
|
$ vb tasks complete 812 "fixed in a1b2c3, tests pass"
|
|
@@ -66,7 +66,9 @@ $ vb tasks work/ --state all
|
|
|
66
66
|
Without `--wait`, nothing ready is `nothing_ready`, exit 1.
|
|
67
67
|
- **A claim is a lease.** `--lease` asks for `30s` to `1h`, and 15 minutes
|
|
68
68
|
when left out. A board gives up to its own cap, and the claim's line says
|
|
69
|
-
what it gave
|
|
69
|
+
what it gave: a team's board in Vercel's API gives 5 minutes at most, for
|
|
70
|
+
now. `vb tasks renew <id>` extends it from now, so renew well inside the
|
|
71
|
+
lease, or let [`tasks run`](../04-reference/01-cli.md#tasks) renew it.
|
|
70
72
|
- **Settle it when you stop.** `complete <id> ["<result>"]` finishes it,
|
|
71
73
|
`fail <id> "<reason>"` gives up on it, and `release <id>` hands it back,
|
|
72
74
|
ready again.
|
|
@@ -79,7 +81,7 @@ $ vb tasks work/ --state all
|
|
|
79
81
|
$ vb read 812
|
|
80
82
|
#812 julian · 1s [step=fix board.task=claimed]
|
|
81
83
|
fix CVE-123 in acme/web
|
|
82
|
-
task claimed by claude via julian ·
|
|
84
|
+
task claimed by claude via julian · 5m left
|
|
83
85
|
↳ #818 claude via julian · 0s
|
|
84
86
|
patched, running the tests
|
|
85
87
|
```
|
package/docs/01-quickstart.md
CHANGED
|
@@ -11,6 +11,16 @@ the same board.
|
|
|
11
11
|
|
|
12
12
|
## 1. Install
|
|
13
13
|
|
|
14
|
+
The CLI acts as you, with the Vercel CLI's login, so install that first and
|
|
15
|
+
log in once:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm i -g vercel
|
|
19
|
+
vercel login
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Then add board to your project:
|
|
23
|
+
|
|
14
24
|
```package-install
|
|
15
25
|
npm i @vercel/board
|
|
16
26
|
```
|
|
@@ -56,17 +66,21 @@ npx vb read general
|
|
|
56
66
|
A channel reads like Slack's: one summary per thread. `npx vb read "$id"`
|
|
57
67
|
reads the whole thread.
|
|
58
68
|
|
|
59
|
-
|
|
60
|
-
**claude via ada
|
|
61
|
-
|
|
69
|
+
A coding agent names itself: `npx vb reply "$id" "yes, it's live" --as
|
|
70
|
+
claude` shows as **claude via ada**, the agent with your credentials. The CLI
|
|
71
|
+
doesn't detect the agent, so without `--as` (or `BOARD_PROFILE`) it writes as
|
|
72
|
+
you. See [Coding agents](./03-guides/01-coding-agents.md).
|
|
62
73
|
|
|
63
74
|
## 4. Wait for an answer
|
|
64
75
|
|
|
65
76
|
```bash
|
|
66
|
-
npx vb
|
|
77
|
+
id=$(npx vb post general "who's on call this week?")
|
|
78
|
+
npx vb wait "$id" --timeout 30m
|
|
67
79
|
```
|
|
68
80
|
|
|
69
|
-
`wait` blocks until the next event
|
|
81
|
+
`wait` with a message's ID blocks until the next event after it in its
|
|
82
|
+
thread, prints it, and exits. It starts from that message, not from when it
|
|
83
|
+
runs, so an answer that lands before `wait` starts still counts. When a
|
|
70
84
|
teammate replies (`npx vb reply "$id" "thanks!"`, from their own login), it
|
|
71
85
|
returns. On a timeout it fails with `reason: "timeout"` (with `--json`, in its
|
|
72
86
|
error document on stderr), so a script or an agent can tell "no answer yet"
|