@openplanr/protocol 0.13.0 → 0.15.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.
Files changed (34) hide show
  1. package/README.md +23 -0
  2. package/package.json +6 -2
  3. package/registries/commands.json +12 -12
  4. package/registries/roles.json +43 -133
  5. package/registries/skills.json +14 -14
  6. package/registries/task-kinds.json +2 -2
  7. package/schemas/v1.20.0/design-document.schema.json +379 -0
  8. package/schemas/v1.20.0/design-review-bundle.schema.json +692 -0
  9. package/schemas/v1.21.0/diagram-authoring-bundle.schema.json +1609 -0
  10. package/schemas/v1.21.0/diagram-edit-transaction.schema.json +4369 -0
  11. package/schemas/v1.21.0/diagram-review-bundle.schema.json +4047 -0
  12. package/schemas/v1.21.0/diagram-shape-definition.schema.json +457 -0
  13. package/schemas/v1.22.0/design-document.schema.json +506 -0
  14. package/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
  15. package/schemas/v1.5.0/role-registry.schema.json +4 -1
  16. package/src/browser-contracts.d.mts +5 -1
  17. package/src/browser-contracts.mjs +27 -0
  18. package/src/contracts.mjs +39 -6
  19. package/src/design-contracts.d.mts +40 -2
  20. package/src/design-contracts.mjs +258 -17
  21. package/src/design-publication-contracts.mjs +3 -1
  22. package/src/diagram-authoring-contracts.d.mts +2 -0
  23. package/src/generated/canonical-registries.mjs +71 -161
  24. package/src/index.d.mts +7 -0
  25. package/src/index.mjs +7 -0
  26. package/src/json-schema.mjs +4 -0
  27. package/src/registries.mjs +20 -4
  28. package/src/review-experience-contracts.d.mts +2 -0
  29. package/src/review-experience-contracts.mjs +77 -5
  30. package/src/shape-library-contracts.d.mts +57 -0
  31. package/src/shape-library-contracts.mjs +266 -0
  32. package/src/studio-presentation-contracts.d.mts +50 -2
  33. package/src/studio-presentation-contracts.mjs +285 -4
  34. package/src/workspace-contracts.mjs +3 -3
@@ -0,0 +1,1609 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openplanr.dev/schemas/v1.21.0/diagram-authoring-bundle.schema.json",
4
+ "x-openplanr-contract": {
5
+ "id": "diagram-authoring-bundle",
6
+ "version": "1.21.0"
7
+ },
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "kind": {
12
+ "const": "diagram-authoring-bundle"
13
+ },
14
+ "schemaVersion": {
15
+ "const": "1.2.0"
16
+ },
17
+ "protocolVersion": {
18
+ "const": "1.21.0"
19
+ },
20
+ "diagramId": {
21
+ "type": "string",
22
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
23
+ "minLength": 1,
24
+ "maxLength": 128
25
+ },
26
+ "document": {
27
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
28
+ "$id": "https://openplanr.dev/schemas/v1.13.0/diagram-document.schema.json",
29
+ "x-openplanr-contract": {
30
+ "id": "diagram-document",
31
+ "version": "1.13.0"
32
+ },
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "kind": {
37
+ "const": "planr-diagram"
38
+ },
39
+ "schemaVersion": {
40
+ "const": "1.0.0"
41
+ },
42
+ "protocolVersion": {
43
+ "const": "1.13.0"
44
+ },
45
+ "diagramId": {
46
+ "type": "string",
47
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
48
+ "minLength": 1,
49
+ "maxLength": 128
50
+ },
51
+ "title": {
52
+ "type": "string",
53
+ "minLength": 0,
54
+ "maxLength": 4096
55
+ },
56
+ "summary": {
57
+ "type": "string",
58
+ "minLength": 0,
59
+ "maxLength": 4096
60
+ },
61
+ "audience": {
62
+ "enum": [
63
+ "engineer",
64
+ "executive",
65
+ "mixed"
66
+ ]
67
+ },
68
+ "grammar": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "properties": {
72
+ "id": {
73
+ "enum": [
74
+ "flowchart",
75
+ "process",
76
+ "swimlane",
77
+ "architecture"
78
+ ]
79
+ },
80
+ "version": {
81
+ "const": "1.0.0"
82
+ }
83
+ },
84
+ "required": [
85
+ "id",
86
+ "version"
87
+ ]
88
+ },
89
+ "nodes": {
90
+ "type": "array",
91
+ "items": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "properties": {
95
+ "id": {
96
+ "type": "string",
97
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
98
+ "minLength": 1,
99
+ "maxLength": 128
100
+ },
101
+ "label": {
102
+ "type": "string",
103
+ "minLength": 0,
104
+ "maxLength": 4096
105
+ },
106
+ "kind": {
107
+ "enum": [
108
+ "process",
109
+ "start",
110
+ "end",
111
+ "decision",
112
+ "data-store",
113
+ "component"
114
+ ]
115
+ },
116
+ "description": {
117
+ "anyOf": [
118
+ {
119
+ "type": "null"
120
+ },
121
+ {
122
+ "type": "string",
123
+ "minLength": 0,
124
+ "maxLength": 4096
125
+ }
126
+ ]
127
+ }
128
+ },
129
+ "required": [
130
+ "id",
131
+ "label",
132
+ "kind",
133
+ "description"
134
+ ]
135
+ },
136
+ "minItems": 0,
137
+ "maxItems": 4096
138
+ },
139
+ "relations": {
140
+ "type": "array",
141
+ "items": {
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "properties": {
145
+ "id": {
146
+ "type": "string",
147
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
148
+ "minLength": 1,
149
+ "maxLength": 128
150
+ },
151
+ "from": {
152
+ "type": "string",
153
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
154
+ "minLength": 1,
155
+ "maxLength": 128
156
+ },
157
+ "to": {
158
+ "type": "string",
159
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
160
+ "minLength": 1,
161
+ "maxLength": 128
162
+ },
163
+ "kind": {
164
+ "enum": [
165
+ "association",
166
+ "dependency",
167
+ "flow",
168
+ "message",
169
+ "transition"
170
+ ]
171
+ },
172
+ "direction": {
173
+ "enum": [
174
+ "forward",
175
+ "both",
176
+ "none"
177
+ ]
178
+ },
179
+ "label": {
180
+ "anyOf": [
181
+ {
182
+ "type": "null"
183
+ },
184
+ {
185
+ "type": "string",
186
+ "minLength": 0,
187
+ "maxLength": 4096
188
+ }
189
+ ]
190
+ },
191
+ "weight": {
192
+ "anyOf": [
193
+ {
194
+ "type": "null"
195
+ },
196
+ {
197
+ "type": "number",
198
+ "minimum": 0,
199
+ "maximum": 1000000
200
+ }
201
+ ]
202
+ }
203
+ },
204
+ "required": [
205
+ "id",
206
+ "from",
207
+ "to",
208
+ "kind",
209
+ "direction",
210
+ "label",
211
+ "weight"
212
+ ]
213
+ },
214
+ "minItems": 0,
215
+ "maxItems": 8192
216
+ },
217
+ "groups": {
218
+ "type": "array",
219
+ "items": {
220
+ "type": "object",
221
+ "additionalProperties": false,
222
+ "properties": {
223
+ "id": {
224
+ "type": "string",
225
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
226
+ "minLength": 1,
227
+ "maxLength": 128
228
+ },
229
+ "label": {
230
+ "type": "string",
231
+ "minLength": 0,
232
+ "maxLength": 4096
233
+ },
234
+ "members": {
235
+ "type": "array",
236
+ "items": {
237
+ "type": "string",
238
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
239
+ "minLength": 1,
240
+ "maxLength": 128
241
+ },
242
+ "minItems": 0,
243
+ "maxItems": 10000,
244
+ "uniqueItems": true
245
+ }
246
+ },
247
+ "required": [
248
+ "id",
249
+ "label",
250
+ "members"
251
+ ]
252
+ },
253
+ "minItems": 0,
254
+ "maxItems": 1024
255
+ },
256
+ "lanes": {
257
+ "type": "array",
258
+ "items": {
259
+ "type": "object",
260
+ "additionalProperties": false,
261
+ "properties": {
262
+ "id": {
263
+ "type": "string",
264
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
265
+ "minLength": 1,
266
+ "maxLength": 128
267
+ },
268
+ "label": {
269
+ "type": "string",
270
+ "minLength": 0,
271
+ "maxLength": 4096
272
+ },
273
+ "members": {
274
+ "type": "array",
275
+ "items": {
276
+ "type": "string",
277
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
278
+ "minLength": 1,
279
+ "maxLength": 128
280
+ },
281
+ "minItems": 0,
282
+ "maxItems": 10000,
283
+ "uniqueItems": true
284
+ }
285
+ },
286
+ "required": [
287
+ "id",
288
+ "label",
289
+ "members"
290
+ ]
291
+ },
292
+ "minItems": 0,
293
+ "maxItems": 256
294
+ },
295
+ "events": {
296
+ "type": "array",
297
+ "items": false,
298
+ "minItems": 0,
299
+ "maxItems": 0
300
+ },
301
+ "series": {
302
+ "type": "array",
303
+ "items": false,
304
+ "minItems": 0,
305
+ "maxItems": 0
306
+ },
307
+ "axes": {
308
+ "type": "array",
309
+ "items": false,
310
+ "minItems": 0,
311
+ "maxItems": 0
312
+ },
313
+ "sets": {
314
+ "type": "array",
315
+ "items": false,
316
+ "minItems": 0,
317
+ "maxItems": 0
318
+ },
319
+ "annotations": {
320
+ "type": "array",
321
+ "items": {
322
+ "type": "object",
323
+ "additionalProperties": false,
324
+ "properties": {
325
+ "id": {
326
+ "type": "string",
327
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
328
+ "minLength": 1,
329
+ "maxLength": 128
330
+ },
331
+ "text": {
332
+ "type": "string",
333
+ "minLength": 0,
334
+ "maxLength": 4096
335
+ },
336
+ "targetId": {
337
+ "anyOf": [
338
+ {
339
+ "type": "null"
340
+ },
341
+ {
342
+ "type": "string",
343
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
344
+ "minLength": 1,
345
+ "maxLength": 128
346
+ }
347
+ ]
348
+ }
349
+ },
350
+ "required": [
351
+ "id",
352
+ "text",
353
+ "targetId"
354
+ ]
355
+ },
356
+ "minItems": 0,
357
+ "maxItems": 1024
358
+ },
359
+ "emphasis": {
360
+ "type": "array",
361
+ "items": {
362
+ "type": "object",
363
+ "additionalProperties": false,
364
+ "properties": {
365
+ "targetId": {
366
+ "type": "string",
367
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
368
+ "minLength": 1,
369
+ "maxLength": 128
370
+ },
371
+ "level": {
372
+ "enum": [
373
+ "primary",
374
+ "secondary",
375
+ "muted"
376
+ ]
377
+ }
378
+ },
379
+ "required": [
380
+ "targetId",
381
+ "level"
382
+ ]
383
+ },
384
+ "minItems": 0,
385
+ "maxItems": 1024
386
+ },
387
+ "laneOrder": {
388
+ "type": "array",
389
+ "items": {
390
+ "type": "string",
391
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
392
+ "minLength": 1,
393
+ "maxLength": 128
394
+ },
395
+ "minItems": 0,
396
+ "maxItems": 10000,
397
+ "uniqueItems": true
398
+ },
399
+ "accessibility": {
400
+ "type": "object",
401
+ "additionalProperties": false,
402
+ "properties": {
403
+ "title": {
404
+ "type": "string",
405
+ "minLength": 0,
406
+ "maxLength": 4096
407
+ },
408
+ "description": {
409
+ "type": "string",
410
+ "minLength": 0,
411
+ "maxLength": 4096
412
+ },
413
+ "readingOrder": {
414
+ "type": "array",
415
+ "items": {
416
+ "type": "string",
417
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
418
+ "minLength": 1,
419
+ "maxLength": 128
420
+ },
421
+ "minItems": 0,
422
+ "maxItems": 10000,
423
+ "uniqueItems": true
424
+ }
425
+ },
426
+ "required": [
427
+ "title",
428
+ "description",
429
+ "readingOrder"
430
+ ]
431
+ },
432
+ "documentDigest": {
433
+ "type": "string",
434
+ "pattern": "^sha256:[a-f0-9]{64}$"
435
+ }
436
+ },
437
+ "required": [
438
+ "kind",
439
+ "schemaVersion",
440
+ "protocolVersion",
441
+ "diagramId",
442
+ "title",
443
+ "summary",
444
+ "audience",
445
+ "grammar",
446
+ "nodes",
447
+ "relations",
448
+ "groups",
449
+ "lanes",
450
+ "events",
451
+ "series",
452
+ "axes",
453
+ "sets",
454
+ "annotations",
455
+ "emphasis",
456
+ "laneOrder",
457
+ "accessibility",
458
+ "documentDigest"
459
+ ]
460
+ },
461
+ "presentation": {
462
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
463
+ "$id": "https://openplanr.dev/schemas/v1.13.0/diagram-presentation.schema.json",
464
+ "x-openplanr-contract": {
465
+ "id": "diagram-presentation",
466
+ "version": "1.13.0"
467
+ },
468
+ "type": "object",
469
+ "additionalProperties": false,
470
+ "properties": {
471
+ "kind": {
472
+ "const": "diagram-presentation"
473
+ },
474
+ "schemaVersion": {
475
+ "const": "1.0.0"
476
+ },
477
+ "protocolVersion": {
478
+ "const": "1.13.0"
479
+ },
480
+ "diagramId": {
481
+ "type": "string",
482
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
483
+ "minLength": 1,
484
+ "maxLength": 128
485
+ },
486
+ "semanticDigest": {
487
+ "type": "string",
488
+ "pattern": "^sha256:[a-f0-9]{64}$"
489
+ },
490
+ "coordinateSystem": {
491
+ "const": "global-canvas"
492
+ },
493
+ "layout": {
494
+ "type": "object",
495
+ "additionalProperties": false,
496
+ "properties": {
497
+ "direction": {
498
+ "enum": [
499
+ "top-down",
500
+ "left-right",
501
+ "right-left",
502
+ "bottom-up"
503
+ ]
504
+ },
505
+ "detailTier": {
506
+ "enum": [
507
+ "simplified",
508
+ "balanced",
509
+ "faithful"
510
+ ]
511
+ }
512
+ },
513
+ "required": [
514
+ "direction",
515
+ "detailTier"
516
+ ]
517
+ },
518
+ "theme": {
519
+ "type": "object",
520
+ "additionalProperties": false,
521
+ "properties": {
522
+ "themeId": {
523
+ "enum": [
524
+ "paper",
525
+ "slate",
526
+ "midnight"
527
+ ]
528
+ },
529
+ "mode": {
530
+ "enum": [
531
+ "light",
532
+ "dark",
533
+ "auto"
534
+ ]
535
+ }
536
+ },
537
+ "required": [
538
+ "themeId",
539
+ "mode"
540
+ ]
541
+ },
542
+ "elements": {
543
+ "type": "array",
544
+ "items": {
545
+ "type": "object",
546
+ "additionalProperties": false,
547
+ "properties": {
548
+ "elementId": {
549
+ "type": "string",
550
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
551
+ "minLength": 1,
552
+ "maxLength": 128
553
+ },
554
+ "bounds": {
555
+ "anyOf": [
556
+ {
557
+ "type": "null"
558
+ },
559
+ {
560
+ "type": "object",
561
+ "additionalProperties": false,
562
+ "properties": {
563
+ "x": {
564
+ "type": "number",
565
+ "minimum": -1000000,
566
+ "maximum": 1000000
567
+ },
568
+ "y": {
569
+ "type": "number",
570
+ "minimum": -1000000,
571
+ "maximum": 1000000
572
+ },
573
+ "width": {
574
+ "type": "number",
575
+ "minimum": 0.01,
576
+ "maximum": 1000000
577
+ },
578
+ "height": {
579
+ "type": "number",
580
+ "minimum": 0.01,
581
+ "maximum": 1000000
582
+ }
583
+ },
584
+ "required": [
585
+ "x",
586
+ "y",
587
+ "width",
588
+ "height"
589
+ ]
590
+ }
591
+ ]
592
+ },
593
+ "route": {
594
+ "anyOf": [
595
+ {
596
+ "type": "null"
597
+ },
598
+ {
599
+ "type": "object",
600
+ "additionalProperties": false,
601
+ "properties": {
602
+ "mode": {
603
+ "enum": [
604
+ "automatic",
605
+ "manual"
606
+ ]
607
+ },
608
+ "strategy": {
609
+ "enum": [
610
+ "straight",
611
+ "orthogonal"
612
+ ]
613
+ },
614
+ "from": {
615
+ "type": "object",
616
+ "additionalProperties": false,
617
+ "properties": {
618
+ "side": {
619
+ "enum": [
620
+ "top",
621
+ "right",
622
+ "bottom",
623
+ "left"
624
+ ]
625
+ },
626
+ "offset": {
627
+ "type": "number",
628
+ "minimum": 0,
629
+ "maximum": 1
630
+ }
631
+ },
632
+ "required": [
633
+ "side",
634
+ "offset"
635
+ ]
636
+ },
637
+ "to": {
638
+ "type": "object",
639
+ "additionalProperties": false,
640
+ "properties": {
641
+ "side": {
642
+ "enum": [
643
+ "top",
644
+ "right",
645
+ "bottom",
646
+ "left"
647
+ ]
648
+ },
649
+ "offset": {
650
+ "type": "number",
651
+ "minimum": 0,
652
+ "maximum": 1
653
+ }
654
+ },
655
+ "required": [
656
+ "side",
657
+ "offset"
658
+ ]
659
+ },
660
+ "points": {
661
+ "type": "array",
662
+ "items": {
663
+ "type": "object",
664
+ "additionalProperties": false,
665
+ "properties": {
666
+ "x": {
667
+ "type": "number",
668
+ "minimum": -1000000,
669
+ "maximum": 1000000
670
+ },
671
+ "y": {
672
+ "type": "number",
673
+ "minimum": -1000000,
674
+ "maximum": 1000000
675
+ }
676
+ },
677
+ "required": [
678
+ "x",
679
+ "y"
680
+ ]
681
+ },
682
+ "minItems": 0,
683
+ "maxItems": 256
684
+ }
685
+ },
686
+ "required": [
687
+ "mode",
688
+ "strategy",
689
+ "from",
690
+ "to",
691
+ "points"
692
+ ]
693
+ }
694
+ ]
695
+ },
696
+ "label": {
697
+ "anyOf": [
698
+ {
699
+ "type": "null"
700
+ },
701
+ {
702
+ "type": "object",
703
+ "additionalProperties": false,
704
+ "properties": {
705
+ "x": {
706
+ "type": "number",
707
+ "minimum": -1000000,
708
+ "maximum": 1000000
709
+ },
710
+ "y": {
711
+ "type": "number",
712
+ "minimum": -1000000,
713
+ "maximum": 1000000
714
+ },
715
+ "width": {
716
+ "type": "number",
717
+ "minimum": 0.01,
718
+ "maximum": 1000000
719
+ }
720
+ },
721
+ "required": [
722
+ "x",
723
+ "y",
724
+ "width"
725
+ ]
726
+ }
727
+ ]
728
+ },
729
+ "zIndex": {
730
+ "type": "integer",
731
+ "minimum": 0,
732
+ "maximum": 10000
733
+ },
734
+ "appearance": {
735
+ "type": "object",
736
+ "additionalProperties": false,
737
+ "properties": {
738
+ "shape": {
739
+ "enum": [
740
+ "rectangle",
741
+ "rounded-rectangle",
742
+ "ellipse",
743
+ "diamond",
744
+ "cylinder",
745
+ "text",
746
+ "container",
747
+ "connector"
748
+ ]
749
+ },
750
+ "fill": {
751
+ "enum": [
752
+ "surface",
753
+ "accent",
754
+ "success",
755
+ "warning",
756
+ "danger",
757
+ "transparent"
758
+ ]
759
+ },
760
+ "stroke": {
761
+ "enum": [
762
+ "default",
763
+ "accent",
764
+ "muted",
765
+ "danger",
766
+ "none"
767
+ ]
768
+ },
769
+ "strokeWidth": {
770
+ "type": "number",
771
+ "minimum": 0,
772
+ "maximum": 16
773
+ },
774
+ "strokeStyle": {
775
+ "enum": [
776
+ "solid",
777
+ "dashed",
778
+ "dotted"
779
+ ]
780
+ },
781
+ "fontSize": {
782
+ "type": "integer",
783
+ "minimum": 8,
784
+ "maximum": 72
785
+ },
786
+ "textAlign": {
787
+ "enum": [
788
+ "left",
789
+ "center",
790
+ "right"
791
+ ]
792
+ },
793
+ "shapeRef": {
794
+ "type": "object",
795
+ "additionalProperties": false,
796
+ "required": [
797
+ "packId",
798
+ "packVersion",
799
+ "shapeId",
800
+ "definitionDigest"
801
+ ],
802
+ "properties": {
803
+ "packId": {
804
+ "type": "string",
805
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
806
+ "maxLength": 128
807
+ },
808
+ "packVersion": {
809
+ "type": "string",
810
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
811
+ "maxLength": 32
812
+ },
813
+ "shapeId": {
814
+ "type": "string",
815
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
816
+ "maxLength": 128
817
+ },
818
+ "definitionDigest": {
819
+ "type": "string",
820
+ "pattern": "^sha256:[a-f0-9]{64}$"
821
+ }
822
+ }
823
+ }
824
+ },
825
+ "required": [
826
+ "shape",
827
+ "fill",
828
+ "stroke",
829
+ "strokeWidth",
830
+ "strokeStyle",
831
+ "fontSize",
832
+ "textAlign"
833
+ ]
834
+ },
835
+ "locks": {
836
+ "type": "object",
837
+ "additionalProperties": false,
838
+ "properties": {
839
+ "position": {
840
+ "type": "boolean"
841
+ },
842
+ "size": {
843
+ "type": "boolean"
844
+ },
845
+ "route": {
846
+ "type": "boolean"
847
+ }
848
+ },
849
+ "required": [
850
+ "position",
851
+ "size",
852
+ "route"
853
+ ]
854
+ }
855
+ },
856
+ "required": [
857
+ "elementId",
858
+ "bounds",
859
+ "route",
860
+ "label",
861
+ "zIndex",
862
+ "appearance",
863
+ "locks"
864
+ ]
865
+ },
866
+ "minItems": 0,
867
+ "maxItems": 10000
868
+ },
869
+ "presentationDigest": {
870
+ "type": "string",
871
+ "pattern": "^sha256:[a-f0-9]{64}$"
872
+ }
873
+ },
874
+ "required": [
875
+ "kind",
876
+ "schemaVersion",
877
+ "protocolVersion",
878
+ "diagramId",
879
+ "semanticDigest",
880
+ "coordinateSystem",
881
+ "layout",
882
+ "theme",
883
+ "elements",
884
+ "presentationDigest"
885
+ ]
886
+ },
887
+ "originalSource": {
888
+ "anyOf": [
889
+ {
890
+ "type": "null"
891
+ },
892
+ {
893
+ "type": "object",
894
+ "additionalProperties": false,
895
+ "properties": {
896
+ "format": {
897
+ "const": "mermaid"
898
+ },
899
+ "text": {
900
+ "type": "string",
901
+ "minLength": 0,
902
+ "maxLength": 1048576
903
+ },
904
+ "sourceDigest": {
905
+ "type": "string",
906
+ "pattern": "^sha256:[a-f0-9]{64}$"
907
+ }
908
+ },
909
+ "required": [
910
+ "format",
911
+ "text",
912
+ "sourceDigest"
913
+ ]
914
+ }
915
+ ]
916
+ },
917
+ "sourceMap": {
918
+ "anyOf": [
919
+ {
920
+ "type": "null"
921
+ },
922
+ {
923
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
924
+ "$id": "https://openplanr.dev/schemas/v1.13.0/diagram-source-map.schema.json",
925
+ "x-openplanr-contract": {
926
+ "id": "diagram-source-map",
927
+ "version": "1.13.0"
928
+ },
929
+ "type": "object",
930
+ "additionalProperties": false,
931
+ "properties": {
932
+ "kind": {
933
+ "const": "diagram-source-map"
934
+ },
935
+ "schemaVersion": {
936
+ "const": "1.0.0"
937
+ },
938
+ "protocolVersion": {
939
+ "const": "1.13.0"
940
+ },
941
+ "diagramId": {
942
+ "type": "string",
943
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
944
+ "minLength": 1,
945
+ "maxLength": 128
946
+ },
947
+ "semanticDigest": {
948
+ "type": "string",
949
+ "pattern": "^sha256:[a-f0-9]{64}$"
950
+ },
951
+ "sourceDigest": {
952
+ "type": "string",
953
+ "pattern": "^sha256:[a-f0-9]{64}$"
954
+ },
955
+ "sourceByteLength": {
956
+ "type": "integer",
957
+ "minimum": 0,
958
+ "maximum": 1048576
959
+ },
960
+ "encoding": {
961
+ "const": "utf-8"
962
+ },
963
+ "parser": {
964
+ "type": "object",
965
+ "additionalProperties": false,
966
+ "properties": {
967
+ "id": {
968
+ "type": "string",
969
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
970
+ "maxLength": 64
971
+ },
972
+ "version": {
973
+ "type": "string",
974
+ "minLength": 1,
975
+ "maxLength": 64
976
+ }
977
+ },
978
+ "required": [
979
+ "id",
980
+ "version"
981
+ ]
982
+ },
983
+ "certificationVersion": {
984
+ "const": "flowchart-copy-v1"
985
+ },
986
+ "entries": {
987
+ "type": "array",
988
+ "items": {
989
+ "type": "object",
990
+ "additionalProperties": false,
991
+ "properties": {
992
+ "sourceId": {
993
+ "anyOf": [
994
+ {
995
+ "type": "null"
996
+ },
997
+ {
998
+ "type": "string",
999
+ "minLength": 1,
1000
+ "maxLength": 128
1001
+ }
1002
+ ]
1003
+ },
1004
+ "elementIds": {
1005
+ "type": "array",
1006
+ "items": {
1007
+ "type": "string",
1008
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
1009
+ "minLength": 1,
1010
+ "maxLength": 128
1011
+ },
1012
+ "minItems": 0,
1013
+ "maxItems": 10000,
1014
+ "uniqueItems": true
1015
+ },
1016
+ "range": {
1017
+ "anyOf": [
1018
+ {
1019
+ "type": "null"
1020
+ },
1021
+ {
1022
+ "type": "object",
1023
+ "additionalProperties": false,
1024
+ "properties": {
1025
+ "startByte": {
1026
+ "type": "integer",
1027
+ "minimum": 0,
1028
+ "maximum": 1048576
1029
+ },
1030
+ "endByte": {
1031
+ "type": "integer",
1032
+ "minimum": 0,
1033
+ "maximum": 1048576
1034
+ }
1035
+ },
1036
+ "required": [
1037
+ "startByte",
1038
+ "endByte"
1039
+ ]
1040
+ }
1041
+ ]
1042
+ },
1043
+ "construct": {
1044
+ "type": "string",
1045
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
1046
+ "maxLength": 64
1047
+ },
1048
+ "confidence": {
1049
+ "enum": [
1050
+ "exact",
1051
+ "ambiguous"
1052
+ ]
1053
+ },
1054
+ "losses": {
1055
+ "type": "array",
1056
+ "items": {
1057
+ "type": "string",
1058
+ "minLength": 1,
1059
+ "maxLength": 512
1060
+ },
1061
+ "minItems": 0,
1062
+ "maxItems": 64
1063
+ }
1064
+ },
1065
+ "required": [
1066
+ "sourceId",
1067
+ "elementIds",
1068
+ "range",
1069
+ "construct",
1070
+ "confidence",
1071
+ "losses"
1072
+ ]
1073
+ },
1074
+ "minItems": 0,
1075
+ "maxItems": 10000
1076
+ }
1077
+ },
1078
+ "required": [
1079
+ "kind",
1080
+ "schemaVersion",
1081
+ "protocolVersion",
1082
+ "diagramId",
1083
+ "semanticDigest",
1084
+ "sourceDigest",
1085
+ "sourceByteLength",
1086
+ "encoding",
1087
+ "parser",
1088
+ "certificationVersion",
1089
+ "entries"
1090
+ ]
1091
+ }
1092
+ ]
1093
+ },
1094
+ "bundleDigest": {
1095
+ "type": "string",
1096
+ "pattern": "^sha256:[a-f0-9]{64}$"
1097
+ },
1098
+ "studioPresentation": {
1099
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1100
+ "$id": "https://openplanr.dev/schemas/v1.17.0/diagram-presentation.schema.json",
1101
+ "x-openplanr-contract": {
1102
+ "id": "diagram-presentation",
1103
+ "version": "1.17.0"
1104
+ },
1105
+ "type": "object",
1106
+ "additionalProperties": false,
1107
+ "required": [
1108
+ "kind",
1109
+ "schemaVersion",
1110
+ "palette",
1111
+ "theme",
1112
+ "fontFamily"
1113
+ ],
1114
+ "properties": {
1115
+ "kind": {
1116
+ "const": "openplanr-diagram-presentation"
1117
+ },
1118
+ "schemaVersion": {
1119
+ "const": "2.0.0"
1120
+ },
1121
+ "palette": {
1122
+ "const": "openplanr-brand-v2"
1123
+ },
1124
+ "theme": {
1125
+ "enum": [
1126
+ "light",
1127
+ "dark"
1128
+ ]
1129
+ },
1130
+ "fontFamily": {
1131
+ "const": "Inter"
1132
+ }
1133
+ }
1134
+ },
1135
+ "shapeLibrary": {
1136
+ "type": "array",
1137
+ "maxItems": 512,
1138
+ "items": {
1139
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1140
+ "$id": "https://openplanr.dev/schemas/v1.21.0/diagram-shape-definition.schema.json",
1141
+ "x-openplanr-contract": {
1142
+ "id": "diagram-shape-definition",
1143
+ "version": "1.21.0"
1144
+ },
1145
+ "type": "object",
1146
+ "additionalProperties": false,
1147
+ "required": [
1148
+ "packId",
1149
+ "packVersion",
1150
+ "shapeId",
1151
+ "definitionDigest",
1152
+ "name",
1153
+ "description",
1154
+ "tags",
1155
+ "primitives",
1156
+ "attachment",
1157
+ "textRegion",
1158
+ "sizing"
1159
+ ],
1160
+ "properties": {
1161
+ "packId": {
1162
+ "type": "string",
1163
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
1164
+ "maxLength": 128
1165
+ },
1166
+ "packVersion": {
1167
+ "type": "string",
1168
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
1169
+ "maxLength": 32
1170
+ },
1171
+ "shapeId": {
1172
+ "type": "string",
1173
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
1174
+ "maxLength": 128
1175
+ },
1176
+ "definitionDigest": {
1177
+ "type": "string",
1178
+ "pattern": "^sha256:[a-f0-9]{64}$"
1179
+ },
1180
+ "name": {
1181
+ "type": "string",
1182
+ "minLength": 1,
1183
+ "maxLength": 128
1184
+ },
1185
+ "description": {
1186
+ "type": "string",
1187
+ "maxLength": 1024
1188
+ },
1189
+ "tags": {
1190
+ "type": "array",
1191
+ "maxItems": 16,
1192
+ "uniqueItems": true,
1193
+ "items": {
1194
+ "type": "string",
1195
+ "minLength": 1,
1196
+ "maxLength": 64
1197
+ }
1198
+ },
1199
+ "primitives": {
1200
+ "type": "array",
1201
+ "minItems": 1,
1202
+ "maxItems": 32,
1203
+ "items": {
1204
+ "oneOf": [
1205
+ {
1206
+ "type": "object",
1207
+ "additionalProperties": false,
1208
+ "required": [
1209
+ "type",
1210
+ "x",
1211
+ "y",
1212
+ "width",
1213
+ "height",
1214
+ "radius",
1215
+ "fill",
1216
+ "stroke"
1217
+ ],
1218
+ "properties": {
1219
+ "type": {
1220
+ "const": "rect"
1221
+ },
1222
+ "x": {
1223
+ "type": "number",
1224
+ "minimum": 0,
1225
+ "maximum": 1
1226
+ },
1227
+ "y": {
1228
+ "type": "number",
1229
+ "minimum": 0,
1230
+ "maximum": 1
1231
+ },
1232
+ "width": {
1233
+ "type": "number",
1234
+ "exclusiveMinimum": 0,
1235
+ "maximum": 1
1236
+ },
1237
+ "height": {
1238
+ "type": "number",
1239
+ "exclusiveMinimum": 0,
1240
+ "maximum": 1
1241
+ },
1242
+ "radius": {
1243
+ "type": "number",
1244
+ "minimum": 0,
1245
+ "maximum": 1
1246
+ },
1247
+ "fill": {
1248
+ "enum": [
1249
+ "fill",
1250
+ "none"
1251
+ ]
1252
+ },
1253
+ "stroke": {
1254
+ "enum": [
1255
+ "stroke",
1256
+ "none"
1257
+ ]
1258
+ }
1259
+ }
1260
+ },
1261
+ {
1262
+ "type": "object",
1263
+ "additionalProperties": false,
1264
+ "required": [
1265
+ "type",
1266
+ "cx",
1267
+ "cy",
1268
+ "rx",
1269
+ "ry",
1270
+ "fill",
1271
+ "stroke"
1272
+ ],
1273
+ "properties": {
1274
+ "type": {
1275
+ "const": "ellipse"
1276
+ },
1277
+ "cx": {
1278
+ "type": "number",
1279
+ "minimum": 0,
1280
+ "maximum": 1
1281
+ },
1282
+ "cy": {
1283
+ "type": "number",
1284
+ "minimum": 0,
1285
+ "maximum": 1
1286
+ },
1287
+ "rx": {
1288
+ "type": "number",
1289
+ "exclusiveMinimum": 0,
1290
+ "maximum": 1
1291
+ },
1292
+ "ry": {
1293
+ "type": "number",
1294
+ "exclusiveMinimum": 0,
1295
+ "maximum": 1
1296
+ },
1297
+ "fill": {
1298
+ "enum": [
1299
+ "fill",
1300
+ "none"
1301
+ ]
1302
+ },
1303
+ "stroke": {
1304
+ "enum": [
1305
+ "stroke",
1306
+ "none"
1307
+ ]
1308
+ }
1309
+ }
1310
+ },
1311
+ {
1312
+ "type": "object",
1313
+ "additionalProperties": false,
1314
+ "required": [
1315
+ "type",
1316
+ "points",
1317
+ "fill",
1318
+ "stroke"
1319
+ ],
1320
+ "properties": {
1321
+ "type": {
1322
+ "const": "polygon"
1323
+ },
1324
+ "points": {
1325
+ "type": "array",
1326
+ "minItems": 3,
1327
+ "maxItems": 32,
1328
+ "items": {
1329
+ "type": "object",
1330
+ "additionalProperties": false,
1331
+ "required": [
1332
+ "x",
1333
+ "y"
1334
+ ],
1335
+ "properties": {
1336
+ "x": {
1337
+ "type": "number",
1338
+ "minimum": 0,
1339
+ "maximum": 1
1340
+ },
1341
+ "y": {
1342
+ "type": "number",
1343
+ "minimum": 0,
1344
+ "maximum": 1
1345
+ }
1346
+ }
1347
+ }
1348
+ },
1349
+ "fill": {
1350
+ "enum": [
1351
+ "fill",
1352
+ "none"
1353
+ ]
1354
+ },
1355
+ "stroke": {
1356
+ "enum": [
1357
+ "stroke",
1358
+ "none"
1359
+ ]
1360
+ }
1361
+ }
1362
+ },
1363
+ {
1364
+ "type": "object",
1365
+ "additionalProperties": false,
1366
+ "required": [
1367
+ "type",
1368
+ "x1",
1369
+ "y1",
1370
+ "x2",
1371
+ "y2",
1372
+ "stroke"
1373
+ ],
1374
+ "properties": {
1375
+ "type": {
1376
+ "const": "line"
1377
+ },
1378
+ "x1": {
1379
+ "type": "number",
1380
+ "minimum": 0,
1381
+ "maximum": 1
1382
+ },
1383
+ "y1": {
1384
+ "type": "number",
1385
+ "minimum": 0,
1386
+ "maximum": 1
1387
+ },
1388
+ "x2": {
1389
+ "type": "number",
1390
+ "minimum": 0,
1391
+ "maximum": 1
1392
+ },
1393
+ "y2": {
1394
+ "type": "number",
1395
+ "minimum": 0,
1396
+ "maximum": 1
1397
+ },
1398
+ "stroke": {
1399
+ "enum": [
1400
+ "stroke",
1401
+ "none"
1402
+ ]
1403
+ }
1404
+ }
1405
+ }
1406
+ ]
1407
+ }
1408
+ },
1409
+ "attachment": {
1410
+ "oneOf": [
1411
+ {
1412
+ "type": "object",
1413
+ "additionalProperties": false,
1414
+ "required": [
1415
+ "type",
1416
+ "x",
1417
+ "y",
1418
+ "width",
1419
+ "height",
1420
+ "radius"
1421
+ ],
1422
+ "properties": {
1423
+ "type": {
1424
+ "const": "rect"
1425
+ },
1426
+ "x": {
1427
+ "type": "number",
1428
+ "minimum": 0,
1429
+ "maximum": 1
1430
+ },
1431
+ "y": {
1432
+ "type": "number",
1433
+ "minimum": 0,
1434
+ "maximum": 1
1435
+ },
1436
+ "width": {
1437
+ "type": "number",
1438
+ "exclusiveMinimum": 0,
1439
+ "maximum": 1
1440
+ },
1441
+ "height": {
1442
+ "type": "number",
1443
+ "exclusiveMinimum": 0,
1444
+ "maximum": 1
1445
+ },
1446
+ "radius": {
1447
+ "type": "number",
1448
+ "minimum": 0,
1449
+ "maximum": 1
1450
+ }
1451
+ }
1452
+ },
1453
+ {
1454
+ "type": "object",
1455
+ "additionalProperties": false,
1456
+ "required": [
1457
+ "type",
1458
+ "cx",
1459
+ "cy",
1460
+ "rx",
1461
+ "ry"
1462
+ ],
1463
+ "properties": {
1464
+ "type": {
1465
+ "const": "ellipse"
1466
+ },
1467
+ "cx": {
1468
+ "type": "number",
1469
+ "minimum": 0,
1470
+ "maximum": 1
1471
+ },
1472
+ "cy": {
1473
+ "type": "number",
1474
+ "minimum": 0,
1475
+ "maximum": 1
1476
+ },
1477
+ "rx": {
1478
+ "type": "number",
1479
+ "exclusiveMinimum": 0,
1480
+ "maximum": 1
1481
+ },
1482
+ "ry": {
1483
+ "type": "number",
1484
+ "exclusiveMinimum": 0,
1485
+ "maximum": 1
1486
+ }
1487
+ }
1488
+ },
1489
+ {
1490
+ "type": "object",
1491
+ "additionalProperties": false,
1492
+ "required": [
1493
+ "type",
1494
+ "points"
1495
+ ],
1496
+ "properties": {
1497
+ "type": {
1498
+ "const": "polygon"
1499
+ },
1500
+ "points": {
1501
+ "type": "array",
1502
+ "minItems": 3,
1503
+ "maxItems": 32,
1504
+ "items": {
1505
+ "type": "object",
1506
+ "additionalProperties": false,
1507
+ "required": [
1508
+ "x",
1509
+ "y"
1510
+ ],
1511
+ "properties": {
1512
+ "x": {
1513
+ "type": "number",
1514
+ "minimum": 0,
1515
+ "maximum": 1
1516
+ },
1517
+ "y": {
1518
+ "type": "number",
1519
+ "minimum": 0,
1520
+ "maximum": 1
1521
+ }
1522
+ }
1523
+ }
1524
+ }
1525
+ }
1526
+ }
1527
+ ]
1528
+ },
1529
+ "textRegion": {
1530
+ "type": "object",
1531
+ "additionalProperties": false,
1532
+ "required": [
1533
+ "x",
1534
+ "y",
1535
+ "width",
1536
+ "height"
1537
+ ],
1538
+ "properties": {
1539
+ "x": {
1540
+ "type": "number",
1541
+ "minimum": 0,
1542
+ "maximum": 1
1543
+ },
1544
+ "y": {
1545
+ "type": "number",
1546
+ "minimum": 0,
1547
+ "maximum": 1
1548
+ },
1549
+ "width": {
1550
+ "type": "number",
1551
+ "exclusiveMinimum": 0,
1552
+ "maximum": 1
1553
+ },
1554
+ "height": {
1555
+ "type": "number",
1556
+ "exclusiveMinimum": 0,
1557
+ "maximum": 1
1558
+ }
1559
+ }
1560
+ },
1561
+ "sizing": {
1562
+ "type": "object",
1563
+ "additionalProperties": false,
1564
+ "required": [
1565
+ "width",
1566
+ "height",
1567
+ "minWidth",
1568
+ "minHeight"
1569
+ ],
1570
+ "properties": {
1571
+ "width": {
1572
+ "type": "number",
1573
+ "minimum": 1,
1574
+ "maximum": 10000
1575
+ },
1576
+ "height": {
1577
+ "type": "number",
1578
+ "minimum": 1,
1579
+ "maximum": 10000
1580
+ },
1581
+ "minWidth": {
1582
+ "type": "number",
1583
+ "minimum": 1,
1584
+ "maximum": 10000
1585
+ },
1586
+ "minHeight": {
1587
+ "type": "number",
1588
+ "minimum": 1,
1589
+ "maximum": 10000
1590
+ }
1591
+ }
1592
+ }
1593
+ }
1594
+ }
1595
+ }
1596
+ },
1597
+ "required": [
1598
+ "kind",
1599
+ "schemaVersion",
1600
+ "protocolVersion",
1601
+ "diagramId",
1602
+ "document",
1603
+ "presentation",
1604
+ "originalSource",
1605
+ "sourceMap",
1606
+ "bundleDigest",
1607
+ "shapeLibrary"
1608
+ ]
1609
+ }