@vercel/board 0.57.1 → 0.58.1

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 (71) hide show
  1. package/dist/{access-CZ419Vho.mjs → access-D1AHzFSP.mjs} +1 -1
  2. package/dist/access.d.mts +2 -2
  3. package/dist/access.mjs +4 -4
  4. package/dist/{actors-CXMWplob.mjs → actors-CCth21rU.mjs} +2 -2
  5. package/dist/{auth-AwZJQpCO.mjs → auth-Cc5_pdi7.mjs} +2 -2
  6. package/dist/{auth-C0Mla9OU.d.mts → auth-DcWTzrHz.d.mts} +1 -1
  7. package/dist/{backend-BuqwQbb4.d.mts → backend-9H57DlQt.d.mts} +23 -5
  8. package/dist/backend-local.d.mts +1 -1
  9. package/dist/backend-local.mjs +1 -1
  10. package/dist/backend-postgres/blob-vercel.d.mts +1 -1
  11. package/dist/backend-postgres.d.mts +3 -3
  12. package/dist/backend-postgres.mjs +3 -3
  13. package/dist/{blob-DjS53D1A.d.mts → blob-CdLCZEPM.d.mts} +2 -2
  14. package/dist/{chat-provider-CpYdXEpI.d.mts → chat-provider-CW-YpGWe.d.mts} +6 -5
  15. package/dist/{chat-provider-Br2RXgLV.mjs → chat-provider-eRYSL4XG.mjs} +4 -4
  16. package/dist/cli-commands.d.mts +1 -1
  17. package/dist/cli-commands.mjs +1 -1
  18. package/dist/cli-embedded.d.mts +2 -2
  19. package/dist/cli-embedded.mjs +2 -2
  20. package/dist/cli.mjs +6 -6
  21. package/dist/{client-B0DGOt7P.d.mts → client-BUPyzzFt.d.mts} +13 -1
  22. package/dist/{commands-DeYAQUcP.mjs → commands-CkRYuvpd.mjs} +74 -20
  23. package/dist/{commands-Dcm4_pc1.d.mts → commands-DryDbyWr.d.mts} +5 -0
  24. package/dist/{conformance-EtEq22w1.mjs → conformance-D9XutDay.mjs} +2 -2
  25. package/dist/conformance.d.mts +1 -1
  26. package/dist/conformance.mjs +1 -1
  27. package/dist/{engine-CfVTyEeo.mjs → engine-DVWbcEIB.mjs} +2 -2
  28. package/dist/{errors-DjatfYjl.mjs → errors-Ce_-E3_C.mjs} +50 -1
  29. package/dist/{errors-DBZtbfph.d.mts → errors-CwObkpSn.d.mts} +1 -1
  30. package/dist/{exports-BvJTIorX.d.mts → exports-Bh09j6Bd.d.mts} +5 -5
  31. package/dist/{exports-B_UGnrnN.mjs → exports-CREw274K.mjs} +92 -9
  32. package/dist/{index-DuibwQf9.d.mts → index-mgNwCwJ4.d.mts} +2 -2
  33. package/dist/index.d.mts +7 -7
  34. package/dist/index.mjs +4 -4
  35. package/dist/index.node.d.mts +8 -8
  36. package/dist/index.node.mjs +4 -4
  37. package/dist/inspect/app.js +33 -33
  38. package/dist/{inspect-DfJzHFiE.mjs → inspect-mdRycsHb.mjs} +2 -2
  39. package/dist/inspect-rfTRL8zp.mjs +2 -0
  40. package/dist/inspect.d.mts +1 -1
  41. package/dist/inspect.mjs +1 -1
  42. package/dist/{local-BiG1WJk0.mjs → local-B9UwaY2z.mjs} +3 -3
  43. package/dist/{local-D2i5sxuY.mjs → local-DMQ-Eh6v.mjs} +18 -7
  44. package/dist/{main-Bbqg3Unf.mjs → main-C7B22rE4.mjs} +159 -31
  45. package/dist/{middleware-D2AGrGj7.mjs → middleware-DVBOEd8G.mjs} +1 -1
  46. package/dist/{provider-BNVyVKtH.d.mts → provider-BnK0Bif7.d.mts} +2 -2
  47. package/dist/{routes-CSnxZyyb.d.mts → routes-D5FtKOP_.d.mts} +87 -1
  48. package/dist/{serve-D06-DMej.mjs → serve-C3B6EP7W.mjs} +6 -6
  49. package/dist/{server-BXbcS-n9.mjs → server-D5S70_au.mjs} +6 -6
  50. package/dist/{serving-B2BNr4PR.mjs → serving-BVtrFzK4.mjs} +1 -1
  51. package/dist/{shell-C8EowDEz.mjs → shell-U3QkDJIF.mjs} +1 -1
  52. package/dist/sync-chat-sdk.d.mts +2 -2
  53. package/dist/sync-chat-sdk.mjs +1 -1
  54. package/dist/sync-github.d.mts +2 -2
  55. package/dist/sync-github.mjs +1 -1
  56. package/dist/sync-linear.d.mts +3 -3
  57. package/dist/sync-linear.mjs +1 -1
  58. package/dist/sync-slack.d.mts +23 -6
  59. package/dist/sync-slack.mjs +33 -2
  60. package/dist/sync.d.mts +2 -2
  61. package/dist/{task-batch-YMVr_c5R.mjs → task-batch-BLUkrUqX.mjs} +7 -4
  62. package/dist/{tokens-CaEPmiG1.mjs → tokens-XagdeYrv.mjs} +2 -2
  63. package/dist/{version-BRR9FkLa.mjs → version-D3WaVccj.mjs} +1 -1
  64. package/docs/01-board/11-tasks.md +6 -1
  65. package/docs/02-sync/01-overview.md +4 -0
  66. package/docs/02-sync/03-slack.md +5 -0
  67. package/docs/02-sync/05-managed.md +117 -0
  68. package/docs/04-reference/01-cli.md +43 -1
  69. package/docs/04-reference/03-http.md +4 -0
  70. package/package.json +1 -1
  71. package/dist/inspect-H1MISWwN.mjs +0 -2
@@ -1,5 +1,5 @@
1
1
  import { _ as withRoutes, i as eventSchema, m as into, r as envelope } from "./events-mWKc1uvZ.mjs";
2
- import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-Br2RXgLV.mjs";
2
+ import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-eRYSL4XG.mjs";
3
3
  import { n as tagOf, t as slug } from "./tags-CxDCF_tt.mjs";
4
4
  import { z } from "zod";
5
5
  import { connectGitHubAdapter } from "@vercel/connect/chat";
@@ -1,6 +1,6 @@
1
- import { Vt as SourceRead } from "./routes-CSnxZyyb.mjs";
2
- import { _ as SyncFn, b as SyncUnit, f as ResolvedTarget, l as ReceivedEvent, o as ProviderPost, p as SyncContext, r as ProviderDelivery } from "./provider-BNVyVKtH.mjs";
3
- import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-CpYdXEpI.mjs";
1
+ import { qt as SourceRead } from "./routes-D5FtKOP_.mjs";
2
+ import { _ as SyncFn, b as SyncUnit, f as ResolvedTarget, l as ReceivedEvent, o as ProviderPost, p as SyncContext, r as ProviderDelivery } from "./provider-BnK0Bif7.mjs";
3
+ import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-CW-YpGWe.mjs";
4
4
  import { z } from "zod";
5
5
  import { Adapter } from "chat";
6
6
  //#region src/sync/linear.d.ts
@@ -1,5 +1,5 @@
1
1
  import { i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-mWKc1uvZ.mjs";
2
- import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-Br2RXgLV.mjs";
2
+ import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-eRYSL4XG.mjs";
3
3
  import { n as tagOf, t as slug } from "./tags-CxDCF_tt.mjs";
4
4
  import "zod";
5
5
  import { connectLinearAdapter } from "@vercel/connect/chat";
@@ -1,6 +1,6 @@
1
- import { Xn as ExternalLink } from "./routes-CSnxZyyb.mjs";
2
- import { _ as SyncFn, f as ResolvedTarget, o as ProviderPost, p as SyncContext, r as ProviderDelivery, s as ProviderSender, x as channels } from "./provider-BNVyVKtH.mjs";
3
- import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-CpYdXEpI.mjs";
1
+ import { nr as ExternalLink } from "./routes-D5FtKOP_.mjs";
2
+ import { _ as SyncFn, f as ResolvedTarget, o as ProviderPost, p as SyncContext, r as ProviderDelivery, s as ProviderSender, x as channels } from "./provider-BnK0Bif7.mjs";
3
+ import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-CW-YpGWe.mjs";
4
4
  import { z } from "zod";
5
5
  import { Adapter } from "chat";
6
6
  //#region src/sync/slack-deployments.d.ts
@@ -69,6 +69,14 @@ export type SlackClient = {
69
69
  user?: SlackUser;
70
70
  }>;
71
71
  };
72
+ /** A bot's name and picture, for a message an app posts with no user of its own; needs `users:read`. */
73
+ bots?: {
74
+ info(args: {
75
+ bot: string;
76
+ }): Promise<{
77
+ bot?: SlackBot;
78
+ }>;
79
+ };
72
80
  files?: {
73
81
  delete(args: {
74
82
  file: string;
@@ -190,14 +198,23 @@ type SlackFile = {
190
198
  title?: string;
191
199
  permalink?: string;
192
200
  };
201
+ /** A bot as Slack describes it: in `bots.info`, and in a message's `bot_profile`. */
202
+ type SlackBot = {
203
+ name?: string;
204
+ icons?: {
205
+ image_72?: string;
206
+ image_48?: string;
207
+ };
208
+ };
193
209
  type SlackMessage = {
194
210
  ts?: string;
195
211
  text?: string;
196
212
  user?: string;
197
213
  username?: string;
198
- bot_profile?: {
199
- name?: string;
200
- };
214
+ bot_id?: string;
215
+ bot_profile?: SlackBot;
216
+ /** The picture a message was posted under, where it names one. */
217
+ icons?: SlackBot['icons'];
201
218
  files?: SlackFile[];
202
219
  thread_ts?: string;
203
220
  reply_count?: number;
@@ -2,7 +2,7 @@ import { m as MESSAGE_TEXT_MAX } from "./schemas-CUSTEFIy.mjs";
2
2
  import "./external-DkWafjn-.mjs";
3
3
  import { t as extractMentions } from "./mentions-DBGmqkr2.mjs";
4
4
  import { d as opensBlock, i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-mWKc1uvZ.mjs";
5
- import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-Br2RXgLV.mjs";
5
+ import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-eRYSL4XG.mjs";
6
6
  import { r as formatVercelDeployments } from "./bots-CqPYxkqK.mjs";
7
7
  import { z } from "zod";
8
8
  import { stringifyMarkdown } from "chat";
@@ -599,6 +599,21 @@ var SlackProvider = class extends ChatSyncProvider {
599
599
  }
600
600
  return promise;
601
601
  }
602
+ const bots = /* @__PURE__ */ new Map();
603
+ function botOf(bot) {
604
+ let promise = bots.get(bot);
605
+ if (!promise) {
606
+ promise = client().then(async (web) => (await web?.bots?.info({ bot }))?.bot ?? null).catch(() => null);
607
+ bots.set(bot, promise);
608
+ }
609
+ return promise;
610
+ }
611
+ /** The message as a bot posted it with no user, or nothing: one a user wrote, or a bot's own user, is the adapter's to name. */
612
+ const fromBot = (raw) => {
613
+ const event = raw;
614
+ return event && !event.user && event.bot_id ? event : null;
615
+ };
616
+ const pictureOf = (icons) => icons?.image_72 ?? icons?.image_48 ?? null;
602
617
  const converter = options.adapter.formatConverter;
603
618
  const mrkdwn = (text) => {
604
619
  try {
@@ -924,7 +939,23 @@ var SlackProvider = class extends ChatSyncProvider {
924
939
  }
925
940
  }];
926
941
  },
927
- avatar: (message) => message.author.userId ? avatarOf(message.author.userId) : Promise.resolve(null),
942
+ async author(author, raw) {
943
+ const event = fromBot(raw);
944
+ if (!event) return null;
945
+ const name = event.username || event.bot_profile?.name || (await botOf(event.bot_id))?.name || event.bot_id;
946
+ return {
947
+ id: `slack:user:${author.userId}`,
948
+ handle: name,
949
+ name,
950
+ avatar: null,
951
+ isBot: true
952
+ };
953
+ },
954
+ async avatar(message) {
955
+ const event = fromBot(message.raw);
956
+ if (!event) return message.author.userId ? avatarOf(message.author.userId) : null;
957
+ return pictureOf(event.icons) ?? pictureOf(event.bot_profile?.icons) ?? pictureOf((await botOf(event.bot_id))?.icons);
958
+ },
928
959
  groupThread: (thread) => thread,
929
960
  isRoot: (thread, messageId) => thread.slice(thread.lastIndexOf(":") + 1) === messageId,
930
961
  context: () => null,
package/dist/sync.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { Jn as ExternalEvent, Yn as ExternalFile, qn as ExternalAuthor } from "./routes-CSnxZyyb.mjs";
2
- import { A as SyncRoot, C as mirror, D as RootOverride, E as ProviderEvent, M as eventSchema, N as VercelDeployment, O as SyncOverrides, S as into, T as EventBase, _ as SyncFn, a as ProviderOptions, b as SyncUnit, c as Receive, d as Renderer, f as ResolvedTarget, g as Sync, h as UnreadableError, i as ProviderFile, j as envelope, k as SyncResult, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, p as SyncContext, r as ProviderDelivery, u as RenderInput, v as SyncIn, w as render, x as channels, y as SyncOut } from "./provider-BNVyVKtH.mjs";
1
+ import { $n as ExternalAuthor, er as ExternalEvent, tr as ExternalFile } from "./routes-D5FtKOP_.mjs";
2
+ import { A as SyncRoot, C as mirror, D as RootOverride, E as ProviderEvent, M as eventSchema, N as VercelDeployment, O as SyncOverrides, S as into, T as EventBase, _ as SyncFn, a as ProviderOptions, b as SyncUnit, c as Receive, d as Renderer, f as ResolvedTarget, g as Sync, h as UnreadableError, i as ProviderFile, j as envelope, k as SyncResult, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, p as SyncContext, r as ProviderDelivery, u as RenderInput, v as SyncIn, w as render, x as channels, y as SyncOut } from "./provider-BnK0Bif7.mjs";
3
3
  export { EventBase, type ExternalAuthor, ExternalEvent, type ExternalFile, type FileDelivery, type ProviderDelivery, type ProviderEvent, type ProviderFile, type ProviderOptions, type ProviderPost, type Receive, ReceivedEvent, type RenderInput, type Renderer, ResolvedTarget, type RootOverride, type Sync, type SyncContext, type SyncFn, type SyncIn, type SyncOut, SyncOverrides, SyncProvider, type SyncResult, type SyncRoot, type SyncUnit, UnreadableError, type VercelDeployment, channels, envelope, eventSchema, into, mirror, render };
@@ -1,11 +1,11 @@
1
1
  import { c as fileNameProblem, i as ATTACHMENT_BYTES_MAX, s as fileName } from "./profile-header-O8wC8yk8.mjs";
2
2
  import "./schemas-CUSTEFIy.mjs";
3
3
  import { l as isThreadTarget } from "./external-DkWafjn-.mjs";
4
- import { H as Filters, r as badRequest, t as HttpError, xt as routes } from "./errors-DjatfYjl.mjs";
5
- import { i as afterRetry } from "./middleware-D2AGrGj7.mjs";
6
- import { t as VERSION } from "./version-BRR9FkLa.mjs";
4
+ import { Ct as routes, H as Filters, r as badRequest, t as HttpError } from "./errors-Ce_-E3_C.mjs";
5
+ import { i as afterRetry } from "./middleware-DVBOEd8G.mjs";
6
+ import { t as VERSION } from "./version-D3WaVccj.mjs";
7
7
  import { t as own } from "./own-OwgPWdmh.mjs";
8
- import { o as options } from "./commands-DeYAQUcP.mjs";
8
+ import { o as options } from "./commands-CkRYuvpd.mjs";
9
9
  import { z } from "zod";
10
10
  //#region src/server/backend.ts
11
11
  /** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
@@ -81,6 +81,9 @@ const METHODS = [
81
81
  "schedule",
82
82
  "schedules",
83
83
  "cancelSchedule",
84
+ "createSync",
85
+ "syncs",
86
+ "removeSync",
84
87
  "tasks",
85
88
  "createTask",
86
89
  "createTasks",
@@ -1,5 +1,5 @@
1
- import { d as unauthorized } from "./errors-DjatfYjl.mjs";
2
- import { S as trustedIssuers, _ as markVerified, a as TOKENS, h as issuerName, o as VERCEL_ISSUER, x as subFits, y as privateHost } from "./auth-AwZJQpCO.mjs";
1
+ import { d as unauthorized } from "./errors-Ce_-E3_C.mjs";
2
+ import { S as trustedIssuers, _ as markVerified, a as TOKENS, h as issuerName, o as VERCEL_ISSUER, x as subFits, y as privateHost } from "./auth-Cc5_pdi7.mjs";
3
3
  import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
4
4
  //#region src/server/identity.ts
5
5
  let fromDisk;
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const VERSION = "0.57.1";
3
+ const VERSION = "0.58.1";
4
4
  //#endregion
5
5
  export { VERSION as t };
@@ -30,7 +30,8 @@ on it as on any other.
30
30
  - **Labels route work.** `--label step=fix` here is what `claim --ready
31
31
  --label step=fix` asks for there.
32
32
  - **`vb tasks [channel]`** lists open tasks, oldest first, the order a queue
33
- works them in. `--state` narrows it to one state, or widens it to `all`.
33
+ works them in: a channel's, a prefix's (`work/`), or with none, every
34
+ channel's. `--state` narrows it to one state, or widens it to `all`.
34
35
  `--label`, `--by`, and `--for` narrow it further. A page is 50 tasks, and a
35
36
  full one prints the command that reads the next.
36
37
 
@@ -183,6 +184,10 @@ ready one, with `--label`, `--from`, and `--wait` as `claim` takes them.
183
184
  - **It renews the claim while the command runs,** at a third of the lease.
184
185
  - **Ctrl-C releases the task** and exits 130. A supervisor's SIGTERM
185
186
  releases it too, and exits 143.
187
+ - **The command can settle the task itself,** with `vb tasks complete
188
+ "$BOARD_TASK"`, `fail`, or `block`, as the same profile. `run` leaves the
189
+ task as the command left it, keeps the command running, and exits with its
190
+ code.
186
191
  - **A lost claim stops the command.** When a renewal fails with `claim_lost`,
187
192
  `run` stops the command and exits 1.
188
193
  - **A command that can't start** releases the task, and `run` exits 1.
@@ -27,6 +27,10 @@ delivery receipts, lookups by platform ID, and an inbox of platform events. So
27
27
  it works the same on Vercel's board, on `local()`, and on a
28
28
  [backend of your own](../01-board/01-mounting.md#a-backend-of-your-own).
29
29
 
30
+ On Vercel's board, the board can also run a sync for you, with no deployment:
31
+ a Slack channel, mirrored both ways through Vercel's Slack app. See
32
+ [Syncs the board runs](./05-managed.md).
33
+
30
34
  ### With `BOARD_URL` set
31
35
 
32
36
  Sync runs where the board's log is. `board()` with `BOARD_URL` set and `sync`
@@ -87,6 +87,11 @@ most once a minute, while the other channels sync.
87
87
 
88
88
  - **Messages, replies, edits, deletes, and reactions,** both ways. Slack's mrkdwn
89
89
  arrives as markdown, and the board's markdown posts back as Slack formatting.
90
+ - **Who wrote it.** A person's message comes in under their Slack name, handle,
91
+ and picture. An app that posts with no user of its own, as it answers a slash
92
+ command or through an incoming webhook, is named as its message names it, then
93
+ from Slack's record of the bot (`bots.info`, under `users:read`), then by its
94
+ bot ID.
90
95
  - **Mentions** sync both ways by the user's ID. `<@U0456>` comes in as a
91
96
  mention of that user, `@[slack:user:U0456]` under key `slack`, and the board
92
97
  meets them, by their Slack name, handle, and picture, though they never
@@ -0,0 +1,117 @@
1
+ ---
2
+ title: Syncs the board runs
3
+ description: Mirror a Slack channel on the board with one command and no deployment of your own.
4
+ ---
5
+
6
+ ## One command, no deployment
7
+
8
+ Sync usually runs in your own deployment, in `board({ sync })`. On Vercel's
9
+ board, the board can run a sync itself: you name a channel and a source, and it
10
+ keeps the sync going with no code and no project of yours. It runs one source:
11
+ a Slack channel, mirrored both ways.
12
+
13
+ ```bash
14
+ # in a terminal:
15
+ vb sync alerts slack/vercel:#alerts # a Slack channel, both ways
16
+ vb syncs # what the board runs, and its state
17
+ vb sync remove syn_9c2f7b # stop one: what it brought in stays
18
+ ```
19
+
20
+ It takes `sync` in the channel, which for a person is `manage`. The channel has
21
+ to be there already: a sync makes none, so a name mistyped is refused. A board
22
+ keeps at most 100 of them. Only Vercel's board runs syncs itself: `local()` and a
23
+ backend of your own answer 501 `no_managed_sync`.
24
+
25
+ ## A Slack channel
26
+
27
+ ```bash
28
+ vb sync alerts slack/vercel:#alerts
29
+ ```
30
+
31
+ This mirrors a Slack channel and a board channel both ways through Vercel's
32
+ Slack app: what is said in Slack lands on the board as the Slack user who said
33
+ it, and what is posted on the board shows up in Slack under its author's name
34
+ and picture, replies in their threads. It needs Vercel's Slack app connected to your team and added to the
35
+ Slack channel. A team with more than one Slack workspace names one with
36
+ `--workspace <domain|id>`.
37
+
38
+ `slack/vercel` names the Slack app the mirror goes through, the way a connector
39
+ is named. Vercel's Slack app is the one the board takes so far, and each sync
40
+ says which app it goes through.
41
+
42
+ A channel's content is its members' to share. So a mirror is `pending`, and
43
+ nothing syncs, until someone in the Slack channel accepts it there. `vb sync`
44
+ prints the command to paste into the channel:
45
+
46
+ ```text
47
+ $ vb sync alerts slack/vercel:#alerts
48
+ syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
49
+ ```
50
+
51
+ Running that command in Slack starts nothing yet. It shows whoever ran it,
52
+ privately, which Vercel team and board the channel would be mirrored with and
53
+ who asked, and the mirror starts when they confirm. The channel is then told the
54
+ same, with the command that stops it:
55
+
56
+ ```text
57
+ /vercel board sync stop syn_9c2f7b
58
+ ```
59
+
60
+ Anyone in the Slack channel can stop its mirror that way. The sync is then
61
+ `paused`, and asking for the mirror again puts the question to the channel
62
+ again.
63
+
64
+ A board mirrors a Slack channel once. To mirror a Slack channel with an app and
65
+ a sync function of your own, see [Slack](./03-slack.md).
66
+
67
+ ### Limits
68
+
69
+ - One Slack workspace mirrors at most 50 channels with one Vercel team's
70
+ boards. Past that, `vb sync` is refused, and so is accepting a mirror in
71
+ Slack, until one of them is stopped.
72
+ - A Slack channel shared with another organization can't be mirrored. One
73
+ that is shared later stops mirroring: the channel is told, the sync is
74
+ `paused`, and asking for it again is refused while the channel stays shared.
75
+ - Vercel's Slack app connected for a whole Slack organization, in place of one
76
+ workspace, isn't supported yet: `vb sync` is refused and says so.
77
+ - A reaction made in Slack doesn't reach the board.
78
+
79
+ ## State
80
+
81
+ `vb syncs` lists every sync the board runs, and `vb syncs <channel>` one
82
+ channel's. One that isn't running says so, and why:
83
+
84
+ ```text
85
+ $ vb syncs
86
+ syn_4f9a2c support slack/vercel:#support
87
+ syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
88
+ syn_1b77e0 ops slack/vercel:#ops paused: Vercel's Slack app can no longer reach the channel. Once it's back in it, mirror the channel again.
89
+ ```
90
+
91
+ | State | What it means |
92
+ | --- | --- |
93
+ | `active` | It runs. |
94
+ | `pending` | It never started: its source has yet to agree to it, as a Slack channel must. |
95
+ | `paused` | It ran, and its source is gone: Vercel's Slack app can no longer reach the channel, someone in the channel stopped it, or the channel is now shared with another organization. |
96
+
97
+ A mirror that isn't running gives way to one asked for again in the same
98
+ channel. So once the app is back in the Slack channel, a paused mirror starts
99
+ again with the `vb sync` that made it, accepted like a new one. One whose
100
+ Slack channel is shared with another organization doesn't, for as long as the
101
+ channel is shared.
102
+
103
+ ## From code
104
+
105
+ The handle and the client make, list, and remove them:
106
+
107
+ ```ts
108
+ import { board } from '@vercel/board'
109
+
110
+ const team = board()
111
+
112
+ const mirror = await team.createSync({ channel: 'alerts', source: 'slack', slack: { app: 'slack/vercel', channel: '#alerts' } })
113
+ mirror.state // 'pending', with mirror.reason: what it waits for, and the command that starts it
114
+
115
+ await team.syncs({ channel: 'alerts' }) // [{ id, channel, source, slack, state, reason, by, createdAt }]
116
+ await team.removeSync(mirror.id)
117
+ ```
@@ -1196,7 +1196,8 @@ $ vb tasks work/ --state all --limit 2
1196
1196
  - **`run`** gives the command the task's ID in `BOARD_TASK`, renews the claim
1197
1197
  at a third of its lease, and exits with the command's code. Exit 0 completes
1198
1198
  the task with `--result`; any other fails it with `exited <code>`, or
1199
- `killed by <signal>`. Ctrl-C releases the task and exits 130. A renewal that
1199
+ `killed by <signal>`. A command that completes, fails, or blocks the task
1200
+ itself leaves it as it is. Ctrl-C releases the task and exits 130. A renewal that
1200
1201
  fails with `claim_lost` stops the command, and `run` exits 1.
1201
1202
  - **The CLI keeps your claim** in `~/.config/board/claims/` (under
1202
1203
  `XDG_CONFIG_HOME` when it's set): one file per board, task, and profile,
@@ -1317,6 +1318,47 @@ channel target (`slack:#incidents`) starts a thread there; a thread target
1317
1318
  ways. Attaching twice prints `already synced with …`. See
1318
1319
  [Sync](../02-sync/01-overview.md).
1319
1320
 
1321
+ ```text
1322
+ vb sync <channel> slack/vercel:<#channel> [--workspace <domain|id>]
1323
+ vb sync remove <sync>
1324
+ ```
1325
+
1326
+ With a channel and a source, it has the board sync the channel itself, on
1327
+ Vercel's board, and `remove` stops one by its ID. [`syncs`](#syncs) lists
1328
+ them. A word alone is always a message, so a channel's name alone is refused
1329
+ and points there. With two, a thread goes with a target and a channel with a
1330
+ source: one of each is refused. The source is
1331
+ `slack/vercel:#channel`, which mirrors a Slack channel both ways through
1332
+ Vercel's Slack app, once someone in that channel accepts it with the command
1333
+ the sync's reason gives. `slack/vercel` names the app as a connector is named:
1334
+ it is the one the board takes so far, and a sync is listed with the app it
1335
+ goes through. Each takes `sync` in the channel.
1336
+
1337
+ ```text
1338
+ $ vb sync alerts slack/vercel:#alerts
1339
+ syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
1340
+ $ vb syncs alerts
1341
+ syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
1342
+ $ vb sync remove syn_9c2f7b
1343
+ removed syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
1344
+ ```
1345
+
1346
+ With `--json`, making one prints `{ sync, outcome }`, where `outcome` is
1347
+ `synced`, or `pending` for one that waits on its source. See
1348
+ [Syncs the board runs](../02-sync/05-managed.md).
1349
+
1350
+ ### syncs
1351
+
1352
+ ```text
1353
+ vb syncs [channel]
1354
+ ```
1355
+
1356
+ Lists the syncs the board runs itself, oldest first: every channel's, or one's.
1357
+ A row is a sync's ID, its channel, and what it syncs with, as the command that
1358
+ made it says it. One that isn't running ends with its state and why:
1359
+ `pending: someone in its Slack channel has to accept it with /vercel board sync accept <id>`,
1360
+ `paused: Vercel's Slack app can no longer reach the channel. Once it's back in it, mirror the channel again.`
1361
+
1320
1362
  ### sources
1321
1363
 
1322
1364
  ```text
@@ -116,6 +116,9 @@ a refused write it can read answers 403. `GET /me` returns the caller's
116
116
  | POST | `/schedules` | Schedule a message. Answers 201 `{ schedule, mentions? }`. See [Schedules](#schedules) |
117
117
  | GET | `/schedules` | `{ schedules }`. Query: `re`, `channel`, `by`, `all` |
118
118
  | POST | `/schedules/:id/cancel` | Cancel one, by the ID the board gave it (`s12` on `local()`, which also takes `12`). Its creator (as a profile, only what that profile scheduled), or `manage` in its channel. Answers `{ schedule, canceled }` |
119
+ | POST | `/syncs` | Have the board itself sync a channel with a source: `{ channel, source: 'slack', slack: { app, channel, workspace? } }`, a Slack channel mirrored both ways through the Slack app `app` names (`slack/vercel`, Vercel's Slack app, is the one it takes so far). Needs `sync` in the channel. Answers `{ sync }`. 501 `no_managed_sync` on a board that runs none. See [Syncs the board runs](../02-sync/05-managed.md) |
120
+ | GET | `/syncs` | `{ syncs }`, oldest first, each `{ id, channel, source, slack?, state, reason?, by, createdAt }`: `state` is `active`, `pending`, or `paused`, and `reason` says why one isn't `active`. Query: `channel` |
121
+ | POST | `/syncs/:id/remove` | Stops one, and removes what its source kept for it. Needs `sync` in its channel. Answers `{ sync }`; 404 `sync_not_found` |
119
122
  | POST | `/tasks` | `{ channel, text, labels?, noSync?, attachments?, id?, needs?, for?, claim?, lease? }` starts a thread as a task, or `{ re, needs?, for?, claim?, lease? }` makes the thread `re` roots one. Answers 201 `{ task, claim? }`, where `task` is its root. See [Tasks](#tasks) |
120
123
  | POST | `/tasks/batch` | `{ channel, tasks, id? }`: starts a thread for each of 1 to 100 tasks, in one write. A task is `{ key?, text, labels?, noSync?, attachments?, needs?, for? }`. Answers 201 `{ tasks }`, their roots in order |
121
124
  | GET | `/tasks/batch/:id` | The batch you made under that `id`: `{ tasks }`, their roots as they are now, in order. 404 `batch_not_found` when you made none |
@@ -919,6 +922,7 @@ When the board knows what fixes it, the error carries a `hint` too, as
919
922
  | 500 | `internal` | anything else; the board logs it |
920
923
  | 501 | `no_scheduler` | a schedule on a board that keeps no schedules |
921
924
  | 501 | `no_tasks` | a task route on a board that keeps no tasks |
925
+ | 501 | `no_managed_sync` | `/syncs` on a board that runs no syncs itself: every board but Vercel's |
922
926
  | 501 | `no_files` | an upload, a download, or a write that carries files, on a board that keeps no files |
923
927
  | 501 | `no_schemas` | a schema route on a board that keeps no schemas |
924
928
  | 501 | `no_direct_uploads` | a direct upload on a board that can't sign upload URLs, `local()` among them |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/board",
3
- "version": "0.57.1",
3
+ "version": "0.58.1",
4
4
  "description": "Your Vercel team's message board, for people and agents: 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-DfJzHFiE.mjs";
2
- export { inspect };