@anhlp/alp-protocol 0.0.0-stage → 0.0.1-beta.4

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.
Files changed (47) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +7 -0
  3. package/README.md +16 -2
  4. package/conformance/cases.json +951 -0
  5. package/conformance/run.d.mts +32 -0
  6. package/conformance/run.mjs +403 -0
  7. package/dist/connection.d.ts +13 -0
  8. package/dist/connection.js +0 -0
  9. package/dist/contract-v1.d.ts +8783 -0
  10. package/dist/contract-v1.js +5 -0
  11. package/dist/contract.d.ts +25 -0
  12. package/dist/contract.js +28 -0
  13. package/dist/dto.d.ts +104 -0
  14. package/dist/dto.js +0 -0
  15. package/dist/events.d.ts +354 -0
  16. package/dist/events.js +0 -0
  17. package/dist/index.d.ts +7 -0
  18. package/dist/index.js +2 -0
  19. package/dist/public.d.ts +1 -0
  20. package/dist/public.js +2 -0
  21. package/dist/rpc.d.ts +1210 -0
  22. package/dist/rpc.js +0 -0
  23. package/dist/schedule.d.ts +43 -0
  24. package/dist/schedule.js +0 -0
  25. package/dist/session.d.ts +285 -0
  26. package/dist/session.js +0 -0
  27. package/dist/validate.d.ts +12 -0
  28. package/dist/validate.js +151 -0
  29. package/dist/wire.d.ts +192 -0
  30. package/dist/wire.js +137 -0
  31. package/fixtures/ipc-v1.jsonl +4 -0
  32. package/fixtures/v1/cases.json +7166 -0
  33. package/package.json +127 -4
  34. package/schema/ipc-v1.json +3271 -0
  35. package/schema/methods-v1.json +8678 -0
  36. package/src/connection.ts +13 -0
  37. package/src/contract-v1.js +2 -0
  38. package/src/contract.js +44 -0
  39. package/src/dto.ts +78 -0
  40. package/src/events.ts +207 -0
  41. package/src/index.ts +7 -0
  42. package/src/public.js +2 -0
  43. package/src/rpc.ts +272 -0
  44. package/src/schedule.ts +43 -0
  45. package/src/session.ts +213 -0
  46. package/src/validate.js +115 -0
  47. package/src/wire.js +213 -0
@@ -0,0 +1,3271 @@
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": "Messages of ALP JSON-RPC protocol v1 (docs/protocol/alp-json-rpc-v1.md). One JSON value per frame; unknown properties, event types and item kinds are accepted for forward compatibility.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/request"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/response"
12
+ },
13
+ {
14
+ "$ref": "#/$defs/notification"
15
+ }
16
+ ],
17
+ "$defs": {
18
+ "error": {
19
+ "type": "object",
20
+ "properties": {
21
+ "code": {
22
+ "type": "integer"
23
+ },
24
+ "message": {
25
+ "type": "string"
26
+ },
27
+ "data": {}
28
+ },
29
+ "required": [
30
+ "code",
31
+ "message"
32
+ ],
33
+ "additionalProperties": true
34
+ },
35
+ "session": {
36
+ "type": "object",
37
+ "properties": {
38
+ "id": {
39
+ "type": "string"
40
+ },
41
+ "projectRoot": {
42
+ "type": "string"
43
+ },
44
+ "agent": {
45
+ "type": "string"
46
+ },
47
+ "runtime": {
48
+ "enum": [
49
+ "claude",
50
+ "codex",
51
+ "acp",
52
+ "antigravity"
53
+ ]
54
+ },
55
+ "model": {
56
+ "type": "string"
57
+ },
58
+ "mode": {
59
+ "type": "string"
60
+ },
61
+ "thinking": {
62
+ "type": "string"
63
+ },
64
+ "workflow": {
65
+ "type": "object",
66
+ "properties": {
67
+ "mode": {
68
+ "type": "string"
69
+ },
70
+ "maxPeers": {
71
+ "type": "integer"
72
+ },
73
+ "supervisor": {
74
+ "type": "boolean"
75
+ }
76
+ },
77
+ "required": [
78
+ "mode",
79
+ "maxPeers",
80
+ "supervisor"
81
+ ],
82
+ "additionalProperties": true
83
+ },
84
+ "threadId": {
85
+ "type": "string"
86
+ },
87
+ "persistent": {
88
+ "type": "boolean"
89
+ },
90
+ "busy": {
91
+ "type": "boolean"
92
+ },
93
+ "parentId": {
94
+ "type": "string"
95
+ },
96
+ "toolCallId": {
97
+ "type": "string"
98
+ },
99
+ "activeTurnId": {
100
+ "type": "string"
101
+ },
102
+ "parked": {
103
+ "type": "string"
104
+ },
105
+ "instructionsSha": {
106
+ "type": "string"
107
+ },
108
+ "teamLabel": {
109
+ "type": "string"
110
+ },
111
+ "promptImages": {
112
+ "type": "boolean"
113
+ },
114
+ "promptAttachments": {
115
+ "type": "array",
116
+ "minItems": 1,
117
+ "uniqueItems": true,
118
+ "items": {
119
+ "enum": [
120
+ "file.path",
121
+ "document.native",
122
+ "text.extract"
123
+ ]
124
+ }
125
+ },
126
+ "usage": {
127
+ "$ref": "#/$defs/usage"
128
+ }
129
+ },
130
+ "required": [
131
+ "id",
132
+ "projectRoot",
133
+ "agent",
134
+ "runtime",
135
+ "model",
136
+ "mode",
137
+ "thinking",
138
+ "workflow",
139
+ "threadId",
140
+ "persistent",
141
+ "busy"
142
+ ],
143
+ "additionalProperties": true
144
+ },
145
+ "usage": {
146
+ "type": "object",
147
+ "properties": {
148
+ "contextWindowUsedTokens": {
149
+ "type": "integer",
150
+ "minimum": 0
151
+ },
152
+ "contextWindowMaxTokens": {
153
+ "type": "integer",
154
+ "minimum": 1
155
+ },
156
+ "inputTokens": {
157
+ "type": "integer",
158
+ "minimum": 0
159
+ },
160
+ "cachedInputTokens": {
161
+ "type": "integer",
162
+ "minimum": 0
163
+ },
164
+ "outputTokens": {
165
+ "type": "integer",
166
+ "minimum": 0
167
+ },
168
+ "totalCostUsd": {
169
+ "type": "number",
170
+ "minimum": 0
171
+ }
172
+ },
173
+ "additionalProperties": true
174
+ },
175
+ "assignment": {
176
+ "type": "object",
177
+ "properties": {
178
+ "id": {
179
+ "type": "string"
180
+ },
181
+ "agent": {
182
+ "type": "string"
183
+ },
184
+ "mode": {
185
+ "type": "string"
186
+ },
187
+ "status": {
188
+ "type": "string"
189
+ },
190
+ "startedAt": {
191
+ "type": "string"
192
+ },
193
+ "worktree": {
194
+ "type": "object",
195
+ "properties": {
196
+ "branch": {
197
+ "type": "string"
198
+ },
199
+ "path": {
200
+ "type": "string"
201
+ }
202
+ },
203
+ "required": [
204
+ "branch",
205
+ "path"
206
+ ],
207
+ "additionalProperties": true
208
+ }
209
+ },
210
+ "required": [
211
+ "id",
212
+ "agent",
213
+ "mode",
214
+ "status",
215
+ "startedAt"
216
+ ],
217
+ "additionalProperties": true
218
+ },
219
+ "mail": {
220
+ "type": "object",
221
+ "properties": {
222
+ "id": {
223
+ "type": "string"
224
+ },
225
+ "kind": {
226
+ "enum": [
227
+ "question",
228
+ "answer",
229
+ "note",
230
+ "steer",
231
+ "result",
232
+ "stalled",
233
+ "board",
234
+ "checkin"
235
+ ]
236
+ },
237
+ "from": {
238
+ "type": "string"
239
+ },
240
+ "assignment": {
241
+ "type": "string"
242
+ },
243
+ "body": {
244
+ "type": "string"
245
+ },
246
+ "replyTo": {
247
+ "type": "string"
248
+ },
249
+ "result": {
250
+ "type": "object"
251
+ },
252
+ "redelivered": {
253
+ "type": "boolean"
254
+ }
255
+ },
256
+ "required": [
257
+ "id",
258
+ "kind",
259
+ "from",
260
+ "assignment"
261
+ ],
262
+ "additionalProperties": true
263
+ },
264
+ "pin": {
265
+ "type": "object",
266
+ "properties": {
267
+ "id": {
268
+ "type": "string"
269
+ },
270
+ "project": {
271
+ "type": "string"
272
+ },
273
+ "kind": {
274
+ "enum": [
275
+ "claim",
276
+ "decision",
277
+ "finding"
278
+ ]
279
+ },
280
+ "body": {
281
+ "type": "string"
282
+ },
283
+ "paths": {
284
+ "type": "array",
285
+ "items": {
286
+ "type": "string"
287
+ }
288
+ },
289
+ "agent": {
290
+ "type": "string"
291
+ },
292
+ "sessionId": {
293
+ "type": "string"
294
+ },
295
+ "rootId": {
296
+ "type": "string"
297
+ },
298
+ "at": {
299
+ "type": "string"
300
+ },
301
+ "released": {
302
+ "type": "string"
303
+ },
304
+ "task": {
305
+ "type": "string"
306
+ }
307
+ },
308
+ "required": [
309
+ "id",
310
+ "project",
311
+ "kind",
312
+ "body",
313
+ "agent",
314
+ "sessionId",
315
+ "rootId",
316
+ "at"
317
+ ],
318
+ "additionalProperties": true
319
+ },
320
+ "question": {
321
+ "type": "object",
322
+ "properties": {
323
+ "id": {
324
+ "type": "string"
325
+ },
326
+ "sessionId": {
327
+ "type": "string"
328
+ },
329
+ "rootId": {
330
+ "type": "string"
331
+ },
332
+ "agent": {
333
+ "type": "string"
334
+ },
335
+ "body": {
336
+ "type": "string"
337
+ },
338
+ "options": {
339
+ "type": "array",
340
+ "items": {
341
+ "type": "string"
342
+ }
343
+ },
344
+ "askedAt": {
345
+ "type": "string"
346
+ }
347
+ },
348
+ "required": [
349
+ "id",
350
+ "sessionId",
351
+ "rootId",
352
+ "agent",
353
+ "body",
354
+ "askedAt"
355
+ ],
356
+ "additionalProperties": true
357
+ },
358
+ "attention": {
359
+ "type": "object",
360
+ "properties": {
361
+ "reason": {
362
+ "enum": [
363
+ "finished",
364
+ "error"
365
+ ]
366
+ },
367
+ "at": {
368
+ "type": "string"
369
+ },
370
+ "turnId": {
371
+ "type": "string"
372
+ },
373
+ "message": {
374
+ "type": "string"
375
+ }
376
+ },
377
+ "required": [
378
+ "reason",
379
+ "at"
380
+ ],
381
+ "additionalProperties": true
382
+ },
383
+ "spec": {
384
+ "type": "object",
385
+ "properties": {
386
+ "cwd": {
387
+ "type": "string"
388
+ },
389
+ "agent": {
390
+ "type": "string"
391
+ },
392
+ "model": {
393
+ "type": "string"
394
+ },
395
+ "mode": {
396
+ "type": "string"
397
+ },
398
+ "thinking": {
399
+ "type": "string"
400
+ },
401
+ "persist": {
402
+ "type": "boolean"
403
+ },
404
+ "restore": {
405
+ "type": "object"
406
+ }
407
+ },
408
+ "required": [
409
+ "cwd"
410
+ ],
411
+ "additionalProperties": true
412
+ },
413
+ "item": {
414
+ "anyOf": [
415
+ {
416
+ "$ref": "#/$defs/knownItem"
417
+ },
418
+ {
419
+ "$ref": "#/$defs/unknownItem"
420
+ }
421
+ ]
422
+ },
423
+ "event": {
424
+ "anyOf": [
425
+ {
426
+ "$ref": "#/$defs/knownEvent"
427
+ },
428
+ {
429
+ "$ref": "#/$defs/unknownEvent"
430
+ }
431
+ ]
432
+ },
433
+ "envelope": {
434
+ "type": "object",
435
+ "properties": {
436
+ "sessionId": {
437
+ "type": "string"
438
+ },
439
+ "epoch": {
440
+ "type": "string"
441
+ },
442
+ "seq": {
443
+ "type": "integer",
444
+ "minimum": 0,
445
+ "maximum": 9007199254740991
446
+ },
447
+ "ts": {
448
+ "type": "string"
449
+ },
450
+ "event": {
451
+ "$ref": "#/$defs/event"
452
+ },
453
+ "cursor": {
454
+ "type": "integer",
455
+ "minimum": 1,
456
+ "maximum": 9007199254740991
457
+ }
458
+ },
459
+ "required": [
460
+ "sessionId",
461
+ "epoch",
462
+ "seq",
463
+ "ts",
464
+ "event"
465
+ ],
466
+ "additionalProperties": true
467
+ },
468
+ "request": {
469
+ "type": "object",
470
+ "properties": {
471
+ "jsonrpc": {
472
+ "const": "2.0"
473
+ },
474
+ "id": {
475
+ "anyOf": [
476
+ {
477
+ "type": "string",
478
+ "maxLength": 128
479
+ },
480
+ {
481
+ "type": "integer",
482
+ "minimum": -9007199254740991,
483
+ "maximum": 9007199254740991
484
+ }
485
+ ]
486
+ },
487
+ "method": {
488
+ "type": "string"
489
+ },
490
+ "params": {
491
+ "type": "object"
492
+ }
493
+ },
494
+ "required": [
495
+ "jsonrpc",
496
+ "method",
497
+ "id"
498
+ ],
499
+ "additionalProperties": true
500
+ },
501
+ "response": {
502
+ "oneOf": [
503
+ {
504
+ "type": "object",
505
+ "properties": {
506
+ "jsonrpc": {
507
+ "const": "2.0"
508
+ },
509
+ "id": {
510
+ "anyOf": [
511
+ {
512
+ "type": "string",
513
+ "maxLength": 128
514
+ },
515
+ {
516
+ "type": "integer",
517
+ "minimum": -9007199254740991,
518
+ "maximum": 9007199254740991
519
+ },
520
+ {
521
+ "type": "null"
522
+ }
523
+ ]
524
+ },
525
+ "result": {}
526
+ },
527
+ "required": [
528
+ "jsonrpc",
529
+ "id",
530
+ "result"
531
+ ],
532
+ "additionalProperties": true
533
+ },
534
+ {
535
+ "type": "object",
536
+ "properties": {
537
+ "jsonrpc": {
538
+ "const": "2.0"
539
+ },
540
+ "id": {
541
+ "anyOf": [
542
+ {
543
+ "type": "string",
544
+ "maxLength": 128
545
+ },
546
+ {
547
+ "type": "integer",
548
+ "minimum": -9007199254740991,
549
+ "maximum": 9007199254740991
550
+ },
551
+ {
552
+ "type": "null"
553
+ }
554
+ ]
555
+ },
556
+ "error": {
557
+ "$ref": "#/$defs/error"
558
+ }
559
+ },
560
+ "required": [
561
+ "jsonrpc",
562
+ "id",
563
+ "error"
564
+ ],
565
+ "additionalProperties": true
566
+ }
567
+ ]
568
+ },
569
+ "notification": {
570
+ "oneOf": [
571
+ {
572
+ "type": "object",
573
+ "properties": {
574
+ "jsonrpc": {
575
+ "const": "2.0"
576
+ },
577
+ "method": {
578
+ "const": "event"
579
+ },
580
+ "params": {
581
+ "$ref": "#/$defs/envelope"
582
+ }
583
+ },
584
+ "required": [
585
+ "jsonrpc",
586
+ "method",
587
+ "params"
588
+ ],
589
+ "additionalProperties": true
590
+ },
591
+ {
592
+ "type": "object",
593
+ "description": "A terminal's output, exit or detach (capability terminal, §12.10).",
594
+ "properties": {
595
+ "jsonrpc": {
596
+ "const": "2.0"
597
+ },
598
+ "method": {
599
+ "const": "terminal.event"
600
+ },
601
+ "params": {
602
+ "$ref": "#/$defs/terminalEvent"
603
+ }
604
+ },
605
+ "required": [
606
+ "jsonrpc",
607
+ "method",
608
+ "params"
609
+ ],
610
+ "additionalProperties": true
611
+ }
612
+ ]
613
+ },
614
+ "knownEvent": {
615
+ "oneOf": [
616
+ {
617
+ "type": "object",
618
+ "properties": {
619
+ "type": {
620
+ "const": "session.opened"
621
+ },
622
+ "session": {
623
+ "$ref": "#/$defs/session"
624
+ },
625
+ "cwd": {
626
+ "type": "string"
627
+ },
628
+ "effective": {
629
+ "type": "object",
630
+ "properties": {
631
+ "model": {
632
+ "type": "string"
633
+ },
634
+ "thinking": {
635
+ "type": "string"
636
+ }
637
+ },
638
+ "required": [
639
+ "model",
640
+ "thinking"
641
+ ],
642
+ "additionalProperties": true
643
+ }
644
+ },
645
+ "required": [
646
+ "type",
647
+ "session",
648
+ "cwd",
649
+ "effective"
650
+ ],
651
+ "additionalProperties": true
652
+ },
653
+ {
654
+ "type": "object",
655
+ "properties": {
656
+ "type": {
657
+ "const": "session.ready"
658
+ }
659
+ },
660
+ "required": [
661
+ "type"
662
+ ],
663
+ "additionalProperties": true
664
+ },
665
+ {
666
+ "type": "object",
667
+ "properties": {
668
+ "type": {
669
+ "const": "session.updated"
670
+ },
671
+ "session": {
672
+ "$ref": "#/$defs/session"
673
+ }
674
+ },
675
+ "required": [
676
+ "type",
677
+ "session"
678
+ ],
679
+ "additionalProperties": true
680
+ },
681
+ {
682
+ "type": "object",
683
+ "properties": {
684
+ "type": {
685
+ "const": "session.closed"
686
+ }
687
+ },
688
+ "required": [
689
+ "type"
690
+ ],
691
+ "additionalProperties": true
692
+ },
693
+ {
694
+ "type": "object",
695
+ "properties": {
696
+ "type": {
697
+ "const": "session.failed"
698
+ },
699
+ "error": {
700
+ "$ref": "#/$defs/alpError"
701
+ }
702
+ },
703
+ "required": [
704
+ "type",
705
+ "error"
706
+ ],
707
+ "additionalProperties": true
708
+ },
709
+ {
710
+ "type": "object",
711
+ "properties": {
712
+ "type": {
713
+ "const": "prompt.accepted"
714
+ },
715
+ "clientMessageId": {
716
+ "type": "string"
717
+ },
718
+ "result": {
719
+ "enum": [
720
+ "turn",
721
+ "steer"
722
+ ]
723
+ },
724
+ "turnId": {
725
+ "type": "string"
726
+ }
727
+ },
728
+ "required": [
729
+ "type",
730
+ "clientMessageId",
731
+ "result",
732
+ "turnId"
733
+ ],
734
+ "additionalProperties": true
735
+ },
736
+ {
737
+ "type": "object",
738
+ "properties": {
739
+ "type": {
740
+ "const": "prompt.failed"
741
+ },
742
+ "clientMessageId": {
743
+ "type": "string"
744
+ },
745
+ "error": {
746
+ "$ref": "#/$defs/alpError"
747
+ }
748
+ },
749
+ "required": [
750
+ "type",
751
+ "clientMessageId",
752
+ "error"
753
+ ],
754
+ "additionalProperties": true
755
+ },
756
+ {
757
+ "type": "object",
758
+ "properties": {
759
+ "type": {
760
+ "const": "turn.started"
761
+ },
762
+ "turnId": {
763
+ "type": "string"
764
+ },
765
+ "origin": {
766
+ "enum": [
767
+ "user",
768
+ "wake",
769
+ "assignment",
770
+ "runtime"
771
+ ]
772
+ }
773
+ },
774
+ "required": [
775
+ "type",
776
+ "turnId",
777
+ "origin"
778
+ ],
779
+ "additionalProperties": true
780
+ },
781
+ {
782
+ "type": "object",
783
+ "properties": {
784
+ "type": {
785
+ "const": "turn.ended"
786
+ },
787
+ "turnId": {
788
+ "type": "string"
789
+ },
790
+ "state": {
791
+ "enum": [
792
+ "completed",
793
+ "failed",
794
+ "canceled"
795
+ ]
796
+ },
797
+ "error": {
798
+ "$ref": "#/$defs/alpError"
799
+ }
800
+ },
801
+ "required": [
802
+ "type",
803
+ "turnId",
804
+ "state"
805
+ ],
806
+ "additionalProperties": true
807
+ },
808
+ {
809
+ "type": "object",
810
+ "properties": {
811
+ "type": {
812
+ "const": "item"
813
+ },
814
+ "item": {
815
+ "$ref": "#/$defs/item"
816
+ }
817
+ },
818
+ "required": [
819
+ "type",
820
+ "item"
821
+ ],
822
+ "additionalProperties": true
823
+ },
824
+ {
825
+ "type": "object",
826
+ "properties": {
827
+ "type": {
828
+ "const": "usage"
829
+ },
830
+ "usage": {
831
+ "$ref": "#/$defs/usage"
832
+ }
833
+ },
834
+ "required": [
835
+ "type",
836
+ "usage"
837
+ ],
838
+ "additionalProperties": true
839
+ },
840
+ {
841
+ "type": "object",
842
+ "properties": {
843
+ "type": {
844
+ "const": "mail"
845
+ },
846
+ "mail": {
847
+ "$ref": "#/$defs/mail"
848
+ }
849
+ },
850
+ "required": [
851
+ "type",
852
+ "mail"
853
+ ],
854
+ "additionalProperties": true
855
+ },
856
+ {
857
+ "type": "object",
858
+ "properties": {
859
+ "type": {
860
+ "const": "assignment"
861
+ },
862
+ "assignment": {
863
+ "$ref": "#/$defs/assignment"
864
+ }
865
+ },
866
+ "required": [
867
+ "type",
868
+ "assignment"
869
+ ],
870
+ "additionalProperties": true
871
+ },
872
+ {
873
+ "type": "object",
874
+ "properties": {
875
+ "type": {
876
+ "const": "question"
877
+ },
878
+ "question": {
879
+ "$ref": "#/$defs/question"
880
+ }
881
+ },
882
+ "required": [
883
+ "type",
884
+ "question"
885
+ ],
886
+ "additionalProperties": true
887
+ },
888
+ {
889
+ "type": "object",
890
+ "properties": {
891
+ "type": {
892
+ "const": "question.resolved"
893
+ },
894
+ "questionId": {
895
+ "type": "string"
896
+ },
897
+ "outcome": {
898
+ "enum": [
899
+ "answered",
900
+ "dismissed",
901
+ "timeout",
902
+ "canceled"
903
+ ]
904
+ },
905
+ "answer": {
906
+ "type": "string"
907
+ }
908
+ },
909
+ "required": [
910
+ "type",
911
+ "questionId",
912
+ "outcome"
913
+ ],
914
+ "additionalProperties": true
915
+ },
916
+ {
917
+ "type": "object",
918
+ "properties": {
919
+ "type": {
920
+ "const": "pin"
921
+ },
922
+ "pin": {
923
+ "$ref": "#/$defs/pin"
924
+ }
925
+ },
926
+ "required": [
927
+ "type",
928
+ "pin"
929
+ ],
930
+ "additionalProperties": true
931
+ },
932
+ {
933
+ "type": "object",
934
+ "properties": {
935
+ "type": {
936
+ "const": "unpin"
937
+ },
938
+ "pinId": {
939
+ "type": "string"
940
+ },
941
+ "reason": {
942
+ "enum": [
943
+ "unpinned",
944
+ "session_ended"
945
+ ]
946
+ }
947
+ },
948
+ "required": [
949
+ "type",
950
+ "pinId",
951
+ "reason"
952
+ ],
953
+ "additionalProperties": true
954
+ },
955
+ {
956
+ "type": "object",
957
+ "properties": {
958
+ "type": {
959
+ "const": "attention"
960
+ },
961
+ "attention": {
962
+ "$ref": "#/$defs/attention"
963
+ }
964
+ },
965
+ "required": [
966
+ "type"
967
+ ],
968
+ "additionalProperties": true
969
+ },
970
+ {
971
+ "type": "object",
972
+ "properties": {
973
+ "type": {
974
+ "const": "history.reset"
975
+ },
976
+ "generation": {
977
+ "type": "string",
978
+ "pattern": "^[0-9a-f]{32}$"
979
+ },
980
+ "reason": {
981
+ "const": "rewind"
982
+ },
983
+ "branchId": {
984
+ "type": "string",
985
+ "pattern": "^br_[0-9a-f]{16}$"
986
+ }
987
+ },
988
+ "required": [
989
+ "type",
990
+ "generation",
991
+ "reason",
992
+ "branchId"
993
+ ],
994
+ "additionalProperties": true
995
+ }
996
+ ]
997
+ },
998
+ "unknownEvent": {
999
+ "type": "object",
1000
+ "properties": {
1001
+ "type": {
1002
+ "type": "string",
1003
+ "not": {
1004
+ "enum": [
1005
+ "session.opened",
1006
+ "session.ready",
1007
+ "session.updated",
1008
+ "session.closed",
1009
+ "session.failed",
1010
+ "prompt.accepted",
1011
+ "prompt.failed",
1012
+ "turn.started",
1013
+ "turn.ended",
1014
+ "item",
1015
+ "usage",
1016
+ "mail",
1017
+ "assignment",
1018
+ "question",
1019
+ "question.resolved",
1020
+ "pin",
1021
+ "unpin",
1022
+ "attention",
1023
+ "history.reset"
1024
+ ]
1025
+ }
1026
+ }
1027
+ },
1028
+ "required": [
1029
+ "type"
1030
+ ],
1031
+ "additionalProperties": true
1032
+ },
1033
+ "knownItem": {
1034
+ "oneOf": [
1035
+ {
1036
+ "type": "object",
1037
+ "properties": {
1038
+ "kind": {
1039
+ "const": "user_message"
1040
+ },
1041
+ "id": {
1042
+ "type": "string"
1043
+ },
1044
+ "text": {
1045
+ "type": "string"
1046
+ },
1047
+ "clientMessageId": {
1048
+ "type": "string"
1049
+ },
1050
+ "images": {
1051
+ "type": "integer",
1052
+ "minimum": 1
1053
+ },
1054
+ "attachments": {
1055
+ "type": "array",
1056
+ "items": {
1057
+ "type": "object",
1058
+ "properties": {
1059
+ "attachmentId": {
1060
+ "type": "string",
1061
+ "pattern": "^att_[0-9a-f]{32}$"
1062
+ },
1063
+ "name": {
1064
+ "type": "string"
1065
+ },
1066
+ "mimeType": {
1067
+ "type": "string"
1068
+ },
1069
+ "size": {
1070
+ "type": "integer",
1071
+ "minimum": 0
1072
+ }
1073
+ },
1074
+ "required": [
1075
+ "attachmentId",
1076
+ "name",
1077
+ "mimeType",
1078
+ "size"
1079
+ ],
1080
+ "additionalProperties": false
1081
+ }
1082
+ },
1083
+ "origin": {
1084
+ "enum": [
1085
+ "user",
1086
+ "wake",
1087
+ "assignment",
1088
+ "runtime"
1089
+ ]
1090
+ }
1091
+ },
1092
+ "required": [
1093
+ "kind",
1094
+ "id",
1095
+ "text"
1096
+ ],
1097
+ "additionalProperties": true
1098
+ },
1099
+ {
1100
+ "type": "object",
1101
+ "properties": {
1102
+ "kind": {
1103
+ "const": "assistant_message"
1104
+ },
1105
+ "id": {
1106
+ "type": "string"
1107
+ },
1108
+ "text": {
1109
+ "type": "string"
1110
+ }
1111
+ },
1112
+ "required": [
1113
+ "kind",
1114
+ "id",
1115
+ "text"
1116
+ ],
1117
+ "additionalProperties": true
1118
+ },
1119
+ {
1120
+ "type": "object",
1121
+ "properties": {
1122
+ "kind": {
1123
+ "const": "notice"
1124
+ },
1125
+ "id": {
1126
+ "type": "string"
1127
+ },
1128
+ "level": {
1129
+ "enum": [
1130
+ "info",
1131
+ "warning",
1132
+ "error"
1133
+ ]
1134
+ },
1135
+ "text": {
1136
+ "type": "string"
1137
+ }
1138
+ },
1139
+ "required": [
1140
+ "kind",
1141
+ "id",
1142
+ "level",
1143
+ "text"
1144
+ ],
1145
+ "additionalProperties": true
1146
+ },
1147
+ {
1148
+ "type": "object",
1149
+ "properties": {
1150
+ "kind": {
1151
+ "const": "compaction"
1152
+ },
1153
+ "id": {
1154
+ "type": "string"
1155
+ },
1156
+ "status": {
1157
+ "enum": [
1158
+ "running",
1159
+ "completed",
1160
+ "failed"
1161
+ ]
1162
+ },
1163
+ "trigger": {
1164
+ "type": "string"
1165
+ },
1166
+ "preTokens": {
1167
+ "type": "integer"
1168
+ },
1169
+ "postTokens": {
1170
+ "type": "integer"
1171
+ }
1172
+ },
1173
+ "required": [
1174
+ "kind",
1175
+ "id",
1176
+ "status"
1177
+ ],
1178
+ "additionalProperties": true
1179
+ },
1180
+ {
1181
+ "type": "object",
1182
+ "properties": {
1183
+ "kind": {
1184
+ "const": "todo"
1185
+ },
1186
+ "id": {
1187
+ "type": "string"
1188
+ },
1189
+ "items": {
1190
+ "type": "array",
1191
+ "items": {
1192
+ "type": "object",
1193
+ "properties": {
1194
+ "id": {
1195
+ "type": "string"
1196
+ },
1197
+ "text": {
1198
+ "type": "string"
1199
+ },
1200
+ "status": {
1201
+ "enum": [
1202
+ "pending",
1203
+ "in_progress",
1204
+ "completed"
1205
+ ]
1206
+ }
1207
+ },
1208
+ "required": [
1209
+ "id",
1210
+ "text",
1211
+ "status"
1212
+ ],
1213
+ "additionalProperties": true
1214
+ }
1215
+ }
1216
+ },
1217
+ "required": [
1218
+ "kind",
1219
+ "id",
1220
+ "items"
1221
+ ],
1222
+ "additionalProperties": true
1223
+ },
1224
+ {
1225
+ "type": "object",
1226
+ "properties": {
1227
+ "kind": {
1228
+ "const": "tool_call"
1229
+ },
1230
+ "id": {
1231
+ "type": "string"
1232
+ },
1233
+ "callId": {
1234
+ "type": "string"
1235
+ },
1236
+ "name": {
1237
+ "type": "string"
1238
+ },
1239
+ "status": {
1240
+ "enum": [
1241
+ "running",
1242
+ "completed",
1243
+ "failed"
1244
+ ]
1245
+ },
1246
+ "error": {
1247
+ "type": "string"
1248
+ },
1249
+ "detail": {
1250
+ "$ref": "#/$defs/toolCallDetail"
1251
+ }
1252
+ },
1253
+ "required": [
1254
+ "kind",
1255
+ "id",
1256
+ "callId",
1257
+ "name",
1258
+ "status",
1259
+ "detail"
1260
+ ],
1261
+ "additionalProperties": true
1262
+ }
1263
+ ]
1264
+ },
1265
+ "unknownItem": {
1266
+ "type": "object",
1267
+ "properties": {
1268
+ "kind": {
1269
+ "type": "string",
1270
+ "not": {
1271
+ "enum": [
1272
+ "user_message",
1273
+ "assistant_message",
1274
+ "notice",
1275
+ "compaction",
1276
+ "todo",
1277
+ "tool_call"
1278
+ ]
1279
+ }
1280
+ },
1281
+ "id": {
1282
+ "type": "string"
1283
+ }
1284
+ },
1285
+ "required": [
1286
+ "kind",
1287
+ "id"
1288
+ ],
1289
+ "additionalProperties": true
1290
+ },
1291
+ "toolCallDetail": {
1292
+ "oneOf": [
1293
+ {
1294
+ "type": "object",
1295
+ "properties": {
1296
+ "type": {
1297
+ "const": "shell"
1298
+ },
1299
+ "command": {
1300
+ "type": "string"
1301
+ },
1302
+ "cwd": {
1303
+ "type": "string"
1304
+ },
1305
+ "output": {
1306
+ "type": "string"
1307
+ },
1308
+ "exitCode": {
1309
+ "type": [
1310
+ "integer",
1311
+ "null"
1312
+ ]
1313
+ }
1314
+ },
1315
+ "required": [
1316
+ "type",
1317
+ "command",
1318
+ "output"
1319
+ ],
1320
+ "additionalProperties": true
1321
+ },
1322
+ {
1323
+ "type": "object",
1324
+ "properties": {
1325
+ "type": {
1326
+ "const": "read"
1327
+ },
1328
+ "filePath": {
1329
+ "type": "string"
1330
+ },
1331
+ "content": {
1332
+ "type": "string"
1333
+ },
1334
+ "offset": {
1335
+ "type": "integer"
1336
+ },
1337
+ "limit": {
1338
+ "type": "integer"
1339
+ }
1340
+ },
1341
+ "required": [
1342
+ "type",
1343
+ "filePath"
1344
+ ],
1345
+ "additionalProperties": true
1346
+ },
1347
+ {
1348
+ "type": "object",
1349
+ "properties": {
1350
+ "type": {
1351
+ "const": "edit"
1352
+ },
1353
+ "filePath": {
1354
+ "type": "string"
1355
+ },
1356
+ "oldString": {
1357
+ "type": "string"
1358
+ },
1359
+ "newString": {
1360
+ "type": "string"
1361
+ },
1362
+ "unifiedDiff": {
1363
+ "type": "string"
1364
+ }
1365
+ },
1366
+ "required": [
1367
+ "type",
1368
+ "filePath"
1369
+ ],
1370
+ "additionalProperties": true
1371
+ },
1372
+ {
1373
+ "type": "object",
1374
+ "properties": {
1375
+ "type": {
1376
+ "const": "write"
1377
+ },
1378
+ "filePath": {
1379
+ "type": "string"
1380
+ },
1381
+ "content": {
1382
+ "type": "string"
1383
+ }
1384
+ },
1385
+ "required": [
1386
+ "type",
1387
+ "filePath"
1388
+ ],
1389
+ "additionalProperties": true
1390
+ },
1391
+ {
1392
+ "type": "object",
1393
+ "properties": {
1394
+ "type": {
1395
+ "const": "search"
1396
+ },
1397
+ "query": {
1398
+ "type": "string"
1399
+ },
1400
+ "toolName": {
1401
+ "enum": [
1402
+ "search",
1403
+ "grep",
1404
+ "glob",
1405
+ "web_search"
1406
+ ]
1407
+ },
1408
+ "content": {
1409
+ "type": "string"
1410
+ },
1411
+ "filePaths": {
1412
+ "type": "array",
1413
+ "items": {
1414
+ "type": "string"
1415
+ }
1416
+ },
1417
+ "webResults": {
1418
+ "type": "array",
1419
+ "items": {
1420
+ "type": "object",
1421
+ "properties": {
1422
+ "title": {
1423
+ "type": "string"
1424
+ },
1425
+ "url": {
1426
+ "type": "string"
1427
+ }
1428
+ },
1429
+ "required": [
1430
+ "title",
1431
+ "url"
1432
+ ],
1433
+ "additionalProperties": true
1434
+ }
1435
+ },
1436
+ "numFiles": {
1437
+ "type": "integer"
1438
+ },
1439
+ "numMatches": {
1440
+ "type": "integer"
1441
+ },
1442
+ "truncated": {
1443
+ "type": "boolean"
1444
+ }
1445
+ },
1446
+ "required": [
1447
+ "type",
1448
+ "query"
1449
+ ],
1450
+ "additionalProperties": true
1451
+ },
1452
+ {
1453
+ "type": "object",
1454
+ "properties": {
1455
+ "type": {
1456
+ "const": "fetch"
1457
+ },
1458
+ "url": {
1459
+ "type": "string"
1460
+ },
1461
+ "prompt": {
1462
+ "type": "string"
1463
+ },
1464
+ "result": {
1465
+ "type": "string"
1466
+ },
1467
+ "code": {
1468
+ "type": "integer"
1469
+ }
1470
+ },
1471
+ "required": [
1472
+ "type",
1473
+ "url"
1474
+ ],
1475
+ "additionalProperties": true
1476
+ },
1477
+ {
1478
+ "type": "object",
1479
+ "properties": {
1480
+ "type": {
1481
+ "const": "sub_agent"
1482
+ },
1483
+ "subAgentType": {
1484
+ "type": "string"
1485
+ },
1486
+ "description": {
1487
+ "type": "string"
1488
+ },
1489
+ "log": {
1490
+ "type": "string"
1491
+ }
1492
+ },
1493
+ "required": [
1494
+ "type"
1495
+ ],
1496
+ "additionalProperties": true
1497
+ },
1498
+ {
1499
+ "type": "object",
1500
+ "properties": {
1501
+ "type": {
1502
+ "const": "plan"
1503
+ },
1504
+ "text": {
1505
+ "type": "string"
1506
+ }
1507
+ },
1508
+ "required": [
1509
+ "type",
1510
+ "text"
1511
+ ],
1512
+ "additionalProperties": true
1513
+ },
1514
+ {
1515
+ "type": "object",
1516
+ "properties": {
1517
+ "type": {
1518
+ "const": "plain_text"
1519
+ },
1520
+ "label": {
1521
+ "type": "string"
1522
+ },
1523
+ "text": {
1524
+ "type": "string"
1525
+ }
1526
+ },
1527
+ "required": [
1528
+ "type"
1529
+ ],
1530
+ "additionalProperties": true
1531
+ },
1532
+ {
1533
+ "type": "object",
1534
+ "properties": {
1535
+ "type": {
1536
+ "const": "unknown"
1537
+ },
1538
+ "input": {},
1539
+ "output": {}
1540
+ },
1541
+ "required": [
1542
+ "type",
1543
+ "input",
1544
+ "output"
1545
+ ],
1546
+ "additionalProperties": true
1547
+ },
1548
+ {
1549
+ "type": "object",
1550
+ "properties": {
1551
+ "type": {
1552
+ "type": "string",
1553
+ "not": {
1554
+ "enum": [
1555
+ "shell",
1556
+ "read",
1557
+ "edit",
1558
+ "write",
1559
+ "search",
1560
+ "fetch",
1561
+ "sub_agent",
1562
+ "plan",
1563
+ "plain_text",
1564
+ "unknown"
1565
+ ]
1566
+ }
1567
+ }
1568
+ },
1569
+ "required": [
1570
+ "type"
1571
+ ],
1572
+ "additionalProperties": true
1573
+ }
1574
+ ]
1575
+ },
1576
+ "alpError": {
1577
+ "type": "object",
1578
+ "properties": {
1579
+ "message": {
1580
+ "type": "string"
1581
+ },
1582
+ "code": {
1583
+ "type": "string"
1584
+ }
1585
+ },
1586
+ "required": [
1587
+ "message"
1588
+ ],
1589
+ "additionalProperties": true
1590
+ },
1591
+ "sessionSummary": {
1592
+ "type": "object",
1593
+ "properties": {
1594
+ "id": {
1595
+ "type": "string"
1596
+ },
1597
+ "projectRoot": {
1598
+ "type": "string"
1599
+ },
1600
+ "agent": {
1601
+ "type": "string"
1602
+ },
1603
+ "runtime": {
1604
+ "enum": [
1605
+ "claude",
1606
+ "codex",
1607
+ "acp",
1608
+ "antigravity"
1609
+ ]
1610
+ },
1611
+ "model": {
1612
+ "type": "string"
1613
+ },
1614
+ "mode": {
1615
+ "type": "string"
1616
+ },
1617
+ "thinking": {
1618
+ "type": "string"
1619
+ },
1620
+ "workflow": {
1621
+ "type": "object",
1622
+ "properties": {
1623
+ "mode": {
1624
+ "type": "string"
1625
+ },
1626
+ "maxPeers": {
1627
+ "type": "integer"
1628
+ },
1629
+ "supervisor": {
1630
+ "type": "boolean"
1631
+ }
1632
+ },
1633
+ "required": [
1634
+ "mode",
1635
+ "maxPeers",
1636
+ "supervisor"
1637
+ ],
1638
+ "additionalProperties": true
1639
+ },
1640
+ "threadId": {
1641
+ "type": "string"
1642
+ },
1643
+ "persistent": {
1644
+ "type": "boolean"
1645
+ },
1646
+ "busy": {
1647
+ "type": "boolean"
1648
+ },
1649
+ "parentId": {
1650
+ "type": "string"
1651
+ },
1652
+ "toolCallId": {
1653
+ "type": "string"
1654
+ },
1655
+ "activeTurnId": {
1656
+ "type": "string"
1657
+ },
1658
+ "parked": {
1659
+ "type": "string"
1660
+ },
1661
+ "instructionsSha": {
1662
+ "type": "string"
1663
+ },
1664
+ "teamLabel": {
1665
+ "type": "string"
1666
+ },
1667
+ "status": {
1668
+ "enum": [
1669
+ "initializing",
1670
+ "idle",
1671
+ "running",
1672
+ "error",
1673
+ "closed"
1674
+ ]
1675
+ },
1676
+ "title": {
1677
+ "type": "string"
1678
+ },
1679
+ "archived": {
1680
+ "type": "boolean"
1681
+ },
1682
+ "attention": {
1683
+ "$ref": "#/$defs/attention"
1684
+ },
1685
+ "lastError": {
1686
+ "type": "object",
1687
+ "properties": {
1688
+ "code": {
1689
+ "type": "string"
1690
+ },
1691
+ "message": {
1692
+ "type": "string"
1693
+ }
1694
+ },
1695
+ "required": [
1696
+ "message"
1697
+ ],
1698
+ "additionalProperties": true
1699
+ },
1700
+ "createdAt": {
1701
+ "type": "string"
1702
+ },
1703
+ "updatedAt": {
1704
+ "type": "string"
1705
+ },
1706
+ "conversation": {
1707
+ "type": "object",
1708
+ "properties": {
1709
+ "fork": {
1710
+ "type": "boolean"
1711
+ },
1712
+ "rewind": {
1713
+ "type": "boolean"
1714
+ },
1715
+ "reload": {
1716
+ "type": "boolean",
1717
+ "description": "Whether session.reload can restart this root's native process (§12.8); the root must also be open and idle."
1718
+ },
1719
+ "configure": {
1720
+ "type": "boolean",
1721
+ "description": "Whether session.configure can change this root's model, effort or team (§12.9); the root must also be open and idle."
1722
+ },
1723
+ "reason": {
1724
+ "enum": [
1725
+ "runtime_unsupported",
1726
+ "not_persistent",
1727
+ "not_root"
1728
+ ]
1729
+ }
1730
+ },
1731
+ "required": [
1732
+ "fork",
1733
+ "rewind"
1734
+ ],
1735
+ "additionalProperties": true
1736
+ },
1737
+ "forkedFrom": {
1738
+ "$ref": "#/$defs/forkProvenance"
1739
+ },
1740
+ "branches": {
1741
+ "type": "array",
1742
+ "maxItems": 100,
1743
+ "items": {
1744
+ "$ref": "#/$defs/conversationBranch"
1745
+ }
1746
+ },
1747
+ "promptAttachments": {
1748
+ "type": "array",
1749
+ "minItems": 1,
1750
+ "uniqueItems": true,
1751
+ "items": {
1752
+ "enum": [
1753
+ "file.path",
1754
+ "document.native",
1755
+ "text.extract"
1756
+ ]
1757
+ }
1758
+ }
1759
+ },
1760
+ "required": [
1761
+ "id",
1762
+ "projectRoot",
1763
+ "agent",
1764
+ "runtime",
1765
+ "model",
1766
+ "mode",
1767
+ "thinking",
1768
+ "workflow",
1769
+ "threadId",
1770
+ "persistent",
1771
+ "busy",
1772
+ "status"
1773
+ ],
1774
+ "additionalProperties": true
1775
+ },
1776
+ "pause": {
1777
+ "type": "object",
1778
+ "properties": {
1779
+ "since": {
1780
+ "type": "string"
1781
+ },
1782
+ "by": {
1783
+ "type": "string"
1784
+ },
1785
+ "reason": {
1786
+ "type": "string"
1787
+ },
1788
+ "resetsAt": {
1789
+ "type": "string"
1790
+ },
1791
+ "checkedAt": {
1792
+ "type": "string"
1793
+ }
1794
+ },
1795
+ "required": [
1796
+ "since",
1797
+ "by",
1798
+ "reason"
1799
+ ],
1800
+ "additionalProperties": true
1801
+ },
1802
+ "pauseState": {
1803
+ "type": "object",
1804
+ "properties": {
1805
+ "all": {
1806
+ "$ref": "#/$defs/pause"
1807
+ },
1808
+ "runtimes": {
1809
+ "type": "object",
1810
+ "additionalProperties": {
1811
+ "$ref": "#/$defs/pause"
1812
+ }
1813
+ },
1814
+ "parked": {
1815
+ "type": "array",
1816
+ "items": {
1817
+ "type": "object",
1818
+ "properties": {
1819
+ "assignmentId": {
1820
+ "type": "string"
1821
+ },
1822
+ "agent": {
1823
+ "type": "string"
1824
+ },
1825
+ "runtime": {
1826
+ "type": "string"
1827
+ },
1828
+ "rootId": {
1829
+ "type": "string"
1830
+ },
1831
+ "reason": {
1832
+ "type": "string"
1833
+ },
1834
+ "since": {
1835
+ "type": "string"
1836
+ }
1837
+ },
1838
+ "required": [
1839
+ "assignmentId",
1840
+ "agent",
1841
+ "runtime",
1842
+ "rootId",
1843
+ "reason",
1844
+ "since"
1845
+ ],
1846
+ "additionalProperties": true
1847
+ }
1848
+ }
1849
+ },
1850
+ "required": [
1851
+ "runtimes",
1852
+ "parked"
1853
+ ],
1854
+ "additionalProperties": true
1855
+ },
1856
+ "preview": {
1857
+ "type": "object",
1858
+ "properties": {
1859
+ "teams": {
1860
+ "type": "array",
1861
+ "items": {
1862
+ "type": "object",
1863
+ "properties": {
1864
+ "id": {
1865
+ "type": "string"
1866
+ },
1867
+ "label": {
1868
+ "type": "string"
1869
+ },
1870
+ "description": {
1871
+ "type": "string"
1872
+ }
1873
+ },
1874
+ "required": [
1875
+ "id",
1876
+ "label"
1877
+ ],
1878
+ "additionalProperties": true
1879
+ }
1880
+ },
1881
+ "team": {
1882
+ "type": "string"
1883
+ },
1884
+ "teamLabel": {
1885
+ "type": "string"
1886
+ },
1887
+ "agent": {
1888
+ "type": "string"
1889
+ },
1890
+ "runtime": {
1891
+ "enum": [
1892
+ "claude",
1893
+ "codex",
1894
+ "acp",
1895
+ "antigravity"
1896
+ ]
1897
+ },
1898
+ "model": {
1899
+ "type": "string"
1900
+ },
1901
+ "mode": {
1902
+ "type": "string"
1903
+ },
1904
+ "thinking": {
1905
+ "type": "string"
1906
+ }
1907
+ },
1908
+ "required": [
1909
+ "teams",
1910
+ "team",
1911
+ "agent",
1912
+ "runtime",
1913
+ "model",
1914
+ "mode",
1915
+ "thinking"
1916
+ ],
1917
+ "additionalProperties": true
1918
+ },
1919
+ "treeStatus": {
1920
+ "type": "object",
1921
+ "properties": {
1922
+ "rootId": {
1923
+ "type": "string"
1924
+ },
1925
+ "sessions": {
1926
+ "type": "array",
1927
+ "items": {
1928
+ "type": "object",
1929
+ "properties": {
1930
+ "id": {
1931
+ "type": "string"
1932
+ },
1933
+ "projectRoot": {
1934
+ "type": "string"
1935
+ },
1936
+ "agent": {
1937
+ "type": "string"
1938
+ },
1939
+ "runtime": {
1940
+ "enum": [
1941
+ "claude",
1942
+ "codex",
1943
+ "acp",
1944
+ "antigravity"
1945
+ ]
1946
+ },
1947
+ "model": {
1948
+ "type": "string"
1949
+ },
1950
+ "mode": {
1951
+ "type": "string"
1952
+ },
1953
+ "thinking": {
1954
+ "type": "string"
1955
+ },
1956
+ "workflow": {
1957
+ "type": "object",
1958
+ "properties": {
1959
+ "mode": {
1960
+ "type": "string"
1961
+ },
1962
+ "maxPeers": {
1963
+ "type": "integer"
1964
+ },
1965
+ "supervisor": {
1966
+ "type": "boolean"
1967
+ }
1968
+ },
1969
+ "required": [
1970
+ "mode",
1971
+ "maxPeers",
1972
+ "supervisor"
1973
+ ],
1974
+ "additionalProperties": true
1975
+ },
1976
+ "threadId": {
1977
+ "type": "string"
1978
+ },
1979
+ "persistent": {
1980
+ "type": "boolean"
1981
+ },
1982
+ "busy": {
1983
+ "type": "boolean"
1984
+ },
1985
+ "parentId": {
1986
+ "type": "string"
1987
+ },
1988
+ "toolCallId": {
1989
+ "type": "string"
1990
+ },
1991
+ "activeTurnId": {
1992
+ "type": "string"
1993
+ },
1994
+ "parked": {
1995
+ "type": "string"
1996
+ },
1997
+ "instructionsSha": {
1998
+ "type": "string"
1999
+ },
2000
+ "teamLabel": {
2001
+ "type": "string"
2002
+ },
2003
+ "state": {
2004
+ "enum": [
2005
+ "running",
2006
+ "waiting",
2007
+ "waiting_parent",
2008
+ "waiting_user",
2009
+ "idle"
2010
+ ]
2011
+ },
2012
+ "idleMs": {
2013
+ "type": "number"
2014
+ },
2015
+ "workdir": {
2016
+ "type": "string"
2017
+ },
2018
+ "unreadMail": {
2019
+ "type": "integer",
2020
+ "minimum": 0
2021
+ }
2022
+ },
2023
+ "required": [
2024
+ "id",
2025
+ "projectRoot",
2026
+ "agent",
2027
+ "runtime",
2028
+ "model",
2029
+ "mode",
2030
+ "thinking",
2031
+ "workflow",
2032
+ "threadId",
2033
+ "persistent",
2034
+ "busy",
2035
+ "state",
2036
+ "idleMs",
2037
+ "workdir",
2038
+ "unreadMail"
2039
+ ],
2040
+ "additionalProperties": true
2041
+ }
2042
+ },
2043
+ "assignments": {
2044
+ "type": "array",
2045
+ "items": {
2046
+ "type": "object",
2047
+ "properties": {
2048
+ "id": {
2049
+ "type": "string"
2050
+ },
2051
+ "requester": {
2052
+ "type": "string"
2053
+ },
2054
+ "isolation": {
2055
+ "enum": [
2056
+ "shared",
2057
+ "worktree"
2058
+ ]
2059
+ },
2060
+ "idleMs": {
2061
+ "type": "number"
2062
+ }
2063
+ },
2064
+ "required": [
2065
+ "id",
2066
+ "requester",
2067
+ "isolation",
2068
+ "idleMs"
2069
+ ],
2070
+ "additionalProperties": true
2071
+ }
2072
+ },
2073
+ "questions": {
2074
+ "type": "array",
2075
+ "items": {
2076
+ "$ref": "#/$defs/question"
2077
+ }
2078
+ },
2079
+ "worktrees": {
2080
+ "type": "array",
2081
+ "items": {
2082
+ "type": "object",
2083
+ "properties": {
2084
+ "assignmentId": {
2085
+ "type": "string"
2086
+ },
2087
+ "requester": {
2088
+ "type": "string"
2089
+ },
2090
+ "agent": {
2091
+ "type": "string"
2092
+ },
2093
+ "branch": {
2094
+ "type": "string"
2095
+ },
2096
+ "files": {
2097
+ "type": "array",
2098
+ "items": {
2099
+ "type": "string"
2100
+ }
2101
+ },
2102
+ "stat": {
2103
+ "type": "string"
2104
+ }
2105
+ },
2106
+ "required": [
2107
+ "assignmentId",
2108
+ "requester",
2109
+ "agent",
2110
+ "branch",
2111
+ "files",
2112
+ "stat"
2113
+ ],
2114
+ "additionalProperties": true
2115
+ }
2116
+ },
2117
+ "leases": {
2118
+ "type": "array",
2119
+ "items": {
2120
+ "type": "object",
2121
+ "properties": {
2122
+ "checkout": {
2123
+ "type": "string"
2124
+ },
2125
+ "assignmentId": {
2126
+ "type": "string"
2127
+ },
2128
+ "agent": {
2129
+ "type": "string"
2130
+ }
2131
+ },
2132
+ "required": [
2133
+ "checkout",
2134
+ "assignmentId",
2135
+ "agent"
2136
+ ],
2137
+ "additionalProperties": true
2138
+ }
2139
+ },
2140
+ "claims": {
2141
+ "type": "array",
2142
+ "items": {
2143
+ "$ref": "#/$defs/pin"
2144
+ }
2145
+ }
2146
+ },
2147
+ "required": [
2148
+ "rootId",
2149
+ "sessions",
2150
+ "assignments",
2151
+ "questions",
2152
+ "worktrees",
2153
+ "leases",
2154
+ "claims"
2155
+ ],
2156
+ "additionalProperties": true
2157
+ },
2158
+ "health": {
2159
+ "type": "object",
2160
+ "properties": {
2161
+ "live": {
2162
+ "type": "boolean"
2163
+ },
2164
+ "ready": {
2165
+ "type": "boolean"
2166
+ },
2167
+ "checks": {
2168
+ "type": "array",
2169
+ "items": {
2170
+ "type": "object",
2171
+ "properties": {
2172
+ "id": {
2173
+ "type": "string"
2174
+ },
2175
+ "ok": {
2176
+ "type": "boolean"
2177
+ },
2178
+ "code": {
2179
+ "type": "string"
2180
+ },
2181
+ "message": {
2182
+ "type": "string"
2183
+ }
2184
+ },
2185
+ "required": [
2186
+ "id",
2187
+ "ok"
2188
+ ],
2189
+ "additionalProperties": true
2190
+ }
2191
+ }
2192
+ },
2193
+ "required": [
2194
+ "live",
2195
+ "ready",
2196
+ "checks"
2197
+ ],
2198
+ "additionalProperties": true
2199
+ },
2200
+ "projectRoot": {
2201
+ "type": "string",
2202
+ "minLength": 1,
2203
+ "maxLength": 4096,
2204
+ "description": "An absolute, normalized path on the daemon host to a directory holding .alp/. Compared as is: the daemon never walks up to a parent."
2205
+ },
2206
+ "taskId": {
2207
+ "type": "string",
2208
+ "pattern": "^t-[0-9a-f]{4,12}(?:\\.\\d+)*$"
2209
+ },
2210
+ "taskRow": {
2211
+ "type": "object",
2212
+ "properties": {
2213
+ "id": {
2214
+ "$ref": "#/$defs/taskId"
2215
+ },
2216
+ "title": {
2217
+ "type": "string"
2218
+ },
2219
+ "type": {
2220
+ "type": "string"
2221
+ },
2222
+ "priority": {
2223
+ "type": "integer"
2224
+ },
2225
+ "status": {
2226
+ "enum": [
2227
+ "open",
2228
+ "in_progress",
2229
+ "review",
2230
+ "closed"
2231
+ ]
2232
+ },
2233
+ "rev": {
2234
+ "type": "integer",
2235
+ "minimum": 0
2236
+ },
2237
+ "parent": {
2238
+ "type": "string"
2239
+ },
2240
+ "assignee": {
2241
+ "type": "string"
2242
+ },
2243
+ "ready": {
2244
+ "type": "boolean"
2245
+ },
2246
+ "blockedBy": {
2247
+ "type": "array",
2248
+ "items": {
2249
+ "type": "string"
2250
+ }
2251
+ },
2252
+ "waits": {
2253
+ "type": "array",
2254
+ "items": {
2255
+ "type": "string"
2256
+ }
2257
+ },
2258
+ "approvals": {
2259
+ "type": "array",
2260
+ "items": {
2261
+ "type": "object",
2262
+ "properties": {
2263
+ "gate": {
2264
+ "type": "string"
2265
+ },
2266
+ "note": {
2267
+ "type": "string"
2268
+ }
2269
+ },
2270
+ "required": [
2271
+ "gate",
2272
+ "note"
2273
+ ],
2274
+ "additionalProperties": true
2275
+ }
2276
+ },
2277
+ "handoff": {
2278
+ "type": "object",
2279
+ "properties": {
2280
+ "outcome": {
2281
+ "type": "string"
2282
+ },
2283
+ "summary": {
2284
+ "type": "string"
2285
+ },
2286
+ "agent": {
2287
+ "type": "string"
2288
+ }
2289
+ },
2290
+ "required": [
2291
+ "outcome",
2292
+ "summary"
2293
+ ],
2294
+ "additionalProperties": true
2295
+ },
2296
+ "closed": {
2297
+ "type": "object",
2298
+ "properties": {
2299
+ "reason": {
2300
+ "type": "string"
2301
+ },
2302
+ "summary": {
2303
+ "type": "string"
2304
+ },
2305
+ "at": {
2306
+ "type": "string"
2307
+ }
2308
+ },
2309
+ "required": [
2310
+ "reason",
2311
+ "at"
2312
+ ],
2313
+ "additionalProperties": true
2314
+ },
2315
+ "description": {
2316
+ "type": "string"
2317
+ },
2318
+ "labels": {
2319
+ "type": "array",
2320
+ "items": {
2321
+ "type": "string"
2322
+ }
2323
+ },
2324
+ "paths": {
2325
+ "type": "array",
2326
+ "items": {
2327
+ "type": "string"
2328
+ }
2329
+ },
2330
+ "progress": {
2331
+ "type": "object",
2332
+ "properties": {
2333
+ "done": {
2334
+ "type": "integer",
2335
+ "minimum": 0
2336
+ },
2337
+ "total": {
2338
+ "type": "integer",
2339
+ "minimum": 0
2340
+ }
2341
+ },
2342
+ "required": [
2343
+ "done",
2344
+ "total"
2345
+ ],
2346
+ "additionalProperties": true
2347
+ },
2348
+ "createdAt": {
2349
+ "type": "string"
2350
+ },
2351
+ "updatedAt": {
2352
+ "type": "string"
2353
+ }
2354
+ },
2355
+ "required": [
2356
+ "id",
2357
+ "title",
2358
+ "type",
2359
+ "priority",
2360
+ "status",
2361
+ "rev",
2362
+ "ready",
2363
+ "updatedAt"
2364
+ ],
2365
+ "additionalProperties": true
2366
+ },
2367
+ "libraryKind": {
2368
+ "enum": [
2369
+ "agents",
2370
+ "skills",
2371
+ "mcp",
2372
+ "hooks",
2373
+ "teams",
2374
+ "providers"
2375
+ ]
2376
+ },
2377
+ "libraryScope": {
2378
+ "enum": [
2379
+ "library",
2380
+ "project"
2381
+ ]
2382
+ },
2383
+ "librarySource": {
2384
+ "enum": [
2385
+ "builtin",
2386
+ "library",
2387
+ "project"
2388
+ ]
2389
+ },
2390
+ "entryName": {
2391
+ "type": "string",
2392
+ "minLength": 1,
2393
+ "maxLength": 128,
2394
+ "pattern": "^[A-Za-z0-9_.-]+$",
2395
+ "not": {
2396
+ "enum": [
2397
+ ".",
2398
+ ".."
2399
+ ]
2400
+ }
2401
+ },
2402
+ "libraryRevision": {
2403
+ "type": [
2404
+ "string",
2405
+ "null"
2406
+ ]
2407
+ },
2408
+ "libraryEntryRow": {
2409
+ "type": "object",
2410
+ "properties": {
2411
+ "name": {
2412
+ "type": "string"
2413
+ },
2414
+ "source": {
2415
+ "$ref": "#/$defs/librarySource"
2416
+ },
2417
+ "overrides": {
2418
+ "$ref": "#/$defs/librarySource"
2419
+ },
2420
+ "description": {
2421
+ "type": "string"
2422
+ },
2423
+ "usedBy": {
2424
+ "type": "array",
2425
+ "items": {
2426
+ "type": "string"
2427
+ }
2428
+ }
2429
+ },
2430
+ "required": [
2431
+ "name",
2432
+ "source"
2433
+ ],
2434
+ "additionalProperties": true
2435
+ },
2436
+ "secretMarker": {
2437
+ "type": "object",
2438
+ "properties": {
2439
+ "$secret": {
2440
+ "const": "keep"
2441
+ }
2442
+ },
2443
+ "required": [
2444
+ "$secret"
2445
+ ],
2446
+ "additionalProperties": false,
2447
+ "description": "Stands for a stored secret value: read results carry it in place of the value; a save that sends it back keeps the stored value."
2448
+ },
2449
+ "languageSetting": {
2450
+ "type": "object",
2451
+ "properties": {
2452
+ "language": {
2453
+ "type": [
2454
+ "string",
2455
+ "null"
2456
+ ]
2457
+ },
2458
+ "applies": {
2459
+ "type": "string"
2460
+ },
2461
+ "default": {
2462
+ "type": "string"
2463
+ }
2464
+ },
2465
+ "required": [
2466
+ "language",
2467
+ "applies",
2468
+ "default"
2469
+ ],
2470
+ "additionalProperties": true
2471
+ },
2472
+ "teamRow": {
2473
+ "type": "object",
2474
+ "properties": {
2475
+ "id": {
2476
+ "type": "string"
2477
+ },
2478
+ "label": {
2479
+ "type": "string"
2480
+ },
2481
+ "description": {
2482
+ "type": "string"
2483
+ },
2484
+ "source": {
2485
+ "$ref": "#/$defs/librarySource"
2486
+ },
2487
+ "overrides": {
2488
+ "$ref": "#/$defs/librarySource"
2489
+ },
2490
+ "error": {
2491
+ "type": "string"
2492
+ }
2493
+ },
2494
+ "required": [
2495
+ "id",
2496
+ "source"
2497
+ ],
2498
+ "additionalProperties": true
2499
+ },
2500
+ "promptImage": {
2501
+ "type": "object",
2502
+ "properties": {
2503
+ "type": {
2504
+ "const": "image"
2505
+ },
2506
+ "mimeType": {
2507
+ "enum": [
2508
+ "image/png",
2509
+ "image/jpeg",
2510
+ "image/gif",
2511
+ "image/webp"
2512
+ ]
2513
+ },
2514
+ "data": {
2515
+ "type": "string",
2516
+ "minLength": 4,
2517
+ "maxLength": 6990508,
2518
+ "pattern": "^[A-Za-z0-9+/]+={0,2}$"
2519
+ },
2520
+ "name": {
2521
+ "type": "string",
2522
+ "maxLength": 255
2523
+ }
2524
+ },
2525
+ "required": [
2526
+ "type",
2527
+ "mimeType",
2528
+ "data"
2529
+ ],
2530
+ "additionalProperties": false
2531
+ },
2532
+ "scheduleId": {
2533
+ "type": "string",
2534
+ "pattern": "^sch_[0-9a-f]{16}$"
2535
+ },
2536
+ "scheduleError": {
2537
+ "type": "object",
2538
+ "properties": {
2539
+ "message": {
2540
+ "type": "string"
2541
+ },
2542
+ "code": {
2543
+ "type": "string"
2544
+ }
2545
+ },
2546
+ "required": [
2547
+ "message"
2548
+ ],
2549
+ "additionalProperties": true
2550
+ },
2551
+ "scheduleJob": {
2552
+ "type": "object",
2553
+ "properties": {
2554
+ "id": {
2555
+ "$ref": "#/$defs/scheduleId"
2556
+ },
2557
+ "projectRoot": {
2558
+ "$ref": "#/$defs/projectRoot"
2559
+ },
2560
+ "sessionId": {
2561
+ "type": "string"
2562
+ },
2563
+ "prompt": {
2564
+ "type": "string"
2565
+ },
2566
+ "dueAt": {
2567
+ "type": "string",
2568
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,3})?(Z|[+-]\\d{2}:\\d{2})$"
2569
+ },
2570
+ "status": {
2571
+ "enum": [
2572
+ "pending",
2573
+ "delivered",
2574
+ "failed",
2575
+ "cancelled"
2576
+ ]
2577
+ },
2578
+ "attempts": {
2579
+ "type": "integer",
2580
+ "minimum": 0
2581
+ },
2582
+ "createdAt": {
2583
+ "type": "string"
2584
+ },
2585
+ "updatedAt": {
2586
+ "type": "string"
2587
+ },
2588
+ "deliveredAt": {
2589
+ "type": "string"
2590
+ },
2591
+ "failedAt": {
2592
+ "type": "string"
2593
+ },
2594
+ "cancelledAt": {
2595
+ "type": "string"
2596
+ },
2597
+ "attemptedAt": {
2598
+ "type": "string"
2599
+ },
2600
+ "lateByMs": {
2601
+ "type": "integer",
2602
+ "minimum": 0
2603
+ },
2604
+ "lastError": {
2605
+ "$ref": "#/$defs/scheduleError"
2606
+ }
2607
+ },
2608
+ "required": [
2609
+ "id",
2610
+ "projectRoot",
2611
+ "sessionId",
2612
+ "prompt",
2613
+ "dueAt",
2614
+ "status",
2615
+ "attempts",
2616
+ "createdAt",
2617
+ "updatedAt"
2618
+ ],
2619
+ "additionalProperties": true
2620
+ },
2621
+ "registryProject": {
2622
+ "type": "object",
2623
+ "properties": {
2624
+ "id": {
2625
+ "type": "string"
2626
+ },
2627
+ "root": {
2628
+ "type": "string"
2629
+ },
2630
+ "customName": {
2631
+ "type": [
2632
+ "string",
2633
+ "null"
2634
+ ]
2635
+ },
2636
+ "addedAt": {
2637
+ "type": "string"
2638
+ },
2639
+ "removedAt": {
2640
+ "type": [
2641
+ "string",
2642
+ "null"
2643
+ ]
2644
+ },
2645
+ "revision": {
2646
+ "type": "integer",
2647
+ "minimum": 0
2648
+ },
2649
+ "canonical": {
2650
+ "type": "string"
2651
+ }
2652
+ },
2653
+ "required": [
2654
+ "id",
2655
+ "root",
2656
+ "addedAt"
2657
+ ],
2658
+ "additionalProperties": false
2659
+ },
2660
+ "registryWorkspace": {
2661
+ "type": "object",
2662
+ "properties": {
2663
+ "id": {
2664
+ "type": "string"
2665
+ },
2666
+ "projectId": {
2667
+ "type": "string"
2668
+ },
2669
+ "directory": {
2670
+ "type": "string"
2671
+ },
2672
+ "title": {
2673
+ "type": [
2674
+ "string",
2675
+ "null"
2676
+ ]
2677
+ },
2678
+ "pinnedAt": {
2679
+ "type": [
2680
+ "string",
2681
+ "null"
2682
+ ]
2683
+ },
2684
+ "archivedAt": {
2685
+ "type": [
2686
+ "string",
2687
+ "null"
2688
+ ]
2689
+ },
2690
+ "labels": {
2691
+ "type": "array",
2692
+ "items": {
2693
+ "type": "string"
2694
+ }
2695
+ },
2696
+ "createdAt": {
2697
+ "type": "string"
2698
+ },
2699
+ "revision": {
2700
+ "type": "integer",
2701
+ "minimum": 0
2702
+ },
2703
+ "canonical": {
2704
+ "type": "string"
2705
+ },
2706
+ "idempotencyKey": {
2707
+ "type": "string"
2708
+ },
2709
+ "branch": {
2710
+ "type": [
2711
+ "string",
2712
+ "null"
2713
+ ]
2714
+ },
2715
+ "managedWorktree": {
2716
+ "type": "boolean"
2717
+ }
2718
+ },
2719
+ "required": [
2720
+ "id",
2721
+ "projectId",
2722
+ "directory",
2723
+ "labels",
2724
+ "createdAt"
2725
+ ],
2726
+ "additionalProperties": false
2727
+ },
2728
+ "attachment": {
2729
+ "type": "object",
2730
+ "description": "A committed attachment as clients see it: ids, display metadata and its digest, never a host path or URL.",
2731
+ "properties": {
2732
+ "attachmentId": {
2733
+ "type": "string",
2734
+ "pattern": "^att_[0-9a-f]{32}$"
2735
+ },
2736
+ "sessionId": {
2737
+ "type": "string",
2738
+ "minLength": 1,
2739
+ "maxLength": 128
2740
+ },
2741
+ "name": {
2742
+ "type": "string",
2743
+ "minLength": 1,
2744
+ "maxLength": 255
2745
+ },
2746
+ "mimeType": {
2747
+ "type": "string",
2748
+ "minLength": 3,
2749
+ "maxLength": 255
2750
+ },
2751
+ "detectedMimeType": {
2752
+ "type": "string",
2753
+ "minLength": 3,
2754
+ "maxLength": 255
2755
+ },
2756
+ "size": {
2757
+ "type": "integer",
2758
+ "minimum": 0
2759
+ },
2760
+ "sha256": {
2761
+ "type": "string",
2762
+ "pattern": "^[0-9a-f]{64}$"
2763
+ },
2764
+ "createdAt": {
2765
+ "type": "string"
2766
+ },
2767
+ "committedAt": {
2768
+ "type": "string"
2769
+ },
2770
+ "referenced": {
2771
+ "type": "boolean"
2772
+ }
2773
+ },
2774
+ "required": [
2775
+ "attachmentId",
2776
+ "sessionId",
2777
+ "name",
2778
+ "mimeType",
2779
+ "detectedMimeType",
2780
+ "size",
2781
+ "sha256",
2782
+ "createdAt",
2783
+ "committedAt",
2784
+ "referenced"
2785
+ ],
2786
+ "additionalProperties": false
2787
+ },
2788
+ "forkProvenance": {
2789
+ "type": "object",
2790
+ "description": "Where a fork came from (§12.7): the source root, and the turn its conversation was cut at.",
2791
+ "properties": {
2792
+ "sessionId": {
2793
+ "type": "string",
2794
+ "minLength": 1,
2795
+ "maxLength": 128
2796
+ },
2797
+ "turnId": {
2798
+ "type": "string",
2799
+ "minLength": 1,
2800
+ "maxLength": 200
2801
+ },
2802
+ "boundary": {
2803
+ "enum": [
2804
+ "through",
2805
+ "before",
2806
+ "whole"
2807
+ ]
2808
+ },
2809
+ "branchId": {
2810
+ "type": "string",
2811
+ "pattern": "^br_[0-9a-f]{16}$"
2812
+ },
2813
+ "at": {
2814
+ "type": "string",
2815
+ "minLength": 1,
2816
+ "maxLength": 64
2817
+ }
2818
+ },
2819
+ "required": [
2820
+ "sessionId",
2821
+ "boundary",
2822
+ "at"
2823
+ ],
2824
+ "additionalProperties": true
2825
+ },
2826
+ "conversationBranch": {
2827
+ "type": "object",
2828
+ "description": "Later turns a rewind set aside (§12.7): kept, never deleted, recoverable as a new session with session.fork { branchId }.",
2829
+ "properties": {
2830
+ "branchId": {
2831
+ "type": "string",
2832
+ "pattern": "^br_[0-9a-f]{16}$"
2833
+ },
2834
+ "beforeTurnId": {
2835
+ "type": "string",
2836
+ "minLength": 1,
2837
+ "maxLength": 200
2838
+ },
2839
+ "turns": {
2840
+ "type": "integer",
2841
+ "minimum": 0
2842
+ },
2843
+ "at": {
2844
+ "type": "string",
2845
+ "minLength": 1,
2846
+ "maxLength": 64
2847
+ }
2848
+ },
2849
+ "required": [
2850
+ "branchId",
2851
+ "beforeTurnId",
2852
+ "turns",
2853
+ "at"
2854
+ ],
2855
+ "additionalProperties": true
2856
+ },
2857
+ "effectiveConfig": {
2858
+ "type": "object",
2859
+ "description": "The configuration a root runs with, or would after a change, as alpd resolved it (§12.9).",
2860
+ "properties": {
2861
+ "team": {
2862
+ "type": "string"
2863
+ },
2864
+ "teamLabel": {
2865
+ "type": "string"
2866
+ },
2867
+ "agent": {
2868
+ "type": "string"
2869
+ },
2870
+ "runtime": {
2871
+ "enum": [
2872
+ "claude",
2873
+ "codex",
2874
+ "acp",
2875
+ "antigravity"
2876
+ ]
2877
+ },
2878
+ "model": {
2879
+ "type": "string"
2880
+ },
2881
+ "thinking": {
2882
+ "type": "string"
2883
+ },
2884
+ "mode": {
2885
+ "type": "string"
2886
+ },
2887
+ "permissionProfile": {
2888
+ "type": "string",
2889
+ "description": "The permission profile capping the agent's mode, when one does."
2890
+ },
2891
+ "supervisor": {
2892
+ "type": "boolean"
2893
+ },
2894
+ "maxPeers": {
2895
+ "type": "integer"
2896
+ },
2897
+ "delegates": {
2898
+ "type": "array",
2899
+ "items": {
2900
+ "type": "string"
2901
+ },
2902
+ "description": "Agents the root may delegate to."
2903
+ },
2904
+ "tools": {
2905
+ "type": "array",
2906
+ "items": {
2907
+ "type": "string"
2908
+ },
2909
+ "description": "ALP tools the root's agent is given."
2910
+ },
2911
+ "mcpServers": {
2912
+ "type": "array",
2913
+ "items": {
2914
+ "type": "object",
2915
+ "properties": {
2916
+ "name": {
2917
+ "type": "string"
2918
+ },
2919
+ "kind": {
2920
+ "enum": [
2921
+ "stdio",
2922
+ "http"
2923
+ ]
2924
+ }
2925
+ },
2926
+ "required": [
2927
+ "name",
2928
+ "kind"
2929
+ ],
2930
+ "additionalProperties": true
2931
+ }
2932
+ },
2933
+ "hooks": {
2934
+ "type": "integer",
2935
+ "minimum": 0,
2936
+ "description": "How many hook commands the agent runs."
2937
+ },
2938
+ "instructionsSha": {
2939
+ "type": "string"
2940
+ }
2941
+ },
2942
+ "required": [
2943
+ "team",
2944
+ "agent",
2945
+ "runtime",
2946
+ "model",
2947
+ "thinking",
2948
+ "mode",
2949
+ "supervisor",
2950
+ "delegates",
2951
+ "tools",
2952
+ "mcpServers",
2953
+ "hooks"
2954
+ ],
2955
+ "additionalProperties": true
2956
+ },
2957
+ "configurePreview": {
2958
+ "type": "object",
2959
+ "properties": {
2960
+ "current": {
2961
+ "$ref": "#/$defs/effectiveConfig"
2962
+ },
2963
+ "proposed": {
2964
+ "$ref": "#/$defs/effectiveConfig"
2965
+ },
2966
+ "changes": {
2967
+ "type": "array",
2968
+ "items": {
2969
+ "enum": [
2970
+ "model",
2971
+ "thinking",
2972
+ "team",
2973
+ "mode"
2974
+ ]
2975
+ }
2976
+ },
2977
+ "restart": {
2978
+ "type": "boolean",
2979
+ "description": "Whether applying it restarts the root's native process (on its own conversation)."
2980
+ },
2981
+ "allowed": {
2982
+ "type": "boolean",
2983
+ "description": "Whether session.configure would take it now; a busy tree may still refuse it later."
2984
+ },
2985
+ "reason": {
2986
+ "enum": [
2987
+ "session_busy",
2988
+ "session_closed",
2989
+ "not_root",
2990
+ "runtime_unsupported",
2991
+ "runtime_mismatch",
2992
+ "agent_mismatch",
2993
+ "permission_escalation",
2994
+ "team_not_found",
2995
+ "invalid_params",
2996
+ "not_persistent"
2997
+ ]
2998
+ },
2999
+ "message": {
3000
+ "type": "string"
3001
+ },
3002
+ "teams": {
3003
+ "type": "array",
3004
+ "items": {
3005
+ "type": "object",
3006
+ "properties": {
3007
+ "id": {
3008
+ "type": "string"
3009
+ },
3010
+ "label": {
3011
+ "type": "string"
3012
+ },
3013
+ "description": {
3014
+ "type": "string"
3015
+ }
3016
+ },
3017
+ "required": [
3018
+ "id",
3019
+ "label"
3020
+ ],
3021
+ "additionalProperties": true
3022
+ }
3023
+ }
3024
+ },
3025
+ "required": [
3026
+ "current",
3027
+ "proposed",
3028
+ "changes",
3029
+ "restart",
3030
+ "allowed",
3031
+ "teams"
3032
+ ],
3033
+ "additionalProperties": true
3034
+ },
3035
+ "configureOutcome": {
3036
+ "type": "object",
3037
+ "properties": {
3038
+ "status": {
3039
+ "enum": [
3040
+ "applied",
3041
+ "unchanged"
3042
+ ]
3043
+ },
3044
+ "requested": {
3045
+ "type": "object",
3046
+ "properties": {
3047
+ "model": {
3048
+ "type": "string"
3049
+ },
3050
+ "thinking": {
3051
+ "type": "string"
3052
+ },
3053
+ "team": {
3054
+ "type": "string"
3055
+ },
3056
+ "mode": {
3057
+ "type": "string"
3058
+ }
3059
+ },
3060
+ "additionalProperties": false
3061
+ },
3062
+ "effective": {
3063
+ "$ref": "#/$defs/effectiveConfig"
3064
+ },
3065
+ "restarted": {
3066
+ "type": "boolean"
3067
+ }
3068
+ },
3069
+ "required": [
3070
+ "status",
3071
+ "requested",
3072
+ "effective",
3073
+ "restarted"
3074
+ ],
3075
+ "additionalProperties": true
3076
+ },
3077
+ "terminal": {
3078
+ "type": "object",
3079
+ "description": "A terminal as clients see it: ids, size and state, never a process id, shell path or host path.",
3080
+ "properties": {
3081
+ "terminalId": {
3082
+ "type": "string",
3083
+ "pattern": "^term_[0-9a-f]{32}$"
3084
+ },
3085
+ "workspaceId": {
3086
+ "type": "string",
3087
+ "minLength": 1,
3088
+ "maxLength": 200
3089
+ },
3090
+ "title": {
3091
+ "type": "string",
3092
+ "maxLength": 64
3093
+ },
3094
+ "cols": {
3095
+ "type": "integer",
3096
+ "minimum": 2,
3097
+ "maximum": 500
3098
+ },
3099
+ "rows": {
3100
+ "type": "integer",
3101
+ "minimum": 1,
3102
+ "maximum": 200
3103
+ },
3104
+ "state": {
3105
+ "enum": [
3106
+ "running",
3107
+ "exited"
3108
+ ]
3109
+ },
3110
+ "attached": {
3111
+ "type": "boolean"
3112
+ },
3113
+ "createdAt": {
3114
+ "type": "string",
3115
+ "format": "date-time"
3116
+ },
3117
+ "lastActivityAt": {
3118
+ "type": "string",
3119
+ "format": "date-time"
3120
+ },
3121
+ "expiresAt": {
3122
+ "type": "string",
3123
+ "format": "date-time"
3124
+ },
3125
+ "exitCode": {
3126
+ "type": [
3127
+ "integer",
3128
+ "null"
3129
+ ]
3130
+ },
3131
+ "signal": {
3132
+ "type": [
3133
+ "integer",
3134
+ "null"
3135
+ ]
3136
+ },
3137
+ "endReason": {
3138
+ "enum": [
3139
+ "exited",
3140
+ "closed",
3141
+ "idle",
3142
+ "lifetime",
3143
+ "detached",
3144
+ "revoked",
3145
+ "disabled",
3146
+ "shutdown"
3147
+ ]
3148
+ }
3149
+ },
3150
+ "required": [
3151
+ "terminalId",
3152
+ "workspaceId",
3153
+ "title",
3154
+ "cols",
3155
+ "rows",
3156
+ "state",
3157
+ "attached",
3158
+ "createdAt",
3159
+ "lastActivityAt",
3160
+ "expiresAt"
3161
+ ],
3162
+ "additionalProperties": false
3163
+ },
3164
+ "terminalEvent": {
3165
+ "description": "params of a terminal.event notification (§12.10): sent only to the connection attached to the terminal.",
3166
+ "oneOf": [
3167
+ {
3168
+ "type": "object",
3169
+ "properties": {
3170
+ "terminalId": {
3171
+ "type": "string",
3172
+ "pattern": "^term_[0-9a-f]{32}$"
3173
+ },
3174
+ "type": {
3175
+ "const": "output"
3176
+ },
3177
+ "seq": {
3178
+ "type": "integer",
3179
+ "minimum": 1
3180
+ },
3181
+ "data": {
3182
+ "type": "string",
3183
+ "minLength": 1,
3184
+ "maxLength": 65536
3185
+ }
3186
+ },
3187
+ "required": [
3188
+ "terminalId",
3189
+ "type",
3190
+ "seq",
3191
+ "data"
3192
+ ],
3193
+ "additionalProperties": false
3194
+ },
3195
+ {
3196
+ "type": "object",
3197
+ "properties": {
3198
+ "terminalId": {
3199
+ "type": "string",
3200
+ "pattern": "^term_[0-9a-f]{32}$"
3201
+ },
3202
+ "type": {
3203
+ "const": "exit"
3204
+ },
3205
+ "seq": {
3206
+ "type": "integer",
3207
+ "minimum": 1
3208
+ },
3209
+ "exitCode": {
3210
+ "type": [
3211
+ "integer",
3212
+ "null"
3213
+ ]
3214
+ },
3215
+ "signal": {
3216
+ "type": [
3217
+ "integer",
3218
+ "null"
3219
+ ]
3220
+ },
3221
+ "reason": {
3222
+ "enum": [
3223
+ "exited",
3224
+ "closed",
3225
+ "idle",
3226
+ "lifetime",
3227
+ "detached",
3228
+ "revoked",
3229
+ "disabled",
3230
+ "shutdown"
3231
+ ]
3232
+ }
3233
+ },
3234
+ "required": [
3235
+ "terminalId",
3236
+ "type",
3237
+ "seq",
3238
+ "exitCode",
3239
+ "signal",
3240
+ "reason"
3241
+ ],
3242
+ "additionalProperties": false
3243
+ },
3244
+ {
3245
+ "type": "object",
3246
+ "properties": {
3247
+ "terminalId": {
3248
+ "type": "string",
3249
+ "pattern": "^term_[0-9a-f]{32}$"
3250
+ },
3251
+ "type": {
3252
+ "const": "detached"
3253
+ },
3254
+ "reason": {
3255
+ "enum": [
3256
+ "replaced",
3257
+ "slow_consumer"
3258
+ ]
3259
+ }
3260
+ },
3261
+ "required": [
3262
+ "terminalId",
3263
+ "type",
3264
+ "reason"
3265
+ ],
3266
+ "additionalProperties": false
3267
+ }
3268
+ ]
3269
+ }
3270
+ }
3271
+ }