@clowder-ai/plugin-contract 0.1.0-beta.15 → 0.1.0-beta.17

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,783 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://clowder-ai.dev/schemas/companion-bridge/v1",
4
+ "title": "Desktop companion renderer bridge",
5
+ "description": "Closed package presentation bridge. The Host-owned isolated preload owns WebRTC, microphone playback and its receive-only provider data channel. Packages never provide SDP, get a peer/channel handle, or send provider events. Host binds owner, installation and conversation; the trusted executor requires explicit gestures for voice and screen admission. Renderer screen observations remain untrusted. No new M0 methods.",
6
+ "$defs": {
7
+ "CompanionSelectionId": {
8
+ "type": "string",
9
+ "pattern": "^[a-zA-Z0-9_-]{1,160}$"
10
+ },
11
+ "CompanionScreenFrame": {
12
+ "type": "object",
13
+ "properties": {
14
+ "image": {
15
+ "type": "string",
16
+ "maxLength": 1400000,
17
+ "pattern": "^data:image/(jpeg|png|webp);base64,"
18
+ },
19
+ "width": {
20
+ "type": "integer",
21
+ "minimum": 1,
22
+ "maximum": 1600
23
+ },
24
+ "height": {
25
+ "type": "integer",
26
+ "minimum": 1,
27
+ "maximum": 1600
28
+ },
29
+ "frameId": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "maxLength": 160
33
+ },
34
+ "sourceLabel": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "maxLength": 256
38
+ },
39
+ "observedAt": {
40
+ "type": "number",
41
+ "minimum": 0
42
+ }
43
+ },
44
+ "required": [
45
+ "image",
46
+ "width",
47
+ "height",
48
+ "frameId",
49
+ "sourceLabel",
50
+ "observedAt"
51
+ ],
52
+ "additionalProperties": false
53
+ },
54
+ "CompanionCommand": {
55
+ "oneOf": [
56
+ {
57
+ "type": "object",
58
+ "properties": {
59
+ "kind": {
60
+ "const": "state"
61
+ }
62
+ },
63
+ "required": [
64
+ "kind"
65
+ ],
66
+ "additionalProperties": false
67
+ },
68
+ {
69
+ "type": "object",
70
+ "properties": {
71
+ "kind": {
72
+ "const": "prepare"
73
+ }
74
+ },
75
+ "required": [
76
+ "kind"
77
+ ],
78
+ "additionalProperties": false
79
+ },
80
+ {
81
+ "type": "object",
82
+ "properties": {
83
+ "kind": {
84
+ "const": "audio.connect"
85
+ }
86
+ },
87
+ "required": [
88
+ "kind"
89
+ ],
90
+ "additionalProperties": false
91
+ },
92
+ {
93
+ "type": "object",
94
+ "properties": {
95
+ "kind": {
96
+ "const": "audio.close"
97
+ }
98
+ },
99
+ "required": [
100
+ "kind"
101
+ ],
102
+ "additionalProperties": false
103
+ },
104
+ {
105
+ "type": "object",
106
+ "properties": {
107
+ "kind": {
108
+ "const": "audio.microphone"
109
+ },
110
+ "muted": {
111
+ "type": "boolean"
112
+ }
113
+ },
114
+ "required": [
115
+ "kind",
116
+ "muted"
117
+ ],
118
+ "additionalProperties": false
119
+ },
120
+ {
121
+ "type": "object",
122
+ "properties": {
123
+ "kind": {
124
+ "const": "audio.speaker"
125
+ },
126
+ "muted": {
127
+ "type": "boolean"
128
+ }
129
+ },
130
+ "required": [
131
+ "kind",
132
+ "muted"
133
+ ],
134
+ "additionalProperties": false
135
+ },
136
+ {
137
+ "type": "object",
138
+ "properties": {
139
+ "kind": {
140
+ "const": "stop"
141
+ }
142
+ },
143
+ "required": [
144
+ "kind"
145
+ ],
146
+ "additionalProperties": false
147
+ },
148
+ {
149
+ "type": "object",
150
+ "properties": {
151
+ "kind": {
152
+ "const": "text"
153
+ },
154
+ "text": {
155
+ "type": "string",
156
+ "minLength": 1,
157
+ "maxLength": 8000
158
+ },
159
+ "clientMessageId": {
160
+ "type": "string",
161
+ "format": "uuid"
162
+ }
163
+ },
164
+ "required": [
165
+ "kind",
166
+ "text",
167
+ "clientMessageId"
168
+ ],
169
+ "additionalProperties": false
170
+ },
171
+ {
172
+ "type": "object",
173
+ "properties": {
174
+ "kind": {
175
+ "const": "documents"
176
+ },
177
+ "allowed": {
178
+ "type": "boolean"
179
+ }
180
+ },
181
+ "required": [
182
+ "kind",
183
+ "allowed"
184
+ ],
185
+ "additionalProperties": false
186
+ },
187
+ {
188
+ "type": "object",
189
+ "properties": {
190
+ "kind": {
191
+ "const": "screen.pick"
192
+ }
193
+ },
194
+ "required": [
195
+ "kind"
196
+ ],
197
+ "additionalProperties": false
198
+ },
199
+ {
200
+ "type": "object",
201
+ "properties": {
202
+ "kind": {
203
+ "const": "screen.open"
204
+ },
205
+ "selectionId": {
206
+ "$ref": "#/$defs/CompanionSelectionId"
207
+ },
208
+ "label": {
209
+ "type": "string",
210
+ "minLength": 1,
211
+ "maxLength": 256
212
+ }
213
+ },
214
+ "required": [
215
+ "kind",
216
+ "selectionId",
217
+ "label"
218
+ ],
219
+ "additionalProperties": false
220
+ },
221
+ {
222
+ "type": "object",
223
+ "properties": {
224
+ "kind": {
225
+ "const": "screen.frame"
226
+ },
227
+ "selectionId": {
228
+ "$ref": "#/$defs/CompanionSelectionId"
229
+ },
230
+ "frame": {
231
+ "$ref": "#/$defs/CompanionScreenFrame"
232
+ }
233
+ },
234
+ "required": [
235
+ "kind",
236
+ "selectionId",
237
+ "frame"
238
+ ],
239
+ "additionalProperties": false
240
+ },
241
+ {
242
+ "type": "object",
243
+ "properties": {
244
+ "kind": {
245
+ "const": "screen.close"
246
+ }
247
+ },
248
+ "required": [
249
+ "kind"
250
+ ],
251
+ "additionalProperties": false
252
+ },
253
+ {
254
+ "type": "object",
255
+ "properties": {
256
+ "kind": {
257
+ "const": "conversation.open"
258
+ }
259
+ },
260
+ "required": [
261
+ "kind"
262
+ ],
263
+ "additionalProperties": false
264
+ },
265
+ {
266
+ "type": "object",
267
+ "properties": {
268
+ "kind": {
269
+ "const": "view.resize"
270
+ },
271
+ "expanded": {
272
+ "type": "boolean"
273
+ }
274
+ },
275
+ "required": [
276
+ "kind",
277
+ "expanded"
278
+ ],
279
+ "additionalProperties": false
280
+ },
281
+ {
282
+ "type": "object",
283
+ "properties": {
284
+ "kind": {
285
+ "const": "view.layout"
286
+ },
287
+ "panel": {
288
+ "enum": [
289
+ "none",
290
+ "actions",
291
+ "menu",
292
+ "chat"
293
+ ]
294
+ },
295
+ "width": {
296
+ "type": "integer",
297
+ "minimum": 120,
298
+ "maximum": 420
299
+ },
300
+ "height": {
301
+ "type": "integer",
302
+ "minimum": 32,
303
+ "maximum": 500
304
+ }
305
+ },
306
+ "required": [
307
+ "kind",
308
+ "panel",
309
+ "width",
310
+ "height"
311
+ ],
312
+ "additionalProperties": false
313
+ },
314
+ {
315
+ "type": "object",
316
+ "properties": {
317
+ "kind": {
318
+ "const": "view.drag"
319
+ },
320
+ "phase": {
321
+ "enum": [
322
+ "start",
323
+ "end"
324
+ ]
325
+ }
326
+ },
327
+ "required": [
328
+ "kind",
329
+ "phase"
330
+ ],
331
+ "additionalProperties": false
332
+ },
333
+ {
334
+ "type": "object",
335
+ "properties": {
336
+ "kind": {
337
+ "const": "view.hide"
338
+ }
339
+ },
340
+ "required": [
341
+ "kind"
342
+ ],
343
+ "additionalProperties": false
344
+ },
345
+ {
346
+ "type": "object",
347
+ "properties": {
348
+ "kind": {
349
+ "const": "conversation.read"
350
+ }
351
+ },
352
+ "required": [
353
+ "kind"
354
+ ],
355
+ "additionalProperties": false
356
+ }
357
+ ]
358
+ },
359
+ "CompanionActor": {
360
+ "type": "object",
361
+ "properties": {
362
+ "catId": {
363
+ "type": "string",
364
+ "minLength": 1,
365
+ "maxLength": 160
366
+ },
367
+ "displayName": {
368
+ "type": "string",
369
+ "minLength": 1,
370
+ "maxLength": 256
371
+ }
372
+ },
373
+ "required": [
374
+ "catId",
375
+ "displayName"
376
+ ],
377
+ "additionalProperties": false
378
+ },
379
+ "CompanionState": {
380
+ "type": "object",
381
+ "properties": {
382
+ "kind": {
383
+ "const": "state"
384
+ },
385
+ "phase": {
386
+ "enum": [
387
+ "idle",
388
+ "preparing",
389
+ "ready",
390
+ "connecting",
391
+ "talking",
392
+ "closed",
393
+ "failed"
394
+ ]
395
+ },
396
+ "displayName": {
397
+ "type": "string",
398
+ "minLength": 1,
399
+ "maxLength": 256
400
+ },
401
+ "skin": {
402
+ "type": "string",
403
+ "minLength": 1,
404
+ "maxLength": 100
405
+ },
406
+ "duty": {
407
+ "$ref": "#/$defs/CompanionActor"
408
+ },
409
+ "carrier": {
410
+ "$ref": "#/$defs/CompanionActor"
411
+ },
412
+ "documentsAllowed": {
413
+ "type": "boolean"
414
+ },
415
+ "toolsReady": {
416
+ "type": "boolean"
417
+ }
418
+ },
419
+ "required": [
420
+ "kind",
421
+ "phase",
422
+ "displayName",
423
+ "skin",
424
+ "duty",
425
+ "carrier",
426
+ "documentsAllowed",
427
+ "toolsReady"
428
+ ],
429
+ "additionalProperties": false
430
+ },
431
+ "CompanionErrorCode": {
432
+ "enum": [
433
+ "invalid_request",
434
+ "permission_required",
435
+ "unavailable",
436
+ "session_required",
437
+ "busy",
438
+ "selection_changed",
439
+ "carrier_unavailable",
440
+ "cancelled",
441
+ "unconfirmed"
442
+ ]
443
+ },
444
+ "CompanionReply": {
445
+ "oneOf": [
446
+ {
447
+ "type": "object",
448
+ "properties": {
449
+ "kind": {
450
+ "const": "ok"
451
+ }
452
+ },
453
+ "required": [
454
+ "kind"
455
+ ],
456
+ "additionalProperties": false
457
+ },
458
+ {
459
+ "$ref": "#/$defs/CompanionState"
460
+ },
461
+ {
462
+ "type": "object",
463
+ "properties": {
464
+ "kind": {
465
+ "const": "delivery"
466
+ },
467
+ "delivery": {
468
+ "enum": [
469
+ "accepted",
470
+ "unconfirmed"
471
+ ]
472
+ }
473
+ },
474
+ "required": [
475
+ "kind",
476
+ "delivery"
477
+ ],
478
+ "additionalProperties": false
479
+ },
480
+ {
481
+ "type": "object",
482
+ "properties": {
483
+ "kind": {
484
+ "const": "selection"
485
+ },
486
+ "selectionId": {
487
+ "$ref": "#/$defs/CompanionSelectionId"
488
+ }
489
+ },
490
+ "required": [
491
+ "kind",
492
+ "selectionId"
493
+ ],
494
+ "additionalProperties": false
495
+ },
496
+ {
497
+ "type": "object",
498
+ "properties": {
499
+ "kind": {
500
+ "const": "navigation"
501
+ },
502
+ "delivery": {
503
+ "enum": [
504
+ "requested",
505
+ "unconfirmed"
506
+ ]
507
+ }
508
+ },
509
+ "required": [
510
+ "kind",
511
+ "delivery"
512
+ ],
513
+ "additionalProperties": false
514
+ },
515
+ {
516
+ "type": "object",
517
+ "properties": {
518
+ "kind": {
519
+ "const": "error"
520
+ },
521
+ "code": {
522
+ "$ref": "#/$defs/CompanionErrorCode"
523
+ }
524
+ },
525
+ "required": [
526
+ "kind",
527
+ "code"
528
+ ],
529
+ "additionalProperties": false
530
+ },
531
+ {
532
+ "type": "object",
533
+ "properties": {
534
+ "kind": {
535
+ "const": "layout"
536
+ },
537
+ "pet": {
538
+ "type": "object",
539
+ "properties": {
540
+ "x": {
541
+ "type": "number"
542
+ },
543
+ "y": {
544
+ "type": "number"
545
+ }
546
+ },
547
+ "required": [
548
+ "x",
549
+ "y"
550
+ ],
551
+ "additionalProperties": false
552
+ },
553
+ "panel": {
554
+ "type": "object",
555
+ "properties": {
556
+ "x": {
557
+ "type": "number"
558
+ },
559
+ "y": {
560
+ "type": "number"
561
+ },
562
+ "width": {
563
+ "type": "number",
564
+ "minimum": 0,
565
+ "maximum": 2000
566
+ },
567
+ "height": {
568
+ "type": "number",
569
+ "minimum": 0,
570
+ "maximum": 2000
571
+ }
572
+ },
573
+ "required": [
574
+ "x",
575
+ "y",
576
+ "width",
577
+ "height"
578
+ ],
579
+ "additionalProperties": false
580
+ },
581
+ "width": {
582
+ "type": "integer",
583
+ "minimum": 1,
584
+ "maximum": 2000
585
+ },
586
+ "height": {
587
+ "type": "integer",
588
+ "minimum": 1,
589
+ "maximum": 2000
590
+ }
591
+ },
592
+ "required": [
593
+ "kind",
594
+ "pet",
595
+ "panel",
596
+ "width",
597
+ "height"
598
+ ],
599
+ "additionalProperties": false
600
+ },
601
+ {
602
+ "type": "object",
603
+ "properties": {
604
+ "kind": {
605
+ "const": "conversation"
606
+ },
607
+ "messages": {
608
+ "type": "array",
609
+ "maxItems": 32,
610
+ "items": {
611
+ "type": "object",
612
+ "properties": {
613
+ "id": {
614
+ "type": "string",
615
+ "maxLength": 256
616
+ },
617
+ "role": {
618
+ "enum": [
619
+ "user",
620
+ "assistant"
621
+ ]
622
+ },
623
+ "text": {
624
+ "type": "string",
625
+ "maxLength": 16000
626
+ },
627
+ "name": {
628
+ "type": "string",
629
+ "maxLength": 256
630
+ }
631
+ },
632
+ "required": [
633
+ "id",
634
+ "role",
635
+ "text",
636
+ "name"
637
+ ],
638
+ "additionalProperties": false
639
+ }
640
+ },
641
+ "hasMore": {
642
+ "type": "boolean"
643
+ }
644
+ },
645
+ "required": [
646
+ "kind",
647
+ "messages",
648
+ "hasMore"
649
+ ],
650
+ "additionalProperties": false
651
+ }
652
+ ]
653
+ },
654
+ "CompanionEvent": {
655
+ "oneOf": [
656
+ {
657
+ "type": "object",
658
+ "properties": {
659
+ "kind": {
660
+ "const": "media-stopped"
661
+ },
662
+ "reason": {
663
+ "enum": [
664
+ "locked",
665
+ "suspended",
666
+ "hidden",
667
+ "closed",
668
+ "revoked"
669
+ ]
670
+ }
671
+ },
672
+ "required": [
673
+ "kind",
674
+ "reason"
675
+ ],
676
+ "additionalProperties": false
677
+ },
678
+ {
679
+ "type": "object",
680
+ "properties": {
681
+ "kind": {
682
+ "const": "audio"
683
+ },
684
+ "type": {
685
+ "enum": [
686
+ "connected",
687
+ "recovering",
688
+ "recovered",
689
+ "error"
690
+ ]
691
+ }
692
+ },
693
+ "required": [
694
+ "kind",
695
+ "type"
696
+ ],
697
+ "additionalProperties": false
698
+ },
699
+ {
700
+ "type": "object",
701
+ "properties": {
702
+ "kind": {
703
+ "const": "audio"
704
+ },
705
+ "type": {
706
+ "const": "transcript"
707
+ },
708
+ "role": {
709
+ "enum": [
710
+ "user",
711
+ "assistant"
712
+ ]
713
+ },
714
+ "text": {
715
+ "type": "string",
716
+ "maxLength": 16000
717
+ },
718
+ "turnId": {
719
+ "type": "string",
720
+ "minLength": 1,
721
+ "maxLength": 256
722
+ },
723
+ "itemId": {
724
+ "type": "string",
725
+ "minLength": 1,
726
+ "maxLength": 256
727
+ }
728
+ },
729
+ "required": [
730
+ "kind",
731
+ "type",
732
+ "role",
733
+ "text"
734
+ ],
735
+ "additionalProperties": false
736
+ },
737
+ {
738
+ "type": "object",
739
+ "properties": {
740
+ "kind": {
741
+ "const": "audio"
742
+ },
743
+ "type": {
744
+ "const": "turn-done"
745
+ },
746
+ "role": {
747
+ "enum": [
748
+ "user",
749
+ "assistant"
750
+ ]
751
+ },
752
+ "transcript": {
753
+ "type": "string",
754
+ "maxLength": 16000
755
+ },
756
+ "turnId": {
757
+ "type": "string",
758
+ "minLength": 1,
759
+ "maxLength": 256
760
+ }
761
+ },
762
+ "required": [
763
+ "kind",
764
+ "type"
765
+ ],
766
+ "additionalProperties": false
767
+ },
768
+ {
769
+ "type": "object",
770
+ "properties": {
771
+ "kind": {
772
+ "const": "view-dismiss"
773
+ }
774
+ },
775
+ "required": [
776
+ "kind"
777
+ ],
778
+ "additionalProperties": false
779
+ }
780
+ ]
781
+ }
782
+ }
783
+ }