@drisp/protocol 0.6.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,973 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/drisplabs/cli/main/packages/protocol/schema/canonical-frame.json",
4
+ "title": "canonical-frame",
5
+ "x-protocol-version": 1,
6
+ "oneOf": [
7
+ {
8
+ "type": "object",
9
+ "properties": {
10
+ "type": {
11
+ "type": "string",
12
+ "const": "hello"
13
+ },
14
+ "protocolVersion": {
15
+ "type": "integer",
16
+ "exclusiveMinimum": 0,
17
+ "maximum": 9007199254740991
18
+ },
19
+ "role": {
20
+ "type": "string",
21
+ "enum": ["runner", "hub"]
22
+ },
23
+ "instanceId": {
24
+ "type": "string"
25
+ },
26
+ "agent": {
27
+ "type": "object",
28
+ "properties": {
29
+ "name": {
30
+ "type": "string"
31
+ },
32
+ "version": {
33
+ "type": "string"
34
+ }
35
+ },
36
+ "required": ["name"],
37
+ "additionalProperties": false
38
+ },
39
+ "capabilities": {
40
+ "type": "array",
41
+ "items": {
42
+ "type": "string"
43
+ }
44
+ },
45
+ "workflows": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "object",
49
+ "properties": {
50
+ "name": {
51
+ "type": "string",
52
+ "minLength": 1
53
+ },
54
+ "version": {
55
+ "type": "string"
56
+ },
57
+ "source": {
58
+ "oneOf": [
59
+ {
60
+ "type": "object",
61
+ "properties": {
62
+ "kind": {
63
+ "type": "string",
64
+ "const": "builtin"
65
+ }
66
+ },
67
+ "required": ["kind"],
68
+ "additionalProperties": false
69
+ },
70
+ {
71
+ "type": "object",
72
+ "properties": {
73
+ "kind": {
74
+ "type": "string",
75
+ "const": "marketplace-remote"
76
+ },
77
+ "ref": {
78
+ "type": "string"
79
+ }
80
+ },
81
+ "required": ["kind", "ref"],
82
+ "additionalProperties": false
83
+ },
84
+ {
85
+ "type": "object",
86
+ "properties": {
87
+ "kind": {
88
+ "type": "string",
89
+ "const": "marketplace-local"
90
+ },
91
+ "repoDir": {
92
+ "type": "string"
93
+ },
94
+ "workflowName": {
95
+ "type": "string"
96
+ }
97
+ },
98
+ "required": ["kind", "repoDir", "workflowName"],
99
+ "additionalProperties": false
100
+ },
101
+ {
102
+ "type": "object",
103
+ "properties": {
104
+ "kind": {
105
+ "type": "string",
106
+ "const": "filesystem"
107
+ },
108
+ "path": {
109
+ "type": "string"
110
+ }
111
+ },
112
+ "required": ["kind", "path"],
113
+ "additionalProperties": false
114
+ },
115
+ {
116
+ "type": "object",
117
+ "properties": {
118
+ "kind": {
119
+ "type": "string",
120
+ "const": "unknown"
121
+ }
122
+ },
123
+ "required": ["kind"],
124
+ "additionalProperties": false
125
+ }
126
+ ]
127
+ }
128
+ },
129
+ "required": ["name", "source"],
130
+ "additionalProperties": false
131
+ }
132
+ }
133
+ },
134
+ "required": ["type", "protocolVersion"],
135
+ "additionalProperties": false
136
+ },
137
+ {
138
+ "type": "object",
139
+ "properties": {
140
+ "type": {
141
+ "type": "string",
142
+ "const": "run.start"
143
+ },
144
+ "runId": {
145
+ "type": "string"
146
+ },
147
+ "runSpec": {
148
+ "type": "object",
149
+ "properties": {
150
+ "prompt": {
151
+ "type": "string"
152
+ },
153
+ "athenaSessionId": {
154
+ "type": "string"
155
+ },
156
+ "adapterResumeSessionId": {
157
+ "type": "string"
158
+ },
159
+ "sessionId": {
160
+ "type": "string"
161
+ },
162
+ "projectDir": {
163
+ "type": "string"
164
+ },
165
+ "workflow": {
166
+ "type": "object",
167
+ "properties": {
168
+ "source": {
169
+ "type": "string"
170
+ },
171
+ "ref": {
172
+ "type": "string"
173
+ },
174
+ "version": {
175
+ "type": "string"
176
+ }
177
+ },
178
+ "additionalProperties": {}
179
+ },
180
+ "harness": {
181
+ "type": "string"
182
+ },
183
+ "env": {
184
+ "type": "object",
185
+ "propertyNames": {
186
+ "type": "string"
187
+ },
188
+ "additionalProperties": {
189
+ "type": "string"
190
+ }
191
+ },
192
+ "timeoutSec": {
193
+ "type": "number"
194
+ },
195
+ "callbackWsUrl": {
196
+ "type": "string"
197
+ },
198
+ "callbackToken": {
199
+ "type": "string"
200
+ }
201
+ },
202
+ "additionalProperties": {}
203
+ },
204
+ "runnerId": {
205
+ "type": "string"
206
+ }
207
+ },
208
+ "required": ["type", "runId"],
209
+ "additionalProperties": false
210
+ },
211
+ {
212
+ "type": "object",
213
+ "properties": {
214
+ "type": {
215
+ "type": "string",
216
+ "const": "answer"
217
+ },
218
+ "athenaSessionId": {
219
+ "type": "string"
220
+ },
221
+ "requestId": {
222
+ "type": "string"
223
+ },
224
+ "decision": {
225
+ "type": "object",
226
+ "properties": {
227
+ "type": {
228
+ "type": "string",
229
+ "enum": ["passthrough", "block", "json"]
230
+ },
231
+ "source": {
232
+ "type": "string",
233
+ "enum": ["user", "timeout", "rule"]
234
+ },
235
+ "intent": {
236
+ "oneOf": [
237
+ {
238
+ "type": "object",
239
+ "properties": {
240
+ "kind": {
241
+ "type": "string",
242
+ "const": "permission_allow"
243
+ }
244
+ },
245
+ "required": ["kind"],
246
+ "additionalProperties": false
247
+ },
248
+ {
249
+ "type": "object",
250
+ "properties": {
251
+ "kind": {
252
+ "type": "string",
253
+ "const": "permission_deny"
254
+ },
255
+ "reason": {
256
+ "type": "string"
257
+ }
258
+ },
259
+ "required": ["kind", "reason"],
260
+ "additionalProperties": false
261
+ },
262
+ {
263
+ "type": "object",
264
+ "properties": {
265
+ "kind": {
266
+ "type": "string",
267
+ "const": "question_answer"
268
+ },
269
+ "answers": {
270
+ "type": "object",
271
+ "propertyNames": {
272
+ "type": "string"
273
+ },
274
+ "additionalProperties": {
275
+ "type": "string"
276
+ }
277
+ }
278
+ },
279
+ "required": ["kind", "answers"],
280
+ "additionalProperties": false
281
+ },
282
+ {
283
+ "type": "object",
284
+ "properties": {
285
+ "kind": {
286
+ "type": "string",
287
+ "const": "pre_tool_allow"
288
+ }
289
+ },
290
+ "required": ["kind"],
291
+ "additionalProperties": false
292
+ },
293
+ {
294
+ "type": "object",
295
+ "properties": {
296
+ "kind": {
297
+ "type": "string",
298
+ "const": "pre_tool_deny"
299
+ },
300
+ "reason": {
301
+ "type": "string"
302
+ }
303
+ },
304
+ "required": ["kind", "reason"],
305
+ "additionalProperties": false
306
+ },
307
+ {
308
+ "type": "object",
309
+ "properties": {
310
+ "kind": {
311
+ "type": "string",
312
+ "const": "stop_block"
313
+ },
314
+ "reason": {
315
+ "type": "string"
316
+ }
317
+ },
318
+ "required": ["kind", "reason"],
319
+ "additionalProperties": false
320
+ },
321
+ {
322
+ "type": "object",
323
+ "properties": {
324
+ "kind": {
325
+ "type": "string",
326
+ "const": "compact_block"
327
+ },
328
+ "reason": {
329
+ "type": "string"
330
+ }
331
+ },
332
+ "required": ["kind", "reason"],
333
+ "additionalProperties": false
334
+ }
335
+ ]
336
+ },
337
+ "reason": {
338
+ "type": "string"
339
+ },
340
+ "data": {}
341
+ },
342
+ "required": ["type", "source"],
343
+ "additionalProperties": false
344
+ }
345
+ },
346
+ "required": ["type", "athenaSessionId", "requestId", "decision"],
347
+ "additionalProperties": false
348
+ },
349
+ {
350
+ "type": "object",
351
+ "properties": {
352
+ "type": {
353
+ "type": "string",
354
+ "const": "stop"
355
+ },
356
+ "runId": {
357
+ "type": "string"
358
+ },
359
+ "runnerId": {
360
+ "type": "string"
361
+ }
362
+ },
363
+ "required": ["type", "runId"],
364
+ "additionalProperties": false
365
+ },
366
+ {
367
+ "type": "object",
368
+ "properties": {
369
+ "type": {
370
+ "type": "string",
371
+ "const": "steer"
372
+ },
373
+ "runId": {
374
+ "type": "string"
375
+ },
376
+ "athenaSessionId": {
377
+ "type": "string"
378
+ },
379
+ "text": {
380
+ "type": "string",
381
+ "minLength": 1
382
+ }
383
+ },
384
+ "required": ["type", "runId", "text"],
385
+ "additionalProperties": false
386
+ },
387
+ {
388
+ "type": "object",
389
+ "properties": {
390
+ "type": {
391
+ "type": "string",
392
+ "const": "needs_human"
393
+ },
394
+ "runId": {
395
+ "type": "string"
396
+ },
397
+ "athenaSessionId": {
398
+ "type": "string"
399
+ },
400
+ "interruption": {
401
+ "oneOf": [
402
+ {
403
+ "type": "object",
404
+ "properties": {
405
+ "message": {
406
+ "type": "string"
407
+ },
408
+ "kind": {
409
+ "type": "string",
410
+ "const": "blocked"
411
+ },
412
+ "reason": {
413
+ "type": "string"
414
+ }
415
+ },
416
+ "required": ["message", "kind"],
417
+ "additionalProperties": false
418
+ },
419
+ {
420
+ "type": "object",
421
+ "properties": {
422
+ "message": {
423
+ "type": "string"
424
+ },
425
+ "kind": {
426
+ "type": "string",
427
+ "const": "question"
428
+ },
429
+ "requestId": {
430
+ "type": "string"
431
+ },
432
+ "question": {
433
+ "type": "string"
434
+ }
435
+ },
436
+ "required": ["message", "kind"],
437
+ "additionalProperties": false
438
+ },
439
+ {
440
+ "type": "object",
441
+ "properties": {
442
+ "message": {
443
+ "type": "string"
444
+ },
445
+ "kind": {
446
+ "type": "string",
447
+ "const": "hard_failure"
448
+ },
449
+ "code": {
450
+ "type": "string",
451
+ "enum": [
452
+ "auth",
453
+ "billing",
454
+ "invalid_request",
455
+ "model_not_found",
456
+ "unclassified"
457
+ ]
458
+ }
459
+ },
460
+ "required": ["message", "kind", "code"],
461
+ "additionalProperties": false
462
+ },
463
+ {
464
+ "type": "object",
465
+ "properties": {
466
+ "message": {
467
+ "type": "string"
468
+ },
469
+ "kind": {
470
+ "type": "string",
471
+ "const": "cap_exhausted"
472
+ },
473
+ "cap": {
474
+ "type": "string",
475
+ "enum": ["retry", "nudge", "iterations", "handover", "tokens"]
476
+ },
477
+ "limit": {
478
+ "type": "integer",
479
+ "exclusiveMinimum": 0,
480
+ "maximum": 9007199254740991
481
+ },
482
+ "resource": {
483
+ "type": "object",
484
+ "properties": {
485
+ "cause": {
486
+ "type": "string",
487
+ "enum": ["tokens", "iterations", "context", "restart"]
488
+ },
489
+ "limit": {
490
+ "type": "number",
491
+ "minimum": 0
492
+ },
493
+ "used": {
494
+ "type": "number",
495
+ "minimum": 0
496
+ },
497
+ "detail": {
498
+ "type": "string"
499
+ },
500
+ "checkpointPath": {
501
+ "type": "string"
502
+ },
503
+ "fresh": {
504
+ "type": "boolean"
505
+ }
506
+ },
507
+ "required": ["cause", "limit", "used", "fresh"],
508
+ "additionalProperties": false
509
+ }
510
+ },
511
+ "required": ["message", "kind", "cap"],
512
+ "additionalProperties": false
513
+ }
514
+ ]
515
+ }
516
+ },
517
+ "required": ["type", "runId", "interruption"],
518
+ "additionalProperties": false
519
+ },
520
+ {
521
+ "type": "object",
522
+ "properties": {
523
+ "type": {
524
+ "type": "string",
525
+ "const": "workflows.changed"
526
+ },
527
+ "workflows": {
528
+ "type": "array",
529
+ "items": {
530
+ "type": "object",
531
+ "properties": {
532
+ "name": {
533
+ "type": "string",
534
+ "minLength": 1
535
+ },
536
+ "version": {
537
+ "type": "string"
538
+ },
539
+ "source": {
540
+ "oneOf": [
541
+ {
542
+ "type": "object",
543
+ "properties": {
544
+ "kind": {
545
+ "type": "string",
546
+ "const": "builtin"
547
+ }
548
+ },
549
+ "required": ["kind"],
550
+ "additionalProperties": false
551
+ },
552
+ {
553
+ "type": "object",
554
+ "properties": {
555
+ "kind": {
556
+ "type": "string",
557
+ "const": "marketplace-remote"
558
+ },
559
+ "ref": {
560
+ "type": "string"
561
+ }
562
+ },
563
+ "required": ["kind", "ref"],
564
+ "additionalProperties": false
565
+ },
566
+ {
567
+ "type": "object",
568
+ "properties": {
569
+ "kind": {
570
+ "type": "string",
571
+ "const": "marketplace-local"
572
+ },
573
+ "repoDir": {
574
+ "type": "string"
575
+ },
576
+ "workflowName": {
577
+ "type": "string"
578
+ }
579
+ },
580
+ "required": ["kind", "repoDir", "workflowName"],
581
+ "additionalProperties": false
582
+ },
583
+ {
584
+ "type": "object",
585
+ "properties": {
586
+ "kind": {
587
+ "type": "string",
588
+ "const": "filesystem"
589
+ },
590
+ "path": {
591
+ "type": "string"
592
+ }
593
+ },
594
+ "required": ["kind", "path"],
595
+ "additionalProperties": false
596
+ },
597
+ {
598
+ "type": "object",
599
+ "properties": {
600
+ "kind": {
601
+ "type": "string",
602
+ "const": "unknown"
603
+ }
604
+ },
605
+ "required": ["kind"],
606
+ "additionalProperties": false
607
+ }
608
+ ]
609
+ }
610
+ },
611
+ "required": ["name", "source"],
612
+ "additionalProperties": false
613
+ }
614
+ }
615
+ },
616
+ "required": ["type", "workflows"],
617
+ "additionalProperties": false
618
+ },
619
+ {
620
+ "oneOf": [
621
+ {
622
+ "type": "object",
623
+ "properties": {
624
+ "type": {
625
+ "type": "string",
626
+ "const": "event"
627
+ },
628
+ "stream": {
629
+ "type": "string",
630
+ "const": "run"
631
+ },
632
+ "runId": {
633
+ "type": "string"
634
+ },
635
+ "seq": {
636
+ "type": "integer",
637
+ "minimum": 0,
638
+ "maximum": 9007199254740991
639
+ },
640
+ "ts": {
641
+ "type": "number"
642
+ },
643
+ "kind": {
644
+ "type": "string"
645
+ },
646
+ "payload": {}
647
+ },
648
+ "required": ["type", "stream", "runId", "seq", "ts", "kind"],
649
+ "additionalProperties": false
650
+ },
651
+ {
652
+ "type": "object",
653
+ "properties": {
654
+ "type": {
655
+ "type": "string",
656
+ "const": "event"
657
+ },
658
+ "stream": {
659
+ "type": "string",
660
+ "const": "feed"
661
+ },
662
+ "deliverySeq": {
663
+ "type": "integer",
664
+ "minimum": 0,
665
+ "maximum": 9007199254740991
666
+ },
667
+ "envelope": {
668
+ "type": "object",
669
+ "properties": {
670
+ "instanceId": {
671
+ "type": "string"
672
+ },
673
+ "athenaSessionId": {
674
+ "type": "string"
675
+ },
676
+ "runId": {
677
+ "type": "string"
678
+ },
679
+ "origin": {
680
+ "type": "string",
681
+ "enum": ["local", "dashboard"]
682
+ },
683
+ "eventId": {
684
+ "type": "string"
685
+ },
686
+ "feedSeq": {
687
+ "type": "integer",
688
+ "minimum": 0,
689
+ "maximum": 9007199254740991
690
+ },
691
+ "emittedAt": {
692
+ "type": "number"
693
+ },
694
+ "feedEvent": {
695
+ "type": "object",
696
+ "properties": {
697
+ "event_id": {
698
+ "type": "string"
699
+ },
700
+ "seq": {
701
+ "type": "integer",
702
+ "minimum": 0,
703
+ "maximum": 9007199254740991
704
+ },
705
+ "ts": {
706
+ "type": "number"
707
+ },
708
+ "session_id": {
709
+ "type": "string"
710
+ },
711
+ "run_id": {
712
+ "type": "string"
713
+ },
714
+ "prompt_id": {
715
+ "type": "string"
716
+ },
717
+ "effort_level": {
718
+ "type": "string"
719
+ },
720
+ "kind": {
721
+ "type": "string"
722
+ },
723
+ "level": {
724
+ "type": "string",
725
+ "enum": ["debug", "info", "warn", "error"]
726
+ },
727
+ "actor_id": {
728
+ "type": "string"
729
+ },
730
+ "cause": {
731
+ "type": "object",
732
+ "properties": {
733
+ "parent_event_id": {
734
+ "type": "string"
735
+ },
736
+ "hook_request_id": {
737
+ "type": "string"
738
+ },
739
+ "tool_use_id": {
740
+ "type": "string"
741
+ },
742
+ "transcript_path": {
743
+ "type": "string"
744
+ }
745
+ },
746
+ "additionalProperties": false
747
+ },
748
+ "title": {
749
+ "type": "string"
750
+ },
751
+ "body": {
752
+ "type": "string"
753
+ },
754
+ "ui": {
755
+ "type": "object",
756
+ "properties": {
757
+ "collapsed_default": {
758
+ "type": "boolean"
759
+ },
760
+ "pin": {
761
+ "type": "boolean"
762
+ },
763
+ "badge": {
764
+ "type": "string"
765
+ }
766
+ },
767
+ "additionalProperties": false
768
+ },
769
+ "display": {
770
+ "type": "object",
771
+ "properties": {
772
+ "title": {
773
+ "type": "string"
774
+ }
775
+ },
776
+ "additionalProperties": false
777
+ },
778
+ "data": {},
779
+ "raw": {}
780
+ },
781
+ "required": [
782
+ "event_id",
783
+ "seq",
784
+ "ts",
785
+ "session_id",
786
+ "run_id",
787
+ "kind",
788
+ "level",
789
+ "actor_id",
790
+ "title",
791
+ "data"
792
+ ],
793
+ "additionalProperties": {}
794
+ }
795
+ },
796
+ "required": [
797
+ "instanceId",
798
+ "athenaSessionId",
799
+ "runId",
800
+ "origin",
801
+ "eventId",
802
+ "feedSeq",
803
+ "emittedAt",
804
+ "feedEvent"
805
+ ],
806
+ "additionalProperties": false
807
+ }
808
+ },
809
+ "required": ["type", "stream", "deliverySeq", "envelope"],
810
+ "additionalProperties": false
811
+ }
812
+ ]
813
+ },
814
+ {
815
+ "type": "object",
816
+ "properties": {
817
+ "type": {
818
+ "type": "string",
819
+ "const": "ping"
820
+ },
821
+ "ts": {
822
+ "type": "number"
823
+ }
824
+ },
825
+ "required": ["type", "ts"],
826
+ "additionalProperties": false
827
+ },
828
+ {
829
+ "type": "object",
830
+ "properties": {
831
+ "type": {
832
+ "type": "string",
833
+ "const": "pong"
834
+ },
835
+ "ts": {
836
+ "type": "number"
837
+ }
838
+ },
839
+ "required": ["type", "ts"],
840
+ "additionalProperties": false
841
+ },
842
+ {
843
+ "type": "object",
844
+ "properties": {
845
+ "type": {
846
+ "type": "string",
847
+ "const": "assignment_accepted"
848
+ },
849
+ "runId": {
850
+ "type": "string"
851
+ }
852
+ },
853
+ "required": ["type", "runId"],
854
+ "additionalProperties": false
855
+ },
856
+ {
857
+ "type": "object",
858
+ "properties": {
859
+ "type": {
860
+ "type": "string",
861
+ "const": "assignment_rejected"
862
+ },
863
+ "runId": {
864
+ "type": "string"
865
+ },
866
+ "reason": {
867
+ "type": "string",
868
+ "enum": [
869
+ "local_capacity",
870
+ "duplicate",
871
+ "malformed_assignment",
872
+ "workspace_unresolved",
873
+ "workspace_invalid"
874
+ ]
875
+ },
876
+ "message": {
877
+ "type": "string"
878
+ }
879
+ },
880
+ "required": ["type", "runId", "reason"],
881
+ "additionalProperties": false
882
+ },
883
+ {
884
+ "type": "object",
885
+ "properties": {
886
+ "type": {
887
+ "type": "string",
888
+ "const": "decision_ack"
889
+ },
890
+ "athenaSessionId": {
891
+ "type": "string"
892
+ },
893
+ "requestId": {
894
+ "type": "string"
895
+ }
896
+ },
897
+ "required": ["type", "athenaSessionId", "requestId"],
898
+ "additionalProperties": false
899
+ },
900
+ {
901
+ "type": "object",
902
+ "properties": {
903
+ "type": {
904
+ "type": "string",
905
+ "const": "feed_ack"
906
+ },
907
+ "deliverySeq": {
908
+ "type": "integer",
909
+ "minimum": 0,
910
+ "maximum": 9007199254740991
911
+ },
912
+ "eventId": {
913
+ "type": "string"
914
+ }
915
+ },
916
+ "required": ["type"],
917
+ "additionalProperties": false
918
+ },
919
+ {
920
+ "type": "object",
921
+ "properties": {
922
+ "type": {
923
+ "type": "string",
924
+ "const": "attachments.changed"
925
+ },
926
+ "attachments": {
927
+ "type": "array",
928
+ "items": {
929
+ "type": "object",
930
+ "properties": {
931
+ "runnerId": {
932
+ "type": "string"
933
+ },
934
+ "name": {
935
+ "type": "string"
936
+ },
937
+ "slug": {
938
+ "type": "string"
939
+ },
940
+ "executionTarget": {
941
+ "type": "string"
942
+ },
943
+ "remoteInstanceId": {
944
+ "type": "string"
945
+ }
946
+ },
947
+ "required": ["runnerId"],
948
+ "additionalProperties": false
949
+ }
950
+ }
951
+ },
952
+ "required": ["type", "attachments"],
953
+ "additionalProperties": false
954
+ },
955
+ {
956
+ "type": "object",
957
+ "properties": {
958
+ "type": {
959
+ "type": "string",
960
+ "const": "error"
961
+ },
962
+ "code": {
963
+ "type": "string"
964
+ },
965
+ "message": {
966
+ "type": "string"
967
+ }
968
+ },
969
+ "required": ["type", "code"],
970
+ "additionalProperties": false
971
+ }
972
+ ]
973
+ }