@hollis-labs/surface-genui 0.0.0-stage → 0.1.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.
@@ -0,0 +1,917 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/hollis-labs/substrate/genui/catalog/1",
4
+ "protocolVersion": "1.0",
5
+ "catalogId": "urn:hollis-labs:genui:catalog:1",
6
+ "title": "GenUI reviewed patterns",
7
+ "components": {
8
+ "GenuiApproval": {
9
+ "type": "object",
10
+ "properties": {
11
+ "component": {
12
+ "const": "GenuiApproval"
13
+ },
14
+ "props": {
15
+ "$ref": "#/$defs/ApprovalProps"
16
+ }
17
+ },
18
+ "required": [
19
+ "component",
20
+ "props"
21
+ ],
22
+ "allowedParents": [
23
+ "Surface"
24
+ ],
25
+ "allowedChildren": []
26
+ },
27
+ "GenuiForm": {
28
+ "type": "object",
29
+ "properties": {
30
+ "component": {
31
+ "const": "GenuiForm"
32
+ },
33
+ "props": {
34
+ "$ref": "#/$defs/FormProps"
35
+ }
36
+ },
37
+ "required": [
38
+ "component",
39
+ "props"
40
+ ],
41
+ "allowedParents": [
42
+ "Surface"
43
+ ],
44
+ "allowedChildren": []
45
+ },
46
+ "GenuiListDetail": {
47
+ "type": "object",
48
+ "properties": {
49
+ "component": {
50
+ "const": "GenuiListDetail"
51
+ },
52
+ "props": {
53
+ "$ref": "#/$defs/ListDetailProps"
54
+ }
55
+ },
56
+ "required": [
57
+ "component",
58
+ "props"
59
+ ],
60
+ "allowedParents": [
61
+ "Surface"
62
+ ],
63
+ "allowedChildren": []
64
+ }
65
+ },
66
+ "functions": {
67
+ "genui_action": {
68
+ "type": "object",
69
+ "returnType": "object",
70
+ "allowedCallers": "rendererOnly",
71
+ "requiresUserActivation": true,
72
+ "properties": {
73
+ "@call": {
74
+ "const": "genui_action"
75
+ },
76
+ "args": {
77
+ "$ref": "#/$defs/CallArgs"
78
+ }
79
+ },
80
+ "required": [
81
+ "@call",
82
+ "args"
83
+ ]
84
+ }
85
+ },
86
+ "$defs": {
87
+ "Subject": {
88
+ "type": "object",
89
+ "properties": {
90
+ "kind": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "maxLength": 128
94
+ },
95
+ "id": {
96
+ "type": "string",
97
+ "minLength": 1,
98
+ "maxLength": 256
99
+ }
100
+ },
101
+ "required": [
102
+ "kind",
103
+ "id"
104
+ ],
105
+ "additionalProperties": false
106
+ },
107
+ "Basis": {
108
+ "type": "object",
109
+ "properties": {
110
+ "revision": {
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "maxLength": 128
114
+ },
115
+ "projectionRevision": {
116
+ "type": "string",
117
+ "minLength": 1,
118
+ "maxLength": 128
119
+ }
120
+ },
121
+ "required": [
122
+ "revision"
123
+ ],
124
+ "additionalProperties": false
125
+ },
126
+ "Action": {
127
+ "type": "object",
128
+ "properties": {
129
+ "id": {
130
+ "type": "string",
131
+ "minLength": 8,
132
+ "maxLength": 256
133
+ },
134
+ "subject": {
135
+ "$ref": "#/$defs/Subject"
136
+ },
137
+ "risk": {
138
+ "enum": [
139
+ "low",
140
+ "medium",
141
+ "high"
142
+ ]
143
+ },
144
+ "basis": {
145
+ "$ref": "#/$defs/Basis"
146
+ },
147
+ "confirmation": {
148
+ "type": "string",
149
+ "minLength": 1,
150
+ "maxLength": 8192
151
+ }
152
+ },
153
+ "required": [
154
+ "id",
155
+ "subject",
156
+ "basis"
157
+ ],
158
+ "additionalProperties": false
159
+ },
160
+ "JSONValue": {
161
+ "oneOf": [
162
+ {
163
+ "type": "null"
164
+ },
165
+ {
166
+ "type": "boolean"
167
+ },
168
+ {
169
+ "type": "integer",
170
+ "minimum": -9007199254740991,
171
+ "maximum": 9007199254740991
172
+ },
173
+ {
174
+ "type": "string",
175
+ "maxLength": 16384
176
+ },
177
+ {
178
+ "type": "array",
179
+ "items": {
180
+ "$ref": "#/$defs/JSONValue"
181
+ },
182
+ "minItems": 0,
183
+ "maxItems": 256
184
+ },
185
+ {
186
+ "type": "object",
187
+ "maxProperties": 256,
188
+ "propertyNames": {
189
+ "maxLength": 256
190
+ },
191
+ "additionalProperties": {
192
+ "$ref": "#/$defs/JSONValue"
193
+ }
194
+ }
195
+ ]
196
+ },
197
+ "Input": {
198
+ "type": "object",
199
+ "maxProperties": 256,
200
+ "propertyNames": {
201
+ "maxLength": 256
202
+ },
203
+ "additionalProperties": {
204
+ "$ref": "#/$defs/JSONValue"
205
+ }
206
+ },
207
+ "CallArgs": {
208
+ "type": "object",
209
+ "properties": {
210
+ "genui_action": {
211
+ "$ref": "#/$defs/Action"
212
+ },
213
+ "input": {
214
+ "$ref": "#/$defs/Input"
215
+ }
216
+ },
217
+ "required": [
218
+ "genui_action",
219
+ "input"
220
+ ],
221
+ "additionalProperties": false
222
+ },
223
+ "FunctionCall": {
224
+ "type": "object",
225
+ "properties": {
226
+ "@call": {
227
+ "const": "genui_action"
228
+ },
229
+ "catalogId": {
230
+ "const": "urn:hollis-labs:genui:catalog:1"
231
+ },
232
+ "args": {
233
+ "$ref": "#/$defs/CallArgs"
234
+ }
235
+ },
236
+ "required": [
237
+ "@call",
238
+ "args"
239
+ ],
240
+ "additionalProperties": false
241
+ },
242
+ "Call": {
243
+ "type": "object",
244
+ "properties": {
245
+ "version": {
246
+ "const": "1.0"
247
+ },
248
+ "callAgentFunction": {
249
+ "type": "object",
250
+ "properties": {
251
+ "surfaceId": {
252
+ "type": "string",
253
+ "minLength": 1,
254
+ "maxLength": 256
255
+ },
256
+ "functionCallId": {
257
+ "type": "string",
258
+ "minLength": 1,
259
+ "maxLength": 256
260
+ },
261
+ "callFunction": {
262
+ "$ref": "#/$defs/FunctionCall"
263
+ }
264
+ },
265
+ "required": [
266
+ "surfaceId",
267
+ "functionCallId",
268
+ "callFunction"
269
+ ],
270
+ "additionalProperties": false
271
+ }
272
+ },
273
+ "required": [
274
+ "version",
275
+ "callAgentFunction"
276
+ ],
277
+ "additionalProperties": false
278
+ },
279
+ "Confirm": {
280
+ "type": "object",
281
+ "properties": {
282
+ "what": {
283
+ "type": "string",
284
+ "minLength": 1,
285
+ "maxLength": 4096
286
+ },
287
+ "scope": {
288
+ "type": "array",
289
+ "items": {
290
+ "type": "string",
291
+ "minLength": 1,
292
+ "maxLength": 256
293
+ },
294
+ "minItems": 1,
295
+ "maxItems": 32
296
+ },
297
+ "ttlMs": {
298
+ "type": "integer",
299
+ "minimum": 1,
300
+ "maximum": 86400000
301
+ },
302
+ "who": {
303
+ "type": "string",
304
+ "minLength": 1,
305
+ "maxLength": 256
306
+ }
307
+ },
308
+ "required": [
309
+ "what",
310
+ "scope",
311
+ "ttlMs"
312
+ ],
313
+ "additionalProperties": false
314
+ },
315
+ "RefusedReason": {
316
+ "enum": [
317
+ "unsupported-action",
318
+ "invalid-arguments",
319
+ "denied",
320
+ "unregistered-route",
321
+ "unresolved-target",
322
+ "stale-owner",
323
+ "absent-scope",
324
+ "cancelled"
325
+ ]
326
+ },
327
+ "Outcome": {
328
+ "oneOf": [
329
+ {
330
+ "type": "object",
331
+ "properties": {
332
+ "status": {
333
+ "const": "ok"
334
+ },
335
+ "result": {
336
+ "$ref": "#/$defs/JSONValue"
337
+ },
338
+ "receipt": {
339
+ "type": "string",
340
+ "minLength": 1,
341
+ "maxLength": 256
342
+ }
343
+ },
344
+ "required": [
345
+ "status"
346
+ ],
347
+ "additionalProperties": false
348
+ },
349
+ {
350
+ "type": "object",
351
+ "properties": {
352
+ "status": {
353
+ "const": "accepted"
354
+ },
355
+ "handle": {
356
+ "type": "string",
357
+ "minLength": 1,
358
+ "maxLength": 256
359
+ },
360
+ "poll": {
361
+ "type": "boolean"
362
+ }
363
+ },
364
+ "required": [
365
+ "status",
366
+ "handle"
367
+ ],
368
+ "additionalProperties": false
369
+ },
370
+ {
371
+ "type": "object",
372
+ "properties": {
373
+ "status": {
374
+ "const": "needs_confirmation"
375
+ },
376
+ "confirm": {
377
+ "$ref": "#/$defs/Confirm"
378
+ }
379
+ },
380
+ "required": [
381
+ "status",
382
+ "confirm"
383
+ ],
384
+ "additionalProperties": false
385
+ },
386
+ {
387
+ "type": "object",
388
+ "properties": {
389
+ "status": {
390
+ "const": "refused"
391
+ },
392
+ "reason": {
393
+ "$ref": "#/$defs/RefusedReason"
394
+ }
395
+ },
396
+ "required": [
397
+ "status",
398
+ "reason"
399
+ ],
400
+ "additionalProperties": false
401
+ },
402
+ {
403
+ "type": "object",
404
+ "properties": {
405
+ "status": {
406
+ "const": "conflict"
407
+ },
408
+ "recorded": {
409
+ "$ref": "#/$defs/Outcome"
410
+ }
411
+ },
412
+ "required": [
413
+ "status",
414
+ "recorded"
415
+ ],
416
+ "additionalProperties": false
417
+ },
418
+ {
419
+ "type": "object",
420
+ "properties": {
421
+ "status": {
422
+ "const": "stale"
423
+ },
424
+ "current": {
425
+ "$ref": "#/$defs/Basis"
426
+ }
427
+ },
428
+ "required": [
429
+ "status",
430
+ "current"
431
+ ],
432
+ "additionalProperties": false
433
+ },
434
+ {
435
+ "type": "object",
436
+ "properties": {
437
+ "status": {
438
+ "const": "canceled"
439
+ },
440
+ "cause": {
441
+ "type": "string",
442
+ "minLength": 1,
443
+ "maxLength": 256
444
+ }
445
+ },
446
+ "required": [
447
+ "status"
448
+ ],
449
+ "additionalProperties": false
450
+ },
451
+ {
452
+ "type": "object",
453
+ "properties": {
454
+ "status": {
455
+ "const": "expired"
456
+ }
457
+ },
458
+ "required": [
459
+ "status"
460
+ ],
461
+ "additionalProperties": false
462
+ },
463
+ {
464
+ "type": "object",
465
+ "properties": {
466
+ "status": {
467
+ "const": "superseded"
468
+ },
469
+ "by": {
470
+ "type": "string",
471
+ "minLength": 1,
472
+ "maxLength": 256
473
+ }
474
+ },
475
+ "required": [
476
+ "status"
477
+ ],
478
+ "additionalProperties": false
479
+ },
480
+ {
481
+ "type": "object",
482
+ "properties": {
483
+ "status": {
484
+ "const": "failed"
485
+ },
486
+ "code": {
487
+ "type": "string",
488
+ "minLength": 1,
489
+ "maxLength": 256
490
+ },
491
+ "message": {
492
+ "type": "string",
493
+ "minLength": 1,
494
+ "maxLength": 4096
495
+ },
496
+ "detail": {
497
+ "$ref": "#/$defs/JSONValue"
498
+ }
499
+ },
500
+ "required": [
501
+ "status",
502
+ "code",
503
+ "message"
504
+ ],
505
+ "additionalProperties": false
506
+ }
507
+ ]
508
+ },
509
+ "ProtocolError": {
510
+ "type": "object",
511
+ "properties": {
512
+ "code": {
513
+ "type": "string",
514
+ "minLength": 1,
515
+ "maxLength": 256
516
+ },
517
+ "message": {
518
+ "type": "string",
519
+ "minLength": 1,
520
+ "maxLength": 4096
521
+ }
522
+ },
523
+ "required": [
524
+ "code",
525
+ "message"
526
+ ],
527
+ "additionalProperties": false
528
+ },
529
+ "FunctionResponse": {
530
+ "oneOf": [
531
+ {
532
+ "type": "object",
533
+ "properties": {
534
+ "functionCallId": {
535
+ "type": "string",
536
+ "minLength": 1,
537
+ "maxLength": 256
538
+ },
539
+ "value": {
540
+ "$ref": "#/$defs/Outcome"
541
+ }
542
+ },
543
+ "required": [
544
+ "functionCallId",
545
+ "value"
546
+ ],
547
+ "additionalProperties": false
548
+ },
549
+ {
550
+ "type": "object",
551
+ "properties": {
552
+ "functionCallId": {
553
+ "type": "string",
554
+ "minLength": 1,
555
+ "maxLength": 256
556
+ },
557
+ "error": {
558
+ "$ref": "#/$defs/ProtocolError"
559
+ }
560
+ },
561
+ "required": [
562
+ "functionCallId",
563
+ "error"
564
+ ],
565
+ "additionalProperties": false
566
+ }
567
+ ]
568
+ },
569
+ "Response": {
570
+ "type": "object",
571
+ "properties": {
572
+ "version": {
573
+ "const": "1.0"
574
+ },
575
+ "agentFunctionResponse": {
576
+ "$ref": "#/$defs/FunctionResponse"
577
+ }
578
+ },
579
+ "required": [
580
+ "version",
581
+ "agentFunctionResponse"
582
+ ],
583
+ "additionalProperties": false
584
+ },
585
+ "Choice": {
586
+ "type": "object",
587
+ "properties": {
588
+ "label": {
589
+ "type": "string",
590
+ "minLength": 1,
591
+ "maxLength": 256
592
+ },
593
+ "callFunction": {
594
+ "$ref": "#/$defs/FunctionCall"
595
+ }
596
+ },
597
+ "required": [
598
+ "label",
599
+ "callFunction"
600
+ ],
601
+ "additionalProperties": false
602
+ },
603
+ "ViewState": {
604
+ "enum": [
605
+ "ready",
606
+ "loading",
607
+ "empty",
608
+ "error",
609
+ "stale",
610
+ "conflict",
611
+ "expired"
612
+ ]
613
+ },
614
+ "Change": {
615
+ "type": "object",
616
+ "properties": {
617
+ "label": {
618
+ "type": "string",
619
+ "minLength": 1,
620
+ "maxLength": 256
621
+ },
622
+ "before": {
623
+ "type": "string",
624
+ "maxLength": 4096
625
+ },
626
+ "after": {
627
+ "type": "string",
628
+ "maxLength": 4096
629
+ }
630
+ },
631
+ "required": [
632
+ "label",
633
+ "before",
634
+ "after"
635
+ ],
636
+ "additionalProperties": false
637
+ },
638
+ "ApprovalProps": {
639
+ "type": "object",
640
+ "properties": {
641
+ "title": {
642
+ "type": "string",
643
+ "minLength": 1,
644
+ "maxLength": 256
645
+ },
646
+ "summary": {
647
+ "type": "string",
648
+ "maxLength": 4096
649
+ },
650
+ "changes": {
651
+ "type": "array",
652
+ "items": {
653
+ "$ref": "#/$defs/Change"
654
+ },
655
+ "minItems": 0,
656
+ "maxItems": 64
657
+ },
658
+ "choices": {
659
+ "type": "array",
660
+ "items": {
661
+ "$ref": "#/$defs/Choice"
662
+ },
663
+ "minItems": 1,
664
+ "maxItems": 4
665
+ },
666
+ "state": {
667
+ "$ref": "#/$defs/ViewState"
668
+ }
669
+ },
670
+ "required": [
671
+ "title",
672
+ "changes",
673
+ "choices",
674
+ "state"
675
+ ],
676
+ "additionalProperties": false
677
+ },
678
+ "FormField": {
679
+ "type": "object",
680
+ "properties": {
681
+ "key": {
682
+ "type": "string",
683
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
684
+ "maxLength": 64
685
+ },
686
+ "label": {
687
+ "type": "string",
688
+ "minLength": 1,
689
+ "maxLength": 256
690
+ },
691
+ "type": {
692
+ "enum": [
693
+ "text",
694
+ "textarea",
695
+ "checkbox",
696
+ "integer"
697
+ ]
698
+ },
699
+ "required": {
700
+ "type": "boolean"
701
+ },
702
+ "help": {
703
+ "type": "string",
704
+ "maxLength": 1024
705
+ },
706
+ "min": {
707
+ "type": "integer",
708
+ "minimum": -9007199254740991,
709
+ "maximum": 9007199254740991
710
+ },
711
+ "max": {
712
+ "type": "integer",
713
+ "minimum": -9007199254740991,
714
+ "maximum": 9007199254740991
715
+ },
716
+ "maxLength": {
717
+ "type": "integer",
718
+ "minimum": 1,
719
+ "maximum": 16384
720
+ }
721
+ },
722
+ "required": [
723
+ "key",
724
+ "label",
725
+ "type",
726
+ "required"
727
+ ],
728
+ "additionalProperties": false
729
+ },
730
+ "FormProps": {
731
+ "type": "object",
732
+ "properties": {
733
+ "title": {
734
+ "type": "string",
735
+ "minLength": 1,
736
+ "maxLength": 256
737
+ },
738
+ "fields": {
739
+ "type": "array",
740
+ "items": {
741
+ "$ref": "#/$defs/FormField"
742
+ },
743
+ "minItems": 1,
744
+ "maxItems": 32
745
+ },
746
+ "submit": {
747
+ "$ref": "#/$defs/Choice"
748
+ },
749
+ "state": {
750
+ "$ref": "#/$defs/ViewState"
751
+ }
752
+ },
753
+ "required": [
754
+ "title",
755
+ "fields",
756
+ "submit",
757
+ "state"
758
+ ],
759
+ "additionalProperties": false
760
+ },
761
+ "ListItem": {
762
+ "type": "object",
763
+ "properties": {
764
+ "id": {
765
+ "type": "string",
766
+ "minLength": 1,
767
+ "maxLength": 256
768
+ },
769
+ "title": {
770
+ "type": "string",
771
+ "minLength": 1,
772
+ "maxLength": 256
773
+ },
774
+ "summary": {
775
+ "type": "string",
776
+ "maxLength": 1024
777
+ }
778
+ },
779
+ "required": [
780
+ "id",
781
+ "title"
782
+ ],
783
+ "additionalProperties": false
784
+ },
785
+ "ListDetailProps": {
786
+ "type": "object",
787
+ "properties": {
788
+ "title": {
789
+ "type": "string",
790
+ "minLength": 1,
791
+ "maxLength": 256
792
+ },
793
+ "items": {
794
+ "type": "array",
795
+ "items": {
796
+ "$ref": "#/$defs/ListItem"
797
+ },
798
+ "minItems": 0,
799
+ "maxItems": 128
800
+ },
801
+ "selectedId": {
802
+ "type": "string",
803
+ "minLength": 1,
804
+ "maxLength": 256
805
+ },
806
+ "detail": {
807
+ "type": "object",
808
+ "properties": {
809
+ "title": {
810
+ "type": "string",
811
+ "minLength": 1,
812
+ "maxLength": 256
813
+ },
814
+ "body": {
815
+ "type": "string",
816
+ "maxLength": 16384
817
+ }
818
+ },
819
+ "required": [
820
+ "title",
821
+ "body"
822
+ ],
823
+ "additionalProperties": false
824
+ },
825
+ "state": {
826
+ "$ref": "#/$defs/ViewState"
827
+ }
828
+ },
829
+ "required": [
830
+ "title",
831
+ "items",
832
+ "state"
833
+ ],
834
+ "additionalProperties": false
835
+ },
836
+ "Pattern": {
837
+ "type": "object",
838
+ "properties": {
839
+ "id": {
840
+ "enum": [
841
+ "approval",
842
+ "form",
843
+ "list_detail"
844
+ ]
845
+ },
846
+ "version": {
847
+ "const": "1.0.0"
848
+ }
849
+ },
850
+ "required": [
851
+ "id",
852
+ "version"
853
+ ],
854
+ "additionalProperties": false
855
+ },
856
+ "Metadata": {
857
+ "type": "object",
858
+ "properties": {
859
+ "extensions": {
860
+ "type": "object",
861
+ "properties": {
862
+ "genui_surface": {
863
+ "type": "object",
864
+ "properties": {
865
+ "contract_version": {
866
+ "const": "1"
867
+ }
868
+ },
869
+ "required": [
870
+ "contract_version"
871
+ ],
872
+ "additionalProperties": false
873
+ },
874
+ "genui_pattern": {
875
+ "$ref": "#/$defs/Pattern"
876
+ }
877
+ },
878
+ "required": [
879
+ "genui_surface",
880
+ "genui_pattern"
881
+ ],
882
+ "additionalProperties": false
883
+ }
884
+ },
885
+ "required": [
886
+ "extensions"
887
+ ],
888
+ "additionalProperties": false
889
+ },
890
+ "DataModel": {
891
+ "type": "object",
892
+ "properties": {
893
+ "draft": {
894
+ "$ref": "#/$defs/Input"
895
+ }
896
+ },
897
+ "required": [],
898
+ "additionalProperties": false
899
+ },
900
+ "anyComponent": {
901
+ "oneOf": [
902
+ {
903
+ "$ref": "#/components/GenuiApproval"
904
+ },
905
+ {
906
+ "$ref": "#/components/GenuiForm"
907
+ },
908
+ {
909
+ "$ref": "#/components/GenuiListDetail"
910
+ }
911
+ ]
912
+ },
913
+ "anyFunction": {
914
+ "$ref": "#/functions/genui_action"
915
+ }
916
+ }
917
+ }