@vercel/board 0.24.0 → 0.25.1
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/{a2-BxfKZFvJ.mjs → a2-A830f5NS.mjs} +6 -6
- package/dist/access.d.mts +1 -2
- package/dist/access.mjs +3 -3
- package/dist/{actors-rPnEQLZu.mjs → actors-BLXVp4oZ.mjs} +2 -2
- package/dist/{auth-5nLsx9qB.mjs → auth-lTkOgvcE.mjs} +1 -1
- package/dist/{backend-D0GDYiFr.d.mts → backend-ZKYTe3xa.d.mts} +5 -11
- package/dist/backend-a2/blob-vercel.d.mts +1 -1
- package/dist/backend-a2/contract.d.mts +1 -2
- package/dist/backend-a2/store-memory.d.mts +1 -1
- package/dist/backend-a2/store-postgres.d.mts +1 -1
- package/dist/backend-a2/store-redis-http.d.mts +1 -1
- package/dist/backend-a2/store-redis.d.mts +1 -1
- package/dist/backend-a2/store-sqlite.d.mts +1 -1
- package/dist/backend-a2.d.mts +5 -6
- package/dist/backend-a2.mjs +1 -1
- package/dist/{backend-http-tGUo0e8j.mjs → backend-http-CJd4Fu0U.mjs} +2 -2
- package/dist/{backend-http-rfiG-AKP.mjs → backend-http-CYtfwqAW.mjs} +9 -6
- package/dist/{backend-http-Dvq2p__1.d.mts → backend-http-E7YU0qhn.d.mts} +3 -4
- package/dist/backend-http.d.mts +1 -1
- package/dist/backend-http.mjs +1 -1
- package/dist/backend-http.node.d.mts +1 -1
- package/dist/backend-http.node.mjs +1 -1
- package/dist/{backend-vercel-DM5PyMc2.mjs → backend-vercel-BhwPExmE.mjs} +3 -3
- package/dist/{backend-vercel-C3zuxmcD.mjs → backend-vercel-Bqg2QfTd.mjs} +7 -4
- package/dist/{backend-vercel-01QKDobk.d.mts → backend-vercel-CIRObA0t.d.mts} +3 -4
- package/dist/backend-vercel.d.mts +1 -1
- package/dist/backend-vercel.mjs +1 -1
- package/dist/backend-vercel.node.d.mts +1 -1
- package/dist/backend-vercel.node.mjs +1 -1
- package/dist/{blob-C0J3wbGv.d.mts → blob-B-9AvYis.d.mts} +2 -1
- package/dist/{chat-provider-D0k3y8zY.d.mts → chat-provider-DsNEBQiA.d.mts} +3 -2
- package/dist/cli-embedded.d.mts +55 -4
- package/dist/cli-embedded.mjs +38 -18
- package/dist/cli.mjs +4 -4
- package/dist/{client-ClznIBMg.mjs → client-D0Px7KzF.mjs} +26 -8
- package/dist/{provider-D11Dfda0.d.mts → client-xLxeDz0f.d.mts} +21 -688
- package/dist/{conformance-DQ9qVzWP.mjs → conformance-DlnfuzEB.mjs} +1 -1
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-kHfSOXnQ.mjs → engine-ROa7-IQY.mjs} +2 -2
- package/dist/errors-CB4tnZGz.d.mts +16 -0
- package/dist/{errors-CQ-fwxM3.mjs → errors-CusN4x2l.mjs} +18 -6
- package/dist/exports-D22M68rk.d.mts +5 -0
- package/dist/{exports-Bw81oDDl.mjs → exports-DCqgO_mr.mjs} +6 -6
- package/dist/{folds-CRYY14kc.d.mts → folds-jS9wlh9_.d.mts} +49 -2
- package/dist/{index-B_hWanKF.d.mts → index-C05it0mC.d.mts} +2 -2
- package/dist/index.d.mts +5 -4
- package/dist/{index.default-B6oPlvEa.mjs → index.default-BejExznB.mjs} +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.node.d.mts +5 -4
- package/dist/index.node.mjs +4 -4
- package/dist/inspect/app.js +108 -108
- package/dist/{main-CzWvRy91.mjs → main-DOhNCWMd.mjs} +712 -142
- package/dist/{middleware-DUjyQP_a.mjs → middleware-ChKM1zuu.mjs} +1 -1
- package/dist/{node-CirFYqw0.mjs → node-Bkd1x0QI.mjs} +56 -28
- package/dist/provider-Cdg1qadh.d.mts +688 -0
- package/dist/{serve-DHyA-6FR.mjs → serve-D2O0C6Kk.mjs} +6 -5
- package/dist/{server-Cp2oIQOj.mjs → server-BF4WJ7qi.mjs} +4 -4
- package/dist/{serving-B307gppu.mjs → serving-CvOWEym2.mjs} +1 -1
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-kapso.d.mts +2 -2
- package/dist/sync-linear.d.mts +2 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync.chat.d.mts +1 -1
- package/dist/sync.d.mts +2 -2
- package/dist/{tokens-DUXaXwOj.mjs → tokens-BuCU-61R.mjs} +2 -2
- package/dist/{types-8yq2VnKI.d.mts → types-aCAf6lGU.d.mts} +1 -1
- package/dist/{watchers-hash-C_1jGA53.mjs → watchers-hash-BHNXy_N7.mjs} +2 -2
- package/docs/01-board/03-identity.md +16 -7
- package/docs/01-board/04-messages.md +2 -2
- package/docs/01-board/05-reading.md +16 -8
- package/docs/01-board/07-schedules.md +2 -2
- package/docs/01-board/09-access.md +5 -4
- package/docs/03-guides/01-coding-agents.md +4 -2
- package/docs/03-guides/03-ci.md +2 -2
- package/docs/04-reference/01-cli.md +78 -19
- package/docs/04-reference/02-board.md +6 -1
- package/docs/04-reference/03-http.md +4 -0
- package/package.json +1 -1
- package/dist/exports-87_yESpp.d.mts +0 -4
- package/dist/schemas-CWxs3ECJ.d.mts +0 -50
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as DIRECT_UPLOAD_BYTES_MAX, r as IMPORT_BYTES_MAX, t as ATTACHMENT_BYTES_MAX } from "./files-SniSmeEr.mjs";
|
|
2
2
|
import { _ as RemoteWatcherId, b as actorKind, i as Attachment, x as platformAvatar } from "./schemas-Be08nyfW.mjs";
|
|
3
3
|
import "./external-BV_cUncs.mjs";
|
|
4
|
-
import { a as METHODS, d as VERSION, f as SYNC, n as compileWatcher, r as hasCriteria, t as canonicalWatchers } from "./watchers-hash-
|
|
5
|
-
import { r as duration, t as BoardError } from "./client-
|
|
4
|
+
import { a as METHODS, d as VERSION, f as SYNC, n as compileWatcher, r as hasCriteria, t as canonicalWatchers } from "./watchers-hash-BHNXy_N7.mjs";
|
|
5
|
+
import { r as duration, t as BoardError } from "./client-D0Px7KzF.mjs";
|
|
6
6
|
import { n as derivedId, r as isKeyIdOf } from "./ids-C6AYo1bu.mjs";
|
|
7
|
-
import { a as forbidden, c as toErrorResponse, i as duplicateId, r as badRequest, s as notFound, t as HttpError } from "./errors-
|
|
7
|
+
import { a as forbidden, c as toErrorResponse, i as duplicateId, r as badRequest, s as notFound, t as HttpError } from "./errors-CusN4x2l.mjs";
|
|
8
8
|
import { t as own } from "./own-OwgPWdmh.mjs";
|
|
9
9
|
import { n as replaceMentions } from "./mentions-CB6ShY4R.mjs";
|
|
10
|
-
import { _ as FULL_ACCESS, i as authenticates, v as authorize } from "./auth-
|
|
11
|
-
import { a as resolveMentions, n as actorSeen } from "./actors-
|
|
12
|
-
import { n as MIDDLEWARE_ACTOR, t as DroppedError } from "./middleware-
|
|
10
|
+
import { _ as FULL_ACCESS, i as authenticates, v as authorize } from "./auth-lTkOgvcE.mjs";
|
|
11
|
+
import { a as resolveMentions, n as actorSeen } from "./actors-BLXVp4oZ.mjs";
|
|
12
|
+
import { n as MIDDLEWARE_ACTOR, t as DroppedError } from "./middleware-ChKM1zuu.mjs";
|
|
13
13
|
import { n as syncTarget, r as withEmailMentions } from "./targets-C-wdR5wP.mjs";
|
|
14
14
|
import { t as A2Error } from "./session-clear-wHd5GCpZ-BnKSxReK.mjs";
|
|
15
15
|
import { a as reducer } from "./reducer-CjmvZSAb-D_OSISmj.mjs";
|
package/dist/access.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { a as Grant, i as ChannelPattern, n as AccessSummary, o as Permission, r as Can, t as Access } from "./access-CV96SYgr.mjs";
|
|
2
2
|
import { _ as oidc, a as CallerRequest, c as HostPrincipal, d as OidcTokensOptions, f as Principal, g as githubActions, h as compileRules, i as AuthenticateContext, l as IssuerConfig, m as RuleFunction, n as AccessRule, o as Claims, p as PrincipalKind, r as Authenticate, t as AccessFunction, u as Known, v as vercelProject } from "./auth-CU56Q2Xh.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { t as Actor } from "./folds-CRYY14kc.mjs";
|
|
3
|
+
import { C as Author, t as Actor } from "./folds-jS9wlh9_.mjs";
|
|
5
4
|
//#region src/server/tokens.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* The OIDC tokens made out to this board: a request's bearer token, from Vercel (people and
|
package/dist/access.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as compileRules, c as githubActions, h as vercelProject, p as oidc } from "./auth-
|
|
2
|
-
import { i as resolveActor } from "./actors-
|
|
3
|
-
import { t as oidcTokens } from "./tokens-
|
|
1
|
+
import { a as compileRules, c as githubActions, h as vercelProject, p as oidc } from "./auth-lTkOgvcE.mjs";
|
|
2
|
+
import { i as resolveActor } from "./actors-BLXVp4oZ.mjs";
|
|
3
|
+
import { t as oidcTokens } from "./tokens-BuCU-61R.mjs";
|
|
4
4
|
export { compileRules, githubActions, oidc, oidcTokens, resolveActor, vercelProject };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { C as toStorable } from "./schemas-Be08nyfW.mjs";
|
|
2
|
-
import { r as badRequest } from "./errors-
|
|
2
|
+
import { r as badRequest } from "./errors-CusN4x2l.mjs";
|
|
3
3
|
import { t as own } from "./own-OwgPWdmh.mjs";
|
|
4
4
|
import { t as extractMentions } from "./mentions-CB6ShY4R.mjs";
|
|
5
|
-
import { y as parseScope } from "./auth-
|
|
5
|
+
import { y as parseScope } from "./auth-lTkOgvcE.mjs";
|
|
6
6
|
//#region src/server/actors.ts
|
|
7
7
|
/** Agents whose avatars the board serves itself. */
|
|
8
8
|
const KNOWN_AGENTS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as ChannelPath, v as SCOPE_MAX } from "./schemas-Be08nyfW.mjs";
|
|
2
|
-
import { a as forbidden, l as unauthorized } from "./errors-
|
|
2
|
+
import { a as forbidden, l as unauthorized } from "./errors-CusN4x2l.mjs";
|
|
3
3
|
//#region src/server/access.ts
|
|
4
4
|
/**
|
|
5
5
|
* What a principal may do in a channel. `read` covers messages, threads,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as Access } from "./access-CV96SYgr.mjs";
|
|
2
2
|
import { m as RuleFunction, n as AccessRule, r as Authenticate, s as Granted, t as AccessFunction, u as Known } from "./auth-CU56Q2Xh.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
3
|
+
import { A as Labels, C as Author, t as Actor, u as ExternalEvent, x as Attachment } from "./folds-jS9wlh9_.mjs";
|
|
4
|
+
import { A as InboxItem, At as SyncRootsQuery, B as Me, C as EventsQuery, D as IdentityView, Et as SyncImportBody, Ft as ThreadView, H as MessagesPage, Ht as UploadTicket, I as LinkedAccount, It as ThreadsPage, K as PersonView, L as LinkedQuery, Lt as ThreadsQuery, M as InboxPushBody, Mt as SyncUnlinkBody, N as InboxQuery, Nt as SyncedView, O as InboxAckBody, Ot as SyncReceiptBody, P as LabelBody, Q as RegisterBody, R as MatchView, S as EventsPage, St as SyncCopiesView, Tt as SyncFindView, U as MessagesQuery, V as MessageView, Vt as UploadStartBody, X as ReactBody, _ as BoardEventView, b as Discovery, bt as SyncCodeView, dt as SourceJoin, et as RegistrationView, ft as SourceJoinBody, gt as SyncAccountBody, ht as SourceReadQuery, j as InboxNextQuery, jt as SyncThreadView, k as InboxEntry, m as AckBody, mt as SourceRead, o as ProfileOption, ot as ScheduleView, q as PostBody, rt as ScheduleBody, st as SchedulesQuery, t as BoardClient, v as ChannelView, wt as SyncFindQuery, x as EditBody, xt as SyncCopiesQuery, yt as SyncCodeBody, z as MatchesQuery, zt as TypingBody } from "./client-xLxeDz0f.mjs";
|
|
5
|
+
import { t as HttpError } from "./errors-CB4tnZGz.mjs";
|
|
6
|
+
import { p as SyncProvider } from "./provider-Cdg1qadh.mjs";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
//#region src/api/protocol.d.ts
|
|
8
9
|
type Input<S extends z.ZodType> = NonNullable<z.output<S>>;
|
|
@@ -294,13 +295,6 @@ type Protocol = {
|
|
|
294
295
|
};
|
|
295
296
|
type Method = keyof Protocol;
|
|
296
297
|
//#endregion
|
|
297
|
-
//#region src/server/errors.d.ts
|
|
298
|
-
declare class HttpError extends Error {
|
|
299
|
-
readonly status: number;
|
|
300
|
-
readonly code: string;
|
|
301
|
-
constructor(status: number, code: string, message: string);
|
|
302
|
-
}
|
|
303
|
-
//#endregion
|
|
304
298
|
//#region src/server/middleware.d.ts
|
|
305
299
|
/** Where a write came from, as the middleware sees it. */
|
|
306
300
|
type WriteSource =
|
|
@@ -684,4 +678,4 @@ interface Backend extends ProtocolMethods {
|
|
|
684
678
|
bind(board: BoardBinding): void;
|
|
685
679
|
}
|
|
686
680
|
//#endregion
|
|
687
|
-
export { Protocol as
|
|
681
|
+
export { Protocol as S, MiddlewareContext as _, Identity as a, WriteSource as b, SelfCaller as c, Board as d, BoardOptions as f, Middleware as g, DroppedError as h, Caller as i, Subscription as l, WatcherContext as m, BackendRoute as n, InboxDelivery as o, Watcher as p, BoardBinding as r, ProtocolMethods as s, Backend as t, VerifiedCaller as u, Write as v, Method as x, WritePatch as y };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as BoardEvents, g as BoardEvent, h as BOARD_SESSION, i as ChannelsState, l as ExternalAuthor, m as Origin, n as ActorsState, o as Message, r as Channel, s as MessagesState, t as Actor } from "../folds-CRYY14kc.mjs";
|
|
1
|
+
import { A as Labels, C as Author, D as Handle, E as Emoji, M as MessageId, N as MessageText, O as LabelKey, S as AttachmentId, T as ChannelPath, _ as BoardEvents, b as ActorKind, g as BoardEvent, h as BOARD_SESSION, i as ChannelsState, j as MESSAGE_TEXT_MAX, k as LabelValue, l as ExternalAuthor, m as Origin, n as ActorsState, o as Message, r as Channel, s as MessagesState, t as Actor, v as ATTACHMENTS_PER_MESSAGE_MAX, w as CHANNEL_PATH_MAX, x as Attachment, y as ActorId } from "../folds-jS9wlh9_.mjs";
|
|
3
2
|
import { l as Reducer, n as Contract } from "../reducer-CYPHsSmd-BQIfozGi.mjs";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
//#region src/contract/files.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as Clock } from "../store-D0MhBvg6-4Z2L0Kqd.mjs";
|
|
2
|
-
import { t as BoardStore } from "../types-
|
|
2
|
+
import { t as BoardStore } from "../types-aCAf6lGU.mjs";
|
|
3
3
|
//#region src/store/memory.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A board that lives in memory, for tests: its log in A2's memory store, its
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BoardStore } from "../types-
|
|
1
|
+
import { t as BoardStore } from "../types-aCAf6lGU.mjs";
|
|
2
2
|
//#region ../../node_modules/.pnpm/experimental-a2@0.22.0_@upstash+qstash@2.12.0_@vercel+queue@0.7.0_ai@7.0.130_zod@4.6.5__52060f00b21aecfab049c27fa3abd2f9/node_modules/experimental-a2/dist/store-redis.d.ts
|
|
3
3
|
//#region src/store-redis-notify.d.ts
|
|
4
4
|
type RedisConnection = {
|
package/dist/backend-a2.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Actor } from "./folds-CRYY14kc.mjs";
|
|
1
|
+
import { t as Actor, x as Attachment } from "./folds-jS9wlh9_.mjs";
|
|
3
2
|
import { l as Reducer, r as ContractEvent } from "./reducer-CYPHsSmd-BQIfozGi.mjs";
|
|
4
3
|
import { a as SessionAppend, c as SessionConsumeOptions, d as SessionSchedule, f as StateOptions, l as SessionConsumeResult, n as A2Server, o as SessionClearOptions, p as SessionCleared, r as Consumer, s as SessionClearResult, t as A2Scheduler, u as SessionDeadLetters } from "./server-qgez0Xny-D5mLfqFQ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { i as Caller, n as BackendRoute, r as BoardBinding } from "./backend-
|
|
7
|
-
import { n as fsBlob, r as memoryBlob, t as BlobStore } from "./blob-
|
|
8
|
-
import { t as BoardStore } from "./types-
|
|
4
|
+
import { A as InboxItem, B as Me, D as IdentityView, Ft as ThreadView, H as MessagesPage, Ht as UploadTicket, I as LinkedAccount, It as ThreadsPage, K as PersonView, Nt as SyncedView, R as MatchView, S as EventsPage, St as SyncCopiesView, Tt as SyncFindView, V as MessageView, b as Discovery, bt as SyncCodeView, dt as SourceJoin, et as RegistrationView, jt as SyncThreadView, k as InboxEntry, mt as SourceRead, ot as ScheduleView, v as ChannelView } from "./client-xLxeDz0f.mjs";
|
|
5
|
+
import { i as Caller, n as BackendRoute, r as BoardBinding } from "./backend-ZKYTe3xa.mjs";
|
|
6
|
+
import { n as fsBlob, r as memoryBlob, t as BlobStore } from "./blob-B-9AvYis.mjs";
|
|
7
|
+
import { t as BoardStore } from "./types-aCAf6lGU.mjs";
|
|
9
8
|
import { z } from "zod";
|
|
10
9
|
//#region src/server/transport.d.ts
|
|
11
10
|
/**
|
package/dist/backend-a2.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as fsBlob, r as memoryBlob, t as a2 } from "./a2-
|
|
1
|
+
import { n as fsBlob, r as memoryBlob, t as a2 } from "./a2-A830f5NS.mjs";
|
|
2
2
|
export { a2, fsBlob, memoryBlob };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as createHttp } from "./backend-http-
|
|
2
|
-
import { n as connect, r as environmentProfile, t as boardUrl } from "./node-
|
|
1
|
+
import { r as createHttp } from "./backend-http-CYtfwqAW.mjs";
|
|
2
|
+
import { n as connect, r as environmentProfile, t as boardUrl } from "./node-Bkd1x0QI.mjs";
|
|
3
3
|
//#region src/backend-http/index.ts
|
|
4
4
|
const environment = {
|
|
5
5
|
url: boardUrl,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./files-SniSmeEr.mjs";
|
|
2
2
|
import "./schemas-Be08nyfW.mjs";
|
|
3
|
-
import { K as routes, O as RegisterBody, a as METHODS, n as compileWatcher, t as canonicalWatchers } from "./watchers-hash-
|
|
4
|
-
import { n as createBoardClient, t as BoardError } from "./client-
|
|
3
|
+
import { K as routes, O as RegisterBody, a as METHODS, n as compileWatcher, t as canonicalWatchers } from "./watchers-hash-BHNXy_N7.mjs";
|
|
4
|
+
import { n as createBoardClient, t as BoardError } from "./client-D0Px7KzF.mjs";
|
|
5
5
|
import { a as sha256, i as keyId, n as derivedId, t as DERIVED_ID } from "./ids-C6AYo1bu.mjs";
|
|
6
|
-
import { a as forbidden, o as json, t as HttpError } from "./errors-
|
|
6
|
+
import { a as forbidden, o as json, t as HttpError } from "./errors-CusN4x2l.mjs";
|
|
7
7
|
//#region src/server/registrant.ts
|
|
8
8
|
/** Registering again this soon after the same registration only repeats it. */
|
|
9
9
|
const REGISTER_EVERY_MS = 1e4;
|
|
@@ -239,7 +239,10 @@ function scopeOf(identity) {
|
|
|
239
239
|
const describe = (error) => ((error instanceof Error ? error.message : String(error)) || "unknown error").slice(0, 500);
|
|
240
240
|
/** The SDK's error, as the board answers it: the remote's own status and code, or 502 when it never answered. */
|
|
241
241
|
const rethrow = (error) => {
|
|
242
|
-
if (error instanceof BoardError) throw new HttpError(error.status >= 400 ? error.status : 502, error.code, error.message
|
|
242
|
+
if (error instanceof BoardError) throw new HttpError(error.status >= 400 ? error.status : 502, error.code, error.message, {
|
|
243
|
+
...error.hint !== void 0 ? { hint: error.hint } : {},
|
|
244
|
+
origin: error.origin
|
|
245
|
+
});
|
|
243
246
|
if (error instanceof HttpError || error instanceof Error && error.name === "AbortError") throw error;
|
|
244
247
|
throw new HttpError(502, "unreachable", `the board didn't answer: ${describe(error)}`);
|
|
245
248
|
};
|
|
@@ -339,7 +342,7 @@ function createHttp(url, options, environment) {
|
|
|
339
342
|
let discovered = null;
|
|
340
343
|
/** The board it uses' discovery, for a handle here: who it is, and the sync entries it lists. */
|
|
341
344
|
const discovery = () => (discovered ??= doFetch(remote).then(async (response) => {
|
|
342
|
-
if (!response.ok) throw new HttpError(response.status >= 400 ? response.status : 502, "no_board", `no board at ${remote}
|
|
345
|
+
if (!response.ok) throw new HttpError(response.status >= 400 ? response.status : 502, "no_board", `There's no board at ${remote}: it answered ${response.status}.`, { origin: "handle" });
|
|
343
346
|
return await response.json();
|
|
344
347
|
}, rethrow)).catch((error) => {
|
|
345
348
|
discovered = null;
|
|
@@ -395,7 +398,7 @@ function createHttp(url, options, environment) {
|
|
|
395
398
|
if (response.ok) return response;
|
|
396
399
|
try {
|
|
397
400
|
const body = await response.json();
|
|
398
|
-
if (body.error?.message) throw new HttpError(response.status, body.error.code ?? "error", body.error.message);
|
|
401
|
+
if (body.error?.message) throw new HttpError(response.status, body.error.code ?? "error", body.error.message, typeof body.error.hint === "string" ? { hint: body.error.hint } : {});
|
|
399
402
|
} catch (error) {
|
|
400
403
|
if (error instanceof HttpError) throw error;
|
|
401
404
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as Caller, n as BackendRoute, r as BoardBinding } from "./backend-D0GDYiFr.mjs";
|
|
1
|
+
import { t as Actor, x as Attachment } from "./folds-jS9wlh9_.mjs";
|
|
2
|
+
import { A as InboxItem, B as Me, D as IdentityView, Ft as ThreadView, H as MessagesPage, Ht as UploadTicket, I as LinkedAccount, It as ThreadsPage, K as PersonView, Nt as SyncedView, R as MatchView, S as EventsPage, St as SyncCopiesView, Tt as SyncFindView, V as MessageView, b as Discovery, bt as SyncCodeView, dt as SourceJoin, et as RegistrationView, jt as SyncThreadView, k as InboxEntry, mt as SourceRead, o as ProfileOption, ot as ScheduleView, v as ChannelView } from "./client-xLxeDz0f.mjs";
|
|
3
|
+
import { i as Caller, n as BackendRoute, r as BoardBinding } from "./backend-ZKYTe3xa.mjs";
|
|
5
4
|
//#region src/server/backend-http.d.ts
|
|
6
5
|
type HttpOptions = {
|
|
7
6
|
/**
|
package/dist/backend-http.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as HttpOptions, t as HttpBackend } from "./backend-http-
|
|
1
|
+
import { n as HttpOptions, t as HttpBackend } from "./backend-http-E7YU0qhn.mjs";
|
|
2
2
|
//#region src/backend-http/index.default.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* The board at `url`, which keeps the log. Outside Node there's no environment to find it or a
|
package/dist/backend-http.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as http } from "./index.default-
|
|
1
|
+
import { t as http } from "./index.default-BejExznB.mjs";
|
|
2
2
|
export { http };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as HttpOptions, t as HttpBackend } from "./backend-http-
|
|
1
|
+
import { n as HttpOptions, t as HttpBackend } from "./backend-http-E7YU0qhn.mjs";
|
|
2
2
|
//#region src/backend-http/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* The board at `url`, which keeps the log: this board uses it as this deployment. Without a
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as http } from "./backend-http-
|
|
1
|
+
import { t as http } from "./backend-http-CJd4Fu0U.mjs";
|
|
2
2
|
export { http };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as RemoteWatcherId } from "./schemas-Be08nyfW.mjs";
|
|
2
|
-
import { O as RegisterBody, a as METHODS, d as VERSION, n as compileWatcher, t as canonicalWatchers } from "./watchers-hash-
|
|
2
|
+
import { O as RegisterBody, a as METHODS, d as VERSION, n as compileWatcher, t as canonicalWatchers } from "./watchers-hash-BHNXy_N7.mjs";
|
|
3
3
|
import { a as sha256, n as derivedId } from "./ids-C6AYo1bu.mjs";
|
|
4
|
-
import { a as forbidden, o as json, s as notFound, t as HttpError } from "./errors-
|
|
5
|
-
import { a as wakePath, i as registrant, n as callerProfile, t as PROJECTS_OWN } from "./backend-http-
|
|
4
|
+
import { a as forbidden, o as json, s as notFound, t as HttpError } from "./errors-CusN4x2l.mjs";
|
|
5
|
+
import { a as wakePath, i as registrant, n as callerProfile, t as PROJECTS_OWN } from "./backend-http-CYtfwqAW.mjs";
|
|
6
6
|
//#region src/server/backend-vercel.ts
|
|
7
7
|
const PROFILE = /^[A-Za-z][A-Za-z0-9-]{0,31}$/;
|
|
8
8
|
const SESSION = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as HttpError } from "./errors-
|
|
2
|
-
import { o as vercelLogin, r as environmentProfile, s as vercelProjectFile } from "./node-
|
|
3
|
-
import { t as createVercel } from "./backend-vercel-
|
|
1
|
+
import { t as HttpError } from "./errors-CusN4x2l.mjs";
|
|
2
|
+
import { o as vercelLogin, r as environmentProfile, s as vercelProjectFile } from "./node-Bkd1x0QI.mjs";
|
|
3
|
+
import { t as createVercel } from "./backend-vercel-BhwPExmE.mjs";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import { decodeJwt } from "jose";
|
|
6
6
|
import { getVercelOidcToken } from "@vercel/oidc";
|
|
@@ -15,7 +15,10 @@ async function token() {
|
|
|
15
15
|
if (process.env.VERCEL_TOKEN) return process.env.VERCEL_TOKEN;
|
|
16
16
|
if (deployed()) return getVercelOidcToken();
|
|
17
17
|
return vercelLogin().catch(() => {
|
|
18
|
-
throw new HttpError(401, "not_logged_in", "not
|
|
18
|
+
throw new HttpError(401, "not_logged_in", "You're not logged in to Vercel.", {
|
|
19
|
+
hint: "Run vercel login.",
|
|
20
|
+
origin: "handle"
|
|
21
|
+
});
|
|
19
22
|
});
|
|
20
23
|
}
|
|
21
24
|
/** Where `token` comes from, in words: what `vb whoami` says. */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as Caller, n as BackendRoute, r as BoardBinding } from "./backend-D0GDYiFr.mjs";
|
|
1
|
+
import { t as Actor, x as Attachment } from "./folds-jS9wlh9_.mjs";
|
|
2
|
+
import { A as InboxItem, B as Me, D as IdentityView, Ft as ThreadView, H as MessagesPage, Ht as UploadTicket, I as LinkedAccount, It as ThreadsPage, K as PersonView, Nt as SyncedView, R as MatchView, S as EventsPage, St as SyncCopiesView, Tt as SyncFindView, V as MessageView, b as Discovery, bt as SyncCodeView, dt as SourceJoin, et as RegistrationView, jt as SyncThreadView, k as InboxEntry, mt as SourceRead, o as ProfileOption, ot as ScheduleView, v as ChannelView } from "./client-xLxeDz0f.mjs";
|
|
3
|
+
import { i as Caller, n as BackendRoute, r as BoardBinding } from "./backend-ZKYTe3xa.mjs";
|
|
5
4
|
//#region src/server/backend-vercel.d.ts
|
|
6
5
|
type VercelOptions = {
|
|
7
6
|
/** The team whose board it is: its ID (`team_…`) or its slug. In Node, by default your deployment's, or `VERCEL_ORG_ID`. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as VercelOptions, t as VercelBackend } from "./backend-vercel-
|
|
1
|
+
import { n as VercelOptions, t as VercelBackend } from "./backend-vercel-CIRObA0t.mjs";
|
|
2
2
|
//#region src/backend-vercel/index.default.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Your team's board, in Vercel's API. Outside Node there's no environment to find credentials or
|
package/dist/backend-vercel.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createVercel } from "./backend-vercel-
|
|
1
|
+
import { t as createVercel } from "./backend-vercel-BhwPExmE.mjs";
|
|
2
2
|
//#region src/backend-vercel/index.default.ts
|
|
3
3
|
/**
|
|
4
4
|
* Your team's board, in Vercel's API. Outside Node there's no environment to find credentials or
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as VercelOptions, t as VercelBackend } from "./backend-vercel-
|
|
1
|
+
import { n as VercelOptions, t as VercelBackend } from "./backend-vercel-CIRObA0t.mjs";
|
|
2
2
|
//#region src/backend-vercel/index.d.ts
|
|
3
3
|
/** Where `token` comes from, in words: what `vb whoami` says. */
|
|
4
4
|
export declare function credentialSource(): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as vercel, t as credentialSource } from "./backend-vercel-
|
|
1
|
+
import { n as vercel, t as credentialSource } from "./backend-vercel-Bqg2QfTd.mjs";
|
|
2
2
|
export { credentialSource, vercel };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { d as ExternalFile, f as ExternalLink, l as ExternalAuthor, t as Actor } from "./folds-
|
|
2
|
-
import {
|
|
1
|
+
import { d as ExternalFile, f as ExternalLink, l as ExternalAuthor, t as Actor } from "./folds-jS9wlh9_.mjs";
|
|
2
|
+
import { dt as SourceJoin, mt as SourceRead } from "./client-xLxeDz0f.mjs";
|
|
3
|
+
import { M as SyncRoot, O as ProviderEvent, a as ProviderOptions, c as ReceivedEvent, d as ResolvedTarget, i as ProviderFile, n as FileDelivery, o as ProviderPost, p as SyncProvider, r as ProviderDelivery, s as Receive, t as FetchedLink, y as SyncFn } from "./provider-Cdg1qadh.mjs";
|
|
3
4
|
import { Adapter, Author, FileUpload, Message, ReactionEvent } from "chat";
|
|
4
5
|
//#region src/sync/types.d.ts
|
|
5
6
|
declare function externalAuthor(platform: string, author: Author): ExternalAuthor;
|
package/dist/cli-embedded.d.mts
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
|
-
import { d as Board } from "./backend-
|
|
2
|
-
import "./index-
|
|
1
|
+
import { d as Board } from "./backend-ZKYTe3xa.mjs";
|
|
2
|
+
import "./index-C05it0mC.mjs";
|
|
3
|
+
//#region src/cli/failure.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* What kind of failure it is, which fixes the exit code: 2 for `usage` and `missing_input`, 124
|
|
6
|
+
* for `timeout`, 130 for `canceled`, and 1 for the rest.
|
|
7
|
+
*/
|
|
8
|
+
type FailureClass = 'usage' | 'missing_input' | 'auth' | 'permission' | 'not_found' | 'conflict' | 'limit' | 'rate_limit' | 'network' | 'platform' | 'timeout' | 'canceled' | 'unknown';
|
|
9
|
+
/** One way out: what to do, and the command that does it, whole (`['vb', 'read', 'dev', '--scope', '<TEAM>']`). */
|
|
10
|
+
type Recovery = {
|
|
11
|
+
instruction: string;
|
|
12
|
+
argv?: string[];
|
|
13
|
+
};
|
|
14
|
+
type Failure = {
|
|
15
|
+
class: FailureClass;
|
|
16
|
+
/** Stable and snake_case: what a program branches on. */
|
|
17
|
+
reason: string;
|
|
18
|
+
/** The headline: what failed, then the known cause, as sentences. */
|
|
19
|
+
message: string;
|
|
20
|
+
/** What the headline can't hold, a line each: the board's own message, say. */
|
|
21
|
+
details?: string[];
|
|
22
|
+
/** Facts needed to act on it, as rows: `['Board', 'https://…']`. */
|
|
23
|
+
context?: [string, string][];
|
|
24
|
+
/** At most two, likeliest first. */
|
|
25
|
+
next?: Recovery[];
|
|
26
|
+
/** Blocked before anything happened, until someone gives it what it needs (a team, say). */
|
|
27
|
+
actionRequired?: boolean;
|
|
28
|
+
/** For programs: what the CLI resolved, and the board's own error (`{ code, message }`) when it answered with one. */
|
|
29
|
+
data?: Record<string, unknown>;
|
|
30
|
+
};
|
|
31
|
+
/** A write went through, with something to say about it. */
|
|
32
|
+
type Warning = {
|
|
33
|
+
reason: string;
|
|
34
|
+
message: string;
|
|
35
|
+
};
|
|
36
|
+
/** A recovery's command, as a person types it. */
|
|
37
|
+
export declare const commandLine: (argv: readonly string[]) => string;
|
|
38
|
+
/**
|
|
39
|
+
* The failure as lines, the headline first and the rest as they sit under it, before the indent a
|
|
40
|
+
* CLI adds under its own mark (`error: `, `✗ `): details, context rows, then each way out after a
|
|
41
|
+
* blank line, its command two spaces in.
|
|
42
|
+
*/
|
|
43
|
+
export declare function failureLines(failure: Failure): string[];
|
|
44
|
+
//#endregion
|
|
3
45
|
//#region src/cli/main.d.ts
|
|
4
46
|
/**
|
|
5
47
|
* The command `argv` runs, by its own name (`delete` for `rm`), as the parser reads it: the
|
|
@@ -13,11 +55,19 @@ export declare function commandWord(argv: string[]): string | undefined;
|
|
|
13
55
|
* Board's CLI as `appName` names it in help, usage, and errors (`vercel board`). With no board
|
|
14
56
|
* URL anywhere, it talks to the team's board in Vercel's API: `VERCEL_ORG_ID`'s, the nearest linked
|
|
15
57
|
* project's team's (`.vercel`), your login's, or `--scope`'s. `run` takes what follows the name, and answers the exit code:
|
|
16
|
-
* 0 success, 1 error, 2 misuse, 124 when `wait` times out. It never exits the process itself. One `run`
|
|
58
|
+
* 0 success, 1 error, 2 misuse, 124 when `wait` times out, 130 when Ctrl-C stops it. It never exits the process itself. One `run`
|
|
17
59
|
* at a time: a run's flags are the CLI's while it runs.
|
|
60
|
+
*
|
|
61
|
+
* A failure goes to `onError`, with whether the run asked for `--json`, to show as the app shows
|
|
62
|
+
* its own, and a warning to `onWarning` (with `--json`, it's in the result). Without them, the CLI
|
|
63
|
+
* prints its own on stderr.
|
|
18
64
|
*/
|
|
19
65
|
export declare function createApp(options: {
|
|
20
66
|
appName: string;
|
|
67
|
+
onError?: (failure: Failure, mode: {
|
|
68
|
+
json: boolean;
|
|
69
|
+
}) => void;
|
|
70
|
+
onWarning?: (warning: Warning) => void;
|
|
21
71
|
}): {
|
|
22
72
|
run(args: string[]): Promise<number>;
|
|
23
73
|
};
|
|
@@ -48,4 +98,5 @@ export type VbResult = {
|
|
|
48
98
|
* `tail` and `wait`, which hold the rest until they end, need `options.signal`.
|
|
49
99
|
*/
|
|
50
100
|
export declare function vb(board: Board, argv: string[], options?: VbOptions): Promise<VbResult>;
|
|
51
|
-
//#endregion
|
|
101
|
+
//#endregion
|
|
102
|
+
export type { Failure, FailureClass, Recovery, Warning };
|
package/dist/cli-embedded.mjs
CHANGED
|
@@ -1,22 +1,42 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { a as commandLine, c as failureLines, i as mainWith, l as formatFailure, n as commandWord, o as exitCode, r as main, s as failureDocument, t as Failed } from "./main-DOhNCWMd.mjs";
|
|
2
2
|
//#region src/cli/embedded.ts
|
|
3
3
|
/**
|
|
4
4
|
* Board's CLI as `appName` names it in help, usage, and errors (`vercel board`). With no board
|
|
5
5
|
* URL anywhere, it talks to the team's board in Vercel's API: `VERCEL_ORG_ID`'s, the nearest linked
|
|
6
6
|
* project's team's (`.vercel`), your login's, or `--scope`'s. `run` takes what follows the name, and answers the exit code:
|
|
7
|
-
* 0 success, 1 error, 2 misuse, 124 when `wait` times out. It never exits the process itself. One `run`
|
|
7
|
+
* 0 success, 1 error, 2 misuse, 124 when `wait` times out, 130 when Ctrl-C stops it. It never exits the process itself. One `run`
|
|
8
8
|
* at a time: a run's flags are the CLI's while it runs.
|
|
9
|
+
*
|
|
10
|
+
* A failure goes to `onError`, with whether the run asked for `--json`, to show as the app shows
|
|
11
|
+
* its own, and a warning to `onWarning` (with `--json`, it's in the result). Without them, the CLI
|
|
12
|
+
* prints its own on stderr.
|
|
9
13
|
*/
|
|
10
14
|
function createApp(options) {
|
|
15
|
+
const { appName, onError, onWarning } = options;
|
|
11
16
|
return { run: (args) => main(args, {
|
|
12
|
-
name:
|
|
17
|
+
name: appName,
|
|
13
18
|
commands: {},
|
|
14
|
-
teamBoard: true
|
|
19
|
+
teamBoard: true,
|
|
20
|
+
...onError ? { onError } : {},
|
|
21
|
+
...onWarning ? { onWarning } : {}
|
|
15
22
|
}) };
|
|
16
23
|
}
|
|
17
|
-
const lacking = (what) => async () => {
|
|
18
|
-
throw new
|
|
24
|
+
const lacking = (what, option) => async () => {
|
|
25
|
+
throw new Failed({
|
|
26
|
+
class: "usage",
|
|
27
|
+
reason: "not_available",
|
|
28
|
+
message: `${what} here: pass ${option} in vb()'s options.`
|
|
29
|
+
});
|
|
19
30
|
};
|
|
31
|
+
/** A call `vb()` answers itself, printed as the CLI would print it. */
|
|
32
|
+
function refused(argv, failure) {
|
|
33
|
+
const stderr = argv.slice(0, argv.includes("--") ? argv.indexOf("--") : void 0).includes("--json") ? JSON.stringify(failureDocument(failure)) : formatFailure(failure);
|
|
34
|
+
return Promise.resolve({
|
|
35
|
+
code: exitCode(failure),
|
|
36
|
+
stdout: "",
|
|
37
|
+
stderr: `${stderr}\n`
|
|
38
|
+
});
|
|
39
|
+
}
|
|
20
40
|
let queue = Promise.resolve();
|
|
21
41
|
/**
|
|
22
42
|
* Runs the vb command `argv` (`['read', '42']`, `['reply', '42', 'on it']`) on `board`, in this
|
|
@@ -27,15 +47,15 @@ let queue = Promise.resolve();
|
|
|
27
47
|
*/
|
|
28
48
|
function vb(board, argv, options = {}) {
|
|
29
49
|
const word = commandWord(argv);
|
|
30
|
-
if (word !== void 0 && options.refuse?.includes(word)) return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
if (word !== void 0 && options.refuse?.includes(word)) return refused(argv, {
|
|
51
|
+
class: "usage",
|
|
52
|
+
reason: "not_available",
|
|
53
|
+
message: `${word} isn't available here.`
|
|
34
54
|
});
|
|
35
|
-
if ((word === "tail" || word === "wait") && !options.signal) return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
if ((word === "tail" || word === "wait") && !options.signal) return refused(argv, {
|
|
56
|
+
class: "usage",
|
|
57
|
+
reason: "not_available",
|
|
58
|
+
message: `${word} runs until it's stopped, and vb() runs one call at a time: pass a signal.`
|
|
39
59
|
});
|
|
40
60
|
const result = queue.then(async () => {
|
|
41
61
|
let stdout = "";
|
|
@@ -49,9 +69,9 @@ function vb(board, argv, options = {}) {
|
|
|
49
69
|
board,
|
|
50
70
|
write: (chunk) => void (stdout += typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true })),
|
|
51
71
|
error: (chunk) => void (stderr += chunk),
|
|
52
|
-
readFile: options.readFile ? async (path) => options.readFile(path) : lacking("--attach
|
|
53
|
-
writeFile: options.writeFile ? async (path, data) => options.writeFile(path, data) : lacking("download
|
|
54
|
-
stdin: options.stdin !== void 0 ? async () => options.stdin : lacking("-
|
|
72
|
+
readFile: options.readFile ? async (path) => options.readFile(path) : lacking("--attach can't read files", "readFile"),
|
|
73
|
+
writeFile: options.writeFile ? async (path, data) => options.writeFile(path, data) : lacking("download can't save files", "writeFile"),
|
|
74
|
+
stdin: options.stdin !== void 0 ? async () => options.stdin : lacking("- can't read stdin", "stdin"),
|
|
55
75
|
...options.signal ? { signal: options.signal } : {}
|
|
56
76
|
}),
|
|
57
77
|
stdout,
|
|
@@ -62,4 +82,4 @@ function vb(board, argv, options = {}) {
|
|
|
62
82
|
return result;
|
|
63
83
|
}
|
|
64
84
|
//#endregion
|
|
65
|
-
export { commandWord, createApp, vb };
|
|
85
|
+
export { commandLine, commandWord, createApp, failureLines, vb };
|
package/dist/cli.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { t as ATTACHMENT_BYTES_MAX } from "./files-SniSmeEr.mjs";
|
|
3
3
|
import "./schemas-Be08nyfW.mjs";
|
|
4
4
|
import { a as option } from "./commands-BtL4jFq8.mjs";
|
|
5
|
-
import { a as projectDir } from "./node-
|
|
6
|
-
import {
|
|
5
|
+
import { a as projectDir } from "./node-Bkd1x0QI.mjs";
|
|
6
|
+
import { r as main, u as who } from "./main-DOhNCWMd.mjs";
|
|
7
7
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
8
8
|
import { appendFile, readFile } from "node:fs/promises";
|
|
9
9
|
import { join } from "node:path";
|
|
@@ -658,10 +658,10 @@ const local = {
|
|
|
658
658
|
}]
|
|
659
659
|
},
|
|
660
660
|
async run(args, { flags, out, usage, portFlag, connection, openBrowser }) {
|
|
661
|
-
if (args.length > 0) throw usage("
|
|
661
|
+
if (args.length > 0) throw usage("serve takes no arguments: pass its port with --port, and its directory with --dir.");
|
|
662
662
|
const port = portFlag();
|
|
663
663
|
const root = projectDir();
|
|
664
|
-
const { localHandle, serveLocal } = await import("./serve-
|
|
664
|
+
const { localHandle, serveLocal } = await import("./serve-D2O0C6Kk.mjs");
|
|
665
665
|
const handle = flags.handle ?? process.env.BOARD_HANDLE;
|
|
666
666
|
const local = await serveLocal({
|
|
667
667
|
dir: flags.dir ?? join(root, ".board"),
|