@mhome/conversation-protocol 1.1.1 → 1.3.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,1846 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:mhome:agent-cloud:protocol:envelope:v1",
4
+ "title": "Agent transport envelope v1",
5
+ "$ref": "#/$defs/envelope",
6
+ "$defs": {
7
+ "identifier": {
8
+ "type": "string",
9
+ "minLength": 1
10
+ },
11
+ "conversation_surface": {
12
+ "type": "string",
13
+ "pattern": "^cs1:(?:(?:cp|cg):[A-Za-z0-9_-]+|(?:mp|mg):[a-z0-9_]+:[A-Za-z0-9_-]+:[A-Za-z0-9_-]+(?::[A-Za-z0-9_-]+)?)$"
14
+ },
15
+ "context_generation": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": [
19
+ "user_scope",
20
+ "identity",
21
+ "memory",
22
+ "integration_guide",
23
+ "installed_integrations",
24
+ "scope_integrations"
25
+ ],
26
+ "properties": {
27
+ "user_scope": {
28
+ "$ref": "#/$defs/identifier"
29
+ },
30
+ "identity": {
31
+ "$ref": "#/$defs/identifier"
32
+ },
33
+ "memory": {
34
+ "$ref": "#/$defs/identifier"
35
+ },
36
+ "integration_guide": {
37
+ "$ref": "#/$defs/identifier"
38
+ },
39
+ "installed_integrations": {
40
+ "$ref": "#/$defs/identifier"
41
+ },
42
+ "scope_integrations": {
43
+ "$ref": "#/$defs/identifier"
44
+ }
45
+ }
46
+ },
47
+ "metadata": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": [
51
+ "version",
52
+ "message_id",
53
+ "correlation_id",
54
+ "causation_id",
55
+ "sent_at_unix_ms",
56
+ "dispatch"
57
+ ],
58
+ "properties": {
59
+ "version": {
60
+ "const": 1
61
+ },
62
+ "message_id": {
63
+ "$ref": "#/$defs/identifier"
64
+ },
65
+ "correlation_id": {
66
+ "$ref": "#/$defs/identifier"
67
+ },
68
+ "causation_id": {
69
+ "oneOf": [
70
+ {
71
+ "$ref": "#/$defs/identifier"
72
+ },
73
+ {
74
+ "type": "null"
75
+ }
76
+ ]
77
+ },
78
+ "sent_at_unix_ms": {
79
+ "type": "integer",
80
+ "minimum": 0
81
+ },
82
+ "dispatch": {
83
+ "$ref": "#/$defs/dispatch_binding"
84
+ }
85
+ }
86
+ },
87
+ "dispatch_binding": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": [
91
+ "dispatch_id",
92
+ "agent_session_id"
93
+ ],
94
+ "properties": {
95
+ "dispatch_id": {
96
+ "$ref": "#/$defs/identifier"
97
+ },
98
+ "agent_session_id": {
99
+ "$ref": "#/$defs/identifier"
100
+ }
101
+ }
102
+ },
103
+ "checkpoint_reference": {
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "object_key",
108
+ "sha256",
109
+ "format_version"
110
+ ],
111
+ "properties": {
112
+ "object_key": {
113
+ "$ref": "#/$defs/identifier"
114
+ },
115
+ "sha256": {
116
+ "type": "string",
117
+ "pattern": "^[0-9a-f]{64}$"
118
+ },
119
+ "format_version": {
120
+ "type": "integer",
121
+ "minimum": 1
122
+ }
123
+ }
124
+ },
125
+ "scope": {
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "required": [
129
+ "tenant_id",
130
+ "scope_id"
131
+ ],
132
+ "properties": {
133
+ "tenant_id": {
134
+ "oneOf": [
135
+ {
136
+ "$ref": "#/$defs/identifier"
137
+ },
138
+ {
139
+ "type": "null"
140
+ }
141
+ ]
142
+ },
143
+ "scope_id": {
144
+ "$ref": "#/$defs/identifier"
145
+ }
146
+ }
147
+ },
148
+ "actor": {
149
+ "type": "object",
150
+ "additionalProperties": false,
151
+ "required": [
152
+ "user_id",
153
+ "client_id"
154
+ ],
155
+ "properties": {
156
+ "user_id": {
157
+ "$ref": "#/$defs/identifier"
158
+ },
159
+ "client_id": {
160
+ "oneOf": [
161
+ {
162
+ "$ref": "#/$defs/identifier"
163
+ },
164
+ {
165
+ "type": "null"
166
+ }
167
+ ]
168
+ }
169
+ }
170
+ },
171
+ "context": {
172
+ "type": "object",
173
+ "additionalProperties": false,
174
+ "required": [
175
+ "scope",
176
+ "actor",
177
+ "surface_id",
178
+ "thread_id",
179
+ "run_id",
180
+ "operation_id",
181
+ "deadline_unix_ms",
182
+ "traceparent"
183
+ ],
184
+ "properties": {
185
+ "scope": {
186
+ "$ref": "#/$defs/scope"
187
+ },
188
+ "actor": {
189
+ "$ref": "#/$defs/actor"
190
+ },
191
+ "surface_id": {
192
+ "$ref": "#/$defs/conversation_surface"
193
+ },
194
+ "thread_id": {
195
+ "$ref": "#/$defs/identifier"
196
+ },
197
+ "run_id": {
198
+ "$ref": "#/$defs/identifier"
199
+ },
200
+ "operation_id": {
201
+ "$ref": "#/$defs/identifier"
202
+ },
203
+ "deadline_unix_ms": {
204
+ "oneOf": [
205
+ {
206
+ "type": "integer",
207
+ "minimum": 0
208
+ },
209
+ {
210
+ "type": "null"
211
+ }
212
+ ]
213
+ },
214
+ "traceparent": {
215
+ "oneOf": [
216
+ {
217
+ "type": "string",
218
+ "minLength": 1
219
+ },
220
+ {
221
+ "type": "null"
222
+ }
223
+ ]
224
+ }
225
+ }
226
+ },
227
+ "tool_call": {
228
+ "type": "object",
229
+ "additionalProperties": false,
230
+ "required": [
231
+ "id",
232
+ "name",
233
+ "arguments"
234
+ ],
235
+ "properties": {
236
+ "id": {
237
+ "$ref": "#/$defs/identifier"
238
+ },
239
+ "name": {
240
+ "$ref": "#/$defs/identifier"
241
+ },
242
+ "arguments": true
243
+ }
244
+ },
245
+ "content_part": {
246
+ "oneOf": [
247
+ {
248
+ "type": "object",
249
+ "additionalProperties": false,
250
+ "required": [
251
+ "type",
252
+ "text"
253
+ ],
254
+ "properties": {
255
+ "type": {
256
+ "const": "text"
257
+ },
258
+ "text": {
259
+ "type": "string"
260
+ }
261
+ }
262
+ },
263
+ {
264
+ "type": "object",
265
+ "additionalProperties": false,
266
+ "required": [
267
+ "type",
268
+ "uri",
269
+ "mime_type"
270
+ ],
271
+ "properties": {
272
+ "type": {
273
+ "const": "artifact"
274
+ },
275
+ "uri": {
276
+ "type": "string",
277
+ "pattern": "^meow-artifact://v1/"
278
+ },
279
+ "mime_type": {
280
+ "type": "string",
281
+ "minLength": 1
282
+ }
283
+ }
284
+ },
285
+ {
286
+ "type": "object",
287
+ "additionalProperties": false,
288
+ "required": [
289
+ "type",
290
+ "id",
291
+ "name",
292
+ "arguments"
293
+ ],
294
+ "properties": {
295
+ "type": {
296
+ "const": "tool_call"
297
+ },
298
+ "id": {
299
+ "$ref": "#/$defs/identifier"
300
+ },
301
+ "name": {
302
+ "$ref": "#/$defs/identifier"
303
+ },
304
+ "arguments": true
305
+ }
306
+ },
307
+ {
308
+ "type": "object",
309
+ "additionalProperties": false,
310
+ "required": [
311
+ "type",
312
+ "call_id",
313
+ "result",
314
+ "is_error"
315
+ ],
316
+ "properties": {
317
+ "type": {
318
+ "const": "tool_result"
319
+ },
320
+ "call_id": {
321
+ "$ref": "#/$defs/identifier"
322
+ },
323
+ "result": true,
324
+ "is_error": {
325
+ "type": "boolean"
326
+ }
327
+ }
328
+ },
329
+ {
330
+ "type": "object",
331
+ "additionalProperties": false,
332
+ "required": [
333
+ "type",
334
+ "image"
335
+ ],
336
+ "properties": {
337
+ "type": {
338
+ "const": "image"
339
+ },
340
+ "image": {
341
+ "$ref": "#/$defs/image"
342
+ }
343
+ }
344
+ }
345
+ ]
346
+ },
347
+ "message": {
348
+ "type": "object",
349
+ "additionalProperties": false,
350
+ "required": [
351
+ "role",
352
+ "content"
353
+ ],
354
+ "properties": {
355
+ "role": {
356
+ "enum": [
357
+ "system",
358
+ "user",
359
+ "assistant",
360
+ "tool"
361
+ ]
362
+ },
363
+ "content": {
364
+ "type": "array",
365
+ "items": {
366
+ "$ref": "#/$defs/content_part"
367
+ }
368
+ },
369
+ "continuation": {
370
+ "oneOf": [
371
+ {
372
+ "$ref": "#/$defs/continuation"
373
+ },
374
+ {
375
+ "type": "null"
376
+ }
377
+ ]
378
+ }
379
+ }
380
+ },
381
+ "run_options": {
382
+ "type": "object",
383
+ "additionalProperties": false,
384
+ "required": [
385
+ "use_case",
386
+ "model_mode",
387
+ "access_mode",
388
+ "allow_tools",
389
+ "max_steps",
390
+ "credit_budget",
391
+ "debug"
392
+ ],
393
+ "properties": {
394
+ "use_case": {
395
+ "type": "string",
396
+ "minLength": 1
397
+ },
398
+ "model_mode": {
399
+ "type": "string",
400
+ "minLength": 1
401
+ },
402
+ "access_mode": {
403
+ "enum": [
404
+ "interactive",
405
+ "full_access",
406
+ "no_access"
407
+ ]
408
+ },
409
+ "allow_tools": {
410
+ "type": "boolean"
411
+ },
412
+ "max_steps": {
413
+ "type": "integer",
414
+ "minimum": 1
415
+ },
416
+ "credit_budget": {
417
+ "oneOf": [
418
+ {
419
+ "type": "integer",
420
+ "minimum": 0
421
+ },
422
+ {
423
+ "type": "null"
424
+ }
425
+ ]
426
+ },
427
+ "debug": {
428
+ "type": "boolean"
429
+ }
430
+ }
431
+ },
432
+ "interaction": {
433
+ "type": "object",
434
+ "additionalProperties": false,
435
+ "required": [
436
+ "batch_id",
437
+ "decisions"
438
+ ],
439
+ "properties": {
440
+ "batch_id": {
441
+ "$ref": "#/$defs/identifier"
442
+ },
443
+ "decisions": {
444
+ "type": "array",
445
+ "items": {
446
+ "type": "object",
447
+ "additionalProperties": false,
448
+ "required": [
449
+ "action_id",
450
+ "proceed"
451
+ ],
452
+ "properties": {
453
+ "action_id": {
454
+ "$ref": "#/$defs/identifier"
455
+ },
456
+ "proceed": {
457
+ "type": "boolean"
458
+ }
459
+ }
460
+ }
461
+ }
462
+ }
463
+ },
464
+ "command": {
465
+ "oneOf": [
466
+ {
467
+ "type": "object",
468
+ "additionalProperties": false,
469
+ "required": [
470
+ "type",
471
+ "context",
472
+ "message",
473
+ "options"
474
+ ],
475
+ "properties": {
476
+ "type": {
477
+ "const": "enqueue"
478
+ },
479
+ "context": {
480
+ "$ref": "#/$defs/context"
481
+ },
482
+ "message": {
483
+ "$ref": "#/$defs/message"
484
+ },
485
+ "options": {
486
+ "$ref": "#/$defs/run_options"
487
+ }
488
+ }
489
+ },
490
+ {
491
+ "type": "object",
492
+ "additionalProperties": false,
493
+ "required": [
494
+ "type",
495
+ "context"
496
+ ],
497
+ "properties": {
498
+ "type": {
499
+ "const": "cancel"
500
+ },
501
+ "context": {
502
+ "$ref": "#/$defs/context"
503
+ }
504
+ }
505
+ },
506
+ {
507
+ "type": "object",
508
+ "additionalProperties": false,
509
+ "required": [
510
+ "type",
511
+ "context",
512
+ "interaction"
513
+ ],
514
+ "properties": {
515
+ "type": {
516
+ "const": "submit_interaction"
517
+ },
518
+ "context": {
519
+ "$ref": "#/$defs/context"
520
+ },
521
+ "interaction": {
522
+ "$ref": "#/$defs/interaction"
523
+ }
524
+ }
525
+ }
526
+ ]
527
+ },
528
+ "llm_route": {
529
+ "type": "object",
530
+ "additionalProperties": false,
531
+ "required": [
532
+ "backend",
533
+ "profile",
534
+ "model",
535
+ "provider_preferences",
536
+ "temperature",
537
+ "max_output_tokens",
538
+ "context_window_tokens",
539
+ "cache_control",
540
+ "reasoning_effort"
541
+ ],
542
+ "properties": {
543
+ "backend": {
544
+ "$ref": "#/$defs/identifier"
545
+ },
546
+ "profile": {
547
+ "$ref": "#/$defs/identifier"
548
+ },
549
+ "model": {
550
+ "$ref": "#/$defs/identifier"
551
+ },
552
+ "provider_preferences": {
553
+ "type": "array",
554
+ "items": {
555
+ "$ref": "#/$defs/identifier"
556
+ }
557
+ },
558
+ "temperature": {
559
+ "oneOf": [
560
+ {
561
+ "type": "number"
562
+ },
563
+ {
564
+ "type": "null"
565
+ }
566
+ ]
567
+ },
568
+ "max_output_tokens": {
569
+ "oneOf": [
570
+ {
571
+ "type": "integer",
572
+ "minimum": 1
573
+ },
574
+ {
575
+ "type": "null"
576
+ }
577
+ ]
578
+ },
579
+ "context_window_tokens": {
580
+ "type": "integer",
581
+ "exclusiveMinimum": 20000
582
+ },
583
+ "cache_control": {
584
+ "oneOf": [
585
+ {
586
+ "type": "boolean"
587
+ },
588
+ {
589
+ "type": "null"
590
+ }
591
+ ]
592
+ },
593
+ "reasoning_effort": {
594
+ "oneOf": [
595
+ {
596
+ "type": "string",
597
+ "minLength": 1
598
+ },
599
+ {
600
+ "type": "null"
601
+ }
602
+ ]
603
+ }
604
+ }
605
+ },
606
+ "llm_route_binding": {
607
+ "type": "object",
608
+ "additionalProperties": false,
609
+ "required": [
610
+ "use_case",
611
+ "model_mode",
612
+ "revision",
613
+ "route"
614
+ ],
615
+ "properties": {
616
+ "use_case": {
617
+ "$ref": "#/$defs/identifier"
618
+ },
619
+ "model_mode": {
620
+ "$ref": "#/$defs/identifier"
621
+ },
622
+ "revision": {
623
+ "oneOf": [
624
+ {
625
+ "type": "string",
626
+ "minLength": 1
627
+ },
628
+ {
629
+ "type": "null"
630
+ }
631
+ ]
632
+ },
633
+ "route": {
634
+ "$ref": "#/$defs/llm_route"
635
+ }
636
+ }
637
+ },
638
+ "llm_execution_plan": {
639
+ "type": "object",
640
+ "additionalProperties": false,
641
+ "required": [
642
+ "routes"
643
+ ],
644
+ "properties": {
645
+ "routes": {
646
+ "type": "array",
647
+ "minItems": 1,
648
+ "items": {
649
+ "$ref": "#/$defs/llm_route_binding"
650
+ }
651
+ }
652
+ }
653
+ },
654
+ "command_request": {
655
+ "type": "object",
656
+ "additionalProperties": false,
657
+ "required": [
658
+ "command",
659
+ "context_generation",
660
+ "llm_plan",
661
+ "base_checkpoint",
662
+ "abandoned_run_id"
663
+ ],
664
+ "properties": {
665
+ "command": {
666
+ "$ref": "#/$defs/command"
667
+ },
668
+ "context_generation": {
669
+ "oneOf": [
670
+ {
671
+ "$ref": "#/$defs/context_generation"
672
+ },
673
+ {
674
+ "type": "null"
675
+ }
676
+ ]
677
+ },
678
+ "llm_plan": {
679
+ "oneOf": [
680
+ {
681
+ "$ref": "#/$defs/llm_execution_plan"
682
+ },
683
+ {
684
+ "type": "null"
685
+ }
686
+ ]
687
+ },
688
+ "base_checkpoint": {
689
+ "oneOf": [
690
+ {
691
+ "$ref": "#/$defs/checkpoint_reference"
692
+ },
693
+ {
694
+ "type": "null"
695
+ }
696
+ ]
697
+ },
698
+ "abandoned_run_id": {
699
+ "oneOf": [
700
+ {
701
+ "$ref": "#/$defs/identifier"
702
+ },
703
+ {
704
+ "type": "null"
705
+ }
706
+ ]
707
+ }
708
+ }
709
+ },
710
+ "preview_value": {
711
+ "oneOf": [
712
+ {
713
+ "type": "object",
714
+ "additionalProperties": false,
715
+ "required": [
716
+ "type",
717
+ "text"
718
+ ],
719
+ "properties": {
720
+ "type": {
721
+ "const": "text"
722
+ },
723
+ "text": {
724
+ "type": "string"
725
+ }
726
+ }
727
+ },
728
+ {
729
+ "type": "object",
730
+ "additionalProperties": false,
731
+ "required": [
732
+ "type",
733
+ "items"
734
+ ],
735
+ "properties": {
736
+ "type": {
737
+ "const": "text_list"
738
+ },
739
+ "items": {
740
+ "type": "array",
741
+ "items": {
742
+ "type": "string"
743
+ }
744
+ }
745
+ }
746
+ },
747
+ {
748
+ "type": "object",
749
+ "additionalProperties": false,
750
+ "required": [
751
+ "type",
752
+ "value"
753
+ ],
754
+ "properties": {
755
+ "type": {
756
+ "const": "number"
757
+ },
758
+ "value": {
759
+ "type": "number"
760
+ }
761
+ }
762
+ },
763
+ {
764
+ "type": "object",
765
+ "additionalProperties": false,
766
+ "required": [
767
+ "type",
768
+ "value"
769
+ ],
770
+ "properties": {
771
+ "type": {
772
+ "const": "bool"
773
+ },
774
+ "value": {
775
+ "type": "boolean"
776
+ }
777
+ }
778
+ }
779
+ ]
780
+ },
781
+ "interaction_preview": {
782
+ "type": "object",
783
+ "additionalProperties": false,
784
+ "required": [
785
+ "actionCode",
786
+ "title",
787
+ "message",
788
+ "tone",
789
+ "details",
790
+ "proceedLabel",
791
+ "rejectLabel"
792
+ ],
793
+ "properties": {
794
+ "actionCode": {
795
+ "$ref": "#/$defs/identifier"
796
+ },
797
+ "title": {
798
+ "$ref": "#/$defs/identifier"
799
+ },
800
+ "message": {
801
+ "type": "string"
802
+ },
803
+ "tone": {
804
+ "enum": [
805
+ "normal",
806
+ "danger"
807
+ ]
808
+ },
809
+ "details": {
810
+ "type": "array",
811
+ "items": {
812
+ "type": "object",
813
+ "additionalProperties": false,
814
+ "required": [
815
+ "label",
816
+ "value"
817
+ ],
818
+ "properties": {
819
+ "label": {
820
+ "$ref": "#/$defs/identifier"
821
+ },
822
+ "value": {
823
+ "$ref": "#/$defs/preview_value"
824
+ }
825
+ }
826
+ }
827
+ },
828
+ "proceedLabel": {
829
+ "$ref": "#/$defs/identifier"
830
+ },
831
+ "rejectLabel": {
832
+ "$ref": "#/$defs/identifier"
833
+ },
834
+ "clientTask": {
835
+ "type": "object",
836
+ "additionalProperties": false,
837
+ "required": [
838
+ "type",
839
+ "integrationIds"
840
+ ],
841
+ "properties": {
842
+ "type": {
843
+ "const": "install_integrations"
844
+ },
845
+ "integrationIds": {
846
+ "type": "array",
847
+ "minItems": 1,
848
+ "items": {
849
+ "$ref": "#/$defs/identifier"
850
+ }
851
+ }
852
+ }
853
+ }
854
+ }
855
+ },
856
+ "prepared_action": {
857
+ "type": "object",
858
+ "additionalProperties": false,
859
+ "required": [
860
+ "action_id",
861
+ "operation_id",
862
+ "preview",
863
+ "payload",
864
+ "revision",
865
+ "approval",
866
+ "interaction_kind"
867
+ ],
868
+ "properties": {
869
+ "action_id": {
870
+ "$ref": "#/$defs/identifier"
871
+ },
872
+ "operation_id": {
873
+ "$ref": "#/$defs/identifier"
874
+ },
875
+ "preview": {
876
+ "$ref": "#/$defs/interaction_preview"
877
+ },
878
+ "payload": true,
879
+ "revision": {
880
+ "type": "integer",
881
+ "minimum": 0
882
+ },
883
+ "approval": {
884
+ "enum": [
885
+ "never",
886
+ "when_interactive",
887
+ "always"
888
+ ]
889
+ },
890
+ "interaction_kind": {
891
+ "enum": [
892
+ "approval",
893
+ "user_action"
894
+ ]
895
+ }
896
+ }
897
+ },
898
+ "usage": {
899
+ "type": "object",
900
+ "additionalProperties": false,
901
+ "required": [
902
+ "model_requests",
903
+ "reported_model_requests",
904
+ "input_tokens",
905
+ "output_tokens",
906
+ "cached_input_tokens",
907
+ "reasoning_output_tokens",
908
+ "peak_input_tokens",
909
+ "credits",
910
+ "tool_calls",
911
+ "window_truncations",
912
+ "trimmed_messages"
913
+ ],
914
+ "properties": {
915
+ "model_requests": {
916
+ "type": "integer",
917
+ "minimum": 0
918
+ },
919
+ "reported_model_requests": {
920
+ "type": "integer",
921
+ "minimum": 0
922
+ },
923
+ "input_tokens": {
924
+ "type": "integer",
925
+ "minimum": 0
926
+ },
927
+ "output_tokens": {
928
+ "type": "integer",
929
+ "minimum": 0
930
+ },
931
+ "cached_input_tokens": {
932
+ "oneOf": [
933
+ {
934
+ "type": "integer",
935
+ "minimum": 0
936
+ },
937
+ {
938
+ "type": "null"
939
+ }
940
+ ]
941
+ },
942
+ "reasoning_output_tokens": {
943
+ "oneOf": [
944
+ {
945
+ "type": "integer",
946
+ "minimum": 0
947
+ },
948
+ {
949
+ "type": "null"
950
+ }
951
+ ]
952
+ },
953
+ "peak_input_tokens": {
954
+ "type": "integer",
955
+ "minimum": 0
956
+ },
957
+ "credits": {
958
+ "oneOf": [
959
+ {
960
+ "type": "integer",
961
+ "minimum": 0
962
+ },
963
+ {
964
+ "type": "null"
965
+ }
966
+ ]
967
+ },
968
+ "tool_calls": {
969
+ "type": "integer",
970
+ "minimum": 0
971
+ },
972
+ "window_truncations": {
973
+ "type": "integer",
974
+ "minimum": 0
975
+ },
976
+ "trimmed_messages": {
977
+ "type": "integer",
978
+ "minimum": 0
979
+ }
980
+ }
981
+ },
982
+ "agent_event": {
983
+ "oneOf": [
984
+ {
985
+ "type": "object",
986
+ "additionalProperties": false,
987
+ "required": [
988
+ "type"
989
+ ],
990
+ "properties": {
991
+ "type": {
992
+ "const": "started"
993
+ }
994
+ }
995
+ },
996
+ {
997
+ "type": "object",
998
+ "additionalProperties": false,
999
+ "required": [
1000
+ "type",
1001
+ "batch_id",
1002
+ "actions",
1003
+ "usage"
1004
+ ],
1005
+ "properties": {
1006
+ "type": {
1007
+ "const": "interaction_required"
1008
+ },
1009
+ "batch_id": {
1010
+ "$ref": "#/$defs/identifier"
1011
+ },
1012
+ "actions": {
1013
+ "type": "array",
1014
+ "items": {
1015
+ "$ref": "#/$defs/prepared_action"
1016
+ }
1017
+ },
1018
+ "usage": {
1019
+ "$ref": "#/$defs/usage"
1020
+ }
1021
+ }
1022
+ },
1023
+ {
1024
+ "type": "object",
1025
+ "additionalProperties": false,
1026
+ "required": [
1027
+ "type",
1028
+ "result",
1029
+ "usage"
1030
+ ],
1031
+ "properties": {
1032
+ "type": {
1033
+ "const": "completed"
1034
+ },
1035
+ "result": true,
1036
+ "usage": {
1037
+ "$ref": "#/$defs/usage"
1038
+ }
1039
+ }
1040
+ },
1041
+ {
1042
+ "type": "object",
1043
+ "additionalProperties": false,
1044
+ "required": [
1045
+ "type",
1046
+ "code",
1047
+ "message",
1048
+ "usage"
1049
+ ],
1050
+ "properties": {
1051
+ "type": {
1052
+ "const": "failed"
1053
+ },
1054
+ "code": {
1055
+ "$ref": "#/$defs/identifier"
1056
+ },
1057
+ "message": {
1058
+ "type": "string"
1059
+ },
1060
+ "usage": {
1061
+ "$ref": "#/$defs/usage"
1062
+ }
1063
+ }
1064
+ }
1065
+ ]
1066
+ },
1067
+ "durable_event": {
1068
+ "type": "object",
1069
+ "additionalProperties": false,
1070
+ "required": [
1071
+ "id",
1072
+ "sequence",
1073
+ "context",
1074
+ "event"
1075
+ ],
1076
+ "properties": {
1077
+ "id": {
1078
+ "$ref": "#/$defs/identifier"
1079
+ },
1080
+ "sequence": {
1081
+ "type": "integer",
1082
+ "minimum": 1
1083
+ },
1084
+ "context": {
1085
+ "$ref": "#/$defs/context"
1086
+ },
1087
+ "event": {
1088
+ "$ref": "#/$defs/agent_event"
1089
+ }
1090
+ }
1091
+ },
1092
+ "event_message": {
1093
+ "type": "object",
1094
+ "additionalProperties": false,
1095
+ "required": [
1096
+ "event",
1097
+ "checkpoint"
1098
+ ],
1099
+ "properties": {
1100
+ "event": {
1101
+ "$ref": "#/$defs/durable_event"
1102
+ },
1103
+ "checkpoint": {
1104
+ "$ref": "#/$defs/checkpoint_reference"
1105
+ }
1106
+ }
1107
+ },
1108
+ "agent_observation": {
1109
+ "oneOf": [
1110
+ {
1111
+ "type": "object",
1112
+ "additionalProperties": false,
1113
+ "required": [
1114
+ "type",
1115
+ "status"
1116
+ ],
1117
+ "properties": {
1118
+ "type": {
1119
+ "const": "progress"
1120
+ },
1121
+ "status": {
1122
+ "$ref": "#/$defs/identifier"
1123
+ }
1124
+ }
1125
+ },
1126
+ {
1127
+ "type": "object",
1128
+ "additionalProperties": false,
1129
+ "required": [
1130
+ "type",
1131
+ "content",
1132
+ "append"
1133
+ ],
1134
+ "properties": {
1135
+ "type": {
1136
+ "const": "companion_text"
1137
+ },
1138
+ "content": {
1139
+ "type": "string"
1140
+ },
1141
+ "append": {
1142
+ "type": "boolean"
1143
+ }
1144
+ }
1145
+ },
1146
+ {
1147
+ "type": "object",
1148
+ "additionalProperties": false,
1149
+ "required": [
1150
+ "type",
1151
+ "call_id",
1152
+ "tool_name"
1153
+ ],
1154
+ "properties": {
1155
+ "type": {
1156
+ "const": "tool_started"
1157
+ },
1158
+ "call_id": {
1159
+ "$ref": "#/$defs/identifier"
1160
+ },
1161
+ "tool_name": {
1162
+ "$ref": "#/$defs/identifier"
1163
+ }
1164
+ }
1165
+ },
1166
+ {
1167
+ "type": "object",
1168
+ "additionalProperties": false,
1169
+ "required": [
1170
+ "type",
1171
+ "call_id",
1172
+ "tool_name",
1173
+ "result",
1174
+ "is_error"
1175
+ ],
1176
+ "properties": {
1177
+ "type": {
1178
+ "const": "tool_result"
1179
+ },
1180
+ "call_id": {
1181
+ "$ref": "#/$defs/identifier"
1182
+ },
1183
+ "tool_name": {
1184
+ "$ref": "#/$defs/identifier"
1185
+ },
1186
+ "result": true,
1187
+ "is_error": {
1188
+ "type": "boolean"
1189
+ }
1190
+ }
1191
+ },
1192
+ {
1193
+ "type": "object",
1194
+ "additionalProperties": false,
1195
+ "required": [
1196
+ "type",
1197
+ "tool_names"
1198
+ ],
1199
+ "properties": {
1200
+ "type": {
1201
+ "const": "tool_calls_scheduled"
1202
+ },
1203
+ "tool_names": {
1204
+ "type": "array",
1205
+ "items": {
1206
+ "$ref": "#/$defs/identifier"
1207
+ }
1208
+ }
1209
+ }
1210
+ },
1211
+ {
1212
+ "type": "object",
1213
+ "additionalProperties": false,
1214
+ "required": [
1215
+ "type",
1216
+ "count"
1217
+ ],
1218
+ "properties": {
1219
+ "type": {
1220
+ "const": "tool_calls_completed"
1221
+ },
1222
+ "count": {
1223
+ "type": "integer",
1224
+ "minimum": 0
1225
+ }
1226
+ }
1227
+ },
1228
+ {
1229
+ "type": "object",
1230
+ "additionalProperties": false,
1231
+ "required": [
1232
+ "type",
1233
+ "scope",
1234
+ "payload"
1235
+ ],
1236
+ "properties": {
1237
+ "type": {
1238
+ "const": "debug_data"
1239
+ },
1240
+ "scope": {
1241
+ "$ref": "#/$defs/identifier"
1242
+ },
1243
+ "payload": true
1244
+ }
1245
+ }
1246
+ ]
1247
+ },
1248
+ "observation_message": {
1249
+ "type": "object",
1250
+ "additionalProperties": false,
1251
+ "required": [
1252
+ "context",
1253
+ "observation"
1254
+ ],
1255
+ "properties": {
1256
+ "context": {
1257
+ "$ref": "#/$defs/context"
1258
+ },
1259
+ "observation": {
1260
+ "$ref": "#/$defs/agent_observation"
1261
+ }
1262
+ }
1263
+ },
1264
+ "execution_failure": {
1265
+ "type": "object",
1266
+ "additionalProperties": false,
1267
+ "required": [
1268
+ "context",
1269
+ "code",
1270
+ "message"
1271
+ ],
1272
+ "properties": {
1273
+ "context": {
1274
+ "$ref": "#/$defs/context"
1275
+ },
1276
+ "code": {
1277
+ "$ref": "#/$defs/identifier"
1278
+ },
1279
+ "message": {
1280
+ "type": "string"
1281
+ }
1282
+ }
1283
+ },
1284
+ "facade_request": {
1285
+ "type": "object",
1286
+ "additionalProperties": false,
1287
+ "required": [
1288
+ "operation_id",
1289
+ "target",
1290
+ "input"
1291
+ ],
1292
+ "properties": {
1293
+ "operation_id": {
1294
+ "$ref": "#/$defs/identifier"
1295
+ },
1296
+ "target": {
1297
+ "$ref": "#/$defs/identifier"
1298
+ },
1299
+ "input": true
1300
+ }
1301
+ },
1302
+ "app_facade_request": {
1303
+ "oneOf": [
1304
+ {
1305
+ "type": "object",
1306
+ "additionalProperties": false,
1307
+ "required": [
1308
+ "phase",
1309
+ "context",
1310
+ "request"
1311
+ ],
1312
+ "properties": {
1313
+ "phase": {
1314
+ "enum": [
1315
+ "invoke",
1316
+ "prepare"
1317
+ ]
1318
+ },
1319
+ "context": {
1320
+ "$ref": "#/$defs/context"
1321
+ },
1322
+ "request": {
1323
+ "$ref": "#/$defs/facade_request"
1324
+ }
1325
+ }
1326
+ },
1327
+ {
1328
+ "type": "object",
1329
+ "additionalProperties": false,
1330
+ "required": [
1331
+ "phase",
1332
+ "context",
1333
+ "action"
1334
+ ],
1335
+ "properties": {
1336
+ "phase": {
1337
+ "enum": [
1338
+ "commit",
1339
+ "reject"
1340
+ ]
1341
+ },
1342
+ "context": {
1343
+ "$ref": "#/$defs/context"
1344
+ },
1345
+ "action": {
1346
+ "$ref": "#/$defs/prepared_action"
1347
+ }
1348
+ }
1349
+ }
1350
+ ]
1351
+ },
1352
+ "app_facade_response": {
1353
+ "oneOf": [
1354
+ {
1355
+ "type": "object",
1356
+ "additionalProperties": false,
1357
+ "required": [
1358
+ "type",
1359
+ "result"
1360
+ ],
1361
+ "properties": {
1362
+ "type": {
1363
+ "const": "result"
1364
+ },
1365
+ "result": {
1366
+ "type": "object",
1367
+ "additionalProperties": false,
1368
+ "required": [
1369
+ "value"
1370
+ ],
1371
+ "properties": {
1372
+ "value": true,
1373
+ "continuation": {
1374
+ "$ref": "#/$defs/prepared_action"
1375
+ },
1376
+ "context_invalidation": {
1377
+ "type": "object",
1378
+ "additionalProperties": false,
1379
+ "required": [
1380
+ "generation"
1381
+ ],
1382
+ "properties": {
1383
+ "generation": {
1384
+ "$ref": "#/$defs/context_generation"
1385
+ }
1386
+ }
1387
+ }
1388
+ }
1389
+ }
1390
+ }
1391
+ },
1392
+ {
1393
+ "type": "object",
1394
+ "additionalProperties": false,
1395
+ "required": [
1396
+ "type",
1397
+ "action"
1398
+ ],
1399
+ "properties": {
1400
+ "type": {
1401
+ "const": "prepared"
1402
+ },
1403
+ "action": {
1404
+ "$ref": "#/$defs/prepared_action"
1405
+ }
1406
+ }
1407
+ },
1408
+ {
1409
+ "type": "object",
1410
+ "additionalProperties": false,
1411
+ "required": [
1412
+ "type"
1413
+ ],
1414
+ "properties": {
1415
+ "type": {
1416
+ "const": "rejected"
1417
+ }
1418
+ }
1419
+ },
1420
+ {
1421
+ "type": "object",
1422
+ "additionalProperties": false,
1423
+ "required": [
1424
+ "type",
1425
+ "code",
1426
+ "message",
1427
+ "retry_after_ms"
1428
+ ],
1429
+ "properties": {
1430
+ "type": {
1431
+ "const": "failed"
1432
+ },
1433
+ "code": {
1434
+ "$ref": "#/$defs/identifier"
1435
+ },
1436
+ "message": {
1437
+ "type": "string"
1438
+ },
1439
+ "retry_after_ms": {
1440
+ "oneOf": [
1441
+ {
1442
+ "type": "integer",
1443
+ "minimum": 0
1444
+ },
1445
+ {
1446
+ "type": "null"
1447
+ }
1448
+ ]
1449
+ }
1450
+ }
1451
+ }
1452
+ ]
1453
+ },
1454
+ "command_response": {
1455
+ "oneOf": [
1456
+ {
1457
+ "type": "object",
1458
+ "additionalProperties": false,
1459
+ "required": [
1460
+ "type",
1461
+ "context",
1462
+ "disposition",
1463
+ "queue_revision"
1464
+ ],
1465
+ "properties": {
1466
+ "type": {
1467
+ "const": "accepted"
1468
+ },
1469
+ "context": {
1470
+ "$ref": "#/$defs/context"
1471
+ },
1472
+ "disposition": {
1473
+ "enum": [
1474
+ "queued",
1475
+ "interaction_ready",
1476
+ "cancel_requested"
1477
+ ]
1478
+ },
1479
+ "queue_revision": {
1480
+ "oneOf": [
1481
+ {
1482
+ "type": "integer",
1483
+ "minimum": 0
1484
+ },
1485
+ {
1486
+ "type": "null"
1487
+ }
1488
+ ]
1489
+ }
1490
+ }
1491
+ },
1492
+ {
1493
+ "type": "object",
1494
+ "additionalProperties": false,
1495
+ "required": [
1496
+ "type",
1497
+ "context",
1498
+ "code",
1499
+ "message"
1500
+ ],
1501
+ "properties": {
1502
+ "type": {
1503
+ "const": "rejected"
1504
+ },
1505
+ "context": {
1506
+ "$ref": "#/$defs/context"
1507
+ },
1508
+ "code": {
1509
+ "$ref": "#/$defs/identifier"
1510
+ },
1511
+ "message": {
1512
+ "type": "string"
1513
+ }
1514
+ }
1515
+ }
1516
+ ]
1517
+ },
1518
+ "event_ack": {
1519
+ "type": "object",
1520
+ "additionalProperties": false,
1521
+ "required": [
1522
+ "event_id",
1523
+ "checkpoint"
1524
+ ],
1525
+ "properties": {
1526
+ "event_id": {
1527
+ "$ref": "#/$defs/identifier"
1528
+ },
1529
+ "checkpoint": {
1530
+ "$ref": "#/$defs/checkpoint_reference"
1531
+ }
1532
+ }
1533
+ },
1534
+ "checkpoint_purge": {
1535
+ "type": "object",
1536
+ "additionalProperties": false,
1537
+ "required": [
1538
+ "purge_id",
1539
+ "conversation_key",
1540
+ "scope",
1541
+ "surface_id",
1542
+ "thread_id"
1543
+ ],
1544
+ "properties": {
1545
+ "purge_id": {
1546
+ "$ref": "#/$defs/identifier"
1547
+ },
1548
+ "conversation_key": {
1549
+ "$ref": "#/$defs/identifier"
1550
+ },
1551
+ "scope": {
1552
+ "$ref": "#/$defs/scope"
1553
+ },
1554
+ "surface_id": {
1555
+ "$ref": "#/$defs/conversation_surface"
1556
+ },
1557
+ "thread_id": {
1558
+ "$ref": "#/$defs/identifier"
1559
+ }
1560
+ }
1561
+ },
1562
+ "checkpoint_purge_ack": {
1563
+ "oneOf": [
1564
+ {
1565
+ "type": "object",
1566
+ "additionalProperties": false,
1567
+ "required": [
1568
+ "status",
1569
+ "purge_id",
1570
+ "conversation_key",
1571
+ "thread_id",
1572
+ "deleted_objects"
1573
+ ],
1574
+ "properties": {
1575
+ "status": {
1576
+ "const": "deleted"
1577
+ },
1578
+ "purge_id": {
1579
+ "$ref": "#/$defs/identifier"
1580
+ },
1581
+ "conversation_key": {
1582
+ "$ref": "#/$defs/identifier"
1583
+ },
1584
+ "thread_id": {
1585
+ "$ref": "#/$defs/identifier"
1586
+ },
1587
+ "deleted_objects": {
1588
+ "type": "integer",
1589
+ "minimum": 0
1590
+ }
1591
+ }
1592
+ },
1593
+ {
1594
+ "type": "object",
1595
+ "additionalProperties": false,
1596
+ "required": [
1597
+ "status",
1598
+ "purge_id",
1599
+ "conversation_key",
1600
+ "thread_id",
1601
+ "code",
1602
+ "message"
1603
+ ],
1604
+ "properties": {
1605
+ "status": {
1606
+ "const": "failed"
1607
+ },
1608
+ "purge_id": {
1609
+ "$ref": "#/$defs/identifier"
1610
+ },
1611
+ "conversation_key": {
1612
+ "$ref": "#/$defs/identifier"
1613
+ },
1614
+ "thread_id": {
1615
+ "$ref": "#/$defs/identifier"
1616
+ },
1617
+ "code": {
1618
+ "$ref": "#/$defs/identifier"
1619
+ },
1620
+ "message": {
1621
+ "type": "string"
1622
+ }
1623
+ }
1624
+ }
1625
+ ]
1626
+ },
1627
+ "payload": {
1628
+ "oneOf": [
1629
+ {
1630
+ "type": "object",
1631
+ "additionalProperties": false,
1632
+ "required": [
1633
+ "family",
1634
+ "payload"
1635
+ ],
1636
+ "properties": {
1637
+ "family": {
1638
+ "const": "command"
1639
+ },
1640
+ "payload": {
1641
+ "$ref": "#/$defs/command_request"
1642
+ }
1643
+ }
1644
+ },
1645
+ {
1646
+ "type": "object",
1647
+ "additionalProperties": false,
1648
+ "required": [
1649
+ "family",
1650
+ "payload"
1651
+ ],
1652
+ "properties": {
1653
+ "family": {
1654
+ "const": "command_response"
1655
+ },
1656
+ "payload": {
1657
+ "$ref": "#/$defs/command_response"
1658
+ }
1659
+ }
1660
+ },
1661
+ {
1662
+ "type": "object",
1663
+ "additionalProperties": false,
1664
+ "required": [
1665
+ "family",
1666
+ "payload"
1667
+ ],
1668
+ "properties": {
1669
+ "family": {
1670
+ "const": "event"
1671
+ },
1672
+ "payload": {
1673
+ "$ref": "#/$defs/event_message"
1674
+ }
1675
+ }
1676
+ },
1677
+ {
1678
+ "type": "object",
1679
+ "additionalProperties": false,
1680
+ "required": [
1681
+ "family",
1682
+ "payload"
1683
+ ],
1684
+ "properties": {
1685
+ "family": {
1686
+ "const": "event_ack"
1687
+ },
1688
+ "payload": {
1689
+ "$ref": "#/$defs/event_ack"
1690
+ }
1691
+ }
1692
+ },
1693
+ {
1694
+ "type": "object",
1695
+ "additionalProperties": false,
1696
+ "required": [
1697
+ "family",
1698
+ "payload"
1699
+ ],
1700
+ "properties": {
1701
+ "family": {
1702
+ "const": "checkpoint_purge"
1703
+ },
1704
+ "payload": {
1705
+ "$ref": "#/$defs/checkpoint_purge"
1706
+ }
1707
+ }
1708
+ },
1709
+ {
1710
+ "type": "object",
1711
+ "additionalProperties": false,
1712
+ "required": [
1713
+ "family",
1714
+ "payload"
1715
+ ],
1716
+ "properties": {
1717
+ "family": {
1718
+ "const": "checkpoint_purge_ack"
1719
+ },
1720
+ "payload": {
1721
+ "$ref": "#/$defs/checkpoint_purge_ack"
1722
+ }
1723
+ }
1724
+ },
1725
+ {
1726
+ "type": "object",
1727
+ "additionalProperties": false,
1728
+ "required": [
1729
+ "family",
1730
+ "payload"
1731
+ ],
1732
+ "properties": {
1733
+ "family": {
1734
+ "const": "observation"
1735
+ },
1736
+ "payload": {
1737
+ "$ref": "#/$defs/observation_message"
1738
+ }
1739
+ }
1740
+ },
1741
+ {
1742
+ "type": "object",
1743
+ "additionalProperties": false,
1744
+ "required": [
1745
+ "family",
1746
+ "payload"
1747
+ ],
1748
+ "properties": {
1749
+ "family": {
1750
+ "const": "execution_failure"
1751
+ },
1752
+ "payload": {
1753
+ "$ref": "#/$defs/execution_failure"
1754
+ }
1755
+ }
1756
+ },
1757
+ {
1758
+ "type": "object",
1759
+ "additionalProperties": false,
1760
+ "required": [
1761
+ "family",
1762
+ "payload"
1763
+ ],
1764
+ "properties": {
1765
+ "family": {
1766
+ "const": "app_facade_request"
1767
+ },
1768
+ "payload": {
1769
+ "$ref": "#/$defs/app_facade_request"
1770
+ }
1771
+ }
1772
+ },
1773
+ {
1774
+ "type": "object",
1775
+ "additionalProperties": false,
1776
+ "required": [
1777
+ "family",
1778
+ "payload"
1779
+ ],
1780
+ "properties": {
1781
+ "family": {
1782
+ "const": "app_facade_response"
1783
+ },
1784
+ "payload": {
1785
+ "$ref": "#/$defs/app_facade_response"
1786
+ }
1787
+ }
1788
+ }
1789
+ ]
1790
+ },
1791
+ "envelope": {
1792
+ "type": "object",
1793
+ "additionalProperties": false,
1794
+ "required": [
1795
+ "metadata",
1796
+ "payload"
1797
+ ],
1798
+ "properties": {
1799
+ "metadata": {
1800
+ "$ref": "#/$defs/metadata"
1801
+ },
1802
+ "payload": {
1803
+ "$ref": "#/$defs/payload"
1804
+ }
1805
+ }
1806
+ },
1807
+ "continuation": {
1808
+ "type": "object",
1809
+ "additionalProperties": false,
1810
+ "required": [
1811
+ "format",
1812
+ "compatibility_key",
1813
+ "payload"
1814
+ ],
1815
+ "properties": {
1816
+ "format": {
1817
+ "type": "string",
1818
+ "minLength": 1
1819
+ },
1820
+ "compatibility_key": {
1821
+ "type": "string",
1822
+ "minLength": 1
1823
+ },
1824
+ "payload": true
1825
+ }
1826
+ },
1827
+ "image": {
1828
+ "type": "object",
1829
+ "additionalProperties": false,
1830
+ "properties": {
1831
+ "url": {
1832
+ "type": "string"
1833
+ },
1834
+ "base64": {
1835
+ "type": "string"
1836
+ },
1837
+ "mimeType": {
1838
+ "type": "string"
1839
+ },
1840
+ "createdAt": {
1841
+ "type": "integer"
1842
+ }
1843
+ }
1844
+ }
1845
+ }
1846
+ }