@vercel/board 0.48.0 → 0.48.1

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.
@@ -1,2 +1,2 @@
1
- import { t as local } from "./local-CKMP4xH3.mjs";
1
+ import { t as local } from "./local-BdKxz-Dn.mjs";
2
2
  export { local };
@@ -1,6 +1,3 @@
1
- //#region src/contract/bots.ts
2
- /** Vercel for GitHub's bot account (`vercel[bot]`), as the board names it. */
3
- const VERCEL_BOT = "github:user:35613825";
4
1
  const VERCEL_MARKER = /^\[vc\]: #\S*\r?\n/;
5
2
  const LINK = /\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g;
6
3
  const STATUS = /!\[([^\]]+)\]\(https:\/\/vercel\.com\/static\/status\/[^)]+\)\s*(?:\[[^\]]*\]\((https?:\/\/[^)\s]+)\))?/;
@@ -60,13 +57,23 @@ function formatVercelDeployments(deployments) {
60
57
  }).join("\n");
61
58
  }
62
59
  /**
60
+ * Whether Vercel for GitHub's bot wrote it: the bot itself, where its platform ID is its actor, or,
61
+ * on a board where an import is by a profile of the syncing principal
62
+ * (`<principal>+github:user:35613825`), that principal's import of it from GitHub, which the board
63
+ * checked (`verified`). A profile that only carries the bot's name, or one that isn't an import, isn't.
64
+ */
65
+ function byVercelBot(written, author) {
66
+ if (written.by.actor === "github:user:35613825") return true;
67
+ return written.by.profile === "github:user:35613825" && !!written.from && author?.kind === "external" && author.verified === true && author.platform === "github";
68
+ }
69
+ /**
63
70
  * A message's text as people should see it: known bot messages in their
64
- * readable form, anything else as is. Only the bot itself gets that form, so
65
- * no one can hide a message's text behind a look-alike table.
71
+ * readable form, anything else as is. Only the bot itself gets that form
72
+ * (`byVercelBot`), so no one can hide a message's text behind a look-alike table.
66
73
  */
67
- function displayText(text, actor) {
68
- const deployments = actor === "github:user:35613825" ? vercelDeployments(text) : null;
74
+ function displayText(text, bot) {
75
+ const deployments = bot ? vercelDeployments(text) : null;
69
76
  return deployments ? `**▲ Vercel**\n${formatVercelDeployments(deployments)}` : text;
70
77
  }
71
78
  //#endregion
72
- export { vercelDeployments as i, displayText as n, formatVercelDeployments as r, VERCEL_BOT as t };
79
+ export { vercelDeployments as i, displayText as n, formatVercelDeployments as r, byVercelBot as t };
@@ -1,5 +1,5 @@
1
- import { a as stoppedBy } from "./exports-B5xOYHj_.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-DZZQEFVl.mjs";
1
+ import { a as stoppedBy } from "./exports-BzSG0_wL.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-BgiViRZ8.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-Dk6_cHLS.mjs";
3
- import { m as projectDir } from "./server-DmlyIzMj.mjs";
4
- import { r as main } from "./main-DZZQEFVl.mjs";
5
- import { i as createInspector, r as stopped, t as allowedHosts } from "./inspect-CAz9PGLf.mjs";
3
+ import { m as projectDir } from "./server-EOQC5Gtq.mjs";
4
+ import { r as main } from "./main-BgiViRZ8.mjs";
5
+ import { i as createInspector, r as stopped, t as allowedHosts } from "./inspect-n9brh-TT.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-CNECs4UG.mjs")).inspect(context);
40
+ return (await import("./inspect-BB-XUPuz.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-DBJTP0xd.mjs");
84
+ const { serveLocal } = await import("./serve-C2Jbr7pR.mjs");
85
85
  const local = await serveLocal({
86
86
  dir: flags.dir ?? join(root, ".board"),
87
87
  hosts,
@@ -5,7 +5,7 @@ import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
5
5
  import { a as waitUntil, c as platformProfile, f as viaText, i as afterRetry, l as shownName, m as derivedId, o as actorParts, t as DroppedError } from "./middleware-CT6vMNUc.mjs";
6
6
  import { a as replaceMentions, n as isEmail, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
7
7
  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-B-qyxNsJ.mjs";
8
- import { i as vercelDeployments, n as displayText } from "./bots-CLKKMgYf.mjs";
8
+ import { i as vercelDeployments, n as displayText, t as byVercelBot } from "./bots-CqPYxkqK.mjs";
9
9
  //#region src/sync/engine.ts
10
10
  /** `files`: a message with files may have no text. */
11
11
  const clampText = (raw, files = false) => {
@@ -1010,10 +1010,11 @@ function createSyncEngine(entries) {
1010
1010
  const name = `${own}${after}`;
1011
1011
  const attribution = `${environment}${after}`;
1012
1012
  const platform = platformOf(key);
1013
+ const bot = byVercelBot(message, actor);
1013
1014
  const body = (renderer ?? ((input) => platform.render(input)))(immutable({
1014
1015
  message: {
1015
1016
  ...structuredClone(message),
1016
- text: displayText(message.text, message.by.actor)
1017
+ text: displayText(message.text, bot)
1017
1018
  },
1018
1019
  author: actor ? { ...actor } : null,
1019
1020
  mentionOf: (id) => nativeMention(key, id, actors),
@@ -1023,7 +1024,7 @@ function createSyncEngine(entries) {
1023
1024
  if (typeof body !== "string") throw badRequest("a provider renderer must return markdown");
1024
1025
  const labeled = `**${name}**: `;
1025
1026
  const markdown = await textFor(key, actors, body.startsWith(labeled) && opensBlock(body.slice(labeled.length)) ? `**${name}**:\n\n${body.slice(labeled.length)}` : body);
1026
- const deployments = message.by.actor === "github:user:35613825" ? vercelDeployments(message.text) : null;
1027
+ const deployments = bot ? vercelDeployments(message.text) : null;
1027
1028
  return {
1028
1029
  markdown,
1029
1030
  ...actor?.verified ? { as: {
@@ -4,7 +4,7 @@ import { A as RegisterBody, B as SyncFindQuery, C as LabelBody, D as PostBody, E
4
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-CT6vMNUc.mjs";
5
5
  import { n as blocksIn, r as findBlocks } from "./blocks-CVoBC7ur.mjs";
6
6
  import { a as replaceMentions, i as mentionTerms, o as settleMentions, r as mentionTerm, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
7
- import { a as runMatch, d as openapi, f as queryObject, g as VERSION, 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-CmKvTLSu.mjs";
7
+ import { a as runMatch, d as openapi, f as queryObject, g as VERSION, 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-D4p9N8lN.mjs";
8
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-C06pIr0M.mjs";
9
9
  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-B9-wXQ-x.mjs";
10
10
  import { a as resolveActor, o as viaOf, r as claimsOf, t as KNOWN_AGENTS } from "./actors-Dkyg-oo0.mjs";
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { f as BoardError, m as duration, t as HttpError } from "./errors-QhkdzI-o.mjs";
2
2
  import { t as DroppedError } from "./middleware-CT6vMNUc.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-B5xOYHj_.mjs";
4
+ import { n as createTasksInChunks, o as createVercel, r as createBoard, t as TasksInChunksError } from "./exports-BzSG0_wL.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-B3Yd0OPc.mjs"),
27
+ sync: () => import("./engine-BQ0hJw2w.mjs"),
28
28
  serving: null,
29
29
  sandbox: null
30
30
  });
@@ -1,6 +1,6 @@
1
1
  import { f as BoardError, m as duration, t as HttpError } from "./errors-QhkdzI-o.mjs";
2
2
  import { t as DroppedError } from "./middleware-CT6vMNUc.mjs";
3
3
  import { t as block } from "./blocks-CVoBC7ur.mjs";
4
- import { n as createTasksInChunks, t as TasksInChunksError } from "./exports-B5xOYHj_.mjs";
5
- import { t as board } from "./server-DmlyIzMj.mjs";
4
+ import { n as createTasksInChunks, t as TasksInChunksError } from "./exports-BzSG0_wL.mjs";
5
+ import { t as board } from "./server-EOQC5Gtq.mjs";
6
6
  export { BoardError, DroppedError, HttpError, TasksInChunksError, block, board, createTasksInChunks, duration };