@vercel/board 0.32.0 → 0.34.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 (167) hide show
  1. package/README.md +25 -20
  2. package/dist/{access-CY5xVMIK.mjs → access-CdBcYPQH.mjs} +170 -13
  3. package/dist/access.d.mts +4 -5
  4. package/dist/access.mjs +5 -5
  5. package/dist/{actors-Bm-ojWWT.mjs → actors-MrIEr9LI.mjs} +3 -3
  6. package/dist/auth-DjoJygbG.mjs +599 -0
  7. package/dist/{auth-K8dY1nBY.d.mts → auth-aaoKt5DK.d.mts} +133 -100
  8. package/dist/backend-local.d.mts +28 -0
  9. package/dist/backend-local.mjs +2 -0
  10. package/dist/{backend-DxE9wGKm.d.mts → backend-u1sVvybh.d.mts} +108 -55
  11. package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
  12. package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-De0iDnUB.d.mts} +2 -3
  13. package/dist/cli-commands.d.mts +1 -1
  14. package/dist/cli-commands.mjs +1 -1
  15. package/dist/cli-embedded.d.mts +2 -2
  16. package/dist/cli-embedded.mjs +1 -1
  17. package/dist/cli.mjs +6 -6
  18. package/dist/{commands-DsnQKTdB.mjs → commands-B8oZEByR.mjs} +37 -52
  19. package/dist/{commands-CpyPV_tk.d.mts → commands-BkVMdXP1.d.mts} +9 -6
  20. package/dist/{conformance-3RBKxwbp.mjs → conformance-gqYBkXFS.mjs} +79 -86
  21. package/dist/conformance.d.mts +1 -1
  22. package/dist/conformance.mjs +1 -1
  23. package/dist/{engine-DurYIRt8.mjs → engine-rtOVWsiF.mjs} +6 -8
  24. package/dist/{errors-CJXhhzvT.mjs → errors-D8ifv16L.mjs} +75 -6
  25. package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
  26. package/dist/exports-Bx2dGpzr.mjs +3252 -0
  27. package/dist/exports-uwRl5qIj.d.mts +4 -0
  28. package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
  29. package/dist/index-D6mK0Ial.d.mts +11 -0
  30. package/dist/index.d.mts +10 -9
  31. package/dist/index.mjs +21 -8
  32. package/dist/index.node.d.mts +6 -7
  33. package/dist/index.node.mjs +3 -3
  34. package/dist/inspect/app.js +95 -95
  35. package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
  36. package/dist/local-CPz22MQ8.mjs +9225 -0
  37. package/dist/{main-CcYDo9Hb.mjs → main-DScDKwQN.mjs} +129 -54
  38. package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
  39. package/dist/middleware-BjYpk4yq.mjs +103 -0
  40. package/dist/{provider-gynDUoyW.d.mts → provider-hB8QNrwm.d.mts} +369 -3
  41. package/dist/{client-COfYrgfV.d.mts → routes-De4W6lEs.d.mts} +997 -367
  42. package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
  43. package/dist/{serve-Bplieh0C.mjs → serve-B1noQRkn.mjs} +33 -24
  44. package/dist/{node-BgeGcwX0.mjs → server-Ov6GBJ8j.mjs} +419 -6
  45. package/dist/{serving-Y7s7VDjB.mjs → serving-2s7lqSBS.mjs} +1 -1
  46. package/dist/{sql-E1K5g_ih.mjs → sql-BQzKUqQt.mjs} +349 -114
  47. package/dist/sqlite-DCtZFEVm.mjs +30 -0
  48. package/dist/{sqlite-db-CzcD_FW8.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
  49. package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
  50. package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
  51. package/dist/store-memory-OdGsc-t_.mjs +2 -0
  52. package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
  53. package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
  54. package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
  55. package/dist/sync-chat-sdk.d.mts +2 -2
  56. package/dist/sync-chat-sdk.mjs +2 -2
  57. package/dist/sync-github.d.mts +2 -2
  58. package/dist/sync-github.mjs +2 -2
  59. package/dist/sync-linear.d.mts +3 -3
  60. package/dist/sync-linear.mjs +2 -2
  61. package/dist/sync-slack.d.mts +3 -3
  62. package/dist/sync-slack.mjs +4 -4
  63. package/dist/sync.d.mts +2 -2
  64. package/dist/sync.mjs +2 -2
  65. package/dist/{watchers-hash-CurCzwhe.mjs → targets-aMdbp84G.mjs} +134 -16
  66. package/dist/{tokens-C7kYyrAG.mjs → tokens-LHLrnV_P.mjs} +15 -43
  67. package/docs/01-board/01-mounting.md +245 -288
  68. package/docs/01-board/03-identity.md +42 -50
  69. package/docs/01-board/04-messages.md +15 -14
  70. package/docs/01-board/05-reading.md +3 -3
  71. package/docs/01-board/06-watchers.md +58 -105
  72. package/docs/01-board/07-schedules.md +21 -41
  73. package/docs/01-board/08-middleware.md +11 -17
  74. package/docs/01-board/09-access.md +187 -343
  75. package/docs/01-board/10-local.md +81 -0
  76. package/docs/01-quickstart.md +49 -126
  77. package/docs/02-sync/01-overview.md +25 -80
  78. package/docs/02-sync/02-functions.md +10 -16
  79. package/docs/02-sync/03-slack.md +13 -26
  80. package/docs/02-sync/04-github.md +8 -20
  81. package/docs/02-sync/07-linear.md +6 -10
  82. package/docs/03-guides/02-inspector.md +3 -3
  83. package/docs/03-guides/03-ci.md +88 -128
  84. package/docs/03-guides/04-triage.md +7 -15
  85. package/docs/03-guides/05-agent-factory.md +29 -36
  86. package/docs/04-reference/01-cli.md +113 -38
  87. package/docs/04-reference/02-board.md +79 -82
  88. package/docs/04-reference/03-http.md +138 -69
  89. package/docs/04-reference/05-conformance.md +32 -46
  90. package/docs/index.md +41 -65
  91. package/package.json +12 -83
  92. package/dist/a2-DiDc77Uf.mjs +0 -4238
  93. package/dist/access-DPcrKIH_.d.mts +0 -37
  94. package/dist/auth-8pRZnF1M.mjs +0 -393
  95. package/dist/backend-a2/blob-vercel.d.mts +0 -8
  96. package/dist/backend-a2/blob-vercel.mjs +0 -81
  97. package/dist/backend-a2/contract.d.mts +0 -828
  98. package/dist/backend-a2/contract.mjs +0 -5
  99. package/dist/backend-a2/scheduler-local.d.mts +0 -11
  100. package/dist/backend-a2/scheduler-local.mjs +0 -2
  101. package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
  102. package/dist/backend-a2/scheduler-qstash.mjs +0 -522
  103. package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
  104. package/dist/backend-a2/scheduler-vercel.mjs +0 -204
  105. package/dist/backend-a2/store-memory.d.mts +0 -11
  106. package/dist/backend-a2/store-postgres.d.mts +0 -38
  107. package/dist/backend-a2/store-postgres.mjs +0 -2977
  108. package/dist/backend-a2/store-redis-http.d.mts +0 -17
  109. package/dist/backend-a2/store-redis-http.mjs +0 -520
  110. package/dist/backend-a2/store-redis.d.mts +0 -31
  111. package/dist/backend-a2/store-redis.mjs +0 -88
  112. package/dist/backend-a2/store-sqlite.d.mts +0 -12
  113. package/dist/backend-a2/store-sqlite.mjs +0 -31
  114. package/dist/backend-a2.d.mts +0 -2633
  115. package/dist/backend-a2.mjs +0 -3
  116. package/dist/backend-http-CaN06CaD.d.mts +0 -672
  117. package/dist/backend-http-CoaCghuJ.mjs +0 -18
  118. package/dist/backend-http-l5A8UmL-.mjs +0 -585
  119. package/dist/backend-http.d.mts +0 -10
  120. package/dist/backend-http.mjs +0 -2
  121. package/dist/backend-http.node.d.mts +0 -10
  122. package/dist/backend-http.node.mjs +0 -2
  123. package/dist/backend-vercel-BE65okBC.mjs +0 -86
  124. package/dist/backend-vercel-CVxoTNF2.mjs +0 -1744
  125. package/dist/backend-vercel-jg-6PAgD.d.mts +0 -674
  126. package/dist/backend-vercel.d.mts +0 -9
  127. package/dist/backend-vercel.mjs +0 -11
  128. package/dist/backend-vercel.node.d.mts +0 -17
  129. package/dist/backend-vercel.node.mjs +0 -2
  130. package/dist/blob-Bx8QPWEd.d.mts +0 -40
  131. package/dist/blob-WbB2DJKn.mjs +0 -201
  132. package/dist/errors-2vGs49Db.d.mts +0 -16
  133. package/dist/exports-BnUZuRm9.mjs +0 -1389
  134. package/dist/exports-u5mApVvn.d.mts +0 -5
  135. package/dist/files-SniSmeEr.mjs +0 -47
  136. package/dist/folds-DLUzfibJ.d.mts +0 -558
  137. package/dist/folds-DsWfIftc.mjs +0 -208
  138. package/dist/index-UXpTPWNc.d.mts +0 -11
  139. package/dist/index.default-Dp8gexln.mjs +0 -12
  140. package/dist/local-C76Fy5ad.mjs +0 -44
  141. package/dist/middleware-BavYSDUa.mjs +0 -62
  142. package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
  143. package/dist/project-4Vl7_uy5.mjs +0 -124
  144. package/dist/redis-tables-BFRj_SEJ.mjs +0 -3895
  145. package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
  146. package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
  147. package/dist/reducers-DQVSP3kk.mjs +0 -538
  148. package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
  149. package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
  150. package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
  151. package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
  152. package/dist/server-wIpAEjpX.mjs +0 -17
  153. package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
  154. package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
  155. package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
  156. package/dist/store-memory-4IBl0Ztu.mjs +0 -2
  157. package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
  158. package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
  159. package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
  160. package/dist/targets-Cgjs29T0.mjs +0 -33
  161. package/dist/types-CmrFjpml.d.mts +0 -102
  162. package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
  163. package/docs/01-board/02-database.md +0 -258
  164. package/docs/04-reference/04-log.md +0 -247
  165. package/sql/postgres/board.sql +0 -145
  166. package/sql/postgres/notifications.sql +0 -24
  167. package/sql/postgres/schema.sql +0 -451
@@ -0,0 +1,81 @@
1
+ ---
2
+ title: Local boards
3
+ description: "`local()` keeps a board in this process: in SQLite under `.board/`, or in memory for tests. It's for development, `vb serve`, tests, and working offline."
4
+ ---
5
+
6
+ ## A board on this machine
7
+
8
+ ```ts app/api/board/[[...path]]/route.ts
9
+ import { board } from '@vercel/board'
10
+ import { local } from '@vercel/board/backend-local'
11
+
12
+ // SQLite at .board/local.db, files in .board/local/, and timers in this process.
13
+ export const team = board({ backend: local() })
14
+ export const GET = team.fetch, POST = team.fetch
15
+ ```
16
+
17
+ `local()` keeps everything in the process that runs it. It needs Node, and a
18
+ disk it can write: a serverless function can't keep one.
19
+
20
+ - **One file per board, by its name.** The default board is `.board/local.db`.
21
+ A board with a `name` gets a file named for it: `board({ backend: local(),
22
+ name: 'security' })` is `.board/security.db`, whatever the name's case. Any
23
+ other name, `Security Team` say, gets letters and dashes, a `.`, and a hash
24
+ (`security-team.83f2a9a1e050b6c257f82d1bf439cc90.db`). No plain name has
25
+ a `.`, so no two names share a file.
26
+ - **`team` is ignored.** There's one team on this machine: `board({ team:
27
+ 'acme', name: 'security' })` is `.board/security.db` too, and
28
+ `board({ team: 'acme' })` is the default board.
29
+ - **Attachments live beside it,** in a folder named like the file:
30
+ `.board/local/`, `.board/security/`. The folder appears with the first file.
31
+ - **A scheduler runs in the process.** Scheduled messages send, and watchers
32
+ and sync retry, while it runs. A restart drops what's pending, a scheduled
33
+ message's next send included.
34
+ - **It opens on the first call.** `board()` binds it without touching the
35
+ disk. A directory it can't write fails that call with 500 `no_store`, which
36
+ says where.
37
+ - **It passes the whole [conformance](../04-reference/05-conformance.md) kit,**
38
+ schedules and attachments included.
39
+
40
+ Keep `.board/` out of Git:
41
+
42
+ ```text .gitignore
43
+ .board/
44
+ ```
45
+
46
+ ## Options
47
+
48
+ | Option | What it does |
49
+ | --- | --- |
50
+ | `dir` | Where it keeps its files. Default `.board`, under the working directory |
51
+ | `memory` | Keeps the board, its files included, in memory: nothing is written, and it's gone with the process. For tests |
52
+
53
+ `close()` closes the board's file once nothing uses it, as a test does at its
54
+ end.
55
+
56
+ ## In tests
57
+
58
+ ```ts test/deploys.test.ts
59
+ import { expect, it } from 'vitest'
60
+ import { board } from '@vercel/board'
61
+ import { local } from '@vercel/board/backend-local'
62
+
63
+ it('posts the deploy', async () => {
64
+ const team = board({ backend: local({ memory: true }) })
65
+ await team.post('deploys', 'www@a1b2c3 is live')
66
+ // await yourDeployHook(team)
67
+ const { messages } = await team.messages({ channel: 'deploys' })
68
+ expect(messages.map((message) => message.text)).toEqual(['www@a1b2c3 is live'])
69
+ })
70
+ ```
71
+
72
+ A handle on it is the board's own code, as on any board this process keeps:
73
+ it writes as `board:client`, and `team.as('deploys')` as
74
+ `board:client:deploys`.
75
+
76
+ ## vb serve
77
+
78
+ [`vb serve`](../04-reference/01-cli.md#serve) runs `local()` under `.board/` at
79
+ the Git checkout's root, behind `http://127.0.0.1:4100/api/board`, and signs
80
+ you a token for it. Other commands, and `board()` with `BOARD_URL` set to that
81
+ URL, reach it.
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  title: Quickstart
3
- description: Mount a board in a Next.js app, start a thread from your terminal, and wait for a reply, in five minutes.
3
+ description: Start a thread on your team's board from your terminal, wait for a reply, and post from your app's code, in five minutes.
4
4
  ---
5
5
 
6
6
  ## What you'll build
7
7
 
8
- A board mounted in one route of a Next.js app, a first thread written from
9
- your terminal, and a command that blocks until a teammate answers it.
8
+ A first thread on your team's board, written from your terminal, a command
9
+ that blocks until a teammate answers it, and a route in your app that posts to
10
+ the same board.
10
11
 
11
12
  ## 1. Install
12
13
 
@@ -14,135 +15,65 @@ your terminal, and a command that blocks until a teammate answers it.
14
15
  npm i @vercel/board
15
16
  ```
16
17
 
17
- ## 2. Mount the board
18
-
19
- ```ts app/api/board/[[...path]]/route.ts
20
- import { board } from '@vercel/board'
21
- import { a2 } from '@vercel/board/backend-a2'
22
-
23
- const team = board({ backend: a2() })
24
- export const GET = team.fetch, POST = team.fetch
25
- ```
26
-
27
- The optional catch-all gives the board every path under `/api/board`. With no
28
- store, `a2()` keeps the log in SQLite at `.a2/dev.db`, under the app's working
29
- directory, and it survives restarts. Add `.a2/` to your `.gitignore`. This
30
- board has no blob store or scheduler, so attachments and scheduled messages
31
- answer 501: [A dev server](./01-board/01-mounting.md#a-dev-server) adds both.
32
-
33
- ## 3. Link the project
18
+ ## 2. Link the project
34
19
 
35
20
  ```bash
36
21
  vercel link
37
- ```
38
-
39
- A board trusts its own Vercel project: people who can access the project,
40
- each with their own `vercel login`, and the project's deployments in the
41
- environment the board runs in. On your machine the board learns which project
42
- it is from `.vercel/project.json`, which `vercel link` writes. See
43
- [Identity](./01-board/03-identity.md) and
44
- [Access](./01-board/09-access.md).
45
-
46
- ## 4. Start the app
47
-
48
- ```bash
49
- npm run dev
50
- ```
51
-
52
- Then, in another terminal, point the CLI at the board and check who you are:
53
-
54
- ```bash
55
- export BOARD_URL=http://localhost:3000/api/board
56
22
  npx vb whoami
57
23
  ```
58
24
 
59
- ```text
60
- ada (vercel:user:u_ada)
61
- board http://localhost:3000/api/board
62
- source vercel login
63
- token expires in 11h 59m
64
- ```
25
+ Your team's board lives in Vercel's API, so there's nothing to deploy or
26
+ mount. In a linked project, the CLI talks to the board of the team
27
+ `.vercel/project.json` names, as you, with your `vercel login`: there's no
28
+ login command of its own. `whoami` prints who you are and which board.
65
29
 
66
- `BOARD_URL` (or `--url` on one command) says which board; without either,
67
- in a Vercel project, the CLI talks to your team's board in Vercel's API
68
- instead. There's no login command: the CLI mints a token from your Vercel
69
- CLI login, for this board only.
30
+ `--scope <team>` picks another team's board, and `--url` or `BOARD_URL` a
31
+ board at a URL instead. See [the CLI](./04-reference/01-cli.md#configuration).
70
32
 
71
33
  > [!NOTE]
72
34
  > `npx vb` runs the bin your project installed. Outside such a project, use
73
35
  > `npx @vercel/board`: `vb` on npm is an unrelated package.
74
36
 
75
- ## 5. Start a thread
37
+ ## 3. Start a thread
76
38
 
77
39
  ```bash
78
- npx vb post general "is the deploy done?"
79
- ```
80
-
81
- ```text
82
- 2
40
+ id=$(npx vb post general "is the deploy done?")
83
41
  ```
84
42
 
85
43
  Writes print the new message's ID, so scripts can chain them. Channels need no
86
- setup: the first post creates one. IDs are positions in the log, so they skip
87
- numbers: other events, like the board meeting you for the first time, take
88
- positions too.
44
+ setup: the first post creates one. The team's default board is made the first
45
+ time someone on the team uses it.
89
46
 
90
47
  Reply, react, and label it, then read the channel:
91
48
 
92
49
  ```bash
93
- npx vb reply 2 "yes, it's live"
94
- npx vb react 2 eyes
95
- npx vb label 2 status=done
50
+ npx vb reply "$id" "yes, it's live"
51
+ npx vb react "$id" eyes
52
+ npx vb label "$id" status=done
96
53
  npx vb read general
97
54
  ```
98
55
 
99
- ```text
100
- general · 1 thread · cursor 5
101
-
102
- #2 ada · 1m [status=done]
103
- is the deploy done?
104
- 1 reply · last #3 ada · 1m
105
- ```
106
-
107
- A channel reads like Slack's: one summary per thread. Read the whole thread by
108
- its ID:
109
-
110
- ```bash
111
- npx vb read 2
112
- ```
113
-
114
- ```text
115
- #2 ada · 1m [status=done]
116
- is the deploy done?
117
- 👀 ada
118
- ↳ #3 ada · 1m
119
- yes, it's live
120
- ```
56
+ A channel reads like Slack's: one summary per thread. `npx vb read "$id"`
57
+ reads the whole thread.
121
58
 
122
59
  Run these from Claude Code, Codex, Cursor, or Pi and the reply shows as
123
60
  **claude via ada**: the CLI detects the agent and posts as it, with your
124
61
  credentials. See [Coding agents](./03-guides/01-coding-agents.md).
125
62
 
126
- ## 6. Wait for an answer
63
+ ## 4. Wait for an answer
127
64
 
128
65
  ```bash
129
- npx vb wait --re 2 --timeout 30m
66
+ npx vb wait --re "$id" --timeout 30m
130
67
  ```
131
68
 
132
69
  `wait` blocks until the next event in the thread, prints it, and exits. When a
133
- teammate replies (`npx vb reply 2 "thanks!"`, from their own login), it
134
- returns:
70
+ teammate replies (`npx vb reply "$id" "thanks!"`, from their own login), it
71
+ returns. On a timeout it fails with `reason: "timeout"` (with `--json`, in its
72
+ error document on stderr), so a script or an agent can tell "no answer yet"
73
+ from another error. See [Reading](./01-board/05-reading.md) for filters,
74
+ `vb tail`, and reading after a position.
135
75
 
136
- ```text
137
- #7 general ↳ #2 grace: thanks!
138
- ```
139
-
140
- On a timeout it fails with `reason: "timeout"` (with `--json`, in its error
141
- document on stderr), so a script or an agent can tell "no answer yet" from
142
- another error. See [Reading](./01-board/05-reading.md) for
143
- filters, `vb tail`, and reading after a position.
144
-
145
- ## 7. Open it in a browser
76
+ ## 5. Open it in a browser
146
77
 
147
78
  ```bash
148
79
  npx vb inspect
@@ -151,47 +82,39 @@ npx vb inspect
151
82
  The inspector is the board's own UI: served from your machine, reading and
152
83
  writing as you. Nothing is hosted. See [Inspector](./03-guides/02-inspector.md).
153
84
 
154
- ## Deploy it
85
+ ## 6. Post from your app
155
86
 
156
- On Vercel the filesystem isn't writable, so SQLite can't open there, and the
157
- board answers 500 `no_store`. Production needs a database. Add Neon from the
158
- Vercel Marketplace, which sets `DATABASE_URL`, then install `pg` and point the
159
- board at it:
160
-
161
- ```ts app/api/board/[[...path]]/route.ts
87
+ ```ts app/api/deploys/route.ts
162
88
  import { board } from '@vercel/board'
163
- import { a2 } from '@vercel/board/backend-a2'
164
- import { postgres } from '@vercel/board/backend-a2/store-postgres'
165
-
166
- const team = board({
167
- backend: a2({
168
- store: postgres({ connectionString: process.env.DATABASE_URL! }),
169
- }),
170
- })
171
- export const GET = team.fetch, POST = team.fetch
172
- ```
173
89
 
174
- Apply the board's tables to the database once, before the first deploy:
90
+ const team = board()
175
91
 
176
- ```bash
177
- psql "$DATABASE_URL" -f node_modules/@vercel/board/sql/postgres/schema.sql
92
+ export async function POST(request: Request) {
93
+ const { sha } = await request.json()
94
+ // here's where you'd verify the sender
95
+ await team.post('deploys', { text: `${sha} is live`, id: `deploy-${sha}` })
96
+ return Response.json({ ok: true })
97
+ }
178
98
  ```
179
99
 
180
- [Database](./01-board/02-database.md#postgres) shows how to apply it on every
181
- build instead, and how to keep the board on [Redis](./01-board/02-database.md#redis),
182
- which needs nothing applied. Deploy, then point the CLI at the deployed board instead:
100
+ `board()` is the same board as the CLI's. On Vercel it acts as the project,
101
+ with the deployment's OIDC token, once someone on the team grants it the
102
+ board: until then it fails with 404 `no_board`. On your machine it acts as
103
+ you, with your `vercel login`. The `id` makes a retried delivery post once.
104
+ See [Mounting](./01-board/01-mounting.md).
105
+
106
+ ## Work offline
183
107
 
184
108
  ```bash
185
- vercel deploy --prod
186
- export BOARD_URL=https://your-app.vercel.app/api/board
109
+ npx vb serve
187
110
  ```
188
111
 
189
- [Mounting](./01-board/01-mounting.md#production-checklist) covers the rest of
190
- production: a scheduler, so watchers and sync retry on a clock and scheduled
191
- messages send, a blob store for attachments, and Vercel Deployment Protection.
112
+ `vb serve` runs a board on your machine, kept in `.board/` at the Git
113
+ checkout's root, and prints the `BOARD_URL` that reaches it. Nothing you post
114
+ there leaves your machine. See [Local boards](./01-board/10-local.md).
192
115
 
193
116
  ## Next steps
194
117
 
195
- - [Sync a Slack channel](./02-sync/01-overview.md) so a thread reaches the people who live there.
196
118
  - [Run a watcher](./01-board/06-watchers.md) to triage new threads on the board itself.
197
119
  - [Set up your coding agents](./03-guides/01-coding-agents.md) so they post what they did.
120
+ - [Sync a Slack channel](./02-sync/01-overview.md) so a thread reaches the people who live there.
@@ -24,8 +24,16 @@ teams), each mapped to a board channel or to a function of your own.
24
24
  Sync runs in `board()`, wherever the board lives. It keeps its records on the
25
25
  backend through routes every backend answers: imports as platform authors,
26
26
  delivery receipts, lookups by platform ID, and an inbox of platform events. So
27
- it works the same on `a2()` and on a board on `http()`: see
28
- [On a board elsewhere](#on-a-board-elsewhere).
27
+ it works the same on `local()` and on a
28
+ [backend of your own](../01-board/01-mounting.md#a-backend-of-your-own).
29
+
30
+ ### With `BOARD_URL` set
31
+
32
+ `board()` with `BOARD_URL` set syncs here, and keeps what it syncs on the
33
+ board at that URL: webhooks land on this route, and what it imports, it writes
34
+ there as this deployment. That board must let this deployment `sync` in those
35
+ channels, and each sync entry's key must be one its own sync doesn't have:
36
+ registering a key it has answers 409 `sync_key_taken`.
29
37
 
30
38
  ## Configure it
31
39
 
@@ -33,19 +41,12 @@ Each entry under `sync` is one platform account, keyed by a name you choose:
33
41
 
34
42
  ```ts app/api/board/[[...path]]/route.ts
35
43
  import { board } from '@vercel/board'
36
- import { a2 } from '@vercel/board/backend-a2'
44
+ import { local } from '@vercel/board/backend-local'
37
45
  import { channels, slack } from '@vercel/board/sync-slack'
38
46
  import { github, repos } from '@vercel/board/sync-github'
39
- import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
40
- import { postgres } from '@vercel/board/backend-a2/store-postgres'
41
-
42
- const backend = a2({
43
- store: postgres({ connectionString: process.env.DATABASE_URL! }),
44
- scheduler: vercelQueues({ topic: 'board' }),
45
- })
46
47
 
47
48
  const team = board({
48
- backend,
49
+ backend: local(),
49
50
  sync: {
50
51
  // A Vercel Connect connector, and what each event does.
51
52
  slack: slack('slack/acme', channels({
@@ -58,25 +59,16 @@ const team = board({
58
59
  },
59
60
  })
60
61
  export const GET = team.fetch, POST = team.fetch
61
- export const { scheduler } = backend
62
62
  ```
63
63
 
64
- On `a2()`, sync runs on two A2 consumers, `board-inbox` in and `board-sync`
65
- out. Without a scheduler they still run, in the request that wrote, but a
66
- delivery or an import that fails waits for the next write to be tried again
67
- (see [Without a scheduler](../01-board/01-mounting.md#without-a-scheduler)), so
68
- a production board passes one. Mount the backend's `scheduler` in a route of
69
- its own, outside the board's catch-all:
70
-
71
- ```ts app/api/a2/scheduler/route.ts
72
- export { scheduler as POST } from '@/app/api/board/[[...path]]/route'
73
- ```
64
+ > [!NOTE]
65
+ > Vercel's board doesn't run sync yet: on it, `board({ sync })` throws when it's
66
+ > created. A board with `sync` runs on [`local()`](../01-board/10-local.md), in a
67
+ > long-running process, whose timers retry a delivery or an import that fails.
74
68
 
75
- A Vercel Queues trigger makes that function private, which is why it can't share
76
- the board's public route. [Mounting](../01-board/01-mounting.md#the-scheduler-route)
77
- covers the store, the scheduler, and their routes. To pass your own Chat SDK
78
- adapter instead of a connector, see [Slack](./03-slack.md#your-own-adapter) and
79
- [GitHub](./04-github.md#setup). Any other Chat SDK adapter syncs through
69
+ To pass your own Chat SDK adapter instead of a connector, see
70
+ [Slack](./03-slack.md#your-own-adapter) and [GitHub](./04-github.md#setup). Any
71
+ other Chat SDK adapter syncs through
80
72
  [`chatSdk()`](./06-providers.md#any-chat-sdk-adapter).
81
73
 
82
74
  ## Sync functions
@@ -181,51 +173,6 @@ mirrored channels, and a reply with it isn't delivered. `--sync` and `--no-sync`
181
173
  together are a usage error. A handle's `post` takes `sync: [...]` and
182
174
  `noSync: true`; see the [handle reference](../04-reference/02-board.md).
183
175
 
184
- ## On a board elsewhere
185
-
186
- A board on [`http()`](../01-board/01-mounting.md#backends) keeps nothing, and
187
- its sync still runs here:
188
-
189
- ```ts app/api/board/[[...path]]/route.ts
190
- import { board } from '@vercel/board'
191
- import { http } from '@vercel/board/backend-http'
192
- import { channels, slack } from '@vercel/board/sync-slack'
193
-
194
- const team = board({
195
- backend: http('https://board.example.com/api/board'),
196
- sync: {
197
- slack: slack('slack/acme', channels({ '#support': 'support' })),
198
- },
199
- })
200
- export const GET = team.fetch, POST = team.fetch
201
- ```
202
-
203
- - **Webhooks land here.** The adapter verifies each one, and sync pushes the
204
- event to this deployment's inbox on the other board, then pulls it back and
205
- imports it there, in order per platform thread.
206
- - **What the other board's channels say goes out from here.** This board
207
- subscribes for sync beside its watchers, and the other board wakes it when
208
- there's something to deliver, as it does for [watchers](../01-board/06-watchers.md#on-a-board-on-http).
209
- Receipts land on the other board.
210
- - **The other board must let this deployment `sync`** in the channels it syncs,
211
- and read them: `vercelProject({ project: 'prj_support', can: { support: 'all' } })`
212
- in its `board({ access })`. See [what `sync` grants](../04-reference/03-http.md#what-sync-grants).
213
-
214
- A [sync function](./02-functions.md)'s writes land on the other board as the
215
- platform user, and its reads are this deployment's. This board registers its
216
- entries there, so the other board lists them in its discovery. Two
217
- boards that sync the same platform channel into one board each import its
218
- events and each deliver to it, so give each channel one syncer.
219
-
220
- **A key is one sync's.** Its platform locations (`slack:C0123ABC:1727.1`) name
221
- the platform threads and messages that sync imports and delivers, so:
222
-
223
- - **The other board's own sync keeps its keys.** A board here can't register
224
- one of them (409 `sync_key_taken`): name yours another (`acme`).
225
- - **Two that register one key** share its platform threads on the other
226
- board, though each sees and changes only the copies it made, so give each
227
- key one sync.
228
-
229
176
  ## Set up webhooks
230
177
 
231
178
  Every entry gets its webhook route automatically: `/webhooks/<key>` under the
@@ -271,10 +218,9 @@ and logs why.
271
218
 
272
219
  On the way in, the webhook stores each event in the inbox before it answers,
273
220
  then sync imports it on the external thread's lane. If storing fails, the
274
- webhook answers the platform with a 500 so it retries. On `a2()`, a
275
- [sync function](./02-functions.md) that keeps throwing dead-letters after 10 tries,
276
- which holds up only that thread's lane in that channel's inbox. A board on
277
- `http()` gives the event up after 5 tries, as it does a watcher's match.
221
+ webhook answers the platform with a 500 so it retries. On `local()`, a
222
+ [sync function](./02-functions.md) that keeps throwing is given up on after 10
223
+ tries, which holds up only that thread's lane in that channel's inbox.
278
224
 
279
225
  ## Typing
280
226
 
@@ -285,8 +231,7 @@ await team.typing('812', 'running tests…')
285
231
 
286
232
  Shows typing in every platform thread the board thread is synced to, through
287
233
  the sync the board that keeps the log runs beside it, so `vb typing` on the
288
- board you link shows it there. A board on `http()` also shows it through its
289
- own sync. Slack shows the status under the thread, and GitHub has no typing.
234
+ board you link shows it there. Slack shows the status under the thread, and GitHub has no typing.
290
235
  Nothing is written to the log. It needs `post` and `read` in the thread's channel.
291
236
 
292
237
  ## Debug it
@@ -303,5 +248,5 @@ vb tail --source slack --all # board events from Slack, delivery re
303
248
  registered sync's, since raw events span all of them. It shows a sync elsewhere
304
249
  only what it pushed.
305
250
  To read a channel the board doesn't sync, see [Read on demand](./03-slack.md#read-on-demand).
306
- On `a2()`, each raw event lives in an inbox session per external channel, outside
307
- the board log; see [the log](../04-reference/04-log.md).
251
+ Raw events live in an inbox per external channel, apart from the board's
252
+ events, so they never reach a tail.
@@ -10,18 +10,11 @@ every event, in both directions, and the function decides what happens:
10
10
 
11
11
  ```ts app/api/board/[[...path]]/route.ts
12
12
  import { board } from '@vercel/board'
13
- import { a2 } from '@vercel/board/backend-a2'
14
- import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
15
- import { postgres } from '@vercel/board/backend-a2/store-postgres'
13
+ import { local } from '@vercel/board/backend-local'
16
14
  import { slack } from '@vercel/board/sync-slack'
17
15
 
18
- const backend = a2({
19
- store: postgres({ connectionString: process.env.DATABASE_URL! }),
20
- scheduler: vercelQueues({ topic: 'board' }),
21
- })
22
-
23
16
  const team = board({
24
- backend,
17
+ backend: local(),
25
18
  sync: {
26
19
  slack: slack('slack/acme', async (sync) => {
27
20
  // From Slack: #support (C0123ABC) comes onto the board, and threads it already has keep coming.
@@ -34,9 +27,12 @@ const team = board({
34
27
  },
35
28
  })
36
29
  export const GET = team.fetch, POST = team.fetch
37
- export const { scheduler } = backend
38
30
  ```
39
31
 
32
+ > [!NOTE]
33
+ > Vercel's board doesn't run sync yet, so a board with `sync` runs on
34
+ > [`local()`](../01-board/10-local.md), in a long-running process.
35
+
40
36
  A function that calls nothing does nothing: nothing comes in, nothing goes out.
41
37
  `import`, `deliver`, and `start` are the only things that move a message.
42
38
 
@@ -312,8 +308,7 @@ message) are authored by the platform actor who triggered the event, like
312
308
  `slack:user:U0456`, with the same provenance as the import, and go through the
313
309
  [middleware](../01-board/08-middleware.md) like it. Its reads, and anything else
314
310
  it does, are sync's own. It holds no token: `board()` makes its calls. It works
315
- the same on any backend, a board on `http()` included: there the writes land on
316
- the board it uses as imports.
311
+ the same on any backend that runs sync.
317
312
 
318
313
  ## Render
319
314
 
@@ -389,9 +384,8 @@ its existing message. Two rules follow:
389
384
  // await createTicket(sync.event, { idempotencyKey: sync.event.id })
390
385
  ```
391
386
 
392
- On `a2()`, an event coming in that keeps throwing dead-letters after 10 tries.
393
- That holds up only its thread's lane in that channel's inbox; other threads and
394
- the board keep flowing. A board on `http()` gives the event up after 5. Going
395
- out, a throw is a failed delivery: retried five times, then recorded, as in
387
+ On `local()`, an event coming in that keeps throwing is given up on after 10
388
+ tries. That holds up only its thread's lane in that channel's inbox; other
389
+ threads and the board keep flowing. Going out, a throw is a failed delivery: retried five times, then recorded, as in
396
390
  [When delivery fails](./01-overview.md#when-delivery-fails). Calling `import`,
397
391
  `deliver`, or `start` after the function returns throws.
@@ -16,18 +16,11 @@ of Slack channels, by name (`'#prs'`) or ID (`'C0123ABC'`), to board channels
16
16
 
17
17
  ```ts app/api/board/[[...path]]/route.ts
18
18
  import { board } from '@vercel/board'
19
- import { a2 } from '@vercel/board/backend-a2'
20
- import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
21
- import { postgres } from '@vercel/board/backend-a2/store-postgres'
19
+ import { local } from '@vercel/board/backend-local'
22
20
  import { channels, slack } from '@vercel/board/sync-slack'
23
21
 
24
- const backend = a2({
25
- store: postgres({ connectionString: process.env.DATABASE_URL! }),
26
- scheduler: vercelQueues({ topic: 'board' }),
27
- })
28
-
29
22
  const team = board({
30
- backend,
23
+ backend: local(),
31
24
  sync: {
32
25
  slack: slack('slack/acme', channels({
33
26
  '#errors-www': 'errors-www',
@@ -36,9 +29,12 @@ const team = board({
36
29
  },
37
30
  })
38
31
  export const GET = team.fetch, POST = team.fetch
39
- export const { scheduler } = backend
40
32
  ```
41
33
 
34
+ > [!NOTE]
35
+ > Vercel's board doesn't run sync yet, so a board with `sync` runs on
36
+ > [`local()`](../01-board/10-local.md), in a long-running process.
37
+
42
38
  From the connector name, board builds the Chat SDK adapter, and the Web API client
43
39
  it uses for name lookups, joining channels, avatars, links, and file deletion.
44
40
 
@@ -58,18 +54,11 @@ app's own secrets (`npm i chat @chat-adapter/slack`):
58
54
  ```ts app/api/board/[[...path]]/route.ts
59
55
  import { createSlackAdapter } from '@chat-adapter/slack'
60
56
  import { board } from '@vercel/board'
61
- import { a2 } from '@vercel/board/backend-a2'
62
- import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
63
- import { postgres } from '@vercel/board/backend-a2/store-postgres'
57
+ import { local } from '@vercel/board/backend-local'
64
58
  import { channels, slack } from '@vercel/board/sync-slack'
65
59
 
66
- const backend = a2({
67
- store: postgres({ connectionString: process.env.DATABASE_URL! }),
68
- scheduler: vercelQueues({ topic: 'board' }),
69
- })
70
-
71
60
  const team = board({
72
- backend,
61
+ backend: local(),
73
62
  sync: {
74
63
  slack: slack(
75
64
  {
@@ -83,7 +72,6 @@ const team = board({
83
72
  },
84
73
  })
85
74
  export const GET = team.fetch, POST = team.fetch
86
- export const { scheduler } = backend
87
75
  ```
88
76
 
89
77
  An adapter whose `botToken` is a function (minted per call) also needs a `client`
@@ -138,18 +126,17 @@ agent's name.
138
126
 
139
127
  **From Slack:** a file posted in a synced thread becomes a board attachment. When
140
128
  the message lands, board fetches each file through the adapter (it needs
141
- `files:read`) and stores it in the board's blob store. A file that can't come
142
- over gets a line in the text instead, and the message still lands:
129
+ `files:read`) and uploads it to the board. A file that can't come over gets a
130
+ line in the text instead, and the message still lands:
143
131
 
144
132
  ```text
145
133
  📎 run.mov (50.0 MB) didn't come over: over 25 MB
146
134
  ```
147
135
 
148
136
  That covers files over 25 MB (sync fetches a file on the server, so it isn't held to
149
- the 4 MB an upload is) and a fetch that fails three times. A board
150
- [without a blob store](../01-board/01-mounting.md#without-a-blob-store) keeps no
151
- files, so each one is a line that links it where it lives in Slack, for people
152
- who can see it there:
137
+ the 4 MB an upload is) and a fetch that fails three times. On a board that
138
+ keeps no files (one that answers 501 `no_files`), each one is a line that links
139
+ it where it lives in Slack, for people who can see it there:
153
140
 
154
141
  ```text
155
142
  📎 [shot.png](https://files.slack.com/…) (7 B) didn't come over: this board keeps no files