@vercel/board 0.50.0 → 0.50.2

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 (64) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +6 -2
  3. package/dist/access.mjs +1 -1
  4. package/dist/{backend-CcaaS9Xl.d.mts → backend-C2JUnbm5.d.mts} +7 -2
  5. package/dist/backend-local.d.mts +1 -1
  6. package/dist/backend-local.mjs +1 -1
  7. package/dist/{chat-provider-HJ7y_ipp.mjs → chat-provider-Br2RXgLV.mjs} +4 -3
  8. package/dist/{chat-provider-DQ1GHm4o.d.mts → chat-provider-z4nzV8A-.d.mts} +1 -1
  9. package/dist/cli-embedded.d.mts +8 -5
  10. package/dist/cli-embedded.mjs +8 -5
  11. package/dist/cli.mjs +5 -5
  12. package/dist/{conformance-Cr-umDl0.mjs → conformance-jHhuKZe8.mjs} +1 -1
  13. package/dist/conformance.d.mts +1 -1
  14. package/dist/conformance.mjs +1 -1
  15. package/dist/{engine-DJZ8Xy_g.mjs → engine-I887QHnP.mjs} +13 -5
  16. package/dist/{events-BdOCmnZh.mjs → events-mWKc1uvZ.mjs} +1 -1
  17. package/dist/{exports-CuD-Mxkw.mjs → exports-DRId1Cks.mjs} +88 -23
  18. package/dist/{exports-lmr6UHHc.d.mts → exports-DkdCh3Zi.d.mts} +1 -1
  19. package/dist/{external-D2jq_DEQ.mjs → external-DkWafjn-.mjs} +5 -1
  20. package/dist/{index-_KxJu15n.d.mts → index-DpuOtt0J.d.mts} +2 -2
  21. package/dist/index.d.mts +2 -2
  22. package/dist/index.mjs +2 -2
  23. package/dist/index.node.d.mts +3 -3
  24. package/dist/index.node.mjs +2 -2
  25. package/dist/inspect/app.js +30 -30
  26. package/dist/inspect/engine.js +1 -1
  27. package/dist/inspect-DLLoYeg7.mjs +2 -0
  28. package/dist/{inspect-CZeoSm7E.mjs → inspect-DSBG5VDl.mjs} +2 -2
  29. package/dist/inspect.mjs +1 -1
  30. package/dist/{local-BVSFSSYf.mjs → local-DjrvtIoE.mjs} +7 -7
  31. package/dist/{main-B016auoG.mjs → main-VTkjxFcG.mjs} +11 -9
  32. package/dist/{memory-C2lzMV_t.mjs → memory-wmUDblhm.mjs} +2 -2
  33. package/dist/{provider-Dwb_9mnu.d.mts → provider-BgUS6ZpP.d.mts} +2 -0
  34. package/dist/{routes-BE0y6wCk.mjs → routes-BSBUdD2X.mjs} +1 -1
  35. package/dist/{serve-B10e7QaY.mjs → serve-C2xn_cQV.mjs} +6 -5
  36. package/dist/{server-ViWNvg5q.mjs → server-BLQxoL0g.mjs} +36 -26
  37. package/dist/{serving-SbqeWqlA.mjs → serving-Bulte-NO.mjs} +1 -1
  38. package/dist/{shell-DmpmgOPC.mjs → shell-Bny3-l_d.mjs} +1 -1
  39. package/dist/{sql-iABdyCiz.mjs → sql-D0MqINA6.mjs} +1 -1
  40. package/dist/{sqlite-28EMrmk7.mjs → sqlite-Dj2ZEtgy.mjs} +2 -2
  41. package/dist/{sqlite-db-Ckd-ceNe.mjs → sqlite-db-DjbTlUwN.mjs} +1 -1
  42. package/dist/sync-chat-sdk.d.mts +2 -2
  43. package/dist/sync-chat-sdk.mjs +2 -2
  44. package/dist/sync-github.d.mts +2 -2
  45. package/dist/sync-github.mjs +3 -3
  46. package/dist/sync-linear.d.mts +2 -2
  47. package/dist/sync-linear.mjs +3 -3
  48. package/dist/sync-slack.d.mts +20 -3
  49. package/dist/sync-slack.mjs +35 -11
  50. package/dist/sync.d.mts +1 -1
  51. package/dist/sync.mjs +2 -2
  52. package/dist/{tags-D0qra0Qy.mjs → tags-CxDCF_tt.mjs} +1 -1
  53. package/dist/{task-batch-9lVDG3d-.mjs → task-batch-CE6BKnRw.mjs} +3 -3
  54. package/dist/{tokens-C-iK0Cku.mjs → tokens-DnDHSPml.mjs} +28 -5
  55. package/dist/{version-C70RLVEK.mjs → version-DWvOShz3.mjs} +1 -1
  56. package/docs/01-board/01-mounting.md +1 -1
  57. package/docs/01-board/07-schedules.md +1 -1
  58. package/docs/02-sync/01-overview.md +3 -3
  59. package/docs/02-sync/03-slack.md +4 -3
  60. package/docs/03-guides/01-coding-agents.md +1 -1
  61. package/docs/04-reference/01-cli.md +19 -14
  62. package/docs/index.md +1 -1
  63. package/package.json +14 -2
  64. package/dist/inspect-UCcPViyA.mjs +0 -2
@@ -1,13 +1,13 @@
1
1
  import { i as ATTACHMENT_BYTES_MAX, l as mediaType, n as formatProfileHeader, o as IMPORT_BYTES_MAX, s as fileName } from "./profile-header-Cj0Cb1cf.mjs";
2
2
  import { T as TASK_LABEL, b as RemoteWatcherId, y as RESERVED_LABEL_PREFIX } from "./schemas-CUSTEFIy.mjs";
3
- import { A as Ref, B as SyncBody, C as InboxQuery, D as MessagesQuery, E as MatchesQuery, F as ScheduleBody, G as TaskNeedsBody, H as SyncFindQuery, I as SchedulesQuery, J as TypingBody, K as TasksQuery, L as SchemaBody, M as ReleaseTaskBody, N as RenewTaskBody, O as PostBody, P as RevokeGrantBody, R as SourceJoinBody, S as InboxPushBody, T as LinkedQuery, U as SyncImportBody, V as SyncCopiesQuery, W as SyncReceiptBody, X as UploadStartBody, Y as UpdateGrantBody, Z as routes, _ as FailTaskBody, a as ClaimReadyTaskBody, b as InboxAckBody, c as CreateChannelBody, d as CreateTasksBody, f as CreatedTasksQuery, g as ExplainQuery, h as EventsQuery, i as CancelTaskBody, j as RegisterBody, k as ReactBody, l as CreateGrantsBody, m as EditBody, n as AssignTaskBody, o as ClaimTaskBody, p as DeleteBody, q as ThreadsQuery, r as BlockTaskBody, s as CompleteTaskBody, t as AckBody, u as CreateTaskBody, w as LabelBody, x as InboxNextQuery, y as GrantBody, z as SourceReadQuery } from "./routes-BE0y6wCk.mjs";
3
+ import { A as Ref, B as SyncBody, C as InboxQuery, D as MessagesQuery, E as MatchesQuery, F as ScheduleBody, G as TaskNeedsBody, H as SyncFindQuery, I as SchedulesQuery, J as TypingBody, K as TasksQuery, L as SchemaBody, M as ReleaseTaskBody, N as RenewTaskBody, O as PostBody, P as RevokeGrantBody, R as SourceJoinBody, S as InboxPushBody, T as LinkedQuery, U as SyncImportBody, V as SyncCopiesQuery, W as SyncReceiptBody, X as UploadStartBody, Y as UpdateGrantBody, Z as routes, _ as FailTaskBody, a as ClaimReadyTaskBody, b as InboxAckBody, c as CreateChannelBody, d as CreateTasksBody, f as CreatedTasksQuery, g as ExplainQuery, h as EventsQuery, i as CancelTaskBody, j as RegisterBody, k as ReactBody, l as CreateGrantsBody, m as EditBody, n as AssignTaskBody, o as ClaimTaskBody, p as DeleteBody, q as ThreadsQuery, r as BlockTaskBody, s as CompleteTaskBody, t as AckBody, u as CreateTaskBody, w as LabelBody, x as InboxNextQuery, y as GrantBody, z as SourceReadQuery } from "./routes-BSBUdD2X.mjs";
4
4
  import { a as duplicateId, c as notFound, d as unauthorized, f as BoardError, h as eventsState, i as batchTooLarge, m as duration, n as RejectedError, o as forbidden, p as createBoardClient, r as badRequest, s as json, t as HttpError, u as toErrorResponse } from "./errors-DYF4hhIc.mjs";
5
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-DUKIITFZ.mjs";
6
6
  import { n as blocksIn, r as findBlocks } from "./blocks-CVoBC7ur.mjs";
7
7
  import { a as replaceMentions, i as mentionTerms, o as settleMentions, r as mentionTerm, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
8
- import { t as VERSION } from "./version-C70RLVEK.mjs";
8
+ import { t as VERSION } from "./version-DWvOShz3.mjs";
9
9
  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-BbgmsAFF.mjs";
10
- import { a as runMatch, d as openapi, f as queryObject, h as SYNC, i as canonicalWatchers, l as METHODS, m as readJson, n as SYNC_ACTOR, o as compileWatcher, p as readCapped, r as syncTarget, t as batchPlan, u as createRouter } from "./task-batch-9lVDG3d-.mjs";
10
+ import { a as runMatch, d as openapi, f as queryObject, h as SYNC, i as canonicalWatchers, l as METHODS, m as readJson, n as SYNC_ACTOR, o as compileWatcher, p as readCapped, r as syncTarget, t as batchPlan, u as createRouter } from "./task-batch-CE6BKnRw.mjs";
11
11
  import { C as verifiesTokens, E as explainGrants, S as verifiedIssuers, d as createAuthority, f as fromTokens, m as hostPrincipal, o as VERCEL_ISSUER, p as grantIssuers, t as DEFAULT_CAN$1, v as namesByLogin } from "./auth-DJDTfgAL.mjs";
12
12
  import { a as resolveActor, o as viaOf, r as claimsOf, t as KNOWN_AGENTS } from "./actors-CX2D22hL.mjs";
13
13
  import { t as checkValue } from "./data-values-CoTP0SQG.mjs";
@@ -1543,13 +1543,14 @@ function createVercel(options, environment) {
1543
1543
  /**
1544
1544
  * An actor as the API names them, asked for by ID with everyone else named in the same turn: the
1545
1545
  * authors on a page cost one request however many actors the board has. Undefined for one the API
1546
- * doesn't have or a read that failed, which isn't kept; null when the API doesn't answer by ID.
1546
+ * doesn't have or a read that failed, which isn't kept; null when the API doesn't answer by ID. `strict` rejects
1547
+ * where the read failed, for a caller that must tell that from an actor the API doesn't have.
1547
1548
  */
1548
- function byId(who, id) {
1549
+ function byId(who, id, strict = false) {
1549
1550
  const names = namesOf(who);
1550
1551
  const { asked } = names;
1551
1552
  const kept = asked.get(id);
1552
- if (kept && Date.now() - kept.at <= NAMES_FRESH_MS) return kept.view;
1553
+ if (kept && Date.now() - kept.at <= NAMES_FRESH_MS) return strict && kept.failing || kept.view;
1553
1554
  let batch = names.asking;
1554
1555
  if (!batch || batch.ids.length >= NAMED_AT_ONCE) {
1555
1556
  const ids = [];
@@ -1563,15 +1564,17 @@ function createVercel(options, environment) {
1563
1564
  batch = names.asking = next;
1564
1565
  }
1565
1566
  batch.ids.push(id);
1566
- const view = batch.views.then((views) => views === null ? null : views.get(id), () => {
1567
+ const failing = batch.views.then((views) => views === null ? null : views.get(id));
1568
+ const view = failing.catch(() => {
1567
1569
  if (asked.get(id)?.view === view) asked.delete(id);
1568
1570
  });
1569
1571
  if (asked.size >= 1e4) asked.clear();
1570
1572
  asked.set(id, {
1571
1573
  at: Date.now(),
1572
- view
1574
+ view,
1575
+ failing
1573
1576
  });
1574
- return view;
1577
+ return strict ? failing : view;
1575
1578
  }
1576
1579
  /**
1577
1580
  * The name of the project `actor` is of, one of its deployments or their agents: as its own actor names it,
@@ -1875,8 +1878,10 @@ function createVercel(options, environment) {
1875
1878
  /**
1876
1879
  * What `--mentions` matches, in a message's text, as on any board: `me` is the caller's handle and
1877
1880
  * actor ID, as the API names them. Anyone else is the name as written and what's under it: a
1878
- * person's agents (`@julian/claude`), a project's imports. The API keeps no mentions, so this reads
1879
- * them from the text of each message a read covers.
1881
+ * person's agents (`@julian/claude`), a project's imports. A mention board() settled to an actor's
1882
+ * ID (`@[vercel:user:u_jb+claude]`) matches by that actor's handle, as the API names them, asked
1883
+ * for by ID; one the API doesn't name matches by its ID alone. The API keeps no mentions, so this
1884
+ * reads them from the text of each message a read covers.
1880
1885
  */
1881
1886
  async function mentionsOf(who, value) {
1882
1887
  if (value === void 0) return void 0;
@@ -1889,7 +1894,26 @@ function createVercel(options, environment) {
1889
1894
  terms = [mentionTerm(value)];
1890
1895
  prefixes = [value.includes(":") ? `${value}+` : `${mentionTerm(value)}/`];
1891
1896
  }
1892
- return (text) => mentionTerms(text).some((term) => terms.includes(term) || prefixes.some((prefix) => term.startsWith(prefix)));
1897
+ const named = (term) => terms.includes(term) || prefixes.some((prefix) => term.startsWith(prefix));
1898
+ const ids = (text) => value === "me" || value.includes(":") ? [] : mentionTerms(text).filter((term) => principalFrom(term) !== null);
1899
+ /**
1900
+ * The handle an ID goes by as the actors list shows it, which is what a `@handle` settles from: the API's own
1901
+ * (`pong/claude`), a deployment by its project's name. None for an ID the API names no one by: a handle made up
1902
+ * from it (an agent by its profile alone) would name another's. A read of the actors that fails fails this, so
1903
+ * a wait reads the same change again rather than going on past a mention it couldn't check.
1904
+ */
1905
+ const handleOf = async (id) => {
1906
+ const view = namesById ? await byId(who, id, true) : null;
1907
+ const found = view === null ? await listed(who, id) : view;
1908
+ return found ? shownHandle(id, found, projectNamesOf([[id, found]])) : null;
1909
+ };
1910
+ const mentioned = async (text) => {
1911
+ if (mentionTerms(text).some(named)) return true;
1912
+ return (await Promise.all(ids(text).map(handleOf))).some((handle) => handle !== null && named(mentionTerm(handle)));
1913
+ };
1914
+ return Object.assign(mentioned, { ahead: (texts) => {
1915
+ if (namesById) for (const text of texts) for (const id of ids(text)) byId(who, id);
1916
+ } });
1893
1917
  }
1894
1918
  const narrowOf = async (who, filters) => ({
1895
1919
  by: await byOf(who, filters.by),
@@ -1903,7 +1927,7 @@ function createVercel(options, environment) {
1903
1927
  async function matches(filters, message, thread, narrow) {
1904
1928
  if (filters.re !== void 0 && filters.re !== message.id && filters.re !== idAt(thread.id, 1)) return false;
1905
1929
  if (narrow.by && !narrow.by(message.createdBy)) return false;
1906
- if (filters.mentions !== void 0 && !narrow.mentions?.(message.text)) return false;
1930
+ if (filters.mentions !== void 0 && !await narrow.mentions?.(message.text)) return false;
1907
1931
  if (filters.from !== void 0 && !await narrow.source?.(message)) return false;
1908
1932
  if (filters.text !== void 0 && !message.text.toLowerCase().includes(filters.text.toLowerCase())) return false;
1909
1933
  for (const [key, values] of filters.label ?? []) {
@@ -2191,10 +2215,16 @@ function createVercel(options, environment) {
2191
2215
  }))))).flat();
2192
2216
  }
2193
2217
  const narrow = await narrowOf(who, filters);
2218
+ const read = [];
2219
+ for (const { thread, channel } of threads) read.push({
2220
+ thread,
2221
+ channel,
2222
+ all: whole(thread) ?? await threadMessages(who, thread.id, signal)
2223
+ });
2224
+ narrow.mentions?.ahead(read.flatMap(({ all }) => all.map((message) => message.text)));
2194
2225
  let newest = 0;
2195
2226
  const messages = [];
2196
- for (const { thread, channel } of threads) {
2197
- const all = whole(thread) ?? await threadMessages(who, thread.id, signal);
2227
+ for (const { thread, channel, all } of read) {
2198
2228
  const labeled = labeledBy(thread, all.find((message) => message.sequence === 1));
2199
2229
  for (const message of all) {
2200
2230
  newest = Math.max(newest, message.createdAt);
@@ -2375,6 +2405,7 @@ function createVercel(options, environment) {
2375
2405
  }))).sort((a, b) => a.change.createdAt - b.change.createdAt);
2376
2406
  const events = [];
2377
2407
  naming(who, merged.flatMap(({ change }) => [change.actor, ...change.currentMessage ? [change.currentMessage.createdBy] : []]));
2408
+ narrow.mentions?.ahead(merged.flatMap(({ change }) => change.currentMessage ? [change.currentMessage.text] : []));
2378
2409
  const start = {
2379
2410
  ...position.past !== void 0 ? { past: position.past } : {},
2380
2411
  ...position.floor !== void 0 ? { floor: position.floor } : {}
@@ -2471,6 +2502,7 @@ function createVercel(options, environment) {
2471
2502
  },
2472
2503
  signal
2473
2504
  });
2505
+ narrow.mentions?.ahead(page.messages.map((message) => message.text));
2474
2506
  for (const message of page.messages) if (await keep(message)) kept.push(message);
2475
2507
  return {
2476
2508
  messages: kept.slice(-limit),
@@ -2488,6 +2520,7 @@ function createVercel(options, environment) {
2488
2520
  signal
2489
2521
  });
2490
2522
  cursor = page.cursor;
2523
+ narrow.mentions?.ahead(page.messages.map((message) => message.text));
2491
2524
  for (const message of page.messages) if (await keep(message)) kept.push(message);
2492
2525
  if (page.messages.length === 0) break;
2493
2526
  }
@@ -2517,6 +2550,7 @@ function createVercel(options, environment) {
2517
2550
  cursor = page.cursor;
2518
2551
  const events = [];
2519
2552
  naming(who, page.events.flatMap((change) => [change.actor, ...change.currentMessage ? [change.currentMessage.createdBy] : []]));
2553
+ narrow.mentions?.ahead(page.events.flatMap((change) => change.currentMessage ? [change.currentMessage.text] : []));
2520
2554
  for (const change of page.events) {
2521
2555
  const message = change.currentMessage;
2522
2556
  const found = message && change.threadId ? {
@@ -2750,11 +2784,19 @@ function createVercel(options, environment) {
2750
2784
  }
2751
2785
  /** A match as vboard hands it out: its event as `vb tail --json` prints it, with its message as it is now. */
2752
2786
  async function matchOf(who, match, filters) {
2753
- const found = await messageIn(who, match.event.messageId).catch((error) => {
2787
+ const current = match.event.currentMessage;
2788
+ const found = current && !filters.label?.length ? {
2789
+ message: current,
2790
+ thread: {
2791
+ id: match.threadId,
2792
+ channelId: match.event.channelId
2793
+ },
2794
+ channel: await channelById(who, match.event.channelId)
2795
+ } : await messageIn(who, match.event.messageId).catch((error) => {
2754
2796
  if (error instanceof HttpError && error.status === 404) return null;
2755
2797
  throw error;
2756
2798
  });
2757
- if (!found) return null;
2799
+ if (!found?.channel) return null;
2758
2800
  const { channel } = found;
2759
2801
  const event = match.event.type === "thread.synced" ? await syncedOf(who, match, found.message, channel.name) : await eventOf(who, match.event, channel.name, match.id, filters, await narrowOf(who, filters), found);
2760
2802
  if (!event?.message) return null;
@@ -5002,9 +5044,11 @@ async function createServe(context) {
5002
5044
  const watch = options.watch ?? {};
5003
5045
  const middleware = options.middleware ?? [];
5004
5046
  /** What a request says about who it is, none of it verified yet: its bearer token, its claims, and the board's URL. */
5005
- function requestOf(request, audience) {
5047
+ function requestOf(request, at) {
5048
+ const credential = (request.headers.get("authorization") ?? "").match(/^Bearer\s+(.+)$/i)?.[1] ?? null;
5049
+ const audience = credential === null ? options.url?.replace(/\/+$/, "") ?? at : audienceOf(at);
5006
5050
  return {
5007
- credential: (request.headers.get("authorization") ?? "").match(/^Bearer\s+(.+)$/i)?.[1] ?? null,
5051
+ credential,
5008
5052
  claims: claimsOf(request.headers),
5009
5053
  audience,
5010
5054
  headers: request.headers
@@ -5017,6 +5061,19 @@ async function createServe(context) {
5017
5061
  origin: { via: { kind: "api" } }
5018
5062
  };
5019
5063
  }
5064
+ let warned = false;
5065
+ /**
5066
+ * The URL a token's audience must be: `url`, or the one `at` reaches where something checks a request's
5067
+ * Host first. Anywhere else its sender chooses it, so a production board without `url` verifies no tokens.
5068
+ */
5069
+ function audienceOf(at) {
5070
+ if (options.url) return options.url.replace(/\/+$/, "");
5071
+ if (hostTrusted(options)) return at;
5072
+ if (typeof process !== "undefined" && process.env.NODE_ENV === "production") throw new HttpError(500, "no_board_url", "this board has no URL to check a token's audience against, and outside Vercel a request's Host is its sender's to choose", { hint: "Pass board({ url: 'https://<host>/api/board' }), the URL people reach it at." });
5073
+ if (!warned) console.warn(`[board] no url: verifying tokens for ${at}, the host requests name. Pass board({ url }) before this serves in production.`);
5074
+ warned = true;
5075
+ return at;
5076
+ }
5020
5077
  /**
5021
5078
  * What a board that serves no requests answers them: one that uses another board's. One on
5022
5079
  * Vercel's still takes wake-ups and webhooks; one at `BOARD_URL` has neither.
@@ -5901,7 +5958,7 @@ async function createServe(context) {
5901
5958
  if (!match) throw notFound(`no route: ${request.method} ${url.pathname}`);
5902
5959
  const { target } = match;
5903
5960
  if (!injected && !match.root && (state.learned === null || state.learned.startsWith(`${match.base}/`))) state.learned = match.base;
5904
- const boardUrl = (options.url ?? `${url.origin}${match.base}`).replace(/\/+$/, "");
5961
+ const at = `${url.origin}${match.base}`.replace(/\/+$/, "");
5905
5962
  if (target.kind === "board" && target.name === "webhook") {
5906
5963
  if (!engine || !entries[match.params.key ?? ""]) throw notFound(`no sync entry named ${match.params.key}`);
5907
5964
  return await engine.handleWebhook(match.params.key, request);
@@ -5920,10 +5977,10 @@ async function createServe(context) {
5920
5977
  param: match.param
5921
5978
  });
5922
5979
  if (!injected && !policy.open) throw servesOnly();
5923
- if (!injected && target.kind === "protocol" && target.name === "discovery") return json(await discovery(request, boardUrl, request.signal));
5980
+ if (!injected && target.kind === "protocol" && target.name === "discovery") return json(await discovery(request, audienceOf(at), request.signal));
5924
5981
  if (target.kind === "protocol" && typeof backend[target.name] !== "function") throw notFound(`no route: ${request.method} ${url.pathname}`);
5925
5982
  const own = injected && "platform" in injected ? engine.caller : injected;
5926
- const asked = own ? null : requestOf(request, boardUrl);
5983
+ const asked = own ? null : requestOf(request, at);
5927
5984
  const caller = own ?? await callerOf(asked);
5928
5985
  if (target.kind === "board") return await serve(target.name, caller, request, url, match.params);
5929
5986
  const input = await inputOf(target.name, request, url, match.params);
@@ -5988,6 +6045,14 @@ async function createServe(context) {
5988
6045
  }
5989
6046
  //#endregion
5990
6047
  //#region src/server/board.ts
6048
+ const hostChecked = /* @__PURE__ */ new WeakSet();
6049
+ /** `options`, for a board behind a server that lets a request name only hosts it allows, as `vb serve` does. */
6050
+ function hostCheckedBy(options) {
6051
+ hostChecked.add(options);
6052
+ return options;
6053
+ }
6054
+ /** Whether a board without `url` can take it from a request's Host: on Vercel, or behind a server that checks Host. */
6055
+ const hostTrusted = (options) => hostChecked.has(options) || typeof process !== "undefined" && process.env.VERCEL === "1";
5991
6056
  /** 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. */
5992
6057
  const STOPPED_BY = Symbol.for("@vercel/board/stopped-by");
5993
6058
  /**
@@ -6411,4 +6476,4 @@ async function createTasksInChunks(board, channel, tasks, options = {}) {
6411
6476
  return created;
6412
6477
  }
6413
6478
  //#endregion
6414
- export { stoppedBy as a, PROTOCOL_ROUTES as c, deployedOnVercel as d, isBoardName as i, withoutToken as l, createTasksInChunks as n, createVercel as o, createBoard as r, isApiMessageId as s, TasksInChunksError as t, tailWatchers as u };
6479
+ export { isBoardName as a, isApiMessageId as c, tailWatchers as d, deployedOnVercel as f, hostCheckedBy as i, PROTOCOL_ROUTES as l, createTasksInChunks as n, stoppedBy as o, createBoard as r, createVercel as s, TasksInChunksError as t, withoutToken as u };
@@ -1,6 +1,6 @@
1
1
  import { $ as MessageView } from "./routes-B6SEA9yw.mjs";
2
2
  import "./auth-Z9-Khvvw.mjs";
3
- import "./backend-CcaaS9Xl.mjs";
3
+ import "./backend-C2JUnbm5.mjs";
4
4
  import { g as TaskInBatch, n as BoardError } from "./client-C2T4eaXd.mjs";
5
5
  //#region src/client/chunks.d.ts
6
6
  /** What `createTasksInChunks` makes tasks with: a handle, or anything with its `tasks.createMany`. */
@@ -152,6 +152,10 @@ const channelOf = (externalThread) => {
152
152
  const colon = externalThread.slice(at + 1).indexOf(":");
153
153
  return colon === -1 ? externalThread : externalThread.slice(0, at + 1 + colon);
154
154
  };
155
- const externalMessageKey = (thread, message) => `${thread}|${message}`;
155
+ /**
156
+ * One key for a platform message in a platform thread. The thread's own `|` and `\` are escaped, so
157
+ * its end is the first bare `|`: (`a`, `b|c`) and (`a|b`, `c`) are two keys.
158
+ */
159
+ const externalMessageKey = (thread, message) => `${thread.replace(/[\\|]/g, "\\$&")}|${message}`;
156
160
  //#endregion
157
161
  export { Link as a, externalMessageKey as c, ExternalTarget as i, isThreadTarget as l, ExternalEvent as n, Origin as o, ExternalLocation as r, channelOf as s, ExternalAuthor as t };
@@ -1,5 +1,5 @@
1
- import { f as Board, p as BoardOptions } from "./backend-CcaaS9Xl.mjs";
2
- import "./exports-lmr6UHHc.mjs";
1
+ import { f as Board, p as BoardOptions } from "./backend-C2JUnbm5.mjs";
2
+ import "./exports-DkdCh3Zi.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,8 @@
1
1
  import { $ as MessageView, $t as TasksQueryInput, A as FailTaskBody, At as SourceJoinBody, B as InboxEntry, Bt as SyncImportBody, C as Discovery, Ct as SchedulesQuery, D as EventsQueryInput, Dt as SchemaInput, E as EventsQuery, Et as SchemaBody, F as GrantInput, Ft as SyncCopiesQuery, G as LABEL_CONDITIONS_MAX, Gt as SyncedView, H as InboxNextQuery, Ht as SyncReceiptBody, I as GrantView, It as SyncCopiesView, J as LinkView, Jt as TaskClaim, K as LEASE_DEFAULT_S, Kt as THREADS_LIMIT_DEFAULT, L as GrantWriteOptions, Lt as SyncFindInput, M as GRANT_BATCH_MAX, Mn as Attachment, Mt as SourceRead, N as GrantBody, Nt as SourceReadQuery, O as ExplainQuery, Ot as SchemaView, P as GrantCan, Pt as SyncBody, Q as Me, Qt as TasksQuery, R as INBOX_EVENT_ID_MAX, Rt as SyncFindQuery, S as DeleteBody, St as ScheduleView, T as EventsPage, Tt as SchedulesQueryOutput, U as InboxPushBody, Ut as SyncReceiptInput, V as InboxItem, Vt as SyncImportInput, W as InboxQuery, Wt as SyncThreadView, X as MatchView, Xt as TaskView, Y as LinkedQuery, Yt as TaskNeedsBody, Z as MatchesQuery, Zt as TasksPage, _ as CreateTaskBody, _t as RevokeGrantBody, a as BlockTaskBody, an as TypingBody, at as PostInput, b as CreateTasksInput, bt as ScheduleBodyOutput, c as CanAt, cn as UpdateGrantInput, ct as REGISTERED_WATCHERS_MAX, d as ClaimReadyTaskBody, dn as routes, dt as RegisterBody, en as ThreadSummaryView, et as MessagesPage, f as ClaimReadyTaskInput, ft as RegisterInput, g as CreateGrantsBody, gt as ResolvedSyncTarget, h as CreateChannelBody, ht as RenewTaskBody, i as AssignTaskBody, in as ThreadsQueryInput, it as PostBody, j as FiltersInput, jt as SourceMessage, k as Explanation, kt as SourceJoin, l as CancelTaskBody, ln as UploadStartBody, lt as ReactBody, m as CompleteTaskBody, mt as ReleaseTaskBody, n as ActorView, nn as ThreadsPage, nt as MessagesQueryInput, o as BlockView, on as TypingResult, ot as PrincipalInput, p as ClaimTaskBody, pt as RegistrationView, q as LabelBody, qt as THREADS_LIMIT_MAX, r as ApiError, rn as ThreadsQuery, rt as ParsedFilters, s as BoardEventView, sn as UpdateGrantBody, st as PrincipalView, t as AckBody, tn as ThreadView, tt as MessagesQuery, u as ChannelView, un as UploadTicket, ut as Ref, v as CreateTaskInput, vt as RouteName, w as EditBody, wt as SchedulesQueryInput, x as CreatedTasksQuery, xt as ScheduleInput, y as CreateTasksBody, yt as ScheduleBody, z as InboxAckBody, zt as SyncFindView } from "./routes-B6SEA9yw.mjs";
2
2
  import { i as Claims, r as CallerRequest } from "./auth-Z9-Khvvw.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-CcaaS9Xl.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-C2JUnbm5.mjs";
4
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-C2T4eaXd.mjs";
5
- import { n as TasksInChunksError, r as createTasksInChunks, t as TaskBatches } from "./exports-lmr6UHHc.mjs";
5
+ import { n as TasksInChunksError, r as createTasksInChunks, t as TaskBatches } from "./exports-DkdCh3Zi.mjs";
6
6
  import { n as block } from "./blocks-DGvh2alZ.mjs";
7
7
  //#region src/server/index.default.d.ts
8
8
  /**
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { f as BoardError, m as duration, t as HttpError } from "./errors-DYF4hhIc.mjs";
2
2
  import { t as DroppedError } from "./middleware-DUKIITFZ.mjs";
3
3
  import { t as block } from "./blocks-CVoBC7ur.mjs";
4
- import { n as createTasksInChunks, o as createVercel, r as createBoard, t as TasksInChunksError } from "./exports-CuD-Mxkw.mjs";
4
+ import { n as createTasksInChunks, r as createBoard, s as createVercel, t as TasksInChunksError } from "./exports-DRId1Cks.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-DJZ8Xy_g.mjs"),
27
+ sync: () => import("./engine-I887QHnP.mjs"),
28
28
  serving: null,
29
29
  sandbox: null
30
30
  });
@@ -1,8 +1,8 @@
1
1
  import { $ as MessageView, $t as TasksQueryInput, A as FailTaskBody, At as SourceJoinBody, B as InboxEntry, Bt as SyncImportBody, C as Discovery, Ct as SchedulesQuery, D as EventsQueryInput, Dt as SchemaInput, E as EventsQuery, Et as SchemaBody, F as GrantInput, Ft as SyncCopiesQuery, G as LABEL_CONDITIONS_MAX, Gt as SyncedView, H as InboxNextQuery, Ht as SyncReceiptBody, I as GrantView, It as SyncCopiesView, J as LinkView, Jt as TaskClaim, K as LEASE_DEFAULT_S, Kt as THREADS_LIMIT_DEFAULT, L as GrantWriteOptions, Lt as SyncFindInput, M as GRANT_BATCH_MAX, Mn as Attachment, Mt as SourceRead, N as GrantBody, Nt as SourceReadQuery, O as ExplainQuery, Ot as SchemaView, P as GrantCan, Pt as SyncBody, Q as Me, Qt as TasksQuery, R as INBOX_EVENT_ID_MAX, Rt as SyncFindQuery, S as DeleteBody, St as ScheduleView, T as EventsPage, Tt as SchedulesQueryOutput, U as InboxPushBody, Ut as SyncReceiptInput, V as InboxItem, Vt as SyncImportInput, W as InboxQuery, Wt as SyncThreadView, X as MatchView, Xt as TaskView, Y as LinkedQuery, Yt as TaskNeedsBody, Z as MatchesQuery, Zt as TasksPage, _ as CreateTaskBody, _t as RevokeGrantBody, a as BlockTaskBody, an as TypingBody, at as PostInput, b as CreateTasksInput, bt as ScheduleBodyOutput, c as CanAt, cn as UpdateGrantInput, ct as REGISTERED_WATCHERS_MAX, d as ClaimReadyTaskBody, dn as routes, dt as RegisterBody, en as ThreadSummaryView, et as MessagesPage, f as ClaimReadyTaskInput, ft as RegisterInput, g as CreateGrantsBody, gt as ResolvedSyncTarget, h as CreateChannelBody, ht as RenewTaskBody, i as AssignTaskBody, in as ThreadsQueryInput, it as PostBody, j as FiltersInput, jt as SourceMessage, k as Explanation, kt as SourceJoin, l as CancelTaskBody, ln as UploadStartBody, lt as ReactBody, m as CompleteTaskBody, mt as ReleaseTaskBody, n as ActorView, nn as ThreadsPage, nt as MessagesQueryInput, o as BlockView, on as TypingResult, ot as PrincipalInput, p as ClaimTaskBody, pt as RegistrationView, q as LabelBody, qt as THREADS_LIMIT_MAX, r as ApiError, rn as ThreadsQuery, rt as ParsedFilters, s as BoardEventView, sn as UpdateGrantBody, st as PrincipalView, t as AckBody, tn as ThreadView, tt as MessagesQuery, u as ChannelView, un as UploadTicket, ut as Ref, v as CreateTaskInput, vt as RouteName, w as EditBody, wt as SchedulesQueryInput, x as CreatedTasksQuery, xt as ScheduleInput, y as CreateTasksBody, yt as ScheduleBody, z as InboxAckBody, zt as SyncFindView } from "./routes-B6SEA9yw.mjs";
2
2
  import { i as Claims, r as CallerRequest } from "./auth-Z9-Khvvw.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-CcaaS9Xl.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-C2JUnbm5.mjs";
4
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-C2T4eaXd.mjs";
5
- import { n as TasksInChunksError, r as createTasksInChunks, t as TaskBatches } from "./exports-lmr6UHHc.mjs";
5
+ import { n as TasksInChunksError, r as createTasksInChunks, t as TaskBatches } from "./exports-DkdCh3Zi.mjs";
6
6
  import { n as block } from "./blocks-DGvh2alZ.mjs";
7
- import { t as board } from "./index-_KxJu15n.mjs";
7
+ import { t as board } from "./index-DpuOtt0J.mjs";
8
8
  export { type AckBody, type ActorView, 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 Caller, type CallerRequest, type CanAt, type CancelTaskBody, type ChannelView, 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 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 MessagesQuery, type MessagesQueryInput, 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 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
1
  import { f as BoardError, m as duration, t as HttpError } from "./errors-DYF4hhIc.mjs";
2
2
  import { t as DroppedError } from "./middleware-DUKIITFZ.mjs";
3
3
  import { t as block } from "./blocks-CVoBC7ur.mjs";
4
- import { n as createTasksInChunks, t as TasksInChunksError } from "./exports-CuD-Mxkw.mjs";
5
- import { t as board } from "./server-ViWNvg5q.mjs";
4
+ import { n as createTasksInChunks, t as TasksInChunksError } from "./exports-DRId1Cks.mjs";
5
+ import { t as board } from "./server-BLQxoL0g.mjs";
6
6
  export { BoardError, DroppedError, HttpError, TasksInChunksError, block, board, createTasksInChunks, duration };