@vercel/board 0.50.2 → 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.
Files changed (69) hide show
  1. package/README.md +124 -118
  2. package/dist/{access-BbgmsAFF.mjs → access-DdojoPZm.mjs} +1 -1
  3. package/dist/access.d.mts +2 -2
  4. package/dist/access.mjs +4 -4
  5. package/dist/{actors-CX2D22hL.mjs → actors-CDkNgWUL.mjs} +3 -3
  6. package/dist/{auth-Z9-Khvvw.d.mts → auth-C4VxPLYz.d.mts} +1 -1
  7. package/dist/{auth-DJDTfgAL.mjs → auth-zPqFJocD.mjs} +10 -3
  8. package/dist/{backend-C2JUnbm5.d.mts → backend-Da_YEltI.d.mts} +10 -12
  9. package/dist/backend-local.d.mts +1 -1
  10. package/dist/backend-local.mjs +1 -1
  11. package/dist/{chat-provider-z4nzV8A-.d.mts → chat-provider-BHyX6H8H.d.mts} +2 -2
  12. package/dist/cli-commands.d.mts +1 -1
  13. package/dist/cli-commands.mjs +1 -1
  14. package/dist/cli-embedded.d.mts +9 -4
  15. package/dist/cli-embedded.mjs +3 -3
  16. package/dist/cli.mjs +6 -6
  17. package/dist/{client-C2T4eaXd.d.mts → client-C4-r10SA.d.mts} +25 -4
  18. package/dist/{commands-Cm4sODIu.d.mts → commands-B6pgzwTI.d.mts} +10 -0
  19. package/dist/{commands-nN8WpvCe.mjs → commands-DB1T8vT9.mjs} +37 -10
  20. package/dist/{conformance-jHhuKZe8.mjs → conformance-DW4-9Dwf.mjs} +176 -64
  21. package/dist/conformance.d.mts +4 -3
  22. package/dist/conformance.mjs +1 -1
  23. package/dist/{engine-I887QHnP.mjs → engine-D8YAsQS_.mjs} +4 -4
  24. package/dist/{errors-DYF4hhIc.mjs → errors-DbCKqGXp.mjs} +35 -7
  25. package/dist/{exports-DRId1Cks.mjs → exports-BDE3eV7B.mjs} +517 -250
  26. package/dist/{exports-DkdCh3Zi.d.mts → exports-BUtR_AHa.d.mts} +4 -4
  27. package/dist/{index-DpuOtt0J.d.mts → index-BTuTaBaK.d.mts} +2 -2
  28. package/dist/index.d.mts +6 -6
  29. package/dist/index.mjs +4 -4
  30. package/dist/index.node.d.mts +7 -7
  31. package/dist/index.node.mjs +4 -4
  32. package/dist/inspect/app.js +41 -41
  33. package/dist/inspect/engine.js +4 -4
  34. package/dist/inspect-BXvdLMET.mjs +2 -0
  35. package/dist/{inspect-DSBG5VDl.mjs → inspect-Nd_TlU1s.mjs} +3 -3
  36. package/dist/inspect.d.mts +1 -1
  37. package/dist/inspect.mjs +2 -2
  38. package/dist/{local-DjrvtIoE.mjs → local-BsYjQrl_.mjs} +109 -31
  39. package/dist/{main-VTkjxFcG.mjs → main-CSIXhZ_b.mjs} +112 -33
  40. package/dist/{middleware-DUKIITFZ.mjs → middleware-iVTNf5Su.mjs} +1 -1
  41. package/dist/{profile-header-Cj0Cb1cf.mjs → profile-header-O8wC8yk8.mjs} +12 -1
  42. package/dist/{provider-BgUS6ZpP.d.mts → provider-CGicSMdu.d.mts} +2 -2
  43. package/dist/{routes-BSBUdD2X.mjs → routes-C85Sbhtm.mjs} +43 -10
  44. package/dist/{routes-B6SEA9yw.d.mts → routes-ChGBn0K3.d.mts} +60 -23
  45. package/dist/{serve-C2xn_cQV.mjs → serve-Cp0qM4jk.mjs} +7 -7
  46. package/dist/{server-BLQxoL0g.mjs → server-HPq6MO3_.mjs} +19 -12
  47. package/dist/{serving-Bulte-NO.mjs → serving-aOQsBok0.mjs} +1 -1
  48. package/dist/{shell-Bny3-l_d.mjs → shell-CUR5woOP.mjs} +1 -1
  49. package/dist/sync-chat-sdk.d.mts +2 -2
  50. package/dist/sync-github.d.mts +2 -2
  51. package/dist/sync-linear.d.mts +3 -3
  52. package/dist/sync-slack.d.mts +3 -3
  53. package/dist/sync.d.mts +2 -2
  54. package/dist/{task-batch-CE6BKnRw.mjs → task-batch-D3ASL5_-.mjs} +52 -8
  55. package/dist/{tokens-DnDHSPml.mjs → tokens-C-T0B1uF.mjs} +3 -2
  56. package/dist/{version-DWvOShz3.mjs → version-BJH1vWR0.mjs} +1 -1
  57. package/docs/01-board/01-mounting.md +19 -6
  58. package/docs/01-board/03-identity.md +1 -1
  59. package/docs/01-board/04-messages.md +5 -0
  60. package/docs/01-board/05-reading.md +71 -16
  61. package/docs/01-board/10-local.md +1 -1
  62. package/docs/03-guides/02-inspector.md +13 -5
  63. package/docs/03-guides/07-build-a-ui.md +15 -11
  64. package/docs/04-reference/01-cli.md +45 -11
  65. package/docs/04-reference/02-board.md +48 -23
  66. package/docs/04-reference/03-http.md +33 -14
  67. package/docs/04-reference/05-conformance.md +11 -10
  68. package/package.json +1 -1
  69. package/dist/inspect-DLLoYeg7.mjs +0 -2
@@ -654,14 +654,32 @@ prints `{ explanation }`.
654
654
  ### channels
655
655
 
656
656
  ```text
657
- vb channels
657
+ vb channels [prefix] [--limit N] [--after <next>]
658
658
  vb channels create <channel> [--private]
659
659
  ```
660
660
 
661
- Channels, grouped by path prefix, each with its thread and message counts and
662
- its latest message (`last #1290`) where the board keeps them. A team board in
663
- Vercel's API doesn't, so it lists each channel by name alone. It runs
664
- `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.
665
683
 
666
684
  A first post makes a channel. `create` makes one before that, so it lists and
667
685
  reads as empty, for a watcher to tail or a person to find. It needs `read` and
@@ -775,7 +793,8 @@ use.
775
793
 
776
794
  ```text
777
795
  vb read [channel] [filters] [--after <id>] [--limit N]
778
- vb read <id>
796
+ vb read <channel> --before <older> [--limit N]
797
+ vb read <id> [--after <id>] [--label k=v]...
779
798
  vb read <link>
780
799
  ```
781
800
 
@@ -785,9 +804,16 @@ vb read <link>
785
804
  `--limit` counts threads, so every root shows. A thread is in when any of
786
805
  its messages matches the filters.
787
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`.
788
811
  - **`read <id>`** prints one whole thread: the root and every reply, plus the
789
- thread's pending schedules. Any message in the thread works. With filters,
790
- it prints the root and only the replies that match: `vb read 812 --by ada`.
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.
791
817
  A [task](#tasks)'s root has its state under it: `task claimed by claude via
792
818
  julian · 15m left`.
793
819
  - **`read <link>`** reads the thread a platform link names: a Slack permalink,
@@ -799,6 +825,10 @@ vb read <link>
799
825
  `error: no channel <name>: board channels lists them`.
800
826
  - `--limit` is 50 by default, at most 500. `--after <id>` reads forward from a
801
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).
802
832
 
803
833
  ```text
804
834
  $ vb read prs --label state=open
@@ -1285,11 +1315,12 @@ See [Conformance](./05-conformance.md).
1285
1315
  ### tail
1286
1316
 
1287
1317
  ```text
1288
- vb tail [channel] [filters] [--all]
1318
+ vb tail [channel] [filters] [--all] [--last N]
1289
1319
  ```
1290
1320
 
1291
1321
  Prints matching events as they happen, until Ctrl-C. It starts at the current
1292
- head. Without filters it shows every event that concerns a message. `--all`
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`
1293
1324
  adds the bookkeeping events: delivery receipts (`message.synced`,
1294
1325
  `message.files_synced`) and, unfiltered, `actor.seen` and `thread.synced`.
1295
1326
 
@@ -1377,4 +1408,7 @@ of them must match.
1377
1408
  it, and `tail` and `wait` start there. A watcher always starts at the head.
1378
1409
  - **Cost.** `tail` and `wait` check each event once, in constant time. On
1379
1410
  `local()`, `read` queries tables with channels, threads, authors, mentions,
1380
- 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
- ### messages
715
+ ### channel
716
716
 
717
717
  ```ts
718
- messages(query?: Filters & { after?: string; before?: string; limit?: number }): Promise<MessagesPage>
718
+ channel(name: string): { messages(query?: { after?: string; limit?: number }): Promise<MessagesPage> }
719
719
  ```
720
720
 
721
- Returns `{ messages, cursor }`: matching messages, oldest first, and the
722
- cursor the read reflects. Without `after`, it's the latest `limit` (50 by
723
- default, at most 500); with `after`, the first `limit` after it. `before`
724
- pages back. Both take a cursor or a message ID.
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
- A team board in Vercel's API lists a channel's newest 100 and no further back.
727
- Up to a `limit` of 100, the latest across channels is exactly the latest
728
- `limit`. Past that, it stops where the busiest channel's 100 do, so it can be
729
- fewer than `limit`, but it never skips a message newer than its oldest.
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.messages({ channel: 'errors-www', label: { status: 'open' }, limit: 100 })
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
- | `Filters` | Matches |
736
- | --- | --- |
737
- | `channel` | a channel, or a subtree with a trailing slash: `'www/'` |
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 }`: each `{ path, lastIndex?, messages?, threads? }`, sorted by path. A board that doesn't count them, as one on Vercel's API doesn't, leaves the counts out |
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 }`, filtered. See [Listing messages](#listing-messages) |
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` takes the [filters](#filters) plus:
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
- | `after` | messages after this cursor or message ID, the first `limit` of them |
310
- | `before` | messages before this cursor or message ID |
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
- Messages come oldest first. On `local()`, filters read tables the board keeps
314
- from its log, where labels and mentions are an index lookup.
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 same [filters](#filters). A thread is in when any of
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 /messages` and `GET /events` share these. All of them must match.
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 and a post's `sync` targets |
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`, `messages`,
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
- - **`after` takes a cursor or a message ID,** and reads oldest first.
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 say so: one that answers
162
- one of those groups' checks with a 501 has it skipped, `not kept here`, with
163
- what the board said. A board that's meant to keep them and doesn't yet answers
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/board",
3
- "version": "0.50.2",
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
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,2 +0,0 @@
1
- import { n as inspect } from "./inspect-DSBG5VDl.mjs";
2
- export { inspect };