@anhlp/alp-protocol 0.0.0-stage → 0.10.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,1054 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://alp.dev/schemas/ipc-v1.json",
4
+ "title": "ALP JSON-RPC v1 IPC",
5
+ "description": "UTF-8 newline delimited JSON. Additive properties are accepted for forward compatibility.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/request"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/response"
12
+ }
13
+ ],
14
+ "$defs": {
15
+ "error": {
16
+ "type": "object",
17
+ "properties": {
18
+ "code": {
19
+ "type": "integer"
20
+ },
21
+ "message": {
22
+ "type": "string"
23
+ },
24
+ "data": {}
25
+ },
26
+ "required": [
27
+ "code",
28
+ "message"
29
+ ],
30
+ "additionalProperties": true
31
+ },
32
+ "session": {
33
+ "type": "object",
34
+ "properties": {
35
+ "id": {
36
+ "type": "string"
37
+ },
38
+ "projectRoot": {
39
+ "type": "string"
40
+ },
41
+ "agent": {
42
+ "type": "string"
43
+ },
44
+ "runtime": {
45
+ "enum": [
46
+ "claude",
47
+ "codex",
48
+ "acp",
49
+ "antigravity"
50
+ ]
51
+ },
52
+ "model": {
53
+ "type": "string"
54
+ },
55
+ "mode": {
56
+ "type": "string"
57
+ },
58
+ "thinking": {
59
+ "type": "string"
60
+ },
61
+ "workflow": {
62
+ "type": "object",
63
+ "properties": {
64
+ "mode": {
65
+ "type": "string"
66
+ },
67
+ "maxPeers": {
68
+ "type": "integer"
69
+ },
70
+ "supervisor": {
71
+ "type": "boolean"
72
+ }
73
+ },
74
+ "required": [
75
+ "mode",
76
+ "maxPeers",
77
+ "supervisor"
78
+ ],
79
+ "additionalProperties": true
80
+ },
81
+ "threadId": {
82
+ "type": "string"
83
+ },
84
+ "persistent": {
85
+ "type": "boolean"
86
+ },
87
+ "busy": {
88
+ "type": "boolean"
89
+ },
90
+ "parentId": {
91
+ "type": "string"
92
+ },
93
+ "toolCallId": {
94
+ "type": "string"
95
+ },
96
+ "activeTurnId": {
97
+ "type": "string"
98
+ },
99
+ "parked": {
100
+ "type": "string"
101
+ },
102
+ "instructionsSha": {
103
+ "type": "string"
104
+ },
105
+ "teamLabel": {
106
+ "type": "string"
107
+ }
108
+ },
109
+ "required": [
110
+ "id",
111
+ "projectRoot",
112
+ "agent",
113
+ "runtime",
114
+ "model",
115
+ "mode",
116
+ "thinking",
117
+ "workflow",
118
+ "threadId",
119
+ "persistent",
120
+ "busy"
121
+ ],
122
+ "additionalProperties": true
123
+ },
124
+ "assignment": {
125
+ "type": "object",
126
+ "properties": {
127
+ "id": {
128
+ "type": "string"
129
+ },
130
+ "agent": {
131
+ "type": "string"
132
+ },
133
+ "mode": {
134
+ "type": "string"
135
+ },
136
+ "status": {
137
+ "type": "string"
138
+ },
139
+ "startedAt": {
140
+ "type": "string"
141
+ },
142
+ "worktree": {
143
+ "type": "object",
144
+ "properties": {
145
+ "branch": {
146
+ "type": "string"
147
+ },
148
+ "path": {
149
+ "type": "string"
150
+ }
151
+ },
152
+ "required": [
153
+ "branch",
154
+ "path"
155
+ ],
156
+ "additionalProperties": true
157
+ }
158
+ },
159
+ "required": [
160
+ "id",
161
+ "agent",
162
+ "mode",
163
+ "status",
164
+ "startedAt"
165
+ ],
166
+ "additionalProperties": true
167
+ },
168
+ "mail": {
169
+ "type": "object",
170
+ "properties": {
171
+ "id": {
172
+ "type": "string"
173
+ },
174
+ "kind": {
175
+ "enum": [
176
+ "question",
177
+ "answer",
178
+ "note",
179
+ "steer",
180
+ "result",
181
+ "stalled",
182
+ "board",
183
+ "checkin"
184
+ ]
185
+ },
186
+ "from": {
187
+ "type": "string"
188
+ },
189
+ "assignment": {
190
+ "type": "string"
191
+ },
192
+ "body": {
193
+ "type": "string"
194
+ },
195
+ "replyTo": {
196
+ "type": "string"
197
+ },
198
+ "result": {
199
+ "type": "object"
200
+ },
201
+ "redelivered": {
202
+ "type": "boolean"
203
+ }
204
+ },
205
+ "required": [
206
+ "id",
207
+ "kind",
208
+ "from",
209
+ "assignment"
210
+ ],
211
+ "additionalProperties": true
212
+ },
213
+ "pin": {
214
+ "type": "object",
215
+ "properties": {
216
+ "id": {
217
+ "type": "string"
218
+ },
219
+ "project": {
220
+ "type": "string"
221
+ },
222
+ "kind": {
223
+ "enum": [
224
+ "claim",
225
+ "decision",
226
+ "finding"
227
+ ]
228
+ },
229
+ "body": {
230
+ "type": "string"
231
+ },
232
+ "paths": {
233
+ "type": "array",
234
+ "items": {
235
+ "type": "string"
236
+ }
237
+ },
238
+ "agent": {
239
+ "type": "string"
240
+ },
241
+ "sessionId": {
242
+ "type": "string"
243
+ },
244
+ "rootId": {
245
+ "type": "string"
246
+ },
247
+ "at": {
248
+ "type": "string"
249
+ },
250
+ "released": {
251
+ "type": "string"
252
+ },
253
+ "task": {
254
+ "type": "string"
255
+ }
256
+ },
257
+ "required": [
258
+ "id",
259
+ "project",
260
+ "kind",
261
+ "body",
262
+ "agent",
263
+ "sessionId",
264
+ "rootId",
265
+ "at"
266
+ ],
267
+ "additionalProperties": true
268
+ },
269
+ "question": {
270
+ "type": "object",
271
+ "properties": {
272
+ "id": {
273
+ "type": "string"
274
+ },
275
+ "sessionId": {
276
+ "type": "string"
277
+ },
278
+ "rootId": {
279
+ "type": "string"
280
+ },
281
+ "agent": {
282
+ "type": "string"
283
+ },
284
+ "body": {
285
+ "type": "string"
286
+ },
287
+ "options": {
288
+ "type": "array",
289
+ "items": {
290
+ "type": "string"
291
+ }
292
+ },
293
+ "askedAt": {
294
+ "type": "string"
295
+ }
296
+ },
297
+ "required": [
298
+ "id",
299
+ "sessionId",
300
+ "rootId",
301
+ "agent",
302
+ "body",
303
+ "askedAt"
304
+ ],
305
+ "additionalProperties": true
306
+ },
307
+ "spec": {
308
+ "type": "object",
309
+ "properties": {
310
+ "cwd": {
311
+ "type": "string"
312
+ },
313
+ "agent": {
314
+ "type": "string"
315
+ },
316
+ "model": {
317
+ "type": "string"
318
+ },
319
+ "mode": {
320
+ "type": "string"
321
+ },
322
+ "thinking": {
323
+ "type": "string"
324
+ },
325
+ "persist": {
326
+ "type": "boolean"
327
+ },
328
+ "restore": {
329
+ "type": "object"
330
+ }
331
+ },
332
+ "required": [
333
+ "cwd"
334
+ ],
335
+ "additionalProperties": true
336
+ },
337
+ "item": {
338
+ "oneOf": [
339
+ {
340
+ "type": "object",
341
+ "properties": {
342
+ "kind": {
343
+ "const": "user_message"
344
+ },
345
+ "id": {
346
+ "type": "string"
347
+ },
348
+ "text": {
349
+ "type": "string"
350
+ },
351
+ "clientMessageId": {
352
+ "type": "string"
353
+ }
354
+ },
355
+ "required": [
356
+ "kind",
357
+ "id",
358
+ "text"
359
+ ],
360
+ "additionalProperties": true
361
+ },
362
+ {
363
+ "type": "object",
364
+ "properties": {
365
+ "kind": {
366
+ "const": "assistant_message"
367
+ },
368
+ "id": {
369
+ "type": "string"
370
+ },
371
+ "text": {
372
+ "type": "string"
373
+ }
374
+ },
375
+ "required": [
376
+ "kind",
377
+ "id",
378
+ "text"
379
+ ],
380
+ "additionalProperties": true
381
+ },
382
+ {
383
+ "type": "object",
384
+ "properties": {
385
+ "kind": {
386
+ "const": "notice"
387
+ },
388
+ "id": {
389
+ "type": "string"
390
+ },
391
+ "level": {
392
+ "enum": [
393
+ "info",
394
+ "warning",
395
+ "error"
396
+ ]
397
+ },
398
+ "text": {
399
+ "type": "string"
400
+ }
401
+ },
402
+ "required": [
403
+ "kind",
404
+ "id",
405
+ "level",
406
+ "text"
407
+ ],
408
+ "additionalProperties": true
409
+ },
410
+ {
411
+ "type": "object",
412
+ "properties": {
413
+ "kind": {
414
+ "const": "compaction"
415
+ },
416
+ "id": {
417
+ "type": "string"
418
+ },
419
+ "status": {
420
+ "enum": [
421
+ "running",
422
+ "completed",
423
+ "failed"
424
+ ]
425
+ },
426
+ "trigger": {
427
+ "type": "string"
428
+ },
429
+ "preTokens": {
430
+ "type": "integer"
431
+ },
432
+ "postTokens": {
433
+ "type": "integer"
434
+ }
435
+ },
436
+ "required": [
437
+ "kind",
438
+ "id",
439
+ "status"
440
+ ],
441
+ "additionalProperties": true
442
+ },
443
+ {
444
+ "type": "object",
445
+ "properties": {
446
+ "kind": {
447
+ "const": "todo"
448
+ },
449
+ "id": {
450
+ "type": "string"
451
+ },
452
+ "items": {
453
+ "type": "array",
454
+ "items": {
455
+ "type": "object",
456
+ "properties": {
457
+ "id": {
458
+ "type": "string"
459
+ },
460
+ "text": {
461
+ "type": "string"
462
+ },
463
+ "status": {
464
+ "enum": [
465
+ "pending",
466
+ "in_progress",
467
+ "completed"
468
+ ]
469
+ }
470
+ },
471
+ "required": [
472
+ "id",
473
+ "text",
474
+ "status"
475
+ ],
476
+ "additionalProperties": true
477
+ }
478
+ }
479
+ },
480
+ "required": [
481
+ "kind",
482
+ "id",
483
+ "items"
484
+ ],
485
+ "additionalProperties": true
486
+ },
487
+ {
488
+ "type": "object",
489
+ "properties": {
490
+ "kind": {
491
+ "const": "tool_call"
492
+ },
493
+ "id": {
494
+ "type": "string"
495
+ },
496
+ "callId": {
497
+ "type": "string"
498
+ },
499
+ "name": {
500
+ "type": "string"
501
+ },
502
+ "status": {
503
+ "enum": [
504
+ "running",
505
+ "completed",
506
+ "failed"
507
+ ]
508
+ },
509
+ "error": {
510
+ "type": "string"
511
+ },
512
+ "detail": {
513
+ "oneOf": [
514
+ {
515
+ "type": "object",
516
+ "properties": {
517
+ "type": {
518
+ "const": "shell"
519
+ },
520
+ "command": {
521
+ "type": "string"
522
+ },
523
+ "cwd": {
524
+ "type": "string"
525
+ },
526
+ "output": {
527
+ "type": "string"
528
+ },
529
+ "exitCode": {
530
+ "type": [
531
+ "integer",
532
+ "null"
533
+ ]
534
+ }
535
+ },
536
+ "required": [
537
+ "type",
538
+ "command",
539
+ "output"
540
+ ],
541
+ "additionalProperties": true
542
+ },
543
+ {
544
+ "type": "object",
545
+ "properties": {
546
+ "type": {
547
+ "const": "unknown"
548
+ },
549
+ "input": {},
550
+ "output": {}
551
+ },
552
+ "required": [
553
+ "type",
554
+ "input",
555
+ "output"
556
+ ],
557
+ "additionalProperties": true
558
+ }
559
+ ]
560
+ }
561
+ },
562
+ "required": [
563
+ "kind",
564
+ "id",
565
+ "callId",
566
+ "name",
567
+ "status",
568
+ "detail"
569
+ ],
570
+ "additionalProperties": true
571
+ }
572
+ ]
573
+ },
574
+ "event": {
575
+ "oneOf": [
576
+ {
577
+ "type": "object",
578
+ "properties": {
579
+ "type": {
580
+ "const": "session.opened"
581
+ },
582
+ "session": {
583
+ "$ref": "#/$defs/session"
584
+ },
585
+ "cwd": {
586
+ "type": "string"
587
+ },
588
+ "effective": {
589
+ "type": "object",
590
+ "properties": {
591
+ "model": {
592
+ "type": "string"
593
+ },
594
+ "thinking": {
595
+ "type": "string"
596
+ }
597
+ },
598
+ "required": [
599
+ "model",
600
+ "thinking"
601
+ ],
602
+ "additionalProperties": true
603
+ }
604
+ },
605
+ "required": [
606
+ "type",
607
+ "session",
608
+ "cwd",
609
+ "effective"
610
+ ],
611
+ "additionalProperties": true
612
+ },
613
+ {
614
+ "type": "object",
615
+ "properties": {
616
+ "type": {
617
+ "const": "session.ready"
618
+ }
619
+ },
620
+ "required": [
621
+ "type"
622
+ ],
623
+ "additionalProperties": true
624
+ },
625
+ {
626
+ "type": "object",
627
+ "properties": {
628
+ "type": {
629
+ "const": "session.updated"
630
+ },
631
+ "session": {
632
+ "$ref": "#/$defs/session"
633
+ }
634
+ },
635
+ "required": [
636
+ "type",
637
+ "session"
638
+ ],
639
+ "additionalProperties": true
640
+ },
641
+ {
642
+ "type": "object",
643
+ "properties": {
644
+ "type": {
645
+ "const": "session.closed"
646
+ }
647
+ },
648
+ "required": [
649
+ "type"
650
+ ],
651
+ "additionalProperties": true
652
+ },
653
+ {
654
+ "type": "object",
655
+ "properties": {
656
+ "type": {
657
+ "const": "session.failed"
658
+ },
659
+ "error": {
660
+ "type": "object",
661
+ "properties": {
662
+ "message": {
663
+ "type": "string"
664
+ }
665
+ },
666
+ "required": [
667
+ "message"
668
+ ],
669
+ "additionalProperties": true
670
+ }
671
+ },
672
+ "required": [
673
+ "type",
674
+ "error"
675
+ ],
676
+ "additionalProperties": true
677
+ },
678
+ {
679
+ "type": "object",
680
+ "properties": {
681
+ "type": {
682
+ "const": "prompt.accepted"
683
+ },
684
+ "clientMessageId": {
685
+ "type": "string"
686
+ },
687
+ "result": {
688
+ "enum": [
689
+ "turn",
690
+ "steer"
691
+ ]
692
+ },
693
+ "turnId": {
694
+ "type": "string"
695
+ }
696
+ },
697
+ "required": [
698
+ "type",
699
+ "clientMessageId",
700
+ "result",
701
+ "turnId"
702
+ ],
703
+ "additionalProperties": true
704
+ },
705
+ {
706
+ "type": "object",
707
+ "properties": {
708
+ "type": {
709
+ "const": "prompt.failed"
710
+ },
711
+ "clientMessageId": {
712
+ "type": "string"
713
+ },
714
+ "error": {
715
+ "type": "object",
716
+ "properties": {
717
+ "message": {
718
+ "type": "string"
719
+ }
720
+ },
721
+ "required": [
722
+ "message"
723
+ ],
724
+ "additionalProperties": true
725
+ }
726
+ },
727
+ "required": [
728
+ "type",
729
+ "clientMessageId",
730
+ "error"
731
+ ],
732
+ "additionalProperties": true
733
+ },
734
+ {
735
+ "type": "object",
736
+ "properties": {
737
+ "type": {
738
+ "const": "turn.started"
739
+ },
740
+ "turnId": {
741
+ "type": "string"
742
+ },
743
+ "origin": {
744
+ "enum": [
745
+ "user",
746
+ "wake",
747
+ "assignment",
748
+ "runtime"
749
+ ]
750
+ }
751
+ },
752
+ "required": [
753
+ "type",
754
+ "turnId",
755
+ "origin"
756
+ ],
757
+ "additionalProperties": true
758
+ },
759
+ {
760
+ "type": "object",
761
+ "properties": {
762
+ "type": {
763
+ "const": "turn.ended"
764
+ },
765
+ "turnId": {
766
+ "type": "string"
767
+ },
768
+ "state": {
769
+ "enum": [
770
+ "completed",
771
+ "failed",
772
+ "canceled"
773
+ ]
774
+ },
775
+ "error": {
776
+ "type": "object",
777
+ "properties": {
778
+ "message": {
779
+ "type": "string"
780
+ }
781
+ },
782
+ "required": [
783
+ "message"
784
+ ],
785
+ "additionalProperties": true
786
+ }
787
+ },
788
+ "required": [
789
+ "type",
790
+ "turnId",
791
+ "state"
792
+ ],
793
+ "additionalProperties": true
794
+ },
795
+ {
796
+ "type": "object",
797
+ "properties": {
798
+ "type": {
799
+ "const": "item"
800
+ },
801
+ "item": {
802
+ "$ref": "#/$defs/item"
803
+ }
804
+ },
805
+ "required": [
806
+ "type",
807
+ "item"
808
+ ],
809
+ "additionalProperties": true
810
+ },
811
+ {
812
+ "type": "object",
813
+ "properties": {
814
+ "type": {
815
+ "const": "mail"
816
+ },
817
+ "mail": {
818
+ "$ref": "#/$defs/mail"
819
+ }
820
+ },
821
+ "required": [
822
+ "type",
823
+ "mail"
824
+ ],
825
+ "additionalProperties": true
826
+ },
827
+ {
828
+ "type": "object",
829
+ "properties": {
830
+ "type": {
831
+ "const": "assignment"
832
+ },
833
+ "assignment": {
834
+ "$ref": "#/$defs/assignment"
835
+ }
836
+ },
837
+ "required": [
838
+ "type",
839
+ "assignment"
840
+ ],
841
+ "additionalProperties": true
842
+ },
843
+ {
844
+ "type": "object",
845
+ "properties": {
846
+ "type": {
847
+ "const": "question"
848
+ },
849
+ "question": {
850
+ "$ref": "#/$defs/question"
851
+ }
852
+ },
853
+ "required": [
854
+ "type",
855
+ "question"
856
+ ],
857
+ "additionalProperties": true
858
+ },
859
+ {
860
+ "type": "object",
861
+ "properties": {
862
+ "type": {
863
+ "const": "question.resolved"
864
+ },
865
+ "questionId": {
866
+ "type": "string"
867
+ },
868
+ "outcome": {
869
+ "enum": [
870
+ "answered",
871
+ "dismissed",
872
+ "timeout",
873
+ "canceled"
874
+ ]
875
+ },
876
+ "answer": {
877
+ "type": "string"
878
+ }
879
+ },
880
+ "required": [
881
+ "type",
882
+ "questionId",
883
+ "outcome"
884
+ ],
885
+ "additionalProperties": true
886
+ },
887
+ {
888
+ "type": "object",
889
+ "properties": {
890
+ "type": {
891
+ "const": "pin"
892
+ },
893
+ "pin": {
894
+ "$ref": "#/$defs/pin"
895
+ }
896
+ },
897
+ "required": [
898
+ "type",
899
+ "pin"
900
+ ],
901
+ "additionalProperties": true
902
+ },
903
+ {
904
+ "type": "object",
905
+ "properties": {
906
+ "type": {
907
+ "const": "unpin"
908
+ },
909
+ "pinId": {
910
+ "type": "string"
911
+ },
912
+ "reason": {
913
+ "enum": [
914
+ "unpinned",
915
+ "session_ended"
916
+ ]
917
+ }
918
+ },
919
+ "required": [
920
+ "type",
921
+ "pinId",
922
+ "reason"
923
+ ],
924
+ "additionalProperties": true
925
+ }
926
+ ]
927
+ },
928
+ "envelope": {
929
+ "type": "object",
930
+ "properties": {
931
+ "sessionId": {
932
+ "type": "string"
933
+ },
934
+ "epoch": {
935
+ "type": "string"
936
+ },
937
+ "seq": {
938
+ "type": "integer",
939
+ "minimum": 0
940
+ },
941
+ "ts": {
942
+ "type": "string"
943
+ },
944
+ "event": {
945
+ "$ref": "#/$defs/event"
946
+ }
947
+ },
948
+ "required": [
949
+ "sessionId",
950
+ "epoch",
951
+ "seq",
952
+ "ts",
953
+ "event"
954
+ ],
955
+ "additionalProperties": true
956
+ },
957
+ "request": {
958
+ "type": "object",
959
+ "properties": {
960
+ "jsonrpc": {
961
+ "const": "2.0"
962
+ },
963
+ "id": {
964
+ "type": [
965
+ "string",
966
+ "integer",
967
+ "null"
968
+ ]
969
+ },
970
+ "method": {
971
+ "type": "string"
972
+ },
973
+ "params": {
974
+ "type": "object"
975
+ }
976
+ },
977
+ "required": [
978
+ "jsonrpc",
979
+ "method"
980
+ ],
981
+ "additionalProperties": true
982
+ },
983
+ "response": {
984
+ "oneOf": [
985
+ {
986
+ "type": "object",
987
+ "properties": {
988
+ "jsonrpc": {
989
+ "const": "2.0"
990
+ },
991
+ "id": {
992
+ "type": [
993
+ "string",
994
+ "integer",
995
+ "null"
996
+ ]
997
+ },
998
+ "result": {}
999
+ },
1000
+ "required": [
1001
+ "jsonrpc",
1002
+ "id",
1003
+ "result"
1004
+ ],
1005
+ "additionalProperties": true
1006
+ },
1007
+ {
1008
+ "type": "object",
1009
+ "properties": {
1010
+ "jsonrpc": {
1011
+ "const": "2.0"
1012
+ },
1013
+ "id": {
1014
+ "type": [
1015
+ "string",
1016
+ "integer",
1017
+ "null"
1018
+ ]
1019
+ },
1020
+ "error": {
1021
+ "$ref": "#/$defs/error"
1022
+ }
1023
+ },
1024
+ "required": [
1025
+ "jsonrpc",
1026
+ "id",
1027
+ "error"
1028
+ ],
1029
+ "additionalProperties": true
1030
+ }
1031
+ ]
1032
+ },
1033
+ "notification": {
1034
+ "type": "object",
1035
+ "properties": {
1036
+ "jsonrpc": {
1037
+ "const": "2.0"
1038
+ },
1039
+ "method": {
1040
+ "const": "event"
1041
+ },
1042
+ "params": {
1043
+ "$ref": "#/$defs/envelope"
1044
+ }
1045
+ },
1046
+ "required": [
1047
+ "jsonrpc",
1048
+ "method",
1049
+ "params"
1050
+ ],
1051
+ "additionalProperties": true
1052
+ }
1053
+ }
1054
+ }