@vercel/board 0.32.0 → 0.34.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/README.md +25 -20
- package/dist/{access-CY5xVMIK.mjs → access-CdBcYPQH.mjs} +170 -13
- package/dist/access.d.mts +4 -5
- package/dist/access.mjs +5 -5
- package/dist/{actors-Bm-ojWWT.mjs → actors-MrIEr9LI.mjs} +3 -3
- package/dist/auth-DjoJygbG.mjs +599 -0
- package/dist/{auth-K8dY1nBY.d.mts → auth-aaoKt5DK.d.mts} +133 -100
- package/dist/backend-local.d.mts +28 -0
- package/dist/backend-local.mjs +2 -0
- package/dist/{backend-DxE9wGKm.d.mts → backend-u1sVvybh.d.mts} +108 -55
- package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
- package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-De0iDnUB.d.mts} +2 -3
- 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 +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/{commands-DsnQKTdB.mjs → commands-B8oZEByR.mjs} +37 -52
- package/dist/{commands-CpyPV_tk.d.mts → commands-BkVMdXP1.d.mts} +9 -6
- package/dist/{conformance-3RBKxwbp.mjs → conformance-gqYBkXFS.mjs} +79 -86
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DurYIRt8.mjs → engine-rtOVWsiF.mjs} +6 -8
- package/dist/{errors-CJXhhzvT.mjs → errors-D8ifv16L.mjs} +75 -6
- package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
- package/dist/exports-Bx2dGpzr.mjs +3252 -0
- package/dist/exports-uwRl5qIj.d.mts +4 -0
- package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
- package/dist/index-D6mK0Ial.d.mts +11 -0
- package/dist/index.d.mts +10 -9
- package/dist/index.mjs +21 -8
- package/dist/index.node.d.mts +6 -7
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +95 -95
- package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
- package/dist/local-CPz22MQ8.mjs +9225 -0
- package/dist/{main-CcYDo9Hb.mjs → main-DScDKwQN.mjs} +129 -54
- package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
- package/dist/middleware-BjYpk4yq.mjs +103 -0
- package/dist/{provider-gynDUoyW.d.mts → provider-hB8QNrwm.d.mts} +369 -3
- package/dist/{client-COfYrgfV.d.mts → routes-De4W6lEs.d.mts} +997 -367
- package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
- package/dist/{serve-Bplieh0C.mjs → serve-B1noQRkn.mjs} +33 -24
- package/dist/{node-BgeGcwX0.mjs → server-Ov6GBJ8j.mjs} +419 -6
- package/dist/{serving-Y7s7VDjB.mjs → serving-2s7lqSBS.mjs} +1 -1
- package/dist/{sql-E1K5g_ih.mjs → sql-BQzKUqQt.mjs} +349 -114
- package/dist/sqlite-DCtZFEVm.mjs +30 -0
- package/dist/{sqlite-db-CzcD_FW8.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
- package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
- package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
- package/dist/store-memory-OdGsc-t_.mjs +2 -0
- package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
- package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
- package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
- 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/{watchers-hash-CurCzwhe.mjs → targets-aMdbp84G.mjs} +134 -16
- package/dist/{tokens-C7kYyrAG.mjs → tokens-LHLrnV_P.mjs} +15 -43
- package/docs/01-board/01-mounting.md +245 -288
- package/docs/01-board/03-identity.md +42 -50
- package/docs/01-board/04-messages.md +15 -14
- package/docs/01-board/05-reading.md +3 -3
- package/docs/01-board/06-watchers.md +58 -105
- package/docs/01-board/07-schedules.md +21 -41
- package/docs/01-board/08-middleware.md +11 -17
- package/docs/01-board/09-access.md +187 -343
- package/docs/01-board/10-local.md +81 -0
- package/docs/01-quickstart.md +49 -126
- package/docs/02-sync/01-overview.md +25 -80
- package/docs/02-sync/02-functions.md +10 -16
- package/docs/02-sync/03-slack.md +13 -26
- package/docs/02-sync/04-github.md +8 -20
- package/docs/02-sync/07-linear.md +6 -10
- package/docs/03-guides/02-inspector.md +3 -3
- package/docs/03-guides/03-ci.md +88 -128
- package/docs/03-guides/04-triage.md +7 -15
- package/docs/03-guides/05-agent-factory.md +29 -36
- package/docs/04-reference/01-cli.md +113 -38
- package/docs/04-reference/02-board.md +79 -82
- package/docs/04-reference/03-http.md +138 -69
- package/docs/04-reference/05-conformance.md +32 -46
- package/docs/index.md +41 -65
- package/package.json +12 -83
- package/dist/a2-DiDc77Uf.mjs +0 -4238
- package/dist/access-DPcrKIH_.d.mts +0 -37
- package/dist/auth-8pRZnF1M.mjs +0 -393
- package/dist/backend-a2/blob-vercel.d.mts +0 -8
- package/dist/backend-a2/blob-vercel.mjs +0 -81
- package/dist/backend-a2/contract.d.mts +0 -828
- package/dist/backend-a2/contract.mjs +0 -5
- package/dist/backend-a2/scheduler-local.d.mts +0 -11
- package/dist/backend-a2/scheduler-local.mjs +0 -2
- package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
- package/dist/backend-a2/scheduler-qstash.mjs +0 -522
- package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
- package/dist/backend-a2/scheduler-vercel.mjs +0 -204
- package/dist/backend-a2/store-memory.d.mts +0 -11
- package/dist/backend-a2/store-postgres.d.mts +0 -38
- package/dist/backend-a2/store-postgres.mjs +0 -2977
- package/dist/backend-a2/store-redis-http.d.mts +0 -17
- package/dist/backend-a2/store-redis-http.mjs +0 -520
- package/dist/backend-a2/store-redis.d.mts +0 -31
- package/dist/backend-a2/store-redis.mjs +0 -88
- package/dist/backend-a2/store-sqlite.d.mts +0 -12
- package/dist/backend-a2/store-sqlite.mjs +0 -31
- package/dist/backend-a2.d.mts +0 -2633
- package/dist/backend-a2.mjs +0 -3
- package/dist/backend-http-CaN06CaD.d.mts +0 -672
- package/dist/backend-http-CoaCghuJ.mjs +0 -18
- package/dist/backend-http-l5A8UmL-.mjs +0 -585
- package/dist/backend-http.d.mts +0 -10
- package/dist/backend-http.mjs +0 -2
- package/dist/backend-http.node.d.mts +0 -10
- package/dist/backend-http.node.mjs +0 -2
- package/dist/backend-vercel-BE65okBC.mjs +0 -86
- package/dist/backend-vercel-CVxoTNF2.mjs +0 -1744
- package/dist/backend-vercel-jg-6PAgD.d.mts +0 -674
- package/dist/backend-vercel.d.mts +0 -9
- package/dist/backend-vercel.mjs +0 -11
- package/dist/backend-vercel.node.d.mts +0 -17
- package/dist/backend-vercel.node.mjs +0 -2
- package/dist/blob-Bx8QPWEd.d.mts +0 -40
- package/dist/blob-WbB2DJKn.mjs +0 -201
- package/dist/errors-2vGs49Db.d.mts +0 -16
- package/dist/exports-BnUZuRm9.mjs +0 -1389
- package/dist/exports-u5mApVvn.d.mts +0 -5
- package/dist/files-SniSmeEr.mjs +0 -47
- package/dist/folds-DLUzfibJ.d.mts +0 -558
- package/dist/folds-DsWfIftc.mjs +0 -208
- package/dist/index-UXpTPWNc.d.mts +0 -11
- package/dist/index.default-Dp8gexln.mjs +0 -12
- package/dist/local-C76Fy5ad.mjs +0 -44
- package/dist/middleware-BavYSDUa.mjs +0 -62
- package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
- package/dist/project-4Vl7_uy5.mjs +0 -124
- package/dist/redis-tables-BFRj_SEJ.mjs +0 -3895
- package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
- package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
- package/dist/reducers-DQVSP3kk.mjs +0 -538
- package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
- package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
- package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
- package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
- package/dist/server-wIpAEjpX.mjs +0 -17
- package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
- package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
- package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
- package/dist/store-memory-4IBl0Ztu.mjs +0 -2
- package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
- package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
- package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
- package/dist/targets-Cgjs29T0.mjs +0 -33
- package/dist/types-CmrFjpml.d.mts +0 -102
- package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
- package/docs/01-board/02-database.md +0 -258
- package/docs/04-reference/04-log.md +0 -247
- package/sql/postgres/board.sql +0 -145
- package/sql/postgres/notifications.sql +0 -24
- package/sql/postgres/schema.sql +0 -451
|
@@ -1,3 +1,65 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/experimental-a2@0.24.0_@upstash+qstash@2.12.0_@vercel+queue@0.7.0_ai@7.0.130_zod@4.6.5__b1e2c243a963f2620a5d202817417c26/node_modules/experimental-a2/dist/session-clear-XJYpmUpg.js
|
|
2
|
+
var A2Error = class extends Error {
|
|
3
|
+
code;
|
|
4
|
+
/** e.g. the Standard Schema issues for INVALID_PAYLOAD */
|
|
5
|
+
details;
|
|
6
|
+
constructor(code, message, options) {
|
|
7
|
+
super(message, options && "cause" in options ? { cause: options.cause } : void 0);
|
|
8
|
+
this.name = "A2Error";
|
|
9
|
+
this.code = code;
|
|
10
|
+
this.details = options?.details;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
/** A consumer write whose attempt no longer owns its triggering event. */
|
|
14
|
+
function supersededAttemptError(sessionId, cause) {
|
|
15
|
+
const of = cause.consumer === void 0 ? "" : ` for consumer '${cause.consumer}'`;
|
|
16
|
+
return new A2Error("SUPERSEDED_ATTEMPT", `attempt ${cause.attempt} no longer owns event ${cause.index}${of} in session '${sessionId}'`);
|
|
17
|
+
}
|
|
18
|
+
/** A conditional append whose `ifLastIndex` is not the session's head. */
|
|
19
|
+
function lastIndexMismatchError(sessionId, ifLastIndex, head) {
|
|
20
|
+
return new A2Error("LAST_INDEX_MISMATCH", `session '${sessionId}' is at index ${head}, not ${ifLastIndex}`, { details: { index: head } });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A batch whose ids conflict with committed events. In a conditional append
|
|
24
|
+
* whose head moved, the condition failed first, as when another writer's
|
|
25
|
+
* batch took those ids, so the conflict reports the head instead.
|
|
26
|
+
*/
|
|
27
|
+
function duplicateBatchError(message, conditional) {
|
|
28
|
+
return conditional && conditional.head !== conditional.ifLastIndex ? lastIndexMismatchError(conditional.sessionId, conditional.ifLastIndex, conditional.head) : new A2Error("PARTIAL_DUPLICATE_BATCH", message);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Wrap an arbitrary thrown value as STORE_UNAVAILABLE, preserving the
|
|
32
|
+
* original as `cause`. A2Errors pass through untouched — they already
|
|
33
|
+
* carry their own meaning.
|
|
34
|
+
*/
|
|
35
|
+
function asStoreUnavailable(err) {
|
|
36
|
+
if (err instanceof A2Error) return err;
|
|
37
|
+
return new A2Error("STORE_UNAVAILABLE", "the store backend failed", { cause: err });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Throw from a consumer to reject retrying: the failure is adjudicated
|
|
41
|
+
* terminal immediately (dead-lettered on the first throw) instead of
|
|
42
|
+
* consuming the ten-failure retry budget. For deterministic failures —
|
|
43
|
+
* a guard that will refuse identically on every attempt — retrying is
|
|
44
|
+
* waste and dead-lettering is the honest outcome. Matched by
|
|
45
|
+
* `instanceof`, so subclasses carry domain meaning.
|
|
46
|
+
*/
|
|
47
|
+
var NonRetriableError = class extends Error {
|
|
48
|
+
constructor(message, options) {
|
|
49
|
+
super(message, options);
|
|
50
|
+
this.name = "NonRetriableError";
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/** Reserved type of the marker a clear appends. */
|
|
54
|
+
const CLEAR_EVENT_TYPE = "a2.cleared";
|
|
55
|
+
/** Accepts any stream item, including presence patches and snapshots. */
|
|
56
|
+
function isSessionCleared(item) {
|
|
57
|
+
return item.type === CLEAR_EVENT_TYPE;
|
|
58
|
+
}
|
|
59
|
+
function sessionClearedError(message) {
|
|
60
|
+
return new A2Error("SESSION_CLEARED", message);
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
1
63
|
//#region ../../node_modules/.pnpm/experimental-a2@0.24.0_@upstash+qstash@2.12.0_@vercel+queue@0.7.0_ai@7.0.130_zod@4.6.5__b1e2c243a963f2620a5d202817417c26/node_modules/experimental-a2/dist/internal-CvsrprnU.js
|
|
2
64
|
/**
|
|
3
65
|
* A null-prototype record for maps keyed by caller-controlled strings
|
|
@@ -62,15 +124,6 @@ const schedulerSendFailureState = (error) => {
|
|
|
62
124
|
});
|
|
63
125
|
return marker;
|
|
64
126
|
};
|
|
65
|
-
/**
|
|
66
|
-
* Classify an adapter error before throwing it. Unclassified adapter failures
|
|
67
|
-
* are retryable because the caller cannot know whether a remote send landed.
|
|
68
|
-
*/
|
|
69
|
-
function classifySchedulerSendFailure(error, disposition) {
|
|
70
|
-
const classified = schedulerFailureObject(error);
|
|
71
|
-
schedulerSendFailureState(classified).pending.push(disposition);
|
|
72
|
-
return classified;
|
|
73
|
-
}
|
|
74
127
|
/** Consume a pending adapter classification and count this rejected send. */
|
|
75
128
|
function markSchedulerSendFailure(error) {
|
|
76
129
|
const marked = schedulerFailureObject(error);
|
|
@@ -78,25 +131,6 @@ function markSchedulerSendFailure(error) {
|
|
|
78
131
|
marker.active.push(marker.pending.pop() ?? "retryable");
|
|
79
132
|
return marked;
|
|
80
133
|
}
|
|
81
|
-
const isDrainableServer = (value) => {
|
|
82
|
-
if (value === null || typeof value !== "object") return false;
|
|
83
|
-
const contract = Reflect.get(value, "contract");
|
|
84
|
-
return contract !== null && typeof contract === "object" && typeof Reflect.get(contract, "name") === "string" && typeof Reflect.get(value, "drain") === "function";
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Validate the server list captured by a scheduler route at construction time.
|
|
88
|
-
* The seam stays structural so custom scheduler integrations can supply their
|
|
89
|
-
* own drainable targets.
|
|
90
|
-
*/
|
|
91
|
-
function assertSchedulerTargets(servers) {
|
|
92
|
-
const contracts = /* @__PURE__ */ new Set();
|
|
93
|
-
for (const target of servers) {
|
|
94
|
-
if (!isDrainableServer(target)) throw new TypeError("a2 scheduler: expected a server from createServer()");
|
|
95
|
-
const name = target.contract.name;
|
|
96
|
-
if (contracts.has(name)) throw new TypeError(`a2 scheduler: duplicate server contract '${name}' in one handler`);
|
|
97
|
-
contracts.add(name);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
134
|
/**
|
|
101
135
|
* Drain timing knobs. Mutable only as a white-box test seam. Claim
|
|
102
136
|
* heartbeats run on real timers, so tests shrink these to keep suites
|
|
@@ -135,20 +169,6 @@ const POLL_TIMINGS = {
|
|
|
135
169
|
idleCeilingMs: 2e3
|
|
136
170
|
};
|
|
137
171
|
/**
|
|
138
|
-
* Timings for the notify-driven redis live stream. A parked feed re-reads
|
|
139
|
-
* the store every `safetyReadMs` even without a pub/sub wake-up, so a lost
|
|
140
|
-
* notification (subscriber reconnect gap, dropped PUBLISH) costs latency,
|
|
141
|
-
* never an event. Writers publish after their scripts, so wake-ups from
|
|
142
|
-
* concurrent writers can arrive out of order: a feed holds a gap for
|
|
143
|
-
* `reorderMs` before catching up with a read, and a write waits at most
|
|
144
|
-
* `publishMs` for its PUBLISH. Mutable only as a white-box test seam.
|
|
145
|
-
*/
|
|
146
|
-
const NOTIFY_TIMINGS = {
|
|
147
|
-
safetyReadMs: 1e4,
|
|
148
|
-
reorderMs: 50,
|
|
149
|
-
publishMs: 1e3
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
172
|
* Bounds for each server instance's in-memory reducer-state cache. Sizes are
|
|
153
173
|
* encoded JSON lengths, re-measured every `measureEvery` folded events, so
|
|
154
174
|
* the byte budget is approximate. Mutable only as a white-box test seam.
|
|
@@ -200,4 +220,4 @@ const PRESENCE_TIMINGS = {
|
|
|
200
220
|
tombstoneMs: 6e4
|
|
201
221
|
};
|
|
202
222
|
//#endregion
|
|
203
|
-
export {
|
|
223
|
+
export { sessionClearedError as C, lastIndexMismatchError as S, CLEAR_EVENT_TYPE as _, SOCKET_TIMINGS as a, duplicateBatchError as b, drainSettledHooks as c, nullProtoRecord as d, runtimeConsumerFactory as f, A2Error as g, stateTailReaders as h, RESERVED_PARTICIPANT_IDS as i, failedPreviousAttempt as l, serverInternals as m, POLL_TIMINGS as n, STATE_CACHE as o, runtimeConsumers as p, PRESENCE_TIMINGS as r, STREAM_TIMINGS as s, DRAIN_TIMINGS as t, markSchedulerSendFailure as u, NonRetriableError as v, supersededAttemptError as w, isSessionCleared as x, asStoreUnavailable as y };
|