@vercel/board 0.54.1 → 0.55.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.
@@ -1,7 +1,7 @@
1
1
  import { i as ATTACHMENT_BYTES_MAX, r as parseProfileHeader, t as InvalidProfileHeader } from "./profile-header-O8wC8yk8.mjs";
2
2
  import "./schemas-CUSTEFIy.mjs";
3
- import { t as Failed, u as who } from "./main-Dicvkp6D.mjs";
4
- import { n as relative, r as shell, t as CSP } from "./shell-DsDyOFd1.mjs";
3
+ import { t as Failed, u as who } from "./main-CSuYOx6C.mjs";
4
+ import { n as relative, r as shell, t as CSP } from "./shell-DB4WVhfU.mjs";
5
5
  import { t as page } from "./page-7KWSGxyC.mjs";
6
6
  import { randomBytes, timingSafeEqual } from "node:crypto";
7
7
  import { createServer } from "node:http";
@@ -0,0 +1,2 @@
1
+ import { n as inspect } from "./inspect-Aomn2jXK.mjs";
2
+ export { inspect };
package/dist/inspect.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as ATTACHMENT_BYTES_MAX, r as parseProfileHeader, t as InvalidProfileHeader } from "./profile-header-O8wC8yk8.mjs";
2
2
  import "./schemas-CUSTEFIy.mjs";
3
- import { n as relative, r as shell, t as CSP } from "./shell-DsDyOFd1.mjs";
3
+ import { n as relative, r as shell, t as CSP } from "./shell-DB4WVhfU.mjs";
4
4
  import { t as page } from "./page-7KWSGxyC.mjs";
5
5
  //#region src/inspect/handler.ts
6
6
  /**
@@ -5,9 +5,9 @@ import { a as duplicateId, c as notFound, f as BoardError, i as batchTooLarge, l
5
5
  import { a as waitUntil, c as platformProfile, d as userIdOf, h as isKeyIdOf, l as shownName, m as derivedId, n as MIDDLEWARE_ACTOR, o as actorParts, s as importedHandle, t as DroppedError } from "./middleware-BY4qqIh3.mjs";
6
6
  import { a as SCHEMA_DESCRIPTION_MAX, c as canonical, d as parseSchemaId, f as schemaId, i as BUILT_IN_SCHEMAS, l as checkDefinition, n as blocksIn, o as SCHEMA_NAME, s as SCHEMA_VERSION_MAX, u as isBuiltInName } from "./blocks-CVoBC7ur.mjs";
7
7
  import { a as replaceMentions, i as mentionTerms, n as isEmail, r as mentionTerm, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
8
- import { t as VERSION } from "./version-1isUFDyU.mjs";
8
+ import { t as VERSION } from "./version-1dDjcBkK.mjs";
9
9
  import { c as compileAccess, i as authorize, o as checkGrantChange, t as FULL_ACCESS, u as parseCan } from "./access-HzqFpgL_.mjs";
10
- import { _ as SYNC, a as runMatch, g as uploadName, h as carried, i as canonicalWatchers, l as METHODS, n as SYNC_ACTOR, o as compileWatcher, r as syncTarget, s as hasCriteria, t as batchPlan } from "./task-batch-BviIruES.mjs";
10
+ import { _ as SYNC, a as runMatch, g as uploadName, h as carried, i as canonicalWatchers, l as METHODS, n as SYNC_ACTOR, o as compileWatcher, r as syncTarget, s as hasCriteria, t as batchPlan } from "./task-batch-BSJ3ihpF.mjs";
11
11
  import { n as setOwn, t as own } from "./own-OwgPWdmh.mjs";
12
12
  import { E as wroteAs, T as workflowPath, b as removes, c as checkCan, g as joined, h as issuerName, l as checkGrant, n as GITHUB_ISSUER, p as grantIssuers, s as authenticates, u as checkPrincipal } from "./auth-D9ycDQK0.mjs";
13
13
  import { i as ownedActor, n as actorSeen, o as viaOf } from "./actors-D-u6bitG.mjs";
@@ -5,12 +5,12 @@ import { n as displayEmoji, r as normalizeEmoji } from "./emoji-CTLpvH-A.mjs";
5
5
  import { l as shownName } from "./middleware-BY4qqIh3.mjs";
6
6
  import { d as parseSchemaId, r as findBlocks, t as block } from "./blocks-CVoBC7ur.mjs";
7
7
  import { a as replaceMentions, n as isEmail, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
8
- import { t as VERSION } from "./version-1isUFDyU.mjs";
8
+ import { t as VERSION } from "./version-1dDjcBkK.mjs";
9
9
  import { r as PERMISSIONS } from "./access-HzqFpgL_.mjs";
10
- import { c as withMentions } from "./task-batch-BviIruES.mjs";
11
- import { a as isBoardName, l as isApiMessageId, n as createTasksInChunks, s as apiThreadRoot, t as TasksInChunksError } from "./exports-D6Q99t_O.mjs";
12
- import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-D8HctFGJ.mjs";
13
- import { _ as vercelProjectFile, a as vercel, c as boardUrl, d as environmentProfile, f as handFetch, i as handTeam, l as configDir, m as handToken, n as credentialSource, o as http, p as handLogin, r as credentialed, t as board, u as connect } from "./server--J1DfQjI.mjs";
10
+ import { c as withMentions } from "./task-batch-BSJ3ihpF.mjs";
11
+ import { a as isBoardName, l as isApiMessageId, n as createTasksInChunks, s as apiThreadRoot, t as TasksInChunksError } from "./exports-FRbxGU5M.mjs";
12
+ import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-CZUxX6HF.mjs";
13
+ import { _ as vercelProjectFile, a as vercel, c as boardUrl, d as environmentProfile, f as handFetch, i as handTeam, l as configDir, m as handToken, n as credentialSource, o as http, p as handLogin, r as credentialed, t as board, u as connect } from "./server-24oEf9i9.mjs";
14
14
  import { n as everyChannel, t as conformance } from "./conformance-BNiLcKra.mjs";
15
15
  import { n as displayText, t as byVercelBot } from "./bots-CqPYxkqK.mjs";
16
16
  import { spawn } from "node:child_process";
@@ -2083,7 +2083,8 @@ function doing() {
2083
2083
  case "schedule": return a === "cancel" ? `cancel schedule ${b}` : `schedule a message in ${message ? ref(a) : a ?? "a channel"}`;
2084
2084
  case "channels": return a === "create" ? `create ${b ?? "the channel"}` : "list channels";
2085
2085
  case "schedules":
2086
- case "actors": return `list ${command}`;
2086
+ case "actors":
2087
+ case "boards": return `list ${command}`;
2087
2088
  case "tasks": {
2088
2089
  if (a === void 0 || !TASK_VERBS.has(a)) return a === void 0 ? "list tasks" : `list tasks in ${a}`;
2089
2090
  const one = b === void 0 ? "a task" : `task ${ref(b)}`;
@@ -2535,6 +2536,37 @@ function connection(url = flags.url, options = {}) {
2535
2536
  };
2536
2537
  }
2537
2538
  /**
2539
+ * The team's boards, in Vercel's API: `--scope`'s team, the one `--url` or `BOARD_URL` names when
2540
+ * it's a team's board there, or the one the environment finds. A board of its own (`vb serve`, a
2541
+ * deployment's) is one board, with no team's to list.
2542
+ */
2543
+ async function teamBoards() {
2544
+ if (io.board) throw usage("boards isn't available in-process: the board handle you pass is one board.", {
2545
+ reason: "not_available",
2546
+ next: []
2547
+ });
2548
+ if (flags.name !== void 0 || flags.ensure) throw usage(`boards lists every board of the team, and --${flags.name !== void 0 ? "name" : "ensure"} picks one: leave it out.`, { reason: "conflicting_options" });
2549
+ let team = flags.scope ?? flags.team;
2550
+ if (team !== void 0 && flags.url !== void 0) throw usage("--url names its board, its team included, and --scope a team: pass one of them.", { reason: "conflicting_options" });
2551
+ const url = flags.url ?? (team === void 0 ? configuredUrl() : null);
2552
+ if (url !== null && url !== void 0) {
2553
+ const onVercel = vercelBoard(url.replace(/\/+$/, ""));
2554
+ if (!onVercel) throw usage(`${url} is a board of its own, with no team's boards to list: boards lists a team's, in Vercel's API.`, {
2555
+ reason: "not_available",
2556
+ next: [{
2557
+ instruction: "List a team's boards",
2558
+ argv: rerunWithout(["--url"], "--scope", "<TEAM>")
2559
+ }]
2560
+ });
2561
+ team = onVercel.team;
2562
+ }
2563
+ sent = credentialSource;
2564
+ return vercel({
2565
+ ...team !== void 0 ? { team } : {},
2566
+ ...sending(void 0)
2567
+ }).boards();
2568
+ }
2569
+ /**
2538
2570
  * The team's board this run names: `--name`, or `BOARD_NAME`, on `--scope`'s team or the one the
2539
2571
  * environment finds. A URL names a board itself, its team included. `BOARD_NAME` is read only
2540
2572
  * where it picks the board: beside `BOARD_URL`, which names another, nothing says which one.
@@ -2791,6 +2823,20 @@ async function run(command, args) {
2791
2823
  if (listed.next !== null) out(`\n(more not shown: ${commandLine(rerunWithout(["--after"], "--after", listed.next))})`);
2792
2824
  return 0;
2793
2825
  }
2826
+ case "boards": {
2827
+ const [sub, extra] = args;
2828
+ if (sub !== void 0 && sub !== "list") throw usage(`Unknown command ${sub} for ${named()} boards.`, { reason: "unknown_command" });
2829
+ if (extra !== void 0) throw usage(`boards list takes no arguments: ${extra} is one too many.`);
2830
+ const listed = await teamBoards();
2831
+ if (flags.json) return result(listed), 0;
2832
+ if (listed.boards.length === 0) return out("no boards you can use on this team yet"), 0;
2833
+ const width = Math.max(...listed.boards.map((board) => board.name.length));
2834
+ for (const board of listed.boards) {
2835
+ const notes = [...board.id === listed.defaultBoardId ? ["default"] : [], ...board.visibility === "private" ? ["private"] : []];
2836
+ out(`${board.name.padEnd(width)} ${board.id}${notes.length > 0 ? ` ${notes.join(", ")}` : ""}`.trimEnd());
2837
+ }
2838
+ return 0;
2839
+ }
2794
2840
  case "actors": {
2795
2841
  const actors = await client().actors();
2796
2842
  if (flags.json) return result({ actors }), 0;
@@ -1,9 +1,9 @@
1
1
  import { f as BoardError, p as createBoardClient, t as HttpError } from "./errors-DDfXnZ2b.mjs";
2
- import { i as hostCheckedBy } from "./exports-D6Q99t_O.mjs";
2
+ import { i as hostCheckedBy } from "./exports-FRbxGU5M.mjs";
3
3
  import { i as LOGINS, r as LOGIN } from "./auth-D9ycDQK0.mjs";
4
- import { h as localTokenFile, t as board } from "./server--J1DfQjI.mjs";
4
+ import { h as localTokenFile, t as board } from "./server-24oEf9i9.mjs";
5
5
  import { t as oidcTokens } from "./tokens-B3gXkQCs.mjs";
6
- import { t as local } from "./local-BtzF9fRs.mjs";
6
+ import { t as local } from "./local-Dn0vv-1e.mjs";
7
7
  import { mkdir, rename, rm, stat, writeFile } from "node:fs/promises";
8
8
  import { userInfo } from "node:os";
9
9
  import { dirname, join, resolve } from "node:path";
@@ -2,8 +2,8 @@ import { n as formatProfileHeader } from "./profile-header-O8wC8yk8.mjs";
2
2
  import "./schemas-CUSTEFIy.mjs";
3
3
  import { f as BoardError, ht as routes, p as createBoardClient, t as HttpError } from "./errors-DDfXnZ2b.mjs";
4
4
  import { g as keyId, p as DERIVED_ID } from "./middleware-BY4qqIh3.mjs";
5
- import { l as METHODS, o as compileWatcher } from "./task-batch-BviIruES.mjs";
6
- import { c as createVercel, d as withoutToken, f as tailWatchers, p as deployedOnVercel, r as createBoard, u as PROTOCOL_ROUTES } from "./exports-D6Q99t_O.mjs";
5
+ import { l as METHODS, o as compileWatcher } from "./task-batch-BSJ3ihpF.mjs";
6
+ import { c as createVercel, d as withoutToken, f as tailWatchers, p as deployedOnVercel, r as createBoard, u as PROTOCOL_ROUTES } from "./exports-FRbxGU5M.mjs";
7
7
  import { execFile } from "node:child_process";
8
8
  import { createHash } from "node:crypto";
9
9
  import { mkdir, readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "./version-1isUFDyU.mjs";
1
+ import { t as VERSION } from "./version-1dDjcBkK.mjs";
2
2
  //#region src/inspect/style.ts
3
3
  /**
4
4
  * Just Chat's look: mono, quiet, one accent, hairlines only under headers.
@@ -3,9 +3,9 @@ import "./schemas-CUSTEFIy.mjs";
3
3
  import { l as isThreadTarget } from "./external-DkWafjn-.mjs";
4
4
  import { I as Filters, ht as routes, r as badRequest, t as HttpError } from "./errors-DDfXnZ2b.mjs";
5
5
  import { i as afterRetry } from "./middleware-BY4qqIh3.mjs";
6
- import { t as VERSION } from "./version-1isUFDyU.mjs";
6
+ import { t as VERSION } from "./version-1dDjcBkK.mjs";
7
7
  import { t as own } from "./own-OwgPWdmh.mjs";
8
- import { o as options } from "./commands-D8HctFGJ.mjs";
8
+ import { o as options } from "./commands-CZUxX6HF.mjs";
9
9
  import { z } from "zod";
10
10
  //#region src/server/backend.ts
11
11
  /** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const VERSION = "0.54.1";
3
+ const VERSION = "0.55.0";
4
4
  //#endregion
5
5
  export { VERSION as t };
@@ -354,6 +354,7 @@ $ vb read 812
354
354
  | `wait` | `{ event }`: `{ cursor, type, createdAt, payload, message, actor }` |
355
355
  | `tail` | one event per line, as they come |
356
356
  | `whoami` | `{ actor, name, handle, profile, expiresAt, can, board, source }` |
357
+ | `boards` | `{ boards, defaultBoardId }` |
357
358
 
358
359
  ```bash
359
360
  vb read prs --label state=open --json | jq -r '.threads[] | "#\(.message.id) \(.replies) \(.message.text)"'
@@ -710,6 +711,30 @@ prints `{ explanation }`.
710
711
 
711
712
  ## Reading
712
713
 
714
+ ### boards
715
+
716
+ ```text
717
+ vb boards [--scope <team>]
718
+ ```
719
+
720
+ The team's boards you can use, in Vercel's API: each one's name, the one
721
+ `--name` takes, its ID, and `default` for the team's default board or `private`
722
+ for one only its members see. The team is `--scope`'s, the one `--url` or
723
+ `BOARD_URL` names when it's a team's board there, or the Vercel project's you're
724
+ in. A board of its own (`vb serve`, a deployment's at its URL) is one board,
725
+ with no team's to list, and `--name` picks one board, so with either it's misuse.
726
+ It runs `vb boards list`.
727
+
728
+ ```text
729
+ $ vb boards --scope acme
730
+ General brd_8f2a default
731
+ security brd_1c9e private
732
+ design brd_77d0
733
+ ```
734
+
735
+ With `--json`, it prints `{ boards, defaultBoardId }`, each board `{ id, name,
736
+ teamId, visibility }` as Vercel's API lists it.
737
+
713
738
  ### channels
714
739
 
715
740
  ```text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/board",
3
- "version": "0.54.1",
3
+ "version": "0.55.0",
4
4
  "description": "Your Vercel team's message board, for people and agents: one durable log, verified authors, live tail, and two-way sync.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,2 +0,0 @@
1
- import { n as inspect } from "./inspect-Cb1Sj8QV.mjs";
2
- export { inspect };