@neta-art/cohub 5.7.0 → 5.8.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.
Files changed (64) hide show
  1. package/README.md +18 -5
  2. package/dist/board/core/palette.d.ts +3 -2
  3. package/dist/board/core/shape-types.d.ts +3 -1
  4. package/dist/board/core/shape-types.js +3 -7
  5. package/dist/board/core/tool-styles.d.ts +2 -1
  6. package/dist/board/image-key.js +3 -5
  7. package/dist/board/index.d.ts +9 -4
  8. package/dist/board/index.js +7 -3
  9. package/dist/board/media-playback.d.ts +22 -0
  10. package/dist/board/media-playback.js +67 -0
  11. package/dist/board/media.d.ts +7 -0
  12. package/dist/board/media.js +70 -0
  13. package/dist/board/nodes.d.ts +113 -0
  14. package/dist/board/nodes.js +154 -0
  15. package/dist/board/render/index.d.ts +3 -1
  16. package/dist/board/render/index.js +4 -2
  17. package/dist/board/render/media-interaction.d.ts +19 -0
  18. package/dist/board/render/media-interaction.js +26 -0
  19. package/dist/board/render/renderers/audio-card-renderer.js +1 -1
  20. package/dist/board/render/renderers/board-renderer-registry.js +2 -2
  21. package/dist/board/render/renderers/draw-card-renderer.js +1 -1
  22. package/dist/board/render/renderers/file-card-renderer.js +1 -1
  23. package/dist/board/render/renderers/frame-card-renderer.js +1 -1
  24. package/dist/board/render/renderers/geo-card-renderer.js +1 -1
  25. package/dist/board/render/renderers/image-card-renderer.js +1 -1
  26. package/dist/board/render/renderers/task-card-renderer.js +16 -13
  27. package/dist/board/render/renderers/text-card-renderer.js +1 -1
  28. package/dist/board/render/renderers/unknown-card-renderer.js +1 -1
  29. package/dist/board/render/renderers/video-card-renderer.js +1 -1
  30. package/dist/board/render/video-thumbnail.d.ts +16 -0
  31. package/dist/board/render/video-thumbnail.js +86 -0
  32. package/dist/board/task.d.ts +10 -5
  33. package/dist/board/task.js +159 -103
  34. package/dist/chunks/environment.d.ts +6 -6
  35. package/dist/chunks/environment.js +6 -6
  36. package/dist/chunks/http.d.ts +152 -5
  37. package/dist/chunks/http.js +1707 -169
  38. package/dist/chunks/transport.js +24 -4
  39. package/dist/chunks/websocket.d.ts +144 -2
  40. package/dist/chunks/websocket.js +1 -1
  41. package/dist/http.d.ts +3 -3
  42. package/dist/index.d.ts +273 -4
  43. package/dist/index.js +275 -741
  44. package/dist/protocol/dist/board-connection.d.ts +7 -0
  45. package/dist/protocol/dist/board-connection.js +4 -0
  46. package/dist/protocol/dist/board-content.d.ts +1 -0
  47. package/dist/protocol/dist/board-content.js +26 -0
  48. package/dist/protocol/dist/board-document.d.ts +157 -48
  49. package/dist/protocol/dist/board-document.js +40 -19
  50. package/dist/protocol/dist/board-node.d.ts +18 -0
  51. package/dist/protocol/dist/board-node.js +239 -0
  52. package/dist/protocol/dist/board-url.d.ts +12 -0
  53. package/dist/protocol/dist/board-url.js +83 -0
  54. package/dist/protocol/dist/board.d.ts +5 -0
  55. package/dist/protocol/dist/identifiers.js +10 -0
  56. package/dist/protocol/dist/index.d.ts +3 -1
  57. package/dist/protocol/dist/index.js +7 -1
  58. package/dist/protocol/dist/provenance.js +2 -0
  59. package/dist/protocol/dist/ui-command.js +2 -0
  60. package/dist/protocol/dist/work-promotion-stats.js +11 -0
  61. package/dist/protocol/dist/work-surface.js +2 -0
  62. package/dist/protocol/dist/work-view-stats.js +1 -0
  63. package/docs/work-runtime-guide.md +7 -7
  64. package/package.json +1 -1
@@ -36,6 +36,7 @@ type BoardConnectionAnchor = z.infer<typeof BoardConnectionAnchorSchema>;
36
36
  declare const AUTO_BOARD_CONNECTION_ANCHOR: BoardConnectionAnchor;
37
37
  declare const BoardConnectionEndpointSchema: z.ZodObject<{
38
38
  nodeId: z.ZodString;
39
+ portId: z.ZodOptional<z.ZodString>;
39
40
  anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
40
41
  kind: z.ZodLiteral<"auto">;
41
42
  }, z.core.$strip>, z.ZodObject<{
@@ -125,6 +126,7 @@ declare const BoardConnectionSchema: z.ZodObject<{
125
126
  id: z.ZodString;
126
127
  source: z.ZodObject<{
127
128
  nodeId: z.ZodString;
129
+ portId: z.ZodOptional<z.ZodString>;
128
130
  anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
129
131
  kind: z.ZodLiteral<"auto">;
130
132
  }, z.core.$strip>, z.ZodObject<{
@@ -144,6 +146,7 @@ declare const BoardConnectionSchema: z.ZodObject<{
144
146
  }, z.core.$strip>;
145
147
  target: z.ZodObject<{
146
148
  nodeId: z.ZodString;
149
+ portId: z.ZodOptional<z.ZodString>;
147
150
  anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
148
151
  kind: z.ZodLiteral<"auto">;
149
152
  }, z.core.$strip>, z.ZodObject<{
@@ -210,6 +213,7 @@ type BoardConnectionInput = BoardConnection;
210
213
  declare const BoardConnectionPatchSchema: z.ZodObject<{
211
214
  source: z.ZodOptional<z.ZodObject<{
212
215
  nodeId: z.ZodString;
216
+ portId: z.ZodOptional<z.ZodString>;
213
217
  anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
214
218
  kind: z.ZodLiteral<"auto">;
215
219
  }, z.core.$strip>, z.ZodObject<{
@@ -229,6 +233,7 @@ declare const BoardConnectionPatchSchema: z.ZodObject<{
229
233
  }, z.core.$strip>>;
230
234
  target: z.ZodOptional<z.ZodObject<{
231
235
  nodeId: z.ZodString;
236
+ portId: z.ZodOptional<z.ZodString>;
232
237
  anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
233
238
  kind: z.ZodLiteral<"auto">;
234
239
  }, z.core.$strip>, z.ZodObject<{
@@ -298,6 +303,8 @@ declare function createBoardConnection(input: {
298
303
  relation?: string;
299
304
  direction?: BoardConnectionDirection;
300
305
  label?: string;
306
+ sourcePortId?: string;
307
+ targetPortId?: string;
301
308
  sourceAnchor?: BoardConnectionAnchor;
302
309
  targetAnchor?: BoardConnectionAnchor;
303
310
  routing?: Partial<BoardConnectionRoutingConfig>;
@@ -55,6 +55,8 @@ const BoardConnectionAnchorSchema = z.union([
55
55
  const AUTO_BOARD_CONNECTION_ANCHOR = { kind: "auto" };
56
56
  const BoardConnectionEndpointSchema = z.object({
57
57
  nodeId: z.string().min(1).max(160),
58
+ /** Optional semantic port. Older connections omit it and remain valid. */
59
+ portId: z.string().min(1).max(120).optional(),
58
60
  anchor: BoardConnectionAnchorSchema.default(AUTO_BOARD_CONNECTION_ANCHOR)
59
61
  });
60
62
  /**
@@ -179,10 +181,12 @@ function createBoardConnection(input) {
179
181
  id: input.id,
180
182
  source: {
181
183
  nodeId: input.sourceNodeId,
184
+ ...input.sourcePortId ? { portId: input.sourcePortId } : {},
182
185
  anchor: input.sourceAnchor ?? AUTO_BOARD_CONNECTION_ANCHOR
183
186
  },
184
187
  target: {
185
188
  nodeId: input.targetNodeId,
189
+ ...input.targetPortId ? { portId: input.targetPortId } : {},
186
190
  anchor: input.targetAnchor ?? AUTO_BOARD_CONNECTION_ANCHOR
187
191
  },
188
192
  relation: input.relation ?? "related",
@@ -0,0 +1 @@
1
+ import { z } from "zod";
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ //#region ../protocol/dist/board-content.js
3
+ const BOARD_CONTENT_KINDS = [
4
+ "text",
5
+ "image",
6
+ "video",
7
+ "audio",
8
+ "file",
9
+ "json",
10
+ "collection"
11
+ ];
12
+ const BoardContentKindSchema = z.enum(BOARD_CONTENT_KINDS);
13
+ const BoardPortSchema = z.object({
14
+ id: z.string().min(1).max(120),
15
+ kind: BoardContentKindSchema,
16
+ role: z.string().min(1).max(80).optional(),
17
+ required: z.boolean().optional(),
18
+ multiple: z.boolean().optional(),
19
+ maxItems: z.number().int().positive().optional()
20
+ }).strict();
21
+ z.object({
22
+ inputs: z.array(BoardPortSchema),
23
+ outputs: z.array(BoardPortSchema)
24
+ }).strict();
25
+ //#endregion
26
+ export { BOARD_CONTENT_KINDS, BoardContentKindSchema, BoardPortSchema };
@@ -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<{
@@ -484,19 +485,39 @@ declare const BoardFileItemSchema: z.ZodObject<{
484
485
  coverUrl: z.ZodOptional<z.ZodString>;
485
486
  }, z.core.$strip>>;
486
487
  }, z.core.$strip>;
487
- declare const BoardTaskOutputSchema: z.ZodObject<{
488
- type: z.ZodEnum<{
489
- audio: "audio";
490
- image: "image";
491
- text: "text";
492
- video: "video";
493
- }>;
494
- url: z.ZodOptional<z.ZodString>;
495
- 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;
496
493
  mimeType: z.ZodOptional<z.ZodString>;
494
+ type: z.ZodLiteral<"image">;
497
495
  naturalWidth: z.ZodOptional<z.ZodNumber>;
498
496
  naturalHeight: z.ZodOptional<z.ZodNumber>;
499
- }, z.core.$strip>;
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">;
500
521
  /**
501
522
  * Cached task facts used for an immediate first paint. The task run remains the
502
523
  * source of truth and live clients refresh this projection by `taskRunId`.
@@ -512,22 +533,41 @@ declare const BoardTaskSnapshotSchema: z.ZodObject<{
512
533
  title: z.ZodString;
513
534
  model: z.ZodOptional<z.ZodString>;
514
535
  promptExcerpt: z.ZodOptional<z.ZodString>;
515
- outputCount: z.ZodDefault<z.ZodNumber>;
516
- primaryOutput: z.ZodOptional<z.ZodObject<{
517
- type: z.ZodEnum<{
518
- audio: "audio";
519
- image: "image";
520
- text: "text";
521
- video: "video";
522
- }>;
523
- url: z.ZodOptional<z.ZodString>;
524
- 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;
525
541
  mimeType: z.ZodOptional<z.ZodString>;
542
+ type: z.ZodLiteral<"image">;
526
543
  naturalWidth: z.ZodOptional<z.ZodNumber>;
527
544
  naturalHeight: z.ZodOptional<z.ZodNumber>;
528
- }, z.core.$strip>>;
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">>>;
529
569
  updatedAt: z.ZodOptional<z.ZodString>;
530
- }, z.core.$strip>;
570
+ }, z.core.$strict>;
531
571
  /** A stable reference to a task run with a small, replaceable display cache. */
532
572
  declare const BoardTaskItemSchema: z.ZodObject<{
533
573
  id: z.ZodString;
@@ -570,22 +610,41 @@ declare const BoardTaskItemSchema: z.ZodObject<{
570
610
  title: z.ZodString;
571
611
  model: z.ZodOptional<z.ZodString>;
572
612
  promptExcerpt: z.ZodOptional<z.ZodString>;
573
- outputCount: z.ZodDefault<z.ZodNumber>;
574
- primaryOutput: z.ZodOptional<z.ZodObject<{
575
- type: z.ZodEnum<{
576
- audio: "audio";
577
- image: "image";
578
- text: "text";
579
- video: "video";
580
- }>;
581
- url: z.ZodOptional<z.ZodString>;
582
- 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;
583
618
  mimeType: z.ZodOptional<z.ZodString>;
619
+ type: z.ZodLiteral<"image">;
584
620
  naturalWidth: z.ZodOptional<z.ZodNumber>;
585
621
  naturalHeight: z.ZodOptional<z.ZodNumber>;
586
- }, z.core.$strip>>;
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">>>;
587
646
  updatedAt: z.ZodOptional<z.ZodString>;
588
- }, z.core.$strip>;
647
+ }, z.core.$strict>;
589
648
  }, z.core.$strip>;
590
649
  /**
591
650
  * The set of shape types this client understands natively. Anything else is
@@ -777,15 +836,39 @@ declare const BoardItemSchema: z.ZodPipe<z.ZodAny, z.ZodTransform<BoardUnknownIt
777
836
  title: string;
778
837
  model?: string | undefined;
779
838
  promptExcerpt?: string | undefined;
780
- outputCount: number;
781
- primaryOutput?: {
782
- type: "audio" | "image" | "text" | "video";
783
- url?: string | undefined;
784
- textExcerpt?: string | undefined;
839
+ artifactCount: number;
840
+ artifacts: ({
841
+ id: string;
842
+ title?: string | undefined;
843
+ url: string;
785
844
  mimeType?: string | undefined;
845
+ type: "image";
786
846
  naturalWidth?: number | undefined;
787
847
  naturalHeight?: number | undefined;
788
- } | undefined;
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
+ })[];
789
872
  updatedAt?: string | undefined;
790
873
  };
791
874
  } | {
@@ -1123,15 +1206,39 @@ declare const BoardDocumentSchema: z.ZodObject<{
1123
1206
  title: string;
1124
1207
  model?: string | undefined;
1125
1208
  promptExcerpt?: string | undefined;
1126
- outputCount: number;
1127
- primaryOutput?: {
1128
- type: "audio" | "image" | "text" | "video";
1129
- url?: string | undefined;
1130
- textExcerpt?: string | undefined;
1209
+ artifactCount: number;
1210
+ artifacts: ({
1211
+ id: string;
1212
+ title?: string | undefined;
1213
+ url: string;
1131
1214
  mimeType?: string | undefined;
1215
+ type: "image";
1132
1216
  naturalWidth?: number | undefined;
1133
1217
  naturalHeight?: number | undefined;
1134
- } | undefined;
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
+ })[];
1135
1242
  updatedAt?: string | undefined;
1136
1243
  };
1137
1244
  } | {
@@ -1269,6 +1376,7 @@ declare const BoardDocumentSchema: z.ZodObject<{
1269
1376
  id: z.ZodString;
1270
1377
  source: z.ZodObject<{
1271
1378
  nodeId: z.ZodString;
1379
+ portId: z.ZodOptional<z.ZodString>;
1272
1380
  anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
1273
1381
  kind: z.ZodLiteral<"auto">;
1274
1382
  }, z.core.$strip>, z.ZodObject<{
@@ -1288,6 +1396,7 @@ declare const BoardDocumentSchema: z.ZodObject<{
1288
1396
  }, z.core.$strip>;
1289
1397
  target: z.ZodObject<{
1290
1398
  nodeId: z.ZodString;
1399
+ portId: z.ZodOptional<z.ZodString>;
1291
1400
  anchor: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
1292
1401
  kind: z.ZodLiteral<"auto">;
1293
1402
  }, z.core.$strip>, z.ZodObject<{
@@ -1354,7 +1463,7 @@ type BoardVideoItem = z.infer<typeof BoardVideoItemSchema>;
1354
1463
  type BoardAudioItem = z.infer<typeof BoardAudioItemSchema>;
1355
1464
  type BoardFileSnapshot = z.infer<typeof BoardFileSnapshotSchema>;
1356
1465
  type BoardFileItem = z.infer<typeof BoardFileItemSchema>;
1357
- type BoardTaskOutput = z.infer<typeof BoardTaskOutputSchema>;
1466
+ type BoardTaskArtifact = z.infer<typeof BoardTaskArtifactSchema>;
1358
1467
  type BoardTaskSnapshot = z.infer<typeof BoardTaskSnapshotSchema>;
1359
1468
  type BoardTaskItem = z.infer<typeof BoardTaskItemSchema>;
1360
1469
  /** Known (natively handled) item variants. */
@@ -1383,4 +1492,4 @@ declare function isMediaItem(item: BoardItem): item is BoardImageItem | BoardVid
1383
1492
  /** Whether an item references a workspace file (media or file card). */
1384
1493
  declare function isFileBackedItem(item: BoardItem): item is BoardImageItem | BoardVideoItem | BoardAudioItem | BoardFileItem;
1385
1494
  //#endregion
1386
- export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, 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, BoardTaskItem, BoardTaskItemSchema, BoardTaskOutput, BoardTaskOutputSchema, 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, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections };
1495
+ 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({
@@ -208,21 +209,41 @@ const BoardFileItemSchema = BoardItemBaseSchema.extend({
208
209
  ref: SpaceFileRefSchema,
209
210
  snapshot: BoardFileSnapshotSchema.optional()
210
211
  });
211
- const BoardTaskOutputSchema = z.object({
212
- type: z.enum([
213
- "image",
214
- "video",
215
- "audio",
216
- "text"
217
- ]),
218
- /** Remote preview only. Inline data is intentionally never persisted. */
219
- url: z.string().url().optional(),
220
- textExcerpt: z.string().max(480).optional(),
221
- mimeType: z.string().max(160).optional(),
222
- /** Intrinsic media size, cached so the node can match the preview aspect. */
223
- naturalWidth: z.number().positive().optional(),
224
- naturalHeight: z.number().positive().optional()
225
- });
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
+ ]);
226
247
  /**
227
248
  * Cached task facts used for an immediate first paint. The task run remains the
228
249
  * source of truth and live clients refresh this projection by `taskRunId`.
@@ -238,10 +259,10 @@ const BoardTaskSnapshotSchema = z.object({
238
259
  title: z.string().min(1).max(240),
239
260
  model: z.string().max(160).optional(),
240
261
  promptExcerpt: z.string().max(480).optional(),
241
- outputCount: z.number().int().nonnegative().default(0),
242
- primaryOutput: BoardTaskOutputSchema.optional(),
262
+ artifactCount: z.number().int().nonnegative(),
263
+ artifacts: z.array(BoardTaskArtifactSchema).max(6).default([]),
243
264
  updatedAt: z.string().optional()
244
- });
265
+ }).strict();
245
266
  /** A stable reference to a task run with a small, replaceable display cache. */
246
267
  const BoardTaskItemSchema = BoardItemBaseSchema.extend({
247
268
  type: z.literal("task"),
@@ -414,4 +435,4 @@ function isFileBackedItem(item) {
414
435
  return item.type === "image" || item.type === "video" || item.type === "audio" || item.type === "file";
415
436
  }
416
437
  //#endregion
417
- export { BOARD_DOCUMENT_KIND, BOARD_EXTENSION, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardTaskItemSchema, BoardTaskOutputSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, DrawPointSchema, KNOWN_BOARD_ITEM_TYPES, SpaceFileRefSchema, UNKNOWN_BOARD_ITEM_TYPE, isFileBackedItem, isMediaItem, isUnknownItem, parseBoardDocument, parseBoardItemLoose, unknownRealType, withResolvedConnections };
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 };