@vercel/board 0.50.0 → 0.51.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/LICENSE +201 -0
- package/README.md +128 -118
- package/dist/{access-BbgmsAFF.mjs → access-DdojoPZm.mjs} +1 -1
- package/dist/access.d.mts +2 -2
- package/dist/access.mjs +4 -4
- package/dist/{actors-CX2D22hL.mjs → actors-CDkNgWUL.mjs} +3 -3
- package/dist/{auth-Z9-Khvvw.d.mts → auth-C4VxPLYz.d.mts} +1 -1
- package/dist/{auth-DJDTfgAL.mjs → auth-zPqFJocD.mjs} +10 -3
- package/dist/{backend-CcaaS9Xl.d.mts → backend-Da_YEltI.d.mts} +16 -13
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-DQ1GHm4o.d.mts → chat-provider-BHyX6H8H.d.mts} +2 -2
- package/dist/{chat-provider-HJ7y_ipp.mjs → chat-provider-Br2RXgLV.mjs} +4 -3
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +15 -7
- package/dist/cli-embedded.mjs +9 -6
- package/dist/cli.mjs +6 -6
- package/dist/{client-C2T4eaXd.d.mts → client-C4-r10SA.d.mts} +25 -4
- package/dist/{commands-Cm4sODIu.d.mts → commands-B6pgzwTI.d.mts} +10 -0
- package/dist/{commands-nN8WpvCe.mjs → commands-DB1T8vT9.mjs} +37 -10
- package/dist/{conformance-Cr-umDl0.mjs → conformance-DW4-9Dwf.mjs} +176 -64
- package/dist/conformance.d.mts +4 -3
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DJZ8Xy_g.mjs → engine-D8YAsQS_.mjs} +17 -9
- package/dist/{errors-DYF4hhIc.mjs → errors-DbCKqGXp.mjs} +35 -7
- package/dist/{events-BdOCmnZh.mjs → events-mWKc1uvZ.mjs} +1 -1
- package/dist/{exports-CuD-Mxkw.mjs → exports-BDE3eV7B.mjs} +593 -261
- package/dist/{exports-lmr6UHHc.d.mts → exports-BUtR_AHa.d.mts} +4 -4
- package/dist/{external-D2jq_DEQ.mjs → external-DkWafjn-.mjs} +5 -1
- package/dist/{index-_KxJu15n.d.mts → index-BTuTaBaK.d.mts} +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +4 -4
- package/dist/index.node.d.mts +7 -7
- package/dist/index.node.mjs +4 -4
- package/dist/inspect/app.js +41 -41
- package/dist/inspect/engine.js +4 -4
- package/dist/inspect-BXvdLMET.mjs +2 -0
- package/dist/{inspect-CZeoSm7E.mjs → inspect-Nd_TlU1s.mjs} +3 -3
- package/dist/inspect.d.mts +1 -1
- package/dist/inspect.mjs +2 -2
- package/dist/{local-BVSFSSYf.mjs → local-BsYjQrl_.mjs} +113 -35
- package/dist/{main-B016auoG.mjs → main-CSIXhZ_b.mjs} +117 -36
- package/dist/{memory-C2lzMV_t.mjs → memory-wmUDblhm.mjs} +2 -2
- package/dist/{middleware-DUKIITFZ.mjs → middleware-iVTNf5Su.mjs} +1 -1
- package/dist/{profile-header-Cj0Cb1cf.mjs → profile-header-O8wC8yk8.mjs} +12 -1
- package/dist/{provider-Dwb_9mnu.d.mts → provider-CGicSMdu.d.mts} +4 -2
- package/dist/{routes-BE0y6wCk.mjs → routes-C85Sbhtm.mjs} +44 -11
- package/dist/{routes-B6SEA9yw.d.mts → routes-ChGBn0K3.d.mts} +60 -23
- package/dist/{serve-B10e7QaY.mjs → serve-Cp0qM4jk.mjs} +9 -8
- package/dist/{server-ViWNvg5q.mjs → server-HPq6MO3_.mjs} +50 -33
- package/dist/{serving-SbqeWqlA.mjs → serving-aOQsBok0.mjs} +1 -1
- package/dist/{shell-DmpmgOPC.mjs → shell-CUR5woOP.mjs} +1 -1
- package/dist/{sql-iABdyCiz.mjs → sql-D0MqINA6.mjs} +1 -1
- package/dist/{sqlite-28EMrmk7.mjs → sqlite-Dj2ZEtgy.mjs} +2 -2
- package/dist/{sqlite-db-Ckd-ceNe.mjs → sqlite-db-DjbTlUwN.mjs} +1 -1
- 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 +3 -3
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-linear.mjs +3 -3
- package/dist/sync-slack.d.mts +21 -4
- package/dist/sync-slack.mjs +35 -11
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{tags-D0qra0Qy.mjs → tags-CxDCF_tt.mjs} +1 -1
- package/dist/{task-batch-9lVDG3d-.mjs → task-batch-D3ASL5_-.mjs} +53 -9
- package/dist/{tokens-C-iK0Cku.mjs → tokens-C-T0B1uF.mjs} +31 -7
- package/dist/{version-C70RLVEK.mjs → version-BJH1vWR0.mjs} +1 -1
- package/docs/01-board/01-mounting.md +20 -7
- package/docs/01-board/03-identity.md +1 -1
- package/docs/01-board/04-messages.md +5 -0
- package/docs/01-board/05-reading.md +71 -16
- package/docs/01-board/07-schedules.md +1 -1
- package/docs/01-board/10-local.md +1 -1
- package/docs/02-sync/01-overview.md +3 -3
- package/docs/02-sync/03-slack.md +4 -3
- package/docs/03-guides/01-coding-agents.md +1 -1
- package/docs/03-guides/02-inspector.md +13 -5
- package/docs/03-guides/07-build-a-ui.md +15 -11
- package/docs/04-reference/01-cli.md +64 -25
- package/docs/04-reference/02-board.md +48 -23
- package/docs/04-reference/03-http.md +33 -14
- package/docs/04-reference/05-conformance.md +11 -10
- package/docs/index.md +1 -1
- package/package.json +14 -2
- package/dist/inspect-UCcPViyA.mjs +0 -2
|
@@ -50,24 +50,28 @@ const code = await createApp({
|
|
|
50
50
|
onWarning: (warning) => console.error(warning.message),
|
|
51
51
|
// Your Vercel login, and the team whose board to use when --scope names none, as this CLI
|
|
52
52
|
// resolves its own: asked for only when a request needs them. Help, a typo, or misuse never asks.
|
|
53
|
-
//
|
|
54
|
-
//
|
|
53
|
+
// The login is who every command runs as, wherever this CLI runs: nothing in the environment
|
|
54
|
+
// goes ahead of it, a deployment's own token and BOARD_TOKEN included. One that throws fails the
|
|
55
|
+
// request: board never falls back to `vercel login`'s. A team that throws fails it too, with
|
|
56
|
+
// what it threw as the failure's details.
|
|
55
57
|
login: async () => process.env.VERCEL_AUTH_TOKEN!,
|
|
56
58
|
team: async () => process.env.VERCEL_ORG_ID ?? null,
|
|
57
59
|
// How requests to Vercel's API go with that login: the app's own fetch, which adds the login's
|
|
58
60
|
// credentials. Without it, the login goes as a Bearer token, which a DPoP login can't use.
|
|
59
61
|
// fetch: (input, init) => yourSignedFetch(input, init), // a DPoP proof for each request
|
|
60
62
|
// A Vercel token someone passed for this run, as `vercel board --token` takes one: the login to
|
|
61
|
-
// use in place of `login
|
|
62
|
-
// and BOARD_TOKEN included. Board sends it itself, as a Bearer token, never through `fetch`. A
|
|
63
|
+
// use in place of `login`. Board sends it itself, as a Bearer token, never through `fetch`. A
|
|
63
64
|
// board at a URL gets a token minted with it, never the token itself.
|
|
64
65
|
// token: yourFlags.token,
|
|
65
66
|
}).run(process.argv.slice(3))
|
|
66
67
|
```
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
The CLI that runs board's says who its commands run as. With a `login` (or a
|
|
70
|
+
`token`), every command runs as that login, on a deployment and with
|
|
71
|
+
`BOARD_TOKEN` set too, so `vercel board` is you, as every `vercel` command is.
|
|
72
|
+
A board at a URL gets a token minted with that login. To act as a deployment's
|
|
73
|
+
project, or with `BOARD_TOKEN`, run `vb`. [`whoami`](#whoami) names a passed
|
|
74
|
+
token as its source, `the token you passed`.
|
|
71
75
|
|
|
72
76
|
`class` fixes the exit code: `usage` and `missing_input` answer 2,
|
|
73
77
|
`canceled` 130, and the rest 1, `timeout` included. Without `onError`, board
|
|
@@ -91,9 +95,10 @@ With no board URL anywhere, it talks to your team's board in Vercel's API:
|
|
|
91
95
|
`VERCEL_ORG_ID`'s, or the team of the nearest linked project
|
|
92
96
|
(`.vercel/project.json`, searching up to the Git checkout's root), or else your
|
|
93
97
|
login's default team. `--scope <team>` picks another, by its slug or ID. It
|
|
94
|
-
reads and writes
|
|
95
|
-
|
|
96
|
-
`
|
|
98
|
+
reads and writes as the login the CLI that runs it gives it. Given none, it
|
|
99
|
+
finds its credentials as `vb` does: a deployment's own token, or else
|
|
100
|
+
`BOARD_TOKEN`, or else you, with `VERCEL_AUTH_TOKEN` or `vercel login`'s. It
|
|
101
|
+
never sends `VERCEL_TOKEN`.
|
|
97
102
|
|
|
98
103
|
### In-process, on a handle
|
|
99
104
|
|
|
@@ -387,7 +392,7 @@ react, label, and sync everywhere:
|
|
|
387
392
|
|
|
388
393
|
```text
|
|
389
394
|
$ vb whoami --scope test
|
|
390
|
-
|
|
395
|
+
Ada Lovelace (vercel:user:u_jb)
|
|
391
396
|
board https://api.vercel.com/v1/messageboard/boards/brd_test?teamId=team_test
|
|
392
397
|
source the Vercel CLI
|
|
393
398
|
can * read
|
|
@@ -649,14 +654,32 @@ prints `{ explanation }`.
|
|
|
649
654
|
### channels
|
|
650
655
|
|
|
651
656
|
```text
|
|
652
|
-
vb channels
|
|
657
|
+
vb channels [prefix] [--limit N] [--after <next>]
|
|
653
658
|
vb channels create <channel> [--private]
|
|
654
659
|
```
|
|
655
660
|
|
|
656
|
-
|
|
657
|
-
its latest message (`last #1290`) where the board keeps
|
|
658
|
-
Vercel's API doesn't, so it lists each channel by name
|
|
659
|
-
`vb channels list`.
|
|
661
|
+
A page of the board's channels, grouped by path prefix, each with its thread
|
|
662
|
+
and message counts and its latest message (`last #1290`) where the board keeps
|
|
663
|
+
them. A team board in Vercel's API doesn't, so it lists each channel by name
|
|
664
|
+
alone. It runs `vb channels list`.
|
|
665
|
+
|
|
666
|
+
- **`prefix`** keeps the channels whose path starts with it: `vb channels dev/`
|
|
667
|
+
is every channel under `dev`, and `vb channels dev` is `dev`, `dev/web`, and
|
|
668
|
+
`devops`.
|
|
669
|
+
- **`--limit`** is 100 by default, 500 at most. A page that isn't the last
|
|
670
|
+
ends with the command for the next:
|
|
671
|
+
|
|
672
|
+
```text
|
|
673
|
+
$ vb channels dev/ --limit 2
|
|
674
|
+
dev/
|
|
675
|
+
dev/api
|
|
676
|
+
dev/web
|
|
677
|
+
|
|
678
|
+
(more not shown: vb channels dev/ --limit 2 --after c.8f2a.2)
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
With `--json`, it prints `{ channels, next }`, where `next` is what `--after`
|
|
682
|
+
takes, and null on the last page.
|
|
660
683
|
|
|
661
684
|
A first post makes a channel. `create` makes one before that, so it lists and
|
|
662
685
|
reads as empty, for a watcher to tail or a person to find. It needs `read` and
|
|
@@ -770,7 +793,8 @@ use.
|
|
|
770
793
|
|
|
771
794
|
```text
|
|
772
795
|
vb read [channel] [filters] [--after <id>] [--limit N]
|
|
773
|
-
vb read <
|
|
796
|
+
vb read <channel> --before <older> [--limit N]
|
|
797
|
+
vb read <id> [--after <id>] [--label k=v]...
|
|
774
798
|
vb read <link>
|
|
775
799
|
```
|
|
776
800
|
|
|
@@ -780,9 +804,16 @@ vb read <link>
|
|
|
780
804
|
`--limit` counts threads, so every root shows. A thread is in when any of
|
|
781
805
|
its messages matches the filters.
|
|
782
806
|
- **`read` with no channel** reads every channel and names each thread's.
|
|
807
|
+
- **`read <channel> --before <older>`** prints the page before one: `older`
|
|
808
|
+
is what a read of that channel printed in its `(older not shown: …)` line,
|
|
809
|
+
and what `--json` answers as `older`. It pages back one channel's threads,
|
|
810
|
+
as they are, as far as the channel goes, and doesn't go with `--after`.
|
|
783
811
|
- **`read <id>`** prints one whole thread: the root and every reply, plus the
|
|
784
|
-
thread's pending schedules. Any message in the thread works.
|
|
785
|
-
|
|
812
|
+
thread's pending schedules. Any message in the thread works. `--after <id>`
|
|
813
|
+
keeps the replies after one of its messages, and `--label` the replies that
|
|
814
|
+
wear it, or all of them when the root does: `vb read 812 --after 813`. The
|
|
815
|
+
filters that find threads (`--by`, `--text`, `--mentions`, `--source`)
|
|
816
|
+
don't narrow one, and are a usage error there, exit 2.
|
|
786
817
|
A [task](#tasks)'s root has its state under it: `task claimed by claude via
|
|
787
818
|
julian · 15m left`.
|
|
788
819
|
- **`read <link>`** reads the thread a platform link names: a Slack permalink,
|
|
@@ -794,16 +825,20 @@ vb read <link>
|
|
|
794
825
|
`error: no channel <name>: board channels lists them`.
|
|
795
826
|
- `--limit` is 50 by default, at most 500. `--after <id>` reads forward from a
|
|
796
827
|
message ID or a cursor instead of showing the latest.
|
|
828
|
+
- **On Vercel's board**, a read names one channel or one thread. With no
|
|
829
|
+
channel, a subtree, or `--by`, `--text`, `--mentions`, or `--source`, it's
|
|
830
|
+
an error, exit 1, with the board's own words for what to do instead:
|
|
831
|
+
see [Reading](../01-board/05-reading.md#on-vercels-board).
|
|
797
832
|
|
|
798
833
|
```text
|
|
799
834
|
$ vb read prs --label state=open
|
|
800
835
|
prs · 2 threads · cursor 1290
|
|
801
836
|
|
|
802
|
-
#1271 github · 2h [pr=vercel
|
|
837
|
+
#1271 github · 2h [pr=vercel/board#158 state=open]
|
|
803
838
|
Show threads in vb read
|
|
804
839
|
no replies
|
|
805
840
|
|
|
806
|
-
#1204 github · 3d [pr=vercel
|
|
841
|
+
#1204 github · 3d [pr=vercel/board#151 state=open]
|
|
807
842
|
Retry Slack deliveries on 429
|
|
808
843
|
4 replies · last #1288 pi via julian · 12m
|
|
809
844
|
|
|
@@ -1184,7 +1219,7 @@ prints `not synced anywhere`.
|
|
|
1184
1219
|
|
|
1185
1220
|
```text
|
|
1186
1221
|
$ vb sync 812
|
|
1187
|
-
slack
|
|
1222
|
+
slack C0123ABCDEF https://acme.slack.com/archives/C0123ABCDEF/p1792780353701549
|
|
1188
1223
|
github acme/web:4021 https://github.com/acme/web/pull/4021#issuecomment-3301
|
|
1189
1224
|
```
|
|
1190
1225
|
|
|
@@ -1280,11 +1315,12 @@ See [Conformance](./05-conformance.md).
|
|
|
1280
1315
|
### tail
|
|
1281
1316
|
|
|
1282
1317
|
```text
|
|
1283
|
-
vb tail [channel] [filters] [--all]
|
|
1318
|
+
vb tail [channel] [filters] [--all] [--last N]
|
|
1284
1319
|
```
|
|
1285
1320
|
|
|
1286
1321
|
Prints matching events as they happen, until Ctrl-C. It starts at the current
|
|
1287
|
-
head
|
|
1322
|
+
head, or with `--last N` at the feed's newest N events (100 at most), which it
|
|
1323
|
+
prints first. Without filters it shows every event that concerns a message. `--all`
|
|
1288
1324
|
adds the bookkeeping events: delivery receipts (`message.synced`,
|
|
1289
1325
|
`message.files_synced`) and, unfiltered, `actor.seen` and `thread.synced`.
|
|
1290
1326
|
|
|
@@ -1372,4 +1408,7 @@ of them must match.
|
|
|
1372
1408
|
it, and `tail` and `wait` start there. A watcher always starts at the head.
|
|
1373
1409
|
- **Cost.** `tail` and `wait` check each event once, in constant time. On
|
|
1374
1410
|
`local()`, `read` queries tables with channels, threads, authors, mentions,
|
|
1375
|
-
and labels indexed.
|
|
1411
|
+
and labels indexed. Vercel's board indexes a thread's root labels and
|
|
1412
|
+
nothing else: `read` there takes `--label` in one channel, and refuses
|
|
1413
|
+
`--by`, `--text`, `--mentions`, and `--source`, which `tail` and `wait`
|
|
1414
|
+
still take.
|
|
@@ -712,35 +712,33 @@ See [Schemas](./03-http.md#schemas) for what a definition may use.
|
|
|
712
712
|
|
|
713
713
|
## Reading
|
|
714
714
|
|
|
715
|
-
###
|
|
715
|
+
### channel
|
|
716
716
|
|
|
717
717
|
```ts
|
|
718
|
-
messages(query?:
|
|
718
|
+
channel(name: string): { messages(query?: { after?: string; limit?: number }): Promise<MessagesPage> }
|
|
719
719
|
```
|
|
720
720
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
default, at most 500); with `after`,
|
|
724
|
-
|
|
721
|
+
One channel, by its whole name. Its `messages()` returns `{ messages, cursor }`:
|
|
722
|
+
the channel's messages across its threads, oldest first. Without `after`, it's
|
|
723
|
+
the latest `limit` (50 by default, at most 500); with `after`, a cursor a read
|
|
724
|
+
of this channel's messages answered, the first `limit` posted since. Reading
|
|
725
|
+
on from a page's `cursor` repeats nothing and skips nothing. A channel nobody
|
|
726
|
+
has posted in yet answers an empty page, and its cursor reads the channel from
|
|
727
|
+
its first message.
|
|
725
728
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
729
|
+
It's the one list of messages a board has: a channel at a time, with no
|
|
730
|
+
filters and no page back. To find threads, use [`threads`](#threads); to read
|
|
731
|
+
a thread, [`thread`](#thread); to read several channels, list them with
|
|
732
|
+
`channels()` and read each.
|
|
730
733
|
|
|
731
734
|
```ts
|
|
732
|
-
const page = await team.
|
|
735
|
+
const page = await team.channel('errors-www').messages({ limit: 100 })
|
|
736
|
+
const since = await team.channel('errors-www').messages({ after: page.cursor })
|
|
733
737
|
```
|
|
734
738
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
| `re` | the thread rooted at that ID |
|
|
739
|
-
| `by` | an actor, by handle or actor ID |
|
|
740
|
-
| `mentions` | `'me'`, a handle, an actor ID, or an email, as the text mentions them |
|
|
741
|
-
| `label` | `{ status: 'open' }`, or `['status=open', 'pr']`; a value may be `a\|b`. Matches the message or its root |
|
|
742
|
-
| `from` | a sync key (`'slack'`), or `'board'`. On Vercel's board, another project's key is `'www/slack'`, by its name or its ID |
|
|
743
|
-
| `text` | a case-insensitive substring |
|
|
739
|
+
A team board in Vercel's API lists a channel's newest 100 at most, whatever
|
|
740
|
+
`limit` asks for, and reads on from a cursor this read answered for that
|
|
741
|
+
channel: a message ID, or a cursor from `threads`, is 400 `invalid_cursor`.
|
|
744
742
|
|
|
745
743
|
### threads
|
|
746
744
|
|
|
@@ -755,6 +753,23 @@ Deleted replies don't count. `limit` counts threads (50 by default, at most
|
|
|
755
753
|
500), so a thread's root is there however many replies it has; `after` is the
|
|
756
754
|
first `limit` threads active after that cursor.
|
|
757
755
|
|
|
756
|
+
| `Filters` | Matches |
|
|
757
|
+
| --- | --- |
|
|
758
|
+
| `channel` | a channel, or a subtree with a trailing slash: `'www/'` |
|
|
759
|
+
| `re` | the thread rooted at that ID |
|
|
760
|
+
| `by` | an actor, by handle or actor ID |
|
|
761
|
+
| `mentions` | `'me'`, a handle, an actor ID, or an email, as the text mentions them |
|
|
762
|
+
| `label` | `{ status: 'open' }`, or `['status=open', 'pr']`; a value may be `a\|b`. Matches the message or its root |
|
|
763
|
+
| `from` | a sync key (`'slack'`), or `'board'`. On Vercel's board, another project's key is `'www/slack'`, by its name or its ID |
|
|
764
|
+
| `text` | a case-insensitive substring |
|
|
765
|
+
|
|
766
|
+
A team board in Vercel's API keeps no search index, and lists threads one
|
|
767
|
+
channel at a time: `by`, `mentions`, `text`, and `from` there are 501
|
|
768
|
+
`not_supported`, and so is a read with no `channel` or with a subtree, unless
|
|
769
|
+
`re` names one thread. It reads nothing before it refuses, and its message
|
|
770
|
+
says what to do instead. [`events`](#events) and [`wait`](#wait) take every
|
|
771
|
+
filter there.
|
|
772
|
+
|
|
758
773
|
`older` is the `before` for the threads last active before the page's, or
|
|
759
774
|
`null` when none are: pass it back to page back through every thread once. A
|
|
760
775
|
page read with `after`, or from a board before `older`, has none. `before`
|
|
@@ -775,7 +790,7 @@ for (let page = await team.threads({ channel: 'prs' }); ; ) {
|
|
|
775
790
|
### thread
|
|
776
791
|
|
|
777
792
|
```ts
|
|
778
|
-
thread(id: string): Promise<ThreadView>
|
|
793
|
+
thread(id: string, range?: { after?: string; limit?: number }): Promise<ThreadView>
|
|
779
794
|
```
|
|
780
795
|
|
|
781
796
|
One whole thread from any message in it: `{ message, replies, cursor,
|
|
@@ -785,7 +800,7 @@ that reply in it.
|
|
|
785
800
|
### channels, actors, me, discovery
|
|
786
801
|
|
|
787
802
|
```ts
|
|
788
|
-
channels(): Promise<ChannelView[]> // { path, lastIndex?, messages?, threads? }
|
|
803
|
+
channels(query?: { prefix?: string; limit?: number; after?: string }): Promise<{ channels: ChannelView[]; cursor: string; next: string | null }> // each { path, lastIndex?, messages?, threads? }
|
|
789
804
|
createChannel(path: string, options?: { private?: boolean }): Promise<{ channel: ChannelView; created: boolean; grants?: GrantView[] }>
|
|
790
805
|
actors(): Promise<Actor[]> // { id, kind, handle, name, avatar }
|
|
791
806
|
me(): Promise<Me> // who this handle writes as
|
|
@@ -945,12 +960,22 @@ const reply = await team.wait({ re: msg.id, after: msg.id }, { timeout: '30m' })
|
|
|
945
960
|
### poll
|
|
946
961
|
|
|
947
962
|
```ts
|
|
948
|
-
poll(query?: Filters & { after?: string; wait?: number; all?: boolean }, signal?: AbortSignal): Promise<EventsPage>
|
|
963
|
+
poll(query?: Filters & { after?: string; wait?: number; all?: boolean; last?: number }, signal?: AbortSignal): Promise<EventsPage>
|
|
949
964
|
```
|
|
950
965
|
|
|
951
966
|
One long-poll of `/events`: `{ events, cursor }`. `wait` is in seconds, at
|
|
952
967
|
most 300. Pass `cursor` back as `after` to continue.
|
|
953
968
|
|
|
969
|
+
`last` reads the feed's newest events instead, 100 at most: oldest first,
|
|
970
|
+
at once, with the feed's end as `cursor`. It takes no `after` or `wait`.
|
|
971
|
+
`events({ last })` starts with them and follows.
|
|
972
|
+
|
|
973
|
+
```ts
|
|
974
|
+
// What the board last saw, then everything after it.
|
|
975
|
+
const { events, cursor } = await team.poll({ last: 50 })
|
|
976
|
+
for await (const event of team.events({ after: cursor })) show(event)
|
|
977
|
+
```
|
|
978
|
+
|
|
954
979
|
### request
|
|
955
980
|
|
|
956
981
|
```ts
|
|
@@ -95,12 +95,12 @@ a refused write it can read answers 403. `GET /me` returns the caller's
|
|
|
95
95
|
| --- | --- | --- |
|
|
96
96
|
| GET | `/` | Discovery (no token): `{ version, url, audience, team_id, project_id, sync, wake_by_path? }`, where `sync` lists each entry's `key` and `platform`, and `wake_by_path` says `POST /watchers` takes a `path`. A board with no backend has none: it answers only wake-ups and webhooks |
|
|
97
97
|
| GET | `/me` | Who this token and profile write as: `{ actor, principal, kind, handle, name, avatar, profile, expiresAt, can }`, where `can` maps each channel pattern to its permissions |
|
|
98
|
-
| GET | `/channels` | `{ channels, cursor }
|
|
98
|
+
| GET | `/channels` | A page: `{ channels, cursor, next }`, each `{ path, lastIndex?, messages?, threads? }`. `prefix` keeps the ones whose path starts with it, `limit` is how many (100 by default, 500 at most), and `after` takes a page's `next`, which is null on the last. By path on `local()`, and on Vercel's board under a prefix. A board that doesn't count them, as one on Vercel's API doesn't, leaves the counts out |
|
|
99
99
|
| POST | `/channels` | `{ path }`: makes a channel before anything posts to it. `{ channel, created }`, 201 when it made it, and 200 with `created: false` for one that's there, which it leaves as it is. A key it doesn't know is 400, so `private` makes nothing |
|
|
100
100
|
| GET | `/actors` | `{ actors, cursor }`: each `{ id, kind, handle, name, avatar, via?, platform?, verified? }`, sorted by handle. `verified: true` is for one the board checked rather than took their name from what they sent: shown under the handle a credential it checked gave them (an OIDC token, a host's verifier), as itself or after `via` |
|
|
101
|
-
| GET | `/messages` | `{ messages, cursor }
|
|
101
|
+
| GET | `/messages` | `{ messages, cursor }`: one channel's messages. See [Listing a channel's messages](#listing-a-channels-messages) |
|
|
102
102
|
| GET | `/threads` | `{ threads, cursor, older }`: a summary per matching thread. See [Listing threads](#listing-threads) |
|
|
103
|
-
| GET | `/messages/:id` | The thread around any message: `{ message, replies, cursor, schedules }`, where `message` is the root |
|
|
103
|
+
| GET | `/messages/:id` | The thread around any message: `{ message, replies, cursor, schedules }`, where `message` is the root. `after`, one of its messages, answers the replies after it, and `limit` that many: the first after it, or without `after`, the newest |
|
|
104
104
|
| GET | `/posts/:id` | Your post with client ID `id`, as `POST /messages` answered it: `{ message }`, or 404 `post_not_found`. Someone else's is as good as missing |
|
|
105
105
|
| POST | `/messages` | Post or reply. Answers 201 `{ message, mentions? }`. See [Posting](#posting) |
|
|
106
106
|
| POST | `/messages/:id/edit` | `{ text, revision? }`. Only its author: as a profile, only what that profile wrote; as the principal itself, what it or any of its profiles wrote. Answers `{ ok: true }`. With `revision`, only if the message is still at it: otherwise 409 `revision_conflict`, and nothing changes |
|
|
@@ -300,22 +300,32 @@ exactly one did. `POST /messages/:id/edit`, `/schedules`,
|
|
|
300
300
|
`/tasks`, and `/tasks/batch` settle their text and answer `mentions` the same
|
|
301
301
|
way. See [Mentions](../01-board/03-identity.md#mentions).
|
|
302
302
|
|
|
303
|
-
### Listing messages
|
|
303
|
+
### Listing a channel's messages
|
|
304
304
|
|
|
305
|
-
`GET /messages`
|
|
305
|
+
`GET /messages` lists one channel's messages across its threads, oldest
|
|
306
|
+
first. It's the one list of messages a board has: it takes no
|
|
307
|
+
[filters](#filters), and nothing but these, or the request is a 400:
|
|
306
308
|
|
|
307
309
|
| Query | Effect |
|
|
308
310
|
| --- | --- |
|
|
309
|
-
| `
|
|
310
|
-
| `
|
|
311
|
+
| `channel` | required: one channel, by its whole name. A pattern (`www/`) is 400 `invalid_request` |
|
|
312
|
+
| `after` | messages after a cursor a read of this channel's messages answered, the first `limit` of them |
|
|
311
313
|
| `limit` | 1 to 500, 50 by default. Without `after`, the latest `limit` |
|
|
312
314
|
|
|
313
|
-
|
|
314
|
-
from
|
|
315
|
+
It answers `{ messages, cursor }`. Reading again with `after: cursor` goes on
|
|
316
|
+
from where the page stopped: nothing is repeated, and nothing is skipped. A
|
|
317
|
+
channel nobody has posted in yet is an empty page, and its cursor reads the
|
|
318
|
+
channel from its first message once it has one.
|
|
319
|
+
|
|
320
|
+
On Vercel's board the latest are 100 at most, whatever `limit` asks for, and
|
|
321
|
+
`after` takes only a cursor this route answered for that channel (400
|
|
322
|
+
`invalid_cursor` for a message ID, or a cursor of the thread list's). To find
|
|
323
|
+
threads, or to read several channels, see [Listing threads](#listing-threads)
|
|
324
|
+
and `GET /channels`.
|
|
315
325
|
|
|
316
326
|
### Listing threads
|
|
317
327
|
|
|
318
|
-
`GET /threads` takes the
|
|
328
|
+
`GET /threads` takes the [filters](#filters). A thread is in when any of
|
|
319
329
|
its messages matches, and each comes as `{ message, replies, last }`: the root,
|
|
320
330
|
its reply count, and its latest reply, or `null`. Deleted replies don't count.
|
|
321
331
|
|
|
@@ -326,7 +336,15 @@ its reply count, and its latest reply, or `null`. Deleted replies don't count.
|
|
|
326
336
|
| `limit` | threads, 1 to 500, 50 by default. Without `after`, the latest `limit` |
|
|
327
337
|
|
|
328
338
|
Threads come by latest activity (the latest reply, or the root when it has
|
|
329
|
-
none), newest last.
|
|
339
|
+
none), newest last. On `local()`, filters read tables the board keeps from its
|
|
340
|
+
log, where labels and mentions are an index lookup.
|
|
341
|
+
|
|
342
|
+
Vercel's board keeps no search index, and lists threads one channel at a time.
|
|
343
|
+
There, `by`, `mentions`, `text`, and `from` are 501 `not_supported`, and so is
|
|
344
|
+
a read with no `channel`, or with a pattern, unless `re` names one thread. It
|
|
345
|
+
refuses them before it reads anything, and its message says what to do
|
|
346
|
+
instead. `label`, `after`, `before`, and `re` work as on any board, in one
|
|
347
|
+
channel.
|
|
330
348
|
|
|
331
349
|
A page read without `after` has `older`: the `before` for the next older page,
|
|
332
350
|
or `null` when no thread is older. Pass it as it came; it isn't a message ID.
|
|
@@ -649,7 +667,7 @@ with no `type` that says it.
|
|
|
649
667
|
|
|
650
668
|
## Filters
|
|
651
669
|
|
|
652
|
-
`GET /
|
|
670
|
+
`GET /threads` and `GET /events` share these. All of them must match.
|
|
653
671
|
|
|
654
672
|
| Query | Matches |
|
|
655
673
|
| --- | --- |
|
|
@@ -671,6 +689,7 @@ with no `type` that says it.
|
|
|
671
689
|
| `after` | start after this cursor or message ID. Omitted: the current head (or `Last-Event-ID`) |
|
|
672
690
|
| `all` | `true` (or `1`) adds bookkeeping: `actor.seen`, `thread.synced`, delivery receipts, and `task.renewed`. `false` (or `0`) is the default; anything else is a 400 |
|
|
673
691
|
| `wait` | long-poll only: seconds to hold for a match, at most 300 |
|
|
692
|
+
| `last` | the feed's newest events instead of the ones from now, from 1 to 100: oldest first, answered at once, with the feed's end as `cursor`, so a read `after` it goes on with what comes next. A stream starts with them, then follows. Each comes with its message as it is now, so one deleted since is its tombstone and one edited says what it says now. A label change says only the values its message still carries, and an event about a reaction since removed, a delivery since made good, or a task's failure or hold since cleared is left out. It takes no `after` or `wait`: 400. A board that can't read them that way answers 501 `not_supported`: see [Vercel's board](../01-board/05-reading.md#on-vercels-board) |
|
|
674
693
|
|
|
675
694
|
Each event is a JSON object:
|
|
676
695
|
|
|
@@ -893,7 +912,7 @@ When the board knows what fixes it, the error carries a `hint` too, as
|
|
|
893
912
|
| 501 | `no_files` | an upload, a download, or a write that carries files, on a board that keeps no files |
|
|
894
913
|
| 501 | `no_schemas` | a schema route on a board that keeps no schemas |
|
|
895
914
|
| 501 | `no_direct_uploads` | a direct upload on a board that can't sign upload URLs, `local()` among them |
|
|
896
|
-
| 501 | `not_supported` | on Vercel's board, what its API doesn't keep: for now files on a scheduled message
|
|
915
|
+
| 501 | `not_supported` | on Vercel's board, what its API doesn't keep: for now files on a scheduled message, a post's `sync` targets, and [threads found](#listing-threads) by `by`, `mentions`, `text`, or `from`, or read across channels |
|
|
897
916
|
| 501 | `no_verifier` | a request to a board on board's default build, outside Node, with no `authenticate` |
|
|
898
917
|
| 501 | `no_wake_by_path` | a `path` in `POST /watchers` on a board that wakes only a `url`: `` this board wakes a url, not a path: register `url` instead `` |
|
|
899
918
|
| 502 | `no_client`, `list_failed`, … | the platform failed a source read |
|
|
@@ -910,6 +929,6 @@ curl "$BOARD_URL/openapi.json"
|
|
|
910
929
|
```
|
|
911
930
|
|
|
912
931
|
OpenAPI 3.1, generated from the same route table the server validates with.
|
|
913
|
-
Each operation's `operationId` is the route's name (`post`, `
|
|
932
|
+
Each operation's `operationId` is the route's name (`post`, `threads`,
|
|
914
933
|
`events`); request bodies are JSON Schema, and query schemas are under
|
|
915
934
|
`x-query-schema`.
|
|
@@ -113,15 +113,13 @@ The whole protocol, on every board:
|
|
|
113
113
|
- **An edit or a delete at a `revision`** lands only while the message is at
|
|
114
114
|
it, which reactions and labels leave as it is: of three edits racing at one
|
|
115
115
|
revision, one lands, and an edit from before a delete is a conflict too.
|
|
116
|
-
- **A label matches on the message or its thread's root.**
|
|
117
116
|
- **A label write `if`** lands only while the labels are as it says: of three
|
|
118
117
|
claims racing where no one has one, one lands, and the rest are 409
|
|
119
118
|
`label_conflict`.
|
|
120
|
-
-
|
|
119
|
+
- **One channel's messages** read oldest first, after a cursor a read of the
|
|
120
|
+
channel answered, and its newest by a `limit`. Reading on from a page's
|
|
121
|
+
cursor repeats nothing and skips nothing.
|
|
121
122
|
- **Threads** come with their reply count and latest reply.
|
|
122
|
-
- **`text` matches anywhere in a message's own text,** in any case, with `%`
|
|
123
|
-
and `_` as themselves: a reply isn't found by its root's text, its thread is
|
|
124
|
-
found by the reply's, and an edited message by what it says now.
|
|
125
123
|
- **Events** read after a cursor, each with its own, and a long-poll holds
|
|
126
124
|
until the next one.
|
|
127
125
|
- **A delete leaves a tombstone.**
|
|
@@ -147,6 +145,7 @@ Then the rest, a group each in the report:
|
|
|
147
145
|
|
|
148
146
|
| Group | Check |
|
|
149
147
|
| --- | --- |
|
|
148
|
+
| `search` | finds threads by `text` anywhere in a message of theirs, in any case, with `%` and `_` as themselves: a thread is found by a reply's text, and by what an edited message says now; and lists the threads of every channel under a pattern (`conformance/`) at once |
|
|
150
149
|
| `paging` | posts three threads, reads the channel's latest two, then pages back by each page's `older` until it's `null`, and finds each thread once, its own three included; and refuses `before` with `after` (400 `invalid_request`). Skipped on a board whose pages have no `older` |
|
|
151
150
|
| `schedules` | schedules a reply a day out, lists it, and cancels it; and keeps a schedule's `noSync`, so its sends stay off every platform |
|
|
152
151
|
| `tasks` | starts a thread as a task and makes one of a thread that was there: its root reads with `task`, whose `by` is the actor that made it one, a reply lands in its thread, `board.task=ready` finds it, and `GET /tasks` lists it. A task made under a client ID lands once, and a create under an ID a reply or a thread that is no task landed with is 409 `duplicate_id`, with nothing made. Of three claims that race for a task, one lands and the rest get 409 `task_claimed`. A claim that asks for 300 seconds gets it, its `until` says so, a renewal moves it, and a claim that asks for none gets at least 5 minutes. A claim's writes are 409 `claim_lost` with the wrong token, after its release, and once another claim holds the task, and change nothing. A task waits for the tasks it needs, a failed or canceled one never readies it, and a reopened one that completes does, within a few seconds. A task that needs one already canceled is 400 `invalid_needs`, as a new thread or one that was there, and one that needs a failed task waits. What a task needs can change: it waits for the new ones, is ready in the same write when they have completed and at once with none, a held task stays held, and the feed shows each change with the task's state after it. A change that would make a task wait for itself, straight back or through another, is 400 `invalid_needs`, as is one a new task couldn't take. A claimed task refuses it with 409 `task_claimed`, and a completed, failed, or canceled one with 409 `task_finished`. A batch of four tasks is made in one request and answered in the order given: one that needs a later task of the batch waits for it by the ID the batch gave it, one that needs nothing is ready, one whose needs were there and have completed is ready, and one that needs both kinds waits. They list in that order, the same `id` again answers the same tasks and makes none, the `id` with one task more, or with as many but another text, is 409 `duplicate_id`, and completing one of the batch readies what waited only for it. A batch is 400 `invalid_needs`, and makes none of its tasks, for a `key` no task has, a `key` two have, a task that needs itself, tasks that need each other, and a last task that needs a canceled one. `GET /tasks?needs=` with a channel lists only that channel's tasks that wait for one, with a `prefix/` only that subtree's, and with neither the whole board's: two wait for one, in `conformance` and in `conformance/tasks`. Skipped for a token that can't post there. A task that needs others waits as it's made and as it's unblocked, and once they have completed, its `task.ready` follows, before the claim it was made with: the feed shows each change with the task's state after it, and no `task.ready` for a task that needs none. A hold blocks claims until it's lifted, and a claimed task's hold is its claim's. A task assigned to a profile is claimed only as that actor. A profile, narrowed with `x-board-can` to no `manage`, changes only the tasks it made: assigning, holding, canceling, or changing the needs of its principal's or another profile's is 403 `task_not_owned`, its principal as itself changes any of them, and a profile's edit of a thread its principal made a task holds it. Skipped for a run that can't send headers, or that writes as a profile. A caller narrowed with `x-board-can` to reading and posting claims no task, by ID or as the next ready one (403 `forbidden`): skipped for a run that can't send the header. So is the next: a caller narrowed to posting everywhere and reading only `conformance` names a prerequisite in `conformance/tasks`, which it can't read, and gets 400 `invalid_needs` starting a task and making one of a thread, with nothing made, while one it reads is a prerequisite as for anyone. A claim of the next ready task takes the oldest in a channel or its subtree that has the labels asked for, and one that waits gets a task released while it does. A feed filtered on `board.task=ready` shows a task become ready and get claimed, with no token in it. A label write or a post that sets a label under `board.` is 400 `reserved_label`. A label write holds on `board.task` as on any label: one whose `if` names a state the task isn't in, or none, is 409 `label_conflict`. An edit of a task's root by anyone but its owner blocks the task with kind `edited`, and ends its claim: the kit imports a thread as a platform user to check it, so it's skipped for a token that can't sync in the channel, or that has watchers or a sync registered. The assignment check is skipped through a board's own handle in its process, where each profile is a principal of its own. It waits out no lease, and has one principal: what a second one may claim or change isn't checked |
|
|
@@ -158,10 +157,12 @@ Then the rest, a group each in the report:
|
|
|
158
157
|
|
|
159
158
|
Every board answers all of them: see
|
|
160
159
|
[the whole protocol](./03-http.md#the-whole-protocol). A board may keep no
|
|
161
|
-
schedules, tasks, grants, schemas, or files, and
|
|
162
|
-
one of those groups' checks with a
|
|
163
|
-
what the board said. A board that's
|
|
164
|
-
otherwise, and fails.
|
|
160
|
+
schedules, tasks, grants, schemas, or files, and no index to find threads by
|
|
161
|
+
(`search`), and say so: one that answers one of those groups' checks with a
|
|
162
|
+
501 has it skipped, `not kept here`, with what the board said. A board that's
|
|
163
|
+
meant to keep them and doesn't yet answers otherwise, and fails.
|
|
164
|
+
Vercel's board keeps no search index, and lists threads one channel at a
|
|
165
|
+
time: both `search` checks are skipped there, with its own words for each.
|
|
165
166
|
Vercel's API reads who writes as boards did before, so a run there fails two
|
|
166
167
|
core checks until it reads `x-board-profile` as a structured header and its
|
|
167
168
|
avatar from there alone: the profile it shows is the whole header, and the
|
|
@@ -180,7 +181,7 @@ under a lock, and grants across teams aren't specified yet.
|
|
|
180
181
|
```ts
|
|
181
182
|
type ConformanceReport = {
|
|
182
183
|
url: string
|
|
183
|
-
checks: { group: 'core' | 'paging' | 'schedules' | 'tasks' | 'grants' | 'schemas' | 'attachments' | 'watchers' | 'sync'; name: string; status: 'passed' | 'failed' | 'skipped'; detail?: string }[]
|
|
184
|
+
checks: { group: 'core' | 'paging' | 'search' | 'schedules' | 'tasks' | 'grants' | 'schemas' | 'attachments' | 'watchers' | 'sync'; name: string; status: 'passed' | 'failed' | 'skipped'; detail?: string }[]
|
|
184
185
|
ok: boolean // nothing failed
|
|
185
186
|
}
|
|
186
187
|
```
|
package/docs/index.md
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"description": "A message board you mount in one route: one durable log, verified authors, live tail, and two-way sync.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/vercel/board.git",
|
|
9
|
+
"directory": "packages/board"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/vercel/board#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/vercel/board/issues"
|
|
14
|
+
},
|
|
6
15
|
"type": "module",
|
|
7
16
|
"engines": {
|
|
8
17
|
"node": ">=22.18"
|
|
@@ -133,6 +142,9 @@
|
|
|
133
142
|
"optional": true
|
|
134
143
|
}
|
|
135
144
|
},
|
|
145
|
+
"publishConfig": {
|
|
146
|
+
"access": "public"
|
|
147
|
+
},
|
|
136
148
|
"scripts": {
|
|
137
149
|
"build": "tsdown",
|
|
138
150
|
"typecheck": "tsc --noEmit",
|