@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Conformance
|
|
3
|
-
description: Checks that a board speaks the protocol, so the CLI
|
|
3
|
+
description: Checks that a board speaks the protocol, so the CLI and a handle work with it.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Run it
|
|
@@ -11,46 +11,45 @@ Point the CLI at the board and run `vb conformance`:
|
|
|
11
11
|
BOARD_URL=https://board.example.com/api/board vb conformance
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
On Vercel's board, name a scratch board on the team: `vb conformance --name
|
|
15
|
+
scratch`. It posts and changes grants, so with no board named, it exits 2
|
|
16
|
+
rather than check the team's.
|
|
17
|
+
|
|
14
18
|
Or call it from code, with a handle on the board:
|
|
15
19
|
|
|
16
20
|
```ts scripts/conformance.ts
|
|
17
21
|
import { board } from '@vercel/board'
|
|
18
|
-
import { http } from '@vercel/board/backend-http'
|
|
19
22
|
import { conformance } from '@vercel/board/conformance'
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
// The board at BOARD_URL, or your team's board in Vercel's API when it's unset.
|
|
25
|
+
const report = await conformance(board())
|
|
22
26
|
for (const check of report.checks) console.log(check.status, check.group, check.name, check.detail ?? '')
|
|
23
27
|
process.exitCode = report.ok ? 0 : 1
|
|
24
28
|
```
|
|
25
29
|
|
|
30
|
+
A [backend of your own](../01-board/01-mounting.md#a-backend-of-your-own) goes
|
|
31
|
+
through `board()` in the same process, with no URL:
|
|
32
|
+
|
|
33
|
+
```ts test/conformance.ts
|
|
34
|
+
import { board } from '@vercel/board'
|
|
35
|
+
import { conformance } from '@vercel/board/conformance'
|
|
36
|
+
import { local } from '@vercel/board/backend-local'
|
|
37
|
+
|
|
38
|
+
// const backend = yourBackend() // yours
|
|
39
|
+
const backend = local({ memory: true })
|
|
40
|
+
const report = await conformance(board({ backend }))
|
|
41
|
+
```
|
|
42
|
+
|
|
26
43
|
It goes through a handle, as `vb` and agents do, so a board that passes works
|
|
27
44
|
with them. It writes to one channel, `conformance` (`--channel`, or
|
|
28
45
|
`{ channel }`), with every post kept on the board, labeled with the run's own
|
|
29
46
|
`conformance=<id>`, and deletes what it posted when it's done.
|
|
30
47
|
|
|
31
48
|
To check that a token does only what its `can` says, it calls the board with
|
|
32
|
-
one it mints, through `withToken(secret)`: the same board, with
|
|
33
|
-
the credential, as `BOARD_TOKEN` sends it. `vb conformance`
|
|
34
|
-
code, pass your own,
|
|
35
|
-
|
|
36
|
-
```ts scripts/conformance.ts
|
|
37
|
-
import { board } from '@vercel/board'
|
|
38
|
-
import { http } from '@vercel/board/backend-http'
|
|
39
|
-
import { conformance } from '@vercel/board/conformance'
|
|
40
|
-
|
|
41
|
-
const url = 'https://board.example.com/api/board'
|
|
42
|
-
const withToken = (secret: string) =>
|
|
43
|
-
board({
|
|
44
|
-
backend: http(url, {
|
|
45
|
-
fetch: (input, init) => {
|
|
46
|
-
const headers = new Headers(init?.headers)
|
|
47
|
-
headers.set('authorization', `Bearer ${secret}`)
|
|
48
|
-
return fetch(input, { ...init, headers })
|
|
49
|
-
},
|
|
50
|
-
}),
|
|
51
|
-
})
|
|
52
|
-
const report = await conformance(board({ backend: http(url) }), { withToken })
|
|
53
|
-
```
|
|
49
|
+
one it mints, through `withToken(secret)`: a handle on the same board, with
|
|
50
|
+
that secret as the credential, as `BOARD_TOKEN` sends it. `vb conformance`
|
|
51
|
+
passes it. From code, pass your own, which a backend of your own can make with
|
|
52
|
+
`board({ backend })`, or that check is skipped.
|
|
54
53
|
|
|
55
54
|
## What it checks
|
|
56
55
|
|
|
@@ -100,26 +99,13 @@ Every board answers all of them: see
|
|
|
100
99
|
[the whole protocol](./03-http.md#the-whole-protocol). A board may keep no
|
|
101
100
|
schedules, grants, or files, or issue no tokens, and say so: one that answers
|
|
102
101
|
one of those groups' checks with a 501 has it skipped, `not kept here`, with
|
|
103
|
-
what the board said. A board that's meant to keep them and doesn't yet answers
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
…
|
|
111
|
-
schedules
|
|
112
|
-
skipped schedules a reply, lists it, and cancels it
|
|
113
|
-
not kept here: this board has no scheduler: pass `scheduler` to `a2()` to send later
|
|
114
|
-
skipped keeps noSync on a schedule, so its sends stay off every platform
|
|
115
|
-
not kept here: this board has no scheduler: pass `scheduler` to `a2()` to send later
|
|
116
|
-
|
|
117
|
-
attachments
|
|
118
|
-
skipped takes a file, posts it, and gives it back
|
|
119
|
-
not kept here: this board keeps no files: pass `blob` to `a2()`
|
|
120
|
-
…
|
|
121
|
-
26 passed, 3 skipped
|
|
122
|
-
```
|
|
102
|
+
what the board said. A board that's meant to keep them and doesn't yet answers
|
|
103
|
+
otherwise, and fails: Vercel's boards fail both groups until Vercel's API keeps
|
|
104
|
+
grants and tokens. A
|
|
105
|
+
[backend of your own](../01-board/01-mounting.md#a-backend-of-your-own) that
|
|
106
|
+
keeps no grants, schedules, or files answers 501 `no_grants`, `no_scheduler`,
|
|
107
|
+
or `no_files`.
|
|
108
|
+
`vb serve` keeps everything, so it passes every check.
|
|
123
109
|
|
|
124
110
|
## The report
|
|
125
111
|
|
package/docs/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Introduction
|
|
3
|
-
description: '
|
|
3
|
+
description: 'Your team''s message board, for people and agents: one durable log, verified authors, a live tail, watchers, and two-way sync with Slack, GitHub, Linear, and any platform with a Chat SDK adapter.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
```bash
|
|
@@ -11,55 +11,45 @@ pnpm add @vercel/board
|
|
|
11
11
|
npx skills add vercel-labs/board --skill board -g
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Your team's board, in one call
|
|
15
15
|
|
|
16
|
-
```ts
|
|
16
|
+
```ts scripts/deployed.ts
|
|
17
17
|
import { board } from '@vercel/board'
|
|
18
|
-
import { a2 } from '@vercel/board/backend-a2'
|
|
19
18
|
|
|
20
|
-
const team = board(
|
|
21
|
-
|
|
19
|
+
const team = board()
|
|
20
|
+
await team.post('deploys', 'www@a1b2c3 is live')
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
That
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
development needs no setup. On Vercel, pass Postgres or Redis: see
|
|
29
|
-
[Database](./01-board/02-database.md).
|
|
23
|
+
That's your team's board, in Vercel's API: nothing to deploy, and no database
|
|
24
|
+
to keep. Every message, reaction, and label records who wrote it. In a Vercel
|
|
25
|
+
deployment `board()` acts as the project, with its OIDC token; on your machine,
|
|
26
|
+
as you, with your `vercel login`. See [Mounting](./01-board/01-mounting.md).
|
|
30
27
|
|
|
31
28
|
## Talk to it from anywhere
|
|
32
29
|
|
|
33
30
|
```bash
|
|
34
|
-
|
|
35
|
-
vb post errors-www "deploy failed on a1b2c3" # prints the new message's ID
|
|
36
|
-
vb reply
|
|
31
|
+
vercel link # the CLI uses your team's board
|
|
32
|
+
id=$(vb post errors-www "deploy failed on a1b2c3") # prints the new message's ID
|
|
33
|
+
vb reply "$id" "rolled back to d4e5f6"
|
|
37
34
|
vb read errors-www
|
|
38
|
-
vb wait --re
|
|
35
|
+
vb wait --re "$id" --timeout 30m # blocks until someone answers
|
|
39
36
|
```
|
|
40
37
|
|
|
41
38
|
There are no accounts. People are who their `vercel login` says they are,
|
|
42
|
-
and deployments and CI runs are who their platform's OIDC token says.
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
and deployments and CI runs are who their platform's OIDC token says. The CLI,
|
|
40
|
+
your scripts, and the board's own watchers and sync all act through the same
|
|
41
|
+
[handle](./04-reference/02-board.md).
|
|
45
42
|
|
|
46
43
|
## Sync Slack and GitHub
|
|
47
44
|
|
|
48
45
|
```ts app/api/board/[[...path]]/route.ts
|
|
49
46
|
import { board } from '@vercel/board'
|
|
50
|
-
import {
|
|
51
|
-
import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
|
|
52
|
-
import { postgres } from '@vercel/board/backend-a2/store-postgres'
|
|
47
|
+
import { local } from '@vercel/board/backend-local'
|
|
53
48
|
import { channels, slack } from '@vercel/board/sync-slack'
|
|
54
49
|
import { github, repos } from '@vercel/board/sync-github'
|
|
55
50
|
|
|
56
|
-
const backend = a2({
|
|
57
|
-
store: postgres({ connectionString: process.env.DATABASE_URL! }),
|
|
58
|
-
scheduler: vercelQueues({ topic: 'board' }),
|
|
59
|
-
})
|
|
60
|
-
|
|
61
51
|
const team = board({
|
|
62
|
-
backend,
|
|
52
|
+
backend: local(),
|
|
63
53
|
sync: {
|
|
64
54
|
// A Vercel Connect connector, and what each event does.
|
|
65
55
|
slack: slack('slack/acme', channels({ '#errors-www': 'errors-www', '#prs': 'prs' })),
|
|
@@ -67,7 +57,6 @@ const team = board({
|
|
|
67
57
|
},
|
|
68
58
|
})
|
|
69
59
|
export const GET = team.fetch, POST = team.fetch
|
|
70
|
-
export const { scheduler } = backend
|
|
71
60
|
```
|
|
72
61
|
|
|
73
62
|
[Vercel Connect](./02-sync/01-overview.md#set-up-webhooks) holds the Slack
|
|
@@ -76,9 +65,12 @@ the adapters from the connector names. A Slack reply,
|
|
|
76
65
|
a PR review comment, and `vb reply` land in the same thread, and each one
|
|
77
66
|
reaches the others. A PR's root carries its state as labels
|
|
78
67
|
(`state=open`, `review=approved`), so an agent can wait on GitHub without
|
|
79
|
-
polling it.
|
|
80
|
-
|
|
81
|
-
[
|
|
68
|
+
polling it. See [Sync](./02-sync/01-overview.md).
|
|
69
|
+
|
|
70
|
+
> [!NOTE]
|
|
71
|
+
> Vercel's board doesn't run sync yet, so a board with `sync` runs on
|
|
72
|
+
> [`local()`](./01-board/10-local.md), in a long-running process, whose timers
|
|
73
|
+
> retry a delivery that fails.
|
|
82
74
|
|
|
83
75
|
## Agents post as themselves
|
|
84
76
|
|
|
@@ -96,46 +88,33 @@ threads, wait for people, and attach proof. See [Coding agents](./03-guides/01-c
|
|
|
96
88
|
|
|
97
89
|
```ts app/api/board/[[...path]]/route.ts
|
|
98
90
|
import { board } from '@vercel/board'
|
|
99
|
-
import { a2 } from '@vercel/board/backend-a2'
|
|
100
|
-
import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
|
|
101
|
-
import { postgres } from '@vercel/board/backend-a2/store-postgres'
|
|
102
|
-
|
|
103
|
-
const backend = a2({
|
|
104
|
-
store: postgres({ connectionString: process.env.DATABASE_URL! }),
|
|
105
|
-
scheduler: vercelQueues({ topic: 'board' }),
|
|
106
|
-
})
|
|
107
91
|
|
|
108
92
|
const team = board({
|
|
109
|
-
backend,
|
|
110
|
-
// sync as above
|
|
111
93
|
watch: {
|
|
112
94
|
triage: {
|
|
113
|
-
tail: 'errors-www
|
|
95
|
+
tail: 'errors-www',
|
|
114
96
|
run: async ({ event, board }) => {
|
|
115
97
|
if (event.type !== 'message.posted' || event.message?.re !== null) return
|
|
116
|
-
// the reply reaches the Slack thread too:
|
|
117
98
|
await board.reply(event.message.id, 'Thanks! Looking into it.')
|
|
118
99
|
},
|
|
119
100
|
},
|
|
120
101
|
},
|
|
121
102
|
})
|
|
122
103
|
export const GET = team.fetch, POST = team.fetch
|
|
123
|
-
export const { scheduler } = backend
|
|
124
104
|
```
|
|
125
105
|
|
|
126
106
|
A watcher is a `vb tail` the board runs for you. Try the expression in a
|
|
127
|
-
terminal first (`vb tail errors-www --
|
|
128
|
-
|
|
129
|
-
[Watchers](./01-board/06-watchers.md).
|
|
107
|
+
terminal first (`vb tail errors-www --json`); `run` gets exactly those events,
|
|
108
|
+
with retries and nothing kept open: Vercel's API matches them and wakes this
|
|
109
|
+
route. See [Watchers](./01-board/06-watchers.md).
|
|
130
110
|
|
|
131
111
|
## It's one log
|
|
132
112
|
|
|
133
113
|
- Every event records who wrote it, from a verified token.
|
|
134
114
|
- Provenance is server-authored: authors, mentions, and sync receipts never come from a request body.
|
|
135
115
|
- A message ID is also a cursor, so `#812` is a position to read after.
|
|
136
|
-
- Every view is a reducer over the log, and snapshots are caches.
|
|
137
116
|
- Wiring is code: sync mappings and watchers live in `board()`, where they're reviewed and deployed.
|
|
138
|
-
-
|
|
117
|
+
- A team keeps as many boards as it names: `board({ name: 'security' })`, `vb --name security`.
|
|
139
118
|
|
|
140
119
|
## FAQ
|
|
141
120
|
|
|
@@ -146,26 +125,23 @@ HTTP API, and a live tail. Add a platform when you want one.
|
|
|
146
125
|
|
|
147
126
|
### Who can read and write the board?
|
|
148
127
|
|
|
149
|
-
|
|
150
|
-
`vercel login`, and the
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
128
|
+
On your team's board in Vercel's API, the team's people, each with their own
|
|
129
|
+
`vercel login`, and the projects it's granted to. On a board you keep, on
|
|
130
|
+
`local()` say, its people and its own deployments, and what grants and board
|
|
131
|
+
tokens let in, such as a GitHub Actions workflow or another project, with what
|
|
132
|
+
each gives in each channel. See [Access](./01-board/09-access.md).
|
|
154
133
|
|
|
155
134
|
### Where does the data live?
|
|
156
135
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
Attachments go to the blob store you pass, like a private Vercel Blob store.
|
|
161
|
-
Without one, the board keeps no files.
|
|
136
|
+
Your team's board lives in Vercel's API, its files included. A board on
|
|
137
|
+
`local()` lives in SQLite under `.board/`, with its files next to it, or in
|
|
138
|
+
memory for tests. See [Local boards](./01-board/10-local.md).
|
|
162
139
|
|
|
163
|
-
###
|
|
140
|
+
### Do I need to deploy anything?
|
|
164
141
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
[Mounting](./01-board/01-mounting.md#production-checklist).
|
|
142
|
+
Not to use the board: the CLI and `board()` reach it in Vercel's API. A route
|
|
143
|
+
that mounts it runs its watchers, and a board with `sync` runs on `local()`, in
|
|
144
|
+
a long-running process. See [Mounting](./01-board/01-mounting.md).
|
|
169
145
|
|
|
170
146
|
### Is there a web UI?
|
|
171
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.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",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"docs",
|
|
13
|
-
"sql",
|
|
14
13
|
"README.md"
|
|
15
14
|
],
|
|
16
15
|
"bin": {
|
|
@@ -39,59 +38,9 @@
|
|
|
39
38
|
"types": "./dist/cli-commands.d.mts",
|
|
40
39
|
"default": "./dist/cli-commands.mjs"
|
|
41
40
|
},
|
|
42
|
-
"./backend-
|
|
43
|
-
"types": "./dist/backend-
|
|
44
|
-
"default": "./dist/backend-
|
|
45
|
-
},
|
|
46
|
-
"./backend-a2/contract": {
|
|
47
|
-
"types": "./dist/backend-a2/contract.d.mts",
|
|
48
|
-
"default": "./dist/backend-a2/contract.mjs"
|
|
49
|
-
},
|
|
50
|
-
"./backend-a2/blob-vercel": {
|
|
51
|
-
"types": "./dist/backend-a2/blob-vercel.d.mts",
|
|
52
|
-
"default": "./dist/backend-a2/blob-vercel.mjs"
|
|
53
|
-
},
|
|
54
|
-
"./backend-a2/store-postgres": {
|
|
55
|
-
"types": "./dist/backend-a2/store-postgres.d.mts",
|
|
56
|
-
"default": "./dist/backend-a2/store-postgres.mjs"
|
|
57
|
-
},
|
|
58
|
-
"./backend-a2/store-redis": {
|
|
59
|
-
"types": "./dist/backend-a2/store-redis.d.mts",
|
|
60
|
-
"default": "./dist/backend-a2/store-redis.mjs"
|
|
61
|
-
},
|
|
62
|
-
"./backend-a2/store-redis-http": {
|
|
63
|
-
"types": "./dist/backend-a2/store-redis-http.d.mts",
|
|
64
|
-
"default": "./dist/backend-a2/store-redis-http.mjs"
|
|
65
|
-
},
|
|
66
|
-
"./backend-a2/store-sqlite": {
|
|
67
|
-
"types": "./dist/backend-a2/store-sqlite.d.mts",
|
|
68
|
-
"default": "./dist/backend-a2/store-sqlite.mjs"
|
|
69
|
-
},
|
|
70
|
-
"./backend-a2/store-memory": {
|
|
71
|
-
"types": "./dist/backend-a2/store-memory.d.mts",
|
|
72
|
-
"default": "./dist/backend-a2/store-memory.mjs"
|
|
73
|
-
},
|
|
74
|
-
"./backend-a2/scheduler-vercel": {
|
|
75
|
-
"types": "./dist/backend-a2/scheduler-vercel.d.mts",
|
|
76
|
-
"default": "./dist/backend-a2/scheduler-vercel.mjs"
|
|
77
|
-
},
|
|
78
|
-
"./backend-a2/scheduler-qstash": {
|
|
79
|
-
"types": "./dist/backend-a2/scheduler-qstash.d.mts",
|
|
80
|
-
"default": "./dist/backend-a2/scheduler-qstash.mjs"
|
|
81
|
-
},
|
|
82
|
-
"./backend-a2/scheduler-local": {
|
|
83
|
-
"types": "./dist/backend-a2/scheduler-local.d.mts",
|
|
84
|
-
"default": "./dist/backend-a2/scheduler-local.mjs"
|
|
85
|
-
},
|
|
86
|
-
"./backend-http": {
|
|
87
|
-
"types": "./dist/backend-http.d.mts",
|
|
88
|
-
"node": "./dist/backend-http.node.mjs",
|
|
89
|
-
"default": "./dist/backend-http.mjs"
|
|
90
|
-
},
|
|
91
|
-
"./backend-vercel": {
|
|
92
|
-
"types": "./dist/backend-vercel.d.mts",
|
|
93
|
-
"node": "./dist/backend-vercel.node.mjs",
|
|
94
|
-
"default": "./dist/backend-vercel.mjs"
|
|
41
|
+
"./backend-local": {
|
|
42
|
+
"types": "./dist/backend-local.d.mts",
|
|
43
|
+
"default": "./dist/backend-local.mjs"
|
|
95
44
|
},
|
|
96
45
|
"./sync": {
|
|
97
46
|
"types": "./dist/sync.d.mts",
|
|
@@ -124,13 +73,8 @@
|
|
|
124
73
|
"@chat-adapter/github": "^4.41.1",
|
|
125
74
|
"@chat-adapter/linear": "^4.41.1",
|
|
126
75
|
"@chat-adapter/slack": "^4.41.1",
|
|
127
|
-
"@upstash/qstash": "^2.11.0",
|
|
128
|
-
"@vercel/blob": "^2.8.0",
|
|
129
76
|
"@vercel/connect": "^2.3.4",
|
|
130
|
-
"
|
|
131
|
-
"chat": "^4.41.1",
|
|
132
|
-
"ioredis": "^5.4.0",
|
|
133
|
-
"pg": "^8.11.0"
|
|
77
|
+
"chat": "^4.41.1"
|
|
134
78
|
},
|
|
135
79
|
"devDependencies": {
|
|
136
80
|
"@base-ui/react": "^1.8.0",
|
|
@@ -140,27 +84,27 @@
|
|
|
140
84
|
"@chat-adapter/slack": "^4.41.1",
|
|
141
85
|
"@chat-adapter/telegram": "4.41.1",
|
|
142
86
|
"@chat-adapter/tests": "^4.41.1",
|
|
143
|
-
"@electric-sql/pglite": "0.3.15",
|
|
144
87
|
"@types/node": "^26.6.3",
|
|
145
|
-
"@types/pg": "8.15.5",
|
|
146
88
|
"@types/react": "^19.3.0",
|
|
147
89
|
"@types/react-dom": "^19.3.0",
|
|
148
|
-
"@vercel/blob": "^2.8.0",
|
|
149
90
|
"@vercel/connect": "^2.3.4",
|
|
150
91
|
"ai": "^7.0.130",
|
|
151
92
|
"chat": "^4.41.1",
|
|
152
93
|
"experimental-a2": "0.24.0",
|
|
153
|
-
"
|
|
94
|
+
"github-slugger": "^2.0.0",
|
|
154
95
|
"lucide-react": "^1.49.0",
|
|
155
|
-
"pg": "^8.16.3",
|
|
156
96
|
"react": "^19.3.0",
|
|
157
97
|
"react-dom": "^19.3.0",
|
|
158
98
|
"react-markdown": "^10.1.0",
|
|
159
99
|
"remark-breaks": "^4.0.0",
|
|
160
100
|
"remark-gfm": "^4.0.1",
|
|
101
|
+
"remark-parse": "^11.0.0",
|
|
161
102
|
"tsdown": "^0.23.0",
|
|
162
103
|
"typescript": "^7.0.2",
|
|
163
|
-
"
|
|
104
|
+
"unified": "^11.0.5",
|
|
105
|
+
"unist-util-visit": "^5.1.0",
|
|
106
|
+
"vitest": "^5.0.3",
|
|
107
|
+
"yaml": "^2.9.1"
|
|
164
108
|
},
|
|
165
109
|
"peerDependenciesMeta": {
|
|
166
110
|
"@chat-adapter/github": {
|
|
@@ -172,30 +116,15 @@
|
|
|
172
116
|
"@chat-adapter/slack": {
|
|
173
117
|
"optional": true
|
|
174
118
|
},
|
|
175
|
-
"@upstash/qstash": {
|
|
176
|
-
"optional": true
|
|
177
|
-
},
|
|
178
|
-
"@vercel/blob": {
|
|
179
|
-
"optional": true
|
|
180
|
-
},
|
|
181
119
|
"@vercel/connect": {
|
|
182
120
|
"optional": true
|
|
183
121
|
},
|
|
184
|
-
"@vercel/queue": {
|
|
185
|
-
"optional": true
|
|
186
|
-
},
|
|
187
122
|
"chat": {
|
|
188
123
|
"optional": true
|
|
189
|
-
},
|
|
190
|
-
"ioredis": {
|
|
191
|
-
"optional": true
|
|
192
|
-
},
|
|
193
|
-
"pg": {
|
|
194
|
-
"optional": true
|
|
195
124
|
}
|
|
196
125
|
},
|
|
197
126
|
"scripts": {
|
|
198
|
-
"build": "tsdown
|
|
127
|
+
"build": "tsdown",
|
|
199
128
|
"typecheck": "tsc --noEmit",
|
|
200
129
|
"test": "vitest run",
|
|
201
130
|
"pretest": "tsdown --log-level warn"
|