@vercel/board 0.36.0 → 0.38.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 (85) hide show
  1. package/dist/{access-BsP0hvcC.mjs → access-CVkjSfxj.mjs} +12 -12
  2. package/dist/access.d.mts +3 -3
  3. package/dist/access.mjs +6 -5
  4. package/dist/{actors-DFOpTw89.mjs → actors-kfMejhaw.mjs} +6 -4
  5. package/dist/{auth-CrjXLgOb.mjs → auth-B3bBYOqf.mjs} +2 -2
  6. package/dist/{auth-C21V0EK1.d.mts → auth-BXLCkeB0.d.mts} +3 -3
  7. package/dist/{backend-D21q8mdm.d.mts → backend-BkQlF1LQ.d.mts} +3 -9
  8. package/dist/backend-local.d.mts +1 -1
  9. package/dist/backend-local.mjs +1 -1
  10. package/dist/{chat-provider-Bb-jeJLY.mjs → chat-provider-1WKsLEnM.mjs} +2 -2
  11. package/dist/{chat-provider-DmZCmBkb.d.mts → chat-provider-DyNy5xdC.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 +18 -2
  15. package/dist/cli-embedded.mjs +22 -4
  16. package/dist/cli.mjs +50 -676
  17. package/dist/{commands-DGID-4Z2.d.mts → commands-B5d-lmNN.d.mts} +1 -1
  18. package/dist/{commands-BLtqSwha.mjs → commands-BLS7erNu.mjs} +12 -1
  19. package/dist/{conformance-CKrwglzA.mjs → conformance-qJF96jZI.mjs} +164 -23
  20. package/dist/conformance.d.mts +10 -2
  21. package/dist/conformance.mjs +1 -1
  22. package/dist/digest-DAxy9Ula.mjs +4 -0
  23. package/dist/{engine-B_prP0b8.mjs → engine-eUgO5jTM.mjs} +18 -14
  24. package/dist/{events-AEKh9tJm.mjs → events-C6HwB046.mjs} +23 -9
  25. package/dist/exports-BJ3wmEMY.d.mts +4 -0
  26. package/dist/{exports-Ck4Xu3OV.mjs → exports-BsfcChdp.mjs} +805 -193
  27. package/dist/{external-BA2aCC_3.mjs → external-CHDxWIVf.mjs} +1 -1
  28. package/dist/{index-LREsSZb2.d.mts → index-DpVyZa9b.d.mts} +2 -2
  29. package/dist/index.d.mts +5 -5
  30. package/dist/index.mjs +3 -3
  31. package/dist/index.node.d.mts +5 -5
  32. package/dist/index.node.mjs +2 -2
  33. package/dist/inspect/app.js +44 -44
  34. package/dist/inspect/engine.js +5 -5
  35. package/dist/inspect-5mkjJYMS.mjs +2 -0
  36. package/dist/inspect-DtCbBtOW.mjs +643 -0
  37. package/dist/{local-DJ_qI9q7.mjs → local-Bo3XzEKB.mjs} +29 -84
  38. package/dist/{main-Jz4nbNJi.mjs → main-0nvLgajF.mjs} +45 -37
  39. package/dist/{memory-DqwXlyK4.mjs → memory-DkoqhxIH.mjs} +2 -2
  40. package/dist/{middleware-BxgizazV.mjs → middleware-CPqAuRtp.mjs} +10 -2
  41. package/dist/page-R0RoE_gM.mjs +2 -0
  42. package/dist/page-UsfvSIWc.mjs +30 -0
  43. package/dist/{provider-DEOfc4Ls.d.mts → provider-D5yVFisj.d.mts} +5 -3
  44. package/dist/{routes-BpKdMvgX.d.mts → routes-BffuaoTX.d.mts} +11 -18
  45. package/dist/{schemas-BG205xds.mjs → schemas-AZkxk06N.mjs} +3 -3
  46. package/dist/{serve-Puf3I-oI.mjs → serve-D7I3KisQ.mjs} +3 -3
  47. package/dist/{server-CS-1aeTl.mjs → server-Cc3nYq3H.mjs} +23 -13
  48. package/dist/{serving-6_bhBNAW.mjs → serving-DJMcG0dT.mjs} +1 -1
  49. package/dist/{sql-aetuEBZC.mjs → sql-l3ysn4O5.mjs} +2 -2
  50. package/dist/{sqlite-DvsB8ENQ.mjs → sqlite-CAwNHbQD.mjs} +2 -2
  51. package/dist/{sqlite-db-BPwRoDI7.mjs → sqlite-db-cm5yhrD-.mjs} +1 -1
  52. package/dist/sync-chat-sdk.d.mts +2 -2
  53. package/dist/sync-chat-sdk.mjs +2 -2
  54. package/dist/sync-github.d.mts +2 -2
  55. package/dist/sync-github.mjs +2 -2
  56. package/dist/sync-linear.d.mts +3 -3
  57. package/dist/sync-linear.mjs +2 -2
  58. package/dist/sync-slack.d.mts +3 -3
  59. package/dist/sync-slack.mjs +4 -4
  60. package/dist/sync.d.mts +2 -2
  61. package/dist/sync.mjs +2 -2
  62. package/dist/{targets-Dk_xgS9q.mjs → targets-B4Uikw0J.mjs} +66 -21
  63. package/dist/{tokens-Dn4cPZIr.mjs → tokens-DA9ipsZ-.mjs} +1 -1
  64. package/docs/01-board/01-mounting.md +12 -9
  65. package/docs/01-board/03-identity.md +2 -1
  66. package/docs/01-board/06-watchers.md +71 -40
  67. package/docs/01-board/09-access.md +10 -5
  68. package/docs/01-quickstart.md +1 -1
  69. package/docs/02-sync/01-overview.md +7 -7
  70. package/docs/02-sync/02-functions.md +5 -8
  71. package/docs/02-sync/03-slack.md +0 -8
  72. package/docs/02-sync/04-github.md +0 -8
  73. package/docs/02-sync/07-linear.md +0 -6
  74. package/docs/03-guides/01-coding-agents.md +1 -0
  75. package/docs/03-guides/02-inspector.md +3 -2
  76. package/docs/03-guides/03-ci.md +10 -4
  77. package/docs/03-guides/04-triage.md +8 -13
  78. package/docs/04-reference/01-cli.md +51 -13
  79. package/docs/04-reference/02-board.md +2 -1
  80. package/docs/04-reference/03-http.md +4 -4
  81. package/docs/04-reference/05-conformance.md +10 -3
  82. package/docs/index.md +3 -10
  83. package/package.json +2 -1
  84. package/dist/attempts-HXcskN1w.mjs +0 -10
  85. package/dist/exports-BxljH73E.d.mts +0 -4
@@ -1,17 +1,16 @@
1
1
  import { a as forbidden$1, c as toErrorResponse, f as duration, g as fileName, h as IMPORT_BYTES_MAX, i as duplicateId, l as unauthorized, m as DIRECT_UPLOAD_BYTES_MAX, p as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, u as BoardError, v as mediaType } from "./errors-rYDxZEuN.mjs";
2
- import { _ as actorKind, a as ChannelPath, c as LabelKey, f as MessageId, g as SeenActorKind, h as SCOPE_MAX, i as Author, m as RemoteWatcherId, n as Attachment, o as Emoji, p as MessageText, s as Handle, t as ActorId, u as Labels, v as platformAvatar, y as storable } from "./schemas-BG205xds.mjs";
3
- import { a as Link, i as ExternalTarget, n as ExternalEvent, o as Origin } from "./external-BA2aCC_3.mjs";
4
- import { a as compileWatcher, c as METHODS, h as VERSION, i as canonicalWatchers, m as SYNC, n as syncTarget, o as hasCriteria, r as withEmailMentions } from "./targets-Dk_xgS9q.mjs";
5
- import { i as waitUntil, n as MIDDLEWARE_ACTOR, o as derivedId, s as isKeyIdOf, t as DroppedError } from "./middleware-BxgizazV.mjs";
6
- import { a as checkGrantChange, d as scopeOf, i as authorize, s as compileAccess, t as FULL_ACCESS, u as parseScope } from "./access-BsP0hvcC.mjs";
7
- import { C as workflowPath, c as checkGrant, f as grantIssuers, h as joined, l as checkPrincipal, m as issuerName, n as DEFAULT_CAN, o as authenticates, r as GITHUB_ISSUER, s as checkCan, t as BOARD_TOKEN_PREFIX, v as removes, w as wroteAs, y as tokenHash } from "./auth-CrjXLgOb.mjs";
2
+ import { _ as actorKind, a as CAN_MAX, c as Handle, d as Labels, g as SeenActorKind, h as RemoteWatcherId, i as Author, l as LabelKey, m as MessageText, n as Attachment, o as ChannelPath, p as MessageId, s as Emoji, t as ActorId, v as platformAvatar, y as storable } from "./schemas-AZkxk06N.mjs";
3
+ import { a as Link, i as ExternalTarget, n as ExternalEvent, o as Origin } from "./external-CHDxWIVf.mjs";
4
+ import { a as runMatch, g as VERSION, h as SYNC, i as canonicalWatchers, l as METHODS, n as syncTarget, o as compileWatcher, r as withEmailMentions, s as hasCriteria } from "./targets-B4Uikw0J.mjs";
5
+ import { a as waitUntil, c as isKeyIdOf, n as MIDDLEWARE_ACTOR, s as derivedId, t as DroppedError } from "./middleware-CPqAuRtp.mjs";
6
+ import { a as canText, c as compileAccess, i as authorize, o as checkGrantChange, t as FULL_ACCESS, u as parseCan } from "./access-CVkjSfxj.mjs";
7
+ import { C as workflowPath, c as checkGrant, f as grantIssuers, h as joined, l as checkPrincipal, m as issuerName, n as DEFAULT_CAN, o as authenticates, r as GITHUB_ISSUER, s as checkCan, t as BOARD_TOKEN_PREFIX, v as removes, w as wroteAs, y as tokenHash } from "./auth-B3bBYOqf.mjs";
8
8
  import { n as setOwn, t as own } from "./own-OwgPWdmh.mjs";
9
9
  import { n as replaceMentions } from "./mentions-CB6ShY4R.mjs";
10
- import { a as resolveMentions, n as actorSeen } from "./actors-DFOpTw89.mjs";
10
+ import { a as resolveMentions, n as actorSeen } from "./actors-kfMejhaw.mjs";
11
11
  import { C as sessionClearedError, a as SOCKET_TIMINGS, c as drainSettledHooks, d as nullProtoRecord, f as runtimeConsumerFactory, g as A2Error, h as stateTailReaders, i as RESERVED_PARTICIPANT_IDS, l as failedPreviousAttempt, m as serverInternals, n as POLL_TIMINGS, o as STATE_CACHE, p as runtimeConsumers, r as PRESENCE_TIMINGS, s as STREAM_TIMINGS, t as DRAIN_TIMINGS, u as markSchedulerSendFailure, v as NonRetriableError, x as isSessionCleared, y as asStoreUnavailable } from "./internal-CvsrprnU-CEPOUpAv.mjs";
12
12
  import { i as streamActivities, n as defaultSleep, t as createStreamActivity } from "./store-polling-BZt2Rf3D-oh3aU_An.mjs";
13
- import { a as foldActors, i as concernedMessageId, o as foldMessages, s as iso, t as TABLES_CONSUMER } from "./sql-aetuEBZC.mjs";
14
- import { t as afterRetry } from "./attempts-HXcskN1w.mjs";
13
+ import { a as foldActors, i as concernedMessageId, o as foldMessages, s as iso, t as TABLES_CONSUMER } from "./sql-l3ysn4O5.mjs";
15
14
  import { z } from "zod";
16
15
  import { createHash, randomBytes } from "node:crypto";
17
16
  import { mkdir, readFile, writeFile } from "node:fs/promises";
@@ -4110,15 +4109,12 @@ const StoredPrincipal = z.object({
4110
4109
  /** The board's own Vercel team, as the board knew it when it verified the token. */
4111
4110
  team: z.string().max(200).optional()
4112
4111
  }).optional(),
4113
- scope: z.string().max(SCOPE_MAX).optional(),
4112
+ scope: z.string().max(CAN_MAX).optional(),
4114
4113
  /** The board token it came with: what it stores stops when the token does. */
4115
4114
  token: z.string().min(1).max(64).optional()
4116
4115
  });
4117
- /** A watcher as a board on `http()` registers it: its tail, and when it runs. */
4118
- const WatcherSpec = z.object({
4119
- tail: z.string().max(1e3),
4120
- when: z.enum(["matches", "enters"])
4121
- });
4116
+ /** A watcher as a board on `http()` registers it: its tail. */
4117
+ const WatcherSpec = z.object({ tail: z.string().max(1e3) });
4122
4118
  /**
4123
4119
  * Watchers that boards on `http()` registered with this one, outside the board
4124
4120
  * log: one session, `registry`. Each principal has one registration, and its
@@ -5696,7 +5692,7 @@ const isOwner = (principal) => principal.kind === "person" && principal.id.start
5696
5692
  /** Whether `identity` may list the grants: `manage` at `*`, or the owner, as far as its token's scope allows. */
5697
5693
  function lists({ principal }) {
5698
5694
  if (principal.access.at("manage", "*")) return true;
5699
- return isOwner(principal) && (principal.scope === void 0 || compileAccess(parseScope(principal.scope)).at("manage", "*"));
5695
+ return isOwner(principal) && (principal.scope === void 0 || compileAccess(parseCan(principal.scope)).at("manage", "*"));
5700
5696
  }
5701
5697
  /** A 403 unless `identity` may list the grants. */
5702
5698
  function mayList(identity, what) {
@@ -5717,7 +5713,7 @@ const withoutEveryone = (grants) => grants.flatMap((grant) => {
5717
5713
  async function changerAccess({ principal }, grants, accessIn) {
5718
5714
  if (isOwner(principal)) {
5719
5715
  if (principal.scope === void 0) return null;
5720
- const scoped = compileAccess(parseScope(principal.scope));
5716
+ const scoped = compileAccess(parseCan(principal.scope));
5721
5717
  return {
5722
5718
  caller: scoped,
5723
5719
  own: scoped
@@ -5833,7 +5829,7 @@ function createTrust(options) {
5833
5829
  let access = minters.get(key);
5834
5830
  if (!access) minters.set(key, access = options.accessNow(minter));
5835
5831
  const now = await access;
5836
- return tokenView(row, now === null || scope === void 0 ? now : now.narrow(parseScope(scope)));
5832
+ return tokenView(row, now === null || scope === void 0 ? now : now.narrow(parseCan(scope)));
5837
5833
  }));
5838
5834
  }
5839
5835
  /** Whether token `id` and every token it was minted with are live now. */
@@ -6004,8 +6000,8 @@ function createTrust(options) {
6004
6000
  } catch (error) {
6005
6001
  throw badRequest(error.message, "invalid_scope");
6006
6002
  }
6007
- const scope = scopeOf((principal.scope === void 0 ? FULL_ACCESS : compileAccess(parseScope(principal.scope))).narrow(can));
6008
- if (scope.length > 4e3) throw badRequest(`a token's can is ${SCOPE_MAX} characters at most as a scope: name fewer channels`, "invalid_scope");
6003
+ const scope = canText((principal.scope === void 0 ? FULL_ACCESS : compileAccess(parseCan(principal.scope))).narrow(can));
6004
+ if (scope.length > 4e3) throw badRequest(`a token's can is ${CAN_MAX} characters at most as a scope: name fewer channels`, "invalid_scope");
6009
6005
  const minter = {
6010
6006
  id: principal.id,
6011
6007
  kind: principal.kind,
@@ -6398,10 +6394,7 @@ function watchersHash(watch, sync = []) {
6398
6394
  function foldRegistry(state, event) {
6399
6395
  if (event.type === "watchers.registered") {
6400
6396
  const { owner, principal, url, watch, sync, hash } = event.payload;
6401
- const copied = Object.fromEntries(Object.entries(watch).map(([id, spec]) => [id, {
6402
- tail: spec.tail,
6403
- when: spec.when
6404
- }]));
6397
+ const copied = Object.fromEntries(Object.entries(watch).map(([id, spec]) => [id, { tail: spec.tail }]));
6405
6398
  state.byOwner[owner] = {
6406
6399
  owner,
6407
6400
  principal: structuredClone(principal),
@@ -6554,7 +6547,7 @@ function nextSend(schedule, n, at, now) {
6554
6547
  /**
6555
6548
  * Whether `principal` is the schedule's creator, as far as seeing and canceling
6556
6549
  * it goes. A principal ID is coarser than access (a repo's workflows share one,
6557
- * and so do the proxies narrowing one token with `x-board-scope`), so it also
6550
+ * and so do the proxies narrowing one token with `x-board-can`), so it also
6558
6551
  * needs `post` there now, as it would to create it. Where it can't read, the
6559
6552
  * schedule is its own only if it was created without reading too, so a
6560
6553
  * principal ID shared with a caller that reads doesn't reach that caller's.
@@ -7030,7 +7023,7 @@ const queueReducer = reducer({
7030
7023
  unreachable: null
7031
7024
  }
7032
7025
  }).fold(foldQueue);
7033
- const describe$1 = (error) => ((error instanceof Error ? error.message : String(error)) || "unknown error").slice(0, 500);
7026
+ const describe = (error) => ((error instanceof Error ? error.message : String(error)) || "unknown error").slice(0, 500);
7034
7027
  /**
7035
7028
  * Whether `access` may see `event` now, as it was matched: a message's channel, or every channel for
7036
7029
  * none. Sync's queue gets what its registrant may sync, since it speaks for platform users there.
@@ -7251,7 +7244,7 @@ function failure(found, error) {
7251
7244
  payload: {
7252
7245
  matched: found.id,
7253
7246
  thread: found.thread,
7254
- error: describe$1(error)
7247
+ error: describe(error)
7255
7248
  }
7256
7249
  };
7257
7250
  }
@@ -7288,48 +7281,8 @@ const SYNCED = /* @__PURE__ */ new Set([
7288
7281
  ]);
7289
7282
  /** Whether a match waits in a registrant's queue for it to pull, as opposed to a config watcher's, which runs here. */
7290
7283
  const queued = (payload) => payload.watcher !== void 0 || payload.sync === true || payload.inbox !== void 0;
7291
- /**
7292
- * A2 dead-letters an event after 10 failures, and a dead letter stops its
7293
- * lane, which is the thread's: the watcher would never run on that thread
7294
- * again. So `run` gets a few tries, then the failure is recorded and the
7295
- * thread moves on.
7296
- */
7297
- const RUN_ATTEMPTS = 5;
7298
- /**
7299
- * A run that's killed (a timeout, out of memory) never throws. A2 counts it
7300
- * toward the 10 failures when the next attempt takes over, and dead-letters
7301
- * the event at that takeover instead of running it: the 10th attempt is the
7302
- * last one a watcher sees. Throws give up at RUN_ATTEMPTS, so getting this far
7303
- * means runs keep dying, and the 10th records the failure without running.
7304
- */
7305
- const KILLED_ATTEMPTS = 10;
7306
7284
  /** Tries at a wake-up before it's left to the next match or sweep, well short of A2's dead letter. */
7307
7285
  const WAKE_TRIES = 3;
7308
- const describe = (error) => ((error instanceof Error ? error.message : String(error)) || "unknown error").slice(0, 500);
7309
- /**
7310
- * One match, on its thread's lane: `run`, retried by A2 while it fails, then
7311
- * given up on (recorded as `watch.failed`) so the thread's next event runs.
7312
- */
7313
- async function runMatch(input) {
7314
- const { watcher, match, attempt } = input;
7315
- const event = match.payload.event;
7316
- const giveUp = async (error) => {
7317
- console.error(`[board] watcher ${watcher.id} gave up on event #${event.cursor} after ${attempt} tries:`, error);
7318
- await input.record({
7319
- matched: match.id,
7320
- thread: match.payload.thread,
7321
- error
7322
- });
7323
- };
7324
- const early = !afterRetry(attempt);
7325
- if (early && attempt >= KILLED_ATTEMPTS) return giveUp(`its run was cut short ${attempt - 1} times (a timeout, or out of memory)`);
7326
- try {
7327
- await watcher.run(event);
7328
- } catch (error) {
7329
- if (!early || attempt < RUN_ATTEMPTS) throw error;
7330
- await giveUp(describe(error));
7331
- }
7332
- }
7333
7286
  /** A watcher writes as `board:watch:<id>`, and its own writes never wake it. */
7334
7287
  const actorOf = (id) => `board:watch:${id}`;
7335
7288
  /** `watch:@<principal>`: everything one registrant's watchers matched, queued for it to pull. */
@@ -7499,7 +7452,7 @@ function createWatchers(options) {
7499
7452
  messages,
7500
7453
  access
7501
7454
  });
7502
- if (watcher.enters ? !entered(match, before, after, messages) : !(watcher.criteria ? match(before) || match(after) : id !== null)) continue;
7455
+ if (!(watcher.criteria ? match(before) || match(after) : id !== null)) continue;
7503
7456
  const key = registration ? `@${registration.owner}/${watcher.id}` : watcher.id;
7504
7457
  const shown = registration ? eventView(event, after, actors, await reads.reader(access, after ? [after] : [])) : view$1 ??= eventView(event, after, actors, OWN_CODE);
7505
7458
  add(registration ? registrantSession(registration.owner) : watchSession(watcher.id), {
@@ -7554,11 +7507,6 @@ function createWatchers(options) {
7554
7507
  if (!reads) throw new Error("watchers used before the board bound them");
7555
7508
  return loadBefore(reads, event, signal);
7556
7509
  }
7557
- /** Didn't match before and does now; a new reply only counts if its thread wasn't already in view. */
7558
- function entered(match, before, after, messages) {
7559
- if (match(before) || !match(after)) return false;
7560
- return !match(before === void 0 && after.re !== null ? messages.byId[after.re] : void 0);
7561
- }
7562
7510
  return {
7563
7511
  server,
7564
7512
  boardConsumer: consumer({
@@ -7820,10 +7768,7 @@ function build(options, binding) {
7820
7768
  let ownHandle = null;
7821
7769
  const post = options.transport?.post ?? publicPost;
7822
7770
  const watchers = createWatchers({
7823
- watch: Object.fromEntries(Object.entries(binding.subscriptions).flatMap(([id, subscription]) => subscription.kind === "tail" ? [[id, {
7824
- tail: subscription.tail,
7825
- when: subscription.when
7826
- }]] : [])),
7771
+ watch: Object.fromEntries(Object.entries(binding.subscriptions).flatMap(([id, subscription]) => subscription.kind === "tail" ? [[id, { tail: subscription.tail }]] : [])),
7827
7772
  run: (id, event, trigger, attempt) => binding.run(id, event, {
7828
7773
  trigger,
7829
7774
  attempt
@@ -8862,12 +8807,12 @@ function build(options, binding) {
8862
8807
  });
8863
8808
  }
8864
8809
  /**
8865
- * Refuses a caller narrowed with `x-board-scope` (a sandboxed agent, say): its principal's
8810
+ * Refuses a caller narrowed with `x-board-can` (a sandboxed agent, say): its principal's
8866
8811
  * watchers are one registration, which its project registers and runs with the token it
8867
8812
  * narrowed. A narrowed pull would take matches from it, and a narrowed register replace it.
8868
8813
  */
8869
8814
  function ownWatchers(principal) {
8870
- if (principal.scope !== void 0) throw forbidden$1("this token is narrowed with x-board-scope: registering and running watchers is its project's job");
8815
+ if (principal.scope !== void 0) throw forbidden$1("this token is narrowed with x-board-can: registering and running watchers is its project's job");
8871
8816
  }
8872
8817
  /**
8873
8818
  * Whether a sync's writes keep the board's record of the platform users they're by (name and
@@ -8880,7 +8825,7 @@ function build(options, binding) {
8880
8825
  /**
8881
8826
  * The caller, when it may sync somewhere: what every sync route needs. `records`: what it does
8882
8827
  * keeps sync's records (imports, receipts, its inbox, links), which only an integration does,
8883
- * never a caller narrowed with `x-board-scope`.
8828
+ * never a caller narrowed with `x-board-can`.
8884
8829
  */
8885
8830
  async function needSync(caller, what, records = false) {
8886
8831
  const identity = await identityOf(caller);
@@ -8889,12 +8834,12 @@ function build(options, binding) {
8889
8834
  return identity;
8890
8835
  }
8891
8836
  /**
8892
- * Refuses a caller narrowed with `x-board-scope` what its principal's sync does: a platform
8837
+ * Refuses a caller narrowed with `x-board-can` what its principal's sync does: a platform
8893
8838
  * thread or message it claimed for a channel in its scope would bring that sync's later events
8894
8839
  * there, from wherever on the platform they are.
8895
8840
  */
8896
8841
  function unnarrowed(principal, what) {
8897
- if (principal.scope !== void 0) throw forbidden$1(`this token is narrowed with x-board-scope, so it can't ${what}: that's its project's sync's job`);
8842
+ if (principal.scope !== void 0) throw forbidden$1(`this token is narrowed with x-board-can, so it can't ${what}: that's its project's sync's job`);
8898
8843
  }
8899
8844
  /**
8900
8845
  * Refuses a platform origin an import can't have. Sync's records map each platform thread and
@@ -9168,10 +9113,10 @@ function local(options = {}) {
9168
9113
  opening ??= (async () => {
9169
9114
  const file = localFile(bound.name);
9170
9115
  let store;
9171
- if (options.memory) store = (await import("./memory-DqwXlyK4.mjs")).memory();
9116
+ if (options.memory) store = (await import("./memory-DkoqhxIH.mjs")).memory();
9172
9117
  else {
9173
9118
  const { mkdir } = await import("node:fs/promises");
9174
- const { sqlite } = await import("./sqlite-DvsB8ENQ.mjs");
9119
+ const { sqlite } = await import("./sqlite-CAwNHbQD.mjs");
9175
9120
  const path = join(dir, `${file}.db`);
9176
9121
  try {
9177
9122
  await mkdir(dir, {
@@ -1,12 +1,12 @@
1
1
  import { _ as fileSize, m as DIRECT_UPLOAD_BYTES_MAX, u as BoardError } from "./errors-rYDxZEuN.mjs";
2
- import { d as MESSAGE_TEXT_MAX, r as AttachmentId } from "./schemas-BG205xds.mjs";
3
- import { h as VERSION, s as withMentions } from "./targets-Dk_xgS9q.mjs";
2
+ import { f as MESSAGE_TEXT_MAX, r as AttachmentId } from "./schemas-AZkxk06N.mjs";
3
+ import { c as withMentions, g as VERSION } from "./targets-B4Uikw0J.mjs";
4
4
  import { n as displayEmoji, r as normalizeEmoji } from "./emoji-CTLpvH-A.mjs";
5
- import { r as PERMISSIONS, u as parseScope } from "./access-BsP0hvcC.mjs";
6
- import { i as isApiMessageId, n as isBoardName } from "./exports-Ck4Xu3OV.mjs";
7
- import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-BLtqSwha.mjs";
8
- import { a as http, c as handFetch, f as vercelProjectFile, i as vercel, l as handLogin, n as credentialSource, o as boardUrl, r as handTeam, s as connect, t as board } from "./server-CS-1aeTl.mjs";
9
- import { t as conformance } from "./conformance-CKrwglzA.mjs";
5
+ import { r as PERMISSIONS, u as parseCan } from "./access-CVkjSfxj.mjs";
6
+ import { i as isApiMessageId, n as isBoardName } from "./exports-BsfcChdp.mjs";
7
+ import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-BLS7erNu.mjs";
8
+ import { a as vercel, c as connect, i as handTeam, l as handFetch, n as credentialSource, o as http, p as vercelProjectFile, r as credentialed, s as boardUrl, t as board, u as handLogin } from "./server-Cc3nYq3H.mjs";
9
+ import { t as conformance } from "./conformance-qJF96jZI.mjs";
10
10
  import { t as displayText } from "./bots-CGkO76qH.mjs";
11
11
  import { spawn } from "node:child_process";
12
12
  import { readFile, stat, writeFile } from "node:fs/promises";
@@ -1293,7 +1293,7 @@ function trustId(what, value) {
1293
1293
  return value;
1294
1294
  }
1295
1295
  /**
1296
- * A token's `--can`, as `x-board-scope` writes it (`dev/=read,post;ci/=read`), repeated or
1296
+ * A token's `--can`, as `x-board-can` writes it (`dev/=read,post;ci/=read`), repeated or
1297
1297
  * `;`-joined, with `none` for no permissions, as `all` is every one: `*=all;security/=none` closes a
1298
1298
  * subtree. `security/=` means the same. The board takes an empty list, so `none` never leaves the CLI.
1299
1299
  */
@@ -1306,9 +1306,9 @@ function canFlag(values) {
1306
1306
  return permissions[0] === "none" ? entry.slice(0, at + 1) : entry;
1307
1307
  }).join(";");
1308
1308
  try {
1309
- return parseScope(scope);
1309
+ return parseCan(scope, "--can");
1310
1310
  } catch (error) {
1311
- throw usage(`${error.message.replace(/x-board-scope/g, "--can").replace(/, or all$/, ", all, or none")}.`);
1311
+ throw usage(`${error.message.replace(/, or all$/, ", all, or none")}.`);
1312
1312
  }
1313
1313
  }
1314
1314
  /** What a grant's flags say, or the misuse in them. */
@@ -1492,7 +1492,8 @@ function failureOf(error) {
1492
1492
  }]);
1493
1493
  case "board_name_taken": return own("conflict", "board_name_taken");
1494
1494
  case "board_not_granted": return own("permission", "board_not_granted");
1495
- case "board_token_unsupported": return own("permission", "board_token_unsupported");
1495
+ case "watchers_need_project": return own("permission", "watchers_need_project");
1496
+ case "unsupported_principal": return own(status === 403 ? "permission" : "usage", "unsupported_principal");
1496
1497
  case "board_token_scope": return own("permission", "board_token_scope");
1497
1498
  case "invalid_board_name": return own("usage", "invalid_arguments", [helpRecovery()]);
1498
1499
  case "too_many_redirects": return own("network", "network_error");
@@ -1649,7 +1650,7 @@ function connection(url = flags.url, options = {}) {
1649
1650
  const board$1 = board({
1650
1651
  backend: vercel({
1651
1652
  ...team !== void 0 ? { team } : {},
1652
- ...sending(options.token)
1653
+ ...sending(options.token, options.can)
1653
1654
  }),
1654
1655
  ...name !== void 0 ? {
1655
1656
  name,
@@ -1668,7 +1669,7 @@ function connection(url = flags.url, options = {}) {
1668
1669
  if (onVercel) {
1669
1670
  const board$3 = board({ backend: vercel({
1670
1671
  ...onVercel,
1671
- ...sending(options.token)
1672
+ ...sending(options.token, options.can)
1672
1673
  }) });
1673
1674
  return {
1674
1675
  url: at,
@@ -1679,7 +1680,8 @@ function connection(url = flags.url, options = {}) {
1679
1680
  const handle = options.handle ?? flags.handle;
1680
1681
  const transport = connect(at, {
1681
1682
  ...options.token !== void 0 ? { token: options.token } : {},
1682
- ...handle ? { handle } : {}
1683
+ ...handle ? { handle } : {},
1684
+ ...options.can !== void 0 ? { fetch: narrowing(options.can) } : {}
1683
1685
  });
1684
1686
  const board$2 = board({ backend: http(at, { fetch: transport.fetch }) });
1685
1687
  return {
@@ -1719,14 +1721,26 @@ function boardNameFlag(url, team) {
1719
1721
  if (!isBoardName(given)) throw usage(`${from} ${given} isn't a board's name: one is 1 to 64 characters.`);
1720
1722
  return given;
1721
1723
  }
1722
- /** For Vercel's API, `token` in place of your own credentials: a board token's secret. */
1723
- function sending(token) {
1724
- if (token === void 0) return {};
1725
- return { fetch: (input, init) => {
1724
+ /** For Vercel's API, `token` in place of your own credentials (a board token's secret), and `can` narrowing them. */
1725
+ function sending(token, can) {
1726
+ if (token === void 0 && can === void 0) return {};
1727
+ return { fetch: (input, init = {}) => {
1728
+ const headers = new Headers(init.headers ?? (input instanceof Request ? input.headers : void 0));
1729
+ if (token !== void 0) headers.set("authorization", `Bearer ${token}`);
1730
+ if (can !== void 0) headers.set("x-board-can", can);
1731
+ return (token === void 0 ? credentialed() : globalThis.fetch)(input, {
1732
+ ...init,
1733
+ headers
1734
+ });
1735
+ } };
1736
+ }
1737
+ /** A fetch that narrows what a board on HTTP lets its credentials do to `can`, as a proxy holding them would. */
1738
+ function narrowing(can) {
1739
+ return (input, init) => {
1726
1740
  const request = new Request(input, init);
1727
- request.headers.set("authorization", `Bearer ${token}`);
1741
+ request.headers.set("x-board-can", can);
1728
1742
  return globalThis.fetch(request);
1729
- } };
1743
+ };
1730
1744
  }
1731
1745
  /** A handle on the board this command talks to: `vb()`'s, as `--as` says, or the one `connection()` finds. */
1732
1746
  function client() {
@@ -1860,9 +1874,11 @@ async function run(command, args) {
1860
1874
  });
1861
1875
  const tokenUrl = io.board ? void 0 : connection().url === null ? (await client().discovery()).url : flags.url;
1862
1876
  const withToken = io.board ? {} : { withToken: (secret) => connection(tokenUrl, { token: secret }).board };
1877
+ const withCan = io.board ? {} : { withCan: (can) => connection(void 0, { can }).board };
1863
1878
  const report = await conformance(client(), {
1864
1879
  ...flags.channel ? { channel: flags.channel } : {},
1865
- ...withToken
1880
+ ...withToken,
1881
+ ...withCan
1866
1882
  });
1867
1883
  if (flags.json) result(report);
1868
1884
  else out(formatConformance(report));
@@ -2078,21 +2094,11 @@ async function run(command, args) {
2078
2094
  principals,
2079
2095
  can
2080
2096
  });
2081
- const unsigned = principals.some((principal) => principal.kind === "github" || principal.kind === "oidc") && vercelBoard((await client().discovery()).url) !== null;
2082
- const note = "Vercel's board doesn't sign in GitHub or OIDC callers yet: this grant works once it does";
2083
- if (flags.json) {
2084
- if (unsigned) warnings.push({
2085
- reason: "callers_not_signed_in",
2086
- message: note
2087
- });
2088
- result({
2089
- grant,
2090
- outcome: "created"
2091
- });
2092
- } else {
2093
- out(`created ${grantRow(grant)}`);
2094
- if (unsigned) out(`note ${note}`);
2095
- }
2097
+ if (flags.json) result({
2098
+ grant,
2099
+ outcome: "created"
2100
+ });
2101
+ else out(`created ${grantRow(grant)}`);
2096
2102
  return 0;
2097
2103
  }
2098
2104
  if (verb === "update") {
@@ -2404,6 +2410,7 @@ async function run(command, args) {
2404
2410
  else out(formatEvent(event));
2405
2411
  return 0;
2406
2412
  }
2413
+ case "inspect": return (await import("./inspect-5mkjJYMS.mjs")).inspect(context());
2407
2414
  default: {
2408
2415
  const own = app.commands[command];
2409
2416
  if (own) return own.run(args, context());
@@ -2447,7 +2454,8 @@ const context = () => ({
2447
2454
  portFlag,
2448
2455
  connection,
2449
2456
  client,
2450
- openBrowser
2457
+ openBrowser,
2458
+ ...app.inspectorPage ? { inspectorPage: app.inspectorPage } : {}
2451
2459
  });
2452
2460
  /**
2453
2461
  * Runs board's CLI on `argv` (what follows the command name) as `app`, and answers its exit
@@ -1,6 +1,6 @@
1
- import { r as sqlTables } from "./sql-aetuEBZC.mjs";
1
+ import { r as sqlTables } from "./sql-l3ysn4O5.mjs";
2
2
  import { t as memory$1 } from "./store-memory-CKQVEzXN.mjs";
3
- import { t as sqliteDb } from "./sqlite-db-BPwRoDI7.mjs";
3
+ import { t as sqliteDb } from "./sqlite-db-cm5yhrD-.mjs";
4
4
  //#region src/store/memory.ts
5
5
  /**
6
6
  * A board that lives in memory, for tests: its log in A2's memory store, its
@@ -1,5 +1,5 @@
1
1
  import { t as HttpError } from "./errors-rYDxZEuN.mjs";
2
- import { d as MESSAGE_TEXT_MAX, u as Labels } from "./schemas-BG205xds.mjs";
2
+ import { d as Labels, f as MESSAGE_TEXT_MAX } from "./schemas-AZkxk06N.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("");
@@ -41,6 +41,14 @@ function waitUntil(task) {
41
41
  Reflect.get(globalThis, Symbol.for("@vercel/request-context"))?.get?.()?.waitUntil?.(task);
42
42
  } catch {}
43
43
  }
44
+ /**
45
+ * Whether a run comes after a retry from a dead letter. A2 keeps counting
46
+ * `ctx.attempt` across one, and no earlier run sees an attempt past A2_TRIES:
47
+ * the event is dead by then. board gives up early, and records why, only in an
48
+ * event's first tries; a retried one gets A2's fresh tries, and dead-letters
49
+ * again if they all fail.
50
+ */
51
+ const afterRetry = (attempt) => attempt > 10;
44
52
  //#endregion
45
53
  //#region src/server/middleware.ts
46
54
  /** A write the middleware didn't let through: the API answers 422 with what it responded. */
@@ -100,4 +108,4 @@ async function runMiddleware(middleware, input, commit) {
100
108
  return committed.value;
101
109
  }
102
110
  //#endregion
103
- export { DERIVED_ID as a, keyId as c, waitUntil as i, sha256 as l, MIDDLEWARE_ACTOR as n, derivedId as o, runMiddleware as r, isKeyIdOf as s, DroppedError as t };
111
+ export { waitUntil as a, isKeyIdOf as c, afterRetry as i, keyId as l, MIDDLEWARE_ACTOR as n, DERIVED_ID as o, runMiddleware as r, derivedId as s, DroppedError as t, sha256 as u };
@@ -0,0 +1,2 @@
1
+ import { t as page } from "./page-UsfvSIWc.mjs";
2
+ export { page };
@@ -0,0 +1,30 @@
1
+ import "./digest-DAxy9Ula.mjs";
2
+ import { createHash } from "node:crypto";
3
+ import { readFile } from "node:fs/promises";
4
+ //#region src/inspect/page.ts
5
+ /**
6
+ * Next to the CLI in `dist`, or in `dist` when running from source. Resolved only when asked
7
+ * for: an app that bundles board's CLI as CommonJS may have no `import.meta.url`, and then has
8
+ * none of board's files either.
9
+ */
10
+ function files() {
11
+ try {
12
+ return [new URL("./inspect/app.js", import.meta.url), new URL("../../dist/inspect/app.js", import.meta.url)];
13
+ } catch {
14
+ return [];
15
+ }
16
+ }
17
+ /**
18
+ * The page's script where board is installed, or null when there's none beside it. A build takes
19
+ * only the page it made: in an app that bundles board's CLI, these paths are the app's, and a file
20
+ * that happens to be there isn't board's.
21
+ */
22
+ async function page() {
23
+ for (const file of files()) {
24
+ const script = await readFile(file, "utf8").catch(() => null);
25
+ if (script !== null && createHash("sha256").update(script).digest("hex") === "474e5b11011a75d090694373a67a3bc8e7c9ec162c44786ed0f44c9fc90261b4") return script;
26
+ }
27
+ return null;
28
+ }
29
+ //#endregion
30
+ export { page as t };
@@ -1,4 +1,4 @@
1
- import { $t as ExternalCopy, C as InboxItem, Ct as ThreadsPage, Dt as TokenInput, F as MessagesPage, J as RegistrationView, L as MessagesQueryInput, Mt as UpdateGrantInput, N as Me, Ot as TokenView, P as MessageView, Qt as Actor, S as InboxEntry, St as ThreadView, Tt as ThreadsQueryInput, an as ExternalFile, b as GrantView, bt as SyncedView, d as EventsPage, en as Attachment, et as ScheduleView, ft as SyncFindInput, g as FiltersInput, gt as SyncImportInput, h as Explanation, i as BoardEventView, in as ExternalEvent, it as SourceJoin, j as MatchView, l as Discovery, mt as SyncFindView, nt as SchedulesQueryInput, o as ChannelView, on as ExternalLink, q as RegisterInput, rn as ExternalAuthor, sn as Link, st as SourceRead, vt as SyncReceiptInput, y as GrantInput, yt as SyncThreadView } from "./routes-BpKdMvgX.mjs";
1
+ import { $t as Actor, C as InboxItem, Ct as ThreadsPage, Dt as TokenInput, F as MessagesPage, J as RegistrationView, L as MessagesQueryInput, Mt as UpdateGrantInput, N as Me, Ot as TokenView, P as MessageView, S as InboxEntry, St as ThreadView, Tt as ThreadsQueryInput, an as ExternalAuthor, b as GrantView, bt as SyncedView, cn as ExternalLink, d as EventsPage, en as ExternalCopy, et as ScheduleView, ft as SyncFindInput, g as FiltersInput, gt as SyncImportInput, h as Explanation, i as BoardEventView, it as SourceJoin, j as MatchView, l as Discovery, ln as Link, mt as SyncFindView, nt as SchedulesQueryInput, o as ChannelView, on as ExternalEvent, q as RegisterInput, sn as ExternalFile, st as SourceRead, tn as Attachment, vt as SyncReceiptInput, y as GrantInput, yt as SyncThreadView } from "./routes-BffuaoTX.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/client/client.d.ts
4
4
  /**
@@ -780,8 +780,10 @@ declare function render<E extends ProviderEvent = ProviderEvent>(renderer: Rende
780
780
  * to every channel's function, with `channel` set to that one. A thread the board syncs outside
781
781
  * these channels (someone ran `vb sync` on it) stays synced both ways. A key the platform says
782
782
  * doesn't exist is skipped. While one can't be checked, an event outside the resolved channels
783
- * throws, so it's retried, rather than going past that key's function to the default. A new root
784
- * starts only in the channels that resolved.
783
+ * that it may be (any, for a name; its own, for an ID) throws, so it's retried, rather than
784
+ * going past that key's function to the default. The webhook keeps one an ID may be; one only a
785
+ * name may be, it refuses, so the platform sends it again and nothing off the map is stored. A
786
+ * new root starts only in the channels that resolved.
785
787
  */
786
788
  declare function channels<E extends ProviderEvent = ProviderEvent>(map: Record<string, SyncUnit<E>>): SyncFn<E>;
787
789
  //#endregion
@@ -420,6 +420,8 @@ type BoardEvent<K extends keyof BoardEvents & string = keyof BoardEvents & strin
420
420
  }; }[K];
421
421
  //#endregion
422
422
  //#region src/contract/schemas.d.ts
423
+ /** The longest `x-board-can` header the board reads; a schedule keeps its creator's. */
424
+ declare const CAN_MAX = 4000;
423
425
  declare const Labels: z.ZodRecord<z.ZodString, z.ZodString>;
424
426
  /** What an actor is: a `person`, an `agent` acting for a principal (`--as claude`), a deployment, a workflow, or a platform user (`external`). */
425
427
  declare const ActorKind: z.ZodEnum<{
@@ -571,6 +573,14 @@ type WrittenCan = Readonly<Record<ChannelPattern, 'all' | readonly Permission[]>
571
573
  */
572
574
  declare const LEVELS: readonly ['principal', 'group', 'everyone'];
573
575
  type Level = (typeof LEVELS)[number];
576
+ /**
577
+ * `x-board-can`: `dev/=read,post,react,label;ci/=read`. Each entry is a
578
+ * pattern and its permissions (or `all`). It's meant for a proxy that holds the
579
+ * credential, like Pi's sandbox: the board intersects it with the principal's
580
+ * access, so it can only narrow, and a caller holding its own token gains
581
+ * nothing by sending it. `name` is what its errors call it: the CLI's `--can` writes the same.
582
+ */
583
+ declare function parseCan(header: string, name?: string): Can;
574
584
  /** A grant as `checkGrantChange` reads it: whom it names, by kind, and what it gives where. */
575
585
  type GrantShape = {
576
586
  readonly principals: readonly {
@@ -938,10 +948,6 @@ declare const REGISTERED_WATCHERS_MAX = 32;
938
948
  declare const RegisterBody: z.ZodUnion<readonly [z.ZodObject<{
939
949
  watch: z.ZodRecord<z.ZodString, z.ZodObject<{
940
950
  tail: z.ZodString;
941
- when: z.ZodDefault<z.ZodEnum<{
942
- enters: "enters";
943
- matches: "matches";
944
- }>>;
945
951
  }, z.core.$strip>>;
946
952
  sync: z.ZodOptional<z.ZodArray<z.ZodObject<{
947
953
  key: z.ZodString;
@@ -953,10 +959,6 @@ declare const RegisterBody: z.ZodUnion<readonly [z.ZodObject<{
953
959
  }, z.core.$strip>, z.ZodObject<{
954
960
  watch: z.ZodRecord<z.ZodString, z.ZodObject<{
955
961
  tail: z.ZodString;
956
- when: z.ZodDefault<z.ZodEnum<{
957
- enters: "enters";
958
- matches: "matches";
959
- }>>;
960
962
  }, z.core.$strip>>;
961
963
  sync: z.ZodOptional<z.ZodArray<z.ZodObject<{
962
964
  key: z.ZodString;
@@ -1614,7 +1616,6 @@ type RegistrationView = {
1614
1616
  owner: string;
1615
1617
  watch: Record<string, {
1616
1618
  tail: string;
1617
- when: 'matches' | 'enters';
1618
1619
  }>;
1619
1620
  /** Its sync entries. With any, its sync gets every event it delivers to platforms, as matches of watcher `@sync`. */
1620
1621
  sync: {
@@ -2608,10 +2609,6 @@ declare const routes: {
2608
2609
  readonly body: z.ZodUnion<readonly [z.ZodObject<{
2609
2610
  watch: z.ZodRecord<z.ZodString, z.ZodObject<{
2610
2611
  tail: z.ZodString;
2611
- when: z.ZodDefault<z.ZodEnum<{
2612
- enters: "enters";
2613
- matches: "matches";
2614
- }>>;
2615
2612
  }, z.core.$strip>>;
2616
2613
  sync: z.ZodOptional<z.ZodArray<z.ZodObject<{
2617
2614
  key: z.ZodString;
@@ -2623,10 +2620,6 @@ declare const routes: {
2623
2620
  }, z.core.$strip>, z.ZodObject<{
2624
2621
  watch: z.ZodRecord<z.ZodString, z.ZodObject<{
2625
2622
  tail: z.ZodString;
2626
- when: z.ZodDefault<z.ZodEnum<{
2627
- enters: "enters";
2628
- matches: "matches";
2629
- }>>;
2630
2623
  }, z.core.$strip>>;
2631
2624
  sync: z.ZodOptional<z.ZodArray<z.ZodObject<{
2632
2625
  key: z.ZodString;
@@ -2663,4 +2656,4 @@ declare const routes: {
2663
2656
  };
2664
2657
  type RouteName = keyof typeof routes;
2665
2658
  //#endregion
2666
- export { ScheduleInput as $, ExternalCopy as $t, LinkedQuery as A, TypingResult as At, PostInput as B, FULL_ACCESS as Bt, InboxItem as C, ThreadsPage as Ct, LABEL_CONDITIONS_MAX as D, TokenInput as Dt, InboxQuery as E, TokenBody as Et, MessagesPage as F, routes as Ft, Ref as G, InvalidCan as Gt, PrincipalView as H, GrantChange as Ht, MessagesQuery as I, Access as It, RegistrationView as J, WrittenCan as Jt, RegisterBody as K, Level as Kt, MessagesQueryInput as L, AccessSummary as Lt, MatchesQuery as M, UpdateGrantInput as Mt, Me as N, UploadStartBody as Nt, LabelBody as O, TokenView as Ot, MessageView as P, UploadTicket as Pt, ScheduleBodyOutput as Q, Actor as Qt, ParsedFilters as R, Can as Rt, InboxEntry as S, ThreadView as St, InboxPushBody as T, ThreadsQueryInput as Tt, REGISTERED_WATCHERS_MAX as U, GrantChangeRefusal as Ut, PrincipalInput as V, Grant as Vt, ReactBody as W, GrantShape as Wt, RouteName as X, compileAccess as Xt, ResolvedSyncTarget as Y, checkGrantChange as Yt, ScheduleBody as Z, union as Zt, GrantBody as _, SyncReceiptBody as _t, CanAt as a, ExternalFile as an, SourceJoinBody as at, GrantView as b, SyncedView as bt, DeleteBody as c, SourceReadQuery as ct, EventsPage as d, SyncCopiesView as dt, Attachment as en, ScheduleView as et, EventsQuery as f, SyncFindInput as ft, FiltersInput as g, SyncImportInput as gt, Explanation as h, SyncImportBody as ht, BoardEventView as i, ExternalEvent as in, SourceJoin as it, MatchView as j, UpdateGrantBody as jt, LinkView as k, TypingBody as kt, Discovery as l, SyncBody as lt, ExplainQuery as m, SyncFindView as mt, ActorView as n, Labels as nn, SchedulesQueryInput as nt, ChannelView as o, ExternalLink as on, SourceMessage as ot, EventsQueryInput as p, SyncFindQuery as pt, RegisterInput as q, Permission as qt, ApiError as r, ExternalAuthor as rn, SchedulesQueryOutput as rt, CreateChannelBody as s, Link as sn, SourceRead as st, AckBody as t, Author as tn, SchedulesQuery as tt, EditBody as u, SyncCopiesQuery as ut, GrantCan as v, SyncReceiptInput as vt, InboxNextQuery as w, ThreadsQuery as wt, InboxAckBody as x, ThreadSummaryView as xt, GrantInput as y, SyncThreadView as yt, PostBody as z, ChannelPattern as zt };
2659
+ export { ScheduleInput as $, Actor as $t, LinkedQuery as A, TypingResult as At, PostInput as B, FULL_ACCESS as Bt, InboxItem as C, ThreadsPage as Ct, LABEL_CONDITIONS_MAX as D, TokenInput as Dt, InboxQuery as E, TokenBody as Et, MessagesPage as F, routes as Ft, Ref as G, InvalidCan as Gt, PrincipalView as H, GrantChange as Ht, MessagesQuery as I, Access as It, RegistrationView as J, WrittenCan as Jt, RegisterBody as K, Level as Kt, MessagesQueryInput as L, AccessSummary as Lt, MatchesQuery as M, UpdateGrantInput as Mt, Me as N, UploadStartBody as Nt, LabelBody as O, TokenView as Ot, MessageView as P, UploadTicket as Pt, ScheduleBodyOutput as Q, union as Qt, ParsedFilters as R, Can as Rt, InboxEntry as S, ThreadView as St, InboxPushBody as T, ThreadsQueryInput as Tt, REGISTERED_WATCHERS_MAX as U, GrantChangeRefusal as Ut, PrincipalInput as V, Grant as Vt, ReactBody as W, GrantShape as Wt, RouteName as X, compileAccess as Xt, ResolvedSyncTarget as Y, checkGrantChange as Yt, ScheduleBody as Z, parseCan as Zt, GrantBody as _, SyncReceiptBody as _t, CanAt as a, ExternalAuthor as an, SourceJoinBody as at, GrantView as b, SyncedView as bt, DeleteBody as c, ExternalLink as cn, SourceReadQuery as ct, EventsPage as d, SyncCopiesView as dt, ExternalCopy as en, ScheduleView as et, EventsQuery as f, SyncFindInput as ft, FiltersInput as g, SyncImportInput as gt, Explanation as h, SyncImportBody as ht, BoardEventView as i, Labels as in, SourceJoin as it, MatchView as j, UpdateGrantBody as jt, LinkView as k, TypingBody as kt, Discovery as l, Link as ln, SyncBody as lt, ExplainQuery as m, SyncFindView as mt, ActorView as n, Author as nn, SchedulesQueryInput as nt, ChannelView as o, ExternalEvent as on, SourceMessage as ot, EventsQueryInput as p, SyncFindQuery as pt, RegisterInput as q, Permission as qt, ApiError as r, CAN_MAX as rn, SchedulesQueryOutput as rt, CreateChannelBody as s, ExternalFile as sn, SourceRead as st, AckBody as t, Attachment as tn, SchedulesQuery as tt, EditBody as u, SyncCopiesQuery as ut, GrantCan as v, SyncReceiptInput as vt, InboxNextQuery as w, ThreadsQuery as wt, InboxAckBody as x, ThreadSummaryView as xt, GrantInput as y, SyncThreadView as yt, PostBody as z, ChannelPattern as zt };
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  const MESSAGE_TEXT_MAX = 1e4;
3
- /** The longest `x-board-scope` header the board reads; a schedule keeps its creator's. */
4
- const SCOPE_MAX = 4e3;
3
+ /** The longest `x-board-can` header the board reads; a schedule keeps its creator's. */
4
+ const CAN_MAX = 4e3;
5
5
  const segment = "[a-z0-9][a-z0-9_-]*";
6
6
  /** `errors-www`, `www/production`: lowercase segments joined by `/`. */
7
7
  const ChannelPath = z.string().max(80).regex(new RegExp(`^${segment}(?:/${segment})*$`), "invalid channel path");
@@ -69,4 +69,4 @@ const Attachment = z.object({
69
69
  /** A registered watcher's ID: a profile name, since its writes are by that profile. */
70
70
  const RemoteWatcherId = z.string().regex(/^[A-Za-z][A-Za-z0-9-]{0,31}$/, "ids start with a letter and use up to 32 letters, numbers, and hyphens");
71
71
  //#endregion
72
- export { actorKind as _, ChannelPath as a, toStorable as b, LabelKey as c, MESSAGE_TEXT_MAX as d, MessageId as f, SeenActorKind as g, SCOPE_MAX as h, Author as i, LabelValue as l, RemoteWatcherId as m, Attachment as n, Emoji as o, MessageText as p, AttachmentId as r, Handle as s, ActorId as t, Labels as u, platformAvatar as v, storable as y };
72
+ export { actorKind as _, CAN_MAX as a, toStorable as b, Handle as c, Labels as d, MESSAGE_TEXT_MAX as f, SeenActorKind as g, RemoteWatcherId as h, Author as i, LabelKey as l, MessageText as m, Attachment as n, ChannelPath as o, MessageId as p, AttachmentId as r, Emoji as s, ActorId as t, LabelValue as u, platformAvatar as v, storable as y };
@@ -1,7 +1,7 @@
1
1
  import { u as BoardError } from "./errors-rYDxZEuN.mjs";
2
- import { t as board, u as localTokenFile } from "./server-CS-1aeTl.mjs";
3
- import { t as oidcTokens } from "./tokens-Dn4cPZIr.mjs";
4
- import { t as local } from "./local-DJ_qI9q7.mjs";
2
+ import { d as localTokenFile, t as board } from "./server-Cc3nYq3H.mjs";
3
+ import { t as oidcTokens } from "./tokens-DA9ipsZ-.mjs";
4
+ import { t as local } from "./local-Bo3XzEKB.mjs";
5
5
  import { mkdir, rename, rm, stat, writeFile } from "node:fs/promises";
6
6
  import { userInfo } from "node:os";
7
7
  import { dirname, join, resolve } from "node:path";