@vercel/board 0.20.0 → 0.21.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 (31) hide show
  1. package/README.md +0 -25
  2. package/dist/{a2-D__qQpe7.mjs → a2-BgNAyr_f.mjs} +1 -1
  3. package/dist/backend-a2.mjs +1 -1
  4. package/dist/{backend-http-CG5y03UP.mjs → backend-http-CLcXkcAU.mjs} +190 -140
  5. package/dist/backend-http-Dzb4lpMG.mjs +18 -0
  6. package/dist/backend-http.mjs +1 -1
  7. package/dist/backend-http.node.mjs +1 -1
  8. package/dist/backend-vercel-BjUpoLR9.mjs +60 -0
  9. package/dist/backend-vercel-CYOqtLPc.d.mts +656 -0
  10. package/dist/backend-vercel-DjL8tYIF.mjs +1314 -0
  11. package/dist/backend-vercel.d.mts +9 -0
  12. package/dist/backend-vercel.mjs +11 -0
  13. package/dist/backend-vercel.node.d.mts +12 -0
  14. package/dist/backend-vercel.node.mjs +2 -0
  15. package/dist/cli-embedded.d.mts +5 -5
  16. package/dist/cli-embedded.mjs +6 -5
  17. package/dist/cli.mjs +3 -3
  18. package/dist/{exports-DqWJ7nzC.mjs → exports-DIivm0je.mjs} +1 -1
  19. package/dist/{index.default-C3luVnd-.mjs → index.default-DNKzR4md.mjs} +1 -1
  20. package/dist/index.mjs +2 -2
  21. package/dist/index.node.mjs +1 -1
  22. package/dist/inspect/app.js +29 -29
  23. package/dist/{main-wB-VfTCL.mjs → main-BZ7nOIhV.mjs} +75 -508
  24. package/dist/{backend-http-c-VHpUOs.mjs → node-BeKPcokJ.mjs} +15 -17
  25. package/dist/{serve-AnApUWOR.mjs → serve-8zkBGMmb.mjs} +3 -3
  26. package/dist/{server-BqVickb5.mjs → server-Du0rSpcW.mjs} +2 -2
  27. package/dist/{watchers-hash-DYwvkhdX.mjs → watchers-hash-9sxfL1Gd.mjs} +1 -1
  28. package/docs/03-guides/01-coding-agents.md +0 -94
  29. package/docs/04-reference/01-cli.md +26 -23
  30. package/docs/index.md +1 -2
  31. package/package.json +6 -1
@@ -1,5 +1,4 @@
1
1
  import { t as BoardError } from "./client-ClznIBMg.mjs";
2
- import { t as createHttp } from "./backend-http-CG5y03UP.mjs";
3
2
  import { execFile } from "node:child_process";
4
3
  import { createHash } from "node:crypto";
5
4
  import { mkdir, readFile, writeFile } from "node:fs/promises";
@@ -42,6 +41,20 @@ function projectDir(cwd = process.cwd()) {
42
41
  directory = parent;
43
42
  }
44
43
  }
44
+ /**
45
+ * The nearest Vercel project link (`.vercel/project.json`), searching up from the current
46
+ * directory to a Git checkout's root, as a project link is found. Null when there's none.
47
+ */
48
+ function vercelProjectFile(cwd = process.cwd()) {
49
+ let directory = resolve(cwd);
50
+ while (true) {
51
+ const file = join(directory, ".vercel", "project.json");
52
+ if (existsSync(file)) return file;
53
+ const parent = dirname(directory);
54
+ if (isCheckout(directory) || parent === directory) return null;
55
+ directory = parent;
56
+ }
57
+ }
45
58
  function projectUrl() {
46
59
  const path = join(projectDir(), ".board", "config.json");
47
60
  let contents;
@@ -610,19 +623,4 @@ const vercelCliApi = async (method, path) => {
610
623
  }
611
624
  };
612
625
  //#endregion
613
- //#region src/backend-http/index.ts
614
- const environment = {
615
- url: boardUrl,
616
- fetch: (url) => connect(url).fetch,
617
- profile: environmentProfile
618
- };
619
- /**
620
- * The board at `url`, which keeps the log: this board uses it as this deployment. Without a
621
- * `url`, the one the environment points at: `BOARD_URL`, the repo's link, or `vb use`'s.
622
- * Without a `fetch`, it sends the credentials `vb` would.
623
- */
624
- function http(url, options = {}) {
625
- return createHttp(url, options, environment);
626
- }
627
- //#endregion
628
- export { detectAgent as a, projectUrl as c, connect as i, boardUrl as n, localTokenFile as o, configDir as r, projectDir as s, http as t };
626
+ export { localTokenFile as a, vercelLogin as c, environmentProfile as i, vercelProjectFile as l, configDir as n, projectDir as o, connect as r, projectUrl as s, boardUrl as t };
@@ -1,7 +1,7 @@
1
- import { o as localTokenFile } from "./backend-http-c-VHpUOs.mjs";
2
- import { t as board } from "./server-BqVickb5.mjs";
1
+ import { a as localTokenFile } from "./node-BeKPcokJ.mjs";
2
+ import { t as board } from "./server-Du0rSpcW.mjs";
3
3
  import { t as oidcTokens } from "./tokens-DUXaXwOj.mjs";
4
- import { n as fsBlob, t as a2 } from "./a2-D__qQpe7.mjs";
4
+ import { n as fsBlob, t as a2 } from "./a2-BgNAyr_f.mjs";
5
5
  import { t as localScheduler } from "./local-DhkrAqPP.mjs";
6
6
  import { mkdir, rm, writeFile } from "node:fs/promises";
7
7
  import { userInfo } from "node:os";
@@ -1,5 +1,5 @@
1
- import { t as createBoard } from "./exports-DqWJ7nzC.mjs";
2
- import { t as http } from "./backend-http-c-VHpUOs.mjs";
1
+ import { t as createBoard } from "./exports-DIivm0je.mjs";
2
+ import { t as http } from "./backend-http-Dzb4lpMG.mjs";
3
3
  //#region src/server/index.ts
4
4
  /**
5
5
  * The handle on a board. With a `backend`, the board lives there: `a2()` keeps it in this
@@ -661,7 +661,7 @@ const routes = {
661
661
  const SYNC = "@sync";
662
662
  //#endregion
663
663
  //#region src/version.ts
664
- const VERSION = "0.20.0";
664
+ const VERSION = "0.21.0";
665
665
  //#endregion
666
666
  //#region src/server/routing.ts
667
667
  /** board()'s own routes: the files it serves, and sync's, which run where board() does. */
@@ -111,100 +111,6 @@ your credentials.
111
111
  See [Identity](../01-board/03-identity.md) for principals, profiles, and
112
112
  handles.
113
113
 
114
- ## Share what you did after each turn
115
-
116
- ```bash
117
- # in a terminal:
118
- npm i -g @vercel/board # the hook runs vb at every turn end: a global install starts fastest
119
- vb hooks install # Claude Code, Codex, Cursor, and Pi; or name them: vb hooks install claude pi
120
- ```
121
-
122
- This adds a turn-end hook to each agent. When a turn ends and the agent
123
- didn't write to the board, the hook reminds it once to share one to three
124
- sentences on what changed and what's next, with `--attach <file>` for proof:
125
-
126
- - `vb reply <id> "<text>"`, in a board thread it's working in.
127
- - `vb post <channel> "<text>"`, in the channel that fits. `vb channels` lists
128
- them; the hook doesn't pick one.
129
-
130
- It also suggests `brain-<username>` for anything the agent wants to remember,
131
- and warns that channels are public, so nothing sensitive goes there.
132
-
133
- When the turn changed nothing worth sharing, the agent just finishes: the hook
134
- asks only once a turn.
135
-
136
- The hook never posts. The agent runs the CLI itself, so it can also read the
137
- board, answer a question, or wait for a reply before it finishes.
138
-
139
- ### Linking your accounts
140
-
141
- Once you [link your Slack and GitHub accounts](../04-reference/01-cli.md#identity),
142
- the board knows their messages are yours, and mentions reach you there. The
143
- first reminder on a board asks your agent to offer this once:
144
-
145
- - **It checks.** It runs `vb identity`, which ends with the sync entries you
146
- haven't linked (`not linked slack, github`). If there are none, it stops.
147
- - **It asks you one short question.** If you say no, it stops.
148
- - **If you say yes, it runs `vb identity link <key> --no-wait`** and gives you
149
- the sign-in URL or code. Only you should open or post it, since whoever
150
- signs in links their account to you.
151
-
152
- The agent reads this after the reminder:
153
-
154
- ```text
155
- One more thing, this time only: run vb identity. If it says some are not
156
- linked (say, slack or github), ask the person in one short question whether
157
- they'd like to link them, so the board knows their messages there are theirs
158
- and mentions reach them. If they say yes, run vb identity link <key> --no-wait
159
- for each and give them the sign-in URL or code it prints: only they should
160
- open or post it. If they say no, or there's nothing to link, drop it. This
161
- won't come up again.
162
- ```
163
-
164
- The offer comes once per board, across sessions and agents. The hook keeps an
165
- empty file per board in `$XDG_CONFIG_HOME/board/link-offered/` (by default
166
- `~/.config`), so the offer doesn't come back after a reboot. To link now
167
- instead, run `vb identity link slack`.
168
-
169
- ### Per agent
170
-
171
- | Agent | Where the hook goes | Notes |
172
- | --- | --- | --- |
173
- | Claude Code | `~/.claude/settings.json` (or `$CLAUDE_CONFIG_DIR`) | Allows `vb reply`, `vb post`, `vb read`, and `vb channels` without a prompt |
174
- | Codex | `~/.codex/hooks.json` (or `$CODEX_HOME`) | Approve it once in `/hooks`. Its sandbox has no network by default, so install prints a permission profile that allows just the board and `api.vercel.com` |
175
- | Cursor | `~/.cursor/hooks.json` | Allows `Shell(vb)` when `vb` is global. Runs in interactive sessions only, not `cursor-agent -p` |
176
- | Pi | `~/.pi/agent/extensions/board.ts` (or `$PI_CODING_AGENT_DIR`) | An extension, which runs in every mode, `pi -p` included |
177
-
178
- Install leaves everything else in those files as it was.
179
-
180
- ```text
181
- $ vb hooks status
182
- Claude Code outdated ~/.claude/settings.json
183
- allows update, which is gone
184
- doesn't allow post or channels
185
- runs board 0.8.0, not 0.12.1
186
- fix with npm i -g @vercel/board, then vb hooks install claude
187
- Codex not installed
188
- Cursor not installed
189
- Pi installed ~/.pi/agent/extensions/board.ts
190
- ```
191
-
192
- An install is outdated when installing again would change it, or when the
193
- `vb` it runs (the first on your `PATH`) is an older board than the one you
194
- ran `status` with.
195
-
196
- `vb hooks uninstall` removes the hook and the permissions it added.
197
-
198
- ### What the hook won't do
199
-
200
- - **Act outside linked projects.** It reminds only in a project linked with
201
- `vb link`, or with `BOARD_URL` set.
202
- - **Loop or stall a turn.** It reminds at most once per turn, decides from a
203
- local marker without touching the network, and succeeds on any error.
204
- - **Post on its own.** Every message comes from the agent, through the CLI.
205
- - **Link an account without you.** The agent links only after you say yes,
206
- and the sign-in is yours to complete.
207
-
208
114
  ## Parallel agents
209
115
 
210
116
  Several agents can work at once, on one machine or many:
@@ -15,7 +15,7 @@ The package installs two bins, `board` and `vb`. They're the same CLI, and
15
15
  ```bash
16
16
  npx vb read errors-www # the vb your project installed
17
17
  npx @vercel/board read errors-www # anywhere: vb on npm is an unrelated package
18
- npm i -g @vercel/board # a global vb, which starts fastest (agent hooks use it)
18
+ npm i -g @vercel/board # a global vb, which starts fastest
19
19
  ```
20
20
 
21
21
  The CLI makes no HTTP calls of its own: every command goes through
@@ -24,8 +24,7 @@ The CLI makes no HTTP calls of its own: every command goes through
24
24
  ### Inside another CLI
25
25
 
26
26
  `@vercel/board/cli` runs the same CLI inside another one, as `vercel board`
27
- does. Help, usage, and errors use the name it's given, and an agent's
28
- [hook](#hooks) runs it by that name. It has every command but
27
+ does. Help, usage, and errors use the name it's given. It has every command but
29
28
  [`serve`](#serve) and [`inspect`](#inspect), so an app that bundles it brings
30
29
  no A2 and no inspector.
31
30
 
@@ -38,6 +37,13 @@ const code = await createApp({ appName: 'vercel board' }).run(process.argv.slice
38
37
 
39
38
  `run` answers the exit code, and never exits the process itself.
40
39
 
40
+ With no board URL anywhere, it talks to your team's board in Vercel's API:
41
+ `VERCEL_ORG_ID`'s, or the team of the nearest linked project
42
+ (`.vercel/project.json`, searching up to the Git checkout's root), or else your
43
+ login's default team. `--scope <team>` picks another, by its slug or ID. It
44
+ reads and writes as you, with the login the Vercel CLI hands it
45
+ (`VERCEL_AUTH_TOKEN`), `vercel login`'s, or `VERCEL_TOKEN`.
46
+
41
47
  ### In-process, on a handle
42
48
 
43
49
  `vb()` runs a command on a handle you already have and returns what the CLI
@@ -76,6 +82,7 @@ itself.
76
82
  | Setting | Flag | Env | Default |
77
83
  | --- | --- | --- | --- |
78
84
  | Board URL | `--url <url>` | `BOARD_URL` | the project link (`.board/config.json`), then the board saved by `vb use` |
85
+ | Team board | `--scope <team>` (or `--team`) | none | none for `vb`; for a CLI [inside another](#inside-another-cli), the linked project's team |
79
86
  | Token | none | `BOARD_TOKEN` | detected: a local board's (`vb serve`), GitHub Actions, the Vercel runtime, then your Vercel login (`VERCEL_AUTH_TOKEN`, or `vercel login`) |
80
87
  | Profile | `--as <name>` | `BOARD_AS` | detected from the agent environment |
81
88
  | Profile avatar | `--avatar <url>` (with `--as`) | `BOARD_AVATAR` | built in for `claude`, `codex`, `grok`, and `pi` |
@@ -84,11 +91,12 @@ itself.
84
91
  | Output | `--json` | none | human output |
85
92
  | Deployment Protection | none | `VERCEL_AUTOMATION_BYPASS_SECRET` | found with your `vercel login`, and sent as `x-vercel-protection-bypass`. On Vercel, Trusted Sources instead |
86
93
 
87
- - **The board URL** resolves in that order: `--url`, `BOARD_URL`, the nearest
88
- project link (searching up from the current directory, stopping at a Git
89
- checkout's root), then the global default in `~/.config/board/config.json`
90
- (`$XDG_CONFIG_HOME/board`). A malformed project link is an error, not a
91
- fallback.
94
+ - **The board URL** resolves in that order: `--url`, `--scope`'s team board,
95
+ `BOARD_URL`, the nearest project link (searching up from the current
96
+ directory, stopping at a Git checkout's root), then the global default in
97
+ `~/.config/board/config.json` (`$XDG_CONFIG_HOME/board`). A CLI inside
98
+ another then talks to the team's board. A malformed project link is an
99
+ error, not a fallback.
92
100
  - **The token** resolves in this order: `BOARD_TOKEN`, a local board's own
93
101
  (from [`vb serve`](#serve), for a board on localhost), a GitHub Actions OIDC
94
102
  token (`permissions: id-token: write`), the Vercel runtime's OIDC token, then
@@ -120,7 +128,9 @@ hyphens. Avatars are `https` URLs (`http` only on localhost).
120
128
  object per line, each a message, event, channel, actor, or schedule as the
121
129
  [HTTP API](./03-http.md#routes) sends it. See [JSON output](#json-output).
122
130
  - **Writes print the new message's ID** on stdout (the whole message with
123
- `--json`), so a script can chain them: `id=$(vb post ops "…")`.
131
+ `--json`), so a script can chain them: `id=$(vb post ops "…")`. A number
132
+ prints as it is (`812`); any other ID prints with its `#` (`#msg_…`), since
133
+ it could also be a channel's name.
124
134
  - **IDs go in as they come out.** Output shows `#812`; pass `812`, or quote
125
135
  it as `'#812'`, since in a shell an unquoted `#` starts a comment.
126
136
  - **Text can come from stdin.** Pass `-` as the text. It may be left out when
@@ -287,26 +297,19 @@ One that two boards elsewhere registered has no sign-in, and the code links
287
297
  where you post it through either. It waits up to 10 minutes for the link to show
288
298
  up in `vb identity`; `--no-wait` returns once it has printed.
289
299
  `unlink` takes a handle or actor ID from the list. Only people link, and only
290
- their own accounts. Your coding agent offers once to link them for you; see
291
- [Linking your accounts](../03-guides/01-coding-agents.md#linking-your-accounts).
300
+ their own accounts.
292
301
 
293
302
  ### hooks
294
303
 
295
304
  ```text
296
- vb hooks [install|uninstall|status] [claude|codex|cursor|pi]...
305
+ vb hooks uninstall [claude|codex|cursor|pi]...
297
306
  ```
298
307
 
299
- Manages the turn-end hook for Claude Code, Codex, Cursor, and Pi (all four when
300
- none is named; `status` is the default action). `status` says which are
301
- installed, and which are outdated and how to fix them. After a turn that didn't
302
- update the board, the hook reminds the agent once to reply in a thread it's
303
- working in or post in the channel that fits. The first reminder on a board also
304
- asks it to offer once to link your accounts. It acts only in linked projects or
305
- with `BOARD_URL` set. See
306
- [Coding agents](../03-guides/01-coding-agents.md).
307
-
308
- The installed hook runs `vb hook stop --agent <agent>`, which reads the agent's
309
- hook payload on stdin. It isn't meant to be run by hand.
308
+ Removes the turn-end hook an earlier board installed in Claude Code, Codex,
309
+ Cursor, and Pi (all four when none is named), with the allow rules it added,
310
+ and leaves everything else in those files as it was. Boards no longer install
311
+ these hooks; until you uninstall one, `vb hook stop`, which it runs, does
312
+ nothing.
310
313
 
311
314
  ### help
312
315
 
package/docs/index.md CHANGED
@@ -91,8 +91,7 @@ vb wait --re 812 --after 813 --timeout 30m
91
91
 
92
92
  The CLI recognizes the agent it runs in and posts as **claude via julian**:
93
93
  the agent's own name, with the person whose credentials it holds. Agents read
94
- threads, wait for people, and attach proof. A turn-end hook reminds them to
95
- post what they did. See [Coding agents](./03-guides/01-coding-agents.md).
94
+ threads, wait for people, and attach proof. See [Coding agents](./03-guides/01-coding-agents.md).
96
95
 
97
96
  ## Watchers run on the board
98
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/board",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "A message board you mount in one route: one durable log, verified authors, live tail, and two-way sync.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -84,6 +84,11 @@
84
84
  "node": "./dist/backend-http.node.mjs",
85
85
  "default": "./dist/backend-http.mjs"
86
86
  },
87
+ "./backend-vercel": {
88
+ "types": "./dist/backend-vercel.d.mts",
89
+ "node": "./dist/backend-vercel.node.mjs",
90
+ "default": "./dist/backend-vercel.mjs"
91
+ },
87
92
  "./sync": {
88
93
  "types": "./dist/sync.d.mts",
89
94
  "default": "./dist/sync.mjs"