@vercel/board 0.56.1 → 0.57.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-HzqFpgL_.mjs → access-CIj7v_Dr.mjs} +1 -1
  2. package/dist/access.d.mts +2 -2
  3. package/dist/access.mjs +4 -4
  4. package/dist/{actors-D-u6bitG.mjs → actors-DVDTqjm7.mjs} +2 -2
  5. package/dist/{auth-D9ycDQK0.mjs → auth-BDWGvFWl.mjs} +2 -2
  6. package/dist/{auth-ULldUvir.d.mts → auth-C0Mla9OU.d.mts} +1 -1
  7. package/dist/{backend-BHN6GTjB.d.mts → backend-BuqwQbb4.d.mts} +6 -22
  8. package/dist/backend-local.d.mts +1 -1
  9. package/dist/backend-local.mjs +1 -1
  10. package/dist/backend-postgres/blob-vercel.d.mts +8 -0
  11. package/dist/backend-postgres/blob-vercel.mjs +81 -0
  12. package/dist/backend-postgres/scheduler-vercel.d.mts +2 -0
  13. package/dist/backend-postgres/scheduler-vercel.mjs +2 -0
  14. package/dist/backend-postgres.d.mts +74 -0
  15. package/dist/backend-postgres.mjs +3229 -0
  16. package/dist/blob-DjS53D1A.d.mts +35 -0
  17. package/dist/{chat-provider-F7UqWVZK.d.mts → chat-provider-CpYdXEpI.d.mts} +2 -2
  18. package/dist/cli-embedded.d.mts +2 -2
  19. package/dist/cli-embedded.mjs +2 -2
  20. package/dist/cli.mjs +5 -5
  21. package/dist/{client-CFHunEFn.d.mts → client-B0DGOt7P.d.mts} +1 -1
  22. package/dist/{conformance-BNiLcKra.mjs → conformance-FiQ68adg.mjs} +2 -2
  23. package/dist/conformance.d.mts +1 -1
  24. package/dist/conformance.mjs +1 -1
  25. package/dist/{engine-C8wCzkw-.mjs → engine-B_CjnE3G.mjs} +3 -3
  26. package/dist/{errors-DDfXnZ2b.mjs → errors-BfMR39F0.mjs} +60 -17
  27. package/dist/errors-DBZtbfph.d.mts +19 -0
  28. package/dist/{exports-BBmjHyCB.d.mts → exports-BvJTIorX.d.mts} +5 -4
  29. package/dist/{exports-DSX-CI5c.mjs → exports-x-ioAfbp.mjs} +23 -14
  30. package/dist/{index-Ce3SDZ3Y.d.mts → index-DuibwQf9.d.mts} +2 -2
  31. package/dist/index.d.mts +6 -5
  32. package/dist/index.mjs +4 -4
  33. package/dist/index.node.d.mts +7 -6
  34. package/dist/index.node.mjs +4 -4
  35. package/dist/inspect/app.js +35 -35
  36. package/dist/{inspect-C-vDnB_n.mjs → inspect-BFnDSdsq.mjs} +2 -2
  37. package/dist/inspect-BuNsu2z6.mjs +2 -0
  38. package/dist/inspect.d.mts +1 -1
  39. package/dist/inspect.mjs +1 -1
  40. package/dist/{internal-CvsrprnU-CEPOUpAv.mjs → internal-CvsrprnU-DhZF6sZK.mjs} +43 -1
  41. package/dist/{local-B5aZcAwj.mjs → local-Bt1-jA9A.mjs} +129 -3956
  42. package/dist/local-Gp8pqHSu.mjs +98 -0
  43. package/dist/{main-DSlpMoBN.mjs → main-Du-mKQZn.mjs} +93 -13
  44. package/dist/{memory-wmUDblhm.mjs → memory-74hyK6eH.mjs} +3 -3
  45. package/dist/{mentions-CnWt9Z5b.mjs → mentions-DBGmqkr2.mjs} +5 -1
  46. package/dist/{middleware-BY4qqIh3.mjs → middleware-bIABV895.mjs} +1 -1
  47. package/dist/{provider-DgGp4Zej.d.mts → provider-BNVyVKtH.d.mts} +2 -2
  48. package/dist/{routes-DNmQSOvQ.d.mts → routes-CSnxZyyb.d.mts} +2 -2
  49. package/dist/{serve-CI3kvpx_.mjs → serve-xOoxwq7T.mjs} +6 -6
  50. package/dist/{server-55vryxAl.mjs → server-BSexF7Bk.mjs} +8 -8
  51. package/dist/server-DX7mM6nm-Cq1xPyqJ.mjs +3769 -0
  52. package/dist/{serving-C1mhZQqH.mjs → serving-ByD4TOOU.mjs} +1 -1
  53. package/dist/{shell-7nGyF--f.mjs → shell-0nWQEqh3.mjs} +5 -1
  54. package/dist/{sql-D0MqINA6.mjs → sql-CvBbb5Ui.mjs} +33 -22
  55. package/dist/{sqlite-Dj2ZEtgy.mjs → sqlite-DtfrT_EP.mjs} +3 -3
  56. package/dist/{sqlite-db-DjbTlUwN.mjs → sqlite-db-DSVlzQjv.mjs} +2 -2
  57. package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +5 -0
  58. package/dist/{store-N8PXxDAS-BdL4Sq-f.mjs → store-codec-pAG2oPgQ-DbEYfF5Y.mjs} +2 -6
  59. package/dist/{store-memory-CKQVEzXN.mjs → store-memory-DOMraCLN.mjs} +3 -2
  60. package/dist/store-memory-XNDFHASI.mjs +2 -0
  61. package/dist/{store-polling-BZt2Rf3D-oh3aU_An.mjs → store-polling-BZt2Rf3D-nlZUQLz2.mjs} +1 -1
  62. package/dist/store-sqlite-Cs8dH9EX.mjs +2 -0
  63. package/dist/{store-sqlite-D6fIszST.mjs → store-sqlite-DUdQnX_6.mjs} +4 -3
  64. package/dist/sync-chat-sdk.d.mts +2 -2
  65. package/dist/sync-github.d.mts +2 -2
  66. package/dist/sync-linear.d.mts +3 -3
  67. package/dist/sync-slack.d.mts +3 -3
  68. package/dist/sync-slack.mjs +1 -1
  69. package/dist/sync.d.mts +2 -2
  70. package/dist/{task-batch-iecHMssy.mjs → task-batch-DgyfK9qx.mjs} +3 -3
  71. package/dist/{tokens-B3gXkQCs.mjs → tokens-_1X8JNLT.mjs} +2 -2
  72. package/dist/vercel-B5FM4uS8.d.mts +21 -0
  73. package/dist/vercel-BUb8II-P.mjs +305 -0
  74. package/dist/{version-gbihG3ui.mjs → version-CZT5WmZs.mjs} +1 -1
  75. package/docs/01-board/01-mounting.md +1 -0
  76. package/docs/01-board/12-postgres.md +222 -0
  77. package/docs/03-guides/02-inspector.md +33 -0
  78. package/docs/03-guides/07-build-a-ui.md +8 -4
  79. package/docs/04-reference/03-http.md +1 -1
  80. package/docs/index.md +4 -1
  81. package/package.json +31 -2
  82. package/sql/postgres/schema.sql +389 -0
  83. package/dist/inspect-CJ8osLQ-.mjs +0 -2
  84. package/dist/store-memory-OdGsc-t_.mjs +0 -2
  85. package/dist/store-sqlite-CTxAVCcz.mjs +0 -2
@@ -0,0 +1,35 @@
1
+ import "./routes-CSnxZyyb.mjs";
2
+ import "./errors-DBZtbfph.mjs";
3
+ //#region src/server/blob.d.ts
4
+ /**
5
+ * Where a local board's attachments' bytes live. The board writes each file
6
+ * once, under a key it chose, and never overwrites it.
7
+ */
8
+ type BlobStore = {
9
+ put(key: string, data: Uint8Array, contentType: string): Promise<void>;
10
+ /** Null when there's nothing under the key. */
11
+ get(key: string): Promise<{
12
+ data: ReadableStream<Uint8Array> | Uint8Array;
13
+ contentType: string;
14
+ } | null>;
15
+ /**
16
+ * For direct uploads, files too big for a request: a URL a client `PUT`s `key`'s bytes to,
17
+ * straight to the store, with `headers`. The store must bind it to `key`, refuse more than
18
+ * `maxBytes`, refuse to overwrite what's there, and stop taking it at `expiresAt`. With `head`,
19
+ * the board takes files up to `DIRECT_UPLOAD_BYTES_MAX`; without, uploads stay at 4 MB.
20
+ */
21
+ uploadUrl?(key: string, options: {
22
+ contentType: string;
23
+ maxBytes: number;
24
+ expiresAt: Date;
25
+ }): Promise<{
26
+ url: string;
27
+ headers: Record<string, string>;
28
+ }>;
29
+ /** The size of what's under the key, or null when there's nothing: how the board checks a direct upload landed. */
30
+ head?(key: string): Promise<{
31
+ size: number;
32
+ } | null>;
33
+ };
34
+ //#endregion
35
+ export { BlobStore as t };
@@ -1,5 +1,5 @@
1
- import { Rt as SourceJoin, Vn as Actor, Vt as SourceRead, Xn as ExternalLink, Yn as ExternalFile, qn as ExternalAuthor } from "./routes-DNmQSOvQ.mjs";
2
- import { A as SyncRoot, E as ProviderEvent, _ as SyncFn, a as ProviderOptions, c as Receive, f as ResolvedTarget, i as ProviderFile, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, r as ProviderDelivery, t as FetchedLink } from "./provider-DgGp4Zej.mjs";
1
+ import { Rt as SourceJoin, Vn as Actor, Vt as SourceRead, Xn as ExternalLink, Yn as ExternalFile, qn as ExternalAuthor } from "./routes-CSnxZyyb.mjs";
2
+ import { A as SyncRoot, E as ProviderEvent, _ as SyncFn, a as ProviderOptions, c as Receive, f as ResolvedTarget, i as ProviderFile, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, r as ProviderDelivery, t as FetchedLink } from "./provider-BNVyVKtH.mjs";
3
3
  import { Adapter, Author, FileUpload, Message, ReactionEvent, StateAdapter } from "chat";
4
4
  //#region src/sync/chat-provider.d.ts
5
5
  type ChatInput = {
@@ -1,5 +1,5 @@
1
- import { f as Board } from "./backend-BHN6GTjB.mjs";
2
- import "./index-Ce3SDZ3Y.mjs";
1
+ import { f as Board } from "./backend-BuqwQbb4.mjs";
2
+ import "./index-DuibwQf9.mjs";
3
3
  //#region src/cli/claims.d.ts
4
4
  /** A claim as the CLI keeps it: what its writes carry, and when its lease ends. */
5
5
  type HeldClaim = {
@@ -1,5 +1,5 @@
1
- import { o as stoppedBy } from "./exports-DSX-CI5c.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-DSlpMoBN.mjs";
1
+ import { o as stoppedBy } from "./exports-x-ioAfbp.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-Du-mKQZn.mjs";
3
3
  //#region src/cli/embedded.ts
4
4
  /**
5
5
  * Board's CLI as `appName` names it in help, usage, and errors (`vercel board`). With no board
package/dist/cli.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as option } from "./commands-7FY_8p92.mjs";
3
- import { g as projectDir } from "./server-55vryxAl.mjs";
4
- import { r as main } from "./main-DSlpMoBN.mjs";
5
- import { i as createInspector, r as stopped, t as allowedHosts } from "./inspect-C-vDnB_n.mjs";
3
+ import { g as projectDir } from "./server-BSexF7Bk.mjs";
4
+ import { r as main } from "./main-Du-mKQZn.mjs";
5
+ import { i as createInspector, r as stopped, t as allowedHosts } from "./inspect-BFnDSdsq.mjs";
6
6
  import { appendFile, readFile } from "node:fs/promises";
7
7
  import { join } from "node:path";
8
8
  //#region src/cli/local.ts
@@ -37,7 +37,7 @@ const local = {
37
37
  },
38
38
  async run(args, context) {
39
39
  if (args.length > 0) throw context.usage("inspect takes no arguments: pass its port with --port.");
40
- return (await import("./inspect-CJ8osLQ-.mjs")).inspect(context);
40
+ return (await import("./inspect-BuNsu2z6.mjs")).inspect(context);
41
41
  }
42
42
  },
43
43
  serve: {
@@ -81,7 +81,7 @@ const local = {
81
81
  }, "tailscale");
82
82
  if (tailscale.length > 0 && hosts.length > 0) throw usage("--tailscale takes Tailscale's word for who's calling, which another proxy in front could forge: it doesn't go with --allow-host.");
83
83
  const root = projectDir();
84
- const { serveLocal } = await import("./serve-CI3kvpx_.mjs");
84
+ const { serveLocal } = await import("./serve-xOoxwq7T.mjs");
85
85
  const local = await serveLocal({
86
86
  dir: flags.dir ?? join(root, ".board"),
87
87
  hosts,
@@ -1,4 +1,4 @@
1
- import { $t as SyncThreadView, B as Explanation, H as FiltersInput, Hn as ExternalCopy, I as EventsPage, It as SchemaInput, J as GrantWriteOptions, Jt as SyncFindView, K as GrantInput, Kt as SyncFindInput, Lt as SchemaView, N as Discovery, Nt as SchedulesQueryInput, Q as InboxItem, Qt as SyncReceiptInput, Rt as SourceJoin, St as RegistrationView, Un as Attachment, Vn as Actor, Vt as SourceRead, Xt as SyncImportInput, Z as InboxEntry, _ as ChannelView, b as ChannelsQueryInput, cn as TasksQueryInput, dt as MessagesPage, en as SyncedView, fn as ThreadView, g as ChannelMessagesQueryInput, hn as ThreadsQueryInput, jt as ScheduleView, lt as Me, on as TasksPage, pn as ThreadsPage, q as GrantView, r as ActorView, rn as TaskClaim, st as MatchView, u as BoardEventView, un as ThreadQueryInput, ut as MessageView, xt as RegisterInput, yn as UpdateGrantInput } from "./routes-DNmQSOvQ.mjs";
1
+ import { $t as SyncThreadView, B as Explanation, H as FiltersInput, Hn as ExternalCopy, I as EventsPage, It as SchemaInput, J as GrantWriteOptions, Jt as SyncFindView, K as GrantInput, Kt as SyncFindInput, Lt as SchemaView, N as Discovery, Nt as SchedulesQueryInput, Q as InboxItem, Qt as SyncReceiptInput, Rt as SourceJoin, St as RegistrationView, Un as Attachment, Vn as Actor, Vt as SourceRead, Xt as SyncImportInput, Z as InboxEntry, _ as ChannelView, b as ChannelsQueryInput, cn as TasksQueryInput, dt as MessagesPage, en as SyncedView, fn as ThreadView, g as ChannelMessagesQueryInput, hn as ThreadsQueryInput, jt as ScheduleView, lt as Me, on as TasksPage, pn as ThreadsPage, q as GrantView, r as ActorView, rn as TaskClaim, st as MatchView, u as BoardEventView, un as ThreadQueryInput, ut as MessageView, xt as RegisterInput, yn as UpdateGrantInput } from "./routes-CSnxZyyb.mjs";
2
2
  //#region src/contract/mentions.d.ts
3
3
  /** An actor as a write's answer names them. */
4
4
  type MentionedActor = {
@@ -1,6 +1,6 @@
1
- import { f as BoardError } from "./errors-DDfXnZ2b.mjs";
1
+ import { f as BoardError } from "./errors-BfMR39F0.mjs";
2
2
  import { c as canonical, t as block } from "./blocks-CVoBC7ur.mjs";
3
- import { a as canText, c as compileAccess } from "./access-HzqFpgL_.mjs";
3
+ import { a as canText, c as compileAccess } from "./access-CIj7v_Dr.mjs";
4
4
  //#region src/client/channels.ts
5
5
  /** Every channel of a board, or every one whose path starts with `prefix`, a page at a time: for what needs them all. */
6
6
  async function everyChannel(board, prefix) {
@@ -1,4 +1,4 @@
1
- import { f as Board } from "./backend-BHN6GTjB.mjs";
1
+ import { f as Board } from "./backend-BuqwQbb4.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-BNiLcKra.mjs";
1
+ import { t as conformance } from "./conformance-FiQ68adg.mjs";
2
2
  export { conformance };
@@ -1,10 +1,10 @@
1
1
  import { f as typeOf, i as ATTACHMENT_BYTES_MAX, l as fileSize, o as IMPORT_BYTES_MAX, u as importedFileName } from "./profile-header-O8wC8yk8.mjs";
2
2
  import { P as toStorable, m as MESSAGE_TEXT_MAX, s as ChannelPath } from "./schemas-CUSTEFIy.mjs";
3
3
  import { l as isThreadTarget, s as channelOf } from "./external-DkWafjn-.mjs";
4
- import { c as notFound, r as badRequest, t as HttpError } from "./errors-DDfXnZ2b.mjs";
4
+ import { c as notFound, r as badRequest, t as HttpError } from "./errors-BfMR39F0.mjs";
5
5
  import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
6
- 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-BY4qqIh3.mjs";
7
- import { a as replaceMentions, n as isEmail, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
6
+ 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-bIABV895.mjs";
7
+ import { n as isEmail, s as replaceMentions, t as extractMentions } from "./mentions-DBGmqkr2.mjs";
8
8
  import { a as immutable, d as opensBlock, f as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-mWKc1uvZ.mjs";
9
9
  import { i as vercelDeployments, n as displayText, t as byVercelBot } from "./bots-CqPYxkqK.mjs";
10
10
  //#region src/sync/engine.ts
@@ -921,8 +921,8 @@ const routes = {
921
921
  body: CreateGrantsBody
922
922
  },
923
923
  updateGrant: {
924
- method: "PATCH",
925
- path: "/grants/:id",
924
+ method: "POST",
925
+ path: "/grants/:id/update",
926
926
  body: UpdateGrantBody
927
927
  },
928
928
  /** Which grant decides a channel, for the caller or, with `manage` at `*`, a principal it names. */
@@ -1251,6 +1251,19 @@ function creatorOf(me, path) {
1251
1251
  };
1252
1252
  throw new BoardError("no_own_principal", `A private channel lets its creator in, as a person or a project's deployment, and ${me.principal} is neither, so ${path} wasn't made.`, 400, { hint: "Make it as a person or a deployment, or make it and its grants yourself." });
1253
1253
  }
1254
+ /** Sleeps for `ms`, or until `signal` aborts. */
1255
+ function pause(ms, signal) {
1256
+ return new Promise((resolve) => {
1257
+ if (signal?.aborted) return resolve();
1258
+ const done = () => {
1259
+ clearTimeout(timer);
1260
+ signal?.removeEventListener("abort", done);
1261
+ resolve();
1262
+ };
1263
+ const timer = setTimeout(done, ms);
1264
+ signal?.addEventListener("abort", done, { once: true });
1265
+ });
1266
+ }
1254
1267
  function createBoardClient(options) {
1255
1268
  const base = options.url.replace(/\/+$/, "");
1256
1269
  const doFetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
@@ -1636,7 +1649,7 @@ function createBoardClient(options) {
1636
1649
  ...goAhead(options)
1637
1650
  } }),
1638
1651
  /** Adds and removes principals (by who they are, environments aside), or replaces its `can`. Needs what `checkGrantChange` says, for the grant as it was and as it'd be. */
1639
- updateGrant: (id, { add, remove, can }, options = {}) => call("PATCH", `/grants/${path(id)}`, { body: {
1652
+ updateGrant: (id, { add, remove, can }, options = {}) => call("POST", `/grants/${path(id)}/update`, { body: {
1640
1653
  ...add ? { add: add.map(withEnvironments) } : {},
1641
1654
  ...remove ? { remove } : {},
1642
1655
  ...can ? { can: wireCan(can) } : {},
@@ -1807,7 +1820,7 @@ function createBoardClient(options) {
1807
1820
  if (opts.signal?.aborted) return;
1808
1821
  if (error instanceof BoardError && (error.status === 501 || error.status >= 400 && error.status < 500)) throw error;
1809
1822
  state.failed();
1810
- await new Promise((r) => setTimeout(r, Math.min(3e4, 500 * 2 ** failures++)));
1823
+ await pause(Math.min(3e4, 500 * 2 ** failures++), opts.signal);
1811
1824
  continue;
1812
1825
  }
1813
1826
  failures = 0;
@@ -1820,25 +1833,46 @@ function createBoardClient(options) {
1820
1833
  } catch (error) {
1821
1834
  if (opts.signal?.aborted) return;
1822
1835
  state.failed();
1823
- await new Promise((r) => setTimeout(r, Math.min(3e4, 500 * 2 ** failures++)));
1836
+ await pause(Math.min(3e4, 500 * 2 ** failures++), opts.signal);
1824
1837
  }
1825
1838
  }
1826
1839
  },
1827
1840
  /** The next matching event after `after` (default: now), or null on timeout. */
1828
1841
  async wait(query = {}, opts = {}) {
1829
1842
  const deadline = Date.now() + duration(opts.timeout ?? "30m");
1830
- let after = query.after ?? (await poll({
1831
- ...query,
1832
- after: void 0,
1833
- wait: 0
1834
- }, opts.signal)).cursor;
1843
+ let failures = 0;
1844
+ const again = async (error) => {
1845
+ if (opts.signal?.aborted) return;
1846
+ if (error instanceof BoardError && (error.status === 501 || error.status >= 400 && error.status < 500)) throw error;
1847
+ if (error instanceof Error && error.name === "AbortError") throw error;
1848
+ const backoff = Math.min(3e4, 500 * 2 ** failures++);
1849
+ if (Date.now() + backoff >= deadline) throw error;
1850
+ await pause(backoff, opts.signal);
1851
+ };
1852
+ let after = query.after;
1853
+ while (after === void 0 && !opts.signal?.aborted) try {
1854
+ after = (await poll({
1855
+ ...query,
1856
+ after: void 0,
1857
+ wait: 0
1858
+ }, opts.signal)).cursor;
1859
+ } catch (error) {
1860
+ await again(error);
1861
+ }
1835
1862
  while (Date.now() < deadline && !opts.signal?.aborted) {
1836
1863
  const wait = Math.max(0, Math.min(25, Math.ceil((deadline - Date.now()) / 1e3)));
1837
- const page = await poll({
1838
- ...query,
1839
- after,
1840
- wait
1841
- }, opts.signal);
1864
+ let page;
1865
+ try {
1866
+ page = await poll({
1867
+ ...query,
1868
+ after,
1869
+ wait
1870
+ }, opts.signal);
1871
+ } catch (error) {
1872
+ await again(error);
1873
+ continue;
1874
+ }
1875
+ failures = 0;
1842
1876
  if (page.events.length > 0) return page.events[0];
1843
1877
  after = page.cursor;
1844
1878
  }
@@ -1846,11 +1880,20 @@ function createBoardClient(options) {
1846
1880
  }
1847
1881
  };
1848
1882
  }
1883
+ /**
1884
+ * The code of a refusal, as a board or Vercel's API answered it. Vercel's API refuses a team whose SAML
1885
+ * session has lapsed with a 403 marked `saml`: `reauthentication_required`, which a new login fixes and a grant doesn't.
1886
+ */
1887
+ function refusalCode(status, error) {
1888
+ if (status === 403 && error?.saml === true) return "reauthentication_required";
1889
+ return error?.code;
1890
+ }
1849
1891
  async function toError(response) {
1850
1892
  try {
1851
1893
  const body = await response.json();
1852
1894
  const retryAfter = response.status === 429 ? /^\d{1,6}$/.exec(response.headers.get("retry-after") ?? "")?.[0] : void 0;
1853
- if (body.error?.message) return new BoardError(body.error.code ?? "error", body.error.message, response.status, {
1895
+ const code = refusalCode(response.status, body.error);
1896
+ if (body.error?.message) return new BoardError(code ?? "error", body.error.message, response.status, {
1854
1897
  ...typeof body.error.hint === "string" ? { hint: body.error.hint } : {},
1855
1898
  origin: handleErrors.has(response) ? "handle" : "board",
1856
1899
  ...retryAfter !== void 0 ? { retryAfter: Number(retryAfter) } : {}
@@ -1955,4 +1998,4 @@ function toErrorResponse(error) {
1955
1998
  } }, 500);
1956
1999
  }
1957
2000
  //#endregion
1958
- export { SchedulesQuery as $, CreatedTasksQuery as A, InboxPushBody as B, ClaimReadyTaskBody as C, CreateGrantsBody as D, CreateChannelBody as E, FailTaskBody as F, PostBody as G, LabelBody as H, Filters as I, RegisterBody as J, ReactBody as K, GrantBody as L, EditBody as M, EventsQuery as N, CreateTaskBody as O, ExplainQuery as P, ScheduleBody as Q, InboxAckBody as R, ChannelsQuery as S, CompleteTaskBody as T, LinkedQuery as U, InboxQuery as V, MatchesQuery as W, RenewTaskBody as X, ReleaseTaskBody as Y, RevokeGrantBody as Z, ActorsQuery as _, duplicateId as a, SyncFindQuery as at, CancelTaskBody as b, notFound as c, TaskNeedsBody as ct, unauthorized as d, ThreadsQuery as dt, SchemaBody as et, BoardError as f, TypingBody as ft, AckBody as g, eventsState as h, routes as ht, batchTooLarge as i, SyncCopiesQuery as it, DeleteBody as j, CreateTasksBody as k, textTooLong as l, TasksQuery as lt, duration as m, UploadStartBody as mt, RejectedError as n, SourceReadQuery as nt, forbidden as o, SyncImportBody as ot, createBoardClient as p, UpdateGrantBody as pt, Ref as q, badRequest as r, SyncBody as rt, json as s, SyncReceiptBody as st, HttpError as t, SourceJoinBody as tt, toErrorResponse as u, ThreadQuery as ut, AssignTaskBody as v, ClaimTaskBody as w, ChannelMessagesQuery as x, BlockTaskBody as y, InboxNextQuery as z };
2001
+ export { ScheduleBody as $, CreateTasksBody as A, InboxNextQuery as B, ChannelsQuery as C, CreateChannelBody as D, CompleteTaskBody as E, ExplainQuery as F, MatchesQuery as G, InboxQuery as H, FailTaskBody as I, Ref as J, PostBody as K, Filters as L, DeleteBody as M, EditBody as N, CreateGrantsBody as O, EventsQuery as P, RevokeGrantBody as Q, GrantBody as R, ChannelMessagesQuery as S, ClaimTaskBody as T, LabelBody as U, InboxPushBody as V, LinkedQuery as W, ReleaseTaskBody as X, RegisterBody as Y, RenewTaskBody as Z, AckBody as _, duplicateId as a, SyncCopiesQuery as at, BlockTaskBody as b, notFound as c, SyncReceiptBody as ct, unauthorized as d, ThreadQuery as dt, SchedulesQuery as et, BoardError as f, ThreadsQuery as ft, refusalCode as g, routes as gt, eventsState as h, UploadStartBody as ht, batchTooLarge as i, SyncBody as it, CreatedTasksQuery as j, CreateTaskBody as k, textTooLong as l, TaskNeedsBody as lt, duration as m, UpdateGrantBody as mt, RejectedError as n, SourceJoinBody as nt, forbidden as o, SyncFindQuery as ot, createBoardClient as p, TypingBody as pt, ReactBody as q, badRequest as r, SourceReadQuery as rt, json as s, SyncImportBody as st, HttpError as t, SchemaBody as tt, toErrorResponse as u, TasksQuery as ut, ActorsQuery as v, ClaimReadyTaskBody as w, CancelTaskBody as x, AssignTaskBody as y, InboxAckBody as z };
@@ -0,0 +1,19 @@
1
+ import { i as ErrorOrigin } from "./client-B0DGOt7P.mjs";
2
+ //#region src/server/errors.d.ts
3
+ declare class HttpError extends Error {
4
+ readonly status: number;
5
+ readonly code: string;
6
+ /** What fixes it, when there's one (`BoardError`'s `hint`). */
7
+ readonly hint: string | undefined;
8
+ /** `handle` for a handle's own error on its way through: everything else is the board's. */
9
+ readonly origin: ErrorOrigin;
10
+ /** For a 429, how many seconds until it's worth sending again, when that's known: the response's `Retry-After`. */
11
+ readonly retryAfter: number | undefined;
12
+ constructor(status: number, code: string, message: string, options?: {
13
+ hint?: string;
14
+ origin?: ErrorOrigin;
15
+ retryAfter?: number;
16
+ });
17
+ }
18
+ //#endregion
19
+ export { HttpError as t };
@@ -1,7 +1,8 @@
1
- import { ut as MessageView } from "./routes-DNmQSOvQ.mjs";
2
- import "./auth-ULldUvir.mjs";
3
- import "./backend-BHN6GTjB.mjs";
4
- import { g as TaskInBatch, n as BoardError } from "./client-CFHunEFn.mjs";
1
+ import { ut as MessageView } from "./routes-CSnxZyyb.mjs";
2
+ import "./auth-C0Mla9OU.mjs";
3
+ import "./backend-BuqwQbb4.mjs";
4
+ import { g as TaskInBatch, n as BoardError } from "./client-B0DGOt7P.mjs";
5
+ import "./errors-DBZtbfph.mjs";
5
6
  //#region src/client/chunks.d.ts
6
7
  /** What `createTasksInChunks` makes tasks with: a handle, or anything with its `tasks.createMany`. */
7
8
  type TaskBatches = {
@@ -1,14 +1,14 @@
1
1
  import { d as mediaType, i as ATTACHMENT_BYTES_MAX, n as formatProfileHeader, o as IMPORT_BYTES_MAX } from "./profile-header-O8wC8yk8.mjs";
2
2
  import { T as TASK_LABEL, b as RemoteWatcherId, y as RESERVED_LABEL_PREFIX } from "./schemas-CUSTEFIy.mjs";
3
- import { $ as SchedulesQuery, A as CreatedTasksQuery, B as InboxPushBody, C as ClaimReadyTaskBody, D as CreateGrantsBody, E as CreateChannelBody, F as FailTaskBody, G as PostBody, H as LabelBody, J as RegisterBody, K as ReactBody, L as GrantBody, M as EditBody, N as EventsQuery, O as CreateTaskBody, P as ExplainQuery, Q as ScheduleBody, R as InboxAckBody, S as ChannelsQuery, T as CompleteTaskBody, U as LinkedQuery, V as InboxQuery, W as MatchesQuery, X as RenewTaskBody, Y as ReleaseTaskBody, Z as RevokeGrantBody, _ as ActorsQuery, a as duplicateId, at as SyncFindQuery, b as CancelTaskBody, c as notFound, ct as TaskNeedsBody, d as unauthorized, dt as ThreadsQuery, et as SchemaBody, f as BoardError, ft as TypingBody, g as AckBody, h as eventsState, ht as routes, i as batchTooLarge, it as SyncCopiesQuery, j as DeleteBody, k as CreateTasksBody, lt as TasksQuery, m as duration, mt as UploadStartBody, n as RejectedError, nt as SourceReadQuery, o as forbidden, ot as SyncImportBody, p as createBoardClient, pt as UpdateGrantBody, q as Ref, r as badRequest, rt as SyncBody, s as json, st as SyncReceiptBody, t as HttpError, tt as SourceJoinBody, u as toErrorResponse, ut as ThreadQuery, v as AssignTaskBody, w as ClaimTaskBody, x as ChannelMessagesQuery, y as BlockTaskBody, z as InboxNextQuery } from "./errors-DDfXnZ2b.mjs";
4
- 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-BY4qqIh3.mjs";
3
+ import { $ as ScheduleBody, A as CreateTasksBody, B as InboxNextQuery, C as ChannelsQuery, D as CreateChannelBody, E as CompleteTaskBody, F as ExplainQuery, G as MatchesQuery, H as InboxQuery, I as FailTaskBody, J as Ref, K as PostBody, M as DeleteBody, N as EditBody, O as CreateGrantsBody, P as EventsQuery, Q as RevokeGrantBody, R as GrantBody, S as ChannelMessagesQuery, T as ClaimTaskBody, U as LabelBody, V as InboxPushBody, W as LinkedQuery, X as ReleaseTaskBody, Y as RegisterBody, Z as RenewTaskBody, _ as AckBody, a as duplicateId, at as SyncCopiesQuery, b as BlockTaskBody, c as notFound, ct as SyncReceiptBody, d as unauthorized, dt as ThreadQuery, et as SchedulesQuery, f as BoardError, ft as ThreadsQuery, g as refusalCode, gt as routes, h as eventsState, ht as UploadStartBody, i as batchTooLarge, it as SyncBody, j as CreatedTasksQuery, k as CreateTaskBody, lt as TaskNeedsBody, m as duration, mt as UpdateGrantBody, n as RejectedError, nt as SourceJoinBody, o as forbidden, ot as SyncFindQuery, p as createBoardClient, pt as TypingBody, q as ReactBody, r as badRequest, rt as SourceReadQuery, s as json, st as SyncImportBody, t as HttpError, tt as SchemaBody, u as toErrorResponse, ut as TasksQuery, v as ActorsQuery, w as ClaimReadyTaskBody, x as CancelTaskBody, y as AssignTaskBody, z as InboxAckBody } from "./errors-BfMR39F0.mjs";
4
+ 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-bIABV895.mjs";
5
5
  import { n as blocksIn, r as findBlocks } from "./blocks-CVoBC7ur.mjs";
6
- import { a as replaceMentions, i as mentionTerms, o as settleMentions, r as mentionTerm, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
7
- import { t as VERSION } from "./version-gbihG3ui.mjs";
8
- 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-HzqFpgL_.mjs";
9
- import { _ as uploadName, a as runMatch, d as createRouter, f as openapi, g as carried, h as readJson, i as canonicalWatchers, m as readCapped, n as SYNC_ACTOR, o as compileWatcher, p as queryObject, r as syncTarget, t as batchPlan, u as METHODS, v as SYNC } from "./task-batch-iecHMssy.mjs";
10
- import { C as verifiedIssuers, D as explainGrants, d as createAuthority, f as fromTokens, m as hostPrincipal, o as VERCEL_ISSUER, p as grantIssuers, t as DEFAULT_CAN$1, v as namesByLogin, w as verifiesTokens } from "./auth-D9ycDQK0.mjs";
11
- import { a as resolveActor, o as viaOf, r as claimsOf, t as KNOWN_AGENTS } from "./actors-D-u6bitG.mjs";
6
+ import { a as mentionTerms, c as settleMentions, i as mentionTerm, r as meTerms, s as replaceMentions, t as extractMentions } from "./mentions-DBGmqkr2.mjs";
7
+ import { t as VERSION } from "./version-CZT5WmZs.mjs";
8
+ 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-CIj7v_Dr.mjs";
9
+ import { _ as uploadName, a as runMatch, d as createRouter, f as openapi, g as carried, h as readJson, i as canonicalWatchers, m as readCapped, n as SYNC_ACTOR, o as compileWatcher, p as queryObject, r as syncTarget, t as batchPlan, u as METHODS, v as SYNC } from "./task-batch-DgyfK9qx.mjs";
10
+ import { C as verifiedIssuers, D as explainGrants, d as createAuthority, f as fromTokens, m as hostPrincipal, o as VERCEL_ISSUER, p as grantIssuers, t as DEFAULT_CAN$1, v as namesByLogin, w as verifiesTokens } from "./auth-BDWGvFWl.mjs";
11
+ import { a as resolveActor, o as viaOf, r as claimsOf, t as KNOWN_AGENTS } from "./actors-DVDTqjm7.mjs";
12
12
  import { t as checkValue } from "./data-values-CoTP0SQG.mjs";
13
13
  //#region src/server/registrant.ts
14
14
  /** Registering again this soon after the same registration only repeats it. */
@@ -725,6 +725,12 @@ const servesNone = () => new HttpError(404, "not_found", "this board uses Vercel
725
725
  const apiKind = (kind) => kind === "app" ? "workflow" : kind;
726
726
  /** How many more times a request goes out after the API puts it off. */
727
727
  const RETRIES = 4;
728
+ /** What the API or its gateway answers when it may answer the same request on another try: unavailable, or a gateway's lost answer. */
729
+ const TRANSIENT = /* @__PURE__ */ new Set([
730
+ 502,
731
+ 503,
732
+ 504
733
+ ]);
728
734
  /** The first wait before sending again, doubling each time. */
729
735
  const RETRY_MS = 1e3;
730
736
  /**
@@ -1093,8 +1099,8 @@ function createVercel(options, environment) {
1093
1099
  const tagged = /* @__PURE__ */ new Map();
1094
1100
  /**
1095
1101
  * One request to the API, as `who`. Its errors are the API's own, with its status and code. One the
1096
- * API puts off (429, or a 503) waits and goes again as it was, so a write keeps its operation ID
1097
- * and lands once.
1102
+ * API puts off (429, or a 503), or that its gateway lost (502, 504), waits and goes again as it was,
1103
+ * so a write keeps its operation ID and lands once.
1098
1104
  */
1099
1105
  async function api(who, method, path, init = {}) {
1100
1106
  const url = new URL(`${origin}/v${init.version ?? 1}/messageboard${path}`);
@@ -1157,14 +1163,14 @@ function createVercel(options, environment) {
1157
1163
  }
1158
1164
  return body;
1159
1165
  }
1160
- if (attempt < RETRIES && !init.signal?.aborted && (response.status === 429 || response.status === 503 && repeatable)) {
1166
+ if (attempt < RETRIES && !init.signal?.aborted && (response.status === 429 || TRANSIENT.has(response.status) && repeatable)) {
1161
1167
  await pause(retryWait(attempt, response.headers.get("retry-after")), init.signal);
1162
1168
  init.signal?.throwIfAborted();
1163
1169
  continue;
1164
1170
  }
1165
1171
  const error = body?.error;
1166
1172
  if (response.status === 429) throw throttled(response, error?.code ?? "rate_limited", attempt, Date.now() - started);
1167
- const refused = new HttpError(response.status, error?.code ?? "remote_error", error?.message ?? `Vercel's API answered ${response.status}`);
1173
+ const refused = new HttpError(response.status, refusalCode(response.status, error) ?? "remote_error", error?.message ?? `Vercel's API answered ${response.status}`);
1168
1174
  if (typeof error?.reason === "string" && /^[a-z_]{1,64}$/.test(error.reason)) reasons.set(refused, error.reason);
1169
1175
  throw refused;
1170
1176
  }
@@ -2164,7 +2170,10 @@ function createVercel(options, environment) {
2164
2170
  let prefixes = [];
2165
2171
  if (value === "me") {
2166
2172
  const found = await api(who, "GET", await onBoard(who, "/me"));
2167
- terms = [found.actor.id, ...found.view?.handle ? [mentionTerm(found.view.handle)] : []];
2173
+ terms = meTerms({
2174
+ id: found.actor.id,
2175
+ handle: found.view?.handle
2176
+ });
2168
2177
  } else {
2169
2178
  terms = [mentionTerm(value)];
2170
2179
  prefixes = [value.includes(":") ? `${value}+` : `${mentionTerm(value)}/`];
@@ -2401,7 +2410,7 @@ function createVercel(options, environment) {
2401
2410
  const named = (profile) => {
2402
2411
  if (profile === null) return null;
2403
2412
  const name = typeof profile === "string" ? profile : profile.name;
2404
- if (!PROFILE.test(name)) throw new HttpError(400, "invalid_request", `as: ${name}: profiles start with a letter and use up to 32 letters, numbers, and hyphens`);
2413
+ if (!PROFILE.test(name)) throw new HttpError(400, "invalid_profile", `as: ${name}: profiles start with a letter and use up to 32 letters, numbers, and hyphens`);
2405
2414
  return typeof profile === "string" || !profile.avatar ? { name } : {
2406
2415
  name,
2407
2416
  avatar: profile.avatar
@@ -1,5 +1,5 @@
1
- import { f as Board, p as BoardOptions } from "./backend-BHN6GTjB.mjs";
2
- import "./exports-BBmjHyCB.mjs";
1
+ import { f as Board, p as BoardOptions } from "./backend-BuqwQbb4.mjs";
2
+ import "./exports-BvJTIorX.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,8 +1,9 @@
1
- import { $ as InboxNextQuery, $t as SyncThreadView, A as CreateTasksInput, At as ScheduleInput, B as Explanation, Bt as SourceMessage, C as ClaimTaskBody, Ct as ReleaseTaskBody, D as CreateTaskBody, Dt as RouteName, E as CreateGrantsBody, Et as RevokeGrantBody, F as EditBody, Ft as SchemaBody, G as GrantCan, Gt as SyncCopiesView, H as FiltersInput, Ht as SourceReadQuery, I as EventsPage, It as SchemaInput, J as GrantWriteOptions, Jt as SyncFindView, K as GrantInput, Kt as SyncFindInput, L as EventsQuery, Lt as SchemaView, M as DeleteBody, Mt as SchedulesQuery, N as Discovery, Nt as SchedulesQueryInput, O as CreateTaskInput, Ot as ScheduleBody, P as EVENTS_LAST_MAX, Pt as SchedulesQueryOutput, Q as InboxItem, Qt as SyncReceiptInput, R as EventsQueryInput, Rt as SourceJoin, S as ClaimReadyTaskInput, Sn as routes, St as RegistrationView, T as CreateChannelBody, Tt as ResolvedSyncTarget, U as GRANT_BATCH_MAX, Un as Attachment, Ut as SyncBody, V as FailTaskBody, Vt as SourceRead, W as GrantBody, Wt as SyncCopiesQuery, X as InboxAckBody, Xt as SyncImportInput, Y as INBOX_EVENT_ID_MAX, Yt as SyncImportBody, Z as InboxEntry, Zt as SyncReceiptBody, _ as ChannelView, _n as TypingResult, _t as REGISTERED_WATCHERS_MAX, a as ActorsQueryInput, an as TaskView, at as LinkView, b as ChannelsQueryInput, bn as UploadStartBody, bt as RegisterBody, c as BlockTaskBody, cn as TasksQueryInput, ct as MatchesQuery, d as CHANNELS_LIMIT_DEFAULT, dn as ThreadSummaryView, dt as MessagesPage, en as SyncedView, et as InboxPushBody, f as CHANNELS_LIMIT_MAX, fn as ThreadView, ft as ParsedFilters, g as ChannelMessagesQueryInput, gn as TypingBody, gt as PrincipalView, h as ChannelMessagesQuery, hn as ThreadsQueryInput, ht as PrincipalInput, i as ActorsQuery, in as TaskNeedsBody, it as LabelBody, j as CreatedTasksQuery, jt as ScheduleView, k as CreateTasksBody, kt as ScheduleBodyOutput, l as BlockView, ln as ThreadQuery, lt as Me, m as CancelTaskBody, mn as ThreadsQuery, mt as PostInput, n as AckBody, nn as THREADS_LIMIT_MAX, nt as LABEL_CONDITIONS_MAX, o as ApiError, on as TasksPage, ot as LinkedQuery, p as CanAt, pn as ThreadsPage, pt as PostBody, q as GrantView, qt as SyncFindQuery, r as ActorView, rn as TaskClaim, rt as LEASE_DEFAULT_S, s as AssignTaskBody, sn as TasksQuery, st as MatchView, t as ACTORS_BY_ID_MAX, tn as THREADS_LIMIT_DEFAULT, tt as InboxQuery, u as BoardEventView, un as ThreadQueryInput, ut as MessageView, v as ChannelsPage, vn as UpdateGrantBody, vt as ReactBody, w as CompleteTaskBody, wt as RenewTaskBody, x as ClaimReadyTaskBody, xn as UploadTicket, xt as RegisterInput, y as ChannelsQuery, yn as UpdateGrantInput, yt as Ref, z as ExplainQuery, zt as SourceJoinBody } from "./routes-DNmQSOvQ.mjs";
2
- import { i as Claims, r as CallerRequest } from "./auth-ULldUvir.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-BHN6GTjB.mjs";
4
- import { C as MentionedActor, S as Mentioned, _ as TaskOptions, a as EventsOptions, b as Written, c as Filters, d as PostOptions, f as ProfileOption, g as TaskInBatch, h as ScheduleTiming, l as HeldTask, m as ScheduleOptions, n as BoardError, o as EventsState, p as ReplyOptions, r as ClaimedTask, s as ExplainPrincipal, u as NewTaskOptions, v as UploadInput, x as duration, y as WaitOptions } from "./client-CFHunEFn.mjs";
5
- import { n as TasksInChunksError, r as createTasksInChunks, t as TaskBatches } from "./exports-BBmjHyCB.mjs";
1
+ import { $ as InboxNextQuery, $t as SyncThreadView, A as CreateTasksInput, At as ScheduleInput, B as Explanation, Bt as SourceMessage, C as ClaimTaskBody, Ct as ReleaseTaskBody, D as CreateTaskBody, Dt as RouteName, E as CreateGrantsBody, Et as RevokeGrantBody, F as EditBody, Ft as SchemaBody, G as GrantCan, Gt as SyncCopiesView, H as FiltersInput, Ht as SourceReadQuery, I as EventsPage, It as SchemaInput, J as GrantWriteOptions, Jt as SyncFindView, K as GrantInput, Kt as SyncFindInput, L as EventsQuery, Lt as SchemaView, M as DeleteBody, Mt as SchedulesQuery, N as Discovery, Nt as SchedulesQueryInput, O as CreateTaskInput, Ot as ScheduleBody, P as EVENTS_LAST_MAX, Pt as SchedulesQueryOutput, Q as InboxItem, Qt as SyncReceiptInput, R as EventsQueryInput, Rt as SourceJoin, S as ClaimReadyTaskInput, Sn as routes, St as RegistrationView, T as CreateChannelBody, Tt as ResolvedSyncTarget, U as GRANT_BATCH_MAX, Un as Attachment, Ut as SyncBody, V as FailTaskBody, Vt as SourceRead, W as GrantBody, Wt as SyncCopiesQuery, X as InboxAckBody, Xt as SyncImportInput, Y as INBOX_EVENT_ID_MAX, Yt as SyncImportBody, Z as InboxEntry, Zt as SyncReceiptBody, _ as ChannelView, _n as TypingResult, _t as REGISTERED_WATCHERS_MAX, a as ActorsQueryInput, an as TaskView, at as LinkView, b as ChannelsQueryInput, bn as UploadStartBody, bt as RegisterBody, c as BlockTaskBody, cn as TasksQueryInput, ct as MatchesQuery, d as CHANNELS_LIMIT_DEFAULT, dn as ThreadSummaryView, dt as MessagesPage, en as SyncedView, et as InboxPushBody, f as CHANNELS_LIMIT_MAX, fn as ThreadView, ft as ParsedFilters, g as ChannelMessagesQueryInput, gn as TypingBody, gt as PrincipalView, h as ChannelMessagesQuery, hn as ThreadsQueryInput, ht as PrincipalInput, i as ActorsQuery, in as TaskNeedsBody, it as LabelBody, j as CreatedTasksQuery, jt as ScheduleView, k as CreateTasksBody, kt as ScheduleBodyOutput, l as BlockView, ln as ThreadQuery, lt as Me, m as CancelTaskBody, mn as ThreadsQuery, mt as PostInput, n as AckBody, nn as THREADS_LIMIT_MAX, nt as LABEL_CONDITIONS_MAX, o as ApiError, on as TasksPage, ot as LinkedQuery, p as CanAt, pn as ThreadsPage, pt as PostBody, q as GrantView, qt as SyncFindQuery, r as ActorView, rn as TaskClaim, rt as LEASE_DEFAULT_S, s as AssignTaskBody, sn as TasksQuery, st as MatchView, t as ACTORS_BY_ID_MAX, tn as THREADS_LIMIT_DEFAULT, tt as InboxQuery, u as BoardEventView, un as ThreadQueryInput, ut as MessageView, v as ChannelsPage, vn as UpdateGrantBody, vt as ReactBody, w as CompleteTaskBody, wt as RenewTaskBody, x as ClaimReadyTaskBody, xn as UploadTicket, xt as RegisterInput, y as ChannelsQuery, yn as UpdateGrantInput, yt as Ref, z as ExplainQuery, zt as SourceJoinBody } from "./routes-CSnxZyyb.mjs";
2
+ import { i as Claims, r as CallerRequest } from "./auth-C0Mla9OU.mjs";
3
+ import { C as Protocol, D as SandboxPolicyOptions, E as SandboxPolicy, O as SandboxRule, S as Method, T as SandboxMatcher, _ 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, 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 SandboxMatch, x as WriteSource, y as Write } from "./backend-BuqwQbb4.mjs";
4
+ import { C as MentionedActor, S as Mentioned, _ as TaskOptions, a as EventsOptions, b as Written, c as Filters, d as PostOptions, f as ProfileOption, g as TaskInBatch, h as ScheduleTiming, l as HeldTask, m as ScheduleOptions, n as BoardError, o as EventsState, p as ReplyOptions, r as ClaimedTask, s as ExplainPrincipal, u as NewTaskOptions, v as UploadInput, x as duration, y as WaitOptions } from "./client-B0DGOt7P.mjs";
5
+ import { t as HttpError } from "./errors-DBZtbfph.mjs";
6
+ import { n as TasksInChunksError, r as createTasksInChunks, t as TaskBatches } from "./exports-BvJTIorX.mjs";
6
7
  import { n as block } from "./blocks-DGvh2alZ.mjs";
7
8
  //#region src/server/index.default.d.ts
8
9
  /**
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { f as BoardError, m as duration, t as HttpError } from "./errors-DDfXnZ2b.mjs";
2
- import { t as DroppedError } from "./middleware-BY4qqIh3.mjs";
1
+ import { f as BoardError, m as duration, t as HttpError } from "./errors-BfMR39F0.mjs";
2
+ import { t as DroppedError } from "./middleware-bIABV895.mjs";
3
3
  import { t as block } from "./blocks-CVoBC7ur.mjs";
4
- import { c as createVercel, n as createTasksInChunks, r as createBoard, t as TasksInChunksError } from "./exports-DSX-CI5c.mjs";
4
+ import { c as createVercel, n as createTasksInChunks, r as createBoard, t as TasksInChunksError } from "./exports-x-ioAfbp.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-C8wCzkw-.mjs"),
27
+ sync: () => import("./engine-B_CjnE3G.mjs"),
28
28
  serving: null,
29
29
  sandbox: null
30
30
  });
@@ -1,8 +1,9 @@
1
- import { $ as InboxNextQuery, $t as SyncThreadView, A as CreateTasksInput, At as ScheduleInput, B as Explanation, Bt as SourceMessage, C as ClaimTaskBody, Ct as ReleaseTaskBody, D as CreateTaskBody, Dt as RouteName, E as CreateGrantsBody, Et as RevokeGrantBody, F as EditBody, Ft as SchemaBody, G as GrantCan, Gt as SyncCopiesView, H as FiltersInput, Ht as SourceReadQuery, I as EventsPage, It as SchemaInput, J as GrantWriteOptions, Jt as SyncFindView, K as GrantInput, Kt as SyncFindInput, L as EventsQuery, Lt as SchemaView, M as DeleteBody, Mt as SchedulesQuery, N as Discovery, Nt as SchedulesQueryInput, O as CreateTaskInput, Ot as ScheduleBody, P as EVENTS_LAST_MAX, Pt as SchedulesQueryOutput, Q as InboxItem, Qt as SyncReceiptInput, R as EventsQueryInput, Rt as SourceJoin, S as ClaimReadyTaskInput, Sn as routes, St as RegistrationView, T as CreateChannelBody, Tt as ResolvedSyncTarget, U as GRANT_BATCH_MAX, Un as Attachment, Ut as SyncBody, V as FailTaskBody, Vt as SourceRead, W as GrantBody, Wt as SyncCopiesQuery, X as InboxAckBody, Xt as SyncImportInput, Y as INBOX_EVENT_ID_MAX, Yt as SyncImportBody, Z as InboxEntry, Zt as SyncReceiptBody, _ as ChannelView, _n as TypingResult, _t as REGISTERED_WATCHERS_MAX, a as ActorsQueryInput, an as TaskView, at as LinkView, b as ChannelsQueryInput, bn as UploadStartBody, bt as RegisterBody, c as BlockTaskBody, cn as TasksQueryInput, ct as MatchesQuery, d as CHANNELS_LIMIT_DEFAULT, dn as ThreadSummaryView, dt as MessagesPage, en as SyncedView, et as InboxPushBody, f as CHANNELS_LIMIT_MAX, fn as ThreadView, ft as ParsedFilters, g as ChannelMessagesQueryInput, gn as TypingBody, gt as PrincipalView, h as ChannelMessagesQuery, hn as ThreadsQueryInput, ht as PrincipalInput, i as ActorsQuery, in as TaskNeedsBody, it as LabelBody, j as CreatedTasksQuery, jt as ScheduleView, k as CreateTasksBody, kt as ScheduleBodyOutput, l as BlockView, ln as ThreadQuery, lt as Me, m as CancelTaskBody, mn as ThreadsQuery, mt as PostInput, n as AckBody, nn as THREADS_LIMIT_MAX, nt as LABEL_CONDITIONS_MAX, o as ApiError, on as TasksPage, ot as LinkedQuery, p as CanAt, pn as ThreadsPage, pt as PostBody, q as GrantView, qt as SyncFindQuery, r as ActorView, rn as TaskClaim, rt as LEASE_DEFAULT_S, s as AssignTaskBody, sn as TasksQuery, st as MatchView, t as ACTORS_BY_ID_MAX, tn as THREADS_LIMIT_DEFAULT, tt as InboxQuery, u as BoardEventView, un as ThreadQueryInput, ut as MessageView, v as ChannelsPage, vn as UpdateGrantBody, vt as ReactBody, w as CompleteTaskBody, wt as RenewTaskBody, x as ClaimReadyTaskBody, xn as UploadTicket, xt as RegisterInput, y as ChannelsQuery, yn as UpdateGrantInput, yt as Ref, z as ExplainQuery, zt as SourceJoinBody } from "./routes-DNmQSOvQ.mjs";
2
- import { i as Claims, r as CallerRequest } from "./auth-ULldUvir.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-BHN6GTjB.mjs";
4
- import { C as MentionedActor, S as Mentioned, _ as TaskOptions, a as EventsOptions, b as Written, c as Filters, d as PostOptions, f as ProfileOption, g as TaskInBatch, h as ScheduleTiming, l as HeldTask, m as ScheduleOptions, n as BoardError, o as EventsState, p as ReplyOptions, r as ClaimedTask, s as ExplainPrincipal, u as NewTaskOptions, v as UploadInput, x as duration, y as WaitOptions } from "./client-CFHunEFn.mjs";
5
- import { n as TasksInChunksError, r as createTasksInChunks, t as TaskBatches } from "./exports-BBmjHyCB.mjs";
1
+ import { $ as InboxNextQuery, $t as SyncThreadView, A as CreateTasksInput, At as ScheduleInput, B as Explanation, Bt as SourceMessage, C as ClaimTaskBody, Ct as ReleaseTaskBody, D as CreateTaskBody, Dt as RouteName, E as CreateGrantsBody, Et as RevokeGrantBody, F as EditBody, Ft as SchemaBody, G as GrantCan, Gt as SyncCopiesView, H as FiltersInput, Ht as SourceReadQuery, I as EventsPage, It as SchemaInput, J as GrantWriteOptions, Jt as SyncFindView, K as GrantInput, Kt as SyncFindInput, L as EventsQuery, Lt as SchemaView, M as DeleteBody, Mt as SchedulesQuery, N as Discovery, Nt as SchedulesQueryInput, O as CreateTaskInput, Ot as ScheduleBody, P as EVENTS_LAST_MAX, Pt as SchedulesQueryOutput, Q as InboxItem, Qt as SyncReceiptInput, R as EventsQueryInput, Rt as SourceJoin, S as ClaimReadyTaskInput, Sn as routes, St as RegistrationView, T as CreateChannelBody, Tt as ResolvedSyncTarget, U as GRANT_BATCH_MAX, Un as Attachment, Ut as SyncBody, V as FailTaskBody, Vt as SourceRead, W as GrantBody, Wt as SyncCopiesQuery, X as InboxAckBody, Xt as SyncImportInput, Y as INBOX_EVENT_ID_MAX, Yt as SyncImportBody, Z as InboxEntry, Zt as SyncReceiptBody, _ as ChannelView, _n as TypingResult, _t as REGISTERED_WATCHERS_MAX, a as ActorsQueryInput, an as TaskView, at as LinkView, b as ChannelsQueryInput, bn as UploadStartBody, bt as RegisterBody, c as BlockTaskBody, cn as TasksQueryInput, ct as MatchesQuery, d as CHANNELS_LIMIT_DEFAULT, dn as ThreadSummaryView, dt as MessagesPage, en as SyncedView, et as InboxPushBody, f as CHANNELS_LIMIT_MAX, fn as ThreadView, ft as ParsedFilters, g as ChannelMessagesQueryInput, gn as TypingBody, gt as PrincipalView, h as ChannelMessagesQuery, hn as ThreadsQueryInput, ht as PrincipalInput, i as ActorsQuery, in as TaskNeedsBody, it as LabelBody, j as CreatedTasksQuery, jt as ScheduleView, k as CreateTasksBody, kt as ScheduleBodyOutput, l as BlockView, ln as ThreadQuery, lt as Me, m as CancelTaskBody, mn as ThreadsQuery, mt as PostInput, n as AckBody, nn as THREADS_LIMIT_MAX, nt as LABEL_CONDITIONS_MAX, o as ApiError, on as TasksPage, ot as LinkedQuery, p as CanAt, pn as ThreadsPage, pt as PostBody, q as GrantView, qt as SyncFindQuery, r as ActorView, rn as TaskClaim, rt as LEASE_DEFAULT_S, s as AssignTaskBody, sn as TasksQuery, st as MatchView, t as ACTORS_BY_ID_MAX, tn as THREADS_LIMIT_DEFAULT, tt as InboxQuery, u as BoardEventView, un as ThreadQueryInput, ut as MessageView, v as ChannelsPage, vn as UpdateGrantBody, vt as ReactBody, w as CompleteTaskBody, wt as RenewTaskBody, x as ClaimReadyTaskBody, xn as UploadTicket, xt as RegisterInput, y as ChannelsQuery, yn as UpdateGrantInput, yt as Ref, z as ExplainQuery, zt as SourceJoinBody } from "./routes-CSnxZyyb.mjs";
2
+ import { i as Claims, r as CallerRequest } from "./auth-C0Mla9OU.mjs";
3
+ import { C as Protocol, D as SandboxPolicyOptions, E as SandboxPolicy, O as SandboxRule, S as Method, T as SandboxMatcher, _ 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, 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 SandboxMatch, x as WriteSource, y as Write } from "./backend-BuqwQbb4.mjs";
4
+ import { C as MentionedActor, S as Mentioned, _ as TaskOptions, a as EventsOptions, b as Written, c as Filters, d as PostOptions, f as ProfileOption, g as TaskInBatch, h as ScheduleTiming, l as HeldTask, m as ScheduleOptions, n as BoardError, o as EventsState, p as ReplyOptions, r as ClaimedTask, s as ExplainPrincipal, u as NewTaskOptions, v as UploadInput, x as duration, y as WaitOptions } from "./client-B0DGOt7P.mjs";
5
+ import { t as HttpError } from "./errors-DBZtbfph.mjs";
6
+ import { n as TasksInChunksError, r as createTasksInChunks, t as TaskBatches } from "./exports-BvJTIorX.mjs";
6
7
  import { n as block } from "./blocks-DGvh2alZ.mjs";
7
- import { t as board } from "./index-Ce3SDZ3Y.mjs";
8
+ import { t as board } from "./index-DuibwQf9.mjs";
8
9
  export { type ACTORS_BY_ID_MAX, type AckBody, type ActorView, type ActorsQuery, type ActorsQueryInput, type ApiError, type AsOptions, type AssignTaskBody, type Attachment, type Backend, type BackendRoute, type BlockTaskBody, type BlockView, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type CHANNELS_LIMIT_DEFAULT, type CHANNELS_LIMIT_MAX, type Caller, type CallerRequest, type CanAt, type CancelTaskBody, type ChannelMessagesQuery, type ChannelMessagesQueryInput, type ChannelView, type ChannelsPage, type ChannelsQuery, type ChannelsQueryInput, type ClaimReadyTaskBody, type ClaimReadyTaskInput, type ClaimTaskBody, type ClaimedTask, type Claims, type CompleteTaskBody, type CreateChannelBody, type CreateGrantsBody, type CreateTaskBody, type CreateTaskInput, type CreateTasksBody, type CreateTasksInput, type CreatedTasksQuery, type DeleteBody, type Discovery, DroppedError, type EVENTS_LAST_MAX, type EditBody, type EventsOptions, type EventsPage, type EventsQuery, type EventsQueryInput, type EventsState, type ExplainPrincipal, type ExplainQuery, type Explanation, type FailTaskBody, type Filters, type FiltersInput, type GRANT_BATCH_MAX, type GrantBody, type GrantCan, type GrantInput, type GrantView, type GrantWriteOptions, type HeldTask, HttpError, type INBOX_EVENT_ID_MAX, type Identity, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LEASE_DEFAULT_S, type LabelBody, type LinkView, type LinkedQuery, type MatchView, type MatchesQuery, type Me, type Mentioned, type MentionedActor, type MessageView, type MessagesPage, type Method, type Middleware, type MiddlewareContext, type NewTaskOptions, 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 ReleaseTaskBody, type RenewTaskBody, type ReplyOptions, type ResolvedSyncTarget, type RevokeGrantBody, 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 THREADS_LIMIT_DEFAULT, type THREADS_LIMIT_MAX, type TaskBatches, type TaskClaim, type TaskInBatch, type TaskNeedsBody, type TaskOptions, type TaskView, TasksInChunksError, type TasksPage, type TasksQuery, type TasksQueryInput, type ThreadQuery, type ThreadQueryInput, 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, type Written, block, board, createTasksInChunks, duration, type routes };
@@ -1,6 +1,6 @@
1
- import { f as BoardError, m as duration, t as HttpError } from "./errors-DDfXnZ2b.mjs";
2
- import { t as DroppedError } from "./middleware-BY4qqIh3.mjs";
1
+ import { f as BoardError, m as duration, t as HttpError } from "./errors-BfMR39F0.mjs";
2
+ import { t as DroppedError } from "./middleware-bIABV895.mjs";
3
3
  import { t as block } from "./blocks-CVoBC7ur.mjs";
4
- import { n as createTasksInChunks, t as TasksInChunksError } from "./exports-DSX-CI5c.mjs";
5
- import { t as board } from "./server-55vryxAl.mjs";
4
+ import { n as createTasksInChunks, t as TasksInChunksError } from "./exports-x-ioAfbp.mjs";
5
+ import { t as board } from "./server-BSexF7Bk.mjs";
6
6
  export { BoardError, DroppedError, HttpError, TasksInChunksError, block, board, createTasksInChunks, duration };