@vercel/board 0.52.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +4 -3
  2. package/dist/{access-DdojoPZm.mjs → access-HzqFpgL_.mjs} +1 -1
  3. package/dist/access.d.mts +3 -3
  4. package/dist/access.mjs +5 -5
  5. package/dist/{actors-CDkNgWUL.mjs → actors-D-u6bitG.mjs} +2 -2
  6. package/dist/{auth-zPqFJocD.mjs → auth-D9ycDQK0.mjs} +34 -12
  7. package/dist/{auth-C4VxPLYz.d.mts → auth-ULldUvir.d.mts} +8 -2
  8. package/dist/{backend-Da_YEltI.d.mts → backend-BHN6GTjB.d.mts} +8 -7
  9. package/dist/backend-local.d.mts +1 -1
  10. package/dist/backend-local.mjs +1 -1
  11. package/dist/{chat-provider-BHyX6H8H.d.mts → chat-provider-F7UqWVZK.d.mts} +2 -2
  12. package/dist/cli-commands.d.mts +1 -1
  13. package/dist/cli-commands.mjs +1 -1
  14. package/dist/cli-embedded.d.mts +32 -3
  15. package/dist/cli-embedded.mjs +4 -2
  16. package/dist/cli.mjs +6 -6
  17. package/dist/{client-C4-r10SA.d.mts → client-CFHunEFn.d.mts} +16 -4
  18. package/dist/{commands-B_gbi2sU.mjs → commands-B5SXeo4W.mjs} +14 -9
  19. package/dist/{commands-B6pgzwTI.d.mts → commands-DLPIX7Jw.d.mts} +3 -1
  20. package/dist/{conformance-DW4-9Dwf.mjs → conformance-CyQG0jky.mjs} +56 -4
  21. package/dist/conformance.d.mts +3 -4
  22. package/dist/conformance.mjs +1 -1
  23. package/dist/{engine-D8YAsQS_.mjs → engine-C8wCzkw-.mjs} +2 -2
  24. package/dist/errors-DDfXnZ2b.mjs +1958 -0
  25. package/dist/{exports-BUtR_AHa.d.mts → exports-BBmjHyCB.d.mts} +4 -4
  26. package/dist/{exports-DI-MtN01.mjs → exports-JUhj5Bl3.mjs} +127 -77
  27. package/dist/{index-BTuTaBaK.d.mts → index-Ce3SDZ3Y.d.mts} +2 -2
  28. package/dist/index.d.mts +6 -6
  29. package/dist/index.mjs +4 -4
  30. package/dist/index.node.d.mts +7 -7
  31. package/dist/index.node.mjs +4 -4
  32. package/dist/inspect/app.js +69 -69
  33. package/dist/inspect/engine.js +3 -3
  34. package/dist/inspect-BN7V9e-M.mjs +2 -0
  35. package/dist/{inspect-BJR-BsUv.mjs → inspect-CrVs-iEi.mjs} +2 -2
  36. package/dist/inspect.d.mts +1 -1
  37. package/dist/inspect.mjs +1 -1
  38. package/dist/{local-B376y9u3.mjs → local-RoMUU6QX.mjs} +39 -23
  39. package/dist/{main-DfJNxck4.mjs → main-B_gzTjBR.mjs} +370 -102
  40. package/dist/{middleware-iVTNf5Su.mjs → middleware-BY4qqIh3.mjs} +1 -1
  41. package/dist/{provider-CGicSMdu.d.mts → provider-DgGp4Zej.d.mts} +2 -2
  42. package/dist/{routes-ChGBn0K3.d.mts → routes-DNmQSOvQ.d.mts} +36 -3
  43. package/dist/{serve-D8j7O2Tc.mjs → serve-Cz1NynhG.mjs} +6 -6
  44. package/dist/{server--BLSj6fd.mjs → server-CdBXNUxf.mjs} +68 -11
  45. package/dist/{serving-aOQsBok0.mjs → serving-C1mhZQqH.mjs} +1 -1
  46. package/dist/{shell-qrJL3Z_R.mjs → shell-Cqn38XUs.mjs} +1 -1
  47. package/dist/sync-chat-sdk.d.mts +2 -2
  48. package/dist/sync-github.d.mts +2 -2
  49. package/dist/sync-linear.d.mts +3 -3
  50. package/dist/sync-slack.d.mts +3 -3
  51. package/dist/sync.d.mts +2 -2
  52. package/dist/{task-batch-6UHphYfl.mjs → task-batch-CVamHB-W.mjs} +4 -5
  53. package/dist/{tokens-C-T0B1uF.mjs → tokens-B3gXkQCs.mjs} +2 -2
  54. package/dist/{version-NfsFHDfg.mjs → version-DBaKHEZS.mjs} +1 -1
  55. package/docs/01-board/01-mounting.md +8 -6
  56. package/docs/01-board/03-identity.md +1 -1
  57. package/docs/01-board/05-reading.md +34 -7
  58. package/docs/01-board/06-watchers.md +2 -1
  59. package/docs/01-board/09-access.md +11 -2
  60. package/docs/01-board/11-tasks.md +28 -5
  61. package/docs/01-quickstart.md +19 -5
  62. package/docs/03-guides/03-ci.md +71 -43
  63. package/docs/03-guides/04-triage.md +4 -4
  64. package/docs/04-reference/01-cli.md +84 -22
  65. package/docs/04-reference/02-board.md +19 -10
  66. package/docs/04-reference/03-http.md +14 -5
  67. package/docs/04-reference/05-conformance.md +1 -1
  68. package/docs/index.md +7 -5
  69. package/package.json +2 -2
  70. package/dist/errors-DbCKqGXp.mjs +0 -851
  71. package/dist/inspect-CYfZ0vva.mjs +0 -2
  72. package/dist/routes-C85Sbhtm.mjs +0 -1067
@@ -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-DbCKqGXp.mjs";
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 { Ft as SourceJoin, Gn as ExternalEvent, Jn as Link, Kn as ExternalFile, Rn as Actor, Rt as SourceRead, Wn as ExternalAuthor, qn as ExternalLink, s as BoardEventView, st as MessageView } from "./routes-ChGBn0K3.mjs";
2
- import { t as BoardClient } from "./client-C4-r10SA.mjs";
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.
@@ -1043,6 +1049,7 @@ declare const LEASE_DEFAULT_S = 900;
1043
1049
  * `lease` seconds.
1044
1050
  */
1045
1051
  declare const CreateTaskBody: z.ZodObject<{
1052
+ token: z.ZodOptional<z.ZodString>;
1046
1053
  channel: z.ZodOptional<z.ZodString>;
1047
1054
  re: z.ZodOptional<z.ZodString>;
1048
1055
  text: z.ZodOptional<z.ZodString>;
@@ -1107,8 +1114,15 @@ declare const TasksQuery: z.ZodObject<{
1107
1114
  needs: z.ZodOptional<z.ZodString>;
1108
1115
  after: z.ZodOptional<z.ZodString>;
1109
1116
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1117
+ latest: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
1118
+ 0: "0";
1119
+ 1: "1";
1120
+ false: "false";
1121
+ true: "true";
1122
+ }>, z.ZodTransform<boolean, "0" | "1" | "false" | "true">>>;
1110
1123
  }, z.core.$strip>;
1111
1124
  declare const ClaimTaskBody: z.ZodOptional<z.ZodObject<{
1125
+ token: z.ZodOptional<z.ZodString>;
1112
1126
  lease: z.ZodOptional<z.ZodNumber>;
1113
1127
  }, z.core.$strip>>;
1114
1128
  /**
@@ -1117,6 +1131,7 @@ declare const ClaimTaskBody: z.ZodOptional<z.ZodObject<{
1117
1131
  * holds the request up to that many seconds for one.
1118
1132
  */
1119
1133
  declare const ClaimReadyTaskBody: z.ZodObject<{
1134
+ token: z.ZodOptional<z.ZodString>;
1120
1135
  channel: z.ZodString;
1121
1136
  label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1122
1137
  from: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1388,8 +1403,8 @@ declare const InboxQuery: z.ZodObject<{
1388
1403
  channel: z.ZodOptional<z.ZodString>;
1389
1404
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1390
1405
  }, z.core.$strip>;
1391
- /** How many watchers one registration holds: the board matches every event against every tail. */
1392
- declare const REGISTERED_WATCHERS_MAX = 32;
1406
+ /** How many watchers one registration holds on the local engine, which matches every event against every tail. Vercel's API sets its own. */
1407
+ declare const REGISTERED_WATCHERS_MAX = 64;
1393
1408
  /**
1394
1409
  * What a board on `http()` registers with the board it uses: its watchers, and where to wake it,
1395
1410
  * at a URL or at a path on its own project, never both.
@@ -1858,6 +1873,7 @@ type SyncFindInput = z.input<typeof SyncFindQuery>;
1858
1873
  type ChannelMessagesQueryInput = z.input<typeof ChannelMessagesQuery>;
1859
1874
  type ThreadQueryInput = z.input<typeof ThreadQuery>;
1860
1875
  type ChannelsQueryInput = z.input<typeof ChannelsQuery>;
1876
+ type ActorsQueryInput = z.input<typeof ActorsQuery>;
1861
1877
  type ThreadsQueryInput = z.input<typeof ThreadsQuery>;
1862
1878
  type EventsQueryInput = z.input<typeof EventsQuery>;
1863
1879
  type PostInput = z.input<typeof PostBody>;
@@ -2279,6 +2295,11 @@ type ThreadsPage = {
2279
2295
  * threads backward sends it on every read without `after`; one from before it leaves it out.
2280
2296
  */
2281
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;
2282
2303
  };
2283
2304
  /** Tasks, oldest first, each as its thread's summary: `message.task` is the task. `cursor` reads the next page, as `after`. */
2284
2305
  type TasksPage = {
@@ -2380,6 +2401,9 @@ declare const routes: {
2380
2401
  readonly actors: {
2381
2402
  readonly method: 'GET';
2382
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>;
2383
2407
  };
2384
2408
  /** One channel's messages across its threads: the newest, or those after one of its cursors. */
2385
2409
  readonly channelMessages: {
@@ -2562,6 +2586,12 @@ declare const routes: {
2562
2586
  needs: z.ZodOptional<z.ZodString>;
2563
2587
  after: z.ZodOptional<z.ZodString>;
2564
2588
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
2589
+ latest: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
2590
+ 0: "0";
2591
+ 1: "1";
2592
+ false: "false";
2593
+ true: "true";
2594
+ }>, z.ZodTransform<boolean, "0" | "1" | "false" | "true">>>;
2565
2595
  }, z.core.$strip>;
2566
2596
  };
2567
2597
  /** Starts a thread as a task (`post` there, and `label` for its labels), or makes the thread `re` roots one (`label` there). */
@@ -2569,6 +2599,7 @@ declare const routes: {
2569
2599
  readonly method: 'POST';
2570
2600
  readonly path: '/tasks';
2571
2601
  readonly body: z.ZodObject<{
2602
+ token: z.ZodOptional<z.ZodString>;
2572
2603
  channel: z.ZodOptional<z.ZodString>;
2573
2604
  re: z.ZodOptional<z.ZodString>;
2574
2605
  text: z.ZodOptional<z.ZodString>;
@@ -2616,6 +2647,7 @@ declare const routes: {
2616
2647
  readonly method: 'POST';
2617
2648
  readonly path: '/tasks/claim';
2618
2649
  readonly body: z.ZodObject<{
2650
+ token: z.ZodOptional<z.ZodString>;
2619
2651
  channel: z.ZodString;
2620
2652
  label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2621
2653
  from: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -2628,6 +2660,7 @@ declare const routes: {
2628
2660
  readonly method: 'POST';
2629
2661
  readonly path: '/tasks/:id/claim';
2630
2662
  readonly body: z.ZodOptional<z.ZodObject<{
2663
+ token: z.ZodOptional<z.ZodString>;
2631
2664
  lease: z.ZodOptional<z.ZodNumber>;
2632
2665
  }, z.core.$strip>>;
2633
2666
  };
@@ -3444,4 +3477,4 @@ declare const routes: {
3444
3477
  };
3445
3478
  type RouteName = keyof typeof routes;
3446
3479
  //#endregion
3447
- export { LABEL_CONDITIONS_MAX as $, THREADS_LIMIT_MAX as $t, Discovery as A, Level as An, SchedulesQueryInput as At, GRANT_BATCH_MAX as B, Attachment as Bn, SyncBody as Bt, CreateGrantsBody as C, ChannelPattern as Cn, RevokeGrantBody as Ct, CreateTasksInput as D, GrantChangeRefusal as Dn, ScheduleInput as Dt, CreateTasksBody as E, GrantChange as En, ScheduleBodyOutput as Et, EventsQueryInput as F, compileAccess as Fn, SourceJoin as Ft, GrantWriteOptions as G, ExternalEvent as Gn, SyncFindView as Gt, GrantCan as H, CAN_MAX as Hn, SyncCopiesView as Ht, ExplainQuery as I, parseCan as In, SourceJoinBody as It, InboxEntry as J, Link as Jn, SyncReceiptBody as Jt, INBOX_EVENT_ID_MAX as K, ExternalFile as Kn, SyncImportBody as Kt, Explanation as L, union as Ln, SourceMessage as Lt, EditBody as M, Permission as Mn, SchemaBody as Mt, EventsPage as N, WrittenCan as Nn, SchemaInput as Nt, CreatedTasksQuery as O, GrantShape as On, ScheduleView as Ot, EventsQuery as P, checkGrantChange as Pn, SchemaView as Pt, InboxQuery as Q, THREADS_LIMIT_DEFAULT as Qt, FailTaskBody as R, Actor as Rn, SourceRead as Rt, CreateChannelBody as S, Can as Sn, ResolvedSyncTarget as St, CreateTaskInput as T, Grant as Tn, ScheduleBody as Tt, GrantInput as U, Labels as Un, SyncFindInput as Ut, GrantBody as V, Author as Vn, SyncCopiesQuery as Vt, GrantView as W, ExternalAuthor as Wn, SyncFindQuery as Wt, InboxNextQuery as X, SyncThreadView as Xt, InboxItem as Y, SyncReceiptInput as Yt, InboxPushBody as Z, SyncedView as Zt, ChannelsQueryInput as _, UploadStartBody as _n, RegisterBody as _t, BlockTaskBody as a, TasksQueryInput as an, MatchesQuery as at, ClaimTaskBody as b, Access as bn, ReleaseTaskBody as bt, CHANNELS_LIMIT_DEFAULT as c, ThreadSummaryView as cn, MessagesPage as ct, CancelTaskBody as d, ThreadsQuery as dn, PostInput as dt, TaskClaim as en, LEASE_DEFAULT_S as et, ChannelMessagesQuery as f, ThreadsQueryInput as fn, PrincipalInput as ft, ChannelsQuery as g, UpdateGrantInput as gn, Ref as gt, ChannelsPage as h, UpdateGrantBody as hn, ReactBody as ht, AssignTaskBody as i, TasksQuery as in, MatchView as it, EVENTS_LAST_MAX as j, PERMISSIONS as jn, SchedulesQueryOutput as jt, DeleteBody as k, InvalidCan as kn, SchedulesQuery as kt, CHANNELS_LIMIT_MAX as l, ThreadView as ln, ParsedFilters as lt, ChannelView as m, TypingResult as mn, REGISTERED_WATCHERS_MAX as mt, ActorView as n, TaskView as nn, LinkView as nt, BlockView as o, ThreadQuery as on, Me as ot, ChannelMessagesQueryInput as p, TypingBody as pn, PrincipalView as pt, InboxAckBody as q, ExternalLink as qn, SyncImportInput as qt, ApiError as r, TasksPage as rn, LinkedQuery as rt, BoardEventView as s, ThreadQueryInput as sn, MessageView as st, AckBody as t, TaskNeedsBody as tn, LabelBody as tt, CanAt as u, ThreadsPage as un, PostBody as ut, ClaimReadyTaskBody as v, UploadTicket as vn, RegisterInput as vt, CreateTaskBody as w, FULL_ACCESS as wn, RouteName as wt, CompleteTaskBody as x, AccessSummary as xn, RenewTaskBody as xt, ClaimReadyTaskInput as y, routes as yn, RegistrationView as yt, FiltersInput as z, ExternalCopy as zn, SourceReadQuery as zt };
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-DbCKqGXp.mjs";
2
- import { i as hostCheckedBy } from "./exports-DI-MtN01.mjs";
3
- import { i as LOGINS, r as LOGIN } from "./auth-zPqFJocD.mjs";
4
- import { h as localTokenFile, t as board } from "./server--BLSj6fd.mjs";
5
- import { t as oidcTokens } from "./tokens-C-T0B1uF.mjs";
6
- import { t as local } from "./local-B376y9u3.mjs";
1
+ import { f as BoardError, p as createBoardClient, t as HttpError } from "./errors-DDfXnZ2b.mjs";
2
+ import { i as hostCheckedBy } from "./exports-JUhj5Bl3.mjs";
3
+ import { i as LOGINS, r as LOGIN } from "./auth-D9ycDQK0.mjs";
4
+ import { h as localTokenFile, t as board } from "./server-CdBXNUxf.mjs";
5
+ import { t as oidcTokens } from "./tokens-B3gXkQCs.mjs";
6
+ import { t as local } from "./local-RoMUU6QX.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 { $ as routes } from "./routes-C85Sbhtm.mjs";
4
- import { f as BoardError, p as createBoardClient, t as HttpError } from "./errors-DbCKqGXp.mjs";
5
- import { g as keyId, p as DERIVED_ID } from "./middleware-iVTNf5Su.mjs";
6
- import { l as METHODS, o as compileWatcher } from "./task-batch-6UHphYfl.mjs";
7
- import { d as tailWatchers, f as deployedOnVercel, l as PROTOCOL_ROUTES, r as createBoard, s as createVercel, u as withoutToken } from "./exports-DI-MtN01.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-CVamHB-W.mjs";
6
+ import { d as tailWatchers, f as deployedOnVercel, l as PROTOCOL_ROUTES, r as createBoard, s as createVercel, u as withoutToken } from "./exports-JUhj5Bl3.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 (process.env.ACTIONS_ID_TOKEN_REQUEST_URL && process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN) {
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
- /** Whether what goes is a Vercel login: an app's, or with no deployment's token and no `BOARD_TOKEN`, yours. */
967
- const asLogin = () => !asDeployment() && !boardToken();
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 your Vercel login: `VERCEL_AUTH_TOKEN`, or your `vercel login`.
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-D8YAsQS_.mjs"),
1061
- serving: () => import("./serving-aOQsBok0.mjs"),
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-C-T0B1uF.mjs";
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 };
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "./version-NfsFHDfg.mjs";
1
+ import { t as VERSION } from "./version-DBaKHEZS.mjs";
2
2
  //#region src/inspect/style.ts
3
3
  /**
4
4
  * Just Chat's look: mono, quiet, one accent, hairlines only under headers.
@@ -1,5 +1,5 @@
1
- import { _ as SyncFn, m as SyncProvider, x as channels } from "./provider-CGicSMdu.mjs";
2
- import { r as ChatTransport, t as ChatInput } from "./chat-provider-BHyX6H8H.mjs";
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
@@ -1,5 +1,5 @@
1
- import { _ as SyncFn, b as SyncUnit, p as SyncContext } from "./provider-CGicSMdu.mjs";
2
- import { n as ChatSyncProvider } from "./chat-provider-BHyX6H8H.mjs";
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
@@ -1,6 +1,6 @@
1
- import { Rt as SourceRead } from "./routes-ChGBn0K3.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-CGicSMdu.mjs";
3
- import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-BHyX6H8H.mjs";
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
@@ -1,6 +1,6 @@
1
- import { qn as ExternalLink } from "./routes-ChGBn0K3.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-CGicSMdu.mjs";
3
- import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-BHyX6H8H.mjs";
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 { Gn as ExternalEvent, Kn as ExternalFile, Wn as ExternalAuthor } from "./routes-ChGBn0K3.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-CGicSMdu.mjs";
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 { $ as routes, b as Filters } from "./routes-C85Sbhtm.mjs";
5
- import { r as badRequest, t as HttpError } from "./errors-DbCKqGXp.mjs";
6
- import { i as afterRetry } from "./middleware-iVTNf5Su.mjs";
7
- import { t as VERSION } from "./version-NfsFHDfg.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-DBaKHEZS.mjs";
8
7
  import { t as own } from "./own-OwgPWdmh.mjs";
9
- import { o as options } from "./commands-B_gbi2sU.mjs";
8
+ import { o as options } from "./commands-B5SXeo4W.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-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";
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;
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const VERSION = "0.52.0";
3
+ const VERSION = "0.54.0";
4
4
  //#endregion
5
5
  export { VERSION as t };
@@ -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 your Vercel CLI login (`VERCEL_AUTH_TOKEN`, or
67
- `vercel login`'s), and writes as whoever that is. It never sends
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` or your `vercel login`, never `VERCEL_TOKEN`. A board at `BOARD_URL` never gets it |
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` or your
270
- `vercel login`, or what `fetch` sends: a deployment writes as its project, and
271
- you as yourself. Its profile is the one `BOARD_PROFILE` names, or none;
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> --by`, `--mentions`, `--text`, `--source` | 501 `not_supported` |
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 do instead:
123
+ It refuses the rest before reading anything, and says what to run instead:
123
124
 
124
125
  ```text
125
- $ vb read errors-www --text ENOTFOUND
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 text yet: they keep no search index. Read one channel's threads, or one thread, and look through what it answers
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
@@ -207,7 +207,8 @@ matches the tails, and the route at the top of this page runs `run`:
207
207
  `POST /watchers` to it, and when a wake-up shows the API holds an older set.
208
208
  Nothing happens before that: creating the board does no I/O. On Vercel, its
209
209
  URL is its production domain, or a preview's own; a request's `Host` never
210
- counts. A registration holds at most 32 watchers. Anyone else's credentials
210
+ counts. The API holds up to 64 watchers per registration, 256 per board
211
+ (400 `too_many_watchers`). Anyone else's credentials
211
212
  get 403 `watchers_need_project`, so with them it doesn't try, and runs its
212
213
  watchers as tails instead (off Vercel: see
213
214
  [How it runs](#how-it-runs)).
@@ -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`.