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

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