@vercel/board 0.39.0 → 0.41.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 +6 -4
- package/dist/{access-CVkjSfxj.mjs → access-C5HaO42b.mjs} +2 -2
- package/dist/access.d.mts +6 -6
- package/dist/access.mjs +5 -5
- package/dist/actors-nrOf7Y7z.mjs +160 -0
- package/dist/{auth-BXLCkeB0.d.mts → auth-Bn8J_1F2.d.mts} +14 -29
- package/dist/{auth-B3bBYOqf.mjs → auth-DAlYi6TN.mjs} +9 -19
- package/dist/{backend-HcCCGPG4.d.mts → backend-CYsTLxtP.d.mts} +139 -43
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/blocks-CVoBC7ur.mjs +402 -0
- package/dist/blocks-DGvh2alZ.d.mts +33 -0
- package/dist/{chat-provider-1WKsLEnM.mjs → chat-provider-CPZg2MQb.mjs} +2 -2
- package/dist/{chat-provider-DyNy5xdC.d.mts → chat-provider-Cgkh9xJw.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 +3 -3
- package/dist/cli-embedded.mjs +4 -4
- package/dist/cli.mjs +8 -13
- package/dist/{commands-B5d-lmNN.d.mts → commands-CrEVjASe.d.mts} +14 -26
- package/dist/{commands-BLS7erNu.mjs → commands-QRD0U9AQ.mjs} +114 -105
- package/dist/{conformance-D59Py2m2.mjs → conformance-ClxEEZ9C.mjs} +378 -101
- package/dist/conformance.d.mts +11 -9
- package/dist/conformance.mjs +1 -1
- package/dist/data-values-C-Cq80hz.mjs +176 -0
- package/dist/digest-Dna1CGa_.mjs +4 -0
- package/dist/{engine-eUgO5jTM.mjs → engine-8BcNeckB.mjs} +197 -84
- package/dist/{errors-rYDxZEuN.mjs → errors-DcQf5WeM.mjs} +123 -42
- package/dist/{events-C6HwB046.mjs → events-BT8y_81j.mjs} +2 -2
- package/dist/{exports-M5o4PTfO.mjs → exports-B6udRV_E.mjs} +961 -383
- package/dist/exports-C8zsIL1A.d.mts +4 -0
- package/dist/{external-CHDxWIVf.mjs → external-DymyhUzl.mjs} +1 -1
- package/dist/{index-rNqqgkyu.d.mts → index-fcpEFCTR.d.mts} +2 -2
- package/dist/index.d.mts +7 -6
- package/dist/index.mjs +8 -6
- package/dist/index.node.d.mts +7 -6
- package/dist/index.node.mjs +5 -4
- package/dist/inspect/app.js +110 -109
- package/dist/inspect/engine.js +5 -5
- package/dist/inspect-BsF3mYMY.mjs +2 -0
- package/dist/{inspect-BkXxR2uB.mjs → inspect-DPRoC_Gg.mjs} +6 -6
- package/dist/{local-DvkOWf4U.mjs → local-B9y4p6N7.mjs} +463 -512
- package/dist/{main-DtV_Po9i.mjs → main-S0A-c_kP.mjs} +549 -178
- package/dist/{memory-DkoqhxIH.mjs → memory-DhduVbUu.mjs} +2 -2
- package/dist/{mentions-CB6ShY4R.mjs → mentions-DfZGp3B-.mjs} +18 -4
- package/dist/{middleware-CPqAuRtp.mjs → middleware-DHdrxmoc.mjs} +71 -3
- package/dist/{targets-C1mT3M1N.mjs → origin-B3m2lnZC.mjs} +43 -64
- package/dist/{page-64IwoGRu.mjs → page-2jjHZmIW.mjs} +2 -2
- package/dist/page-CAUe4GmQ.mjs +2 -0
- package/dist/{provider-D5yVFisj.d.mts → provider-dY54GFNz.d.mts} +20 -34
- package/dist/{routes-BffuaoTX.d.mts → routes-By9lmvUD.d.mts} +91 -77
- package/dist/{schemas-AZkxk06N.mjs → schemas-DAzSsgWk.mjs} +8 -3
- package/dist/schemas.d.mts +37 -0
- package/dist/schemas.mjs +3 -0
- package/dist/{serve-CX1rqDF_.mjs → serve-B15I2Ibf.mjs} +5 -5
- package/dist/{server-DkYkyarg.mjs → server-DgpRZ4Nu.mjs} +74 -127
- package/dist/{serving-DJMcG0dT.mjs → serving-CALKWs9K.mjs} +1 -1
- package/dist/{sql-l3ysn4O5.mjs → sql-P9g-rLIF.mjs} +75 -12
- package/dist/{sqlite-CAwNHbQD.mjs → sqlite-B3rCcIof.mjs} +2 -2
- package/dist/{sqlite-db-cm5yhrD-.mjs → sqlite-db-D0Fyju-4.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 +14 -8
- package/dist/sync-slack.mjs +46 -19
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{tokens-DA9ipsZ-.mjs → tokens-D7_ZIWpX.mjs} +4 -4
- package/docs/01-board/01-mounting.md +13 -16
- package/docs/01-board/03-identity.md +112 -74
- package/docs/01-board/04-messages.md +61 -2
- package/docs/01-board/05-reading.md +11 -5
- package/docs/01-board/06-watchers.md +17 -13
- package/docs/01-board/07-schedules.md +8 -6
- package/docs/01-board/08-middleware.md +1 -1
- package/docs/01-board/09-access.md +80 -132
- package/docs/02-sync/01-overview.md +75 -4
- package/docs/02-sync/02-functions.md +11 -6
- package/docs/02-sync/03-slack.md +43 -19
- package/docs/02-sync/06-providers.md +9 -4
- package/docs/03-guides/01-coding-agents.md +18 -22
- package/docs/03-guides/02-inspector.md +4 -5
- package/docs/03-guides/03-ci.md +7 -26
- package/docs/03-guides/04-triage.md +2 -2
- package/docs/03-guides/05-agent-factory.md +7 -9
- package/docs/03-guides/06-sandboxed-agents.md +149 -0
- package/docs/04-reference/01-cli.md +161 -104
- package/docs/04-reference/02-board.md +89 -37
- package/docs/04-reference/03-http.md +176 -71
- package/docs/04-reference/05-conformance.md +47 -21
- package/docs/index.md +5 -5
- package/package.json +5 -1
- package/dist/actors-kfMejhaw.mjs +0 -156
- package/dist/digest-krhjNAt4.mjs +0 -4
- package/dist/exports-vLQ2Y2Nd.d.mts +0 -4
- package/dist/inspect-lnv1sLXM.mjs +0 -2
- package/dist/page-BUj8_UZv.mjs +0 -2
|
@@ -203,12 +203,10 @@ declare const boardEvents: {
|
|
|
203
203
|
thread: z.ZodString;
|
|
204
204
|
labels: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
205
205
|
noSync: z.ZodBoolean;
|
|
206
|
-
mentions: z.ZodArray<z.ZodString>;
|
|
207
206
|
by: z.ZodObject<{
|
|
208
207
|
actor: z.ZodString;
|
|
209
208
|
principal: z.ZodString;
|
|
210
209
|
profile: z.ZodNullable<z.ZodString>;
|
|
211
|
-
session: z.ZodNullable<z.ZodString>;
|
|
212
210
|
}, z.core.$strip>;
|
|
213
211
|
origin: z.ZodNullable<z.ZodObject<{
|
|
214
212
|
channel: z.ZodOptional<z.ZodString>;
|
|
@@ -255,7 +253,6 @@ declare const boardEvents: {
|
|
|
255
253
|
actor: z.ZodString;
|
|
256
254
|
principal: z.ZodString;
|
|
257
255
|
profile: z.ZodNullable<z.ZodString>;
|
|
258
|
-
session: z.ZodNullable<z.ZodString>;
|
|
259
256
|
}, z.core.$strip>;
|
|
260
257
|
}, z.core.$strip>;
|
|
261
258
|
/** A message's links changed: an edit linked something new, or the platform sent what a link says. */
|
|
@@ -280,7 +277,6 @@ declare const boardEvents: {
|
|
|
280
277
|
actor: z.ZodString;
|
|
281
278
|
principal: z.ZodString;
|
|
282
279
|
profile: z.ZodNullable<z.ZodString>;
|
|
283
|
-
session: z.ZodNullable<z.ZodString>;
|
|
284
280
|
}, z.core.$strip>;
|
|
285
281
|
from: z.ZodNullable<z.ZodString>;
|
|
286
282
|
}, z.core.$strip>;
|
|
@@ -288,12 +284,10 @@ declare const boardEvents: {
|
|
|
288
284
|
id: z.ZodNumber;
|
|
289
285
|
thread: z.ZodString;
|
|
290
286
|
text: z.ZodString;
|
|
291
|
-
mentions: z.ZodArray<z.ZodString>;
|
|
292
287
|
by: z.ZodObject<{
|
|
293
288
|
actor: z.ZodString;
|
|
294
289
|
principal: z.ZodString;
|
|
295
290
|
profile: z.ZodNullable<z.ZodString>;
|
|
296
|
-
session: z.ZodNullable<z.ZodString>;
|
|
297
291
|
}, z.core.$strip>;
|
|
298
292
|
from: z.ZodNullable<z.ZodString>;
|
|
299
293
|
}, z.core.$strip>;
|
|
@@ -304,7 +298,6 @@ declare const boardEvents: {
|
|
|
304
298
|
actor: z.ZodString;
|
|
305
299
|
principal: z.ZodString;
|
|
306
300
|
profile: z.ZodNullable<z.ZodString>;
|
|
307
|
-
session: z.ZodNullable<z.ZodString>;
|
|
308
301
|
}, z.core.$strip>;
|
|
309
302
|
from: z.ZodNullable<z.ZodString>;
|
|
310
303
|
}, z.core.$strip>;
|
|
@@ -316,7 +309,6 @@ declare const boardEvents: {
|
|
|
316
309
|
actor: z.ZodString;
|
|
317
310
|
principal: z.ZodString;
|
|
318
311
|
profile: z.ZodNullable<z.ZodString>;
|
|
319
|
-
session: z.ZodNullable<z.ZodString>;
|
|
320
312
|
}, z.core.$strip>;
|
|
321
313
|
from: z.ZodNullable<z.ZodString>;
|
|
322
314
|
}, z.core.$strip>;
|
|
@@ -328,7 +320,6 @@ declare const boardEvents: {
|
|
|
328
320
|
actor: z.ZodString;
|
|
329
321
|
principal: z.ZodString;
|
|
330
322
|
profile: z.ZodNullable<z.ZodString>;
|
|
331
|
-
session: z.ZodNullable<z.ZodString>;
|
|
332
323
|
}, z.core.$strip>;
|
|
333
324
|
from: z.ZodNullable<z.ZodString>;
|
|
334
325
|
}, z.core.$strip>;
|
|
@@ -341,7 +332,6 @@ declare const boardEvents: {
|
|
|
341
332
|
actor: z.ZodString;
|
|
342
333
|
principal: z.ZodString;
|
|
343
334
|
profile: z.ZodNullable<z.ZodString>;
|
|
344
|
-
session: z.ZodNullable<z.ZodString>;
|
|
345
335
|
}, z.core.$strip>;
|
|
346
336
|
}, z.core.$strip>;
|
|
347
337
|
/** A thread is synced with an external channel (start a thread there) or thread (join it). */
|
|
@@ -360,7 +350,6 @@ declare const boardEvents: {
|
|
|
360
350
|
actor: z.ZodString;
|
|
361
351
|
principal: z.ZodString;
|
|
362
352
|
profile: z.ZodNullable<z.ZodString>;
|
|
363
|
-
session: z.ZodNullable<z.ZodString>;
|
|
364
353
|
}, z.core.$strip>;
|
|
365
354
|
}, z.core.$strip>;
|
|
366
355
|
/** An outbound delivery receipt: board message `id` exists on the platform as `external`. */
|
|
@@ -405,7 +394,13 @@ declare const boardEvents: {
|
|
|
405
394
|
handle: z.ZodString;
|
|
406
395
|
name: z.ZodString;
|
|
407
396
|
avatar: z.ZodNullable<z.ZodString>;
|
|
397
|
+
via: z.ZodOptional<z.ZodObject<{
|
|
398
|
+
name: z.ZodString;
|
|
399
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
408
402
|
host: z.ZodOptional<z.ZodLiteral<true>>;
|
|
403
|
+
verified: z.ZodOptional<z.ZodLiteral<true>>;
|
|
409
404
|
}, z.core.$strip>;
|
|
410
405
|
};
|
|
411
406
|
type BoardEvents = typeof boardEvents;
|
|
@@ -435,7 +430,6 @@ declare const Author: z.ZodObject<{
|
|
|
435
430
|
actor: z.ZodString;
|
|
436
431
|
principal: z.ZodString;
|
|
437
432
|
profile: z.ZodNullable<z.ZodString>;
|
|
438
|
-
session: z.ZodNullable<z.ZodString>;
|
|
439
433
|
}, z.core.$strip>;
|
|
440
434
|
/** A file on a message. The board records `type` and `size` from what it stored, never from the request. */
|
|
441
435
|
declare const Attachment: z.ZodObject<{
|
|
@@ -449,6 +443,13 @@ type ActorKind = z.infer<typeof ActorKind>;
|
|
|
449
443
|
type Author = z.infer<typeof Author>;
|
|
450
444
|
type Attachment = z.infer<typeof Attachment>;
|
|
451
445
|
//#endregion
|
|
446
|
+
//#region src/contract/profiles.d.ts
|
|
447
|
+
/** Who an actor with a profile acts through: its principal's name, and a deployment's environment. */
|
|
448
|
+
type Via = {
|
|
449
|
+
name: string;
|
|
450
|
+
environment: string | null;
|
|
451
|
+
};
|
|
452
|
+
//#endregion
|
|
452
453
|
//#region src/contract/folds.d.ts
|
|
453
454
|
type Message = {
|
|
454
455
|
id: number;
|
|
@@ -460,7 +461,6 @@ type Message = {
|
|
|
460
461
|
thread: string;
|
|
461
462
|
labels: Labels;
|
|
462
463
|
reactions: Record<string, string[]>;
|
|
463
|
-
mentions: string[];
|
|
464
464
|
by: Author;
|
|
465
465
|
noSync: boolean;
|
|
466
466
|
/** Where it came from on a platform, if it did. */
|
|
@@ -485,6 +485,11 @@ type Message = {
|
|
|
485
485
|
* it's theirs to edit and delete only then. Its event's payload says so too.
|
|
486
486
|
*/
|
|
487
487
|
blind?: true;
|
|
488
|
+
/**
|
|
489
|
+
* Set while its text is a platform's though it was written on the board: its last edit is one a
|
|
490
|
+
* sync brought in, which the board can't refuse or check. An edit made on the board clears it.
|
|
491
|
+
*/
|
|
492
|
+
platformText?: true;
|
|
488
493
|
/** The index of the last event that changed it. Folds from before it existed leave it out. */
|
|
489
494
|
version?: number;
|
|
490
495
|
/** The index of its post, or of its last edit or delete. Folds from before it existed leave it out. */
|
|
@@ -502,8 +507,14 @@ type Actor = {
|
|
|
502
507
|
handle: string;
|
|
503
508
|
name: string;
|
|
504
509
|
avatar: string | null;
|
|
510
|
+
/** Who an actor with a profile (an agent, or a platform user a sync speaks for) acts through. */
|
|
511
|
+
via?: Via;
|
|
512
|
+
/** A platform user's platform (`slack`), as their sync key was registered with: for display. */
|
|
513
|
+
platform?: string;
|
|
505
514
|
/** A host's principal, or one of its profiles: once it's seen as one, it stays one. Views leave it out. */
|
|
506
515
|
host?: true;
|
|
516
|
+
/** Its last `actor.seen` was by a write whose credential named it as shown. Each write says it anew. */
|
|
517
|
+
verified?: true;
|
|
507
518
|
};
|
|
508
519
|
/** A copy of a board message on a platform. */
|
|
509
520
|
/** `files`: the platform's IDs for the message's files, or null when it refused them; unset until they're sent. */
|
|
@@ -923,15 +934,17 @@ declare const UpdateGrantBody: z.ZodObject<{
|
|
|
923
934
|
}, z.core.$strict>], "kind">>>;
|
|
924
935
|
can: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>>;
|
|
925
936
|
}, z.core.$strict>;
|
|
926
|
-
/**
|
|
927
|
-
|
|
937
|
+
/**
|
|
938
|
+
* A schema version to register, for good: `name` and `version` are its ID (`sandbox@1`), and
|
|
939
|
+
* `schema` is a JSON Schema for an object, in structural keywords only, which the board checks.
|
|
940
|
+
* Strict, so a board that doesn't know a field refuses it: what it kept could never be changed.
|
|
941
|
+
*/
|
|
942
|
+
declare const SchemaBody: z.ZodObject<{
|
|
928
943
|
name: z.ZodString;
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
expires: z.ZodOptional<z.ZodString>;
|
|
934
|
-
}, z.core.$strip>;
|
|
944
|
+
version: z.ZodNumber;
|
|
945
|
+
description: z.ZodOptional<z.ZodString>;
|
|
946
|
+
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
947
|
+
}, z.core.$strict>;
|
|
935
948
|
declare const SyncBody: z.ZodObject<{
|
|
936
949
|
target: z.ZodString;
|
|
937
950
|
}, z.core.$strip>;
|
|
@@ -1149,15 +1162,6 @@ declare const SyncImportBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1149
1162
|
unavailable: z.ZodNullable<z.ZodString>;
|
|
1150
1163
|
message: z.ZodNullable<z.ZodString>;
|
|
1151
1164
|
}, z.core.$strip>>;
|
|
1152
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1153
|
-
op: z.ZodLiteral<"seen">;
|
|
1154
|
-
author: z.ZodObject<{
|
|
1155
|
-
id: z.ZodString;
|
|
1156
|
-
handle: z.ZodString;
|
|
1157
|
-
name: z.ZodString;
|
|
1158
|
-
isBot: z.ZodBoolean;
|
|
1159
|
-
avatar: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | null, string | null>>;
|
|
1160
|
-
}, z.core.$strip>;
|
|
1161
1165
|
}, z.core.$strip>], "op">;
|
|
1162
1166
|
/** What sync did on a platform, about a board message: it landed, its files did, it gave up, or its thread syncs with a target. */
|
|
1163
1167
|
declare const SyncReceiptBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1410,10 +1414,8 @@ type UpdateGrantInput = {
|
|
|
1410
1414
|
remove?: readonly PrincipalInput[];
|
|
1411
1415
|
can?: GrantCan;
|
|
1412
1416
|
};
|
|
1413
|
-
/** What `
|
|
1414
|
-
type
|
|
1415
|
-
can?: Can | GrantCan;
|
|
1416
|
-
};
|
|
1417
|
+
/** What `createSchema` takes: a version's name, its number, and its JSON Schema. */
|
|
1418
|
+
type SchemaInput = z.input<typeof SchemaBody>;
|
|
1417
1419
|
type SchedulesQueryOutput = z.output<typeof SchedulesQuery>;
|
|
1418
1420
|
/** A scheduled message. It posts as `by`, its creator; each message it posts carries `schedule: { id, n }`. */
|
|
1419
1421
|
type ScheduleView = {
|
|
@@ -1447,7 +1449,6 @@ type ScheduleView = {
|
|
|
1447
1449
|
actor: string;
|
|
1448
1450
|
principal: string;
|
|
1449
1451
|
profile: string | null;
|
|
1450
|
-
session: string | null;
|
|
1451
1452
|
};
|
|
1452
1453
|
reason: 'canceled' | 'thread_deleted' | 'dropped' | 'revoked';
|
|
1453
1454
|
} | null;
|
|
@@ -1455,7 +1456,6 @@ type ScheduleView = {
|
|
|
1455
1456
|
actor: string;
|
|
1456
1457
|
principal: string;
|
|
1457
1458
|
profile: string | null;
|
|
1458
|
-
session: string | null;
|
|
1459
1459
|
};
|
|
1460
1460
|
author: ActorView;
|
|
1461
1461
|
createdAt: string;
|
|
@@ -1525,25 +1525,34 @@ type GrantView = {
|
|
|
1525
1525
|
by: string | null;
|
|
1526
1526
|
at: string | null;
|
|
1527
1527
|
};
|
|
1528
|
-
/** A
|
|
1529
|
-
type
|
|
1528
|
+
/** A schema version, as the board keeps it: it never changes. */
|
|
1529
|
+
type SchemaView = {
|
|
1530
|
+
/** `name@version`: what names it everywhere. */
|
|
1530
1531
|
id: string;
|
|
1531
1532
|
name: string;
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
/**
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1533
|
+
version: number;
|
|
1534
|
+
description: string | null;
|
|
1535
|
+
/** The JSON Schema its data matches. */
|
|
1536
|
+
schema: Record<string, unknown>;
|
|
1537
|
+
/** One every board has: no one registers a version under its name. */
|
|
1538
|
+
builtIn: boolean;
|
|
1539
|
+
/** The actor that registered it, and when: null for a built-in. */
|
|
1540
|
+
by: string | null;
|
|
1541
|
+
at: string | null;
|
|
1542
|
+
};
|
|
1543
|
+
/**
|
|
1544
|
+
* `kind` says who wrote it: a `person` or a platform user (`external`), an agent (`profile`), or a deployment or workflow.
|
|
1545
|
+
* `via` is who one with a profile acts through: an agent's person or project, or the principal whose sync speaks for a
|
|
1546
|
+
* platform user (`Malte via www (preview)`). `platform` is a platform user's platform (`slack`), for display: their ID
|
|
1547
|
+
* names the sync key they came through. `verified` says the board checked who they are rather than taking their name
|
|
1548
|
+
* from what they sent: everyone on Vercel's board, and on a local one, whoever shows under the handle a credential it
|
|
1549
|
+
* checked gave them, as itself or after `via`.
|
|
1550
|
+
*/
|
|
1551
|
+
type ActorView = Pick<Actor, 'kind' | 'handle' | 'name' | 'avatar' | 'via' | 'platform'> & {
|
|
1552
|
+
verified?: true;
|
|
1542
1553
|
};
|
|
1543
|
-
/** `kind` says who wrote it: a `person` or a platform user (`external`), an agent (`profile`), or a deployment or workflow. */
|
|
1544
|
-
type ActorView = Pick<Actor, 'kind' | 'handle' | 'name' | 'avatar'>;
|
|
1545
1554
|
/** A message as clients see it: its IDs are refs, and `version` says which of two views of it is newer. */
|
|
1546
|
-
type MessageView = Omit<Message, 'id' | 're' | 'replyTo' | 'links' | 'schedule' | 'version' | 'revision'> & {
|
|
1555
|
+
type MessageView = Omit<Message, 'id' | 're' | 'replyTo' | 'links' | 'schedule' | 'version' | 'revision' | 'platformText'> & {
|
|
1547
1556
|
id: string;
|
|
1548
1557
|
/** The thread's root, or null for a root. */
|
|
1549
1558
|
re: string | null;
|
|
@@ -1563,6 +1572,19 @@ type MessageView = Omit<Message, 'id' | 're' | 'replyTo' | 'links' | 'schedule'
|
|
|
1563
1572
|
n: number;
|
|
1564
1573
|
};
|
|
1565
1574
|
author: ActorView | null;
|
|
1575
|
+
/**
|
|
1576
|
+
* The data its text carries, in order: each fence that names a schema (```json#sandbox@1), which
|
|
1577
|
+
* the board checked against that schema when the message was written. A message a sync brought
|
|
1578
|
+
* in has none, whatever its text says: a platform's text is never checked.
|
|
1579
|
+
*/
|
|
1580
|
+
blocks: BlockView[];
|
|
1581
|
+
};
|
|
1582
|
+
/** A block: the schema it names, and its data, a JSON object that matches it. */
|
|
1583
|
+
type BlockView = {
|
|
1584
|
+
/** The schema's name and version: `sandbox`, 1. */
|
|
1585
|
+
schema: string;
|
|
1586
|
+
version: number;
|
|
1587
|
+
data: Record<string, unknown>;
|
|
1566
1588
|
};
|
|
1567
1589
|
/** A link in a message: a board message it names is a ref. */
|
|
1568
1590
|
type LinkView = Omit<Link, 'message'> & {
|
|
@@ -1657,7 +1679,8 @@ type Me = {
|
|
|
1657
1679
|
name: string;
|
|
1658
1680
|
avatar: string | null;
|
|
1659
1681
|
profile: string | null;
|
|
1660
|
-
|
|
1682
|
+
/** Who you act through, writing with a profile: `claude via julian`. */
|
|
1683
|
+
via?: Via;
|
|
1661
1684
|
expiresAt: string | null;
|
|
1662
1685
|
/** What you may do in each channel pattern, implications included: `{ '*': [...every permission] }` is full access. */
|
|
1663
1686
|
can: AccessSummary;
|
|
@@ -2122,26 +2145,26 @@ declare const routes: {
|
|
|
2122
2145
|
readonly method: 'POST';
|
|
2123
2146
|
readonly path: '/grants/:id/revoke';
|
|
2124
2147
|
};
|
|
2125
|
-
/**
|
|
2126
|
-
readonly
|
|
2148
|
+
/** Every schema: the built-ins, then the board's own. Anyone the board lets in reads them. */
|
|
2149
|
+
readonly schemas: {
|
|
2127
2150
|
readonly method: 'GET';
|
|
2128
|
-
readonly path: '/
|
|
2151
|
+
readonly path: '/schemas';
|
|
2129
2152
|
};
|
|
2130
|
-
|
|
2153
|
+
/** One schema version, by `name@version`. */
|
|
2154
|
+
readonly schema: {
|
|
2155
|
+
readonly method: 'GET';
|
|
2156
|
+
readonly path: '/schemas/:id';
|
|
2157
|
+
};
|
|
2158
|
+
/** Registers a version, which never changes after: needs manage at `*`. The same definition again is a no-op. */
|
|
2159
|
+
readonly createSchema: {
|
|
2131
2160
|
readonly method: 'POST';
|
|
2132
|
-
readonly path: '/
|
|
2161
|
+
readonly path: '/schemas';
|
|
2133
2162
|
readonly body: z.ZodObject<{
|
|
2134
2163
|
name: z.ZodString;
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
expires: z.ZodOptional<z.ZodString>;
|
|
2140
|
-
}, z.core.$strip>;
|
|
2141
|
-
};
|
|
2142
|
-
readonly revokeToken: {
|
|
2143
|
-
readonly method: 'POST';
|
|
2144
|
-
readonly path: '/tokens/:id/revoke';
|
|
2164
|
+
version: z.ZodNumber;
|
|
2165
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2166
|
+
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2167
|
+
}, z.core.$strict>;
|
|
2145
2168
|
};
|
|
2146
2169
|
/** The caller's own post with the client ID it gave: what `POST /messages` answered, for telling a retry before posting. */
|
|
2147
2170
|
readonly posted: {
|
|
@@ -2450,15 +2473,6 @@ declare const routes: {
|
|
|
2450
2473
|
unavailable: z.ZodNullable<z.ZodString>;
|
|
2451
2474
|
message: z.ZodNullable<z.ZodString>;
|
|
2452
2475
|
}, z.core.$strip>>;
|
|
2453
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
2454
|
-
op: z.ZodLiteral<"seen">;
|
|
2455
|
-
author: z.ZodObject<{
|
|
2456
|
-
id: z.ZodString;
|
|
2457
|
-
handle: z.ZodString;
|
|
2458
|
-
name: z.ZodString;
|
|
2459
|
-
isBot: z.ZodBoolean;
|
|
2460
|
-
avatar: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string | null, string | null>>;
|
|
2461
|
-
}, z.core.$strip>;
|
|
2462
2476
|
}, z.core.$strip>], "op">;
|
|
2463
2477
|
};
|
|
2464
2478
|
/** What sync did on a platform: a delivery, its files, a failure, or a thread's new target. */
|
|
@@ -2656,4 +2670,4 @@ declare const routes: {
|
|
|
2656
2670
|
};
|
|
2657
2671
|
type RouteName = keyof typeof routes;
|
|
2658
2672
|
//#endregion
|
|
2659
|
-
export {
|
|
2673
|
+
export { ScheduleBodyOutput as $, union as $t, LinkView as A, TypingBody as At, PostBody as B, ChannelPattern as Bt, InboxEntry as C, SyncThreadView as Ct, InboxQuery as D, ThreadsPage as Dt, InboxPushBody as E, ThreadView as Et, MessageView as F, UploadTicket as Ft, ReactBody as G, GrantShape as Gt, PrincipalInput as H, Grant as Ht, MessagesPage as I, routes as It, RegisterInput as J, Permission as Jt, Ref as K, InvalidCan as Kt, MessagesQuery as L, Access as Lt, MatchView as M, UpdateGrantBody as Mt, MatchesQuery as N, UpdateGrantInput as Nt, LABEL_CONDITIONS_MAX as O, ThreadsQuery as Ot, Me as P, UploadStartBody as Pt, ScheduleBody as Q, parseCan as Qt, MessagesQueryInput as R, AccessSummary as Rt, InboxAckBody as S, SyncReceiptInput as St, InboxNextQuery as T, ThreadSummaryView as Tt, PrincipalView as U, GrantChange as Ut, PostInput as V, FULL_ACCESS as Vt, REGISTERED_WATCHERS_MAX as W, GrantChangeRefusal as Wt, ResolvedSyncTarget as X, checkGrantChange as Xt, RegistrationView as Y, WrittenCan as Yt, RouteName as Z, compileAccess as Zt, FiltersInput as _, SyncFindQuery as _t, BoardEventView as a, Labels as an, SchemaBody as at, GrantInput as b, SyncImportInput as bt, CreateChannelBody as c, ExternalFile as cn, SourceJoin as ct, EditBody as d, SourceRead as dt, Actor as en, ScheduleInput as et, EventsPage as f, SourceReadQuery as ft, Explanation as g, SyncFindInput as gt, ExplainQuery as h, SyncCopiesView as ht, BlockView as i, CAN_MAX as in, SchedulesQueryOutput as it, LinkedQuery as j, TypingResult as jt, LabelBody as k, ThreadsQueryInput as kt, DeleteBody as l, ExternalLink as ln, SourceJoinBody as lt, EventsQueryInput as m, SyncCopiesQuery as mt, ActorView as n, Attachment as nn, SchedulesQuery as nt, CanAt as o, ExternalAuthor as on, SchemaInput as ot, EventsQuery as p, SyncBody as pt, RegisterBody as q, Level as qt, ApiError as r, Author as rn, SchedulesQueryInput as rt, ChannelView as s, ExternalEvent as sn, SchemaView as st, AckBody as t, ExternalCopy as tn, ScheduleView as tt, Discovery as u, Link as un, SourceMessage as ut, GrantBody as v, SyncFindView as vt, InboxItem as w, SyncedView as wt, GrantView as x, SyncReceiptBody as xt, GrantCan as y, SyncImportBody as yt, ParsedFilters as z, Can as zt };
|
|
@@ -53,8 +53,13 @@ function platformAvatar(avatar) {
|
|
|
53
53
|
const Author = z.object({
|
|
54
54
|
actor: ActorId,
|
|
55
55
|
principal: z.string().min(1),
|
|
56
|
-
profile: z.string().nullable()
|
|
57
|
-
|
|
56
|
+
profile: z.string().nullable()
|
|
57
|
+
});
|
|
58
|
+
/** Who wrote something, as views show it: a log from before sessions were gone keeps one on each, which no view shows. */
|
|
59
|
+
const authorView = ({ actor, principal, profile }) => ({
|
|
60
|
+
actor,
|
|
61
|
+
principal,
|
|
62
|
+
profile
|
|
58
63
|
});
|
|
59
64
|
/** 128 random bits, base64url: an attachment is named by an ID nobody can guess. */
|
|
60
65
|
/** 128 random bits, base64url, as a board on this machine makes them; or `att_` and a UUID, as Vercel's board does. */
|
|
@@ -69,4 +74,4 @@ const Attachment = z.object({
|
|
|
69
74
|
/** A registered watcher's ID: a profile name, since its writes are by that profile. */
|
|
70
75
|
const RemoteWatcherId = z.string().regex(/^[A-Za-z][A-Za-z0-9-]{0,31}$/, "ids start with a letter and use up to 32 letters, numbers, and hyphens");
|
|
71
76
|
//#endregion
|
|
72
|
-
export { actorKind as _, CAN_MAX as a,
|
|
77
|
+
export { actorKind as _, CAN_MAX as a, storable as b, Handle as c, Labels as d, MESSAGE_TEXT_MAX as f, SeenActorKind as g, RemoteWatcherId as h, Author as i, LabelKey as l, MessageText as m, Attachment as n, ChannelPath as o, MessageId as p, AttachmentId as r, Emoji as s, ActorId as t, LabelValue as u, authorView as v, toStorable as x, platformAvatar as y };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { n as block, r as findBlocks, t as FoundBlock } from "./blocks-DGvh2alZ.mjs";
|
|
2
|
+
//#region src/contract/data-schemas.d.ts
|
|
3
|
+
/** A schema's definition: a JSON Schema for an object, in structural keywords only. */
|
|
4
|
+
type SchemaDefinition = Record<string, unknown>;
|
|
5
|
+
/** `sandbox@1` as its name and version, or null for anything else. */
|
|
6
|
+
export declare function parseSchemaId(id: string): {
|
|
7
|
+
name: string;
|
|
8
|
+
version: number;
|
|
9
|
+
} | null;
|
|
10
|
+
/**
|
|
11
|
+
* The schemas every board has, as Vercel's API has them: their names are reserved, so no one
|
|
12
|
+
* registers a version of one. They may use what a registered schema can't (`pattern`): they're the
|
|
13
|
+
* board's own, and never change.
|
|
14
|
+
*/
|
|
15
|
+
export declare const BUILT_IN_SCHEMAS: readonly {
|
|
16
|
+
name: string;
|
|
17
|
+
version: number;
|
|
18
|
+
description: string;
|
|
19
|
+
schema: SchemaDefinition;
|
|
20
|
+
}[];
|
|
21
|
+
/**
|
|
22
|
+
* Why `schema` can't be registered, or null when it can: it describes an object, stays small, and
|
|
23
|
+
* uses only the structural keywords, each with a value that means something. Checking a value
|
|
24
|
+
* against one then costs the value's size times the schema's, and both are bounded.
|
|
25
|
+
*/
|
|
26
|
+
export declare function checkDefinition(schema: unknown): string | null;
|
|
27
|
+
/** `value` as JSON with every object's keys in order: two definitions that say the same are the same text. */
|
|
28
|
+
export declare function canonical(value: unknown): string;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/contract/data-values.d.ts
|
|
31
|
+
/**
|
|
32
|
+
* Why `value` doesn't match `schema`, or null when it does: the first thing wrong, said of the
|
|
33
|
+
* field it's wrong in (`action must be "started" or "stopped"`, `config.vcpus must be an integer`).
|
|
34
|
+
*/
|
|
35
|
+
export declare function checkValue(schema: SchemaDefinition | boolean, value: unknown): string | null;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { type FoundBlock, type SchemaDefinition, block, findBlocks };
|
package/dist/schemas.mjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { c as canonical, d as parseSchemaId, i as BUILT_IN_SCHEMAS, l as checkDefinition, r as findBlocks, t as block } from "./blocks-CVoBC7ur.mjs";
|
|
2
|
+
import { t as checkValue } from "./data-values-C-Cq80hz.mjs";
|
|
3
|
+
export { BUILT_IN_SCHEMAS, block, canonical, checkDefinition, checkValue, findBlocks, parseSchemaId };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as BoardError } from "./errors-
|
|
2
|
-
import { d as localTokenFile, t as board } from "./server-
|
|
3
|
-
import { t as oidcTokens } from "./tokens-
|
|
4
|
-
import { t as local } from "./local-
|
|
1
|
+
import { u as BoardError } from "./errors-DcQf5WeM.mjs";
|
|
2
|
+
import { d as localTokenFile, t as board } from "./server-DgpRZ4Nu.mjs";
|
|
3
|
+
import { t as oidcTokens } from "./tokens-D7_ZIWpX.mjs";
|
|
4
|
+
import { t as local } from "./local-B9y4p6N7.mjs";
|
|
5
5
|
import { mkdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import { userInfo } from "node:os";
|
|
7
7
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -178,4 +178,4 @@ async function forward(handler, req, res) {
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
//#endregion
|
|
181
|
-
export {
|
|
181
|
+
export { serveLocal };
|