@vercel/board 0.48.0 → 0.49.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 (84) hide show
  1. package/dist/{access-C06pIr0M.mjs → access-B8DnrnHa.mjs} +29 -17
  2. package/dist/access.d.mts +2 -2
  3. package/dist/access.mjs +5 -5
  4. package/dist/{actors-Dkyg-oo0.mjs → actors-DewJKyqy.mjs} +4 -3
  5. package/dist/{auth-B9-wXQ-x.mjs → auth-CEU06Nyp.mjs} +2 -2
  6. package/dist/{auth-li3lKwJG.d.mts → auth-Z9-Khvvw.d.mts} +1 -1
  7. package/dist/{backend-UBP6HimX.d.mts → backend-BzCXxVZ-.d.mts} +19 -5
  8. package/dist/backend-local.d.mts +1 -1
  9. package/dist/backend-local.mjs +1 -1
  10. package/dist/{bots-CLKKMgYf.mjs → bots-CqPYxkqK.mjs} +15 -8
  11. package/dist/{chat-provider-kNWd6MQC.mjs → chat-provider-BS_fr61g.mjs} +2 -2
  12. package/dist/{chat-provider-iN0DFsSE.d.mts → chat-provider-DQ1GHm4o.d.mts} +2 -2
  13. package/dist/cli-commands.d.mts +1 -1
  14. package/dist/cli-commands.mjs +1 -1
  15. package/dist/cli-embedded.d.mts +2 -2
  16. package/dist/cli-embedded.mjs +3 -3
  17. package/dist/cli.mjs +6 -6
  18. package/dist/client-C2T4eaXd.d.mts +544 -0
  19. package/dist/{commands-CJsOA-hf.d.mts → commands-Cm4sODIu.d.mts} +12 -8
  20. package/dist/{commands-Dk6_cHLS.mjs → commands-nN8WpvCe.mjs} +75 -58
  21. package/dist/{conformance-CDP8y2Zm.mjs → conformance-0xONNKcB.mjs} +102 -20
  22. package/dist/conformance.d.mts +1 -1
  23. package/dist/conformance.mjs +1 -1
  24. package/dist/{engine-B3Yd0OPc.mjs → engine-BH_nfJ3N.mjs} +10 -8
  25. package/dist/{errors-QhkdzI-o.mjs → errors-DwV7I0g4.mjs} +53 -174
  26. package/dist/{events-B-qyxNsJ.mjs → events-B76-4bNp.mjs} +2 -2
  27. package/dist/{exports-inhbjAWi.d.mts → exports-CKEK1fxf.d.mts} +4 -4
  28. package/dist/{exports-B5xOYHj_.mjs → exports-DLzyKwEp.mjs} +336 -82
  29. package/dist/{external-BuVTXT1R.mjs → external-BLI4W_-V.mjs} +1 -1
  30. package/dist/{index-B0Fnhvk7.d.mts → index-DxqSw8yd.d.mts} +2 -2
  31. package/dist/index.d.mts +6 -6
  32. package/dist/index.mjs +4 -4
  33. package/dist/index.node.d.mts +7 -7
  34. package/dist/index.node.mjs +4 -4
  35. package/dist/inspect/app.js +39 -39
  36. package/dist/inspect/engine.js +3 -3
  37. package/dist/inspect-B2ImmOvw.mjs +272 -0
  38. package/dist/inspect-DnRQUmP8.mjs +2 -0
  39. package/dist/inspect.d.mts +17 -0
  40. package/dist/inspect.mjs +196 -0
  41. package/dist/{local-CKMP4xH3.mjs → local-DPpSEq2_.mjs} +132 -50
  42. package/dist/{main-DZZQEFVl.mjs → main-CqX7JqzE.mjs} +217 -49
  43. package/dist/{memory-CMm-Fk_A.mjs → memory-DzqkXIB-.mjs} +2 -2
  44. package/dist/{middleware-CT6vMNUc.mjs → middleware-ysFm2S4v.mjs} +2 -2
  45. package/dist/{page-D-OzDOAX.mjs → page-7KWSGxyC.mjs} +12 -2
  46. package/dist/page-CN77B014.mjs +2 -0
  47. package/dist/profile-header-Cj0Cb1cf.mjs +163 -0
  48. package/dist/{provider-DC3WHUXo.d.mts → provider-Dwb_9mnu.d.mts} +3 -529
  49. package/dist/{routes-CjA6Mp4D.d.mts → routes-B6SEA9yw.d.mts} +130 -4
  50. package/dist/{routes-ABXf3CKq.mjs → routes-qS92xz8U.mjs} +33 -7
  51. package/dist/{schemas-7VFdomFB.mjs → schemas-TeVe4Udh.mjs} +4 -2
  52. package/dist/{serve-DBJTP0xd.mjs → serve-CYr4RwRM.mjs} +5 -5
  53. package/dist/{server-DmlyIzMj.mjs → server-V7qyVUiJ.mjs} +11 -9
  54. package/dist/{serving-BNdiReQT.mjs → serving-BzNxlnDV.mjs} +1 -1
  55. package/dist/{inspect-CAz9PGLf.mjs → shell-BLHZoP-x.mjs} +25 -274
  56. package/dist/{sql-IEbO5vXs.mjs → sql-DIKQd5Me.mjs} +2 -2
  57. package/dist/{sqlite-CVG8XKHm.mjs → sqlite-BF9kBDh1.mjs} +2 -2
  58. package/dist/{sqlite-db-BJjPQYx4.mjs → sqlite-db-CSYwiZ4E.mjs} +1 -1
  59. package/dist/sync-chat-sdk.d.mts +2 -2
  60. package/dist/sync-chat-sdk.mjs +2 -2
  61. package/dist/sync-github.d.mts +2 -2
  62. package/dist/sync-github.mjs +2 -2
  63. package/dist/sync-linear.d.mts +3 -3
  64. package/dist/sync-linear.mjs +2 -2
  65. package/dist/sync-slack.d.mts +3 -3
  66. package/dist/sync-slack.mjs +12 -8
  67. package/dist/sync.d.mts +2 -2
  68. package/dist/sync.mjs +2 -2
  69. package/dist/{task-batch-CmKvTLSu.mjs → task-batch-CujTLmTB.mjs} +10 -11
  70. package/dist/{tokens-BCp4EWTQ.mjs → tokens-BmCDAT4N.mjs} +2 -2
  71. package/dist/version-BCoWGLEW.mjs +5 -0
  72. package/docs/01-board/01-mounting.md +8 -0
  73. package/docs/01-board/04-messages.md +6 -2
  74. package/docs/01-board/05-reading.md +17 -2
  75. package/docs/01-board/09-access.md +40 -6
  76. package/docs/01-board/11-tasks.md +3 -3
  77. package/docs/03-guides/02-inspector.md +31 -0
  78. package/docs/04-reference/01-cli.md +81 -32
  79. package/docs/04-reference/02-board.md +14 -3
  80. package/docs/04-reference/03-http.md +5 -3
  81. package/docs/04-reference/05-conformance.md +7 -0
  82. package/package.json +5 -1
  83. package/dist/inspect-CNECs4UG.mjs +0 -2
  84. package/dist/page-Dr9Aqlej.mjs +0 -2
@@ -0,0 +1,544 @@
1
+ import { $ as MessageView, $t as TasksQueryInput, An as Actor, B as InboxEntry, C as Discovery, Dt as SchemaInput, F as GrantInput, Gt as SyncedView, I as GrantView, Jt as TaskClaim, L as GrantWriteOptions, Lt as SyncFindInput, Mn as Attachment, Mt as SourceRead, Ot as SchemaView, Q as Me, St as ScheduleView, T as EventsPage, Ut as SyncReceiptInput, V as InboxItem, Vt as SyncImportInput, Wt as SyncThreadView, X as MatchView, Zt as TasksPage, cn as UpdateGrantInput, et as MessagesPage, ft as RegisterInput, in as ThreadsQueryInput, j as FiltersInput, jn as ExternalCopy, k as Explanation, kt as SourceJoin, n as ActorView, nn as ThreadsPage, nt as MessagesQueryInput, pt as RegistrationView, s as BoardEventView, tn as ThreadView, u as ChannelView, wt as SchedulesQueryInput, zt as SyncFindView } from "./routes-B6SEA9yw.mjs";
2
+ //#region src/contract/mentions.d.ts
3
+ /** An actor as a write's answer names them. */
4
+ type MentionedActor = {
5
+ id: string;
6
+ handle: string;
7
+ name: string;
8
+ };
9
+ /**
10
+ * What became of an `@handle` a write typed. With `actor`, it named that one actor and the text now
11
+ * has `@[actor-id]` in its place. With `actor: null`, it's still in the text as typed, a mention of
12
+ * no one: `candidates` is who it could have meant, the several who have that handle, or for a handle
13
+ * with no `/`, whoever has it under a name (`support/malte` for `@malte`).
14
+ */
15
+ type Mentioned = {
16
+ written: string;
17
+ actor: MentionedActor | null;
18
+ candidates: MentionedActor[];
19
+ };
20
+ //#endregion
21
+ //#region src/client/client.d.ts
22
+ /**
23
+ * Where an error came from: `handle`, raised by the handle on this machine (no Vercel login,
24
+ * Deployment Protection), or `board`, a board's answer, whose words are its own whatever code it
25
+ * names.
26
+ */
27
+ type ErrorOrigin = 'handle' | 'board';
28
+ /**
29
+ * What went wrong: `message` says what and why, `code` is what to branch on, `hint`, when there's
30
+ * one, what fixes it, and `origin` who said so. Trust a `board` one's message and hint as you would
31
+ * the board.
32
+ */
33
+ declare class BoardError extends Error {
34
+ readonly code: string;
35
+ readonly status: number;
36
+ readonly hint: string | undefined;
37
+ readonly origin: ErrorOrigin;
38
+ /** For a 429, how many seconds the board asked to wait before sending again (its `Retry-After`), when it said. */
39
+ readonly retryAfter: number | undefined;
40
+ constructor(code: string, message: string, status: number, options?: {
41
+ hint?: string;
42
+ origin?: ErrorOrigin;
43
+ retryAfter?: number;
44
+ });
45
+ }
46
+ type Resolvable<T> = T | (() => T | Promise<T>);
47
+ /** A profile name, `{ name, avatar }`, or null for no profile. */
48
+ type ProfileOption = string | {
49
+ name: string;
50
+ avatar?: string;
51
+ } | null;
52
+ type ClientOptions = {
53
+ /** The board's URL, e.g. `https://www.example.com/api/board`. */
54
+ url: string;
55
+ /** An OIDC token whose audience is the board's URL, or a function returning one. Without one, `fetch` brings the credentials. */
56
+ token?: Resolvable<string>;
57
+ profile?: Resolvable<ProfileOption>;
58
+ /** Extra headers on every request. */
59
+ headers?: Resolvable<Record<string, string>>;
60
+ fetch?: typeof fetch;
61
+ /**
62
+ * How a direct upload's bytes go to the blob store's signed URL: `fetch` by default, never the
63
+ * board's own, which brings the board's credentials and would hand them to the store.
64
+ */
65
+ storeFetch?: typeof fetch;
66
+ };
67
+ /**
68
+ * What a write that took a text answers: what it made, and under `mentions`, what became of each
69
+ * `@handle` the text typed, when it typed any.
70
+ */
71
+ type Written<T> = T & {
72
+ mentions?: Mentioned[];
73
+ };
74
+ type PostOptions = {
75
+ text: string;
76
+ labels?: Record<string, string>;
77
+ /** Keep this message on the board: no configured sync targets. */
78
+ noSync?: boolean;
79
+ /** External targets the new thread starts with: `slack:#incidents` starts one, `github:owner/repo:12` joins one. */
80
+ sync?: string[];
81
+ /** Makes retries idempotent: the same id never posts twice. */
82
+ id?: string;
83
+ /** Files from `upload`, or their IDs. */
84
+ attachments?: (Attachment | string)[];
85
+ };
86
+ type ReplyOptions = Omit<PostOptions, 'sync'> & {
87
+ /**
88
+ * Posts only while this is the thread's newest message: the ID of the last one you read. If
89
+ * another has come after it, nothing is posted, and it throws a 409 `newer_message`.
90
+ */
91
+ after?: string;
92
+ };
93
+ /**
94
+ * When a scheduled message goes out: once `in` a while or `at` a time, or
95
+ * `every` so often (first at `at`, `in`, or one `every` from now), stopping
96
+ * `until` a time, `for` a while after the first send, or after `times` sends.
97
+ * A repeat with no stop runs until it's canceled.
98
+ */
99
+ type ScheduleTiming = {
100
+ in?: string;
101
+ at?: Date | string;
102
+ every?: string;
103
+ until?: Date | string;
104
+ for?: string;
105
+ times?: number;
106
+ };
107
+ type ScheduleOptions = Omit<PostOptions, 'sync' | 'id'> & ScheduleTiming;
108
+ /**
109
+ * What makes a thread a task: the tasks it waits for (`needs`, by their IDs), the one actor of
110
+ * yours that claims it (`for`, `<your principal>+<profile>`), and `claim`, which claims it in the
111
+ * same write, for `lease` seconds.
112
+ */
113
+ type TaskOptions = {
114
+ needs?: string[];
115
+ for?: string | null;
116
+ claim?: boolean;
117
+ lease?: number;
118
+ };
119
+ /** A new thread that's a task: its root's text, labels, `noSync`, `attachments`, and `id`, as a post takes them, and what makes it a task. */
120
+ type NewTaskOptions = TaskOptions & Pick<PostOptions, 'text' | 'labels' | 'noSync' | 'attachments' | 'id'>;
121
+ /**
122
+ * One task of several made together: its root's text, labels, `noSync`, and `attachments`, as a
123
+ * post takes them. `key` is a name for it among the others, and `needs` takes a task's ID, or
124
+ * `{ key }` for one made with it, before or after it. `for` is the one actor of yours that claims it.
125
+ */
126
+ type TaskInBatch = Required<Pick<PostOptions, 'text'>> & Pick<PostOptions, 'labels' | 'noSync' | 'attachments'> & {
127
+ key?: string;
128
+ needs?: (string | {
129
+ key: string;
130
+ })[];
131
+ for?: string | null;
132
+ };
133
+ /**
134
+ * What a claim does, each fenced by the claim: once it's over (released, settled, held, taken over,
135
+ * or past its lease), they throw a 409 `claim_lost` and change nothing.
136
+ */
137
+ type HeldTask = {
138
+ /** Extends the lease from now, by `lease` seconds (the board's default without one). Answers the claim with its new `until`. */
139
+ renew(lease?: number): Promise<ClaimedTask>;
140
+ /** Gives the task back: it's ready again. */
141
+ release(): Promise<MessageView>;
142
+ complete(result?: string): Promise<MessageView>;
143
+ fail(reason: string): Promise<MessageView>;
144
+ /** Holds the task for a person, which ends the claim: `kind` says what for (`needs_input`, `awaiting_approval`). */
145
+ block(reason: string, opts?: {
146
+ kind?: string;
147
+ }): Promise<MessageView>;
148
+ };
149
+ /**
150
+ * A task you hold until `until`: its root as the claim left it, and the claim's `epoch` and
151
+ * `token`, which `held` takes to act on it from another process.
152
+ */
153
+ type ClaimedTask = HeldTask & TaskClaim & {
154
+ task: MessageView;
155
+ };
156
+ /** What `upload` takes: the bytes, and what to call them. */
157
+ type UploadInput = {
158
+ data: Blob | Uint8Array<ArrayBuffer>;
159
+ name: string;
160
+ /** A MIME type; a `Blob`'s own type, or one from the name's extension, otherwise. */
161
+ type?: string;
162
+ };
163
+ /** Whether live events are flowing: `live` once the board has answered a request for them, `retrying` once one failed and it's backing off. */
164
+ type EventsState = 'live' | 'retrying';
165
+ /**
166
+ * What following events takes: a `signal` that stops it, and `onState`, told each time the feed
167
+ * goes live or starts retrying. It hears nothing before the first answer or failure.
168
+ */
169
+ type EventsOptions = {
170
+ signal?: AbortSignal;
171
+ onState?: (state: EventsState) => void;
172
+ };
173
+ type WaitOptions = {
174
+ /** `'30s'`, `'10m'`, `'1h'`, or milliseconds. Default `'30m'`. */
175
+ timeout?: string | number;
176
+ signal?: AbortSignal;
177
+ };
178
+ declare function duration(value: string | number): number;
179
+ type Filters = Omit<FiltersInput, 'label'> & {
180
+ /** `{ status: 'open' }` or `['status=open']`. */
181
+ label?: Record<string, string> | string[];
182
+ };
183
+ type BoardClient = ReturnType<typeof createBoardClient>;
184
+ /** Whom `explain` asks about: nobody for yourself, or one principal as people name it. */
185
+ type ExplainPrincipal = {
186
+ user?: string;
187
+ project?: string;
188
+ /** Where the project's deployment runs: production when left out. */
189
+ environment?: string;
190
+ github?: string;
191
+ workflow?: string;
192
+ branch?: string;
193
+ event?: string;
194
+ oidc?: string;
195
+ claims?: Record<string, string>;
196
+ /** An app on the team, by its slug or client ID. */
197
+ app?: string;
198
+ };
199
+ declare function createBoardClient(options: ClientOptions): {
200
+ url: string;
201
+ /**
202
+ * The board's HTTP API with this client's credentials, and the response as
203
+ * the board sent it, errors included: for proxies like `vb inspect`.
204
+ */
205
+ request: (path: string, init?: {
206
+ method?: string;
207
+ body?: Uint8Array<ArrayBuffer>;
208
+ headers?: Record<string, string>;
209
+ signal?: AbortSignal;
210
+ /** Act as this profile (`null` for yourself) instead of the client's. */
211
+ as?: ProfileOption;
212
+ }) => Promise<Response>;
213
+ discovery: () => Promise<Discovery>;
214
+ me: () => Promise<Me>;
215
+ channels: () => Promise<ChannelView[]>;
216
+ /**
217
+ * Makes a channel before anything posts to it, as a first post would. Needs `read` and `post`
218
+ * there. `created` is false when it was there already; it's left as it is.
219
+ *
220
+ * `private` makes it closed to everyone but you, from the protocol's own methods: a grant
221
+ * letting you in at `<path>/`, then one closing `<path>/` to everyone else, then the channel,
222
+ * answering the two grants as `grants`. A failure part way leaves the channel open with a grant
223
+ * too many, or closed and not made yet, and never shuts you out. Before it writes anything, it
224
+ * refuses a caller that's neither a person nor a project's deployment (400 `no_own_principal`),
225
+ * one that can't list grants, a path a grant other than `*`'s reaches already (409
226
+ * `channel_granted`: the channel, `<path>/`, or a pattern under it, whose grants would still let
227
+ * in whoever they name), and a path where it or a channel under it is there already (409
228
+ * `channel_exists`), since closing `security/` closes `security/incidents` too. A board that
229
+ * keeps no grants fails on the listing, with nothing made. Once its own grant is made it lists
230
+ * them again, and takes its own back when another reaches the path, so of two callers making
231
+ * the same channel at once, at most one keeps a way in; and once the lock is made, it lists them
232
+ * a last time, and takes both back when a grant made in between still reaches the path, or its
233
+ * own two aren't as it made them (someone added themselves to its grant, or opened the lock).
234
+ */
235
+ createChannel: (path: string, options?: {
236
+ private?: boolean;
237
+ }) => Promise<{
238
+ channel: ChannelView;
239
+ created: boolean;
240
+ grants?: GrantView[];
241
+ }>;
242
+ actors: () => Promise<(Actor & Pick<ActorView, "verified">)[]>;
243
+ messages: (query?: Filters & Omit<MessagesQueryInput, keyof FiltersInput>) => Promise<MessagesPage>;
244
+ thread: (id: string) => Promise<ThreadView>;
245
+ /** Your own post with the client ID you gave it, as posting it answered: 404 `post_not_found` when there's none. */
246
+ posted: (id: string) => Promise<MessageView>;
247
+ /** Threads with a matching message, one summary each (root, reply count, latest reply), by latest activity. `limit` counts threads; `before` takes a page's `older`. */
248
+ threads: (query?: Filters & Omit<ThreadsQueryInput, keyof FiltersInput>) => Promise<ThreadsPage>;
249
+ /**
250
+ * Starts a thread. An `@handle` in the text that names exactly one actor you can see is stored as
251
+ * `@[actor-id]`, a mention of them; one that names none or several stays as typed, a mention of
252
+ * no one. `mentions` on what comes back says what became of each, when the text typed any.
253
+ */
254
+ post(channel: string, input: string | PostOptions): Promise<Written<MessageView>>;
255
+ /** Replies in a thread. Its `@handle`s are settled as `post`'s are: of several who share one, it's the one who wrote in the thread. */
256
+ reply(id: string, input: string | ReplyOptions): Promise<Written<MessageView>>;
257
+ /**
258
+ * Posts later, as you: a new thread when `target` is a channel, a reply when it's
259
+ * `{ re }`, any message's ID in the thread. Each message it posts carries
260
+ * `schedule: { id, n }`. Needs a board with a scheduler.
261
+ */
262
+ schedule(target: string | {
263
+ re: string;
264
+ }, input: ScheduleOptions): Promise<Written<ScheduleView>>;
265
+ /** Pending schedules (`all` for done and canceled too), oldest first. `re` is any message in a thread. */
266
+ schedules: (query?: Omit<SchedulesQueryInput, 'all'> & {
267
+ all?: boolean;
268
+ }) => Promise<ScheduleView[]>;
269
+ /** Stops a schedule: yours, or any with manage in its channel. `canceled` is false when it was already done or canceled. */
270
+ cancelSchedule: (id: string) => Promise<{
271
+ schedule: ScheduleView;
272
+ canceled: boolean;
273
+ }>;
274
+ /**
275
+ * Tasks: threads someone's agents are to do, with a state the board keeps. A task's ID is its
276
+ * root's, and its root's `task` says its state, whose it is, what it waits for, and who holds
277
+ * it. A board that keeps no tasks fails each of these with 501 `no_tasks`.
278
+ */
279
+ tasks: {
280
+ /**
281
+ * Tasks, oldest first, each as its thread's summary: open ones (`waiting`, `ready`, `claimed`,
282
+ * `blocked`) unless `state` says `all` or names one. `owner` and `for` take a handle or an ID,
283
+ * `needs` a task's ID, for the tasks that wait for it. `cursor`, as `after`, reads the next page.
284
+ */
285
+ list: (query?: Omit<TasksQueryInput, 'label'> & {
286
+ label?: Record<string, string> | string[];
287
+ }) => Promise<TasksPage>;
288
+ create: {
289
+ (target: string, input: string | NewTaskOptions): Promise<{
290
+ task: MessageView;
291
+ claim?: ClaimedTask;
292
+ mentions?: Mentioned[];
293
+ }>;
294
+ (target: {
295
+ re: string;
296
+ }, input?: TaskOptions): Promise<{
297
+ task: MessageView;
298
+ claim?: ClaimedTask;
299
+ mentions?: Mentioned[];
300
+ }>;
301
+ };
302
+ createMany: (channel: string, tasks: TaskInBatch[], opts?: {
303
+ id?: string;
304
+ }) => Promise<MessageView[]>;
305
+ claim: {
306
+ (target: string, opts?: {
307
+ lease?: number;
308
+ signal?: AbortSignal;
309
+ }): Promise<ClaimedTask>;
310
+ (target: {
311
+ channel: string;
312
+ label?: Record<string, string>;
313
+ from?: string[];
314
+ wait?: number;
315
+ lease?: number;
316
+ }, opts?: {
317
+ signal?: AbortSignal;
318
+ }): Promise<ClaimedTask | null>;
319
+ };
320
+ /** What a claim you hold does, from the `epoch` and `token` it answered: for a process that kept them, as `vb` does between commands. */
321
+ held: (id: string, proof: {
322
+ epoch: number;
323
+ token: string;
324
+ }) => HeldTask;
325
+ /** Holds a task no one has claimed for a person: yours, or any with manage in its channel. A claimed one's hold is its claim's (`claim.block`). */
326
+ block: (id: string, reason: string, opts?: {
327
+ kind?: string;
328
+ }) => Promise<MessageView>;
329
+ /** Lifts a hold: the task is ready again, or waiting while a task it needs hasn't completed. */
330
+ unblock: (id: string) => Promise<MessageView>;
331
+ /** Makes a failed task ready again, in place: what waits for it still does. */
332
+ reopen: (id: string) => Promise<MessageView>;
333
+ /** Assigns a task to one of its owner's actors (`<owner>+<profile>`), the only one that claims it then, or with null to anyone who may. */
334
+ assign: (id: string, actor: string | null) => Promise<MessageView>;
335
+ /**
336
+ * Replaces what a task waits for, by their IDs: it waits for those now, and is ready once they've all completed, or
337
+ * at once with none. For its owner, while no one holds it and it isn't finished. One that would make it wait for
338
+ * itself, through however many tasks, throws a 400 `invalid_needs`.
339
+ */
340
+ needs: (id: string, needs: string[]) => Promise<MessageView>;
341
+ /** Cancels a task that hasn't completed, ending any claim. What waits for it keeps waiting. */
342
+ cancel: (id: string, reason: string) => Promise<MessageView>;
343
+ };
344
+ /**
345
+ * A new grant: `principals` may do what `can` says, a map from channel pattern to permissions
346
+ * (`[]` for none). The same principals again are another grant. At each channel, the most
347
+ * specific pattern among the grants that name a caller decides, then the closest principal,
348
+ * and grants tied there add up. Needs manage at each pattern `can` names.
349
+ *
350
+ * One you couldn't take back, since it takes your own manage at a pattern it names (closing
351
+ * `security/` to `everyone` closes it to you), is 409 `grant_lockout`: keep yourself in with
352
+ * `createGrants`, or pass `lockMeOut` to make it anyway. Every grant write takes it.
353
+ */
354
+ createGrant: (input: GrantInput, options?: GrantWriteOptions) => Promise<{
355
+ grant: GrantView;
356
+ }>;
357
+ /**
358
+ * Several grants in one write, all of them or none, judged together: each needs what
359
+ * `createGrant` does on the grants as they are, and what they leave you with is judged with
360
+ * all of them made. So a lock and the grant that keeps you in go together, in any order.
361
+ */
362
+ createGrants: (inputs: readonly GrantInput[], options?: GrantWriteOptions) => Promise<{
363
+ grants: GrantView[];
364
+ }>;
365
+ /** Adds and removes principals (by who they are, environments aside), or replaces its `can`. Needs what `checkGrantChange` says, for the grant as it was and as it'd be. */
366
+ updateGrant: (id: string, { add, remove, can }: UpdateGrantInput, options?: GrantWriteOptions) => Promise<{
367
+ grant: GrantView;
368
+ }>;
369
+ /**
370
+ * Which grants decide `channel`, and what they give: for you, or with manage at `*`, for the
371
+ * principal `principal` names (`{ user }`, `{ project, environment }`, `{ github, workflow,
372
+ * branch, event }`, or `{ oidc, claims }`).
373
+ */
374
+ explain: (channel: string, principal?: ExplainPrincipal) => Promise<Explanation>;
375
+ /** The board's grants. Needs manage at `*`, or a team owner. */
376
+ grants: () => Promise<GrantView[]>;
377
+ /** `revoked` is false when it was already gone. Its principals' next requests are refused. */
378
+ revokeGrant: (id: string, options?: GrantWriteOptions) => Promise<{
379
+ revoked: boolean;
380
+ }>;
381
+ /** Every schema: the built-ins, then the board's own, by name and version. */
382
+ schemas: () => Promise<SchemaView[]>;
383
+ /** One schema version, by its ID: `sandbox@1`. */
384
+ schema: (id: string) => Promise<SchemaView>;
385
+ /**
386
+ * Registers a schema version, for good: `schema` is a JSON Schema for an object, in structural
387
+ * keywords only. Needs manage at `*`. `created` is false for one that's there with the same
388
+ * definition; another definition is refused, since a version never changes.
389
+ */
390
+ createSchema: (input: SchemaInput) => Promise<{
391
+ schema: SchemaView;
392
+ created: boolean;
393
+ }>;
394
+ /**
395
+ * Stores a file on the board, for a post or reply's `attachments`. Up to 4 MB goes in one
396
+ * request; bigger, up to 100 MB, goes straight to the board's blob store on a URL the board
397
+ * signs, where its store can (`no_direct_uploads` where it can't).
398
+ */
399
+ upload(input: UploadInput): Promise<Attachment>;
400
+ /** An attachment's bytes, as the board serves them: `content-type` is the file's type. */
401
+ download: (id: string, opts?: {
402
+ signal?: AbortSignal;
403
+ }) => Promise<Response>;
404
+ /**
405
+ * `revision` is the message's as you read it: if it's been edited or deleted since, nothing
406
+ * changes, and it throws a 409 `revision_conflict`.
407
+ */
408
+ edit: (id: string, text: string, opts?: {
409
+ revision?: number;
410
+ }) => Promise<{
411
+ ok: true;
412
+ mentions?: Mentioned[];
413
+ }>;
414
+ delete: (id: string, opts?: {
415
+ revision?: number;
416
+ }) => Promise<{
417
+ ok: true;
418
+ }>;
419
+ /** `emoji` is a short name, `:name:`, or the character itself. */
420
+ react: (id: string, emoji: string, opts?: {
421
+ remove?: boolean;
422
+ }) => Promise<{
423
+ ok: true;
424
+ }>;
425
+ /**
426
+ * `if` is what the labels must be now, a value or null for one that mustn't be set: if one
427
+ * isn't, nothing changes, and it throws a 409 `label_conflict`.
428
+ */
429
+ label: (id: string, change: {
430
+ set?: Record<string, string>;
431
+ unset?: string[];
432
+ if?: Record<string, string | null>;
433
+ }) => Promise<{
434
+ ok: true;
435
+ }>;
436
+ /**
437
+ * Shows typing in the platform threads the message's thread is synced to.
438
+ * Ephemeral: nothing goes in the log. Answers the external threads that took it.
439
+ * `status` replaces "Typing…" on Slack ("running tests…").
440
+ */
441
+ typing: (id: string, status?: string) => Promise<string[]>;
442
+ /**
443
+ * With a target, attaches the message's thread to it, backfilling it: attaching twice is a no-op.
444
+ * Without one, where the thread is synced, and this message's copy on each target, with its link.
445
+ */
446
+ sync: {
447
+ (id: string): Promise<SyncedView>;
448
+ (id: string, target: string): Promise<{
449
+ target: string;
450
+ attached: boolean;
451
+ }>;
452
+ };
453
+ /**
454
+ * The thread of the board message a platform link names (a Slack permalink, a GitHub comment's
455
+ * URL), from what the board synced: the platform is never asked. 404 for one it didn't sync.
456
+ */
457
+ linked: (url: string) => Promise<ThreadView>;
458
+ /** Raw platform events for a sync entry, newest first. */
459
+ inbox: (key: string, opts?: {
460
+ channel?: string;
461
+ limit?: number;
462
+ }) => Promise<InboxEntry[]>;
463
+ /** Registers the caller's watchers, replacing its last registration: what a board on `http()` does. */
464
+ register: (input: RegisterInput) => Promise<RegistrationView>;
465
+ /** Registered watchers: every one to `manage` everywhere, the caller's own to anyone else. */
466
+ watchers: () => Promise<RegistrationView[]>;
467
+ /** The caller's matches it can run now, each leased to it until it acks. `wait` holds the request up to that many seconds for one. */
468
+ matches: (opts?: {
469
+ limit?: number;
470
+ wait?: number;
471
+ signal?: AbortSignal;
472
+ }) => Promise<MatchView[]>;
473
+ /** How a pulled match went: done, an error to try again, or `skip` to drop it. */
474
+ ack: (id: string, body: {
475
+ lease: string;
476
+ error?: string;
477
+ skip?: boolean;
478
+ }) => Promise<{
479
+ ok: true;
480
+ }>;
481
+ /**
482
+ * Reads a platform channel (`#name`, an ID), thread (`C0123:1727000000.123456`),
483
+ * or message permalink on demand, without syncing or storing it. Full access only.
484
+ */
485
+ readSource: (key: string, target: string, opts?: {
486
+ limit?: number;
487
+ after?: string;
488
+ }) => Promise<SourceRead>;
489
+ /** Adds the app to a public channel so `readSource` can read it, where the sync opted in with `join`. Full access only. */
490
+ joinSource: (key: string, target: string) => Promise<SourceJoin>;
491
+ poll: (query?: Filters & {
492
+ after?: string;
493
+ wait?: number;
494
+ all?: boolean;
495
+ }, signal?: AbortSignal) => Promise<EventsPage>;
496
+ /** A platform's write, as its platform author: idempotent per platform event for a post, found from its origin otherwise. */
497
+ syncImport: (body: SyncImportInput) => Promise<{
498
+ message: string | null;
499
+ dropped?: string[];
500
+ }>;
501
+ /** What sync did on a platform: a delivery, its files, a failure, or a thread's new target. */
502
+ syncReceipt: (body: SyncReceiptInput) => Promise<{
503
+ ok: true;
504
+ attached?: boolean;
505
+ }>;
506
+ /** A board thread's sync, by its key. */
507
+ syncThread: (thread: string) => Promise<SyncThreadView>;
508
+ /** What platform IDs are on the board: a thread, or a message. */
509
+ syncFind: (query: SyncFindInput, opts?: {
510
+ signal?: AbortSignal;
511
+ }) => Promise<SyncFindView>;
512
+ /** Messages' copies on platforms, by message and target. */
513
+ syncCopies: (messages: string[]) => Promise<Record<string, Record<string, ExternalCopy>>>;
514
+ /** Pushes platform events into your inbox for sync key `key`; each platform ID lands once. */
515
+ inboxPush: (key: string, events: {
516
+ id: string;
517
+ event: InboxItem['event'];
518
+ raw: unknown;
519
+ }[]) => Promise<{
520
+ ok: true;
521
+ }>;
522
+ /** Your next inbox events for `key`, leased to you until you ack them, one platform thread at a time. */
523
+ inboxNext: (key: string, opts?: {
524
+ limit?: number;
525
+ }) => Promise<InboxItem[]>;
526
+ /** How an inbox event went: done, or an error to try it again. */
527
+ inboxAck: (key: string, id: string, body: {
528
+ lease: string;
529
+ error?: string;
530
+ }) => Promise<{
531
+ ok: true;
532
+ }>;
533
+ /** Live events. Reconnects from the last seen index whenever the stream closes, and tells `onState` whether it's live or retrying. */
534
+ events(query?: Filters & {
535
+ after?: string;
536
+ all?: boolean;
537
+ }, opts?: EventsOptions): AsyncGenerator<BoardEventView>;
538
+ /** The next matching event after `after` (default: now), or null on timeout. */
539
+ wait(query?: Filters & {
540
+ after?: string;
541
+ }, opts?: WaitOptions): Promise<BoardEventView | null>;
542
+ };
543
+ //#endregion
544
+ export { MentionedActor as C, Mentioned as S, TaskOptions as _, EventsOptions as a, Written as b, Filters as c, PostOptions as d, ProfileOption as f, TaskInBatch as g, ScheduleTiming as h, ErrorOrigin as i, HeldTask as l, ScheduleOptions as m, BoardError as n, EventsState as o, ReplyOptions as p, ClaimedTask as r, ExplainPrincipal as s, BoardClient as t, NewTaskOptions as u, UploadInput as v, duration as x, WaitOptions as y };
@@ -162,17 +162,17 @@ declare const options: {
162
162
  readonly type: 'string';
163
163
  readonly multiple: true;
164
164
  readonly value: 'file';
165
- readonly description: 'attach a file, up to 10 per message';
165
+ readonly description: 'attach a file: up to 10 per message, each up to 100 MB (4 MB on some boards)';
166
166
  };
167
- readonly 'text-file': {
167
+ readonly file: {
168
168
  readonly type: 'string';
169
169
  readonly value: 'path';
170
- readonly description: 'the text, from a file: - reads stdin';
170
+ readonly description: 'from a file: - reads stdin';
171
171
  };
172
- readonly 'tasks-file': {
172
+ readonly data: {
173
173
  readonly type: 'string';
174
- readonly value: 'path';
175
- readonly description: 'several tasks, from a JSON file: - reads stdin';
174
+ readonly value: 'json';
175
+ readonly description: 'as JSON, written inline';
176
176
  };
177
177
  readonly unset: {
178
178
  readonly type: 'string';
@@ -269,6 +269,10 @@ declare const options: {
269
269
  readonly value: 'pattern=perms';
270
270
  readonly description: 'what they may do, repeated: perms, all, or none';
271
271
  };
272
+ readonly 'lock-me-out': {
273
+ readonly type: 'boolean';
274
+ readonly description: "go ahead with a change you couldn't take back";
275
+ };
272
276
  readonly user: {
273
277
  readonly type: 'string';
274
278
  readonly multiple: true;
@@ -445,8 +449,8 @@ declare const options: {
445
449
  };
446
450
  readonly schema: {
447
451
  readonly type: 'string';
448
- readonly value: 'json|@file';
449
- readonly description: 'its JSON Schema: inline, @<file>, or - for stdin';
452
+ readonly value: 'schema';
453
+ readonly description: 'the text is JSON for this schema, such as sandbox@1';
450
454
  };
451
455
  readonly description: {
452
456
  readonly type: 'string';