ask-session-protocol 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1428 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Ask Session Protocol",
4
+ "description": "Canonical wire contract for ask agent sessions: event vocabulary, interactions, and the RPC method surface. See the ask-session-protocol gem for the authoritative registry.",
5
+ "protocolVersion": "1.0",
6
+ "$defs": {
7
+ "event": {
8
+ "session.created": {
9
+ "type": "object",
10
+ "description": "A session was created and is ready to receive prompts.",
11
+ "properties": {
12
+ "type": {
13
+ "const": "session.created"
14
+ },
15
+ "seq": {
16
+ "type": "integer",
17
+ "minimum": 1
18
+ },
19
+ "payload": {
20
+ "type": "object",
21
+ "properties": {
22
+ "sessionId": {
23
+ "description": "The session identifier.",
24
+ "type": "string"
25
+ }
26
+ },
27
+ "required": [
28
+ "sessionId"
29
+ ]
30
+ }
31
+ },
32
+ "required": [
33
+ "type",
34
+ "seq",
35
+ "payload"
36
+ ],
37
+ "additionalProperties": false
38
+ },
39
+ "session.ended": {
40
+ "type": "object",
41
+ "description": "The session was closed and its resources released.",
42
+ "properties": {
43
+ "type": {
44
+ "const": "session.ended"
45
+ },
46
+ "seq": {
47
+ "type": "integer",
48
+ "minimum": 1
49
+ },
50
+ "payload": {
51
+ "type": "object",
52
+ "properties": {
53
+ "sessionId": {
54
+ "description": "The session identifier.",
55
+ "type": "string"
56
+ },
57
+ "reason": {
58
+ "description": "Why the session ended: closed, aborted, error, ...",
59
+ "type": "string"
60
+ }
61
+ },
62
+ "required": [
63
+ "sessionId"
64
+ ]
65
+ }
66
+ },
67
+ "required": [
68
+ "type",
69
+ "seq",
70
+ "payload"
71
+ ],
72
+ "additionalProperties": false
73
+ },
74
+ "turn.started": {
75
+ "type": "object",
76
+ "description": "A turn (prompt → response → tool loop) began.",
77
+ "properties": {
78
+ "type": {
79
+ "const": "turn.started"
80
+ },
81
+ "seq": {
82
+ "type": "integer",
83
+ "minimum": 1
84
+ },
85
+ "payload": {
86
+ "type": "object",
87
+ "properties": {
88
+ "turnId": {
89
+ "description": "Identifies the turn; correlates all of its events.",
90
+ "type": "string"
91
+ }
92
+ },
93
+ "required": [
94
+ "turnId"
95
+ ]
96
+ }
97
+ },
98
+ "required": [
99
+ "type",
100
+ "seq",
101
+ "payload"
102
+ ],
103
+ "additionalProperties": false
104
+ },
105
+ "turn.completed": {
106
+ "type": "object",
107
+ "description": "A turn finished successfully. The accumulated response text is in `response`.",
108
+ "properties": {
109
+ "type": {
110
+ "const": "turn.completed"
111
+ },
112
+ "seq": {
113
+ "type": "integer",
114
+ "minimum": 1
115
+ },
116
+ "payload": {
117
+ "type": "object",
118
+ "properties": {
119
+ "turnId": {
120
+ "description": "The turn identifier.",
121
+ "type": "string"
122
+ },
123
+ "response": {
124
+ "description": "Final assistant text for the turn.",
125
+ "type": "string"
126
+ },
127
+ "inputTokens": {
128
+ "description": "LLM input tokens used in the turn.",
129
+ "type": "integer"
130
+ },
131
+ "outputTokens": {
132
+ "description": "LLM output tokens used in the turn.",
133
+ "type": "integer"
134
+ },
135
+ "cost": {
136
+ "description": "Estimated cost of the turn in USD.",
137
+ "type": "number"
138
+ }
139
+ },
140
+ "required": [
141
+ "turnId"
142
+ ]
143
+ }
144
+ },
145
+ "required": [
146
+ "type",
147
+ "seq",
148
+ "payload"
149
+ ],
150
+ "additionalProperties": false
151
+ },
152
+ "turn.failed": {
153
+ "type": "object",
154
+ "description": "A turn failed; the session remains usable.",
155
+ "properties": {
156
+ "type": {
157
+ "const": "turn.failed"
158
+ },
159
+ "seq": {
160
+ "type": "integer",
161
+ "minimum": 1
162
+ },
163
+ "payload": {
164
+ "type": "object",
165
+ "properties": {
166
+ "turnId": {
167
+ "description": "The turn identifier.",
168
+ "type": "string"
169
+ },
170
+ "error": {
171
+ "description": "Human-readable failure reason.",
172
+ "type": "string"
173
+ }
174
+ },
175
+ "required": [
176
+ "turnId",
177
+ "error"
178
+ ]
179
+ }
180
+ },
181
+ "required": [
182
+ "type",
183
+ "seq",
184
+ "payload"
185
+ ],
186
+ "additionalProperties": false
187
+ },
188
+ "turn.aborted": {
189
+ "type": "object",
190
+ "description": "A turn was aborted by the user (session/abort) or the host.",
191
+ "properties": {
192
+ "type": {
193
+ "const": "turn.aborted"
194
+ },
195
+ "seq": {
196
+ "type": "integer",
197
+ "minimum": 1
198
+ },
199
+ "payload": {
200
+ "type": "object",
201
+ "properties": {
202
+ "turnId": {
203
+ "description": "The turn identifier.",
204
+ "type": "string"
205
+ }
206
+ },
207
+ "required": [
208
+ "turnId"
209
+ ]
210
+ }
211
+ },
212
+ "required": [
213
+ "type",
214
+ "seq",
215
+ "payload"
216
+ ],
217
+ "additionalProperties": false
218
+ },
219
+ "model.streaming": {
220
+ "type": "object",
221
+ "description": "A delta of the assistant's response text.",
222
+ "properties": {
223
+ "type": {
224
+ "const": "model.streaming"
225
+ },
226
+ "seq": {
227
+ "type": "integer",
228
+ "minimum": 1
229
+ },
230
+ "payload": {
231
+ "type": "object",
232
+ "properties": {
233
+ "delta": {
234
+ "description": "The next chunk of text.",
235
+ "type": "string"
236
+ }
237
+ },
238
+ "required": [
239
+ "delta"
240
+ ]
241
+ }
242
+ },
243
+ "required": [
244
+ "type",
245
+ "seq",
246
+ "payload"
247
+ ],
248
+ "additionalProperties": false
249
+ },
250
+ "model.thinking": {
251
+ "type": "object",
252
+ "description": "A delta of the model's reasoning/thinking text (rendered collapsibly).",
253
+ "properties": {
254
+ "type": {
255
+ "const": "model.thinking"
256
+ },
257
+ "seq": {
258
+ "type": "integer",
259
+ "minimum": 1
260
+ },
261
+ "payload": {
262
+ "type": "object",
263
+ "properties": {
264
+ "delta": {
265
+ "description": "The next chunk of thinking text.",
266
+ "type": "string"
267
+ }
268
+ },
269
+ "required": [
270
+ "delta"
271
+ ]
272
+ }
273
+ },
274
+ "required": [
275
+ "type",
276
+ "seq",
277
+ "payload"
278
+ ],
279
+ "additionalProperties": false
280
+ },
281
+ "tool.use": {
282
+ "type": "object",
283
+ "description": "The model requested a tool call; execution is about to start.",
284
+ "properties": {
285
+ "type": {
286
+ "const": "tool.use"
287
+ },
288
+ "seq": {
289
+ "type": "integer",
290
+ "minimum": 1
291
+ },
292
+ "payload": {
293
+ "type": "object",
294
+ "properties": {
295
+ "id": {
296
+ "description": "Tool call identifier; correlates use/delta/result.",
297
+ "type": "string"
298
+ },
299
+ "name": {
300
+ "description": "Tool name, e.g. bash, write.",
301
+ "type": "string"
302
+ },
303
+ "args": {
304
+ "description": "Tool arguments (object or pre-serialized string)."
305
+ }
306
+ },
307
+ "required": [
308
+ "id",
309
+ "name"
310
+ ]
311
+ }
312
+ },
313
+ "required": [
314
+ "type",
315
+ "seq",
316
+ "payload"
317
+ ],
318
+ "additionalProperties": false
319
+ },
320
+ "tool.delta": {
321
+ "type": "object",
322
+ "description": "A partial result while a tool is executing.",
323
+ "properties": {
324
+ "type": {
325
+ "const": "tool.delta"
326
+ },
327
+ "seq": {
328
+ "type": "integer",
329
+ "minimum": 1
330
+ },
331
+ "payload": {
332
+ "type": "object",
333
+ "properties": {
334
+ "id": {
335
+ "description": "Tool call identifier.",
336
+ "type": "string"
337
+ },
338
+ "name": {
339
+ "description": "Tool name.",
340
+ "type": "string"
341
+ },
342
+ "partial": {
343
+ "description": "The next chunk of tool output.",
344
+ "type": "string"
345
+ }
346
+ },
347
+ "required": [
348
+ "id",
349
+ "name",
350
+ "partial"
351
+ ]
352
+ }
353
+ },
354
+ "required": [
355
+ "type",
356
+ "seq",
357
+ "payload"
358
+ ],
359
+ "additionalProperties": false
360
+ },
361
+ "tool.result": {
362
+ "type": "object",
363
+ "description": "A tool finished executing.",
364
+ "properties": {
365
+ "type": {
366
+ "const": "tool.result"
367
+ },
368
+ "seq": {
369
+ "type": "integer",
370
+ "minimum": 1
371
+ },
372
+ "payload": {
373
+ "type": "object",
374
+ "properties": {
375
+ "id": {
376
+ "description": "Tool call identifier.",
377
+ "type": "string"
378
+ },
379
+ "name": {
380
+ "description": "Tool name.",
381
+ "type": "string"
382
+ },
383
+ "output": {
384
+ "description": "Tool output (string or structured value)."
385
+ },
386
+ "isError": {
387
+ "description": "True when the tool failed.",
388
+ "type": "boolean"
389
+ },
390
+ "durationMs": {
391
+ "description": "Execution duration in milliseconds.",
392
+ "type": "integer"
393
+ }
394
+ },
395
+ "required": [
396
+ "id",
397
+ "name"
398
+ ]
399
+ }
400
+ },
401
+ "required": [
402
+ "type",
403
+ "seq",
404
+ "payload"
405
+ ],
406
+ "additionalProperties": false
407
+ },
408
+ "approval.required": {
409
+ "type": "object",
410
+ "description": "A tool is queued for human approval. Resolve via interaction/approve or interaction/reject.",
411
+ "properties": {
412
+ "type": {
413
+ "const": "approval.required"
414
+ },
415
+ "seq": {
416
+ "type": "integer",
417
+ "minimum": 1
418
+ },
419
+ "payload": {
420
+ "type": "object",
421
+ "properties": {
422
+ "id": {
423
+ "description": "Interaction id; used to resolve this request.",
424
+ "type": "string"
425
+ },
426
+ "toolName": {
427
+ "description": "The tool waiting for approval.",
428
+ "type": "string"
429
+ },
430
+ "args": {
431
+ "description": "Tool arguments under review."
432
+ },
433
+ "message": {
434
+ "description": "Reason the approval was requested.",
435
+ "type": "string"
436
+ },
437
+ "autoApprovable": {
438
+ "description": "True when a configured rule may auto-approve.",
439
+ "type": "boolean"
440
+ }
441
+ },
442
+ "required": [
443
+ "id",
444
+ "toolName"
445
+ ]
446
+ }
447
+ },
448
+ "required": [
449
+ "type",
450
+ "seq",
451
+ "payload"
452
+ ],
453
+ "additionalProperties": false,
454
+ "x-interaction": true
455
+ },
456
+ "approval.updated": {
457
+ "type": "object",
458
+ "description": "A pending approval was resolved.",
459
+ "properties": {
460
+ "type": {
461
+ "const": "approval.updated"
462
+ },
463
+ "seq": {
464
+ "type": "integer",
465
+ "minimum": 1
466
+ },
467
+ "payload": {
468
+ "type": "object",
469
+ "properties": {
470
+ "id": {
471
+ "description": "The interaction id from approval.required.",
472
+ "type": "string"
473
+ },
474
+ "status": {
475
+ "description": "How it was resolved.",
476
+ "enum": [
477
+ "approved",
478
+ "rejected"
479
+ ],
480
+ "type": "string"
481
+ }
482
+ },
483
+ "required": [
484
+ "id",
485
+ "status"
486
+ ]
487
+ }
488
+ },
489
+ "required": [
490
+ "type",
491
+ "seq",
492
+ "payload"
493
+ ],
494
+ "additionalProperties": false
495
+ },
496
+ "plan.proposed": {
497
+ "type": "object",
498
+ "description": "The agent proposed a plan (plan mode). Resolve via plan/approve or plan/reject.",
499
+ "properties": {
500
+ "type": {
501
+ "const": "plan.proposed"
502
+ },
503
+ "seq": {
504
+ "type": "integer",
505
+ "minimum": 1
506
+ },
507
+ "payload": {
508
+ "type": "object",
509
+ "properties": {
510
+ "id": {
511
+ "description": "Interaction id; used to resolve this proposal.",
512
+ "type": "string"
513
+ },
514
+ "plan": {
515
+ "description": "The proposed plan text.",
516
+ "type": "string"
517
+ }
518
+ },
519
+ "required": [
520
+ "id",
521
+ "plan"
522
+ ]
523
+ }
524
+ },
525
+ "required": [
526
+ "type",
527
+ "seq",
528
+ "payload"
529
+ ],
530
+ "additionalProperties": false,
531
+ "x-interaction": true
532
+ },
533
+ "plan.approved": {
534
+ "type": "object",
535
+ "description": "A proposed plan was approved and the agent may proceed.",
536
+ "properties": {
537
+ "type": {
538
+ "const": "plan.approved"
539
+ },
540
+ "seq": {
541
+ "type": "integer",
542
+ "minimum": 1
543
+ },
544
+ "payload": {
545
+ "type": "object",
546
+ "properties": {
547
+ "id": {
548
+ "description": "The interaction id from plan.proposed, when known.",
549
+ "type": "string"
550
+ },
551
+ "plan": {
552
+ "description": "The approved plan text.",
553
+ "type": "string"
554
+ }
555
+ },
556
+ "required": [
557
+ "plan"
558
+ ]
559
+ }
560
+ },
561
+ "required": [
562
+ "type",
563
+ "seq",
564
+ "payload"
565
+ ],
566
+ "additionalProperties": false
567
+ },
568
+ "plan.rejected": {
569
+ "type": "object",
570
+ "description": "A proposed plan was rejected; the agent stays in plan mode.",
571
+ "properties": {
572
+ "type": {
573
+ "const": "plan.rejected"
574
+ },
575
+ "seq": {
576
+ "type": "integer",
577
+ "minimum": 1
578
+ },
579
+ "payload": {
580
+ "type": "object",
581
+ "properties": {
582
+ "id": {
583
+ "description": "The interaction id from plan.proposed, when known.",
584
+ "type": "string"
585
+ },
586
+ "plan": {
587
+ "description": "The rejected plan text.",
588
+ "type": "string"
589
+ }
590
+ },
591
+ "required": [
592
+ "plan"
593
+ ]
594
+ }
595
+ },
596
+ "required": [
597
+ "type",
598
+ "seq",
599
+ "payload"
600
+ ],
601
+ "additionalProperties": false
602
+ },
603
+ "todos.updated": {
604
+ "type": "object",
605
+ "description": "The session's todo list changed. Payload carries the full list.",
606
+ "properties": {
607
+ "type": {
608
+ "const": "todos.updated"
609
+ },
610
+ "seq": {
611
+ "type": "integer",
612
+ "minimum": 1
613
+ },
614
+ "payload": {
615
+ "type": "object",
616
+ "properties": {
617
+ "todos": {
618
+ "description": "Full todo list: [{id, title, status}].",
619
+ "type": "array"
620
+ }
621
+ },
622
+ "required": [
623
+ "todos"
624
+ ]
625
+ }
626
+ },
627
+ "required": [
628
+ "type",
629
+ "seq",
630
+ "payload"
631
+ ],
632
+ "additionalProperties": false
633
+ },
634
+ "file.changed": {
635
+ "type": "object",
636
+ "description": "A file in the workspace changed (create/modify/delete).",
637
+ "properties": {
638
+ "type": {
639
+ "const": "file.changed"
640
+ },
641
+ "seq": {
642
+ "type": "integer",
643
+ "minimum": 1
644
+ },
645
+ "payload": {
646
+ "type": "object",
647
+ "properties": {
648
+ "path": {
649
+ "description": "Workspace-relative file path.",
650
+ "type": "string"
651
+ },
652
+ "type": {
653
+ "description": "Kind of change.",
654
+ "enum": [
655
+ "created",
656
+ "modified",
657
+ "deleted"
658
+ ],
659
+ "type": "string"
660
+ },
661
+ "patch": {
662
+ "description": "Unified diff text for created/modified files.",
663
+ "type": "string"
664
+ }
665
+ },
666
+ "required": [
667
+ "path",
668
+ "type"
669
+ ]
670
+ }
671
+ },
672
+ "required": [
673
+ "type",
674
+ "seq",
675
+ "payload"
676
+ ],
677
+ "additionalProperties": false
678
+ },
679
+ "error": {
680
+ "type": "object",
681
+ "description": "A non-fatal error was emitted outside a turn (recoverable when flagged).",
682
+ "properties": {
683
+ "type": {
684
+ "const": "error"
685
+ },
686
+ "seq": {
687
+ "type": "integer",
688
+ "minimum": 1
689
+ },
690
+ "payload": {
691
+ "type": "object",
692
+ "properties": {
693
+ "error": {
694
+ "description": "Error message.",
695
+ "type": "string"
696
+ },
697
+ "recoverable": {
698
+ "description": "True when the host can continue.",
699
+ "type": "boolean"
700
+ }
701
+ },
702
+ "required": [
703
+ "error"
704
+ ]
705
+ }
706
+ },
707
+ "required": [
708
+ "type",
709
+ "seq",
710
+ "payload"
711
+ ],
712
+ "additionalProperties": false
713
+ }
714
+ },
715
+ "interaction": {
716
+ "approval": {
717
+ "type": "object",
718
+ "properties": {
719
+ "id": {
720
+ "type": "string"
721
+ },
722
+ "kind": {
723
+ "const": "approval"
724
+ },
725
+ "status": {
726
+ "type": "string",
727
+ "enum": [
728
+ "pending",
729
+ "approved",
730
+ "rejected",
731
+ "responded",
732
+ "expired"
733
+ ]
734
+ },
735
+ "payload": {
736
+ "type": "object",
737
+ "properties": {
738
+ "toolName": {
739
+ "type": "string"
740
+ },
741
+ "args": {},
742
+ "message": {
743
+ "type": "string"
744
+ },
745
+ "autoApprovable": {
746
+ "type": "boolean"
747
+ }
748
+ },
749
+ "required": [
750
+ "toolName"
751
+ ]
752
+ }
753
+ },
754
+ "required": [
755
+ "id",
756
+ "kind",
757
+ "status",
758
+ "payload"
759
+ ],
760
+ "additionalProperties": false
761
+ },
762
+ "plan": {
763
+ "type": "object",
764
+ "properties": {
765
+ "id": {
766
+ "type": "string"
767
+ },
768
+ "kind": {
769
+ "const": "plan"
770
+ },
771
+ "status": {
772
+ "type": "string",
773
+ "enum": [
774
+ "pending",
775
+ "approved",
776
+ "rejected",
777
+ "responded",
778
+ "expired"
779
+ ]
780
+ },
781
+ "payload": {
782
+ "type": "object",
783
+ "properties": {
784
+ "plan": {
785
+ "type": "string"
786
+ }
787
+ },
788
+ "required": [
789
+ "plan"
790
+ ]
791
+ }
792
+ },
793
+ "required": [
794
+ "id",
795
+ "kind",
796
+ "status",
797
+ "payload"
798
+ ],
799
+ "additionalProperties": false
800
+ },
801
+ "user_input": {
802
+ "type": "object",
803
+ "properties": {
804
+ "id": {
805
+ "type": "string"
806
+ },
807
+ "kind": {
808
+ "const": "user_input"
809
+ },
810
+ "status": {
811
+ "type": "string",
812
+ "enum": [
813
+ "pending",
814
+ "approved",
815
+ "rejected",
816
+ "responded",
817
+ "expired"
818
+ ]
819
+ },
820
+ "payload": {
821
+ "type": "object",
822
+ "properties": {
823
+ "prompt": {
824
+ "description": "What the agent is asking the human.",
825
+ "type": "string"
826
+ },
827
+ "options": {
828
+ "description": "Suggested answers, when the host offers any.",
829
+ "type": "array"
830
+ }
831
+ },
832
+ "required": [
833
+ "prompt"
834
+ ]
835
+ }
836
+ },
837
+ "required": [
838
+ "id",
839
+ "kind",
840
+ "status",
841
+ "payload"
842
+ ],
843
+ "additionalProperties": false
844
+ }
845
+ },
846
+ "method": {
847
+ "ping": {
848
+ "type": "object",
849
+ "description": "Liveness check.",
850
+ "properties": {
851
+ "method": {
852
+ "const": "ping"
853
+ },
854
+ "params": {
855
+ "type": "object",
856
+ "properties": {}
857
+ }
858
+ },
859
+ "required": [
860
+ "method",
861
+ "params"
862
+ ],
863
+ "additionalProperties": false
864
+ },
865
+ "initialize": {
866
+ "type": "object",
867
+ "description": "Handshake: negotiate protocol version and exchange capabilities.",
868
+ "properties": {
869
+ "method": {
870
+ "const": "initialize"
871
+ },
872
+ "params": {
873
+ "type": "object",
874
+ "properties": {
875
+ "client": {
876
+ "description": "{name, version} of the client.",
877
+ "type": "object"
878
+ },
879
+ "capabilities": {
880
+ "description": "Client capabilities (informational).",
881
+ "type": "array"
882
+ }
883
+ }
884
+ }
885
+ },
886
+ "required": [
887
+ "method",
888
+ "params"
889
+ ],
890
+ "additionalProperties": false
891
+ },
892
+ "session/create": {
893
+ "type": "object",
894
+ "description": "Create a session in a workspace.",
895
+ "properties": {
896
+ "method": {
897
+ "const": "session/create"
898
+ },
899
+ "params": {
900
+ "type": "object",
901
+ "properties": {
902
+ "workspace": {
903
+ "description": "{workspacePath} of the project.",
904
+ "type": "object"
905
+ },
906
+ "mode": {
907
+ "description": "Permission mode, e.g. on_request, full_access.",
908
+ "type": "string"
909
+ },
910
+ "model": {
911
+ "description": "Model identifier.",
912
+ "type": "string"
913
+ },
914
+ "tools": {
915
+ "description": "Tool names to enable.",
916
+ "type": "array"
917
+ },
918
+ "systemPrompt": {
919
+ "description": "System prompt override.",
920
+ "type": "string"
921
+ }
922
+ }
923
+ }
924
+ },
925
+ "required": [
926
+ "method",
927
+ "params"
928
+ ],
929
+ "additionalProperties": false
930
+ },
931
+ "session/list": {
932
+ "type": "object",
933
+ "description": "List sessions, most recent first.",
934
+ "properties": {
935
+ "method": {
936
+ "const": "session/list"
937
+ },
938
+ "params": {
939
+ "type": "object",
940
+ "properties": {
941
+ "limit": {
942
+ "description": "Max sessions (default 20).",
943
+ "type": "integer"
944
+ }
945
+ }
946
+ }
947
+ },
948
+ "required": [
949
+ "method",
950
+ "params"
951
+ ],
952
+ "additionalProperties": false
953
+ },
954
+ "session/resume": {
955
+ "type": "object",
956
+ "description": "Resume/attach to an existing session.",
957
+ "properties": {
958
+ "method": {
959
+ "const": "session/resume"
960
+ },
961
+ "params": {
962
+ "type": "object",
963
+ "properties": {
964
+ "sessionId": {
965
+ "type": "string"
966
+ }
967
+ },
968
+ "required": [
969
+ "sessionId"
970
+ ]
971
+ }
972
+ },
973
+ "required": [
974
+ "method",
975
+ "params"
976
+ ],
977
+ "additionalProperties": false
978
+ },
979
+ "session/subscribe": {
980
+ "type": "object",
981
+ "description": "Subscribe to a session's event stream with replay support.",
982
+ "properties": {
983
+ "method": {
984
+ "const": "session/subscribe"
985
+ },
986
+ "params": {
987
+ "type": "object",
988
+ "properties": {
989
+ "sessionId": {
990
+ "type": "string"
991
+ },
992
+ "deliveryKind": {
993
+ "description": "Default: replay.",
994
+ "enum": [
995
+ "live",
996
+ "replay",
997
+ "web-remote-replayable"
998
+ ],
999
+ "type": "string"
1000
+ },
1001
+ "afterSeq": {
1002
+ "description": "Replay events after this seq.",
1003
+ "type": "integer"
1004
+ },
1005
+ "includeSnapshot": {
1006
+ "description": "Include a state snapshot in the result.",
1007
+ "type": "boolean"
1008
+ }
1009
+ },
1010
+ "required": [
1011
+ "sessionId"
1012
+ ]
1013
+ }
1014
+ },
1015
+ "required": [
1016
+ "method",
1017
+ "params"
1018
+ ],
1019
+ "additionalProperties": false
1020
+ },
1021
+ "session/events": {
1022
+ "type": "object",
1023
+ "description": "Poll events after a seq (for clients without a subscription).",
1024
+ "properties": {
1025
+ "method": {
1026
+ "const": "session/events"
1027
+ },
1028
+ "params": {
1029
+ "type": "object",
1030
+ "properties": {
1031
+ "sessionId": {
1032
+ "type": "string"
1033
+ },
1034
+ "afterSeq": {
1035
+ "description": "Default 0.",
1036
+ "type": "integer"
1037
+ },
1038
+ "limit": {
1039
+ "description": "Max events to return.",
1040
+ "type": "integer"
1041
+ }
1042
+ },
1043
+ "required": [
1044
+ "sessionId"
1045
+ ]
1046
+ }
1047
+ },
1048
+ "required": [
1049
+ "method",
1050
+ "params"
1051
+ ],
1052
+ "additionalProperties": false
1053
+ },
1054
+ "session/send": {
1055
+ "type": "object",
1056
+ "description": "Inject a message mid-run (barge-in) or prompt an idle session.",
1057
+ "properties": {
1058
+ "method": {
1059
+ "const": "session/send"
1060
+ },
1061
+ "params": {
1062
+ "type": "object",
1063
+ "properties": {
1064
+ "sessionId": {
1065
+ "type": "string"
1066
+ },
1067
+ "content": {
1068
+ "description": "The message text.",
1069
+ "type": "string"
1070
+ },
1071
+ "expectedTurnId": {
1072
+ "description": "Staleness guard: only steer this turn.",
1073
+ "type": "string"
1074
+ }
1075
+ },
1076
+ "required": [
1077
+ "sessionId",
1078
+ "content"
1079
+ ]
1080
+ }
1081
+ },
1082
+ "required": [
1083
+ "method",
1084
+ "params"
1085
+ ],
1086
+ "additionalProperties": false
1087
+ },
1088
+ "session/abort": {
1089
+ "type": "object",
1090
+ "description": "Abort the running turn.",
1091
+ "properties": {
1092
+ "method": {
1093
+ "const": "session/abort"
1094
+ },
1095
+ "params": {
1096
+ "type": "object",
1097
+ "properties": {
1098
+ "sessionId": {
1099
+ "type": "string"
1100
+ }
1101
+ },
1102
+ "required": [
1103
+ "sessionId"
1104
+ ]
1105
+ }
1106
+ },
1107
+ "required": [
1108
+ "method",
1109
+ "params"
1110
+ ],
1111
+ "additionalProperties": false
1112
+ },
1113
+ "session/close": {
1114
+ "type": "object",
1115
+ "description": "Close the session and release its resources.",
1116
+ "properties": {
1117
+ "method": {
1118
+ "const": "session/close"
1119
+ },
1120
+ "params": {
1121
+ "type": "object",
1122
+ "properties": {
1123
+ "sessionId": {
1124
+ "type": "string"
1125
+ }
1126
+ },
1127
+ "required": [
1128
+ "sessionId"
1129
+ ]
1130
+ }
1131
+ },
1132
+ "required": [
1133
+ "method",
1134
+ "params"
1135
+ ],
1136
+ "additionalProperties": false
1137
+ },
1138
+ "session/artifacts": {
1139
+ "type": "object",
1140
+ "description": "List the session's tool artifacts.",
1141
+ "properties": {
1142
+ "method": {
1143
+ "const": "session/artifacts"
1144
+ },
1145
+ "params": {
1146
+ "type": "object",
1147
+ "properties": {
1148
+ "sessionId": {
1149
+ "type": "string"
1150
+ }
1151
+ },
1152
+ "required": [
1153
+ "sessionId"
1154
+ ]
1155
+ }
1156
+ },
1157
+ "required": [
1158
+ "method",
1159
+ "params"
1160
+ ],
1161
+ "additionalProperties": false
1162
+ },
1163
+ "session/artifact/get": {
1164
+ "type": "object",
1165
+ "description": "Fetch one artifact's content.",
1166
+ "properties": {
1167
+ "method": {
1168
+ "const": "session/artifact/get"
1169
+ },
1170
+ "params": {
1171
+ "type": "object",
1172
+ "properties": {
1173
+ "sessionId": {
1174
+ "type": "string"
1175
+ },
1176
+ "artifactId": {
1177
+ "type": "string"
1178
+ }
1179
+ },
1180
+ "required": [
1181
+ "sessionId",
1182
+ "artifactId"
1183
+ ]
1184
+ }
1185
+ },
1186
+ "required": [
1187
+ "method",
1188
+ "params"
1189
+ ],
1190
+ "additionalProperties": false
1191
+ },
1192
+ "interaction/list": {
1193
+ "type": "object",
1194
+ "description": "List pending interactions for a session.",
1195
+ "properties": {
1196
+ "method": {
1197
+ "const": "interaction/list"
1198
+ },
1199
+ "params": {
1200
+ "type": "object",
1201
+ "properties": {
1202
+ "sessionId": {
1203
+ "type": "string"
1204
+ }
1205
+ },
1206
+ "required": [
1207
+ "sessionId"
1208
+ ]
1209
+ }
1210
+ },
1211
+ "required": [
1212
+ "method",
1213
+ "params"
1214
+ ],
1215
+ "additionalProperties": false
1216
+ },
1217
+ "interaction/approve": {
1218
+ "type": "object",
1219
+ "description": "Approve a pending interaction by id (approval.required).",
1220
+ "properties": {
1221
+ "method": {
1222
+ "const": "interaction/approve"
1223
+ },
1224
+ "params": {
1225
+ "type": "object",
1226
+ "properties": {
1227
+ "sessionId": {
1228
+ "type": "string"
1229
+ },
1230
+ "interactionId": {
1231
+ "type": "string"
1232
+ }
1233
+ },
1234
+ "required": [
1235
+ "sessionId",
1236
+ "interactionId"
1237
+ ]
1238
+ }
1239
+ },
1240
+ "required": [
1241
+ "method",
1242
+ "params"
1243
+ ],
1244
+ "additionalProperties": false
1245
+ },
1246
+ "interaction/reject": {
1247
+ "type": "object",
1248
+ "description": "Reject a pending interaction by id (approval.required).",
1249
+ "properties": {
1250
+ "method": {
1251
+ "const": "interaction/reject"
1252
+ },
1253
+ "params": {
1254
+ "type": "object",
1255
+ "properties": {
1256
+ "sessionId": {
1257
+ "type": "string"
1258
+ },
1259
+ "interactionId": {
1260
+ "type": "string"
1261
+ }
1262
+ },
1263
+ "required": [
1264
+ "sessionId",
1265
+ "interactionId"
1266
+ ]
1267
+ }
1268
+ },
1269
+ "required": [
1270
+ "method",
1271
+ "params"
1272
+ ],
1273
+ "additionalProperties": false
1274
+ },
1275
+ "interaction/approve-all": {
1276
+ "type": "object",
1277
+ "description": "Approve every pending approval interaction.",
1278
+ "properties": {
1279
+ "method": {
1280
+ "const": "interaction/approve-all"
1281
+ },
1282
+ "params": {
1283
+ "type": "object",
1284
+ "properties": {
1285
+ "sessionId": {
1286
+ "type": "string"
1287
+ }
1288
+ },
1289
+ "required": [
1290
+ "sessionId"
1291
+ ]
1292
+ }
1293
+ },
1294
+ "required": [
1295
+ "method",
1296
+ "params"
1297
+ ],
1298
+ "additionalProperties": false
1299
+ },
1300
+ "interaction/reject-all": {
1301
+ "type": "object",
1302
+ "description": "Reject every pending approval interaction.",
1303
+ "properties": {
1304
+ "method": {
1305
+ "const": "interaction/reject-all"
1306
+ },
1307
+ "params": {
1308
+ "type": "object",
1309
+ "properties": {
1310
+ "sessionId": {
1311
+ "type": "string"
1312
+ }
1313
+ },
1314
+ "required": [
1315
+ "sessionId"
1316
+ ]
1317
+ }
1318
+ },
1319
+ "required": [
1320
+ "method",
1321
+ "params"
1322
+ ],
1323
+ "additionalProperties": false
1324
+ },
1325
+ "interaction/respond": {
1326
+ "type": "object",
1327
+ "description": "Answer a user_input interaction by id (elicitation).",
1328
+ "properties": {
1329
+ "method": {
1330
+ "const": "interaction/respond"
1331
+ },
1332
+ "params": {
1333
+ "type": "object",
1334
+ "properties": {
1335
+ "sessionId": {
1336
+ "type": "string"
1337
+ },
1338
+ "interactionId": {
1339
+ "type": "string"
1340
+ },
1341
+ "response": {
1342
+ "type": "string"
1343
+ }
1344
+ },
1345
+ "required": [
1346
+ "sessionId",
1347
+ "interactionId",
1348
+ "response"
1349
+ ]
1350
+ }
1351
+ },
1352
+ "required": [
1353
+ "method",
1354
+ "params"
1355
+ ],
1356
+ "additionalProperties": false
1357
+ },
1358
+ "plan/approve": {
1359
+ "type": "object",
1360
+ "description": "Approve the pending plan proposal (plan.proposed).",
1361
+ "properties": {
1362
+ "method": {
1363
+ "const": "plan/approve"
1364
+ },
1365
+ "params": {
1366
+ "type": "object",
1367
+ "properties": {
1368
+ "sessionId": {
1369
+ "type": "string"
1370
+ }
1371
+ },
1372
+ "required": [
1373
+ "sessionId"
1374
+ ]
1375
+ }
1376
+ },
1377
+ "required": [
1378
+ "method",
1379
+ "params"
1380
+ ],
1381
+ "additionalProperties": false
1382
+ },
1383
+ "plan/reject": {
1384
+ "type": "object",
1385
+ "description": "Reject the pending plan proposal; the agent stays in plan mode.",
1386
+ "properties": {
1387
+ "method": {
1388
+ "const": "plan/reject"
1389
+ },
1390
+ "params": {
1391
+ "type": "object",
1392
+ "properties": {
1393
+ "sessionId": {
1394
+ "type": "string"
1395
+ }
1396
+ },
1397
+ "required": [
1398
+ "sessionId"
1399
+ ]
1400
+ }
1401
+ },
1402
+ "required": [
1403
+ "method",
1404
+ "params"
1405
+ ],
1406
+ "additionalProperties": false
1407
+ },
1408
+ "workspace/readState": {
1409
+ "type": "object",
1410
+ "description": "Read the host's workspace state (path, git, mode).",
1411
+ "properties": {
1412
+ "method": {
1413
+ "const": "workspace/readState"
1414
+ },
1415
+ "params": {
1416
+ "type": "object",
1417
+ "properties": {}
1418
+ }
1419
+ },
1420
+ "required": [
1421
+ "method",
1422
+ "params"
1423
+ ],
1424
+ "additionalProperties": false
1425
+ }
1426
+ }
1427
+ }
1428
+ }