@vercel/board 0.35.0 → 0.37.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 (80) hide show
  1. package/dist/access.d.mts +2 -2
  2. package/dist/access.mjs +1 -1
  3. package/dist/{actors-DFOpTw89.mjs → actors-uoD62kiN.mjs} +1 -0
  4. package/dist/{auth-C21V0EK1.d.mts → auth-BHXgi696.d.mts} +1 -1
  5. package/dist/{backend-D21q8mdm.d.mts → backend-BIvl2z1z.d.mts} +3 -9
  6. package/dist/backend-local.d.mts +1 -1
  7. package/dist/backend-local.mjs +1 -1
  8. package/dist/{chat-provider-9hCT654s.mjs → chat-provider-C0WUS3-G.mjs} +2 -2
  9. package/dist/{chat-provider-DmZCmBkb.d.mts → chat-provider-DFYEReZL.d.mts} +2 -2
  10. package/dist/cli-commands.d.mts +1 -1
  11. package/dist/cli-commands.mjs +1 -1
  12. package/dist/cli-embedded.d.mts +18 -2
  13. package/dist/cli-embedded.mjs +22 -4
  14. package/dist/cli.mjs +50 -676
  15. package/dist/{commands-CENWob9m.mjs → commands-D2pFCMSh.mjs} +19 -6
  16. package/dist/{commands-BorACIFS.d.mts → commands-DGID-4Z2.d.mts} +4 -2
  17. package/dist/{conformance-CKrwglzA.mjs → conformance-rCrc_mwi.mjs} +2 -3
  18. package/dist/conformance.d.mts +1 -1
  19. package/dist/conformance.mjs +1 -1
  20. package/dist/digest-CLGw7653.mjs +4 -0
  21. package/dist/{engine-wN7quvbU.mjs → engine-COa73McY.mjs} +17 -13
  22. package/dist/{events-IQg0k281.mjs → events-v8f7pF9f.mjs} +22 -8
  23. package/dist/exports-Bb0m03fT.d.mts +4 -0
  24. package/dist/{exports-GIRJm2Ja.mjs → exports-DTezg4xR.mjs} +776 -173
  25. package/dist/{external-CYe424fO.mjs → external-BA2aCC_3.mjs} +1 -1
  26. package/dist/{index-LREsSZb2.d.mts → index-B1TZrMMu.d.mts} +2 -2
  27. package/dist/index.d.mts +5 -5
  28. package/dist/index.mjs +3 -3
  29. package/dist/index.node.d.mts +5 -5
  30. package/dist/index.node.mjs +2 -2
  31. package/dist/inspect/app.js +35 -35
  32. package/dist/inspect/engine.js +5 -5
  33. package/dist/inspect-B8c0Wh5Z.mjs +2 -0
  34. package/dist/inspect-CoFk2Xj7.mjs +643 -0
  35. package/dist/{local-yKwdgukb.mjs → local-Cm7a7_Q0.mjs} +14 -69
  36. package/dist/{main-DjokcEAL.mjs → main-DoZ8IFPb.mjs} +17 -13
  37. package/dist/{memory-7RRnLa4X.mjs → memory-DqwXlyK4.mjs} +2 -2
  38. package/dist/{middleware-BxgizazV.mjs → middleware-k_XKQ6f7.mjs} +9 -1
  39. package/dist/page-BAQpb-s-.mjs +2 -0
  40. package/dist/page-LysMGAl3.mjs +30 -0
  41. package/dist/{provider-DEOfc4Ls.d.mts → provider-7pOnK8Jw.d.mts} +5 -3
  42. package/dist/{routes-BpKdMvgX.d.mts → routes-BtsZzal-.d.mts} +0 -17
  43. package/dist/{serve-CJ8hauK2.mjs → serve-2U_JPJtS.mjs} +2 -2
  44. package/dist/{server-CtaTtyhw.mjs → server-Drul_uwj.mjs} +18 -10
  45. package/dist/{sql-BQzKUqQt.mjs → sql-aetuEBZC.mjs} +1 -1
  46. package/dist/{sqlite-DCtZFEVm.mjs → sqlite-DvsB8ENQ.mjs} +2 -2
  47. package/dist/{sqlite-db-qLTs52Ny.mjs → sqlite-db-BPwRoDI7.mjs} +1 -1
  48. package/dist/sync-chat-sdk.d.mts +2 -2
  49. package/dist/sync-chat-sdk.mjs +2 -2
  50. package/dist/sync-github.d.mts +2 -2
  51. package/dist/sync-github.mjs +2 -2
  52. package/dist/sync-linear.d.mts +3 -3
  53. package/dist/sync-linear.mjs +2 -2
  54. package/dist/sync-slack.d.mts +3 -3
  55. package/dist/sync-slack.mjs +3 -3
  56. package/dist/sync.d.mts +2 -2
  57. package/dist/sync.mjs +2 -2
  58. package/dist/{targets-n2i2ZOWI.mjs → targets-B0D4tJDY.mjs} +64 -19
  59. package/docs/01-board/01-mounting.md +11 -8
  60. package/docs/01-board/03-identity.md +3 -2
  61. package/docs/01-board/06-watchers.md +71 -40
  62. package/docs/01-board/09-access.md +1 -1
  63. package/docs/01-quickstart.md +1 -1
  64. package/docs/02-sync/01-overview.md +7 -7
  65. package/docs/02-sync/02-functions.md +5 -8
  66. package/docs/02-sync/03-slack.md +0 -8
  67. package/docs/02-sync/04-github.md +0 -8
  68. package/docs/02-sync/07-linear.md +0 -6
  69. package/docs/03-guides/01-coding-agents.md +1 -0
  70. package/docs/03-guides/02-inspector.md +3 -2
  71. package/docs/03-guides/03-ci.md +1 -1
  72. package/docs/03-guides/04-triage.md +8 -13
  73. package/docs/04-reference/01-cli.md +32 -8
  74. package/docs/04-reference/02-board.md +5 -0
  75. package/docs/04-reference/03-http.md +1 -1
  76. package/docs/04-reference/05-conformance.md +1 -1
  77. package/docs/index.md +3 -10
  78. package/package.json +2 -1
  79. package/dist/attempts-HXcskN1w.mjs +0 -10
  80. package/dist/exports-BxljH73E.d.mts +0 -4
@@ -220,6 +220,7 @@ const options = {
220
220
  project: {
221
221
  type: "string",
222
222
  multiple: true,
223
+ short: "p",
223
224
  value: "name|id",
224
225
  description: "a project's deployments"
225
226
  },
@@ -260,7 +261,8 @@ const options = {
260
261
  environment: {
261
262
  type: "string",
262
263
  multiple: true,
263
- value: "envs",
264
+ short: "e",
265
+ value: "environment",
264
266
  description: "where its --project runs"
265
267
  },
266
268
  workflow: {
@@ -269,7 +271,7 @@ const options = {
269
271
  value: "file",
270
272
  description: "its --github's workflow, e.g. ci.yml"
271
273
  },
272
- branch: {
274
+ "git-branch": {
273
275
  type: "string",
274
276
  multiple: true,
275
277
  value: "branch",
@@ -587,7 +589,7 @@ const commands = [
587
589
  option("environment", "where its --project runs (default: production)"),
588
590
  ...[
589
591
  "workflow",
590
- "branch",
592
+ "git-branch",
591
593
  "event",
592
594
  "claim"
593
595
  ].map((name) => option(name)),
@@ -608,7 +610,7 @@ const commands = [
608
610
  },
609
611
  {
610
612
  name: "two repositories' workflows",
611
- value: "grants create --github acme/web --workflow ci.yml --branch main --github acme/api --workflow deploy.yml --can 'ci/=post'"
613
+ value: "grants create --github acme/web --workflow ci.yml --git-branch main --github acme/api --workflow deploy.yml --can 'ci/=post'"
612
614
  },
613
615
  {
614
616
  name: "another issuer's tokens",
@@ -645,7 +647,7 @@ const commands = [
645
647
  "remove-everyone",
646
648
  "environment",
647
649
  "workflow",
648
- "branch",
650
+ "git-branch",
649
651
  "event",
650
652
  "claim"
651
653
  ].map((name) => option(name)), option("can", "replaces what it lets them do", "pattern=perms")],
@@ -673,7 +675,7 @@ const commands = [
673
675
  "app",
674
676
  "environment",
675
677
  "workflow",
676
- "branch",
678
+ "git-branch",
677
679
  "event",
678
680
  "claim"
679
681
  ].map((name) => option(name))],
@@ -1166,6 +1168,17 @@ const commands = [
1166
1168
  value: "wait dev --mentions --timeout 10m"
1167
1169
  }]
1168
1170
  },
1171
+ {
1172
+ group: "live",
1173
+ name: "inspect",
1174
+ description: "the board in your browser, as you: read, post, react (local only)",
1175
+ arguments: [],
1176
+ options: [option("port", "the port to listen on (default: a free one)"), option("no-open")],
1177
+ examples: [{
1178
+ name: "open the board in your browser",
1179
+ value: "inspect"
1180
+ }]
1181
+ },
1169
1182
  {
1170
1183
  group: "live",
1171
1184
  name: "help",
@@ -268,6 +268,7 @@ declare const options: {
268
268
  readonly project: {
269
269
  readonly type: 'string';
270
270
  readonly multiple: true;
271
+ readonly short: 'p';
271
272
  readonly value: 'name|id';
272
273
  readonly description: "a project's deployments";
273
274
  };
@@ -308,7 +309,8 @@ declare const options: {
308
309
  readonly environment: {
309
310
  readonly type: 'string';
310
311
  readonly multiple: true;
311
- readonly value: 'envs';
312
+ readonly short: 'e';
313
+ readonly value: 'environment';
312
314
  readonly description: 'where its --project runs';
313
315
  };
314
316
  readonly workflow: {
@@ -317,7 +319,7 @@ declare const options: {
317
319
  readonly value: 'file';
318
320
  readonly description: "its --github's workflow, e.g. ci.yml";
319
321
  };
320
- readonly branch: {
322
+ readonly 'git-branch': {
321
323
  readonly type: 'string';
322
324
  readonly multiple: true;
323
325
  readonly value: 'branch';
@@ -1037,7 +1037,6 @@ const CHECKS = [
1037
1037
  if (registered && (Object.keys(registered.watch).length > 0 || (registered.sync?.length ?? 0) > 0)) return "this token has watchers or a sync registered here, and checking would replace them";
1038
1038
  const byPath = (await ctx.board.discovery()).wake_by_path;
1039
1039
  const environment = /^vercel:project:[^:]+:(.+)$/.exec(ctx.me.principal)?.[1] ?? null;
1040
- if (byPath && environment !== null && environment !== "production" && environment !== "preview") return `a path wakes production or a preview, and this token is ${environment}'s`;
1041
1040
  const where = wokenAt(registered);
1042
1041
  const branch = environment === "preview" ? { branch: "conformance" } : {};
1043
1042
  const attempt = () => ctx.board.register({
@@ -1395,11 +1394,11 @@ async function conformance(board, options = {}) {
1395
1394
  status: "skipped",
1396
1395
  detail: `not kept here: ${error.message}`
1397
1396
  });
1398
- else if (group === "watchers" && error instanceof BoardError && error.code === "board_token_unsupported") checks.push({
1397
+ else if (group === "watchers" && error instanceof BoardError && error.code === "watchers_need_project") checks.push({
1399
1398
  group,
1400
1399
  name,
1401
1400
  status: "skipped",
1402
- detail: "a board token can't register watchers yet"
1401
+ detail: "only a deployment registers watchers here"
1403
1402
  });
1404
1403
  else checks.push({
1405
1404
  group,
@@ -1,4 +1,4 @@
1
- import { d as Board } from "./backend-D21q8mdm.mjs";
1
+ import { d as Board } from "./backend-BIvl2z1z.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-CKrwglzA.mjs";
1
+ import { t as conformance } from "./conformance-rCrc_mwi.mjs";
2
2
  export { conformance };
@@ -0,0 +1,4 @@
1
+ //#region src/inspect/digest.ts
2
+ const PAGE_SHA256 = "4f1478124855783385e763c2cc87539b5299c8c9c0325f1ec65db6b7284f3382";
3
+ //#endregion
4
+ export { PAGE_SHA256 as t };
@@ -1,11 +1,10 @@
1
1
  import { _ as fileSize, h as IMPORT_BYTES_MAX, p as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, y as typeOf } from "./errors-rYDxZEuN.mjs";
2
2
  import { a as ChannelPath, b as toStorable, d as MESSAGE_TEXT_MAX } from "./schemas-BG205xds.mjs";
3
- import { l as isThreadTarget, s as channelOf } from "./external-CYe424fO.mjs";
3
+ import { l as isThreadTarget, s as channelOf } from "./external-BA2aCC_3.mjs";
4
4
  import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
5
- import { i as waitUntil, o as derivedId, t as DroppedError } from "./middleware-BxgizazV.mjs";
5
+ import { a as waitUntil, i as afterRetry, s as derivedId, t as DroppedError } from "./middleware-k_XKQ6f7.mjs";
6
6
  import { n as replaceMentions } from "./mentions-CB6ShY4R.mjs";
7
- import { t as afterRetry } from "./attempts-HXcskN1w.mjs";
8
- import { a as immutable, d as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-IQg0k281.mjs";
7
+ import { a as immutable, d as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-v8f7pF9f.mjs";
9
8
  import { t as displayText } from "./bots-CGkO76qH.mjs";
10
9
  //#region src/sync/engine.ts
11
10
  /** `files`: a message with files may have no text. */
@@ -22,12 +21,12 @@ const keepsNoFiles = (error) => error instanceof HttpError && error.code === "no
22
21
  * A platform file on a board that keeps no files: a link to where it lives on the platform, which
23
22
  * its readers there can open, or its name when the platform gave no URL.
24
23
  */
25
- const fileLink = (file) => {
24
+ const fileLink = (file, why) => {
26
25
  const name = file.name ?? "a file";
27
- if (!file.url || !/^https?:\/\//.test(file.url)) return fileNote(file, "this board keeps no files");
26
+ if (!file.url || !/^https?:\/\//.test(file.url)) return fileNote(file, why);
28
27
  const label = name.replace(/[[\]\\]/g, (char) => `\\${char}`);
29
28
  const url = file.url.replace(/[ ()]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
30
- return fileNote(file, "this board keeps no files", `[${label}](${url})`);
29
+ return fileNote(file, why, `[${label}](${url})`);
31
30
  };
32
31
  /** A platform message's text with its file notes after it. */
33
32
  const withNotes = (text, notes) => notes.length ? `${text.trim() ? `${text}\n\n` : ""}${notes.join("\n")}` : text;
@@ -227,7 +226,11 @@ function createSyncEngine(entries) {
227
226
  "subthread" in event ? event.subthread : null
228
227
  ]) if (location !== null && !location.startsWith(`${key}:`)) throw badRequest(`provider locations must belong to sync entry ${key}`);
229
228
  const routes = routesFor(platformOf(key));
230
- if (routes && !await routes(native(event.channel), (name) => resolve(key, name)) && !await syncsThread(event.thread)) return;
229
+ const kept = routes && await routes(native(event.channel), (name) => resolve(key, name)).catch(async (error) => {
230
+ if (await syncsThread(event.thread)) return true;
231
+ throw error;
232
+ });
233
+ if (routes && !kept && !await syncsThread(event.thread)) return;
231
234
  await call("inboxPush", {
232
235
  key,
233
236
  events: [{
@@ -377,10 +380,11 @@ function createSyncEngine(entries) {
377
380
  async function importFiles(platform, files, attempt) {
378
381
  const attachments = [];
379
382
  const notes = [];
380
- let noFiles = false;
383
+ /** Why the board takes none of them, in its words, once it said so. */
384
+ let noFiles = null;
381
385
  for (const file of files.slice(0, 10)) {
382
- if (noFiles) {
383
- notes.push(fileLink(file));
386
+ if (noFiles !== null) {
387
+ notes.push(fileLink(file, noFiles));
384
388
  continue;
385
389
  }
386
390
  if (file.size !== void 0 && file.size > 26214400) {
@@ -422,8 +426,8 @@ function createSyncEngine(entries) {
422
426
  continue;
423
427
  }
424
428
  if (!keepsNoFiles(error)) throw error;
425
- noFiles = true;
426
- notes.push(fileLink(file));
429
+ noFiles = error.message;
430
+ notes.push(fileLink(file, noFiles));
427
431
  }
428
432
  }
429
433
  for (const file of files.slice(10)) notes.push(fileNote(file, `a message carries at most 10`));
@@ -1,5 +1,5 @@
1
1
  import { c as LabelKey, u as Labels } from "./schemas-BG205xds.mjs";
2
- import { n as ExternalEvent, r as ExternalLocation } from "./external-CYe424fO.mjs";
2
+ import { n as ExternalEvent, r as ExternalLocation } from "./external-BA2aCC_3.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/sync/fn.ts
5
5
  const ROUTES = Symbol.for("board.syncRoutes");
@@ -54,26 +54,32 @@ const follow = async (sync) => {
54
54
  * to every channel's function, with `channel` set to that one. A thread the board syncs outside
55
55
  * these channels (someone ran `vb sync` on it) stays synced both ways. A key the platform says
56
56
  * doesn't exist is skipped. While one can't be checked, an event outside the resolved channels
57
- * throws, so it's retried, rather than going past that key's function to the default. A new root
58
- * starts only in the channels that resolved.
57
+ * that it may be (any, for a name; its own, for an ID) throws, so it's retried, rather than
58
+ * going past that key's function to the default. The webhook keeps one an ID may be; one only a
59
+ * name may be, it refuses, so the platform sends it again and nothing off the map is stored. A
60
+ * new root starts only in the channels that resolved.
59
61
  */
60
62
  function channels(map) {
61
63
  const units = Object.entries(map).map(([name, unit]) => [name, typeof unit === "string" ? mirror(unit) : unit]);
62
64
  const resolved = async (resolve) => {
63
65
  const ids = await Promise.allSettled(units.map(([name]) => resolve(name)));
64
66
  const found = /* @__PURE__ */ new Map();
65
- let unchecked;
67
+ const unchecked = [];
66
68
  ids.forEach((id, i) => {
67
69
  if (id.status === "fulfilled") found.set(id.value, units[i][1]);
68
- else if (!channelMissing(id.reason)) unchecked ??= { reason: id.reason };
70
+ else if (!channelMissing(id.reason)) unchecked.push({
71
+ key: units[i][0],
72
+ reason: id.reason
73
+ });
69
74
  });
75
+ const pending = (channel) => unchecked.find(({ key }) => key.toLowerCase() === channel.toLowerCase()) ?? unchecked.find(({ key }) => key.startsWith("#"));
70
76
  return {
71
77
  found,
72
- unchecked
78
+ pending
73
79
  };
74
80
  };
75
81
  const fn = async (sync) => {
76
- const { found, unchecked } = await resolved(sync.resolve);
82
+ const { found, pending } = await resolved(sync.resolve);
77
83
  if (sync.direction === "out" && sync.target === null) {
78
84
  for (const [channel, unit] of found) await unit({
79
85
  ...sync,
@@ -83,10 +89,18 @@ function channels(map) {
83
89
  }
84
90
  const unit = found.get(sync.channel);
85
91
  if (unit) return void await unit(sync);
92
+ const unchecked = pending(sync.channel);
86
93
  if (unchecked) throw unchecked.reason;
87
94
  await follow(sync);
88
95
  };
89
- return withRoutes(fn, async (channel, resolve) => (await resolved(resolve)).found.has(channel));
96
+ return withRoutes(fn, async (channel, resolve) => {
97
+ const { found, pending } = await resolved(resolve);
98
+ if (found.has(channel)) return true;
99
+ const unchecked = pending(channel);
100
+ if (!unchecked) return false;
101
+ if (unchecked.key.startsWith("#")) throw unchecked.reason;
102
+ return true;
103
+ });
90
104
  }
91
105
  //#endregion
92
106
  //#region src/sync/provider.ts
@@ -0,0 +1,4 @@
1
+ import "./routes-BtsZzal-.mjs";
2
+ import "./auth-BHXgi696.mjs";
3
+ import "./backend-BIvl2z1z.mjs";
4
+ import "./provider-7pOnK8Jw.mjs";