@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,822 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openplanr.dev/schemas/v1.22.0/design-review-bundle.schema.json",
4
+ "x-openplanr-contract": {
5
+ "id": "design-review-bundle",
6
+ "version": "1.22.0"
7
+ },
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "kind": {
12
+ "const": "openplanr-design-review-bundle"
13
+ },
14
+ "schemaVersion": {
15
+ "enum": [
16
+ "1.1.0",
17
+ "1.2.0"
18
+ ]
19
+ },
20
+ "design": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "properties": {
24
+ "id": {
25
+ "$ref": "#/$defs/id"
26
+ },
27
+ "title": {
28
+ "$ref": "#/$defs/text"
29
+ },
30
+ "frames": {
31
+ "type": "array",
32
+ "minItems": 1,
33
+ "items": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": [
37
+ "id",
38
+ "label",
39
+ "width",
40
+ "height"
41
+ ],
42
+ "properties": {
43
+ "id": {
44
+ "$ref": "#/$defs/id"
45
+ },
46
+ "label": {
47
+ "$ref": "#/$defs/text"
48
+ },
49
+ "width": {
50
+ "type": "integer",
51
+ "minimum": 1,
52
+ "maximum": 16384
53
+ },
54
+ "height": {
55
+ "anyOf": [
56
+ {
57
+ "type": "integer",
58
+ "minimum": 1,
59
+ "maximum": 16384
60
+ },
61
+ {
62
+ "const": "auto"
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ }
68
+ },
69
+ "screens": {
70
+ "type": "array",
71
+ "minItems": 1,
72
+ "items": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": [
76
+ "id",
77
+ "title"
78
+ ],
79
+ "properties": {
80
+ "id": {
81
+ "$ref": "#/$defs/id"
82
+ },
83
+ "title": {
84
+ "$ref": "#/$defs/text"
85
+ },
86
+ "description": {
87
+ "$ref": "#/$defs/text"
88
+ },
89
+ "anchors": {
90
+ "$ref": "#/$defs/ids"
91
+ },
92
+ "props": {
93
+ "type": "object",
94
+ "propertyNames": {
95
+ "type": "string",
96
+ "minLength": 1,
97
+ "maxLength": 128,
98
+ "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])"
99
+ },
100
+ "additionalProperties": {
101
+ "oneOf": [
102
+ {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": [
106
+ "type",
107
+ "options",
108
+ "default"
109
+ ],
110
+ "properties": {
111
+ "type": {
112
+ "const": "enum"
113
+ },
114
+ "options": {
115
+ "type": "array",
116
+ "minItems": 1,
117
+ "uniqueItems": true,
118
+ "items": {
119
+ "type": "string",
120
+ "minLength": 1,
121
+ "maxLength": 128,
122
+ "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])"
123
+ }
124
+ },
125
+ "default": {
126
+ "type": "string",
127
+ "minLength": 1,
128
+ "maxLength": 128,
129
+ "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])"
130
+ }
131
+ }
132
+ },
133
+ {
134
+ "type": "object",
135
+ "additionalProperties": false,
136
+ "required": [
137
+ "type",
138
+ "default"
139
+ ],
140
+ "properties": {
141
+ "type": {
142
+ "const": "boolean"
143
+ },
144
+ "default": {
145
+ "type": "boolean"
146
+ }
147
+ }
148
+ }
149
+ ]
150
+ }
151
+ }
152
+ }
153
+ }
154
+ },
155
+ "screenOrder": {
156
+ "type": "array",
157
+ "minItems": 1,
158
+ "items": {
159
+ "$ref": "#/$defs/id"
160
+ },
161
+ "uniqueItems": true
162
+ },
163
+ "flows": {
164
+ "type": "array",
165
+ "items": {
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "required": [
169
+ "id",
170
+ "title",
171
+ "screens"
172
+ ],
173
+ "properties": {
174
+ "id": {
175
+ "$ref": "#/$defs/id"
176
+ },
177
+ "title": {
178
+ "$ref": "#/$defs/text"
179
+ },
180
+ "screens": {
181
+ "type": "array",
182
+ "minItems": 1,
183
+ "items": {
184
+ "$ref": "#/$defs/id"
185
+ }
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "variants": {
191
+ "type": "array",
192
+ "minItems": 1,
193
+ "items": {
194
+ "type": "object",
195
+ "additionalProperties": false,
196
+ "required": [
197
+ "id",
198
+ "label",
199
+ "status"
200
+ ],
201
+ "properties": {
202
+ "id": {
203
+ "$ref": "#/$defs/id"
204
+ },
205
+ "label": {
206
+ "$ref": "#/$defs/text"
207
+ },
208
+ "description": {
209
+ "$ref": "#/$defs/text"
210
+ },
211
+ "status": {
212
+ "enum": [
213
+ "ready",
214
+ "failed"
215
+ ]
216
+ },
217
+ "issue": {
218
+ "$ref": "#/$defs/text"
219
+ },
220
+ "props": {
221
+ "type": "object",
222
+ "propertyNames": {
223
+ "$ref": "#/$defs/id"
224
+ },
225
+ "additionalProperties": {
226
+ "type": "object",
227
+ "propertyNames": {
228
+ "type": "string",
229
+ "minLength": 1,
230
+ "maxLength": 128,
231
+ "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])"
232
+ },
233
+ "additionalProperties": {
234
+ "anyOf": [
235
+ {
236
+ "type": "string",
237
+ "minLength": 1,
238
+ "maxLength": 128,
239
+ "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])"
240
+ },
241
+ {
242
+ "type": "boolean"
243
+ }
244
+ ]
245
+ }
246
+ }
247
+ }
248
+ },
249
+ "if": {
250
+ "properties": {
251
+ "status": {
252
+ "const": "failed"
253
+ }
254
+ }
255
+ },
256
+ "then": {
257
+ "required": [
258
+ "issue"
259
+ ]
260
+ }
261
+ }
262
+ },
263
+ "selectedVariant": {
264
+ "$ref": "#/$defs/id"
265
+ },
266
+ "defaultView": {
267
+ "enum": [
268
+ "canvas",
269
+ "prototype",
270
+ "walkthrough"
271
+ ]
272
+ },
273
+ "layout": {
274
+ "type": "object",
275
+ "additionalProperties": false,
276
+ "properties": {
277
+ "boards": {
278
+ "type": "object",
279
+ "description": "Keys are screenId, screenId/frameId or screenId/frameId/variantId; each ID must exist in the document.",
280
+ "additionalProperties": {
281
+ "type": "object",
282
+ "additionalProperties": false,
283
+ "required": [
284
+ "x",
285
+ "y"
286
+ ],
287
+ "properties": {
288
+ "x": {
289
+ "$ref": "#/$defs/coordinate"
290
+ },
291
+ "y": {
292
+ "$ref": "#/$defs/coordinate"
293
+ },
294
+ "title": {
295
+ "$ref": "#/$defs/text"
296
+ }
297
+ }
298
+ }
299
+ },
300
+ "sections": {
301
+ "type": "array",
302
+ "items": {
303
+ "type": "object",
304
+ "additionalProperties": false,
305
+ "required": [
306
+ "id",
307
+ "x",
308
+ "y",
309
+ "text"
310
+ ],
311
+ "properties": {
312
+ "id": {
313
+ "$ref": "#/$defs/id"
314
+ },
315
+ "x": {
316
+ "$ref": "#/$defs/coordinate"
317
+ },
318
+ "y": {
319
+ "$ref": "#/$defs/coordinate"
320
+ },
321
+ "text": {
322
+ "$ref": "#/$defs/text"
323
+ },
324
+ "maxW": {
325
+ "type": "integer",
326
+ "minimum": 1,
327
+ "maximum": 16384
328
+ }
329
+ }
330
+ }
331
+ }
332
+ }
333
+ },
334
+ "schemaVersion": {
335
+ "enum": [
336
+ "1.0.0",
337
+ "1.1.0"
338
+ ]
339
+ }
340
+ },
341
+ "required": [
342
+ "id",
343
+ "title",
344
+ "frames",
345
+ "screens",
346
+ "screenOrder",
347
+ "variants",
348
+ "selectedVariant",
349
+ "defaultView"
350
+ ],
351
+ "allOf": [
352
+ {
353
+ "if": {
354
+ "properties": {
355
+ "schemaVersion": {
356
+ "const": "1.1.0"
357
+ }
358
+ },
359
+ "required": [
360
+ "schemaVersion"
361
+ ]
362
+ },
363
+ "else": {
364
+ "properties": {
365
+ "screens": {
366
+ "items": {
367
+ "not": {
368
+ "required": [
369
+ "props"
370
+ ]
371
+ }
372
+ }
373
+ },
374
+ "variants": {
375
+ "items": {
376
+ "not": {
377
+ "required": [
378
+ "props"
379
+ ]
380
+ }
381
+ }
382
+ }
383
+ }
384
+ }
385
+ }
386
+ ]
387
+ },
388
+ "envelope": {
389
+ "type": "object",
390
+ "required": [
391
+ "schemaVersion",
392
+ "artifacts",
393
+ "viewer"
394
+ ]
395
+ },
396
+ "entries": {
397
+ "type": "array",
398
+ "minItems": 1,
399
+ "maxItems": 4096,
400
+ "items": {
401
+ "type": "object",
402
+ "additionalProperties": false,
403
+ "required": [
404
+ "artifactId",
405
+ "screenId",
406
+ "variantId",
407
+ "frameId"
408
+ ],
409
+ "properties": {
410
+ "artifactId": {
411
+ "type": "string",
412
+ "minLength": 1,
413
+ "maxLength": 128
414
+ },
415
+ "screenId": {
416
+ "type": "string",
417
+ "minLength": 1,
418
+ "maxLength": 128
419
+ },
420
+ "variantId": {
421
+ "type": "string",
422
+ "minLength": 1,
423
+ "maxLength": 128
424
+ },
425
+ "frameId": {
426
+ "type": "string",
427
+ "minLength": 1,
428
+ "maxLength": 128
429
+ },
430
+ "height": {
431
+ "const": "auto"
432
+ }
433
+ }
434
+ }
435
+ },
436
+ "state": {
437
+ "type": [
438
+ "object",
439
+ "null"
440
+ ],
441
+ "additionalProperties": false,
442
+ "properties": {
443
+ "positions": {
444
+ "type": "object",
445
+ "additionalProperties": {
446
+ "type": "object",
447
+ "additionalProperties": false,
448
+ "required": [
449
+ "x",
450
+ "y"
451
+ ],
452
+ "properties": {
453
+ "x": {
454
+ "type": "number",
455
+ "minimum": -10000000,
456
+ "maximum": 10000000
457
+ },
458
+ "y": {
459
+ "type": "number",
460
+ "minimum": -10000000,
461
+ "maximum": 10000000
462
+ }
463
+ }
464
+ }
465
+ }
466
+ }
467
+ },
468
+ "revision": {
469
+ "type": "string",
470
+ "minLength": 1,
471
+ "maxLength": 128
472
+ },
473
+ "verification": {
474
+ "type": [
475
+ "object",
476
+ "null"
477
+ ],
478
+ "additionalProperties": false,
479
+ "properties": {
480
+ "status": {
481
+ "enum": [
482
+ "verified",
483
+ "unverified",
484
+ "failed",
485
+ "pending"
486
+ ]
487
+ }
488
+ }
489
+ },
490
+ "reviewContext": {
491
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
492
+ "$id": "https://openplanr.dev/schemas/v1.10.0/design-review-context.schema.json",
493
+ "x-openplanr-contract": {
494
+ "id": "design-review-context",
495
+ "version": "1.10.0"
496
+ },
497
+ "type": "object",
498
+ "additionalProperties": false,
499
+ "properties": {
500
+ "kind": {
501
+ "const": "openplanr-design-review-context"
502
+ },
503
+ "schemaVersion": {
504
+ "const": "1.0.0"
505
+ },
506
+ "designId": {
507
+ "type": "string",
508
+ "minLength": 1,
509
+ "maxLength": 128
510
+ },
511
+ "brief": {
512
+ "type": "object",
513
+ "additionalProperties": false,
514
+ "properties": {
515
+ "purpose": {
516
+ "type": "string",
517
+ "maxLength": 16384
518
+ },
519
+ "requests": {
520
+ "type": "array",
521
+ "maxItems": 3,
522
+ "items": {
523
+ "type": "string",
524
+ "maxLength": 16384
525
+ }
526
+ },
527
+ "audience": {
528
+ "type": "string",
529
+ "maxLength": 16384
530
+ }
531
+ },
532
+ "required": [
533
+ "purpose",
534
+ "requests"
535
+ ]
536
+ },
537
+ "revisionSummary": {
538
+ "type": "string",
539
+ "maxLength": 16384
540
+ },
541
+ "implementation": {
542
+ "type": "object",
543
+ "additionalProperties": false,
544
+ "properties": {
545
+ "tokens": {
546
+ "type": "array",
547
+ "maxItems": 512,
548
+ "items": {
549
+ "type": "object",
550
+ "additionalProperties": false,
551
+ "properties": {
552
+ "name": {
553
+ "type": "string",
554
+ "minLength": 1,
555
+ "maxLength": 128
556
+ },
557
+ "value": {
558
+ "type": "string",
559
+ "maxLength": 16384
560
+ },
561
+ "description": {
562
+ "type": "string",
563
+ "maxLength": 16384
564
+ }
565
+ },
566
+ "required": [
567
+ "name",
568
+ "value"
569
+ ]
570
+ }
571
+ },
572
+ "components": {
573
+ "type": "array",
574
+ "maxItems": 256,
575
+ "items": {
576
+ "type": "object",
577
+ "additionalProperties": false,
578
+ "properties": {
579
+ "id": {
580
+ "type": "string",
581
+ "minLength": 1,
582
+ "maxLength": 128
583
+ },
584
+ "name": {
585
+ "type": "string",
586
+ "maxLength": 16384
587
+ },
588
+ "screenIds": {
589
+ "type": "array",
590
+ "maxItems": 256,
591
+ "items": {
592
+ "type": "string",
593
+ "minLength": 1,
594
+ "maxLength": 128
595
+ }
596
+ },
597
+ "anchorIds": {
598
+ "type": "array",
599
+ "maxItems": 256,
600
+ "items": {
601
+ "type": "string",
602
+ "minLength": 1,
603
+ "maxLength": 128
604
+ }
605
+ },
606
+ "states": {
607
+ "type": "array",
608
+ "maxItems": 256,
609
+ "items": {
610
+ "type": "object",
611
+ "additionalProperties": false,
612
+ "properties": {
613
+ "name": {
614
+ "type": "string",
615
+ "minLength": 1,
616
+ "maxLength": 128
617
+ },
618
+ "description": {
619
+ "type": "string",
620
+ "maxLength": 16384
621
+ }
622
+ },
623
+ "required": [
624
+ "name",
625
+ "description"
626
+ ]
627
+ }
628
+ },
629
+ "notes": {
630
+ "type": "string",
631
+ "maxLength": 16384
632
+ },
633
+ "responsive": {
634
+ "type": "string",
635
+ "maxLength": 16384
636
+ },
637
+ "accessibility": {
638
+ "type": "string",
639
+ "maxLength": 16384
640
+ }
641
+ },
642
+ "required": [
643
+ "id",
644
+ "name"
645
+ ]
646
+ }
647
+ },
648
+ "responsive": {
649
+ "type": "array",
650
+ "maxItems": 256,
651
+ "items": {
652
+ "type": "string",
653
+ "maxLength": 16384
654
+ }
655
+ },
656
+ "accessibility": {
657
+ "type": "array",
658
+ "maxItems": 256,
659
+ "items": {
660
+ "type": "string",
661
+ "maxLength": 16384
662
+ }
663
+ }
664
+ },
665
+ "required": [
666
+ "tokens",
667
+ "components",
668
+ "responsive",
669
+ "accessibility"
670
+ ]
671
+ }
672
+ },
673
+ "required": [
674
+ "kind",
675
+ "schemaVersion",
676
+ "designId",
677
+ "brief",
678
+ "implementation"
679
+ ]
680
+ },
681
+ "contextDigest": {
682
+ "type": "string",
683
+ "pattern": "^[a-f0-9]{64}$"
684
+ },
685
+ "fingerprints": {
686
+ "type": "array",
687
+ "maxItems": 4096,
688
+ "items": {
689
+ "type": "object",
690
+ "additionalProperties": false,
691
+ "properties": {
692
+ "screenId": {
693
+ "type": "string",
694
+ "minLength": 1,
695
+ "maxLength": 128
696
+ },
697
+ "variantId": {
698
+ "type": "string",
699
+ "minLength": 1,
700
+ "maxLength": 128
701
+ },
702
+ "frameId": {
703
+ "type": "string",
704
+ "minLength": 1,
705
+ "maxLength": 128
706
+ },
707
+ "contentDigest": {
708
+ "type": "string",
709
+ "pattern": "^[a-f0-9]{64}$"
710
+ },
711
+ "guidanceDigest": {
712
+ "type": "string",
713
+ "pattern": "^[a-f0-9]{64}$"
714
+ }
715
+ },
716
+ "required": [
717
+ "screenId",
718
+ "variantId",
719
+ "frameId",
720
+ "contentDigest",
721
+ "guidanceDigest"
722
+ ]
723
+ }
724
+ }
725
+ },
726
+ "required": [
727
+ "kind",
728
+ "schemaVersion",
729
+ "design",
730
+ "envelope",
731
+ "entries",
732
+ "revision",
733
+ "reviewContext",
734
+ "contextDigest",
735
+ "fingerprints"
736
+ ],
737
+ "$defs": {
738
+ "id": {
739
+ "type": "string",
740
+ "minLength": 1,
741
+ "maxLength": 128,
742
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
743
+ },
744
+ "text": {
745
+ "type": "string",
746
+ "minLength": 1,
747
+ "pattern": "\\S"
748
+ },
749
+ "ids": {
750
+ "type": "array",
751
+ "items": {
752
+ "$ref": "#/$defs/id"
753
+ },
754
+ "uniqueItems": true
755
+ },
756
+ "localPath": {
757
+ "type": "string",
758
+ "minLength": 1,
759
+ "description": "Path relative to the authored document directory. No URL, traversal, encoded path, query or fragment.",
760
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)(?!.*[/ ]$)[^\\\\:\\u0000-\\u001F%?#]+$"
761
+ },
762
+ "paths": {
763
+ "type": "array",
764
+ "items": {
765
+ "$ref": "#/$defs/localPath"
766
+ },
767
+ "uniqueItems": true
768
+ },
769
+ "source": {
770
+ "type": "object",
771
+ "additionalProperties": false,
772
+ "required": [
773
+ "html"
774
+ ],
775
+ "properties": {
776
+ "html": {
777
+ "$ref": "#/$defs/localPath"
778
+ },
779
+ "styles": {
780
+ "$ref": "#/$defs/paths"
781
+ },
782
+ "scripts": {
783
+ "$ref": "#/$defs/paths"
784
+ }
785
+ }
786
+ },
787
+ "coordinate": {
788
+ "type": "number",
789
+ "minimum": -10000000,
790
+ "maximum": 10000000
791
+ }
792
+ },
793
+ "allOf": [
794
+ {
795
+ "if": {
796
+ "properties": {
797
+ "schemaVersion": {
798
+ "const": "1.2.0"
799
+ }
800
+ }
801
+ },
802
+ "then": {
803
+ "properties": {
804
+ "envelope": {
805
+ "type": "object",
806
+ "required": [
807
+ "schemaVersion",
808
+ "sources",
809
+ "artifacts",
810
+ "viewer"
811
+ ],
812
+ "properties": {
813
+ "schemaVersion": {
814
+ "const": "1.1.0"
815
+ }
816
+ }
817
+ }
818
+ }
819
+ }
820
+ }
821
+ ]
822
+ }