-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathactions.schema.json
More file actions
9042 lines (9042 loc) · 375 KB
/
Copy pathactions.schema.json
File metadata and controls
9042 lines (9042 loc) · 375 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$comment": "Generated from types/actions.ts — do not edit",
"$id": "https://microsoft.github.io/agent-host-protocol/schema/actions.schema.json",
"title": "AHP Action Types",
"description": "All action types in the Agent Host Protocol.",
"$defs": {
"ActionOrigin": {
"type": "object",
"description": "Identifies the client that originally dispatched an action.",
"properties": {
"clientId": {
"type": "string"
},
"clientSeq": {
"type": "number"
}
},
"required": [
"clientId",
"clientSeq"
]
},
"ActionEnvelope": {
"type": "object",
"description": "Every action is wrapped in an `ActionEnvelope`.\n\nThe envelope identifies the channel the action belongs to (e.g.\n`ahp-root://` for root actions, the session URI for session actions, the\nterminal URI for terminal actions). Individual action payloads carry only\nfields that are intrinsic to the action; the channel comes from the\nenvelope so that any subscribable resource can route its actions uniformly.",
"properties": {
"channel": {
"$ref": "#/$defs/URI",
"description": "Channel URI this action belongs to."
},
"action": {
"$ref": "#/$defs/StateAction"
},
"serverSeq": {
"type": "number"
},
"origin": {
"$ref": "#/$defs/ActionOrigin"
},
"rejectionReason": {
"type": "string"
}
},
"required": [
"channel",
"action",
"serverSeq"
]
},
"RootAgentsChangedAction": {
"type": "object",
"description": "Fired when available agent backends or their models change.",
"properties": {
"type": {
"const": "root/agentsChanged"
},
"agents": {
"type": "array",
"items": {
"$ref": "#/$defs/AgentInfo"
},
"description": "Updated agent list"
}
},
"required": [
"type",
"agents"
]
},
"RootActiveSessionsChangedAction": {
"type": "object",
"description": "Fired when the number of active sessions changes.",
"properties": {
"type": {
"const": "root/activeSessionsChanged"
},
"activeSessions": {
"type": "number",
"description": "Current count of active sessions"
}
},
"required": [
"type",
"activeSessions"
]
},
"RootTerminalsChangedAction": {
"type": "object",
"description": "Fired when the list of known terminals changes.\n\nFull-replacement semantics: the `terminals` array replaces the previous\n`terminals` entirely.",
"properties": {
"type": {
"const": "root/terminalsChanged"
},
"terminals": {
"type": "array",
"items": {
"$ref": "#/$defs/TerminalInfo"
},
"description": "Updated terminal list (full replacement)"
}
},
"required": [
"type",
"terminals"
]
},
"RootConfigChangedAction": {
"type": "object",
"description": "Fired when agent-host configuration values change.\n\nBy default, the reducer merges the new values into `state.config.values`.\nSet `replace` to `true` to replace all values instead of merging.",
"properties": {
"type": {
"const": "root/configChanged"
},
"config": {
"type": "object",
"additionalProperties": {},
"description": "Updated config values"
},
"replace": {
"type": "boolean",
"description": "When `true`, replaces all config values instead of merging"
}
},
"required": [
"type",
"config"
]
},
"SessionReadyAction": {
"type": "object",
"description": "Session backend initialized successfully.",
"properties": {
"type": {
"const": "session/ready"
}
},
"required": [
"type"
]
},
"SessionCreationFailedAction": {
"type": "object",
"description": "Session backend failed to initialize.",
"properties": {
"type": {
"const": "session/creationFailed"
},
"error": {
"$ref": "#/$defs/ErrorInfo",
"description": "Error details"
}
},
"required": [
"type",
"error"
]
},
"SessionChatAddedAction": {
"type": "object",
"description": "A chat was added to this session's catalog. Upsert semantics: if a chat\nwith the same `summary.resource` already exists, the existing entry is\nreplaced.\n\nMirrors the root-channel `root/sessionAdded` notification.",
"properties": {
"type": {
"const": "session/chatAdded"
},
"summary": {
"$ref": "#/$defs/ChatSummary",
"description": "The full summary of the newly added (or upserted) chat."
}
},
"required": [
"type",
"summary"
]
},
"SessionChatRemovedAction": {
"type": "object",
"description": "A chat was removed from this session's catalog. No-op when no entry matches.\n\nMirrors the root-channel `root/sessionRemoved` notification.",
"properties": {
"type": {
"const": "session/chatRemoved"
},
"chat": {
"$ref": "#/$defs/URI",
"description": "The URI of the chat to remove."
}
},
"required": [
"type",
"chat"
]
},
"SessionChatUpdatedAction": {
"type": "object",
"description": "One existing chat's summary fields changed.\n\nPartial-update semantics: only fields present in `changes` are written;\nomitted fields are preserved. Identity fields (`resource`) MUST NOT be\ncarried in `changes`. No-op when no entry with `chat` exists — clients\nSHOULD then wait for a {@link SessionChatAddedAction | `session/chatAdded`}.\n\nMirrors the root-channel `root/sessionSummaryChanged` notification.",
"properties": {
"type": {
"const": "session/chatUpdated"
},
"chat": {
"$ref": "#/$defs/URI",
"description": "The URI of the chat whose summary changed."
},
"changes": {
"type": "object",
"properties": {
"resource": {
"$ref": "#/$defs/URI",
"description": "Chat URI"
},
"title": {
"type": "string",
"description": "Chat title"
},
"status": {
"$ref": "#/$defs/SessionStatus",
"description": "Current chat status (reuses SessionStatus shape)"
},
"activity": {
"type": "string",
"description": "Human-readable description of what the chat is currently doing"
},
"modifiedAt": {
"type": "string",
"description": "Last modification timestamp (ISO 8601, e.g. `\"2025-03-10T18:42:03.123Z\"`)"
},
"origin": {
"$ref": "#/$defs/ChatOrigin",
"description": "How this chat came into existence"
},
"interactivity": {
"$ref": "#/$defs/ChatInteractivity",
"description": "How the user can interact with this chat. See {@link ChatInteractivity}.\n\nSupports agent-team patterns where worker chats are read-only or hidden.\nAbsence defaults to {@link ChatInteractivity.Full} for backward\ncompatibility."
},
"workingDirectories": {
"type": "array",
"items": {
"$ref": "#/$defs/URI"
},
"description": "The subset of the session's working directories this chat uses.\nSee {@link ChatState.workingDirectories} for the full semantics."
}
},
"description": "Mutable summary fields that changed; omitted fields are unchanged.\n\nIdentity fields (`resource`) never change and MUST be omitted by\nsenders; receivers SHOULD ignore them if present."
}
},
"required": [
"type",
"chat",
"changes"
]
},
"SessionDefaultChatChangedAction": {
"type": "object",
"description": "The default chat input-routing hint for this session changed.",
"properties": {
"type": {
"const": "session/defaultChatChanged"
},
"defaultChat": {
"$ref": "#/$defs/URI",
"description": "New default chat URI, or `undefined` to clear the hint."
}
},
"required": [
"type"
]
},
"SessionTitleChangedAction": {
"type": "object",
"description": "Session title updated. Fired by the server when the title is auto-generated\nfrom conversation, or dispatched by a client to rename a session.",
"properties": {
"type": {
"const": "session/titleChanged"
},
"title": {
"type": "string",
"description": "New title"
}
},
"required": [
"type",
"title"
]
},
"SessionIsReadChangedAction": {
"type": "object",
"description": "The read state of the session changed.\n\nDispatched by a client to mark a session as read (e.g. after viewing it)\nor unread (e.g. after new activity since the client last looked at it).",
"properties": {
"type": {
"const": "session/isReadChanged"
},
"isRead": {
"type": "boolean",
"description": "Whether the session has been read"
}
},
"required": [
"type",
"isRead"
]
},
"SessionIsArchivedChangedAction": {
"type": "object",
"description": "The archived state of the session changed.\n\nDispatched by a client to archive a session (e.g. the task is\ncomplete) or to unarchive it.",
"properties": {
"type": {
"const": "session/isArchivedChanged"
},
"isArchived": {
"type": "boolean",
"description": "Whether the session is archived"
}
},
"required": [
"type",
"isArchived"
]
},
"SessionActivityChangedAction": {
"type": "object",
"description": "The activity description of the session changed.\n\nDispatched by the server to indicate what the session is currently doing\n(e.g. running a tool, thinking). Clear activity by setting it to `undefined`.",
"properties": {
"type": {
"const": "session/activityChanged"
},
"activity": {
"type": "string",
"description": "Human-readable description of current activity, or `undefined` to clear"
}
},
"required": [
"type"
]
},
"SessionChangesetsChangedAction": {
"type": "object",
"description": "The {@link Changeset | catalogue of changesets} the agent host\nadvertises for this session changed. Replaces\n{@link SessionState.changesets | `state.changesets`} entirely\n(full-replacement semantics) — set to `undefined` to clear the\ncatalogue.\n\nProducers dispatch this whenever entries are added or removed. The\nfan-out happens through this action so observers see catalogue\nmutations in the same {@link ChangesetAction | per-changeset} action\nstream they already follow for file-level updates.",
"properties": {
"type": {
"const": "session/changesetsChanged"
},
"changesets": {
"type": "array",
"items": {
"$ref": "#/$defs/Changeset"
},
"description": "New catalogue, or `undefined` to clear it"
}
},
"required": [
"type"
]
},
"SessionServerToolsChangedAction": {
"type": "object",
"description": "Server tools for this session have changed.\n\nFull-replacement semantics: the `tools` array replaces the previous `serverTools` entirely.",
"properties": {
"type": {
"const": "session/serverToolsChanged"
},
"tools": {
"type": "array",
"items": {
"$ref": "#/$defs/ToolDefinition"
},
"description": "Updated server tools list (full replacement)"
}
},
"required": [
"type",
"tools"
]
},
"SessionActiveClientSetAction": {
"type": "object",
"description": "An active client for this session was added or updated.\n\nUpsert semantics keyed by {@link SessionActiveClient.clientId | `clientId`}:\na client dispatches this action with its own `SessionActiveClient` to join\nthe session's active clients or refresh its entry, replacing any existing\nentry that has the same `clientId`. Multiple clients may be active at once.\nThis is also how a client updates its published tools or customizations —\nre-dispatch with the full, updated entry. Use\n{@link SessionActiveClientRemovedAction | `session/activeClientRemoved`} to\nleave. The server SHOULD automatically dispatch that removal when an active\nclient disconnects.",
"properties": {
"type": {
"const": "session/activeClientSet"
},
"activeClient": {
"$ref": "#/$defs/SessionActiveClient",
"description": "The active client to add or update, matched by `clientId`."
}
},
"required": [
"type",
"activeClient"
]
},
"SessionActiveClientRemovedAction": {
"type": "object",
"description": "An active client was removed from this session.\n\nRemoves the entry for the client identified by `clientId` from\n{@link SessionState.activeClients}; a no-op when no entry matches.\n\nThe host SHOULD dispatch this automatically when a client stops participating\nin the session — for example when it unsubscribes from the session channel,\nwhen it disconnects and does not reconnect within a host-defined grace\nperiod, or when a `reconnect` command's `subscriptions` omit a session the\nclient was still active in. When removing a client, the host SHOULD also\ncancel that client's in-flight tool calls — those whose tool call state\ncarries a client `ToolCallContributor` with the matching `clientId` — by\ndispatching `chat/toolCallComplete` with `result.success = false`. (There is\nno per-tool-call server cancel; a failed completion is the cancellation\nmechanism, and the call ends in `completed` status with a failed result.)",
"properties": {
"type": {
"const": "session/activeClientRemoved"
},
"clientId": {
"type": "string",
"description": "The `clientId` of the active client to remove."
}
},
"required": [
"type",
"clientId"
]
},
"SessionWorkingDirectorySetAction": {
"type": "object",
"description": "A working directory was added to the session's\n{@link SessionState.workingDirectories} set.\n\nMembership semantics keyed by the directory URI: the reducer appends\n`directory` when the set does not already contain it (creating the set if\nabsent) and is a no-op when it is already present. Only valid when the agent\nadvertises {@link AgentCapabilities.multipleWorkingDirectories}.",
"properties": {
"type": {
"const": "session/workingDirectorySet"
},
"directory": {
"$ref": "#/$defs/URI",
"description": "The working directory to grant the session's agent tool access to."
}
},
"required": [
"type",
"directory"
]
},
"SessionWorkingDirectoryRemovedAction": {
"type": "object",
"description": "A working directory was removed from the session's\n{@link SessionState.workingDirectories} set.\n\nRemoves `directory` from the set; a no-op when it is not present. There is no\natomic backend \"remove one\" primitive — a host reconfigures its agent to the\nreduced set — so this action is safe to model as idempotent. A host MAY\ndecline to apply the removal (e.g. an immutable primary directory, see\n{@link MultipleWorkingDirectoriesCapability.immutablePrimary}); it then leaves\nthe set unchanged. When the agent advertises\n{@link MultipleWorkingDirectoriesCapability.primaryReplacement}, clients MUST\nNOT use this generic membership action to remove index `0`; the host MUST\nreject such a removal, leaving the protected slot intact.",
"properties": {
"type": {
"const": "session/workingDirectoryRemoved"
},
"directory": {
"$ref": "#/$defs/URI",
"description": "The working directory to revoke the session's agent tool access to."
}
},
"required": [
"type",
"directory"
]
},
"SessionWorkingDirectoryReplacedAction": {
"type": "object",
"description": "Atomically replaces one of the session's working directories.\n\nThis is a targeted compare-and-swap: the reducer is a no-op when\n{@link SessionState.workingDirectories} does not contain `directory`.\nOtherwise it replaces that entry with `replacement` and deduplicates the\nresult, preserving every other directory's relative order. When\n`replacement` occurs after the target, it moves to the target's position;\nfor example, `[A, B, C]` with `B → C` becomes `[A, C]`. When it occurs\nbefore the target, it retains its earlier position and the target is removed;\n`[A, B, C]` with `C → A` becomes `[A, B]`.\n\nOnly valid when the agent advertises\n{@link AgentCapabilities.multipleWorkingDirectories}. Replacing index `0`\nadditionally requires\n{@link MultipleWorkingDirectoriesCapability.primaryReplacement}; clients\nMUST NOT target an immutable primary. The host MUST validate and apply its\nbackend side effect before broadcasting an accepted action, or reject it.",
"properties": {
"type": {
"const": "session/workingDirectoryReplaced"
},
"directory": {
"$ref": "#/$defs/URI",
"description": "URI of the existing entry to replace."
},
"replacement": {
"$ref": "#/$defs/URI",
"description": "URI to place in the replaced entry's position."
}
},
"required": [
"type",
"directory",
"replacement"
]
},
"SessionInputNeededSetAction": {
"type": "object",
"description": "A session-level input request was added or updated.\n\nUpsert semantics keyed by {@link SessionInputRequest.id | `request.id`}: the\nhost dispatches this with the full {@link SessionInputRequest} to append a new\nentry to {@link SessionState.inputNeeded} or replace the existing entry with\nthe same `id`.\n\nServer-originated: the host mirrors chat-level requests (elicitations, tool\nconfirmations, client-tool executions) into the session aggregate so clients\nsubscribed only to the session channel can discover them. Clients respond by\ndispatching the ordinary `chat/*` action to the entry's `chat` channel — see\n{@link SessionInputRequest}.",
"properties": {
"type": {
"const": "session/inputNeededSet"
},
"request": {
"$ref": "#/$defs/SessionInputRequest",
"description": "The input request to add or update, matched by `id`."
}
},
"required": [
"type",
"request"
]
},
"SessionInputNeededRemovedAction": {
"type": "object",
"description": "A session-level input request was removed.\n\nRemoves the entry identified by `id` from\n{@link SessionState.inputNeeded}; a no-op when no entry matches.\n\nServer-originated: the host dispatches this once the underlying request\nresolves (the user answers, the tool call is confirmed, or the client\nreports its result).",
"properties": {
"type": {
"const": "session/inputNeededRemoved"
},
"id": {
"type": "string",
"description": "The `id` of the input request to remove."
}
},
"required": [
"type",
"id"
]
},
"SessionCustomizationsChangedAction": {
"type": "object",
"description": "The session's customizations have changed.\n\nFull-replacement semantics: the `customizations` array replaces the\nprevious `customizations` entirely.",
"properties": {
"type": {
"const": "session/customizationsChanged"
},
"customizations": {
"type": "array",
"items": {
"$ref": "#/$defs/Customization"
},
"description": "Updated customization list (full replacement)."
}
},
"required": [
"type",
"customizations"
]
},
"SessionCustomizationToggledAction": {
"type": "object",
"description": "A client updated a customization's enablement decisions.\n\nMatches `id` against every top-level customization first — a plugin or\ndirectory container, or a bare top-level MCP server — then against the\nchildren inside each container (a skill, agent, or other entry). Plugins\nand MCP servers retain the matched entry's explicit decisions; other\nentries update their `enabled` flag. Disabling a plugin still disables all\nof its children — the effective state of a plugin child is the plugin's\nderived enabled value and `(child.enabled ?? true)` — so toggling a child\nonly matters while its plugin is enabled. Is a no-op when no\ncustomization has the given `id`.\n\nThe `enablement` array completely replaces all explicit decisions. A caller\nchanging one scope must include every decision it intends to preserve.",
"properties": {
"type": {
"const": "session/customizationToggled"
},
"id": {
"type": "string",
"description": "The id of the container or child to update."
},
"enablement": {
"type": "array",
"items": {
"$ref": "#/$defs/CustomizationEnablement"
},
"description": "Explicit enablement decisions, replacing the previous list entirely."
}
},
"required": [
"type",
"id",
"enablement"
]
},
"SessionCustomizationUpdatedAction": {
"type": "object",
"description": "Upserts a top-level customization (plugin or directory).\n\nThe reducer locates the existing entry by `customization.id`:\n\n- If found, the entry is replaced entirely with `customization`,\n including its `children` array. To preserve existing children, the\n host must include them on the payload.\n- If not found, the entry is appended.",
"properties": {
"type": {
"const": "session/customizationUpdated"
},
"customization": {
"$ref": "#/$defs/Customization",
"description": "The customization to upsert (matched by `customization.id`)."
}
},
"required": [
"type",
"customization"
]
},
"SessionCustomizationRemovedAction": {
"type": "object",
"description": "Removes a customization by id.\n\nSearches every container and its children for the entry. If the entry\nis a container, its children are removed with it. Is a no-op when no\nmatching id is found.",
"properties": {
"type": {
"const": "session/customizationRemoved"
},
"id": {
"type": "string",
"description": "The id of the customization to remove."
}
},
"required": [
"type",
"id"
]
},
"SessionMcpServerStateChangedAction": {
"type": "object",
"description": "Updates the runtime fields of an existing\n{@link McpServerCustomization} — narrow alternative to\n{@link SessionCustomizationUpdatedAction} for the high-frequency\n`starting` ↔ `ready` ↔ `authRequired` transitions.\n\nLocates the target entry by `id`, searching both the top-level\ncustomization list and the `children` array of every container.\nReplaces the entry's {@link McpServerCustomization.state | `state`}\nand {@link McpServerCustomization.channel | `channel`}\n(full-replacement semantics: omit `channel` to clear an existing\nchannel URI). Other fields of the customization are preserved.\n\nIs a no-op when no matching `McpServerCustomization` is found. To\nupdate any other field (name, icons, `mcpApp` capabilities, etc.) use\n{@link SessionCustomizationUpdatedAction} instead.\n\nWhen the transition is to {@link McpServerStatus.AuthRequired}\nbecause of a request issued mid-turn, the host SHOULD also raise\n{@link SessionStatus.InputNeeded} on the session — see\n{@link McpServerAuthRequiredState} for the rationale.",
"properties": {
"type": {
"const": "session/mcpServerStateChanged"
},
"id": {
"type": "string",
"description": "The id of the {@link McpServerCustomization} to update."
},
"state": {
"$ref": "#/$defs/McpServerState",
"description": "The new lifecycle state."
},
"channel": {
"$ref": "#/$defs/URI",
"description": "Updated `mcp://` side-channel URI. Full-replacement: omit to clear\nan existing channel (typical when leaving\n{@link McpServerStatus.Ready | `Ready`})."
}
},
"required": [
"type",
"id",
"state"
]
},
"SessionMcpServerStartRequestedAction": {
"type": "object",
"description": "Requests that the host start or restart an existing\n{@link McpServerCustomization}.\n\nLocates the target entry by `id`, searching both the top-level\ncustomization list and the `children` array of every container. The\nreducer optimistically moves the server to\n{@link McpServerStatus.Starting | `starting`} and clears any previous\n{@link McpServerCustomization.channel | `channel`}; the host remains\nauthoritative and SHOULD follow with\n{@link SessionMcpServerStateChangedAction | `session/mcpServerStateChanged`}\nonce the server becomes ready, needs authentication, fails, or is\nrejected. Is a no-op when no matching `McpServerCustomization` is found.",
"properties": {
"type": {
"const": "session/mcpServerStartRequested"
},
"id": {
"type": "string",
"description": "The id of the {@link McpServerCustomization} to start."
}
},
"required": [
"type",
"id"
]
},
"SessionMcpServerStopRequestedAction": {
"type": "object",
"description": "Requests that the host stop an existing {@link McpServerCustomization}.\n\nLocates the target entry by `id`, searching both the top-level\ncustomization list and the `children` array of every container. The\nreducer optimistically moves the server to\n{@link McpServerStatus.Stopped | `stopped`} and clears any previous\n{@link McpServerCustomization.channel | `channel`}. Replacing an\n{@link McpServerStatus.AuthRequired | `authRequired`} lifecycle state with\n`stopped` unblocks the server from waiting on authentication. If the host\nalso raised session-level input-needed state solely for that MCP server, it\nSHOULD remove that input-needed entry when accepting the stop.\n\nThe host remains authoritative and MAY reject the action or follow with\n{@link SessionMcpServerStateChangedAction | `session/mcpServerStateChanged`}\nif the final lifecycle state differs. Is a no-op when no matching\n`McpServerCustomization` is found.",
"properties": {
"type": {
"const": "session/mcpServerStopRequested"
},
"id": {
"type": "string",
"description": "The id of the {@link McpServerCustomization} to stop."
}
},
"required": [
"type",
"id"
]
},
"SessionConfigChangedAction": {
"type": "object",
"description": "Client changed a mutable config value mid-session.\n\nOnly properties with `sessionMutable: true` in the config schema may be\nchanged. The server validates and broadcasts the action; the reducer merges\nthe new values into `state.config.values`.",
"properties": {
"type": {
"const": "session/configChanged"
},
"config": {
"type": "object",
"additionalProperties": {},
"description": "Updated config values"
},
"replace": {
"type": "boolean",
"description": "When `true`, replaces all config values instead of merging"
}
},
"required": [
"type",
"config"
]
},
"SessionMetaChangedAction": {
"type": "object",
"description": "The session's `_meta` side-channel changed. Replaces `state._meta`\nentirely (full-replacement semantics). Producers SHOULD merge any\nkeys they wish to preserve into the new value before dispatching.",
"properties": {
"type": {
"const": "session/metaChanged"
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "New `_meta` payload, or `undefined` to clear it"
}
},
"required": [
"type"
]
},
"ToolCallActionBase": {
"type": "object",
"description": "Base interface for all tool-call-scoped actions, carrying the common turn\nand tool call identifiers. The owning chat URI is identified by the\nenclosing {@link ActionEnvelope}'s `channel` field.",
"properties": {
"turnId": {
"type": "string",
"description": "Turn identifier"
},
"toolCallId": {
"type": "string",
"description": "Tool call identifier"
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional provider-specific metadata for this tool call.\n\nClients MAY look for well-known keys here to provide enhanced UI.\nFor example, a `ptyTerminal` key with `{ input: string; output: string }`\nindicates the tool operated on a terminal (both `input` and `output` may\ncontain escape sequences)."
}
},
"required": [
"turnId",
"toolCallId"
]
},
"ChatTurnStartedAction": {
"type": "object",
"description": "A new message has been sent to the agent, and a new turn starts.\n\nA client is only allowed to send {@link MessageKind.User} messages.",
"properties": {
"type": {
"const": "chat/turnStarted"
},
"turnId": {
"type": "string",
"description": "Turn identifier"
},
"startedAt": {
"type": "string",
"description": "ISO 8601 timestamp when this turn started."
},
"message": {
"$ref": "#/$defs/Message",
"description": "The new message"
},
"queuedMessageId": {
"type": "string",
"description": "If this turn was auto-started from a queued message, the ID of that message"
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional provider-specific metadata for this action.\n\nClients MAY look for well-known keys here to provide enhanced UI, and\nagent hosts MAY use it to carry per-event context that does not fit any\nother field — for example, attributing the event to a specific agent\n(such as a sub-agent acting within the turn). Mirrors the MCP `_meta`\nconvention."
}
},
"required": [
"type",
"turnId",
"startedAt",
"message"
]
},
"ChatDeltaAction": {
"type": "object",
"description": "Streaming text chunk from the assistant, appended to a specific response part.\n\nThe server MUST first emit a `chat/responsePart` to create the target\nmarkdown part, then use this action to append text to it.",
"properties": {
"type": {
"const": "chat/delta"
},
"turnId": {
"type": "string",
"description": "Turn identifier"
},
"partId": {
"type": "string",
"description": "Identifier of the response part to append to"
},
"content": {
"type": "string",
"description": "Text chunk"
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional provider-specific metadata for this action.\n\nClients MAY look for well-known keys here to provide enhanced UI, and\nagent hosts MAY use it to carry per-event context that does not fit any\nother field — for example, attributing the event to a specific agent\n(such as a sub-agent acting within the turn). Mirrors the MCP `_meta`\nconvention."
}
},
"required": [
"type",
"turnId",
"partId",
"content"
]
},
"ChatResponsePartAction": {
"type": "object",
"description": "Structured content appended to the response.\n\nAn {@link ErrorResponsePart} MUST be appended with {@link ChatErrorAction}\ninstead so adding the part and ending the turn are one atomic transition.",
"properties": {
"type": {
"const": "chat/responsePart"
},
"turnId": {
"type": "string",
"description": "Turn identifier"
},
"part": {
"$ref": "#/$defs/ResponsePart",
"description": "Response part to append; error parts are ignored."
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional provider-specific metadata for this action.\n\nClients MAY look for well-known keys here to provide enhanced UI, and\nagent hosts MAY use it to carry per-event context that does not fit any\nother field — for example, attributing the event to a specific agent\n(such as a sub-agent acting within the turn). Mirrors the MCP `_meta`\nconvention."
}
},
"required": [
"type",
"turnId",
"part"
]
},
"ChatToolCallStartAction": {
"type": "object",
"description": "A tool call begins — parameters are streaming from the LM.\n\nThe server sets {@link ToolCallContributor | `contributor`} to identify\nthe origin of the tool. For client-provided tools, the named client is\nresponsible for executing the tool once it reaches the `running` state\nand dispatching `chat/toolCallComplete`. For MCP-served tools, the\nserver executes the call against the named `McpServerCustomization`.",
"properties": {
"turnId": {
"type": "string",
"description": "Turn identifier"
},
"toolCallId": {
"type": "string",
"description": "Tool call identifier"
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional provider-specific metadata for this tool call.\n\nClients MAY look for well-known keys here to provide enhanced UI.\nFor example, a `ptyTerminal` key with `{ input: string; output: string }`\nindicates the tool operated on a terminal (both `input` and `output` may\ncontain escape sequences)."
},
"type": {
"const": "chat/toolCallStart"
},
"toolName": {
"type": "string",
"description": "Internal tool name (for debugging/logging)"
},
"displayName": {
"type": "string",
"description": "Human-readable tool name"
},
"intention": {
"type": "string",
"description": "Human-readable description of what the tool invocation intends to do"
},
"contributor": {
"$ref": "#/$defs/ToolCallContributor",
"description": "Reference to the contributor of the tool being called. Absent for\nserver-side tools that are not contributed by a client or MCP server."
}
},
"required": [
"turnId",
"toolCallId",
"type",
"toolName",
"displayName"
]
},
"ChatToolCallDeltaAction": {
"type": "object",
"description": "Streaming partial parameters for a tool call.",
"properties": {
"turnId": {
"type": "string",
"description": "Turn identifier"
},
"toolCallId": {
"type": "string",
"description": "Tool call identifier"
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional provider-specific metadata for this tool call.\n\nClients MAY look for well-known keys here to provide enhanced UI.\nFor example, a `ptyTerminal` key with `{ input: string; output: string }`\nindicates the tool operated on a terminal (both `input` and `output` may\ncontain escape sequences)."
},
"type": {
"const": "chat/toolCallDelta"
},
"content": {
"type": "string",
"description": "Partial parameter content to append, if provided by the host."
},
"invocationMessage": {
"$ref": "#/$defs/StringOrMarkdown",
"description": "Updated progress message"
}
},
"required": [
"turnId",
"toolCallId",
"type"
]
},
"ChatToolCallReadyAction": {
"type": "object",
"description": "Tool call parameters are complete, or a running tool requires re-confirmation.\n\nWhen dispatched for a `streaming` tool call, transitions to `pending-confirmation`\nor directly to `running` if `confirmed` is set.\n\nWhen dispatched for a `running` tool call (e.g. mid-execution permission needed),\ntransitions back to `pending-confirmation`. The `invocationMessage` and `_meta`\nSHOULD be updated to describe the specific confirmation needed. Clients use the\nstandard `chat/toolCallConfirmed` flow to approve or deny.\n\nFor client-provided tools, the server typically sets `confirmed` to\n`'not-needed'` so the tool transitions directly to `running`, where the\nowning client can begin execution immediately.",
"properties": {
"turnId": {
"type": "string",
"description": "Turn identifier"
},
"toolCallId": {
"type": "string",
"description": "Tool call identifier"
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional provider-specific metadata for this tool call.\n\nClients MAY look for well-known keys here to provide enhanced UI.\nFor example, a `ptyTerminal` key with `{ input: string; output: string }`\nindicates the tool operated on a terminal (both `input` and `output` may\ncontain escape sequences)."
},
"type": {
"const": "chat/toolCallReady"
},
"contributor": {
"$ref": "#/$defs/ToolCallContributor",
"description": "Final contributor metadata. MUST NOT change execution ownership established\nat `chat/toolCallStart`; a client contributor must keep the same `clientId`."
},
"intention": {
"type": "string",
"description": "Final human-readable description of what the tool invocation intends to do.\nWhen present, replaces the provisional intention from `chat/toolCallStart`."
},
"invocationMessage": {
"$ref": "#/$defs/StringOrMarkdown",
"description": "Message describing what the tool will do or what confirmation is needed"
},
"toolInput": {
"$ref": "#/$defs/ToolInput",
"description": "Final tool input"
},
"confirmationTitle": {
"$ref": "#/$defs/StringOrMarkdown",
"description": "Short title for the confirmation prompt (e.g. `\"Run in terminal\"`, `\"Write file\"`)"
},
"riskAssessment": {
"$ref": "#/$defs/ToolCallRiskAssessment",
"description": "Risk assessment that informed the confirmation requirement."
},
"edits": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/$defs/FileEdit"
}
}
},
"required": [
"items"
],
"description": "File edits that this tool call will perform, for preview before confirmation"
},
"editable": {
"type": "boolean",
"description": "Whether the agent host allows the client to edit the tool's input parameters before confirming"
},
"confirmed": {
"$ref": "#/$defs/ToolCallConfirmationReason",
"description": "If set, the tool was auto-confirmed and transitions directly to `running`"
},
"options": {
"type": "array",
"items": {
"$ref": "#/$defs/ConfirmationOption"
},
"description": "Options the server offers for this confirmation. When present, the client\nSHOULD render these instead of a plain approve/deny UI. Each option\nbelongs to a {@link ConfirmationOptionGroup} so the client can still\ncategorise the choices."
}
},
"required": [
"turnId",
"toolCallId",
"type",
"invocationMessage"
]
},
"ChatToolCallApprovedAction": {
"type": "object",
"description": "Client approves a pending tool call. The tool transitions to `running`.",
"properties": {
"turnId": {
"type": "string",
"description": "Turn identifier"
},
"toolCallId": {
"type": "string",
"description": "Tool call identifier"
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional provider-specific metadata for this tool call.\n\nClients MAY look for well-known keys here to provide enhanced UI.\nFor example, a `ptyTerminal` key with `{ input: string; output: string }`\nindicates the tool operated on a terminal (both `input` and `output` may\ncontain escape sequences)."
},
"type": {
"const": "chat/toolCallConfirmed"
},
"approved": {
"description": "The tool call was approved"
},
"confirmed": {
"$ref": "#/$defs/ToolCallConfirmationReason",
"description": "How the tool was confirmed"
},
"editedToolInput": {
"type": "string",
"description": "Edited tool input parameters, if the client modified them before confirming.\n\nFor inline `toolInput`, the reducer replaces the state value directly.\nFor referenced input, the host MUST replace the resource contents before\nechoing the accepted action."
},
"selectedOptionId": {
"type": "string",
"description": "ID of the selected confirmation option, if the server provided options"
}
},
"required": [
"turnId",
"toolCallId",
"type",
"approved",
"confirmed"
]
},
"ChatToolCallDeniedAction": {