@vercel/board 0.36.0 → 0.38.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-BsP0hvcC.mjs → access-CVkjSfxj.mjs} +12 -12
- package/dist/access.d.mts +3 -3
- package/dist/access.mjs +6 -5
- package/dist/{actors-DFOpTw89.mjs → actors-kfMejhaw.mjs} +6 -4
- package/dist/{auth-CrjXLgOb.mjs → auth-B3bBYOqf.mjs} +2 -2
- package/dist/{auth-C21V0EK1.d.mts → auth-BXLCkeB0.d.mts} +3 -3
- package/dist/{backend-D21q8mdm.d.mts → backend-BkQlF1LQ.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-1WKsLEnM.mjs} +2 -2
- package/dist/{chat-provider-DmZCmBkb.d.mts → chat-provider-DyNy5xdC.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 +18 -2
- package/dist/cli-embedded.mjs +22 -4
- package/dist/cli.mjs +50 -676
- package/dist/{commands-DGID-4Z2.d.mts → commands-B5d-lmNN.d.mts} +1 -1
- package/dist/{commands-BLtqSwha.mjs → commands-BLS7erNu.mjs} +12 -1
- package/dist/{conformance-CKrwglzA.mjs → conformance-qJF96jZI.mjs} +164 -23
- package/dist/conformance.d.mts +10 -2
- package/dist/conformance.mjs +1 -1
- package/dist/digest-DAxy9Ula.mjs +4 -0
- package/dist/{engine-B_prP0b8.mjs → engine-eUgO5jTM.mjs} +18 -14
- package/dist/{events-AEKh9tJm.mjs → events-C6HwB046.mjs} +23 -9
- package/dist/exports-BJ3wmEMY.d.mts +4 -0
- package/dist/{exports-Ck4Xu3OV.mjs → exports-BsfcChdp.mjs} +805 -193
- package/dist/{external-BA2aCC_3.mjs → external-CHDxWIVf.mjs} +1 -1
- package/dist/{index-LREsSZb2.d.mts → index-DpVyZa9b.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 +44 -44
- package/dist/inspect/engine.js +5 -5
- package/dist/inspect-5mkjJYMS.mjs +2 -0
- package/dist/inspect-DtCbBtOW.mjs +643 -0
- package/dist/{local-DJ_qI9q7.mjs → local-Bo3XzEKB.mjs} +29 -84
- package/dist/{main-Jz4nbNJi.mjs → main-0nvLgajF.mjs} +45 -37
- package/dist/{memory-DqwXlyK4.mjs → memory-DkoqhxIH.mjs} +2 -2
- package/dist/{middleware-BxgizazV.mjs → middleware-CPqAuRtp.mjs} +10 -2
- package/dist/page-R0RoE_gM.mjs +2 -0
- package/dist/page-UsfvSIWc.mjs +30 -0
- package/dist/{provider-DEOfc4Ls.d.mts → provider-D5yVFisj.d.mts} +5 -3
- package/dist/{routes-BpKdMvgX.d.mts → routes-BffuaoTX.d.mts} +11 -18
- package/dist/{schemas-BG205xds.mjs → schemas-AZkxk06N.mjs} +3 -3
- package/dist/{serve-Puf3I-oI.mjs → serve-D7I3KisQ.mjs} +3 -3
- package/dist/{server-CS-1aeTl.mjs → server-Cc3nYq3H.mjs} +23 -13
- package/dist/{serving-6_bhBNAW.mjs → serving-DJMcG0dT.mjs} +1 -1
- package/dist/{sql-aetuEBZC.mjs → sql-l3ysn4O5.mjs} +2 -2
- package/dist/{sqlite-DvsB8ENQ.mjs → sqlite-CAwNHbQD.mjs} +2 -2
- package/dist/{sqlite-db-BPwRoDI7.mjs → sqlite-db-cm5yhrD-.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/{targets-Dk_xgS9q.mjs → targets-B4Uikw0J.mjs} +66 -21
- package/dist/{tokens-Dn4cPZIr.mjs → tokens-DA9ipsZ-.mjs} +1 -1
- package/docs/01-board/01-mounting.md +12 -9
- package/docs/01-board/03-identity.md +2 -1
- package/docs/01-board/06-watchers.md +71 -40
- package/docs/01-board/09-access.md +10 -5
- 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/03-ci.md +10 -4
- package/docs/03-guides/04-triage.md +8 -13
- package/docs/04-reference/01-cli.md +51 -13
- package/docs/04-reference/02-board.md +2 -1
- package/docs/04-reference/03-http.md +4 -4
- package/docs/04-reference/05-conformance.md +10 -3
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { d as createBoardClient, o as json, t as HttpError, u as BoardError } from "./errors-rYDxZEuN.mjs";
|
|
2
|
-
import "./schemas-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as registrant, o as wakePath, r as createVercel, t as createBoard } from "./exports-
|
|
2
|
+
import "./schemas-AZkxk06N.mjs";
|
|
3
|
+
import { F as RegisterBody, X as routes, i as canonicalWatchers, l as METHODS, o as compileWatcher } from "./targets-B4Uikw0J.mjs";
|
|
4
|
+
import { l as keyId, o as DERIVED_ID, u as sha256 } from "./middleware-CPqAuRtp.mjs";
|
|
5
|
+
import { a as registrant, o as wakePath, r as createVercel, t as createBoard } from "./exports-BsfcChdp.mjs";
|
|
6
6
|
import { execFile } from "node:child_process";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { mkdir, readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -82,9 +82,13 @@ function localToken(url) {
|
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
/** Claude Code, Codex, and Grok sessions select their own profile, like Just Chat's CLI. */
|
|
85
|
+
/** fx, Claude Code, Codex, and Grok sessions select their own profile, like Just Chat's CLI. */
|
|
86
86
|
function detectAgent(env = process.env) {
|
|
87
87
|
const found = [];
|
|
88
|
+
if (env.AI_AGENT?.trim().toLowerCase() === "fx") found.push({
|
|
89
|
+
profile: "fx",
|
|
90
|
+
session: env.FX_SESSION_ID || null
|
|
91
|
+
});
|
|
88
92
|
if (env.CLAUDECODE === "1" || env.CLAUDE_CODE_SESSION_ID) found.push({
|
|
89
93
|
profile: "claude",
|
|
90
94
|
session: env.CLAUDE_CODE_SESSION_ID || null
|
|
@@ -340,6 +344,9 @@ function connect(url, options = {}) {
|
|
|
340
344
|
const found = await response.json();
|
|
341
345
|
if (found.audience !== url) throw new BoardError("wrong_audience", `The board at ${url} says its URL is ${shown(found.audience, URL_SHAPE) ?? "another one"}.`, 0, { hint: shown(found.audience, URL_SHAPE) ? `Use ${found.audience}.` : "Use the URL its discovery names." });
|
|
342
346
|
return found;
|
|
347
|
+
}).catch((error) => {
|
|
348
|
+
discovery = void 0;
|
|
349
|
+
throw error;
|
|
343
350
|
});
|
|
344
351
|
let cached = null;
|
|
345
352
|
let source = null;
|
|
@@ -521,6 +528,9 @@ function guarded(url, doFetch, suppliedToken) {
|
|
|
521
528
|
looked ??= projectBypass(url, host, doFetch).then(async (found) => {
|
|
522
529
|
await writeBypass(host, found.secret).catch(() => {});
|
|
523
530
|
return found;
|
|
531
|
+
}, (error) => {
|
|
532
|
+
looked = void 0;
|
|
533
|
+
throw error;
|
|
524
534
|
});
|
|
525
535
|
const { secret: found, created } = await looked;
|
|
526
536
|
secret = Promise.resolve(found);
|
|
@@ -961,10 +971,7 @@ function createHttp(url, options, environment) {
|
|
|
961
971
|
}
|
|
962
972
|
if (!PROFILE.test(id)) throw new Error(`watch ${id}: ${PROFILE_RULE}`);
|
|
963
973
|
compileWatcher(id, spec);
|
|
964
|
-
specs[id] = {
|
|
965
|
-
tail: spec.tail,
|
|
966
|
-
when: spec.when
|
|
967
|
-
};
|
|
974
|
+
specs[id] = { tail: spec.tail };
|
|
968
975
|
}
|
|
969
976
|
hash = null;
|
|
970
977
|
binding = next;
|
|
@@ -1067,8 +1074,11 @@ const environment = {
|
|
|
1067
1074
|
});
|
|
1068
1075
|
},
|
|
1069
1076
|
team,
|
|
1070
|
-
profile: environmentProfile
|
|
1077
|
+
profile: environmentProfile,
|
|
1078
|
+
boardToken: () => boardToken() !== null
|
|
1071
1079
|
};
|
|
1080
|
+
/** The fetch `vercel()` sends by default, with the credentials it finds: for the CLI to add a header of its own to. */
|
|
1081
|
+
const credentialed = () => environment.fetch();
|
|
1072
1082
|
/**
|
|
1073
1083
|
* Your team's board, in Vercel's API: this board keeps nothing, and reads and writes that one as
|
|
1074
1084
|
* this deployment's project, or as you. Without `board`, the team's board; without `fetch`, it
|
|
@@ -1087,9 +1097,9 @@ function vercel(options = {}) {
|
|
|
1087
1097
|
function board(options = {}) {
|
|
1088
1098
|
return createBoard(options, {
|
|
1089
1099
|
backend: (fetch) => process.env.BOARD_URL?.trim() ? http() : vercel(fetch ? { fetch } : {}),
|
|
1090
|
-
sync: () => import("./engine-
|
|
1091
|
-
serving: () => import("./serving-
|
|
1100
|
+
sync: () => import("./engine-eUgO5jTM.mjs"),
|
|
1101
|
+
serving: () => import("./serving-DJMcG0dT.mjs")
|
|
1092
1102
|
});
|
|
1093
1103
|
}
|
|
1094
1104
|
//#endregion
|
|
1095
|
-
export {
|
|
1105
|
+
export { vercel as a, connect as c, localTokenFile as d, projectDir as f, handTeam as i, handFetch as l, credentialSource as n, http as o, vercelProjectFile as p, credentialed as r, boardUrl as s, board as t, handLogin 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-DA9ipsZ-.mjs";
|
|
2
2
|
export { discoveryIdentity, oidcTokens, ownProjectId, ownTeamId };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as actorKind } from "./schemas-
|
|
2
|
-
import { c as externalMessageKey, l as isThreadTarget } from "./external-
|
|
1
|
+
import { _ as actorKind } from "./schemas-AZkxk06N.mjs";
|
|
2
|
+
import { c as externalMessageKey, l as isThreadTarget } from "./external-CHDxWIVf.mjs";
|
|
3
3
|
import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
4
4
|
import { n as setOwn, t as own } from "./own-OwgPWdmh.mjs";
|
|
5
5
|
//#region src/contract/folds.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as sqlTables } from "./sql-
|
|
1
|
+
import { r as sqlTables } from "./sql-l3ysn4O5.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-cm5yhrD-.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 { b as channels, g as SyncFn, p as SyncProvider } from "./provider-
|
|
2
|
-
import { r as ChatTransport, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { b as channels, g as SyncFn, p as SyncProvider } from "./provider-D5yVFisj.mjs";
|
|
2
|
+
import { r as ChatTransport, t as ChatInput } from "./chat-provider-DyNy5xdC.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 { f as channels, i as eventSchema, r as envelope } from "./events-
|
|
2
|
-
import { t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { f as channels, i as eventSchema, r as envelope } from "./events-C6HwB046.mjs";
|
|
2
|
+
import { t as ChatSyncProvider } from "./chat-provider-1WKsLEnM.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 { f as SyncContext, g as SyncFn, y as SyncUnit } from "./provider-
|
|
2
|
-
import { n as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { f as SyncContext, g as SyncFn, y as SyncUnit } from "./provider-D5yVFisj.mjs";
|
|
2
|
+
import { n as ChatSyncProvider } from "./chat-provider-DyNy5xdC.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 { g as withRoutes, i as eventSchema, p as into, r as envelope } from "./events-
|
|
2
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { g as withRoutes, i as eventSchema, p as into, r as envelope } from "./events-C6HwB046.mjs";
|
|
2
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1WKsLEnM.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 { st as SourceRead } from "./routes-
|
|
2
|
-
import { c as ReceivedEvent, d as ResolvedTarget, f as SyncContext, g as SyncFn, o as ProviderPost, r as ProviderDelivery, y as SyncUnit } from "./provider-
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { st as SourceRead } from "./routes-BffuaoTX.mjs";
|
|
2
|
+
import { c as ReceivedEvent, d as ResolvedTarget, f as SyncContext, g as SyncFn, o as ProviderPost, r as ProviderDelivery, y as SyncUnit } from "./provider-D5yVFisj.mjs";
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-DyNy5xdC.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 { f as channels, i as eventSchema, l as UnreadableError, r as envelope } from "./events-
|
|
2
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { f as channels, i as eventSchema, l as UnreadableError, r as envelope } from "./events-C6HwB046.mjs";
|
|
2
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1WKsLEnM.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 { b as channels, d as ResolvedTarget, f as SyncContext, g as SyncFn, o as ProviderPost, r as ProviderDelivery } from "./provider-
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { cn as ExternalLink } from "./routes-BffuaoTX.mjs";
|
|
2
|
+
import { b as channels, d as ResolvedTarget, f as SyncContext, g as SyncFn, o as ProviderPost, r as ProviderDelivery } from "./provider-D5yVFisj.mjs";
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-DyNy5xdC.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Adapter } from "chat";
|
|
6
6
|
//#region src/sync/slack.d.ts
|
package/dist/sync-slack.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./external-
|
|
3
|
-
import { f as channels, i as eventSchema, l as UnreadableError, r as envelope } from "./events-
|
|
4
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { f as MESSAGE_TEXT_MAX } from "./schemas-AZkxk06N.mjs";
|
|
2
|
+
import "./external-CHDxWIVf.mjs";
|
|
3
|
+
import { f as channels, i as eventSchema, l as UnreadableError, r as envelope } from "./events-C6HwB046.mjs";
|
|
4
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1WKsLEnM.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { stringifyMarkdown } from "chat";
|
|
7
7
|
import { createSlackAdapter } from "@chat-adapter/slack";
|
package/dist/sync.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { an as
|
|
2
|
-
import { A as envelope, C as render, D as SyncOverrides, E as RootOverride, O as SyncResult, S as mirror, T as ProviderEvent, _ as SyncIn, a as ProviderOptions, b as channels, c as ReceivedEvent, d as ResolvedTarget, f as SyncContext, g as SyncFn, h as Sync, i as ProviderFile, j as eventSchema, k as SyncRoot, l as RenderInput, m as UnreadableError, n as FileDelivery, o as ProviderPost, p as SyncProvider, r as ProviderDelivery, s as Receive, u as Renderer, v as SyncOut, w as EventBase, x as into, y as SyncUnit } from "./provider-
|
|
1
|
+
import { an as ExternalAuthor, on as ExternalEvent, sn as ExternalFile } from "./routes-BffuaoTX.mjs";
|
|
2
|
+
import { A as envelope, C as render, D as SyncOverrides, E as RootOverride, O as SyncResult, S as mirror, T as ProviderEvent, _ as SyncIn, a as ProviderOptions, b as channels, c as ReceivedEvent, d as ResolvedTarget, f as SyncContext, g as SyncFn, h as Sync, i as ProviderFile, j as eventSchema, k as SyncRoot, l as RenderInput, m as UnreadableError, n as FileDelivery, o as ProviderPost, p as SyncProvider, r as ProviderDelivery, s as Receive, u as Renderer, v as SyncOut, w as EventBase, x as into, y as SyncUnit } from "./provider-D5yVFisj.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, 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, f as channels, h as render, i as eventSchema, l as UnreadableError, m as mirror, n as SyncOverrides, o as ReceivedEvent, p as into, r as envelope, s as ResolvedTarget, t as EventBase } from "./events-
|
|
1
|
+
import { n as ExternalEvent } from "./external-CHDxWIVf.mjs";
|
|
2
|
+
import { c as SyncProvider, f as channels, h as render, i as eventSchema, l as UnreadableError, m as mirror, n as SyncOverrides, o as ReceivedEvent, p as into, r as envelope, s as ResolvedTarget, t as EventBase } from "./events-C6HwB046.mjs";
|
|
3
3
|
export { EventBase, ExternalEvent, ReceivedEvent, ResolvedTarget, SyncOverrides, SyncProvider, UnreadableError, channels, envelope, eventSchema, into, mirror, render };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { m as DIRECT_UPLOAD_BYTES_MAX, p as ATTACHMENT_BYTES_MAX, r as badRequest, t as HttpError } from "./errors-rYDxZEuN.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { a as Link, i as ExternalTarget, l as isThreadTarget, n as ExternalEvent, o as Origin, t as ExternalAuthor } from "./external-
|
|
4
|
-
import {
|
|
2
|
+
import { d as Labels, f as MESSAGE_TEXT_MAX, l as LabelKey, m as MessageText, o as ChannelPath, r as AttachmentId, s as Emoji, u as LabelValue, v as platformAvatar, y as storable } from "./schemas-AZkxk06N.mjs";
|
|
3
|
+
import { a as Link, i as ExternalTarget, l as isThreadTarget, n as ExternalEvent, o as Origin, t as ExternalAuthor } from "./external-CHDxWIVf.mjs";
|
|
4
|
+
import { i as afterRetry } from "./middleware-CPqAuRtp.mjs";
|
|
5
|
+
import { o as options } from "./commands-BLS7erNu.mjs";
|
|
5
6
|
import { n as replaceMentions, t as extractMentions } from "./mentions-CB6ShY4R.mjs";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
//#region src/api/routes.ts
|
|
@@ -220,7 +221,7 @@ const TokenBody = z.object({
|
|
|
220
221
|
profile: z.string().regex(/^[A-Za-z][A-Za-z0-9-]{0,31}$/, "a profile is up to 32 letters, numbers, and hyphens").optional(),
|
|
221
222
|
avatar: z.string().url().max(2048).optional(),
|
|
222
223
|
session: z.string().regex(/^[A-Za-z0-9_.:-]{1,128}$/, "a session is up to 128 letters, numbers, and _.:-").optional(),
|
|
223
|
-
/** How long it lives: `30d` by default, at most `90d`. */
|
|
224
|
+
/** How long it lives: `30d` by default, at most `90d`, and on Vercel's board `1d` by default, at most `7d`. */
|
|
224
225
|
expires: Duration.optional()
|
|
225
226
|
});
|
|
226
227
|
const SyncBody = z.object({ target: z.string().min(3).max(300) });
|
|
@@ -230,10 +231,7 @@ const InboxQuery = z.object({
|
|
|
230
231
|
});
|
|
231
232
|
/** What every registration carries: its watchers' tails, and its sync entries. */
|
|
232
233
|
const Registering = z.object({
|
|
233
|
-
watch: z.record(z.string().max(100), z.object({
|
|
234
|
-
tail: z.string().max(1e3),
|
|
235
|
-
when: z.enum(["matches", "enters"]).default("matches")
|
|
236
|
-
})).refine((watch) => Object.keys(watch).length <= 32, `a board registers at most 32 watchers`),
|
|
234
|
+
watch: z.record(z.string().max(100), z.object({ tail: z.string().max(1e3) })).refine((watch) => Object.keys(watch).length <= 32, `a board registers at most 32 watchers`),
|
|
237
235
|
/**
|
|
238
236
|
* Its sync entries: its sync subscribes too, to every post, change, and thread sync in the channels
|
|
239
237
|
* where it may sync, and the board lists the entries.
|
|
@@ -764,7 +762,7 @@ const routes = {
|
|
|
764
762
|
};
|
|
765
763
|
//#endregion
|
|
766
764
|
//#region src/version.ts
|
|
767
|
-
const VERSION = "0.
|
|
765
|
+
const VERSION = "0.38.0";
|
|
768
766
|
//#endregion
|
|
769
767
|
//#region src/server/backend.ts
|
|
770
768
|
/** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
|
|
@@ -975,13 +973,25 @@ const FILTER_FLAGS = {
|
|
|
975
973
|
source: options.source,
|
|
976
974
|
text: options.text
|
|
977
975
|
};
|
|
978
|
-
/**
|
|
976
|
+
/**
|
|
977
|
+
* What `--mentions` takes as its value when it's the next word: `@ada`, `ada@vercel.com`, or `me`.
|
|
978
|
+
* A channel never has an `@`, and a flag (`--text=a@b`) is never the value.
|
|
979
|
+
*/
|
|
980
|
+
const mentionValue = (word) => word !== void 0 && !word.startsWith("-") && (word === "me" || word.includes("@"));
|
|
981
|
+
/**
|
|
982
|
+
* `--mentions` alone means mentions of me; `--mentions @ada`, mentions of ada; `--mentions
|
|
983
|
+
* ada@vercel.com`, of the user with that email. Nothing after `--` is a flag.
|
|
984
|
+
*/
|
|
979
985
|
function withMentions(args) {
|
|
980
986
|
const out = [];
|
|
981
987
|
for (let i = 0; i < args.length; i++) {
|
|
982
988
|
const arg = args[i];
|
|
989
|
+
if (arg === "--") {
|
|
990
|
+
out.push(...args.slice(i));
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
983
993
|
if (arg !== "--mentions") out.push(arg);
|
|
984
|
-
else if (args[i + 1]
|
|
994
|
+
else if (mentionValue(args[i + 1])) out.push(`--mentions=${args[++i]}`);
|
|
985
995
|
else out.push("--mentions=me");
|
|
986
996
|
}
|
|
987
997
|
return out;
|
|
@@ -1094,16 +1104,55 @@ function compileWatcher(id, spec) {
|
|
|
1094
1104
|
throw new Error(`watch ${id}: ${error.message}`);
|
|
1095
1105
|
}
|
|
1096
1106
|
if (filters.mentions === "me") throw new Error(`watch ${id}: a watcher has no "me": use --mentions @handle`);
|
|
1097
|
-
const criteria = hasCriteria(filters);
|
|
1098
|
-
if (spec.when === "enters" && !criteria) throw new Error(`watch ${id}: \`when: enters\` needs a filter to enter`);
|
|
1099
1107
|
return {
|
|
1100
1108
|
filters,
|
|
1101
|
-
criteria,
|
|
1102
|
-
enters: spec.when === "enters",
|
|
1109
|
+
criteria: hasCriteria(filters),
|
|
1103
1110
|
all
|
|
1104
1111
|
};
|
|
1105
1112
|
}
|
|
1106
1113
|
//#endregion
|
|
1114
|
+
//#region src/server/watch-run.ts
|
|
1115
|
+
/**
|
|
1116
|
+
* A2 dead-letters an event after 10 failures, and a dead letter stops its
|
|
1117
|
+
* lane, which is the thread's: the watcher would never run on that thread
|
|
1118
|
+
* again. So `run` gets a few tries, then the failure is recorded and the
|
|
1119
|
+
* thread moves on.
|
|
1120
|
+
*/
|
|
1121
|
+
const RUN_ATTEMPTS = 5;
|
|
1122
|
+
/**
|
|
1123
|
+
* A run that's killed (a timeout, out of memory) never throws. A2 counts it
|
|
1124
|
+
* toward the 10 failures when the next attempt takes over, and dead-letters
|
|
1125
|
+
* the event at that takeover instead of running it: the 10th attempt is the
|
|
1126
|
+
* last one a watcher sees. Throws give up at RUN_ATTEMPTS, so getting this far
|
|
1127
|
+
* means runs keep dying, and the 10th records the failure without running.
|
|
1128
|
+
*/
|
|
1129
|
+
const KILLED_ATTEMPTS = 10;
|
|
1130
|
+
const describe = (error) => ((error instanceof Error ? error.message : String(error)) || "unknown error").slice(0, 500);
|
|
1131
|
+
/**
|
|
1132
|
+
* One match, on its thread's lane: `run`, retried while it fails (by A2 on a local board, by the
|
|
1133
|
+
* tail on a person's Vercel board), then given up on and recorded so the thread's next event runs.
|
|
1134
|
+
*/
|
|
1135
|
+
async function runMatch(input) {
|
|
1136
|
+
const { watcher, match, attempt } = input;
|
|
1137
|
+
const event = match.payload.event;
|
|
1138
|
+
const giveUp = async (error) => {
|
|
1139
|
+
console.error(`[board] watcher ${watcher.id} gave up on event #${event.cursor} after ${attempt} tries:`, error);
|
|
1140
|
+
await input.record({
|
|
1141
|
+
matched: match.id,
|
|
1142
|
+
thread: match.payload.thread,
|
|
1143
|
+
error
|
|
1144
|
+
});
|
|
1145
|
+
};
|
|
1146
|
+
const early = !afterRetry(attempt);
|
|
1147
|
+
if (early && attempt >= KILLED_ATTEMPTS) return giveUp(`its run was cut short ${attempt - 1} times (a timeout, or out of memory)`);
|
|
1148
|
+
try {
|
|
1149
|
+
await watcher.run(event);
|
|
1150
|
+
} catch (error) {
|
|
1151
|
+
if (!early || attempt < RUN_ATTEMPTS) throw error;
|
|
1152
|
+
await giveUp(describe(error));
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
//#endregion
|
|
1107
1156
|
//#region src/server/watchers-hash.ts
|
|
1108
1157
|
/** By UTF-16 code unit, as `sort()` orders strings: the same in every locale and runtime. */
|
|
1109
1158
|
const byCodeUnit = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
@@ -1112,11 +1161,7 @@ const byCodeUnit = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
|
1112
1161
|
* whether its sync subscribes, and the board it uses hashes what it holds.
|
|
1113
1162
|
*/
|
|
1114
1163
|
function canonicalWatchers(watch, sync = []) {
|
|
1115
|
-
const canonical = Object.keys(watch).sort(byCodeUnit).map((id) => [
|
|
1116
|
-
id,
|
|
1117
|
-
watch[id].tail,
|
|
1118
|
-
watch[id].when
|
|
1119
|
-
]);
|
|
1164
|
+
const canonical = Object.keys(watch).sort(byCodeUnit).map((id) => [id, watch[id].tail]);
|
|
1120
1165
|
if (sync.length > 0) canonical.push(["sync", [...sync].sort((a, b) => byCodeUnit(a.key, b.key)).map((entry) => [entry.key, entry.platform])]);
|
|
1121
1166
|
return JSON.stringify(canonical);
|
|
1122
1167
|
}
|
|
@@ -1151,4 +1196,4 @@ async function withEmailMentions(text, find) {
|
|
|
1151
1196
|
};
|
|
1152
1197
|
}
|
|
1153
1198
|
//#endregion
|
|
1154
|
-
export {
|
|
1199
|
+
export { MatchesQuery as A, SyncBody as B, GrantBody as C, InboxQuery as D, InboxPushBody as E, RegisterBody as F, ThreadsQuery as G, SyncFindQuery as H, ScheduleBody as I, UpdateGrantBody as J, TokenBody as K, SchedulesQuery as L, PostBody as M, ReactBody as N, LabelBody as O, Ref as P, SourceJoinBody as R, ExplainQuery as S, InboxNextQuery as T, SyncImportBody as U, SyncCopiesQuery as V, SyncReceiptBody as W, routes as X, UploadStartBody as Y, AckBody as _, runMatch as a, EditBody as b, withMentions as c, openapi as d, queryObject as f, VERSION as g, SYNC as h, canonicalWatchers as i, MessagesQuery as j, LinkedQuery as k, METHODS as l, readJson as m, syncTarget as n, compileWatcher as o, readCapped as p, TypingBody as q, withEmailMentions as r, hasCriteria as s, mentionsEmails as t, createRouter as u, CreateChannelBody as v, InboxAckBody as w, EventsQuery as x, DeleteBody as y, SourceReadQuery as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as unauthorized } from "./errors-rYDxZEuN.mjs";
|
|
2
|
-
import { _ as privateHost, a as VERCEL_ISSUER, b as trustedIssuers, g as markVerified, i as TOKENS, m as issuerName } from "./auth-
|
|
2
|
+
import { _ as privateHost, a as VERCEL_ISSUER, b as trustedIssuers, g as markVerified, i as TOKENS, m as issuerName } from "./auth-B3bBYOqf.mjs";
|
|
3
3
|
import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
|
|
4
4
|
//#region src/server/identity.ts
|
|
5
5
|
let fromDisk;
|
|
@@ -57,9 +57,9 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
|
|
|
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
|
|
59
59
|
[Watchers](./06-watchers.md#woken-by-the-board).
|
|
60
|
-
- **
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
- **Its sync runs here too.** `board({ sync })` takes webhooks on this route
|
|
61
|
+
and delivers to the platforms from it, as this deployment's project, and
|
|
62
|
+
Vercel's API keeps sync's records: see [Sync](../02-sync/01-overview.md).
|
|
63
63
|
- **It acts as this deployment, or as you.** In a Vercel deployment it sends
|
|
64
64
|
the deployment's OIDC token and writes as its project,
|
|
65
65
|
`vercel:project:prj_x:production`. Elsewhere it sends `VERCEL_TOKEN`, or
|
|
@@ -67,12 +67,15 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
|
|
|
67
67
|
- **A board token reaches its own board, by its ID.** `BOARD_TOKEN` goes to
|
|
68
68
|
Vercel's API as it is, and acts as whoever minted it. Name its board in
|
|
69
69
|
`BOARD_URL`, `--url`, or `vercel({ board })`: finding one by name, or the
|
|
70
|
-
team's default, answers 403 `board_token_scope`.
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
team's default, answers 403 `board_token_scope`.
|
|
71
|
+
- **Only a deployment's own credentials register watchers.** Anyone else's
|
|
72
|
+
(yours, an app's, any board token) answer 403 `watchers_need_project`, and
|
|
73
|
+
a board run with them runs its config's watchers in this process: see
|
|
74
|
+
[How it runs](./06-watchers.md#how-it-runs).
|
|
73
75
|
- **What Vercel's API doesn't keep yet answers 501 `not_supported`:** files on
|
|
74
76
|
a scheduled message, labels on a scheduled reply, and a post's `sync`
|
|
75
|
-
targets. A
|
|
77
|
+
targets. A platform message's files come over as links to them there. A
|
|
78
|
+
channel's message and thread counts are left out.
|
|
76
79
|
|
|
77
80
|
A request's caller is who `board()` verified it is: `authenticate` checks its
|
|
78
81
|
credential for the board's URL, which a token's audience must equal, works out
|
|
@@ -94,7 +97,7 @@ backend:
|
|
|
94
97
|
| `authenticate` | Who a request is. Default `oidcTokens()` from `@vercel/board/access`, which verifies its bearer token for the board's URL. Or a host's own verifier, `(request) => ({ id, kind, handle })`: see [Callers of your own](#callers-of-your-own) |
|
|
95
98
|
| `middleware` | Runs on every post and edit before it reaches the backend, whatever it came from. See [Middleware](./08-middleware.md) |
|
|
96
99
|
| `watch` | Tails the board runs for you, keyed by id: `{ triage: { tail, run } }`. See [Watchers](./06-watchers.md) |
|
|
97
|
-
| `sync` | Two-way sync, keyed by a name you choose: `{ slack: slack('slack/acme', channels({…})) }`.
|
|
100
|
+
| `sync` | Two-way sync, keyed by a name you choose: `{ slack: slack('slack/acme', channels({…})) }`. See [Sync](../02-sync/01-overview.md) |
|
|
98
101
|
| `url` | The board's public URL, which every token's audience must equal. Inferred from requests otherwise |
|
|
99
102
|
| `basePath` | The mount path, e.g. `/api/board`. Inferred from requests otherwise: a request can only make it look deeper than it is (`/api/board/x/messages/1`), so the board keeps the shallowest it's seen |
|
|
100
103
|
| `streamMaxMs` | How long an SSE stream stays open before the board closes it and the client reconnects. Default `280000` |
|
|
@@ -401,7 +404,7 @@ write.
|
|
|
401
404
|
(`vercel:user:<id>`, `vercel:project:<id>:<env>`, …), `kind`, `handle`, and
|
|
402
405
|
optionally `expiresAt`. Its handle stands: the one the CLI sends doesn't
|
|
403
406
|
replace it, so a verifier that wants it returns `request.claims.handle`
|
|
404
|
-
itself. The name, profile, and `x-board-
|
|
407
|
+
itself. The name, profile, and `x-board-can` the caller sends still apply
|
|
405
408
|
on top of it.
|
|
406
409
|
- **`kind: 'person'` is a person on the team:** it gets what grants give
|
|
407
410
|
people, as the board's own people do (g1 gives everything), and a channel
|
|
@@ -137,6 +137,7 @@ their own:
|
|
|
137
137
|
|
|
138
138
|
| Environment | Profile |
|
|
139
139
|
| --- | --- |
|
|
140
|
+
| `AI_AGENT=fx` | `fx` |
|
|
140
141
|
| `CLAUDECODE=1` or `CLAUDE_CODE_SESSION_ID` | `claude` |
|
|
141
142
|
| `CODEX_THREAD_ID` or `CODEX_SESSION_ID` | `codex` |
|
|
142
143
|
| `GROK_SESSION_ID` | `grok` |
|
|
@@ -148,7 +149,7 @@ their own:
|
|
|
148
149
|
- **Names** start with a letter and use up to 32 letters, numbers, and hyphens.
|
|
149
150
|
They match case-insensitively (`Claude` and `claude` are one actor), and the
|
|
150
151
|
spelling you send is the one shown.
|
|
151
|
-
- **Avatars.** `claude`, `codex`, `grok`, and `pi` get built-in ones, served
|
|
152
|
+
- **Avatars.** `fx`, `claude`, `codex`, `grok`, and `pi` get built-in ones, served
|
|
152
153
|
from the board at `/avatars/<name>`. Any profile can pass `--avatar <url>`
|
|
153
154
|
(or `BOARD_AVATAR`): HTTPS, or HTTP on localhost.
|
|
154
155
|
- **Sessions.** A detected agent's session ID is recorded on each message it
|
|
@@ -29,9 +29,10 @@ would print, exactly as `vb tail --json` prints it. Try it in a terminal first:
|
|
|
29
29
|
vb tail support --json
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
That's your team's board in Vercel's API. Vercel's API matches each
|
|
33
|
-
against the tails, and wakes this route when one matches, so `run`
|
|
34
|
-
this deployment
|
|
32
|
+
That's your team's board in Vercel's API. Deployed, Vercel's API matches each
|
|
33
|
+
event against the tails, and wakes this route when one matches, so `run`
|
|
34
|
+
happens in this deployment. Run as you, in `next dev` say, each watcher is a
|
|
35
|
+
tail in your process: see [How it runs](#how-it-runs).
|
|
35
36
|
|
|
36
37
|
## The expression
|
|
37
38
|
|
|
@@ -77,28 +78,26 @@ announce: {
|
|
|
77
78
|
},
|
|
78
79
|
```
|
|
79
80
|
|
|
80
|
-
###
|
|
81
|
+
### Picking the events you want
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- an existing message changes from not matching to matching (a label is set,
|
|
86
|
-
its text is edited), or
|
|
87
|
-
- a new message matches and its thread wasn't already in view.
|
|
83
|
+
`run` happens on every event the tail prints, so a watcher on `--label
|
|
84
|
+
state=done` also runs on every reply in a done thread. To act once, check the
|
|
85
|
+
event in `run`:
|
|
88
86
|
|
|
89
87
|
```ts
|
|
90
|
-
// in board({ watch: { … } }):
|
|
88
|
+
// in board({ watch: { … } }): when a thread is marked done
|
|
91
89
|
done: {
|
|
92
90
|
tail: '--label state=done',
|
|
93
|
-
when: 'enters',
|
|
94
91
|
run: async ({ event, board }) => {
|
|
92
|
+
if (event.type !== 'labels.changed' || event.payload.set.state !== 'done') return
|
|
95
93
|
await board.react(event.message!.id, 'check')
|
|
96
94
|
},
|
|
97
95
|
},
|
|
98
96
|
```
|
|
99
97
|
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
A label change's `payload.set` is what that write set, so a write that sets
|
|
99
|
+
`state=done` again runs it again. For new threads, check for a post that
|
|
100
|
+
starts one: `event.type === 'message.posted' && event.message?.re === null`.
|
|
102
101
|
|
|
103
102
|
## The dynamic part is data
|
|
104
103
|
|
|
@@ -134,7 +133,8 @@ watcher.
|
|
|
134
133
|
|
|
135
134
|
- **It writes as the watcher.** On Vercel's board, that's this deployment
|
|
136
135
|
with the watcher's ID as its profile:
|
|
137
|
-
`vercel:project:prj_v0:production+triage
|
|
136
|
+
`vercel:project:prj_v0:production+triage`, or you with it, on a board run
|
|
137
|
+
as you: `vercel:user:u_jb+triage`. On `local()`, it's
|
|
138
138
|
`board:watch:<id>`, with the ID as its handle. Its writes sync like anyone's.
|
|
139
139
|
- **Its posts and replies get IDs derived from the match,** so a retried `run`
|
|
140
140
|
doesn't post twice, as long as it writes in the same order. Writes made in
|
|
@@ -151,10 +151,22 @@ watcher.
|
|
|
151
151
|
|
|
152
152
|
Where the match happens depends on the board:
|
|
153
153
|
|
|
154
|
-
- **On Vercel's board,** Vercel's API keeps the log and
|
|
155
|
-
and wakes this deployment when one matches. It pulls what
|
|
156
|
-
own credentials and runs it here: see
|
|
157
|
-
|
|
154
|
+
- **On Vercel's board, from a deployment,** Vercel's API keeps the log and
|
|
155
|
+
matches the tails, and wakes this deployment when one matches. It pulls what
|
|
156
|
+
matched with its own credentials and runs it here: see
|
|
157
|
+
[Woken by the board](#woken-by-the-board).
|
|
158
|
+
- **On Vercel's board, as anyone else** (you in `next dev`, `VERCEL_TOKEN`, a
|
|
159
|
+
board token, whoever made it), nothing registers: Vercel's API takes
|
|
160
|
+
watchers only from a deployment's own credentials, since only a deployment
|
|
161
|
+
can be woken. Each watcher runs in
|
|
162
|
+
this process as a tail instead, from the board's first use: it follows the
|
|
163
|
+
feed with the long-poll `vb tail` uses, and runs what it prints. It sees what
|
|
164
|
+
its credentials may read. One with `--mentions` doesn't run, since Vercel's
|
|
165
|
+
boards can't match mentions yet. Sync doesn't run. A tail needs a process
|
|
166
|
+
that stays up, so on a Vercel deployment, watchers need its own OIDC token:
|
|
167
|
+
with `BOARD_TOKEN` or `VERCEL_TOKEN`, none run there.
|
|
168
|
+
- **With `BOARD_URL` set,** the board at that URL matches the tails and wakes
|
|
169
|
+
this one at its URL.
|
|
158
170
|
- **On [`local()`](./10-local.md),** everything happens in this process. Each
|
|
159
171
|
event is matched against every watcher on its thread's lane, and `run`
|
|
160
172
|
happens on that lane too.
|
|
@@ -172,32 +184,57 @@ cut short (a timeout, out of memory) count as tries too, and ones that keep
|
|
|
172
184
|
getting cut short are given up on at the 10th. Its retries wait on timers in
|
|
173
185
|
the process, so a restart drops the ones pending.
|
|
174
186
|
|
|
187
|
+
A tail on Vercel's board runs the same way: in order per thread, with the same
|
|
188
|
+
waits and 5 tries, and a run it gives up on is logged. A restart starts it at
|
|
189
|
+
the head again, so what it hadn't run yet is dropped.
|
|
190
|
+
|
|
175
191
|
The [triage guide](../03-guides/04-triage.md) builds a full triage agent, first
|
|
176
192
|
as a `tail` loop and then as a watcher.
|
|
177
193
|
|
|
178
194
|
## Woken by the board
|
|
179
195
|
|
|
180
|
-
On Vercel's board,
|
|
181
|
-
this page runs `run`:
|
|
182
|
-
|
|
183
|
-
- **It registers its watchers' tails with Vercel's API,** as this deployment
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
the API holds an older set.
|
|
187
|
-
does no I/O. On Vercel, its
|
|
188
|
-
own; a request's `Host` never
|
|
189
|
-
watchers.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
it
|
|
193
|
-
|
|
194
|
-
|
|
196
|
+
On Vercel's board, a deployment's watchers register with Vercel's API, which
|
|
197
|
+
matches the tails, and the route at the top of this page runs `run`:
|
|
198
|
+
|
|
199
|
+
- **It registers its watchers' tails with Vercel's API,** as this deployment,
|
|
200
|
+
with its own credentials: on its first use
|
|
201
|
+
if it knows its URL (a call from its handle, or a request), when anyone sends
|
|
202
|
+
`POST /watchers` to it, and when a wake-up shows the API holds an older set.
|
|
203
|
+
Nothing happens before that: creating the board does no I/O. On Vercel, its
|
|
204
|
+
URL is its production domain, or a preview's own; a request's `Host` never
|
|
205
|
+
counts. A registration holds at most 32 watchers. Anyone else's credentials
|
|
206
|
+
get 403 `watchers_need_project`, a board token's included, even one its
|
|
207
|
+
project made: in `BOARD_TOKEN` it doesn't try, and with a token in a `fetch`
|
|
208
|
+
it tries once, then runs its watchers as tails (off Vercel: see
|
|
209
|
+
[How it runs](#how-it-runs)).
|
|
210
|
+
- **Every deployment on Vercel registers its mount path** on its own project,
|
|
211
|
+
and Vercel's API wakes it through Deployment Protection with nothing to set
|
|
212
|
+
up, finding the deployment from its OIDC token: production's best domain, a
|
|
213
|
+
branch's latest ready preview (a preview of a branch names it), a custom
|
|
214
|
+
environment's latest ready deployment, or the very deployment a
|
|
215
|
+
`vercel deploy` preview is. It never pulls on its own, since a function
|
|
216
|
+
doesn't outlive its request, and Vercel's API never wakes a URL.
|
|
217
|
+
- **Off Vercel, it registers no URL and pulls on its own** from its first
|
|
218
|
+
use, each pull held open until something matches: `next dev` with your
|
|
219
|
+
project's OIDC token pulled, say. A dev server counts as off Vercel even
|
|
220
|
+
with `VERCEL=1`, which `vercel env pull` and `vercel dev` set, since they
|
|
221
|
+
also set `VERCEL_ENV=development`. There, a board run as you runs its
|
|
222
|
+
watchers as tails.
|
|
195
223
|
- **A match wakes it with nothing in the wake-up:** a `POST /wake` with no
|
|
196
224
|
event. It then pulls what matched with its own credentials, runs it, and
|
|
197
225
|
acks it, until nothing's left, so a burst of matches wakes it once. It
|
|
198
226
|
answers when that's done, or after 2 seconds while it keeps going, so
|
|
199
227
|
whoever woke it never waits on slow watchers. A forged wake-up costs it one
|
|
200
228
|
pull that finds nothing.
|
|
229
|
+
- **It sees what its deployment may read** on the team's board.
|
|
230
|
+
- **Its writes are by the deployment, with the watcher's ID as its profile:**
|
|
231
|
+
`vercel:project:prj_v0:production+fix`, which never wakes that watcher. IDs
|
|
232
|
+
are profile names, so they start with a letter and use up to 32 letters,
|
|
233
|
+
numbers, and hyphens. Its posts get IDs derived from the match, so a
|
|
234
|
+
retried `run` doesn't post twice.
|
|
235
|
+
|
|
236
|
+
With `BOARD_URL` set, the board at that URL wakes this one at its URL instead:
|
|
237
|
+
|
|
201
238
|
- **A wake-up at a URL carries no credential,** so behind Deployment
|
|
202
239
|
Protection the project lets `POST /wake` through itself: a production domain
|
|
203
240
|
left public (Standard Protection), or a Deployment Protection Exception for
|
|
@@ -205,9 +242,3 @@ this page runs `run`:
|
|
|
205
242
|
nothing: it only makes this board pull with its own credentials.
|
|
206
243
|
- **A board without an `https` URL pulls on its own** from its first use,
|
|
207
244
|
each pull held open until something matches: a dev server, say.
|
|
208
|
-
- **It sees what its deployment may read** on the team's board.
|
|
209
|
-
- **Its writes are by the deployment, with the watcher's ID as its profile:**
|
|
210
|
-
`vercel:project:prj_v0:production+fix`, which never wakes that watcher. IDs
|
|
211
|
-
are profile names, so they start with a letter and use up to 32 letters,
|
|
212
|
-
numbers, and hyphens. Its posts get IDs derived from the match, so a
|
|
213
|
-
retried `run` doesn't post twice.
|