@vercel/board 0.32.0 → 0.33.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.
- package/README.md +25 -20
- package/dist/{access-CY5xVMIK.mjs → access-N3XmkKXg.mjs} +3 -3
- package/dist/access.d.mts +4 -5
- package/dist/access.mjs +5 -5
- package/dist/{actors-Bm-ojWWT.mjs → actors-ihyN47OV.mjs} +3 -3
- package/dist/{auth-K8dY1nBY.d.mts → auth-D6z3rMNj.d.mts} +7 -93
- package/dist/{auth-8pRZnF1M.mjs → auth-r-_PeZyw.mjs} +32 -148
- package/dist/{backend-DxE9wGKm.d.mts → backend-CWpyR1A7.d.mts} +81 -51
- package/dist/backend-local.d.mts +28 -0
- package/dist/backend-local.mjs +2 -0
- package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
- package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-DJpFUaFv.d.mts} +2 -3
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +2 -2
- package/dist/cli-embedded.mjs +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/{commands-CpyPV_tk.d.mts → commands-BOBQHVqM.d.mts} +9 -0
- package/dist/{commands-DsnQKTdB.mjs → commands-CHoMl06v.mjs} +12 -1
- package/dist/{conformance-3RBKxwbp.mjs → conformance-qKmGLTAT.mjs} +5 -5
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DurYIRt8.mjs → engine-JxgZiikU.mjs} +6 -8
- package/dist/{errors-CJXhhzvT.mjs → errors-Pk0XV1hK.mjs} +56 -2
- package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
- package/dist/exports-BuKjVq2t.d.mts +4 -0
- package/dist/exports-gHDHlg0i.mjs +3207 -0
- package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
- package/dist/{folds-DLUzfibJ.d.mts → folds-DjFTiqIM.d.mts} +38 -44
- package/dist/index-CXvvYNYj.d.mts +11 -0
- package/dist/index.d.mts +9 -8
- package/dist/index.mjs +21 -8
- package/dist/index.node.d.mts +5 -6
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +95 -95
- package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
- package/dist/local-BbLjA5vI.mjs +8818 -0
- package/dist/{main-CcYDo9Hb.mjs → main-CQpCZJFw.mjs} +91 -23
- package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
- package/dist/middleware-BU7rVi9F.mjs +103 -0
- package/dist/{client-COfYrgfV.d.mts → provider-BlzUvcM9.d.mts} +665 -5
- package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
- package/dist/{serve-Bplieh0C.mjs → serve-D8_W4UN6.mjs} +33 -24
- package/dist/{node-BgeGcwX0.mjs → server-BiIUXWbU.mjs} +419 -6
- package/dist/{serving-Y7s7VDjB.mjs → serving-D7rcUtSC.mjs} +1 -1
- package/dist/{sql-E1K5g_ih.mjs → sql-BQzKUqQt.mjs} +349 -114
- package/dist/sqlite-DCtZFEVm.mjs +30 -0
- package/dist/{sqlite-db-CzcD_FW8.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
- package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
- package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
- package/dist/store-memory-OdGsc-t_.mjs +2 -0
- package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
- package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
- package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-chat-sdk.mjs +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-github.mjs +2 -2
- package/dist/sync-linear.d.mts +2 -3
- package/dist/sync-linear.mjs +2 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync-slack.mjs +4 -4
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{watchers-hash-CurCzwhe.mjs → targets-CknPGGVi.mjs} +40 -10
- package/dist/{tokens-C7kYyrAG.mjs → tokens-DPKjl3jf.mjs} +15 -43
- package/docs/01-board/01-mounting.md +243 -288
- package/docs/01-board/03-identity.md +41 -50
- package/docs/01-board/04-messages.md +15 -14
- package/docs/01-board/05-reading.md +3 -3
- package/docs/01-board/06-watchers.md +58 -105
- package/docs/01-board/07-schedules.md +21 -41
- package/docs/01-board/08-middleware.md +11 -17
- package/docs/01-board/09-access.md +76 -313
- package/docs/01-board/10-local.md +81 -0
- package/docs/01-quickstart.md +49 -126
- package/docs/02-sync/01-overview.md +25 -80
- package/docs/02-sync/02-functions.md +10 -16
- package/docs/02-sync/03-slack.md +13 -26
- package/docs/02-sync/04-github.md +8 -20
- package/docs/02-sync/07-linear.md +6 -10
- package/docs/03-guides/02-inspector.md +3 -3
- package/docs/03-guides/03-ci.md +88 -128
- package/docs/03-guides/04-triage.md +7 -15
- package/docs/03-guides/05-agent-factory.md +30 -36
- package/docs/04-reference/01-cli.md +104 -22
- package/docs/04-reference/02-board.md +60 -74
- package/docs/04-reference/03-http.md +119 -57
- package/docs/04-reference/05-conformance.md +31 -45
- package/docs/index.md +41 -65
- package/package.json +12 -83
- package/dist/a2-DiDc77Uf.mjs +0 -4238
- package/dist/access-DPcrKIH_.d.mts +0 -37
- package/dist/backend-a2/blob-vercel.d.mts +0 -8
- package/dist/backend-a2/blob-vercel.mjs +0 -81
- package/dist/backend-a2/contract.d.mts +0 -828
- package/dist/backend-a2/contract.mjs +0 -5
- package/dist/backend-a2/scheduler-local.d.mts +0 -11
- package/dist/backend-a2/scheduler-local.mjs +0 -2
- package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
- package/dist/backend-a2/scheduler-qstash.mjs +0 -522
- package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
- package/dist/backend-a2/scheduler-vercel.mjs +0 -204
- package/dist/backend-a2/store-memory.d.mts +0 -11
- package/dist/backend-a2/store-postgres.d.mts +0 -38
- package/dist/backend-a2/store-postgres.mjs +0 -2977
- package/dist/backend-a2/store-redis-http.d.mts +0 -17
- package/dist/backend-a2/store-redis-http.mjs +0 -520
- package/dist/backend-a2/store-redis.d.mts +0 -31
- package/dist/backend-a2/store-redis.mjs +0 -88
- package/dist/backend-a2/store-sqlite.d.mts +0 -12
- package/dist/backend-a2/store-sqlite.mjs +0 -31
- package/dist/backend-a2.d.mts +0 -2633
- package/dist/backend-a2.mjs +0 -3
- package/dist/backend-http-CaN06CaD.d.mts +0 -672
- package/dist/backend-http-CoaCghuJ.mjs +0 -18
- package/dist/backend-http-l5A8UmL-.mjs +0 -585
- package/dist/backend-http.d.mts +0 -10
- package/dist/backend-http.mjs +0 -2
- package/dist/backend-http.node.d.mts +0 -10
- package/dist/backend-http.node.mjs +0 -2
- package/dist/backend-vercel-BE65okBC.mjs +0 -86
- package/dist/backend-vercel-CVxoTNF2.mjs +0 -1744
- package/dist/backend-vercel-jg-6PAgD.d.mts +0 -674
- package/dist/backend-vercel.d.mts +0 -9
- package/dist/backend-vercel.mjs +0 -11
- package/dist/backend-vercel.node.d.mts +0 -17
- package/dist/backend-vercel.node.mjs +0 -2
- package/dist/blob-Bx8QPWEd.d.mts +0 -40
- package/dist/blob-WbB2DJKn.mjs +0 -201
- package/dist/errors-2vGs49Db.d.mts +0 -16
- package/dist/exports-BnUZuRm9.mjs +0 -1389
- package/dist/exports-u5mApVvn.d.mts +0 -5
- package/dist/files-SniSmeEr.mjs +0 -47
- package/dist/folds-DsWfIftc.mjs +0 -208
- package/dist/index-UXpTPWNc.d.mts +0 -11
- package/dist/index.default-Dp8gexln.mjs +0 -12
- package/dist/local-C76Fy5ad.mjs +0 -44
- package/dist/middleware-BavYSDUa.mjs +0 -62
- package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
- package/dist/project-4Vl7_uy5.mjs +0 -124
- package/dist/provider-gynDUoyW.d.mts +0 -665
- package/dist/redis-tables-BFRj_SEJ.mjs +0 -3895
- package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
- package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
- package/dist/reducers-DQVSP3kk.mjs +0 -538
- package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
- package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
- package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
- package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
- package/dist/server-wIpAEjpX.mjs +0 -17
- package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
- package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
- package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
- package/dist/store-memory-4IBl0Ztu.mjs +0 -2
- package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
- package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
- package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
- package/dist/targets-Cgjs29T0.mjs +0 -33
- package/dist/types-CmrFjpml.d.mts +0 -102
- package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
- package/docs/01-board/02-database.md +0 -258
- package/docs/04-reference/04-log.md +0 -247
- package/sql/postgres/board.sql +0 -145
- package/sql/postgres/notifications.sql +0 -24
- package/sql/postgres/schema.sql +0 -451
package/docs/01-quickstart.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Quickstart
|
|
3
|
-
description:
|
|
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
|
|
9
|
-
|
|
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.
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
67
|
-
|
|
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
|
-
##
|
|
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.
|
|
87
|
-
|
|
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
|
|
94
|
-
npx vb react
|
|
95
|
-
npx vb label
|
|
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
|
-
|
|
100
|
-
|
|
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
|
-
##
|
|
63
|
+
## 4. Wait for an answer
|
|
127
64
|
|
|
128
65
|
```bash
|
|
129
|
-
npx vb wait --re
|
|
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
|
|
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
|
-
|
|
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
|
-
##
|
|
85
|
+
## 6. Post from your app
|
|
155
86
|
|
|
156
|
-
|
|
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
|
-
|
|
90
|
+
const team = board()
|
|
175
91
|
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
|
|
186
|
-
export BOARD_URL=https://your-app.vercel.app/api/board
|
|
109
|
+
npx vb serve
|
|
187
110
|
```
|
|
188
111
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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 `
|
|
28
|
-
[
|
|
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 {
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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 `
|
|
275
|
-
[sync function](./02-functions.md) that keeps throwing
|
|
276
|
-
which holds up only that thread's lane in that channel's inbox.
|
|
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.
|
|
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
|
-
|
|
307
|
-
|
|
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 {
|
|
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
|
|
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 `
|
|
393
|
-
That holds up only its thread's lane in that channel's inbox; other
|
|
394
|
-
the board keep flowing.
|
|
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.
|
package/docs/02-sync/03-slack.md
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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
|
|
142
|
-
|
|
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.
|
|
150
|
-
|
|
151
|
-
|
|
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
|
|
@@ -16,18 +16,11 @@ connector name:
|
|
|
16
16
|
|
|
17
17
|
```ts app/api/board/[[...path]]/route.ts
|
|
18
18
|
import { board } from '@vercel/board'
|
|
19
|
-
import {
|
|
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 { github, repos } from '@vercel/board/sync-github'
|
|
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
|
github: github('github/acme', repos({
|
|
33
26
|
'acme/www': 'dev', // PRs and issues, both in dev
|
|
@@ -37,9 +30,12 @@ const team = board({
|
|
|
37
30
|
},
|
|
38
31
|
})
|
|
39
32
|
export const GET = team.fetch, POST = team.fetch
|
|
40
|
-
export const { scheduler } = backend
|
|
41
33
|
```
|
|
42
34
|
|
|
35
|
+
> [!NOTE]
|
|
36
|
+
> Vercel's board doesn't run sync yet, so a board with `sync` runs on
|
|
37
|
+
> [`local()`](../01-board/10-local.md), in a long-running process.
|
|
38
|
+
|
|
43
39
|
A value is a board channel or a [function](./02-functions.md) for the repo's PRs
|
|
44
40
|
and issues alike, or `{ pulls, issues }` to send each somewhere else. Leave one out
|
|
45
41
|
to skip it.
|
|
@@ -204,18 +200,11 @@ Without Connect, pass the App's credentials to a Chat SDK adapter
|
|
|
204
200
|
```ts app/api/board/[[...path]]/route.ts
|
|
205
201
|
import { createGitHubAdapter } from '@chat-adapter/github'
|
|
206
202
|
import { board } from '@vercel/board'
|
|
207
|
-
import {
|
|
208
|
-
import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
|
|
209
|
-
import { postgres } from '@vercel/board/backend-a2/store-postgres'
|
|
203
|
+
import { local } from '@vercel/board/backend-local'
|
|
210
204
|
import { github, repos } from '@vercel/board/sync-github'
|
|
211
205
|
|
|
212
|
-
const backend = a2({
|
|
213
|
-
store: postgres({ connectionString: process.env.DATABASE_URL! }),
|
|
214
|
-
scheduler: vercelQueues({ topic: 'board' }),
|
|
215
|
-
})
|
|
216
|
-
|
|
217
206
|
const team = board({
|
|
218
|
-
backend,
|
|
207
|
+
backend: local(),
|
|
219
208
|
sync: {
|
|
220
209
|
github: github(
|
|
221
210
|
{
|
|
@@ -231,7 +220,6 @@ const team = board({
|
|
|
231
220
|
},
|
|
232
221
|
})
|
|
233
222
|
export const GET = team.fetch, POST = team.fetch
|
|
234
|
-
export const { scheduler } = backend
|
|
235
223
|
```
|
|
236
224
|
|
|
237
225
|
A repo without the App can still announce PRs from a workflow; see
|
|
@@ -16,18 +16,11 @@ connector name:
|
|
|
16
16
|
|
|
17
17
|
```ts app/api/board/[[...path]]/route.ts
|
|
18
18
|
import { board } from '@vercel/board'
|
|
19
|
-
import {
|
|
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 { linear, teams } from '@vercel/board/sync-linear'
|
|
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
|
linear: linear('linear/acme', teams({
|
|
33
26
|
ENG: 'dev', // ENG-123 and the rest of the team's issues, both ways
|
|
@@ -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
|
A key is a team's key, the prefix of its issue IDs (`ENG` in `ENG-123`). A value is
|
|
43
39
|
a board channel to mirror, or a [function](./02-functions.md). A team that isn't
|
|
44
40
|
in the map stays off the board, except threads someone syncs by hand.
|
|
@@ -97,8 +97,8 @@ point it at a board you run locally with no `sync` configured:
|
|
|
97
97
|
vb inspect --url http://localhost:3000/api/board
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
A board on `
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
A board on `local()` keeps its log in SQLite under `.board/`, in the directory
|
|
101
|
+
it runs in; see [Local boards](../01-board/10-local.md). `vb serve` runs a
|
|
102
|
+
local board with no sync and opens the inspector on it. Sync
|
|
103
103
|
config runs wherever the board runs, so a local board that mirrors Slack posts
|
|
104
104
|
to Slack too.
|