@vercel/board 0.41.0 → 0.42.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 (44) hide show
  1. package/dist/{access-C5HaO42b.mjs → access-BgBiaCyx.mjs} +1 -1
  2. package/dist/access.mjs +4 -4
  3. package/dist/{actors-nrOf7Y7z.mjs → actors-DkZsnMgA.mjs} +2 -2
  4. package/dist/{auth-DAlYi6TN.mjs → auth-Ft4AJptx.mjs} +2 -2
  5. package/dist/{backend-CYsTLxtP.d.mts → backend-DMrK55mU.d.mts} +22 -3
  6. package/dist/backend-local.d.mts +1 -1
  7. package/dist/backend-local.mjs +1 -1
  8. package/dist/cli-embedded.d.mts +9 -4
  9. package/dist/cli-embedded.mjs +7 -5
  10. package/dist/cli.mjs +4 -4
  11. package/dist/{conformance-ClxEEZ9C.mjs → conformance-BORt5nky.mjs} +2 -2
  12. package/dist/conformance.d.mts +1 -1
  13. package/dist/conformance.mjs +1 -1
  14. package/dist/digest-CKC0Rmy1.mjs +4 -0
  15. package/dist/{engine-8BcNeckB.mjs → engine-BVHSH2Kn.mjs} +2 -2
  16. package/dist/{errors-DcQf5WeM.mjs → errors-DUzpDSrJ.mjs} +3 -0
  17. package/dist/{exports-B6udRV_E.mjs → exports-BfNXPHN_.mjs} +133 -36
  18. package/dist/exports-Bw_OYNRl.d.mts +4 -0
  19. package/dist/{index-fcpEFCTR.d.mts → index-CydxnBND.d.mts} +2 -2
  20. package/dist/index.d.mts +3 -3
  21. package/dist/index.mjs +4 -4
  22. package/dist/index.node.d.mts +3 -3
  23. package/dist/index.node.mjs +3 -3
  24. package/dist/inspect/app.js +40 -40
  25. package/dist/{inspect-DPRoC_Gg.mjs → inspect-CniRRiJ2.mjs} +4 -4
  26. package/dist/inspect-HlHh7OXa.mjs +2 -0
  27. package/dist/{local-B9y4p6N7.mjs → local-CWLPYoiY.mjs} +23 -7
  28. package/dist/{main-S0A-c_kP.mjs → main-aVEEoc60.mjs} +45 -8
  29. package/dist/{middleware-DHdrxmoc.mjs → middleware-0DUFrav-.mjs} +1 -1
  30. package/dist/{origin-B3m2lnZC.mjs → origin-DAyYeDuW.mjs} +3 -3
  31. package/dist/{page-2jjHZmIW.mjs → page-BD6ygU49.mjs} +2 -2
  32. package/dist/page-BiJVe-7R.mjs +2 -0
  33. package/dist/{serve-B15I2Ibf.mjs → serve-BnBqi0sw.mjs} +4 -4
  34. package/dist/{server-DgpRZ4Nu.mjs → server-Bcpkt6TS.mjs} +14 -13
  35. package/dist/{serving-CALKWs9K.mjs → serving-hcxzaCCO.mjs} +1 -1
  36. package/dist/{tokens-D7_ZIWpX.mjs → tokens-BSMpTPEe.mjs} +2 -2
  37. package/docs/01-board/09-access.md +4 -1
  38. package/docs/04-reference/01-cli.md +7 -3
  39. package/docs/04-reference/02-board.md +18 -1
  40. package/package.json +1 -1
  41. package/dist/digest-Dna1CGa_.mjs +0 -4
  42. package/dist/exports-C8zsIL1A.d.mts +0 -4
  43. package/dist/inspect-BsF3mYMY.mjs +0 -2
  44. package/dist/page-CAUe4GmQ.mjs +0 -2
@@ -1,4 +1,4 @@
1
- import { a as forbidden } from "./errors-DcQf5WeM.mjs";
1
+ import { a as forbidden } from "./errors-DUzpDSrJ.mjs";
2
2
  import { a as CAN_MAX, o as ChannelPath } from "./schemas-DAzSsgWk.mjs";
3
3
  //#region src/server/access.ts
4
4
  /**
package/dist/access.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as CAN_MAX } from "./schemas-DAzSsgWk.mjs";
2
- import { c as compileAccess, f as union, n as InvalidCan, o as checkGrantChange, t as FULL_ACCESS, u as parseCan } from "./access-C5HaO42b.mjs";
3
- import { C as explainGrants, t as DEFAULT_CAN, w as grantAccess } from "./auth-DAlYi6TN.mjs";
4
- import { a as resolveActor } from "./actors-nrOf7Y7z.mjs";
5
- import { t as oidcTokens } from "./tokens-D7_ZIWpX.mjs";
2
+ import { c as compileAccess, f as union, n as InvalidCan, o as checkGrantChange, t as FULL_ACCESS, u as parseCan } from "./access-BgBiaCyx.mjs";
3
+ import { C as explainGrants, t as DEFAULT_CAN, w as grantAccess } from "./auth-Ft4AJptx.mjs";
4
+ import { a as resolveActor } from "./actors-DkZsnMgA.mjs";
5
+ import { t as oidcTokens } from "./tokens-BSMpTPEe.mjs";
6
6
  export { CAN_MAX, DEFAULT_CAN, FULL_ACCESS, InvalidCan, checkGrantChange, compileAccess, explainGrants, grantAccess, oidcTokens, parseCan, resolveActor, union };
@@ -1,6 +1,6 @@
1
- import { m as parseProfileHeader, r as badRequest } from "./errors-DcQf5WeM.mjs";
1
+ import { m as parseProfileHeader, r as badRequest } from "./errors-DUzpDSrJ.mjs";
2
2
  import { x as toStorable } from "./schemas-DAzSsgWk.mjs";
3
- import { u as parseCan } from "./access-C5HaO42b.mjs";
3
+ import { u as parseCan } from "./access-BgBiaCyx.mjs";
4
4
  import { t as own } from "./own-OwgPWdmh.mjs";
5
5
  //#region src/server/actors.ts
6
6
  /** Agents whose marks the board serves at `/avatars/<name>`, for a caller to pass as an avatar. */
@@ -1,5 +1,5 @@
1
- import { a as forbidden, l as unauthorized, r as badRequest, t as HttpError } from "./errors-DcQf5WeM.mjs";
2
- import { c as compileAccess, l as decide, p as writtenCan, s as combine, t as FULL_ACCESS, u as parseCan } from "./access-C5HaO42b.mjs";
1
+ import { a as forbidden, l as unauthorized, r as badRequest, t as HttpError } from "./errors-DUzpDSrJ.mjs";
2
+ import { c as compileAccess, l as decide, p as writtenCan, s as combine, t as FULL_ACCESS, u as parseCan } from "./access-BgBiaCyx.mjs";
3
3
  //#region src/server/grants.ts
4
4
  /**
5
5
  * How close `principal` is to the caller, or null when it doesn't name it: `principal` for its own
@@ -633,9 +633,12 @@ type Board = BoardClient & {
633
633
  fetch(request: Request): Promise<Response>;
634
634
  /**
635
635
  * The handle, acting with `profile`: `<principal>+<profile>` over HTTP, `board:client:<profile>`
636
- * on `local()`. `null` acts as yourself, outside any agent session.
636
+ * on `local()`. `null` acts as yourself, outside any agent session. With `can`, the board holds
637
+ * every call it makes to that, as it holds a sandbox to its policy's `x-board-can`: an agent's tool
638
+ * that runs `vb()` on `team.as('fixer', { can: ['read', 'post'] })` can't read sync's inbox or
639
+ * change grants. A narrowed handle's own `as()` and `sandboxPolicy()` stay inside its `can`.
637
640
  */
638
- as(profile: ProfileOption): Board;
641
+ as(profile: ProfileOption, options?: AsOptions): Board;
639
642
  /**
640
643
  * A Vercel Sandbox network policy that hands this board, and nothing else, to a sandboxed agent:
641
644
  * `Sandbox.create({ networkPolicy })` takes it. The sandbox's proxy adds the credential (this
@@ -647,6 +650,16 @@ type Board = BoardClient & {
647
650
  */
648
651
  sandboxPolicy(options?: SandboxPolicyOptions): Promise<SandboxPolicy>;
649
652
  };
653
+ /** What `as()` takes beside the profile. */
654
+ type AsOptions = {
655
+ /**
656
+ * What the handle may do at most, as `x-board-can` narrows a request: a `can` (`{ 'dev/': ['read',
657
+ * 'post'] }`, `['read']`) or its header form (`dev/=read,post`). It only narrows what this
658
+ * deployment may do, and what the handle it's called on may: never sync's records, watchers'
659
+ * registrations, or what `manage` does unless it says so. Without one, the handle's own.
660
+ */
661
+ can?: Can | string;
662
+ };
650
663
  /** A board on a backend you pass, which says how it reaches the board itself. */
651
664
  type BackendOptions = {
652
665
  /**
@@ -702,6 +715,12 @@ type SelfCaller = {
702
715
  * the profile `BOARD_PROFILE` names.
703
716
  */
704
717
  profile?: ProfileOption;
718
+ /**
719
+ * What `as(profile, { can })` narrowed the handle to, as `x-board-can` writes it
720
+ * (`dev/=read,post`): each backend holds the call to it as a request narrowed with that header
721
+ * is, so it never widens. Absent on a handle nothing narrowed, and on the board's own code.
722
+ */
723
+ can?: string;
705
724
  origin: WriteOrigin;
706
725
  };
707
726
  /** Who's calling a backend's method: one board() verified, or this deployment's own code. Every method honors what it may do. */
@@ -872,4 +891,4 @@ interface Backend extends ProtocolMethods {
872
891
  bind(board: BoardBinding): void;
873
892
  }
874
893
  //#endregion
875
- export { Protocol as C, SandboxPolicyOptions as D, SandboxPolicy as E, SandboxRule as O, Method as S, SandboxMatcher as T, MiddlewareContext as _, Identity as a, WriteSource as b, SelfCaller as c, Board as d, BoardOptions as f, Middleware as g, DroppedError as h, Caller as i, Subscription as l, WatcherContext as m, BackendRoute as n, InboxDelivery as o, Watcher as p, BoardBinding as r, ProtocolMethods as s, Backend as t, VerifiedCaller as u, Write as v, SandboxMatch as w, HttpError as x, WritePatch as y };
894
+ export { Method as C, SandboxPolicy as D, SandboxMatcher as E, SandboxPolicyOptions as O, HttpError as S, SandboxMatch as T, Middleware as _, Identity as a, WritePatch as b, SelfCaller as c, AsOptions as d, Board as f, DroppedError as g, WatcherContext as h, Caller as i, SandboxRule as k, Subscription as l, Watcher as m, BackendRoute as n, InboxDelivery as o, BoardOptions as p, BoardBinding as r, ProtocolMethods as s, Backend as t, VerifiedCaller as u, MiddlewareContext as v, Protocol as w, WriteSource as x, Write as y };
@@ -1,4 +1,4 @@
1
- import { t as Backend } from "./backend-CYsTLxtP.mjs";
1
+ import { t as Backend } from "./backend-DMrK55mU.mjs";
2
2
  //#region src/server/local.d.ts
3
3
  type LocalOptions = {
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { t as local } from "./local-B9y4p6N7.mjs";
1
+ import { t as local } from "./local-CWLPYoiY.mjs";
2
2
  export { local };
@@ -1,5 +1,5 @@
1
- import { d as Board } from "./backend-CYsTLxtP.mjs";
2
- import "./index-fcpEFCTR.mjs";
1
+ import { f as Board } from "./backend-DMrK55mU.mjs";
2
+ import "./index-CydxnBND.mjs";
3
3
  //#region src/cli/failure.d.ts
4
4
  /**
5
5
  * What kind of failure it is, which fixes the exit code: 2 for `usage` and `missing_input`, 130
@@ -101,7 +101,11 @@ export type VbOptions = {
101
101
  writeFile?: (path: string, data: Uint8Array) => Promise<void> | PromiseLike<void>;
102
102
  /** The text `-` reads, as stdin would hold it. */
103
103
  stdin?: string;
104
- /** Stops `tail` and `wait`, as Ctrl-C does. */
104
+ /**
105
+ * Ends the command and its requests: `tail` and `wait` as Ctrl-C does (0), any other with a
106
+ * failure, 1 when it's `AbortSignal.timeout()`'s and 130 otherwise. A write it stopped may have
107
+ * landed. Every request ends, whether or not the backend heeds it, on a handle `board()` made.
108
+ */
105
109
  signal?: AbortSignal;
106
110
  /** Commands this caller doesn't run, which answer 2: `['tail', 'wait']` for an agent's tool. */
107
111
  refuse?: string[];
@@ -117,7 +121,8 @@ export type VbResult = {
117
121
  * process, and returns what the CLI would print. `board` already says which board and who, so
118
122
  * `--url` doesn't apply, and the commands about your machine (`whoami`, `identity`,
119
123
  * `hooks`, `serve`, `inspect`) answer 2. Calls run one at a time, in order, so
120
- * `tail` and `wait`, which hold the rest until they end, need `options.signal`.
124
+ * `tail` and `wait`, which hold the rest until they end, need `options.signal`; it bounds any
125
+ * other call too: `{ signal: AbortSignal.timeout(30_000) }`.
121
126
  */
122
127
  export declare function vb(board: Board, argv: string[], options?: VbOptions): Promise<VbResult>;
123
128
  //#endregion
@@ -1,6 +1,7 @@
1
- import { h as VERSION } from "./origin-B3m2lnZC.mjs";
2
- import { a as commandLine, c as failureLines, i as mainWith, l as formatFailure, n as commandWord, o as exitCode, r as main, s as failureDocument, t as Failed } from "./main-S0A-c_kP.mjs";
3
- import { t as PAGE_SHA256 } from "./digest-Dna1CGa_.mjs";
1
+ import { h as VERSION } from "./origin-DAyYeDuW.mjs";
2
+ import { r as stoppedBy } from "./exports-BfNXPHN_.mjs";
3
+ import { a as commandLine, c as failureLines, i as mainWith, l as formatFailure, n as commandWord, o as exitCode, r as main, s as failureDocument, t as Failed } from "./main-aVEEoc60.mjs";
4
+ import { t as PAGE_SHA256 } from "./digest-CKC0Rmy1.mjs";
4
5
  //#region src/cli/embedded.ts
5
6
  /**
6
7
  * The inspector's page as this version of board's npm package has it, for an app that bundles
@@ -67,7 +68,8 @@ let queue = Promise.resolve();
67
68
  * process, and returns what the CLI would print. `board` already says which board and who, so
68
69
  * `--url` doesn't apply, and the commands about your machine (`whoami`, `identity`,
69
70
  * `hooks`, `serve`, `inspect`) answer 2. Calls run one at a time, in order, so
70
- * `tail` and `wait`, which hold the rest until they end, need `options.signal`.
71
+ * `tail` and `wait`, which hold the rest until they end, need `options.signal`; it bounds any
72
+ * other call too: `{ signal: AbortSignal.timeout(30_000) }`.
71
73
  */
72
74
  function vb(board, argv, options = {}) {
73
75
  const word = commandWord(argv);
@@ -90,7 +92,7 @@ function vb(board, argv, options = {}) {
90
92
  name: "board",
91
93
  commands: {}
92
94
  }, {
93
- board,
95
+ board: options.signal && stoppedBy(board, options.signal) || board,
94
96
  write: (chunk) => void (stdout += typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true })),
95
97
  error: (chunk) => void (stderr += chunk),
96
98
  readFile: options.readFile ? async (path) => options.readFile(path) : lacking("--attach and --text-file can't read files", "readFile"),
package/dist/cli.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as option } from "./commands-QRD0U9AQ.mjs";
3
- import { f as projectDir } from "./server-DgpRZ4Nu.mjs";
4
- import { r as main } from "./main-S0A-c_kP.mjs";
5
- import { n as stopped, r as startInspector } from "./inspect-DPRoC_Gg.mjs";
3
+ import { f as projectDir } from "./server-Bcpkt6TS.mjs";
4
+ import { r as main } from "./main-aVEEoc60.mjs";
5
+ import { n as stopped, r as startInspector } from "./inspect-CniRRiJ2.mjs";
6
6
  import { appendFile, readFile } from "node:fs/promises";
7
7
  import { join } from "node:path";
8
8
  //#region src/cli/local.ts
@@ -36,7 +36,7 @@ const local = { serve: {
36
36
  if (args.length > 0) throw usage("serve takes no arguments: pass its port with --port, and its directory with --dir.");
37
37
  const port = portFlag();
38
38
  const root = projectDir();
39
- const { serveLocal } = await import("./serve-B15I2Ibf.mjs");
39
+ const { serveLocal } = await import("./serve-BnBqi0sw.mjs");
40
40
  const local = await serveLocal({
41
41
  dir: flags.dir ?? join(root, ".board"),
42
42
  ...port !== void 0 ? { port } : {}
@@ -1,6 +1,6 @@
1
- import { u as BoardError } from "./errors-DcQf5WeM.mjs";
1
+ import { u as BoardError } from "./errors-DUzpDSrJ.mjs";
2
2
  import { c as canonical, t as block } from "./blocks-CVoBC7ur.mjs";
3
- import { a as canText, c as compileAccess } from "./access-C5HaO42b.mjs";
3
+ import { a as canText, c as compileAccess } from "./access-BgBiaCyx.mjs";
4
4
  //#region src/conformance/index.ts
5
5
  var Mismatch = class extends Error {};
6
6
  const show = (value) => JSON.stringify(value) ?? String(value);
@@ -1,4 +1,4 @@
1
- import { d as Board } from "./backend-CYsTLxtP.mjs";
1
+ import { f as Board } from "./backend-DMrK55mU.mjs";
2
2
  //#region src/conformance/index.d.ts
3
3
  /**
4
4
  * Checks that a board speaks the protocol, through a handle on it (`conformance(board())`), as
@@ -1,2 +1,2 @@
1
- import { t as conformance } from "./conformance-ClxEEZ9C.mjs";
1
+ import { t as conformance } from "./conformance-BORt5nky.mjs";
2
2
  export { conformance };
@@ -0,0 +1,4 @@
1
+ //#region src/inspect/digest.ts
2
+ const PAGE_SHA256 = "f50caced754723432e972aafa252cdb3cb49676ceedc21c762987ed418dac0f6";
3
+ //#endregion
4
+ export { PAGE_SHA256 as t };
@@ -1,8 +1,8 @@
1
- import { _ as IMPORT_BYTES_MAX, h as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, x as typeOf, y as fileSize } from "./errors-DcQf5WeM.mjs";
1
+ import { _ as IMPORT_BYTES_MAX, h as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, x as typeOf, y as fileSize } from "./errors-DUzpDSrJ.mjs";
2
2
  import { f as MESSAGE_TEXT_MAX, o as ChannelPath, x as toStorable } from "./schemas-DAzSsgWk.mjs";
3
3
  import { l as isThreadTarget, s as channelOf } from "./external-DymyhUzl.mjs";
4
4
  import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
5
- import { a as waitUntil, c as platformProfile, f as viaText, i as afterRetry, l as shownName, m as derivedId, o as actorParts, t as DroppedError } from "./middleware-DHdrxmoc.mjs";
5
+ import { a as waitUntil, c as platformProfile, f as viaText, i as afterRetry, l as shownName, m as derivedId, o as actorParts, t as DroppedError } from "./middleware-0DUFrav-.mjs";
6
6
  import { a as replaceMentions, n as isEmail, t as extractMentions } from "./mentions-DfZGp3B-.mjs";
7
7
  import { a as immutable, d as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-BT8y_81j.mjs";
8
8
  import { t as displayText } from "./bots-CGkO76qH.mjs";
@@ -1,3 +1,4 @@
1
+ import { f as MESSAGE_TEXT_MAX } from "./schemas-DAzSsgWk.mjs";
1
2
  import { r as normalizeEmoji } from "./emoji-CTLpvH-A.mjs";
2
3
  import { ZodError } from "zod";
3
4
  //#region src/contract/files.ts
@@ -697,6 +698,7 @@ const badRequest = (message, code = "invalid_request") => new HttpError(400, cod
697
698
  const unauthorized = (message) => new HttpError(401, "unauthorized", message);
698
699
  const forbidden = (message) => new HttpError(403, "forbidden", message);
699
700
  const notFound = (message, code = "not_found") => new HttpError(404, code, message);
701
+ const textTooLong = () => new HttpError(400, "text_too_long", `A message's text is at most ${MESSAGE_TEXT_MAX.toLocaleString("en-US")} characters.`, { hint: "Put the long part in a file and attach it to a message, with a short summary as the text." });
700
702
  const duplicateId = () => new HttpError(409, "duplicate_id", "that id was already used for a different write");
701
703
  const json = (body, status = 200, headers) => new Response(JSON.stringify(body), {
702
704
  status,
@@ -731,6 +733,7 @@ function toErrorResponse(error) {
731
733
  }
732
734
  if (error instanceof ZodError) {
733
735
  const issue = error.issues[0] && reported(error.issues[0]);
736
+ if (issue?.code === "too_big" && issue.origin === "string" && issue.maximum === 1e4 && issue.path.length === 1 && issue.path[0] === "text") return toErrorResponse(textTooLong());
734
737
  const path = issue?.path.length ? `${issue.path.join(".")}: ` : "";
735
738
  return json({ error: {
736
739
  code: "invalid_request",
@@ -1,11 +1,11 @@
1
- import { _ as IMPORT_BYTES_MAX, a as forbidden, b as mediaType, c as toErrorResponse, d as createBoardClient, f as duration, h as ATTACHMENT_BYTES_MAX, l as unauthorized, n as RejectedError, o as json, p as formatProfileHeader, r as badRequest, s as notFound, t as HttpError, u as BoardError, v as fileName } from "./errors-DcQf5WeM.mjs";
1
+ import { _ as IMPORT_BYTES_MAX, a as forbidden, b as mediaType, c as toErrorResponse, d as createBoardClient, f as duration, h as ATTACHMENT_BYTES_MAX, l as unauthorized, n as RejectedError, o as json, p as formatProfileHeader, r as badRequest, s as notFound, t as HttpError, u as BoardError, v as fileName } from "./errors-DUzpDSrJ.mjs";
2
2
  import { h as RemoteWatcherId } from "./schemas-DAzSsgWk.mjs";
3
3
  import { f as schemaId, n as blocksIn, r as findBlocks } from "./blocks-CVoBC7ur.mjs";
4
- import { A as MessagesQuery, B as SyncBody, C as InboxAckBody, D as LabelBody, E as InboxQuery, F as ScheduleBody, G as ThreadsQuery, H as SyncFindQuery, I as SchedulesQuery, J as UploadStartBody, K as TypingBody, L as SchemaBody, M as ReactBody, N as Ref, O as LinkedQuery, P as RegisterBody, R as SourceJoinBody, S as GrantBody, T as InboxPushBody, U as SyncImportBody, V as SyncCopiesQuery, W as SyncReceiptBody, Y as routes, _ as CreateChannelBody, a as compileWatcher, b as EventsQuery, c as METHODS, d as queryObject, f as readCapped, g as AckBody, h as VERSION, i as runMatch, j as PostBody, k as MatchesQuery, l as createRouter, m as SYNC, n as syncTarget, p as readJson, q as UpdateGrantBody, r as canonicalWatchers, t as SYNC_ACTOR, u as openapi, v as DeleteBody, w as InboxNextQuery, x as ExplainQuery, y as EditBody, z as SourceReadQuery } from "./origin-B3m2lnZC.mjs";
5
- import { _ as sha256, a as waitUntil, c as platformProfile, d as userIdOf, m as derivedId, o as actorParts, r as runMiddleware, s as importedHandle, t as DroppedError, u as underPrincipal } from "./middleware-DHdrxmoc.mjs";
6
- import { a as canText, c as compileAccess, d as parsePattern, n as InvalidCan, r as PERMISSIONS, u as parseCan } from "./access-C5HaO42b.mjs";
7
- import { C as explainGrants, b as verifiesTokens, d as grantIssuers, f as hostPrincipal, i as VERCEL_ISSUER, l as createAuthority, t as DEFAULT_CAN$1, u as fromTokens, y as verifiedIssuers } from "./auth-DAlYi6TN.mjs";
8
- import { a as resolveActor, o as viaOf, r as claimsOf, t as KNOWN_AGENTS } from "./actors-nrOf7Y7z.mjs";
4
+ import { A as MessagesQuery, B as SyncBody, C as InboxAckBody, D as LabelBody, E as InboxQuery, F as ScheduleBody, G as ThreadsQuery, H as SyncFindQuery, I as SchedulesQuery, J as UploadStartBody, K as TypingBody, L as SchemaBody, M as ReactBody, N as Ref, O as LinkedQuery, P as RegisterBody, R as SourceJoinBody, S as GrantBody, T as InboxPushBody, U as SyncImportBody, V as SyncCopiesQuery, W as SyncReceiptBody, Y as routes, _ as CreateChannelBody, a as compileWatcher, b as EventsQuery, c as METHODS, d as queryObject, f as readCapped, g as AckBody, h as VERSION, i as runMatch, j as PostBody, k as MatchesQuery, l as createRouter, m as SYNC, n as syncTarget, p as readJson, q as UpdateGrantBody, r as canonicalWatchers, t as SYNC_ACTOR, u as openapi, v as DeleteBody, w as InboxNextQuery, x as ExplainQuery, y as EditBody, z as SourceReadQuery } from "./origin-DAyYeDuW.mjs";
5
+ import { _ as sha256, a as waitUntil, c as platformProfile, d as userIdOf, m as derivedId, o as actorParts, r as runMiddleware, s as importedHandle, t as DroppedError, u as underPrincipal } from "./middleware-0DUFrav-.mjs";
6
+ import { a as canText, c as compileAccess, d as parsePattern, n as InvalidCan, r as PERMISSIONS, t as FULL_ACCESS, u as parseCan } from "./access-BgBiaCyx.mjs";
7
+ import { C as explainGrants, b as verifiesTokens, d as grantIssuers, f as hostPrincipal, i as VERCEL_ISSUER, l as createAuthority, t as DEFAULT_CAN$1, u as fromTokens, y as verifiedIssuers } from "./auth-Ft4AJptx.mjs";
8
+ import { a as resolveActor, o as viaOf, r as claimsOf, t as KNOWN_AGENTS } from "./actors-DkZsnMgA.mjs";
9
9
  import { t as checkValue } from "./data-values-C-Cq80hz.mjs";
10
10
  //#region src/server/registrant.ts
11
11
  /** Registering again this soon after the same registration only repeats it. */
@@ -935,7 +935,8 @@ function createVercel(options, environment) {
935
935
  }
936
936
  const headers = {
937
937
  "content-type": "application/json",
938
- ...apiProfileHeaders(who.profile)
938
+ ...apiProfileHeaders(who.profile),
939
+ ...who.can !== void 0 ? { "x-board-can": who.can } : {}
939
940
  };
940
941
  const repeatable = method !== "POST" && method !== "PATCH" || typeof init.body?.operationId === "string";
941
942
  for (let attempt = 0;; attempt++) {
@@ -1520,6 +1521,14 @@ function createVercel(options, environment) {
1520
1521
  });
1521
1522
  /** The actor `who` writes as: the credentials' principal, and its profile, as the API names it. */
1522
1523
  const actorOf = async (who) => `${principalId((await self(who)).actor.principal)}${who.profile ? `+${who.profile.name.toLowerCase()}` : ""}`;
1524
+ /**
1525
+ * Refuses a handle narrowed with `as(profile, { can })` a source: the platform's app reads and
1526
+ * joins what it can, not what the caller can, so it's this deployment's sync's job, as on a board
1527
+ * of its own.
1528
+ */
1529
+ function ownSources(caller, what) {
1530
+ if ("self" in caller && caller.can !== void 0) throw new HttpError(403, "forbidden", `this handle is narrowed with a can, so it can't ${what}: that's its project's sync's job`);
1531
+ }
1523
1532
  /** Who a caller acts as there: its profile, beside this deployment's credentials. */
1524
1533
  function whoOf(caller) {
1525
1534
  if ("identity" in caller) throw servesNone();
@@ -1534,7 +1543,10 @@ function createVercel(options, environment) {
1534
1543
  };
1535
1544
  if (caller.origin.via?.kind === "client") {
1536
1545
  const asked = "profile" in caller ? caller.profile : caller.self ?? void 0;
1537
- return { profile: named(asked === void 0 ? environment?.profile() ?? null : asked) };
1546
+ return {
1547
+ profile: named(asked === void 0 ? environment?.profile() ?? null : asked),
1548
+ ...caller.can !== void 0 ? { can: caller.can } : {}
1549
+ };
1538
1550
  }
1539
1551
  return { profile: named(caller.self ?? "client") };
1540
1552
  }
@@ -2874,14 +2886,17 @@ function createVercel(options, environment) {
2874
2886
  async typing(caller, { id, status }, signal) {
2875
2887
  if (!binding || binding.sync.length === 0) return { targets: [] };
2876
2888
  const { message, replies } = await methods.message(caller, { id }, signal);
2889
+ if ("self" in caller && caller.can !== void 0 && !compileAccess(parseCan(caller.can)).can("post", message.channel)) throw new HttpError(403, "forbidden", `this handle can't post in ${message.channel}`);
2877
2890
  return { targets: await binding.typing([message, ...replies], status) };
2878
2891
  },
2879
- async readSource(_caller, { key, target, limit, after }) {
2892
+ async readSource(caller, { key, target, limit, after }) {
2880
2893
  if (!binding?.sync.some((entry) => entry.key === key)) throw notFound(`this board doesn't run sync entry ${key}: read it where its sync runs`, "not_synced_here");
2894
+ ownSources(caller, "read a source");
2881
2895
  return binding.readSource(key, target, limit ?? 50, after ?? null);
2882
2896
  },
2883
- async joinSource(_caller, { key, target }) {
2897
+ async joinSource(caller, { key, target }) {
2884
2898
  if (!binding?.sync.some((entry) => entry.key === key)) throw notFound(`this board doesn't run sync entry ${key}: join it where its sync runs`, "not_synced_here");
2899
+ ownSources(caller, "join a source");
2885
2900
  return binding.joinSource(key, target);
2886
2901
  },
2887
2902
  async syncImport(caller, body, signal) {
@@ -3584,9 +3599,12 @@ async function createServe(context) {
3584
3599
  * What a verified caller may do, as board()'s `access` said when it verified them: board() checks
3585
3600
  * it before it does anything for them past calling the backend (a platform call, sync's own write,
3586
3601
  * reading an upload, the middleware), so a caller it won't let in starts none of it. Null for this
3587
- * deployment's own code, which may do everything.
3602
+ * deployment's own code, which may do everything, unless `as(profile, { can })` narrowed its
3603
+ * handle: then what that `can` leaves it, as a request narrowed with x-board-can is checked.
3588
3604
  */
3589
- const accessOf = (caller) => "identity" in caller ? caller.identity.principal.access : null;
3605
+ const accessOf = (caller) => "identity" in caller ? caller.identity.principal.access : caller.can !== void 0 ? FULL_ACCESS.narrow(parseCan(caller.can)) : null;
3606
+ /** Whether `caller` is narrowed with a `can`: a request's x-board-can, or a handle's from `as()`. */
3607
+ const narrowed = (caller) => "identity" in caller ? caller.identity.principal.scope !== void 0 : caller.can !== void 0;
3590
3608
  /**
3591
3609
  * Whether board() may work for a write of `caller`'s that lands in `channel`, or in the thread of
3592
3610
  * message `re`, which it must read: `post` there. One it may not goes to the backend as it came,
@@ -3838,7 +3856,7 @@ async function createServe(context) {
3838
3856
  };
3839
3857
  if (middleware.length === 0 || caller.origin.via?.kind === "middleware" || body.op !== "post" && body.op !== "edit") return send(body);
3840
3858
  const access = accessOf(caller);
3841
- if (access && (!access.anywhere("sync") || "identity" in caller && caller.identity.principal.scope !== void 0)) return send(body);
3859
+ if (access && (!access.anywhere("sync") || narrowed(caller))) return send(body);
3842
3860
  const dropped = async (commit) => {
3843
3861
  try {
3844
3862
  return await commit();
@@ -4296,6 +4314,59 @@ async function createServe(context) {
4296
4314
  }
4297
4315
  //#endregion
4298
4316
  //#region src/server/board.ts
4317
+ /** A handle's own, with every request it makes ended by a signal: what `vb()` runs a command on. Global, so another copy of board finds it. */
4318
+ const STOPPED_BY = Symbol.for("@vercel/board/stopped-by");
4319
+ /**
4320
+ * `board`, with each request it makes ended by `signal`: the backend's call gets it, and the request
4321
+ * rejects with its reason when it fires, whether or not the backend heeds it. A request already
4322
+ * sent may still have done what it asked. Null for a handle board() didn't make.
4323
+ */
4324
+ function stoppedBy(board, signal) {
4325
+ const own = board[STOPPED_BY];
4326
+ return typeof own === "function" ? own(signal) : null;
4327
+ }
4328
+ /** `response`, with a body that errors with `signal`'s reason once it fires: a download whose body stalls ends too. */
4329
+ function bounded(response, signal) {
4330
+ if (!response.ok || !response.body) return response;
4331
+ const reader = response.body.getReader();
4332
+ const body = new ReadableStream({
4333
+ start(controller) {
4334
+ const stop = () => {
4335
+ controller.error(signal.reason);
4336
+ reader.cancel(signal.reason).catch(() => {});
4337
+ };
4338
+ if (signal.aborted) stop();
4339
+ else signal.addEventListener("abort", stop, { once: true });
4340
+ },
4341
+ async pull(controller) {
4342
+ let read;
4343
+ try {
4344
+ read = await reader.read();
4345
+ } catch (error) {
4346
+ if (!signal.aborted) controller.error(error);
4347
+ return;
4348
+ }
4349
+ if (signal.aborted) return;
4350
+ if (read.done) controller.close();
4351
+ else controller.enqueue(read.value);
4352
+ },
4353
+ cancel: (reason) => reader.cancel(reason)
4354
+ });
4355
+ return new Response(body, {
4356
+ status: response.status,
4357
+ statusText: response.statusText,
4358
+ headers: response.headers
4359
+ });
4360
+ }
4361
+ /** `work`, or `signal`'s reason once it fires, whichever comes first. */
4362
+ function until(signal, work) {
4363
+ if (signal.aborted) return Promise.reject(signal.reason);
4364
+ return new Promise((resolve, reject) => {
4365
+ const stop = () => reject(signal.reason);
4366
+ signal.addEventListener("abort", stop, { once: true });
4367
+ work.then(resolve, reject).finally(() => signal.removeEventListener("abort", stop));
4368
+ });
4369
+ }
4299
4370
  /** How long a handle's live events wait for the next, in seconds, before asking again. */
4300
4371
  const EVENTS_WAIT_S = 25;
4301
4372
  /** A profile's name, as the board takes one in `x-board-profile`. */
@@ -4346,12 +4417,24 @@ function createBoard(options, runtime) {
4346
4417
  loading.catch(() => loading = null);
4347
4418
  return loading;
4348
4419
  }
4349
- function clientAs(caller, trigger) {
4350
- const writes = { made: 0 };
4420
+ function clientAs(caller, trigger, stop, writes = { made: 0 }) {
4421
+ const inject = async (request) => (await server()).inject(request, caller, trigger, writes);
4351
4422
  return createBoardClient({
4352
4423
  url: inProcess,
4353
4424
  token: "in-process",
4354
- fetch: (async (input, init) => (await server()).inject(new Request(input, init), caller, trigger, writes))
4425
+ fetch: (async (input, init) => {
4426
+ if (!stop) return inject(new Request(input, init));
4427
+ const signal = init?.signal ? AbortSignal.any([init.signal, stop]) : stop;
4428
+ if (signal.aborted) throw signal.reason;
4429
+ return bounded(await until(signal, inject(new Request(input, {
4430
+ ...init,
4431
+ signal
4432
+ }))), signal);
4433
+ }),
4434
+ ...stop ? { storeFetch: ((input, init) => globalThis.fetch(input, {
4435
+ ...init,
4436
+ signal: init?.signal ? AbortSignal.any([init.signal, stop]) : stop
4437
+ })) } : {}
4355
4438
  });
4356
4439
  }
4357
4440
  const serve = async (request) => (await server()).dispatch(request, null);
@@ -4372,6 +4455,19 @@ function createBoard(options, runtime) {
4372
4455
  routes: PROTOCOL_ROUTES
4373
4456
  };
4374
4457
  }
4458
+ /** `can`'s header text, read as the board reads one: a 400 `invalid_scope` for one it doesn't. */
4459
+ function canOf(can) {
4460
+ try {
4461
+ return canHeader(can);
4462
+ } catch (error) {
4463
+ if (error instanceof InvalidCan) throw new BoardError("invalid_scope", error.message, 400);
4464
+ throw error;
4465
+ }
4466
+ }
4467
+ /** What a handle narrowed to `held` (or nothing) may do once `can` narrows it too: never more than either. */
4468
+ const within = (held, can) => held === void 0 ? can : canText(compileAccess(parseCan(held)).narrow(parseCan(can)));
4469
+ /** The `can` a handle as `caller` holds: what `as(profile, { can })` gave it. */
4470
+ const heldBy = (caller) => "self" in caller ? caller.can : void 0;
4375
4471
  /** The policy that hands this board to a sandbox, for a handle as `caller`. */
4376
4472
  async function sandboxPolicy(caller, options = {}) {
4377
4473
  const own = "profile" in caller ? caller.profile : null;
@@ -4379,16 +4475,9 @@ function createBoard(options, runtime) {
4379
4475
  if (named === null) throw new BoardError("invalid_profile", "A sandbox writes as a profile of this deployment, and this names none: the sandbox could send its own, and write as any.", 400, { hint: "Name one: sandboxPolicy({ profile: { name } }), or team.as('<name>').sandboxPolicy()." });
4380
4476
  if (!SANDBOX_PROFILE.test(named.name)) throw new BoardError("invalid_profile", `${named.name} isn't a profile's name: one starts with a letter and uses up to 32 letters, numbers, and hyphens.`, 400);
4381
4477
  if (named.avatar !== void 0 && !avatarUrl(named.avatar)) throw new BoardError("invalid_profile", `${named.avatar} isn't an avatar: one is an https URL, or http on localhost.`, 400);
4382
- let can;
4383
- try {
4384
- can = canHeader(options.can);
4385
- } catch (error) {
4386
- if (error instanceof InvalidCan) throw new BoardError("invalid_scope", error.message, 400);
4387
- throw error;
4388
- }
4389
4478
  const input = {
4390
4479
  profile: named,
4391
- can,
4480
+ can: within(heldBy(caller), canOf(options.can)),
4392
4481
  token: options.token
4393
4482
  };
4394
4483
  try {
@@ -4402,17 +4491,18 @@ function createBoard(options, runtime) {
4402
4491
  }
4403
4492
  }
4404
4493
  /** A handle on `client`, which `as` gives other profiles of. */
4405
- function handle(client, url, caller) {
4494
+ function handle(client, url, caller, trigger, stop, writes) {
4406
4495
  const made = {
4407
4496
  ...client,
4408
4497
  fetch: serve,
4409
- as,
4498
+ as: asFrom(caller, stop),
4410
4499
  sandboxPolicy: (options) => sandboxPolicy(caller, options)
4411
4500
  };
4412
4501
  if (url) Object.defineProperty(made, "url", {
4413
4502
  get: url,
4414
4503
  enumerable: true
4415
4504
  });
4505
+ Object.defineProperty(made, STOPPED_BY, { value: (signal) => handleOf(caller, trigger, signal, writes) });
4416
4506
  return made;
4417
4507
  }
4418
4508
  /**
@@ -4420,12 +4510,12 @@ function createBoard(options, runtime) {
4420
4510
  * so a retry posts once and no request can take it first. A verified caller's are a backend's,
4421
4511
  * derived already (a schedule's send's), so they go as they are.
4422
4512
  */
4423
- function handleOf(caller, trigger) {
4424
- const client = clientAs(caller, trigger);
4513
+ function handleOf(caller, trigger, stop, writes = { made: 0 }) {
4514
+ const client = clientAs(caller, trigger, stop, writes);
4425
4515
  if ("identity" in caller) return handle({
4426
4516
  ...client,
4427
4517
  events: (query, opts) => events(client, query, opts)
4428
- }, () => ownUrl() ?? inProcess, caller);
4518
+ }, () => ownUrl() ?? inProcess, caller, trigger, stop, writes);
4429
4519
  const via = caller.origin.via?.kind ?? "client";
4430
4520
  const id = (given) => derivedId(`board-${via === "watcher" ? "watch" : via}`, caller.self ?? "", given);
4431
4521
  const owned = async (input) => typeof input === "string" || input.id === void 0 ? input : {
@@ -4439,25 +4529,32 @@ function createBoard(options, runtime) {
4439
4529
  posted: async (given) => client.posted(await id(given)),
4440
4530
  request: (path, init = {}) => {
4441
4531
  const { as: profile, ...rest } = init;
4442
- return profile !== void 0 ? as(profile).request(path, rest) : client.request(path, rest);
4532
+ return profile !== void 0 ? asFrom(caller, stop)(profile).request(path, rest) : client.request(path, rest);
4443
4533
  },
4444
4534
  events: (query, opts) => events(client, query, opts)
4445
- }, () => ownUrl() ?? inProcess, caller);
4535
+ }, () => ownUrl() ?? inProcess, caller, trigger, stop, writes);
4446
4536
  }
4447
- const profileCaller = (profile) => {
4537
+ const profileCaller = (profile, can) => {
4448
4538
  const name = profile === null ? null : typeof profile === "string" ? profile : profile.name;
4449
4539
  return {
4450
4540
  self: name,
4451
4541
  profile,
4542
+ ...can !== void 0 ? { can } : {},
4452
4543
  origin: { via: {
4453
4544
  kind: "client",
4454
4545
  name
4455
4546
  } }
4456
4547
  };
4457
4548
  };
4458
- function as(profile) {
4459
- return handleOf(profileCaller(profile), null);
4460
- }
4549
+ /**
4550
+ * `as()` on a handle as `caller`: another profile, held to what that handle holds, and to `can`
4551
+ * when it's given, and stopped by what stops that handle.
4552
+ */
4553
+ const asFrom = (caller, stop) => (profile, options = {}) => {
4554
+ const held = heldBy(caller);
4555
+ const can = options.can === void 0 ? held : within(held, canOf(options.can));
4556
+ return handleOf(profileCaller(profile, can), null, stop);
4557
+ };
4461
4558
  const context = {
4462
4559
  options,
4463
4560
  backend,
@@ -4555,4 +4652,4 @@ async function* events(client, query = {}, opts = {}) {
4555
4652
  }
4556
4653
  }
4557
4654
  //#endregion
4558
- export { PROTOCOL_ROUTES as a, deployedOnVercel as c, isApiMessageId as i, isBoardName as n, withoutToken as o, createVercel as r, tailWatchers as s, createBoard as t };
4655
+ export { isApiMessageId as a, tailWatchers as c, createVercel as i, deployedOnVercel as l, isBoardName as n, PROTOCOL_ROUTES as o, stoppedBy as r, withoutToken as s, createBoard as t };
@@ -0,0 +1,4 @@
1
+ import "./routes-By9lmvUD.mjs";
2
+ import "./auth-Bn8J_1F2.mjs";
3
+ import "./backend-DMrK55mU.mjs";
4
+ import "./provider-dY54GFNz.mjs";
@@ -1,5 +1,5 @@
1
- import { d as Board, f as BoardOptions } from "./backend-CYsTLxtP.mjs";
2
- import "./exports-C8zsIL1A.mjs";
1
+ import { f as Board, p as BoardOptions } from "./backend-DMrK55mU.mjs";
2
+ import "./exports-Bw_OYNRl.mjs";
3
3
  //#region src/server/index.d.ts
4
4
  /**
5
5
  * The handle on a board. Without a `backend`, it's Vercel's board for your team, the one `name`
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { $ as ScheduleBodyOutput, A as LinkView, At as TypingBody, B as PostBody, C as InboxEntry, Ct as SyncThreadView, D as InboxQuery, Dt as ThreadsPage, E as InboxPushBody, Et as ThreadView, F as MessageView, Ft as UploadTicket, G as ReactBody, H as PrincipalInput, I as MessagesPage, It as routes, J as RegisterInput, K as Ref, L as MessagesQuery, M as MatchView, Mt as UpdateGrantBody, N as MatchesQuery, Nt as UpdateGrantInput, O as LABEL_CONDITIONS_MAX, Ot as ThreadsQuery, P as Me, Pt as UploadStartBody, Q as ScheduleBody, R as MessagesQueryInput, S as InboxAckBody, St as SyncReceiptInput, T as InboxNextQuery, Tt as ThreadSummaryView, U as PrincipalView, V as PostInput, W as REGISTERED_WATCHERS_MAX, X as ResolvedSyncTarget, Y as RegistrationView, Z as RouteName, _ as FiltersInput, _t as SyncFindQuery, a as BoardEventView, at as SchemaBody, b as GrantInput, bt as SyncImportInput, c as CreateChannelBody, ct as SourceJoin, d as EditBody, dt as SourceRead, et as ScheduleInput, f as EventsPage, ft as SourceReadQuery, g as Explanation, gt as SyncFindInput, h as ExplainQuery, ht as SyncCopiesView, i as BlockView, it as SchedulesQueryOutput, j as LinkedQuery, jt as TypingResult, k as LabelBody, kt as ThreadsQueryInput, l as DeleteBody, lt as SourceJoinBody, m as EventsQueryInput, mt as SyncCopiesQuery, n as ActorView, nn as Attachment, nt as SchedulesQuery, o as CanAt, ot as SchemaInput, p as EventsQuery, pt as SyncBody, q as RegisterBody, r as ApiError, rt as SchedulesQueryInput, s as ChannelView, st as SchemaView, t as AckBody, tt as ScheduleView, u as Discovery, ut as SourceMessage, v as GrantBody, vt as SyncFindView, w as InboxItem, wt as SyncedView, x as GrantView, xt as SyncReceiptBody, y as GrantCan, yt as SyncImportBody, z as ParsedFilters } from "./routes-By9lmvUD.mjs";
2
2
  import { i as Claims, r as CallerRequest } from "./auth-Bn8J_1F2.mjs";
3
- import { C as Protocol, D as SandboxPolicyOptions, E as SandboxPolicy, O as SandboxRule, S as Method, T as SandboxMatcher, _ as MiddlewareContext, a as Identity, b as WriteSource, c as SelfCaller, d as Board, f as BoardOptions, g as Middleware, h as DroppedError, i as Caller, l as Subscription, m as WatcherContext, n as BackendRoute, o as InboxDelivery, p as Watcher, r as BoardBinding, s as ProtocolMethods, t as Backend, u as VerifiedCaller, v as Write, w as SandboxMatch, x as HttpError, y as WritePatch } from "./backend-CYsTLxtP.mjs";
3
+ import { C as Method, D as SandboxPolicy, E as SandboxMatcher, O as SandboxPolicyOptions, S as HttpError, T as SandboxMatch, _ as Middleware, a as Identity, b as WritePatch, c as SelfCaller, d as AsOptions, f as Board, g as DroppedError, h as WatcherContext, i as Caller, k as SandboxRule, l as Subscription, m as Watcher, n as BackendRoute, o as InboxDelivery, p as BoardOptions, r as BoardBinding, s as ProtocolMethods, t as Backend, u as VerifiedCaller, v as MiddlewareContext, w as Protocol, x as WriteSource, y as Write } from "./backend-DMrK55mU.mjs";
4
4
  import { B as ScheduleOptions, H as UploadInput, I as Filters, L as PostOptions, P as BoardError, R as ProfileOption, U as WaitOptions, V as ScheduleTiming, W as duration, z as ReplyOptions } from "./provider-dY54GFNz.mjs";
5
5
  import { n as block } from "./blocks-DGvh2alZ.mjs";
6
- import "./exports-C8zsIL1A.mjs";
6
+ import "./exports-Bw_OYNRl.mjs";
7
7
  //#region src/server/index.default.d.ts
8
8
  /**
9
9
  * The handle on a board. Without a `backend`, it's Vercel's board for the team, the one `name`
@@ -13,4 +13,4 @@ import "./exports-C8zsIL1A.mjs";
13
13
  */
14
14
  export declare function board(options?: BoardOptions): Board;
15
15
  //#endregion
16
- export { type AckBody, type ActorView, type ApiError, type Attachment, type Backend, type BackendRoute, type BlockView, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type Caller, type CallerRequest, type CanAt, type ChannelView, type Claims, type CreateChannelBody, type DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type ExplainQuery, type Explanation, type Filters, type FiltersInput, type GrantBody, type GrantCan, type GrantInput, type GrantView, HttpError, type Identity, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LabelBody, type LinkView, type LinkedQuery, type MatchView, type MatchesQuery, type Me, type MessageView, type MessagesPage, type MessagesQuery, type MessagesQueryInput, type Method, type Middleware, type MiddlewareContext, type ParsedFilters, type PostBody, type PostInput, type PostOptions, type PrincipalInput, type PrincipalView, type ProfileOption, type Protocol, type ProtocolMethods, type REGISTERED_WATCHERS_MAX, type ReactBody, type Ref, type RegisterBody, type RegisterInput, type RegistrationView, type ReplyOptions, type ResolvedSyncTarget, type RouteName, type SandboxMatch, type SandboxMatcher, type SandboxPolicy, type SandboxPolicyOptions, type SandboxRule, type ScheduleBody, type ScheduleBodyOutput, type ScheduleInput, type ScheduleOptions, type ScheduleTiming, type ScheduleView, type SchedulesQuery, type SchedulesQueryInput, type SchedulesQueryOutput, type SchemaBody, type SchemaInput, type SchemaView, type SelfCaller, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncBody, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncThreadView, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, type TypingBody, type TypingResult, type UpdateGrantBody, type UpdateGrantInput, type UploadInput, type UploadStartBody, type UploadTicket, type VerifiedCaller, type WaitOptions, type Watcher, type WatcherContext, type Write, type WritePatch, type WriteSource, block, duration, type routes };
16
+ export { type AckBody, type ActorView, type ApiError, type AsOptions, type Attachment, type Backend, type BackendRoute, type BlockView, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type Caller, type CallerRequest, type CanAt, type ChannelView, type Claims, type CreateChannelBody, type DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type ExplainQuery, type Explanation, type Filters, type FiltersInput, type GrantBody, type GrantCan, type GrantInput, type GrantView, HttpError, type Identity, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LabelBody, type LinkView, type LinkedQuery, type MatchView, type MatchesQuery, type Me, type MessageView, type MessagesPage, type MessagesQuery, type MessagesQueryInput, type Method, type Middleware, type MiddlewareContext, type ParsedFilters, type PostBody, type PostInput, type PostOptions, type PrincipalInput, type PrincipalView, type ProfileOption, type Protocol, type ProtocolMethods, type REGISTERED_WATCHERS_MAX, type ReactBody, type Ref, type RegisterBody, type RegisterInput, type RegistrationView, type ReplyOptions, type ResolvedSyncTarget, type RouteName, type SandboxMatch, type SandboxMatcher, type SandboxPolicy, type SandboxPolicyOptions, type SandboxRule, type ScheduleBody, type ScheduleBodyOutput, type ScheduleInput, type ScheduleOptions, type ScheduleTiming, type ScheduleView, type SchedulesQuery, type SchedulesQueryInput, type SchedulesQueryOutput, type SchemaBody, type SchemaInput, type SchemaView, type SelfCaller, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncBody, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncThreadView, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, type TypingBody, type TypingResult, type UpdateGrantBody, type UpdateGrantInput, type UploadInput, type UploadStartBody, type UploadTicket, type VerifiedCaller, type WaitOptions, type Watcher, type WatcherContext, type Write, type WritePatch, type WriteSource, block, duration, type routes };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { f as duration, t as HttpError, u as BoardError } from "./errors-DcQf5WeM.mjs";
1
+ import { f as duration, t as HttpError, u as BoardError } from "./errors-DUzpDSrJ.mjs";
2
2
  import { t as block } from "./blocks-CVoBC7ur.mjs";
3
- import { t as DroppedError } from "./middleware-DHdrxmoc.mjs";
4
- import { r as createVercel, t as createBoard } from "./exports-B6udRV_E.mjs";
3
+ import { t as DroppedError } from "./middleware-0DUFrav-.mjs";
4
+ import { i as createVercel, t as createBoard } from "./exports-BfNXPHN_.mjs";
5
5
  //#region src/backend-vercel/index.default.ts
6
6
  /**
7
7
  * Your team's board, in Vercel's API. Outside Node there's no environment to find credentials or
@@ -24,7 +24,7 @@ function board(options = {}) {
24
24
  if (!fetch) throw new Error("board: pass a fetch that sends credentials Vercel's API takes, or a backend: outside Node there's no environment to find them in");
25
25
  return vercel({ fetch });
26
26
  },
27
- sync: () => import("./engine-8BcNeckB.mjs"),
27
+ sync: () => import("./engine-BVHSH2Kn.mjs"),
28
28
  serving: null,
29
29
  sandbox: null
30
30
  });