@vercel/board 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{access-3udXjJAg.mjs → access-Crbvd2Dm.mjs} +2 -2
- package/dist/access.d.mts +2 -2
- package/dist/access.mjs +5 -5
- package/dist/{actors-DasGZnfb.mjs → actors-BBphaJ_G.mjs} +3 -3
- package/dist/{auth-aiOVE82-.mjs → auth-C-pFnJBA.mjs} +2 -2
- package/dist/{auth-BG_whr9_.d.mts → auth-CkNXnQno.d.mts} +1 -1
- package/dist/{backend-D6yTo8Un.d.mts → backend-D3p8gjba.d.mts} +126 -4
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-BvNqOQFL.mjs → chat-provider-1zpY6Qo_.mjs} +2 -2
- package/dist/{chat-provider-V2jnjVLq.d.mts → chat-provider-Bn33acHd.d.mts} +2 -2
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +2 -2
- package/dist/cli-embedded.mjs +3 -2
- package/dist/cli.mjs +6 -6
- package/dist/{commands-DewS14_P.d.mts → commands-CSZPQ38I.d.mts} +54 -0
- package/dist/{commands-CqdnjUkm.mjs → commands-D0lyo8O8.mjs} +319 -0
- package/dist/{conformance-BInS4_6b.mjs → conformance-Blzd4CXG.mjs} +972 -6
- package/dist/conformance.d.mts +6 -5
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-XVBt02Bl.mjs → engine-C_SlBihU.mjs} +15 -7
- package/dist/{errors-ZazTZh-s.mjs → errors-DZ1tbwSM.mjs} +151 -3
- package/dist/{events-D17RndlV.mjs → events-mGuhF4i5.mjs} +2 -2
- package/dist/{exports-DCf75prP.mjs → exports-DQauuHrc.mjs} +1248 -45
- package/dist/exports-DUX_Yzo7.d.mts +44 -0
- package/dist/{external-DfhN7lKK.mjs → external-BVr1Sq0y.mjs} +1 -1
- package/dist/{index-Djmr4GzQ.d.mts → index-BHXg4Xdo.d.mts} +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +5 -5
- package/dist/index.node.d.mts +7 -6
- package/dist/index.node.mjs +5 -4
- package/dist/inspect/app.js +215 -115
- package/dist/inspect/engine.js +5 -5
- package/dist/{inspect-B0_aKQM8.mjs → inspect-2OIjv2lW.mjs} +242 -20
- package/dist/inspect-F-b4GPXX.mjs +2 -0
- package/dist/{local-Bel_oeFa.mjs → local-11FMUJrU.mjs} +1593 -60
- package/dist/{main-DmsdcUZ_.mjs → main-BYmbTDgo.mjs} +1167 -24
- package/dist/{memory-DyEL0fvN.mjs → memory-CZBdVNn8.mjs} +2 -2
- package/dist/{middleware-BHHKHA9q.mjs → middleware-BKsTcMAv.mjs} +2 -2
- package/dist/{provider-BC9mPYVh.d.mts → provider-D3bfHRHA.d.mts} +119 -3
- package/dist/{routes-CkUetTO2.mjs → routes-B2HHHD_C.mjs} +246 -6
- package/dist/{routes-zm4TXKCC.d.mts → routes-NEc6w3QC.d.mts} +540 -6
- package/dist/{schemas-BhZaystC.mjs → schemas-7VFdomFB.mjs} +34 -1
- package/dist/{serve-bPSEx_8X.mjs → serve-DS2T2iWI.mjs} +4 -4
- package/dist/{server-CcvxkXzG.mjs → server-Ch3tuK2k.mjs} +10 -10
- package/dist/{serving-BLVRrJ7P.mjs → serving-9riPNrHk.mjs} +1 -1
- package/dist/{sql-CyVcjw8x.mjs → sql-Bml29DpM.mjs} +174 -9
- package/dist/{sqlite-Con-8duk.mjs → sqlite-4C5u7-ag.mjs} +2 -2
- package/dist/{sqlite-db-BdzxtUOV.mjs → sqlite-db-eVb9v3zc.mjs} +1 -1
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-chat-sdk.mjs +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-github.mjs +2 -2
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-linear.mjs +2 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync-slack.mjs +4 -4
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{origin-BHmEdok7.mjs → task-batch-BJcLiYe1.mjs} +83 -8
- package/dist/{tokens-BErYXuHZ.mjs → tokens-DPKF_cb5.mjs} +2 -2
- package/docs/01-board/01-mounting.md +3 -3
- package/docs/01-board/07-schedules.md +2 -2
- package/docs/01-board/08-middleware.md +7 -0
- package/docs/01-board/11-tasks.md +348 -0
- package/docs/03-guides/02-inspector.md +66 -9
- package/docs/03-guides/06-sandboxed-agents.md +5 -3
- package/docs/03-guides/07-build-a-ui.md +210 -0
- package/docs/04-reference/01-cli.md +216 -8
- package/docs/04-reference/02-board.md +277 -2
- package/docs/04-reference/03-http.md +185 -11
- package/docs/04-reference/05-conformance.md +10 -7
- package/package.json +1 -1
- package/dist/exports-Gspe1eEq.d.mts +0 -4
- package/dist/inspect-CULoD54F.mjs +0 -2
|
@@ -6,6 +6,12 @@ const CHANNEL_PATTERN_MAX = 2049;
|
|
|
6
6
|
const MESSAGE_TEXT_MAX = 1e4;
|
|
7
7
|
/** The longest `x-board-can` header the board reads; a schedule keeps its creator's. */
|
|
8
8
|
const CAN_MAX = 4e3;
|
|
9
|
+
/** The label namespace the board writes itself: `board.task`, a task's state. No caller's write sets or unsets a key under it. */
|
|
10
|
+
const RESERVED_LABEL_PREFIX = "board.";
|
|
11
|
+
/** The label a task's root wears, with its state as the value. */
|
|
12
|
+
const TASK_LABEL = "board.task";
|
|
13
|
+
/** The longest result or reason a task keeps: a line or two, with the detail in its thread. */
|
|
14
|
+
const TASK_NOTE_MAX = 1e3;
|
|
9
15
|
const segment = "[a-z0-9][a-z0-9_-]*";
|
|
10
16
|
/** `errors-www`, `www/production`: lowercase segments joined by `/`. */
|
|
11
17
|
const ChannelPath = z.string().max(CHANNEL_PATH_MAX).regex(new RegExp(`^${segment}(?:/${segment})*$`), "invalid channel path");
|
|
@@ -77,7 +83,34 @@ const Attachment = z.object({
|
|
|
77
83
|
type: z.string().min(1).max(255),
|
|
78
84
|
size: z.number().int().nonnegative()
|
|
79
85
|
});
|
|
86
|
+
/** What a task is doing: its root's `board.task` label. */
|
|
87
|
+
const TaskState = z.enum([
|
|
88
|
+
"waiting",
|
|
89
|
+
"ready",
|
|
90
|
+
"claimed",
|
|
91
|
+
"blocked",
|
|
92
|
+
"completed",
|
|
93
|
+
"failed",
|
|
94
|
+
"canceled"
|
|
95
|
+
]);
|
|
96
|
+
/** The states a task can still leave by being worked: `GET /tasks` lists these by default. */
|
|
97
|
+
const OPEN_TASK_STATES = [
|
|
98
|
+
"waiting",
|
|
99
|
+
"ready",
|
|
100
|
+
"claimed",
|
|
101
|
+
"blocked"
|
|
102
|
+
];
|
|
103
|
+
/** A task's result or reason: a line or two. */
|
|
104
|
+
const TaskNote = z.string().max(TASK_NOTE_MAX).refine((text) => text.trim().length > 0, "it is empty").refine(storable, "it has a NUL character or a lone surrogate");
|
|
105
|
+
/** A task's result or reason as a request sends it: its length is the backend's to judge. */
|
|
106
|
+
const SentTaskNote = z.string().refine((text) => text.trim().length > 0, "it is empty").refine(storable, "it has a NUL character or a lone surrogate");
|
|
107
|
+
/** A hold's kind as a request sends it: its length is the backend's to judge. */
|
|
108
|
+
const SentTaskHoldKind = z.string().regex(/^[a-z0-9][a-z0-9_.-]*$/, "a kind is lowercase letters, numbers, and _.-");
|
|
109
|
+
/** Why a task is held, as whoever held it names it: `needs_input`, `awaiting_approval`. `edited` is the board's own. */
|
|
110
|
+
/** The kind of the hold the board places itself, when someone who doesn't own a task edits its root: no request holds a task as it. */
|
|
111
|
+
const EDITED_HOLD = "edited";
|
|
112
|
+
const TaskHoldKind = z.string().regex(/^[a-z0-9][a-z0-9_.-]{0,63}$/, "a kind is up to 64 lowercase letters, numbers, and _.-");
|
|
80
113
|
/** A registered watcher's ID: a profile name, since its writes are by that profile. */
|
|
81
114
|
const RemoteWatcherId = z.string().regex(/^[A-Za-z][A-Za-z0-9-]{0,31}$/, "ids start with a letter and use up to 32 letters, numbers, and hyphens");
|
|
82
115
|
//#endregion
|
|
83
|
-
export {
|
|
116
|
+
export { authorView as A, SentText as C, TaskNote as D, TaskHoldKind as E, storable as M, toStorable as N, TaskState as O, SentTaskNote as S, TASK_NOTE_MAX as T, OPEN_TASK_STATES as _, CAN_MAX as a, SeenActorKind as b, EDITED_HOLD as c, LabelKey as d, LabelValue as f, MessageText as g, MessageId as h, Author as i, platformAvatar as j, actorKind as k, Emoji as l, MESSAGE_TEXT_MAX as m, Attachment as n, CHANNEL_PATTERN_MAX as o, Labels as p, AttachmentId as r, ChannelPath as s, ActorId as t, Handle as u, RESERVED_LABEL_PREFIX as v, TASK_LABEL as w, SentTaskHoldKind as x, RemoteWatcherId as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as oidcTokens } from "./tokens-
|
|
4
|
-
import { t as local } from "./local-
|
|
1
|
+
import { f as BoardError } from "./errors-DZ1tbwSM.mjs";
|
|
2
|
+
import { p as localTokenFile, t as board } from "./server-Ch3tuK2k.mjs";
|
|
3
|
+
import { t as oidcTokens } from "./tokens-DPKF_cb5.mjs";
|
|
4
|
+
import { t as local } from "./local-11FMUJrU.mjs";
|
|
5
5
|
import { mkdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import { userInfo } from "node:os";
|
|
7
7
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./schemas-
|
|
3
|
-
import {
|
|
4
|
-
import { g as keyId, p as DERIVED_ID } from "./middleware-
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
1
|
+
import { _ as formatProfileHeader, f as BoardError, p as createBoardClient, t as HttpError } from "./errors-DZ1tbwSM.mjs";
|
|
2
|
+
import "./schemas-7VFdomFB.mjs";
|
|
3
|
+
import { Y as routes } from "./routes-B2HHHD_C.mjs";
|
|
4
|
+
import { g as keyId, p as DERIVED_ID } from "./middleware-BKsTcMAv.mjs";
|
|
5
|
+
import { l as METHODS, o as compileWatcher } from "./task-batch-BJcLiYe1.mjs";
|
|
6
|
+
import { c as PROTOCOL_ROUTES, d as deployedOnVercel, l as withoutToken, o as createVercel, r as createBoard, u as tailWatchers } from "./exports-DQauuHrc.mjs";
|
|
7
7
|
import { execFile } from "node:child_process";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { mkdir, readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -808,7 +808,7 @@ function createHttp(url, options, environment) {
|
|
|
808
808
|
start();
|
|
809
809
|
if ("identity" in caller) throw new HttpError(404, "not_found", `this board uses ${remote}, and answers nothing itself`);
|
|
810
810
|
const client = clientOf(caller);
|
|
811
|
-
if ((method === "post" || method === "posted") && "self" in caller && typeof input.id === "string" && DERIVED_ID.test(input.id)) input = {
|
|
811
|
+
if ((method === "post" || method === "posted" || method === "createTask" || method === "createTasks" || method === "createdTasks") && "self" in caller && typeof input.id === "string" && DERIVED_ID.test(input.id)) input = {
|
|
812
812
|
...input,
|
|
813
813
|
id: await ownKey(input.id).catch(rethrow)
|
|
814
814
|
};
|
|
@@ -989,10 +989,10 @@ function vercel(options = {}) {
|
|
|
989
989
|
function board(options = {}) {
|
|
990
990
|
return createBoard(options, {
|
|
991
991
|
backend: (fetch) => process.env.BOARD_URL?.trim() ? http() : vercel(fetch ? { fetch } : {}),
|
|
992
|
-
sync: () => import("./engine-
|
|
993
|
-
serving: () => import("./serving-
|
|
992
|
+
sync: () => import("./engine-C_SlBihU.mjs"),
|
|
993
|
+
serving: () => import("./serving-9riPNrHk.mjs"),
|
|
994
994
|
sandbox: (url, token) => sandboxHeaders(url, url, token)
|
|
995
995
|
});
|
|
996
996
|
}
|
|
997
997
|
//#endregion
|
|
998
|
-
export { vercel as a,
|
|
998
|
+
export { vercel as a, configDir as c, handFetch as d, handLogin as f, vercelProjectFile as h, handTeam as i, connect as l, projectDir as m, credentialSource as n, http as o, localTokenFile as p, credentialed as r, boardUrl as s, board as t, environmentProfile as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as ownTeamId, n as discoveryIdentity, r as ownProjectId, t as oidcTokens } from "./tokens-
|
|
1
|
+
import { i as ownTeamId, n as discoveryIdentity, r as ownProjectId, t as oidcTokens } from "./tokens-DPKF_cb5.mjs";
|
|
2
2
|
export { discoveryIdentity, oidcTokens, ownProjectId, ownTeamId };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as externalMessageKey, l as isThreadTarget } from "./external-
|
|
1
|
+
import { k as actorKind, w as TASK_LABEL } from "./schemas-7VFdomFB.mjs";
|
|
2
|
+
import { c as externalMessageKey, l as isThreadTarget } from "./external-BVr1Sq0y.mjs";
|
|
3
3
|
import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
4
|
-
import { n as setOwn, t as own } from "./own-OwgPWdmh.mjs";
|
|
5
4
|
import { i as mentionTerms } from "./mentions-DfZGp3B-.mjs";
|
|
5
|
+
import { n as setOwn, t as own } from "./own-OwgPWdmh.mjs";
|
|
6
6
|
//#region src/contract/folds.ts
|
|
7
7
|
const iso = (date) => typeof date === "string" ? date : date.toISOString();
|
|
8
8
|
function foldMessages(state, event) {
|
|
@@ -109,9 +109,133 @@ function foldMessage(state, event) {
|
|
|
109
109
|
delete message.undelivered[event.payload.target];
|
|
110
110
|
return message;
|
|
111
111
|
}
|
|
112
|
+
case "task.created": {
|
|
113
|
+
const message = state.byId[event.payload.id];
|
|
114
|
+
if (!message || message.deleted || message.re !== null || message.task) return void 0;
|
|
115
|
+
const { needs, by } = event.payload;
|
|
116
|
+
message.task = {
|
|
117
|
+
state: needs.length > 0 ? "waiting" : "ready",
|
|
118
|
+
owner: by.principal,
|
|
119
|
+
by: by.actor,
|
|
120
|
+
for: event.payload.for,
|
|
121
|
+
needs: [...needs],
|
|
122
|
+
epoch: 0,
|
|
123
|
+
claim: null,
|
|
124
|
+
blocked: null,
|
|
125
|
+
result: null,
|
|
126
|
+
reason: null
|
|
127
|
+
};
|
|
128
|
+
return labeled(message);
|
|
129
|
+
}
|
|
130
|
+
case "task.assigned":
|
|
131
|
+
case "task.needs_changed":
|
|
132
|
+
case "task.ready":
|
|
133
|
+
case "task.claimed":
|
|
134
|
+
case "task.renewed":
|
|
135
|
+
case "task.released":
|
|
136
|
+
case "task.expired":
|
|
137
|
+
case "task.completed":
|
|
138
|
+
case "task.failed":
|
|
139
|
+
case "task.blocked":
|
|
140
|
+
case "task.unblocked":
|
|
141
|
+
case "task.canceled":
|
|
142
|
+
case "task.reopened": {
|
|
143
|
+
const message = state.byId[event.payload.id];
|
|
144
|
+
if (!message?.task || !foldTask(message.task, event)) return void 0;
|
|
145
|
+
return labeled(message);
|
|
146
|
+
}
|
|
112
147
|
default: return;
|
|
113
148
|
}
|
|
114
149
|
}
|
|
150
|
+
/** `message`, a task's root, wearing its task's state as `board.task`. A tombstone wears no labels, this one included. */
|
|
151
|
+
function labeled(message) {
|
|
152
|
+
if (!message.deleted) setOwn(message.labels, TASK_LABEL, message.task.state);
|
|
153
|
+
return message;
|
|
154
|
+
}
|
|
155
|
+
/** Whether a claim's write is by the claim that holds the task: the same epoch, while it's claimed. */
|
|
156
|
+
const holds = (task, epoch) => task.state === "claimed" && task.epoch === epoch;
|
|
157
|
+
/**
|
|
158
|
+
* Applies a task's event to it, and says whether it changed anything. Each event lands only from
|
|
159
|
+
* the states it can leave, so one written against a task that has since moved on changes nothing:
|
|
160
|
+
* the writes check first, and this is what holds if one didn't.
|
|
161
|
+
*/
|
|
162
|
+
function foldTask(task, event) {
|
|
163
|
+
switch (event.type) {
|
|
164
|
+
case "task.assigned":
|
|
165
|
+
if (task.for === event.payload.for) return false;
|
|
166
|
+
task.for = event.payload.for;
|
|
167
|
+
return true;
|
|
168
|
+
case "task.needs_changed":
|
|
169
|
+
if (task.state !== "waiting" && task.state !== "ready" && task.state !== "blocked") return false;
|
|
170
|
+
task.needs = [...event.payload.needs];
|
|
171
|
+
if (task.state !== "blocked") task.state = task.needs.length > 0 ? "waiting" : "ready";
|
|
172
|
+
return true;
|
|
173
|
+
case "task.ready":
|
|
174
|
+
if (task.state !== "waiting") return false;
|
|
175
|
+
task.state = "ready";
|
|
176
|
+
return true;
|
|
177
|
+
case "task.claimed": {
|
|
178
|
+
const { epoch, until, token, by } = event.payload;
|
|
179
|
+
if (task.state !== "ready" || epoch !== task.epoch + 1) return false;
|
|
180
|
+
task.state = "claimed";
|
|
181
|
+
task.epoch = epoch;
|
|
182
|
+
task.claim = {
|
|
183
|
+
actor: by.actor,
|
|
184
|
+
until,
|
|
185
|
+
token
|
|
186
|
+
};
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
case "task.renewed":
|
|
190
|
+
if (!holds(task, event.payload.epoch)) return false;
|
|
191
|
+
task.claim.until = event.payload.until;
|
|
192
|
+
return true;
|
|
193
|
+
case "task.released":
|
|
194
|
+
case "task.expired":
|
|
195
|
+
if (!holds(task, event.payload.epoch)) return false;
|
|
196
|
+
task.state = "ready";
|
|
197
|
+
task.claim = null;
|
|
198
|
+
return true;
|
|
199
|
+
case "task.completed":
|
|
200
|
+
if (!holds(task, event.payload.epoch)) return false;
|
|
201
|
+
task.state = "completed";
|
|
202
|
+
task.claim = null;
|
|
203
|
+
task.result = event.payload.result;
|
|
204
|
+
return true;
|
|
205
|
+
case "task.failed":
|
|
206
|
+
if (!holds(task, event.payload.epoch)) return false;
|
|
207
|
+
task.state = "failed";
|
|
208
|
+
task.claim = null;
|
|
209
|
+
task.reason = event.payload.reason;
|
|
210
|
+
return true;
|
|
211
|
+
case "task.blocked":
|
|
212
|
+
if (task.state !== "waiting" && task.state !== "ready" && task.state !== "claimed") return false;
|
|
213
|
+
task.state = "blocked";
|
|
214
|
+
task.claim = null;
|
|
215
|
+
task.blocked = {
|
|
216
|
+
kind: event.payload.kind,
|
|
217
|
+
reason: event.payload.reason
|
|
218
|
+
};
|
|
219
|
+
return true;
|
|
220
|
+
case "task.unblocked":
|
|
221
|
+
if (task.state !== "blocked") return false;
|
|
222
|
+
task.state = task.needs.length > 0 ? "waiting" : "ready";
|
|
223
|
+
task.blocked = null;
|
|
224
|
+
return true;
|
|
225
|
+
case "task.canceled":
|
|
226
|
+
if (task.state === "completed" || task.state === "canceled") return false;
|
|
227
|
+
task.state = "canceled";
|
|
228
|
+
task.claim = null;
|
|
229
|
+
task.blocked = null;
|
|
230
|
+
task.reason = event.payload.reason;
|
|
231
|
+
return true;
|
|
232
|
+
case "task.reopened":
|
|
233
|
+
if (task.state !== "failed") return false;
|
|
234
|
+
task.state = "ready";
|
|
235
|
+
task.reason = null;
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
115
239
|
/** Who's who: `actor.seen`. */
|
|
116
240
|
function foldActors(state, event) {
|
|
117
241
|
if (event.type !== "actor.seen") return state;
|
|
@@ -728,15 +852,38 @@ function sqlTables(db) {
|
|
|
728
852
|
const matching = clauses(rest, p);
|
|
729
853
|
if (matching.length > 0) where.push(`r.id in (select coalesce(m.re, m.id) from board_messages m where ${matching.join(" and ")})`);
|
|
730
854
|
if (page.after !== void 0) where.push(`r.at > ${p.add(page.after)}`);
|
|
855
|
+
if (page.before !== void 0) where.push(`(r.at < ${p.add(page.before.at)} or (r.at = ${p.add(page.before.at)} and r.id < ${p.add(page.before.id)}))`);
|
|
731
856
|
const order = page.after !== void 0 ? "asc" : "desc";
|
|
857
|
+
const limit = page.after !== void 0 ? page.limit : page.limit + 1;
|
|
732
858
|
return {
|
|
733
|
-
text: `select r.data as data, r.replies as replies, l.data as last
|
|
859
|
+
text: `select r.data as data, r.replies as replies, r.at as at, l.data as last
|
|
734
860
|
from board_messages r left join board_messages l on l.id = r.at and r.at <> r.id
|
|
735
861
|
where ${where.join(" and ")}
|
|
736
|
-
order by r.at ${order} limit ${p.add(
|
|
862
|
+
order by r.at ${order}, r.id ${order} limit ${p.add(limit)}`,
|
|
863
|
+
values: p.values
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
/** Roots that match, each with its summary, by ID: a root's own row holds its reply count and its latest reply. */
|
|
867
|
+
function rootsQuery(filter, page) {
|
|
868
|
+
const p = new Params();
|
|
869
|
+
const where = ["m.re is null", ...clauses(filter, p)];
|
|
870
|
+
if (page.before !== void 0) where.push(`m.id < ${p.add(page.before)}`);
|
|
871
|
+
if (page.after !== void 0) where.push(`m.id > ${p.add(page.after)}`);
|
|
872
|
+
const order = page.after !== void 0 ? "asc" : "desc";
|
|
873
|
+
return {
|
|
874
|
+
text: `select m.data as data, m.replies as replies, l.data as last
|
|
875
|
+
from board_messages m left join board_messages l on l.id = m.at and m.at <> m.id
|
|
876
|
+
where ${where.join(" and ")}
|
|
877
|
+
order by m.id ${order} limit ${p.add(page.limit)}`,
|
|
737
878
|
values: p.values
|
|
738
879
|
};
|
|
739
880
|
}
|
|
881
|
+
/** A thread summary from a row of a root joined with its latest reply. */
|
|
882
|
+
const summary = (found) => ({
|
|
883
|
+
root: parse(found),
|
|
884
|
+
replies: Number(found.replies),
|
|
885
|
+
last: found.last === null || found.last === void 0 ? null : JSON.parse(String(found.last))
|
|
886
|
+
});
|
|
740
887
|
return {
|
|
741
888
|
async position() {
|
|
742
889
|
return position(await db.all(positionSql));
|
|
@@ -796,11 +943,29 @@ where v.message_id in (${p.list([...new Set(ids)])})
|
|
|
796
943
|
async threads(filter, page) {
|
|
797
944
|
if (filter.mentions) await mentionsReady();
|
|
798
945
|
const [positions, rows] = await db.read([positionSql, threadsQuery(filter, page)]);
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
last: found.last === null || found.last === void 0 ? null : JSON.parse(String(found.last))
|
|
946
|
+
const listed = rows.map((found) => ({
|
|
947
|
+
...summary(found),
|
|
948
|
+
at: Number(found.at)
|
|
803
949
|
}));
|
|
950
|
+
if (page.after !== void 0) return {
|
|
951
|
+
threads: listed.map(({ at: _, ...thread }) => thread),
|
|
952
|
+
position: position(positions)
|
|
953
|
+
};
|
|
954
|
+
const shown = listed.slice(0, page.limit);
|
|
955
|
+
const oldest = shown.at(-1);
|
|
956
|
+
const older = listed.length > page.limit && oldest ? {
|
|
957
|
+
at: oldest.at,
|
|
958
|
+
id: oldest.root.id
|
|
959
|
+
} : null;
|
|
960
|
+
return {
|
|
961
|
+
threads: shown.reverse().map(({ at: _, ...thread }) => thread),
|
|
962
|
+
position: position(positions),
|
|
963
|
+
older
|
|
964
|
+
};
|
|
965
|
+
},
|
|
966
|
+
async roots(filter, page) {
|
|
967
|
+
const [positions, rows] = await db.read([positionSql, rootsQuery(filter, page)]);
|
|
968
|
+
const threads = rows.map(summary);
|
|
804
969
|
return {
|
|
805
970
|
threads: page.after !== void 0 ? threads : threads.reverse(),
|
|
806
971
|
position: position(positions)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as sqlTables } from "./sql-
|
|
1
|
+
import { r as sqlTables } from "./sql-Bml29DpM.mjs";
|
|
2
2
|
import { t as sqlite$1 } from "./store-sqlite-D6fIszST.mjs";
|
|
3
|
-
import { t as sqliteDb } from "./sqlite-db-
|
|
3
|
+
import { t as sqliteDb } from "./sqlite-db-eVb9v3zc.mjs";
|
|
4
4
|
//#region src/store/sqlite.ts
|
|
5
5
|
/**
|
|
6
6
|
* A local board in one SQLite file, its log and board's tables side by side. It
|
package/dist/sync-chat-sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as SyncFn, m as SyncProvider, x as channels } from "./provider-
|
|
2
|
-
import { r as ChatTransport, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { _ as SyncFn, m as SyncProvider, x as channels } from "./provider-D3bfHRHA.mjs";
|
|
2
|
+
import { r as ChatTransport, t as ChatInput } from "./chat-provider-Bn33acHd.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ReactionEvent } from "chat";
|
|
5
5
|
//#region src/sync/chat-sdk.d.ts
|
package/dist/sync-chat-sdk.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as eventSchema, p as channels, r as envelope } from "./events-
|
|
2
|
-
import { t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { i as eventSchema, p as channels, r as envelope } from "./events-mGuhF4i5.mjs";
|
|
2
|
+
import { t as ChatSyncProvider } from "./chat-provider-1zpY6Qo_.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
//#region src/sync/chat-sdk.ts
|
|
5
5
|
const schemaOf = (platform) => eventSchema(platform, "message");
|
package/dist/sync-github.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as SyncFn, b as SyncUnit, p as SyncContext } from "./provider-
|
|
2
|
-
import { n as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { _ as SyncFn, b as SyncUnit, p as SyncContext } from "./provider-D3bfHRHA.mjs";
|
|
2
|
+
import { n as ChatSyncProvider } from "./chat-provider-Bn33acHd.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Adapter } from "chat";
|
|
5
5
|
//#region src/sync/github.d.ts
|
package/dist/sync-github.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as withRoutes, i as eventSchema, m as into, r as envelope } from "./events-
|
|
2
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { _ as withRoutes, i as eventSchema, m as into, r as envelope } from "./events-mGuhF4i5.mjs";
|
|
2
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1zpY6Qo_.mjs";
|
|
3
3
|
import { n as tagOf } from "./tags-BpFo6q0_.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { connectGitHubAdapter } from "@vercel/connect/chat";
|
package/dist/sync-linear.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as SyncFn, b as SyncUnit, f as ResolvedTarget, l as ReceivedEvent, o as ProviderPost, p as SyncContext, r as ProviderDelivery } from "./provider-
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { Ot as SourceRead } from "./routes-NEc6w3QC.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-D3bfHRHA.mjs";
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-Bn33acHd.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Adapter } from "chat";
|
|
6
6
|
//#region src/sync/linear.d.ts
|
package/dist/sync-linear.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-
|
|
2
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-mGuhF4i5.mjs";
|
|
2
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1zpY6Qo_.mjs";
|
|
3
3
|
import { n as tagOf, t as slug } from "./tags-BpFo6q0_.mjs";
|
|
4
4
|
import "zod";
|
|
5
5
|
import { connectLinearAdapter } from "@vercel/connect/chat";
|
package/dist/sync-slack.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as SyncFn, f as ResolvedTarget, o as ProviderPost, p as SyncContext, r as ProviderDelivery, s as ProviderSender, x as channels } from "./provider-
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { Nn as ExternalLink } from "./routes-NEc6w3QC.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-D3bfHRHA.mjs";
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-Bn33acHd.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Adapter } from "chat";
|
|
6
6
|
//#region src/sync/slack-deployments.d.ts
|
package/dist/sync-slack.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./external-
|
|
3
|
-
import { d as opensBlock, i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-
|
|
4
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { m as MESSAGE_TEXT_MAX } from "./schemas-7VFdomFB.mjs";
|
|
2
|
+
import "./external-BVr1Sq0y.mjs";
|
|
3
|
+
import { d as opensBlock, i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-mGuhF4i5.mjs";
|
|
4
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1zpY6Qo_.mjs";
|
|
5
5
|
import { r as formatVercelDeployments } from "./bots-CLKKMgYf.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { stringifyMarkdown } from "chat";
|
package/dist/sync.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
1
|
+
import { An as ExternalAuthor, Mn as ExternalFile, jn as ExternalEvent } from "./routes-NEc6w3QC.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-D3bfHRHA.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 };
|
package/dist/sync.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as ExternalEvent } from "./external-
|
|
2
|
-
import { c as SyncProvider, g as render, h as mirror, i as eventSchema, l as UnreadableError, m as into, n as SyncOverrides, o as ReceivedEvent, p as channels, r as envelope, s as ResolvedTarget, t as EventBase } from "./events-
|
|
1
|
+
import { n as ExternalEvent } from "./external-BVr1Sq0y.mjs";
|
|
2
|
+
import { c as SyncProvider, g as render, h as mirror, i as eventSchema, l as UnreadableError, m as into, n as SyncOverrides, o as ReceivedEvent, p as channels, r as envelope, s as ResolvedTarget, t as EventBase } from "./events-mGuhF4i5.mjs";
|
|
3
3
|
export { EventBase, ExternalEvent, ReceivedEvent, ResolvedTarget, SyncOverrides, SyncProvider, UnreadableError, channels, envelope, eventSchema, into, mirror, render };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./schemas-
|
|
3
|
-
import { l as isThreadTarget } from "./external-
|
|
4
|
-
import {
|
|
5
|
-
import { i as afterRetry } from "./middleware-
|
|
6
|
-
import { o as options } from "./commands-
|
|
1
|
+
import { r as badRequest, t as HttpError, y as ATTACHMENT_BYTES_MAX } from "./errors-DZ1tbwSM.mjs";
|
|
2
|
+
import "./schemas-7VFdomFB.mjs";
|
|
3
|
+
import { l as isThreadTarget } from "./external-BVr1Sq0y.mjs";
|
|
4
|
+
import { Y as routes, _ as Filters } from "./routes-B2HHHD_C.mjs";
|
|
5
|
+
import { i as afterRetry } from "./middleware-BKsTcMAv.mjs";
|
|
6
|
+
import { o as options } from "./commands-D0lyo8O8.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/version.ts
|
|
10
|
-
const VERSION = "0.
|
|
10
|
+
const VERSION = "0.46.0";
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/server/backend.ts
|
|
13
13
|
/** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
|
|
@@ -40,6 +40,22 @@ const METHODS = [
|
|
|
40
40
|
"schedule",
|
|
41
41
|
"schedules",
|
|
42
42
|
"cancelSchedule",
|
|
43
|
+
"tasks",
|
|
44
|
+
"createTask",
|
|
45
|
+
"createTasks",
|
|
46
|
+
"createdTasks",
|
|
47
|
+
"claimReadyTask",
|
|
48
|
+
"claimTask",
|
|
49
|
+
"renewTask",
|
|
50
|
+
"releaseTask",
|
|
51
|
+
"completeTask",
|
|
52
|
+
"failTask",
|
|
53
|
+
"blockTask",
|
|
54
|
+
"unblockTask",
|
|
55
|
+
"reopenTask",
|
|
56
|
+
"assignTask",
|
|
57
|
+
"setTaskNeeds",
|
|
58
|
+
"cancelTask",
|
|
43
59
|
"grants",
|
|
44
60
|
"createGrant",
|
|
45
61
|
"updateGrant",
|
|
@@ -72,6 +88,7 @@ const METHODS = [
|
|
|
72
88
|
"synced",
|
|
73
89
|
"linked"
|
|
74
90
|
];
|
|
91
|
+
METHODS.filter((name) => name === "tasks" || name.includes("Task"));
|
|
75
92
|
const escape = (literal) => literal.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
76
93
|
function compile(method, path, target, own) {
|
|
77
94
|
const parts = path.split("/").filter(Boolean);
|
|
@@ -425,4 +442,62 @@ const syncTarget = (target) => typeof target === "string" ? {
|
|
|
425
442
|
*/
|
|
426
443
|
const SYNC_ACTOR = "board:sync";
|
|
427
444
|
//#endregion
|
|
428
|
-
|
|
445
|
+
//#region src/contract/task-batch.ts
|
|
446
|
+
/**
|
|
447
|
+
* For each task of a batch, the batch's tasks it waits for, by their place in it, and an order to
|
|
448
|
+
* make them in: every task after the ones it waits for, and as the batch has them otherwise. A
|
|
449
|
+
* `problem` instead when two tasks have one `key`, a task waits for a `key` no task has or for
|
|
450
|
+
* itself, or tasks wait for each other: such a batch can't be made.
|
|
451
|
+
*/
|
|
452
|
+
function batchPlan(tasks) {
|
|
453
|
+
const named = /* @__PURE__ */ new Map();
|
|
454
|
+
for (const [at, task] of tasks.entries()) {
|
|
455
|
+
if (task.key === void 0) continue;
|
|
456
|
+
if (named.has(task.key)) return { problem: `two tasks of the batch have the key ${JSON.stringify(task.key)}` };
|
|
457
|
+
named.set(task.key, at);
|
|
458
|
+
}
|
|
459
|
+
const inside = [];
|
|
460
|
+
for (const [at, task] of tasks.entries()) {
|
|
461
|
+
const waits = /* @__PURE__ */ new Set();
|
|
462
|
+
for (const need of task.needs ?? []) {
|
|
463
|
+
if (typeof need === "string") continue;
|
|
464
|
+
const found = named.get(need.key);
|
|
465
|
+
if (found === void 0) return { problem: `no task of the batch has the key ${JSON.stringify(need.key)}` };
|
|
466
|
+
if (found === at) return { problem: `the task with the key ${JSON.stringify(need.key)} waits for itself` };
|
|
467
|
+
waits.add(found);
|
|
468
|
+
}
|
|
469
|
+
inside.push([...waits]);
|
|
470
|
+
}
|
|
471
|
+
const order = [];
|
|
472
|
+
const state = new Uint8Array(tasks.length);
|
|
473
|
+
for (let start = 0; start < tasks.length; start++) {
|
|
474
|
+
if (state[start] !== 0) continue;
|
|
475
|
+
const path = [{
|
|
476
|
+
at: start,
|
|
477
|
+
next: 0
|
|
478
|
+
}];
|
|
479
|
+
state[start] = 1;
|
|
480
|
+
while (path.length > 0) {
|
|
481
|
+
const top = path.at(-1);
|
|
482
|
+
const need = inside[top.at][top.next++];
|
|
483
|
+
if (need === void 0) {
|
|
484
|
+
state[top.at] = 2;
|
|
485
|
+
order.push(top.at);
|
|
486
|
+
path.pop();
|
|
487
|
+
} else if (state[need] === 1) return { problem: `the tasks with the keys ${path.slice(path.findIndex((step) => step.at === need)).map((step) => JSON.stringify(tasks[step.at].key)).join(", ")} wait for each other` };
|
|
488
|
+
else if (state[need] === 0) {
|
|
489
|
+
state[need] = 1;
|
|
490
|
+
path.push({
|
|
491
|
+
at: need,
|
|
492
|
+
next: 0
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return {
|
|
498
|
+
inside,
|
|
499
|
+
order
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
export { runMatch as a, withMentions as c, openapi as d, queryObject as f, VERSION as g, SYNC as h, canonicalWatchers as i, METHODS as l, readJson as m, SYNC_ACTOR as n, compileWatcher as o, readCapped as p, syncTarget as r, hasCriteria as s, batchPlan as t, createRouter as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { g as privateHost, h as markVerified, i as VERCEL_ISSUER, p as issuerName, r as TOKENS, v as trustedIssuers } from "./auth-
|
|
1
|
+
import { d as unauthorized } from "./errors-DZ1tbwSM.mjs";
|
|
2
|
+
import { g as privateHost, h as markVerified, i as VERCEL_ISSUER, p as issuerName, r as TOKENS, v as trustedIssuers } from "./auth-C-pFnJBA.mjs";
|
|
3
3
|
import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
|
|
4
4
|
//#region src/server/identity.ts
|
|
5
5
|
let fromDisk;
|
|
@@ -52,7 +52,7 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
|
|
|
52
52
|
`board()` with no backend keeps nothing here:
|
|
53
53
|
|
|
54
54
|
- **Vercel's API keeps the board:** messages, threads, reactions, labels, a
|
|
55
|
-
channel's changes, schedules, and files, up to 100 MB each as a
|
|
55
|
+
channel's changes, schedules, tasks, and files, up to 100 MB each as a
|
|
56
56
|
[direct upload](../04-reference/03-http.md#direct-uploads).
|
|
57
57
|
- **Its watchers run here.** Vercel's API matches each event against their
|
|
58
58
|
tails and wakes this route when one matches: see
|
|
@@ -69,8 +69,8 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
|
|
|
69
69
|
a board run with them runs its config's watchers in this process: see
|
|
70
70
|
[How it runs](./06-watchers.md#how-it-runs).
|
|
71
71
|
- **What Vercel's API doesn't keep yet answers 501 `not_supported`:** files on
|
|
72
|
-
a scheduled message
|
|
73
|
-
|
|
72
|
+
a scheduled message and a post's `sync` targets. A channel's message and
|
|
73
|
+
thread counts are left out.
|
|
74
74
|
|
|
75
75
|
A request's caller is who `board()` verified it is: `authenticate` checks its
|
|
76
76
|
credential for the board's URL, which a token's audience must equal, works out
|
|
@@ -111,8 +111,8 @@ await team.cancelSchedule(reminder.id) // { schedule, canceled }
|
|
|
111
111
|
already posted. Downtime doesn't replay: the next send is the next slot after
|
|
112
112
|
now, so a board that was down sends once rather than catching up on every
|
|
113
113
|
missed slot.
|
|
114
|
-
- **Vercel's board takes no files on a scheduled message yet
|
|
115
|
-
|
|
114
|
+
- **Vercel's board takes no files on a scheduled message yet:** those answer
|
|
115
|
+
501 `not_supported`.
|
|
116
116
|
- **A board that keeps no schedules refuses.** `POST /schedules`, `schedule()`,
|
|
117
117
|
and `vb schedule` answer 501 `no_scheduler`, and `vb` says it can't, with the
|
|
118
118
|
board's words under it. A [backend of your own](./01-mounting.md#a-backend-of-your-own)
|
|
@@ -60,6 +60,13 @@ it's made, as the caller's post.
|
|
|
60
60
|
fails with `duplicate_id`. A write it dropped has nothing on the board, so a
|
|
61
61
|
retry goes through it again: keep side effects like `respond` idempotent, or
|
|
62
62
|
cheap to repeat.
|
|
63
|
+
- **A batch of tasks goes through a root at a time.** `tasks.createMany` hands
|
|
64
|
+
it each task's root as a post, in order, before any is written: one it drops
|
|
65
|
+
makes none of them. A retry of a batch that landed skips it, as a post's
|
|
66
|
+
does: the board looks for the batch by its `id` first, and tells the same
|
|
67
|
+
request by what was sent, before the middleware. Vercel's board has no such
|
|
68
|
+
read, so a retry goes through again there: see
|
|
69
|
+
[`tasks`](../04-reference/02-board.md#tasks).
|
|
63
70
|
|
|
64
71
|
## What it gets
|
|
65
72
|
|