@neta-art/cohub 5.6.0 → 5.8.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 +18 -5
- package/dist/board/codec.js +15 -0
- package/dist/board/core/palette.d.ts +3 -2
- package/dist/board/core/shape-types.d.ts +8 -2
- package/dist/board/core/shape-types.js +3 -7
- package/dist/board/core/tool-styles.d.ts +2 -1
- package/dist/board/image-key.js +3 -5
- package/dist/board/index.d.ts +10 -5
- package/dist/board/index.js +7 -3
- package/dist/board/media-playback.d.ts +22 -0
- package/dist/board/media-playback.js +67 -0
- package/dist/board/media.d.ts +7 -0
- package/dist/board/media.js +70 -0
- package/dist/board/nodes.d.ts +113 -0
- package/dist/board/nodes.js +154 -0
- package/dist/board/render/audio-waveform.d.ts +12 -0
- package/dist/board/render/audio-waveform.js +36 -0
- package/dist/board/render/index.d.ts +4 -1
- package/dist/board/render/index.js +4 -1
- package/dist/board/render/media-interaction.d.ts +19 -0
- package/dist/board/render/media-interaction.js +26 -0
- package/dist/board/render/renderers/audio-card-renderer.d.ts +5 -0
- package/dist/board/render/renderers/audio-card-renderer.js +120 -0
- package/dist/board/render/renderers/board-renderer-registry.js +4 -2
- package/dist/board/render/renderers/draw-card-renderer.js +1 -1
- package/dist/board/render/renderers/file-card-renderer.js +1 -1
- package/dist/board/render/renderers/frame-card-renderer.js +1 -1
- package/dist/board/render/renderers/geo-card-renderer.js +1 -1
- package/dist/board/render/renderers/image-card-renderer.js +1 -1
- package/dist/board/render/renderers/task-card-renderer.d.ts +2 -1
- package/dist/board/render/renderers/task-card-renderer.js +21 -53
- package/dist/board/render/renderers/text-card-renderer.js +1 -1
- package/dist/board/render/renderers/unknown-card-renderer.js +1 -1
- package/dist/board/render/renderers/video-card-renderer.js +1 -1
- package/dist/board/render/video-thumbnail.d.ts +16 -0
- package/dist/board/render/video-thumbnail.js +86 -0
- package/dist/board/task.d.ts +10 -5
- package/dist/board/task.js +159 -103
- package/dist/chunks/environment.d.ts +6 -6
- package/dist/chunks/environment.js +6 -6
- package/dist/chunks/http.d.ts +71 -5
- package/dist/chunks/http.js +1535 -167
- package/dist/chunks/transport.js +8 -1
- package/dist/chunks/websocket.d.ts +139 -3
- package/dist/http.d.ts +3 -3
- package/dist/index.d.ts +245 -4
- package/dist/index.js +438 -788
- package/dist/protocol/dist/board-document.d.ts +271 -53
- package/dist/protocol/dist/board-document.js +54 -22
- package/dist/protocol/dist/board-node.d.ts +18 -0
- package/dist/protocol/dist/board-node.js +239 -0
- package/dist/protocol/dist/board-url.d.ts +12 -0
- package/dist/protocol/dist/board-url.js +83 -0
- package/dist/protocol/dist/board.d.ts +5 -0
- package/dist/protocol/dist/index.d.ts +2 -1
- package/dist/protocol/dist/index.js +2 -1
- package/dist/protocol/dist/provenance.js +1 -0
- package/docs/work-runtime-guide.md +7 -7
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BOARD_DOCUMENT_KIND, BOARD_EXTENSION } from "./board.js";
|
|
2
|
+
import { BOARD_REMOTE_URL_MAX_LENGTH, BoardRemoteUrlSchema, normalizeBoardRemoteUrl } from "./board-url.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region ../protocol/dist/board-document.d.ts
|
|
4
5
|
declare const BoardFrameSchema: z.ZodObject<{
|
|
@@ -370,6 +371,50 @@ declare const BoardVideoItemSchema: z.ZodObject<{
|
|
|
370
371
|
naturalHeight: z.ZodOptional<z.ZodNumber>;
|
|
371
372
|
}, z.core.$strip>>;
|
|
372
373
|
}, z.core.$strip>;
|
|
374
|
+
/** Audio node — space file only. Playback state is local UI, never synced. */
|
|
375
|
+
declare const BoardAudioItemSchema: z.ZodObject<{
|
|
376
|
+
id: z.ZodString;
|
|
377
|
+
frame: z.ZodObject<{
|
|
378
|
+
x: z.ZodNumber;
|
|
379
|
+
y: z.ZodNumber;
|
|
380
|
+
width: z.ZodNumber;
|
|
381
|
+
height: z.ZodNumber;
|
|
382
|
+
rotation: z.ZodDefault<z.ZodNumber>;
|
|
383
|
+
}, z.core.$strip>;
|
|
384
|
+
locked: z.ZodOptional<z.ZodBoolean>;
|
|
385
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
386
|
+
variant: z.ZodDefault<z.ZodString>;
|
|
387
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
388
|
+
accentColor: z.ZodOptional<z.ZodString>;
|
|
389
|
+
size: z.ZodDefault<z.ZodEnum<{
|
|
390
|
+
lg: "lg";
|
|
391
|
+
md: "md";
|
|
392
|
+
sm: "sm";
|
|
393
|
+
}>>;
|
|
394
|
+
emphasis: z.ZodDefault<z.ZodEnum<{
|
|
395
|
+
epic: "epic";
|
|
396
|
+
legendary: "legendary";
|
|
397
|
+
normal: "normal";
|
|
398
|
+
rare: "rare";
|
|
399
|
+
}>>;
|
|
400
|
+
effects: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
401
|
+
}, z.core.$strip>>;
|
|
402
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
403
|
+
type: z.ZodLiteral<"audio">;
|
|
404
|
+
ref: z.ZodObject<{
|
|
405
|
+
kind: z.ZodLiteral<"space-file">;
|
|
406
|
+
path: z.ZodString;
|
|
407
|
+
}, z.core.$strip>;
|
|
408
|
+
snapshot: z.ZodOptional<z.ZodObject<{
|
|
409
|
+
title: z.ZodOptional<z.ZodString>;
|
|
410
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
411
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
412
|
+
mtimeMs: z.ZodOptional<z.ZodNumber>;
|
|
413
|
+
naturalWidth: z.ZodOptional<z.ZodNumber>;
|
|
414
|
+
naturalHeight: z.ZodOptional<z.ZodNumber>;
|
|
415
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
416
|
+
}, z.core.$strip>>;
|
|
417
|
+
}, z.core.$strip>;
|
|
373
418
|
/**
|
|
374
419
|
* Cached display facts for a file card.
|
|
375
420
|
*
|
|
@@ -440,19 +485,39 @@ declare const BoardFileItemSchema: z.ZodObject<{
|
|
|
440
485
|
coverUrl: z.ZodOptional<z.ZodString>;
|
|
441
486
|
}, z.core.$strip>>;
|
|
442
487
|
}, z.core.$strip>;
|
|
443
|
-
declare const
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
video: "video";
|
|
449
|
-
}>;
|
|
450
|
-
url: z.ZodOptional<z.ZodString>;
|
|
451
|
-
textExcerpt: z.ZodOptional<z.ZodString>;
|
|
488
|
+
declare const BOARD_TASK_ARTIFACT_LIMIT = 6;
|
|
489
|
+
declare const BoardTaskArtifactSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
490
|
+
id: z.ZodString;
|
|
491
|
+
title: z.ZodOptional<z.ZodString>;
|
|
492
|
+
url: z.ZodString;
|
|
452
493
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
494
|
+
type: z.ZodLiteral<"image">;
|
|
453
495
|
naturalWidth: z.ZodOptional<z.ZodNumber>;
|
|
454
496
|
naturalHeight: z.ZodOptional<z.ZodNumber>;
|
|
455
|
-
}, z.core.$
|
|
497
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
498
|
+
id: z.ZodString;
|
|
499
|
+
title: z.ZodOptional<z.ZodString>;
|
|
500
|
+
url: z.ZodString;
|
|
501
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
502
|
+
type: z.ZodLiteral<"video">;
|
|
503
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
504
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
505
|
+
naturalWidth: z.ZodOptional<z.ZodNumber>;
|
|
506
|
+
naturalHeight: z.ZodOptional<z.ZodNumber>;
|
|
507
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
508
|
+
id: z.ZodString;
|
|
509
|
+
title: z.ZodOptional<z.ZodString>;
|
|
510
|
+
url: z.ZodString;
|
|
511
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
512
|
+
type: z.ZodLiteral<"audio">;
|
|
513
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
514
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
515
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
516
|
+
id: z.ZodString;
|
|
517
|
+
type: z.ZodLiteral<"text">;
|
|
518
|
+
title: z.ZodOptional<z.ZodString>;
|
|
519
|
+
textExcerpt: z.ZodString;
|
|
520
|
+
}, z.core.$strict>], "type">;
|
|
456
521
|
/**
|
|
457
522
|
* Cached task facts used for an immediate first paint. The task run remains the
|
|
458
523
|
* source of truth and live clients refresh this projection by `taskRunId`.
|
|
@@ -468,22 +533,41 @@ declare const BoardTaskSnapshotSchema: z.ZodObject<{
|
|
|
468
533
|
title: z.ZodString;
|
|
469
534
|
model: z.ZodOptional<z.ZodString>;
|
|
470
535
|
promptExcerpt: z.ZodOptional<z.ZodString>;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
text: "text";
|
|
477
|
-
video: "video";
|
|
478
|
-
}>;
|
|
479
|
-
url: z.ZodOptional<z.ZodString>;
|
|
480
|
-
textExcerpt: z.ZodOptional<z.ZodString>;
|
|
536
|
+
artifactCount: z.ZodNumber;
|
|
537
|
+
artifacts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
538
|
+
id: z.ZodString;
|
|
539
|
+
title: z.ZodOptional<z.ZodString>;
|
|
540
|
+
url: z.ZodString;
|
|
481
541
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
542
|
+
type: z.ZodLiteral<"image">;
|
|
482
543
|
naturalWidth: z.ZodOptional<z.ZodNumber>;
|
|
483
544
|
naturalHeight: z.ZodOptional<z.ZodNumber>;
|
|
484
|
-
}, z.core.$
|
|
545
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
546
|
+
id: z.ZodString;
|
|
547
|
+
title: z.ZodOptional<z.ZodString>;
|
|
548
|
+
url: z.ZodString;
|
|
549
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
550
|
+
type: z.ZodLiteral<"video">;
|
|
551
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
552
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
553
|
+
naturalWidth: z.ZodOptional<z.ZodNumber>;
|
|
554
|
+
naturalHeight: z.ZodOptional<z.ZodNumber>;
|
|
555
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
556
|
+
id: z.ZodString;
|
|
557
|
+
title: z.ZodOptional<z.ZodString>;
|
|
558
|
+
url: z.ZodString;
|
|
559
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
560
|
+
type: z.ZodLiteral<"audio">;
|
|
561
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
562
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
563
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
564
|
+
id: z.ZodString;
|
|
565
|
+
type: z.ZodLiteral<"text">;
|
|
566
|
+
title: z.ZodOptional<z.ZodString>;
|
|
567
|
+
textExcerpt: z.ZodString;
|
|
568
|
+
}, z.core.$strict>], "type">>>;
|
|
485
569
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
486
|
-
}, z.core.$
|
|
570
|
+
}, z.core.$strict>;
|
|
487
571
|
/** A stable reference to a task run with a small, replaceable display cache. */
|
|
488
572
|
declare const BoardTaskItemSchema: z.ZodObject<{
|
|
489
573
|
id: z.ZodString;
|
|
@@ -526,22 +610,41 @@ declare const BoardTaskItemSchema: z.ZodObject<{
|
|
|
526
610
|
title: z.ZodString;
|
|
527
611
|
model: z.ZodOptional<z.ZodString>;
|
|
528
612
|
promptExcerpt: z.ZodOptional<z.ZodString>;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
text: "text";
|
|
535
|
-
video: "video";
|
|
536
|
-
}>;
|
|
537
|
-
url: z.ZodOptional<z.ZodString>;
|
|
538
|
-
textExcerpt: z.ZodOptional<z.ZodString>;
|
|
613
|
+
artifactCount: z.ZodNumber;
|
|
614
|
+
artifacts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
615
|
+
id: z.ZodString;
|
|
616
|
+
title: z.ZodOptional<z.ZodString>;
|
|
617
|
+
url: z.ZodString;
|
|
539
618
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
619
|
+
type: z.ZodLiteral<"image">;
|
|
540
620
|
naturalWidth: z.ZodOptional<z.ZodNumber>;
|
|
541
621
|
naturalHeight: z.ZodOptional<z.ZodNumber>;
|
|
542
|
-
}, z.core.$
|
|
622
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
623
|
+
id: z.ZodString;
|
|
624
|
+
title: z.ZodOptional<z.ZodString>;
|
|
625
|
+
url: z.ZodString;
|
|
626
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
627
|
+
type: z.ZodLiteral<"video">;
|
|
628
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
629
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
630
|
+
naturalWidth: z.ZodOptional<z.ZodNumber>;
|
|
631
|
+
naturalHeight: z.ZodOptional<z.ZodNumber>;
|
|
632
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
633
|
+
id: z.ZodString;
|
|
634
|
+
title: z.ZodOptional<z.ZodString>;
|
|
635
|
+
url: z.ZodString;
|
|
636
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
637
|
+
type: z.ZodLiteral<"audio">;
|
|
638
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
639
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
640
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
641
|
+
id: z.ZodString;
|
|
642
|
+
type: z.ZodLiteral<"text">;
|
|
643
|
+
title: z.ZodOptional<z.ZodString>;
|
|
644
|
+
textExcerpt: z.ZodString;
|
|
645
|
+
}, z.core.$strict>], "type">>>;
|
|
543
646
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
544
|
-
}, z.core.$
|
|
647
|
+
}, z.core.$strict>;
|
|
545
648
|
}, z.core.$strip>;
|
|
546
649
|
/**
|
|
547
650
|
* The set of shape types this client understands natively. Anything else is
|
|
@@ -549,7 +652,7 @@ declare const BoardTaskItemSchema: z.ZodObject<{
|
|
|
549
652
|
* authored by newer clients round-trip losslessly — data is never dropped or
|
|
550
653
|
* silently downgraded just because this client predates a shape type.
|
|
551
654
|
*/
|
|
552
|
-
declare const KNOWN_BOARD_ITEM_TYPES: readonly ["image", "video", "file", "task", "text", "geo", "draw", "arrow", "frame"];
|
|
655
|
+
declare const KNOWN_BOARD_ITEM_TYPES: readonly ["image", "video", "audio", "file", "task", "text", "geo", "draw", "arrow", "frame"];
|
|
553
656
|
type KnownBoardItemType = (typeof KNOWN_BOARD_ITEM_TYPES)[number];
|
|
554
657
|
/**
|
|
555
658
|
* A forward-compatible carrier for shape types this client does not recognise.
|
|
@@ -640,6 +743,39 @@ declare const BoardItemSchema: z.ZodPipe<z.ZodAny, z.ZodTransform<BoardUnknownIt
|
|
|
640
743
|
naturalWidth?: number | undefined;
|
|
641
744
|
naturalHeight?: number | undefined;
|
|
642
745
|
} | undefined;
|
|
746
|
+
} | {
|
|
747
|
+
id: string;
|
|
748
|
+
frame: {
|
|
749
|
+
x: number;
|
|
750
|
+
y: number;
|
|
751
|
+
width: number;
|
|
752
|
+
height: number;
|
|
753
|
+
rotation: number;
|
|
754
|
+
};
|
|
755
|
+
locked?: boolean | undefined;
|
|
756
|
+
style?: {
|
|
757
|
+
variant: string;
|
|
758
|
+
theme?: string | undefined;
|
|
759
|
+
accentColor?: string | undefined;
|
|
760
|
+
size: "lg" | "md" | "sm";
|
|
761
|
+
emphasis: "epic" | "legendary" | "normal" | "rare";
|
|
762
|
+
effects: string[];
|
|
763
|
+
} | undefined;
|
|
764
|
+
metadata?: Record<string, unknown> | undefined;
|
|
765
|
+
type: "audio";
|
|
766
|
+
ref: {
|
|
767
|
+
kind: "space-file";
|
|
768
|
+
path: string;
|
|
769
|
+
};
|
|
770
|
+
snapshot?: {
|
|
771
|
+
title?: string | undefined;
|
|
772
|
+
mimeType?: string | undefined;
|
|
773
|
+
size?: number | undefined;
|
|
774
|
+
mtimeMs?: number | undefined;
|
|
775
|
+
naturalWidth?: number | undefined;
|
|
776
|
+
naturalHeight?: number | undefined;
|
|
777
|
+
durationMs?: number | undefined;
|
|
778
|
+
} | undefined;
|
|
643
779
|
} | {
|
|
644
780
|
id: string;
|
|
645
781
|
frame: {
|
|
@@ -700,15 +836,39 @@ declare const BoardItemSchema: z.ZodPipe<z.ZodAny, z.ZodTransform<BoardUnknownIt
|
|
|
700
836
|
title: string;
|
|
701
837
|
model?: string | undefined;
|
|
702
838
|
promptExcerpt?: string | undefined;
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
839
|
+
artifactCount: number;
|
|
840
|
+
artifacts: ({
|
|
841
|
+
id: string;
|
|
842
|
+
title?: string | undefined;
|
|
843
|
+
url: string;
|
|
708
844
|
mimeType?: string | undefined;
|
|
845
|
+
type: "image";
|
|
709
846
|
naturalWidth?: number | undefined;
|
|
710
847
|
naturalHeight?: number | undefined;
|
|
711
|
-
} |
|
|
848
|
+
} | {
|
|
849
|
+
id: string;
|
|
850
|
+
title?: string | undefined;
|
|
851
|
+
url: string;
|
|
852
|
+
mimeType?: string | undefined;
|
|
853
|
+
type: "video";
|
|
854
|
+
previewUrl?: string | undefined;
|
|
855
|
+
durationMs?: number | undefined;
|
|
856
|
+
naturalWidth?: number | undefined;
|
|
857
|
+
naturalHeight?: number | undefined;
|
|
858
|
+
} | {
|
|
859
|
+
id: string;
|
|
860
|
+
title?: string | undefined;
|
|
861
|
+
url: string;
|
|
862
|
+
mimeType?: string | undefined;
|
|
863
|
+
type: "audio";
|
|
864
|
+
previewUrl?: string | undefined;
|
|
865
|
+
durationMs?: number | undefined;
|
|
866
|
+
} | {
|
|
867
|
+
id: string;
|
|
868
|
+
type: "text";
|
|
869
|
+
title?: string | undefined;
|
|
870
|
+
textExcerpt: string;
|
|
871
|
+
})[];
|
|
712
872
|
updatedAt?: string | undefined;
|
|
713
873
|
};
|
|
714
874
|
} | {
|
|
@@ -953,6 +1113,39 @@ declare const BoardDocumentSchema: z.ZodObject<{
|
|
|
953
1113
|
naturalWidth?: number | undefined;
|
|
954
1114
|
naturalHeight?: number | undefined;
|
|
955
1115
|
} | undefined;
|
|
1116
|
+
} | {
|
|
1117
|
+
id: string;
|
|
1118
|
+
frame: {
|
|
1119
|
+
x: number;
|
|
1120
|
+
y: number;
|
|
1121
|
+
width: number;
|
|
1122
|
+
height: number;
|
|
1123
|
+
rotation: number;
|
|
1124
|
+
};
|
|
1125
|
+
locked?: boolean | undefined;
|
|
1126
|
+
style?: {
|
|
1127
|
+
variant: string;
|
|
1128
|
+
theme?: string | undefined;
|
|
1129
|
+
accentColor?: string | undefined;
|
|
1130
|
+
size: "lg" | "md" | "sm";
|
|
1131
|
+
emphasis: "epic" | "legendary" | "normal" | "rare";
|
|
1132
|
+
effects: string[];
|
|
1133
|
+
} | undefined;
|
|
1134
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1135
|
+
type: "audio";
|
|
1136
|
+
ref: {
|
|
1137
|
+
kind: "space-file";
|
|
1138
|
+
path: string;
|
|
1139
|
+
};
|
|
1140
|
+
snapshot?: {
|
|
1141
|
+
title?: string | undefined;
|
|
1142
|
+
mimeType?: string | undefined;
|
|
1143
|
+
size?: number | undefined;
|
|
1144
|
+
mtimeMs?: number | undefined;
|
|
1145
|
+
naturalWidth?: number | undefined;
|
|
1146
|
+
naturalHeight?: number | undefined;
|
|
1147
|
+
durationMs?: number | undefined;
|
|
1148
|
+
} | undefined;
|
|
956
1149
|
} | {
|
|
957
1150
|
id: string;
|
|
958
1151
|
frame: {
|
|
@@ -1013,15 +1206,39 @@ declare const BoardDocumentSchema: z.ZodObject<{
|
|
|
1013
1206
|
title: string;
|
|
1014
1207
|
model?: string | undefined;
|
|
1015
1208
|
promptExcerpt?: string | undefined;
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1209
|
+
artifactCount: number;
|
|
1210
|
+
artifacts: ({
|
|
1211
|
+
id: string;
|
|
1212
|
+
title?: string | undefined;
|
|
1213
|
+
url: string;
|
|
1021
1214
|
mimeType?: string | undefined;
|
|
1215
|
+
type: "image";
|
|
1022
1216
|
naturalWidth?: number | undefined;
|
|
1023
1217
|
naturalHeight?: number | undefined;
|
|
1024
|
-
} |
|
|
1218
|
+
} | {
|
|
1219
|
+
id: string;
|
|
1220
|
+
title?: string | undefined;
|
|
1221
|
+
url: string;
|
|
1222
|
+
mimeType?: string | undefined;
|
|
1223
|
+
type: "video";
|
|
1224
|
+
previewUrl?: string | undefined;
|
|
1225
|
+
durationMs?: number | undefined;
|
|
1226
|
+
naturalWidth?: number | undefined;
|
|
1227
|
+
naturalHeight?: number | undefined;
|
|
1228
|
+
} | {
|
|
1229
|
+
id: string;
|
|
1230
|
+
title?: string | undefined;
|
|
1231
|
+
url: string;
|
|
1232
|
+
mimeType?: string | undefined;
|
|
1233
|
+
type: "audio";
|
|
1234
|
+
previewUrl?: string | undefined;
|
|
1235
|
+
durationMs?: number | undefined;
|
|
1236
|
+
} | {
|
|
1237
|
+
id: string;
|
|
1238
|
+
type: "text";
|
|
1239
|
+
title?: string | undefined;
|
|
1240
|
+
textExcerpt: string;
|
|
1241
|
+
})[];
|
|
1025
1242
|
updatedAt?: string | undefined;
|
|
1026
1243
|
};
|
|
1027
1244
|
} | {
|
|
@@ -1241,13 +1458,14 @@ type BoardArrowItem = z.infer<typeof BoardArrowItemSchema>;
|
|
|
1241
1458
|
type BoardFrameItem = z.infer<typeof BoardFrameItemSchema>;
|
|
1242
1459
|
type BoardImageItem = z.infer<typeof BoardImageItemSchema>;
|
|
1243
1460
|
type BoardVideoItem = z.infer<typeof BoardVideoItemSchema>;
|
|
1461
|
+
type BoardAudioItem = z.infer<typeof BoardAudioItemSchema>;
|
|
1244
1462
|
type BoardFileSnapshot = z.infer<typeof BoardFileSnapshotSchema>;
|
|
1245
1463
|
type BoardFileItem = z.infer<typeof BoardFileItemSchema>;
|
|
1246
|
-
type
|
|
1464
|
+
type BoardTaskArtifact = z.infer<typeof BoardTaskArtifactSchema>;
|
|
1247
1465
|
type BoardTaskSnapshot = z.infer<typeof BoardTaskSnapshotSchema>;
|
|
1248
1466
|
type BoardTaskItem = z.infer<typeof BoardTaskItemSchema>;
|
|
1249
1467
|
/** Known (natively handled) item variants. */
|
|
1250
|
-
type BoardKnownItem = BoardImageItem | BoardVideoItem | BoardFileItem | BoardTaskItem | BoardTextItem | BoardGeoItem | BoardDrawItem | BoardArrowItem | BoardFrameItem;
|
|
1468
|
+
type BoardKnownItem = BoardImageItem | BoardVideoItem | BoardAudioItem | BoardFileItem | BoardTaskItem | BoardTextItem | BoardGeoItem | BoardDrawItem | BoardArrowItem | BoardFrameItem;
|
|
1251
1469
|
/** Any item, including forward-compatible unknown types. */
|
|
1252
1470
|
type BoardItem = BoardKnownItem | BoardUnknownItem;
|
|
1253
1471
|
type BoardDocument = z.infer<typeof BoardDocumentSchema>;
|
|
@@ -1268,8 +1486,8 @@ declare function parseBoardDocument(input: unknown): BoardDocument;
|
|
|
1268
1486
|
/** Keep only the connections whose endpoints both exist in `items`. */
|
|
1269
1487
|
declare function withResolvedConnections(document: BoardDocument): BoardDocument;
|
|
1270
1488
|
declare function isUnknownItem(item: BoardItem): item is BoardUnknownItem;
|
|
1271
|
-
declare function isMediaItem(item: BoardItem): item is BoardImageItem | BoardVideoItem;
|
|
1272
|
-
/** Whether an item references a workspace file (
|
|
1273
|
-
declare function isFileBackedItem(item: BoardItem): item is BoardImageItem | BoardVideoItem | BoardFileItem;
|
|
1489
|
+
declare function isMediaItem(item: BoardItem): item is BoardImageItem | BoardVideoItem | BoardAudioItem;
|
|
1490
|
+
/** Whether an item references a workspace file (media or file card). */
|
|
1491
|
+
declare function isFileBackedItem(item: BoardItem): item is BoardImageItem | BoardVideoItem | BoardAudioItem | BoardFileItem;
|
|
1274
1492
|
//#endregion
|
|
1275
|
-
export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardPoint, BoardPointSchema,
|
|
1493
|
+
export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardAudioItem, BoardAudioItemSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardPoint, BoardPointSchema, BoardRemoteUrlSchema, BoardTaskArtifact, BoardTaskArtifactSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, DrawPoint, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, SpaceFileRef, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, normalizeBoardRemoteUrl, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BOARD_ARROW_STROKE_SIZE } from "./board-constants.js";
|
|
2
2
|
import { BoardConnectionSchema } from "./board-connection.js";
|
|
3
3
|
import { BOARD_DOCUMENT_KIND, BOARD_EXTENSION } from "./board.js";
|
|
4
|
+
import { BOARD_REMOTE_URL_MAX_LENGTH, BoardRemoteUrlSchema, normalizeBoardRemoteUrl } from "./board-url.js";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
//#region ../protocol/dist/board-document.js
|
|
6
7
|
const BoardFrameSchema = z.object({
|
|
@@ -167,6 +168,12 @@ const BoardVideoItemSchema = BoardItemBaseSchema.extend({
|
|
|
167
168
|
ref: SpaceFileRefSchema,
|
|
168
169
|
snapshot: BoardMediaSnapshotSchema.optional()
|
|
169
170
|
});
|
|
171
|
+
/** Audio node — space file only. Playback state is local UI, never synced. */
|
|
172
|
+
const BoardAudioItemSchema = BoardItemBaseSchema.extend({
|
|
173
|
+
type: z.literal("audio"),
|
|
174
|
+
ref: SpaceFileRefSchema,
|
|
175
|
+
snapshot: BoardMediaSnapshotSchema.extend({ durationMs: z.number().finite().nonnegative().optional() }).optional()
|
|
176
|
+
});
|
|
170
177
|
/**
|
|
171
178
|
* Cached display facts for a file card.
|
|
172
179
|
*
|
|
@@ -202,21 +209,41 @@ const BoardFileItemSchema = BoardItemBaseSchema.extend({
|
|
|
202
209
|
ref: SpaceFileRefSchema,
|
|
203
210
|
snapshot: BoardFileSnapshotSchema.optional()
|
|
204
211
|
});
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
const BOARD_TASK_ARTIFACT_LIMIT = 6;
|
|
213
|
+
const BoardTaskMediaArtifactFields = {
|
|
214
|
+
id: z.string().min(1).max(240),
|
|
215
|
+
title: z.string().max(240).optional(),
|
|
216
|
+
url: BoardRemoteUrlSchema,
|
|
217
|
+
mimeType: z.string().max(160).optional()
|
|
218
|
+
};
|
|
219
|
+
const BoardTaskArtifactSchema = z.discriminatedUnion("type", [
|
|
220
|
+
z.object({
|
|
221
|
+
...BoardTaskMediaArtifactFields,
|
|
222
|
+
type: z.literal("image"),
|
|
223
|
+
naturalWidth: z.number().positive().optional(),
|
|
224
|
+
naturalHeight: z.number().positive().optional()
|
|
225
|
+
}).strict(),
|
|
226
|
+
z.object({
|
|
227
|
+
...BoardTaskMediaArtifactFields,
|
|
228
|
+
type: z.literal("video"),
|
|
229
|
+
previewUrl: BoardRemoteUrlSchema.optional(),
|
|
230
|
+
durationMs: z.number().int().positive().optional(),
|
|
231
|
+
naturalWidth: z.number().positive().optional(),
|
|
232
|
+
naturalHeight: z.number().positive().optional()
|
|
233
|
+
}).strict(),
|
|
234
|
+
z.object({
|
|
235
|
+
...BoardTaskMediaArtifactFields,
|
|
236
|
+
type: z.literal("audio"),
|
|
237
|
+
previewUrl: BoardRemoteUrlSchema.optional(),
|
|
238
|
+
durationMs: z.number().int().positive().optional()
|
|
239
|
+
}).strict(),
|
|
240
|
+
z.object({
|
|
241
|
+
id: z.string().min(1).max(240),
|
|
242
|
+
type: z.literal("text"),
|
|
243
|
+
title: z.string().max(240).optional(),
|
|
244
|
+
textExcerpt: z.string().min(1).max(480)
|
|
245
|
+
}).strict()
|
|
246
|
+
]);
|
|
220
247
|
/**
|
|
221
248
|
* Cached task facts used for an immediate first paint. The task run remains the
|
|
222
249
|
* source of truth and live clients refresh this projection by `taskRunId`.
|
|
@@ -232,10 +259,10 @@ const BoardTaskSnapshotSchema = z.object({
|
|
|
232
259
|
title: z.string().min(1).max(240),
|
|
233
260
|
model: z.string().max(160).optional(),
|
|
234
261
|
promptExcerpt: z.string().max(480).optional(),
|
|
235
|
-
|
|
236
|
-
|
|
262
|
+
artifactCount: z.number().int().nonnegative(),
|
|
263
|
+
artifacts: z.array(BoardTaskArtifactSchema).max(6).default([]),
|
|
237
264
|
updatedAt: z.string().optional()
|
|
238
|
-
});
|
|
265
|
+
}).strict();
|
|
239
266
|
/** A stable reference to a task run with a small, replaceable display cache. */
|
|
240
267
|
const BoardTaskItemSchema = BoardItemBaseSchema.extend({
|
|
241
268
|
type: z.literal("task"),
|
|
@@ -251,6 +278,7 @@ const BoardTaskItemSchema = BoardItemBaseSchema.extend({
|
|
|
251
278
|
const KNOWN_BOARD_ITEM_TYPES = [
|
|
252
279
|
"image",
|
|
253
280
|
"video",
|
|
281
|
+
"audio",
|
|
254
282
|
"file",
|
|
255
283
|
"task",
|
|
256
284
|
"text",
|
|
@@ -288,6 +316,10 @@ function parseBoardItemLoose(raw) {
|
|
|
288
316
|
const parsed = BoardVideoItemSchema.safeParse(raw);
|
|
289
317
|
return parsed.success ? parsed.data : makeUnknownItem(raw);
|
|
290
318
|
}
|
|
319
|
+
case "audio": {
|
|
320
|
+
const parsed = BoardAudioItemSchema.safeParse(raw);
|
|
321
|
+
return parsed.success ? parsed.data : makeUnknownItem(raw);
|
|
322
|
+
}
|
|
291
323
|
case "file": {
|
|
292
324
|
const parsed = BoardFileItemSchema.safeParse(raw);
|
|
293
325
|
return parsed.success ? parsed.data : makeUnknownItem(raw);
|
|
@@ -396,11 +428,11 @@ function isUnknownItem(item) {
|
|
|
396
428
|
return item.type === UNKNOWN_BOARD_ITEM_TYPE;
|
|
397
429
|
}
|
|
398
430
|
function isMediaItem(item) {
|
|
399
|
-
return item.type === "image" || item.type === "video";
|
|
431
|
+
return item.type === "image" || item.type === "video" || item.type === "audio";
|
|
400
432
|
}
|
|
401
|
-
/** Whether an item references a workspace file (
|
|
433
|
+
/** Whether an item references a workspace file (media or file card). */
|
|
402
434
|
function isFileBackedItem(item) {
|
|
403
|
-
return item.type === "image" || item.type === "video" || item.type === "file";
|
|
435
|
+
return item.type === "image" || item.type === "video" || item.type === "audio" || item.type === "file";
|
|
404
436
|
}
|
|
405
437
|
//#endregion
|
|
406
|
-
export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardAppearanceSchema, BoardArrowItemSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema,
|
|
438
|
+
export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardRemoteUrlSchema, BoardTaskArtifactSchema, BoardTaskItemSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, normalizeBoardRemoteUrl, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region ../protocol/dist/board-node.d.ts
|
|
3
|
+
declare const BOARD_COLOR_IDS: readonly ["brand", "neutral", "black", "white", "blue", "green", "amber", "violet", "rose"];
|
|
4
|
+
type BoardColorId = (typeof BOARD_COLOR_IDS)[number];
|
|
5
|
+
declare const BOARD_GEO_KINDS: readonly ["rectangle", "rounded", "ellipse", "diamond", "triangle"];
|
|
6
|
+
type BoardGeoKind = (typeof BOARD_GEO_KINDS)[number];
|
|
7
|
+
type BoardNodeValidationDiagnostic = {
|
|
8
|
+
severity: "error";
|
|
9
|
+
code: "INVALID_BOARD_NODE" | "INVALID_BOARD_GEOMETRY";
|
|
10
|
+
message: string;
|
|
11
|
+
path: string;
|
|
12
|
+
expected?: string;
|
|
13
|
+
received?: unknown;
|
|
14
|
+
allowedValues?: readonly string[];
|
|
15
|
+
coordinateSpace?: "frame-local" | "world";
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { BOARD_COLOR_IDS, BOARD_GEO_KINDS, BoardColorId, BoardGeoKind, BoardNodeValidationDiagnostic };
|