@vercel/board 0.36.0 → 0.37.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.d.mts +2 -2
- package/dist/access.mjs +1 -1
- package/dist/{actors-DFOpTw89.mjs → actors-uoD62kiN.mjs} +1 -0
- package/dist/{auth-C21V0EK1.d.mts → auth-BHXgi696.d.mts} +1 -1
- package/dist/{backend-D21q8mdm.d.mts → backend-BIvl2z1z.d.mts} +3 -9
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-Bb-jeJLY.mjs → chat-provider-C0WUS3-G.mjs} +1 -1
- package/dist/{chat-provider-DmZCmBkb.d.mts → chat-provider-DFYEReZL.d.mts} +2 -2
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +18 -2
- package/dist/cli-embedded.mjs +22 -4
- package/dist/cli.mjs +50 -676
- package/dist/{commands-BLtqSwha.mjs → commands-D2pFCMSh.mjs} +11 -0
- package/dist/{conformance-CKrwglzA.mjs → conformance-rCrc_mwi.mjs} +2 -3
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/digest-CLGw7653.mjs +4 -0
- package/dist/{engine-B_prP0b8.mjs → engine-COa73McY.mjs} +16 -12
- package/dist/{events-AEKh9tJm.mjs → events-v8f7pF9f.mjs} +21 -7
- package/dist/exports-Bb0m03fT.d.mts +4 -0
- package/dist/{exports-Ck4Xu3OV.mjs → exports-DTezg4xR.mjs} +728 -171
- package/dist/{index-LREsSZb2.d.mts → index-B1TZrMMu.d.mts} +2 -2
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +3 -3
- package/dist/index.node.d.mts +5 -5
- package/dist/index.node.mjs +2 -2
- package/dist/inspect/app.js +35 -35
- package/dist/inspect/engine.js +5 -5
- package/dist/inspect-B8c0Wh5Z.mjs +2 -0
- package/dist/inspect-CoFk2Xj7.mjs +643 -0
- package/dist/{local-DJ_qI9q7.mjs → local-Cm7a7_Q0.mjs} +10 -65
- package/dist/{main-Jz4nbNJi.mjs → main-DoZ8IFPb.mjs} +9 -7
- package/dist/{middleware-BxgizazV.mjs → middleware-k_XKQ6f7.mjs} +9 -1
- package/dist/page-BAQpb-s-.mjs +2 -0
- package/dist/page-LysMGAl3.mjs +30 -0
- package/dist/{provider-DEOfc4Ls.d.mts → provider-7pOnK8Jw.d.mts} +5 -3
- package/dist/{routes-BpKdMvgX.d.mts → routes-BtsZzal-.d.mts} +0 -17
- package/dist/{serve-Puf3I-oI.mjs → serve-2U_JPJtS.mjs} +2 -2
- package/dist/{server-CS-1aeTl.mjs → server-Drul_uwj.mjs} +18 -10
- 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 +2 -2
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +1 -1
- package/dist/{targets-Dk_xgS9q.mjs → targets-B0D4tJDY.mjs} +63 -18
- package/docs/01-board/01-mounting.md +11 -8
- package/docs/01-board/03-identity.md +2 -1
- package/docs/01-board/06-watchers.md +71 -40
- package/docs/01-quickstart.md +1 -1
- package/docs/02-sync/01-overview.md +7 -7
- package/docs/02-sync/02-functions.md +5 -8
- package/docs/02-sync/03-slack.md +0 -8
- package/docs/02-sync/04-github.md +0 -8
- package/docs/02-sync/07-linear.md +0 -6
- package/docs/03-guides/01-coding-agents.md +1 -0
- package/docs/03-guides/02-inspector.md +3 -2
- package/docs/03-guides/04-triage.md +8 -13
- package/docs/04-reference/01-cli.md +28 -4
- package/docs/04-reference/03-http.md +1 -1
- package/docs/04-reference/05-conformance.md +1 -1
- package/docs/index.md +3 -10
- package/package.json +2 -1
- package/dist/attempts-HXcskN1w.mjs +0 -10
- package/dist/exports-BxljH73E.d.mts +0 -4
|
@@ -1168,6 +1168,17 @@ const commands = [
|
|
|
1168
1168
|
value: "wait dev --mentions --timeout 10m"
|
|
1169
1169
|
}]
|
|
1170
1170
|
},
|
|
1171
|
+
{
|
|
1172
|
+
group: "live",
|
|
1173
|
+
name: "inspect",
|
|
1174
|
+
description: "the board in your browser, as you: read, post, react (local only)",
|
|
1175
|
+
arguments: [],
|
|
1176
|
+
options: [option("port", "the port to listen on (default: a free one)"), option("no-open")],
|
|
1177
|
+
examples: [{
|
|
1178
|
+
name: "open the board in your browser",
|
|
1179
|
+
value: "inspect"
|
|
1180
|
+
}]
|
|
1181
|
+
},
|
|
1171
1182
|
{
|
|
1172
1183
|
group: "live",
|
|
1173
1184
|
name: "help",
|
|
@@ -1037,7 +1037,6 @@ const CHECKS = [
|
|
|
1037
1037
|
if (registered && (Object.keys(registered.watch).length > 0 || (registered.sync?.length ?? 0) > 0)) return "this token has watchers or a sync registered here, and checking would replace them";
|
|
1038
1038
|
const byPath = (await ctx.board.discovery()).wake_by_path;
|
|
1039
1039
|
const environment = /^vercel:project:[^:]+:(.+)$/.exec(ctx.me.principal)?.[1] ?? null;
|
|
1040
|
-
if (byPath && environment !== null && environment !== "production" && environment !== "preview") return `a path wakes production or a preview, and this token is ${environment}'s`;
|
|
1041
1040
|
const where = wokenAt(registered);
|
|
1042
1041
|
const branch = environment === "preview" ? { branch: "conformance" } : {};
|
|
1043
1042
|
const attempt = () => ctx.board.register({
|
|
@@ -1395,11 +1394,11 @@ async function conformance(board, options = {}) {
|
|
|
1395
1394
|
status: "skipped",
|
|
1396
1395
|
detail: `not kept here: ${error.message}`
|
|
1397
1396
|
});
|
|
1398
|
-
else if (group === "watchers" && error instanceof BoardError && error.code === "
|
|
1397
|
+
else if (group === "watchers" && error instanceof BoardError && error.code === "watchers_need_project") checks.push({
|
|
1399
1398
|
group,
|
|
1400
1399
|
name,
|
|
1401
1400
|
status: "skipped",
|
|
1402
|
-
detail: "a
|
|
1401
|
+
detail: "only a deployment registers watchers here"
|
|
1403
1402
|
});
|
|
1404
1403
|
else checks.push({
|
|
1405
1404
|
group,
|
package/dist/conformance.d.mts
CHANGED
package/dist/conformance.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as conformance } from "./conformance-
|
|
1
|
+
import { t as conformance } from "./conformance-rCrc_mwi.mjs";
|
|
2
2
|
export { conformance };
|
|
@@ -2,10 +2,9 @@ import { _ as fileSize, h as IMPORT_BYTES_MAX, p as ATTACHMENT_BYTES_MAX, r as b
|
|
|
2
2
|
import { a as ChannelPath, b as toStorable, d as MESSAGE_TEXT_MAX } from "./schemas-BG205xds.mjs";
|
|
3
3
|
import { l as isThreadTarget, s as channelOf } from "./external-BA2aCC_3.mjs";
|
|
4
4
|
import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { a as waitUntil, i as afterRetry, s as derivedId, t as DroppedError } from "./middleware-k_XKQ6f7.mjs";
|
|
6
6
|
import { n as replaceMentions } from "./mentions-CB6ShY4R.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { a as immutable, d as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-AEKh9tJm.mjs";
|
|
7
|
+
import { a as immutable, d as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-v8f7pF9f.mjs";
|
|
9
8
|
import { t as displayText } from "./bots-CGkO76qH.mjs";
|
|
10
9
|
//#region src/sync/engine.ts
|
|
11
10
|
/** `files`: a message with files may have no text. */
|
|
@@ -22,12 +21,12 @@ const keepsNoFiles = (error) => error instanceof HttpError && error.code === "no
|
|
|
22
21
|
* A platform file on a board that keeps no files: a link to where it lives on the platform, which
|
|
23
22
|
* its readers there can open, or its name when the platform gave no URL.
|
|
24
23
|
*/
|
|
25
|
-
const fileLink = (file) => {
|
|
24
|
+
const fileLink = (file, why) => {
|
|
26
25
|
const name = file.name ?? "a file";
|
|
27
|
-
if (!file.url || !/^https?:\/\//.test(file.url)) return fileNote(file,
|
|
26
|
+
if (!file.url || !/^https?:\/\//.test(file.url)) return fileNote(file, why);
|
|
28
27
|
const label = name.replace(/[[\]\\]/g, (char) => `\\${char}`);
|
|
29
28
|
const url = file.url.replace(/[ ()]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
30
|
-
return fileNote(file,
|
|
29
|
+
return fileNote(file, why, `[${label}](${url})`);
|
|
31
30
|
};
|
|
32
31
|
/** A platform message's text with its file notes after it. */
|
|
33
32
|
const withNotes = (text, notes) => notes.length ? `${text.trim() ? `${text}\n\n` : ""}${notes.join("\n")}` : text;
|
|
@@ -227,7 +226,11 @@ function createSyncEngine(entries) {
|
|
|
227
226
|
"subthread" in event ? event.subthread : null
|
|
228
227
|
]) if (location !== null && !location.startsWith(`${key}:`)) throw badRequest(`provider locations must belong to sync entry ${key}`);
|
|
229
228
|
const routes = routesFor(platformOf(key));
|
|
230
|
-
|
|
229
|
+
const kept = routes && await routes(native(event.channel), (name) => resolve(key, name)).catch(async (error) => {
|
|
230
|
+
if (await syncsThread(event.thread)) return true;
|
|
231
|
+
throw error;
|
|
232
|
+
});
|
|
233
|
+
if (routes && !kept && !await syncsThread(event.thread)) return;
|
|
231
234
|
await call("inboxPush", {
|
|
232
235
|
key,
|
|
233
236
|
events: [{
|
|
@@ -377,10 +380,11 @@ function createSyncEngine(entries) {
|
|
|
377
380
|
async function importFiles(platform, files, attempt) {
|
|
378
381
|
const attachments = [];
|
|
379
382
|
const notes = [];
|
|
380
|
-
|
|
383
|
+
/** Why the board takes none of them, in its words, once it said so. */
|
|
384
|
+
let noFiles = null;
|
|
381
385
|
for (const file of files.slice(0, 10)) {
|
|
382
|
-
if (noFiles) {
|
|
383
|
-
notes.push(fileLink(file));
|
|
386
|
+
if (noFiles !== null) {
|
|
387
|
+
notes.push(fileLink(file, noFiles));
|
|
384
388
|
continue;
|
|
385
389
|
}
|
|
386
390
|
if (file.size !== void 0 && file.size > 26214400) {
|
|
@@ -422,8 +426,8 @@ function createSyncEngine(entries) {
|
|
|
422
426
|
continue;
|
|
423
427
|
}
|
|
424
428
|
if (!keepsNoFiles(error)) throw error;
|
|
425
|
-
noFiles =
|
|
426
|
-
notes.push(fileLink(file));
|
|
429
|
+
noFiles = error.message;
|
|
430
|
+
notes.push(fileLink(file, noFiles));
|
|
427
431
|
}
|
|
428
432
|
}
|
|
429
433
|
for (const file of files.slice(10)) notes.push(fileNote(file, `a message carries at most 10`));
|
|
@@ -54,26 +54,32 @@ const follow = async (sync) => {
|
|
|
54
54
|
* to every channel's function, with `channel` set to that one. A thread the board syncs outside
|
|
55
55
|
* these channels (someone ran `vb sync` on it) stays synced both ways. A key the platform says
|
|
56
56
|
* doesn't exist is skipped. While one can't be checked, an event outside the resolved channels
|
|
57
|
-
*
|
|
58
|
-
*
|
|
57
|
+
* that it may be (any, for a name; its own, for an ID) throws, so it's retried, rather than
|
|
58
|
+
* going past that key's function to the default. The webhook keeps one an ID may be; one only a
|
|
59
|
+
* name may be, it refuses, so the platform sends it again and nothing off the map is stored. A
|
|
60
|
+
* new root starts only in the channels that resolved.
|
|
59
61
|
*/
|
|
60
62
|
function channels(map) {
|
|
61
63
|
const units = Object.entries(map).map(([name, unit]) => [name, typeof unit === "string" ? mirror(unit) : unit]);
|
|
62
64
|
const resolved = async (resolve) => {
|
|
63
65
|
const ids = await Promise.allSettled(units.map(([name]) => resolve(name)));
|
|
64
66
|
const found = /* @__PURE__ */ new Map();
|
|
65
|
-
|
|
67
|
+
const unchecked = [];
|
|
66
68
|
ids.forEach((id, i) => {
|
|
67
69
|
if (id.status === "fulfilled") found.set(id.value, units[i][1]);
|
|
68
|
-
else if (!channelMissing(id.reason)) unchecked
|
|
70
|
+
else if (!channelMissing(id.reason)) unchecked.push({
|
|
71
|
+
key: units[i][0],
|
|
72
|
+
reason: id.reason
|
|
73
|
+
});
|
|
69
74
|
});
|
|
75
|
+
const pending = (channel) => unchecked.find(({ key }) => key.toLowerCase() === channel.toLowerCase()) ?? unchecked.find(({ key }) => key.startsWith("#"));
|
|
70
76
|
return {
|
|
71
77
|
found,
|
|
72
|
-
|
|
78
|
+
pending
|
|
73
79
|
};
|
|
74
80
|
};
|
|
75
81
|
const fn = async (sync) => {
|
|
76
|
-
const { found,
|
|
82
|
+
const { found, pending } = await resolved(sync.resolve);
|
|
77
83
|
if (sync.direction === "out" && sync.target === null) {
|
|
78
84
|
for (const [channel, unit] of found) await unit({
|
|
79
85
|
...sync,
|
|
@@ -83,10 +89,18 @@ function channels(map) {
|
|
|
83
89
|
}
|
|
84
90
|
const unit = found.get(sync.channel);
|
|
85
91
|
if (unit) return void await unit(sync);
|
|
92
|
+
const unchecked = pending(sync.channel);
|
|
86
93
|
if (unchecked) throw unchecked.reason;
|
|
87
94
|
await follow(sync);
|
|
88
95
|
};
|
|
89
|
-
return withRoutes(fn, async (channel, resolve) =>
|
|
96
|
+
return withRoutes(fn, async (channel, resolve) => {
|
|
97
|
+
const { found, pending } = await resolved(resolve);
|
|
98
|
+
if (found.has(channel)) return true;
|
|
99
|
+
const unchecked = pending(channel);
|
|
100
|
+
if (!unchecked) return false;
|
|
101
|
+
if (unchecked.key.startsWith("#")) throw unchecked.reason;
|
|
102
|
+
return true;
|
|
103
|
+
});
|
|
90
104
|
}
|
|
91
105
|
//#endregion
|
|
92
106
|
//#region src/sync/provider.ts
|