-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathSessionEvents.cs
More file actions
4265 lines (3601 loc) · 179 KB
/
SessionEvents.cs
File metadata and controls
4265 lines (3601 loc) · 179 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
// AUTO-GENERATED FILE - DO NOT EDIT
// Generated from: session-events.schema.json
using System.Diagnostics;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace GitHub.Copilot.SDK;
/// <summary>
/// Provides the base class from which all session events derive.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
[JsonPolymorphic(
TypeDiscriminatorPropertyName = "type",
IgnoreUnrecognizedTypeDiscriminators = true)]
[JsonDerivedType(typeof(AbortEvent), "abort")]
[JsonDerivedType(typeof(AssistantIntentEvent), "assistant.intent")]
[JsonDerivedType(typeof(AssistantMessageEvent), "assistant.message")]
[JsonDerivedType(typeof(AssistantMessageDeltaEvent), "assistant.message_delta")]
[JsonDerivedType(typeof(AssistantReasoningEvent), "assistant.reasoning")]
[JsonDerivedType(typeof(AssistantReasoningDeltaEvent), "assistant.reasoning_delta")]
[JsonDerivedType(typeof(AssistantStreamingDeltaEvent), "assistant.streaming_delta")]
[JsonDerivedType(typeof(AssistantTurnEndEvent), "assistant.turn_end")]
[JsonDerivedType(typeof(AssistantTurnStartEvent), "assistant.turn_start")]
[JsonDerivedType(typeof(AssistantUsageEvent), "assistant.usage")]
[JsonDerivedType(typeof(CapabilitiesChangedEvent), "capabilities.changed")]
[JsonDerivedType(typeof(CommandCompletedEvent), "command.completed")]
[JsonDerivedType(typeof(CommandExecuteEvent), "command.execute")]
[JsonDerivedType(typeof(CommandQueuedEvent), "command.queued")]
[JsonDerivedType(typeof(CommandsChangedEvent), "commands.changed")]
[JsonDerivedType(typeof(ElicitationCompletedEvent), "elicitation.completed")]
[JsonDerivedType(typeof(ElicitationRequestedEvent), "elicitation.requested")]
[JsonDerivedType(typeof(ExitPlanModeCompletedEvent), "exit_plan_mode.completed")]
[JsonDerivedType(typeof(ExitPlanModeRequestedEvent), "exit_plan_mode.requested")]
[JsonDerivedType(typeof(ExternalToolCompletedEvent), "external_tool.completed")]
[JsonDerivedType(typeof(ExternalToolRequestedEvent), "external_tool.requested")]
[JsonDerivedType(typeof(HookEndEvent), "hook.end")]
[JsonDerivedType(typeof(HookStartEvent), "hook.start")]
[JsonDerivedType(typeof(McpOauthCompletedEvent), "mcp.oauth_completed")]
[JsonDerivedType(typeof(McpOauthRequiredEvent), "mcp.oauth_required")]
[JsonDerivedType(typeof(PendingMessagesModifiedEvent), "pending_messages.modified")]
[JsonDerivedType(typeof(PermissionCompletedEvent), "permission.completed")]
[JsonDerivedType(typeof(PermissionRequestedEvent), "permission.requested")]
[JsonDerivedType(typeof(SamplingCompletedEvent), "sampling.completed")]
[JsonDerivedType(typeof(SamplingRequestedEvent), "sampling.requested")]
[JsonDerivedType(typeof(SessionBackgroundTasksChangedEvent), "session.background_tasks_changed")]
[JsonDerivedType(typeof(SessionCompactionCompleteEvent), "session.compaction_complete")]
[JsonDerivedType(typeof(SessionCompactionStartEvent), "session.compaction_start")]
[JsonDerivedType(typeof(SessionContextChangedEvent), "session.context_changed")]
[JsonDerivedType(typeof(SessionCustomAgentsUpdatedEvent), "session.custom_agents_updated")]
[JsonDerivedType(typeof(SessionErrorEvent), "session.error")]
[JsonDerivedType(typeof(SessionExtensionsLoadedEvent), "session.extensions_loaded")]
[JsonDerivedType(typeof(SessionHandoffEvent), "session.handoff")]
[JsonDerivedType(typeof(SessionIdleEvent), "session.idle")]
[JsonDerivedType(typeof(SessionInfoEvent), "session.info")]
[JsonDerivedType(typeof(SessionMcpServerStatusChangedEvent), "session.mcp_server_status_changed")]
[JsonDerivedType(typeof(SessionMcpServersLoadedEvent), "session.mcp_servers_loaded")]
[JsonDerivedType(typeof(SessionModeChangedEvent), "session.mode_changed")]
[JsonDerivedType(typeof(SessionModelChangeEvent), "session.model_change")]
[JsonDerivedType(typeof(SessionPlanChangedEvent), "session.plan_changed")]
[JsonDerivedType(typeof(SessionRemoteSteerableChangedEvent), "session.remote_steerable_changed")]
[JsonDerivedType(typeof(SessionResumeEvent), "session.resume")]
[JsonDerivedType(typeof(SessionShutdownEvent), "session.shutdown")]
[JsonDerivedType(typeof(SessionSkillsLoadedEvent), "session.skills_loaded")]
[JsonDerivedType(typeof(SessionSnapshotRewindEvent), "session.snapshot_rewind")]
[JsonDerivedType(typeof(SessionStartEvent), "session.start")]
[JsonDerivedType(typeof(SessionTaskCompleteEvent), "session.task_complete")]
[JsonDerivedType(typeof(SessionTitleChangedEvent), "session.title_changed")]
[JsonDerivedType(typeof(SessionToolsUpdatedEvent), "session.tools_updated")]
[JsonDerivedType(typeof(SessionTruncationEvent), "session.truncation")]
[JsonDerivedType(typeof(SessionUsageInfoEvent), "session.usage_info")]
[JsonDerivedType(typeof(SessionWarningEvent), "session.warning")]
[JsonDerivedType(typeof(SessionWorkspaceFileChangedEvent), "session.workspace_file_changed")]
[JsonDerivedType(typeof(SkillInvokedEvent), "skill.invoked")]
[JsonDerivedType(typeof(SubagentCompletedEvent), "subagent.completed")]
[JsonDerivedType(typeof(SubagentDeselectedEvent), "subagent.deselected")]
[JsonDerivedType(typeof(SubagentFailedEvent), "subagent.failed")]
[JsonDerivedType(typeof(SubagentSelectedEvent), "subagent.selected")]
[JsonDerivedType(typeof(SubagentStartedEvent), "subagent.started")]
[JsonDerivedType(typeof(SystemMessageEvent), "system.message")]
[JsonDerivedType(typeof(SystemNotificationEvent), "system.notification")]
[JsonDerivedType(typeof(ToolExecutionCompleteEvent), "tool.execution_complete")]
[JsonDerivedType(typeof(ToolExecutionPartialResultEvent), "tool.execution_partial_result")]
[JsonDerivedType(typeof(ToolExecutionProgressEvent), "tool.execution_progress")]
[JsonDerivedType(typeof(ToolExecutionStartEvent), "tool.execution_start")]
[JsonDerivedType(typeof(ToolUserRequestedEvent), "tool.user_requested")]
[JsonDerivedType(typeof(UserInputCompletedEvent), "user_input.completed")]
[JsonDerivedType(typeof(UserInputRequestedEvent), "user_input.requested")]
[JsonDerivedType(typeof(UserMessageEvent), "user.message")]
public partial class SessionEvent
{
/// <summary>Unique event identifier (UUID v4), generated when the event is emitted.</summary>
[JsonPropertyName("id")]
public Guid Id { get; set; }
/// <summary>ISO 8601 timestamp when the event was created.</summary>
[JsonPropertyName("timestamp")]
public DateTimeOffset Timestamp { get; set; }
/// <summary>ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.</summary>
[JsonPropertyName("parentId")]
public Guid? ParentId { get; set; }
/// <summary>When true, the event is transient and not persisted to the session event log on disk.</summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ephemeral")]
public bool? Ephemeral { get; set; }
/// <summary>
/// The event type discriminator.
/// </summary>
[JsonIgnore]
public virtual string Type => "unknown";
/// <summary>Deserializes a JSON string into a <see cref="SessionEvent"/>.</summary>
public static SessionEvent FromJson(string json) =>
JsonSerializer.Deserialize(json, SessionEventsJsonContext.Default.SessionEvent)!;
/// <summary>Serializes this event to a JSON string.</summary>
public string ToJson() =>
JsonSerializer.Serialize(this, SessionEventsJsonContext.Default.SessionEvent);
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay => ToJson();
}
/// <summary>Session initialization metadata including context and configuration.</summary>
/// <remarks>Represents the <c>session.start</c> event.</remarks>
public partial class SessionStartEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.start";
/// <summary>The <c>session.start</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionStartData Data { get; set; }
}
/// <summary>Session resume metadata including current context and event count.</summary>
/// <remarks>Represents the <c>session.resume</c> event.</remarks>
public partial class SessionResumeEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.resume";
/// <summary>The <c>session.resume</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionResumeData Data { get; set; }
}
/// <summary>Notifies Mission Control that the session's remote steering capability has changed.</summary>
/// <remarks>Represents the <c>session.remote_steerable_changed</c> event.</remarks>
public partial class SessionRemoteSteerableChangedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.remote_steerable_changed";
/// <summary>The <c>session.remote_steerable_changed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionRemoteSteerableChangedData Data { get; set; }
}
/// <summary>Error details for timeline display including message and optional diagnostic information.</summary>
/// <remarks>Represents the <c>session.error</c> event.</remarks>
public partial class SessionErrorEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.error";
/// <summary>The <c>session.error</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionErrorData Data { get; set; }
}
/// <summary>Payload indicating the agent is idle; includes any background tasks still in flight.</summary>
/// <remarks>Represents the <c>session.idle</c> event.</remarks>
public partial class SessionIdleEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.idle";
/// <summary>The <c>session.idle</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionIdleData Data { get; set; }
}
/// <summary>Session title change payload containing the new display title.</summary>
/// <remarks>Represents the <c>session.title_changed</c> event.</remarks>
public partial class SessionTitleChangedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.title_changed";
/// <summary>The <c>session.title_changed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionTitleChangedData Data { get; set; }
}
/// <summary>Informational message for timeline display with categorization.</summary>
/// <remarks>Represents the <c>session.info</c> event.</remarks>
public partial class SessionInfoEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.info";
/// <summary>The <c>session.info</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionInfoData Data { get; set; }
}
/// <summary>Warning message for timeline display with categorization.</summary>
/// <remarks>Represents the <c>session.warning</c> event.</remarks>
public partial class SessionWarningEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.warning";
/// <summary>The <c>session.warning</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionWarningData Data { get; set; }
}
/// <summary>Model change details including previous and new model identifiers.</summary>
/// <remarks>Represents the <c>session.model_change</c> event.</remarks>
public partial class SessionModelChangeEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.model_change";
/// <summary>The <c>session.model_change</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionModelChangeData Data { get; set; }
}
/// <summary>Agent mode change details including previous and new modes.</summary>
/// <remarks>Represents the <c>session.mode_changed</c> event.</remarks>
public partial class SessionModeChangedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.mode_changed";
/// <summary>The <c>session.mode_changed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionModeChangedData Data { get; set; }
}
/// <summary>Plan file operation details indicating what changed.</summary>
/// <remarks>Represents the <c>session.plan_changed</c> event.</remarks>
public partial class SessionPlanChangedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.plan_changed";
/// <summary>The <c>session.plan_changed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionPlanChangedData Data { get; set; }
}
/// <summary>Workspace file change details including path and operation type.</summary>
/// <remarks>Represents the <c>session.workspace_file_changed</c> event.</remarks>
public partial class SessionWorkspaceFileChangedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.workspace_file_changed";
/// <summary>The <c>session.workspace_file_changed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionWorkspaceFileChangedData Data { get; set; }
}
/// <summary>Session handoff metadata including source, context, and repository information.</summary>
/// <remarks>Represents the <c>session.handoff</c> event.</remarks>
public partial class SessionHandoffEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.handoff";
/// <summary>The <c>session.handoff</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionHandoffData Data { get; set; }
}
/// <summary>Conversation truncation statistics including token counts and removed content metrics.</summary>
/// <remarks>Represents the <c>session.truncation</c> event.</remarks>
public partial class SessionTruncationEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.truncation";
/// <summary>The <c>session.truncation</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionTruncationData Data { get; set; }
}
/// <summary>Session rewind details including target event and count of removed events.</summary>
/// <remarks>Represents the <c>session.snapshot_rewind</c> event.</remarks>
public partial class SessionSnapshotRewindEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.snapshot_rewind";
/// <summary>The <c>session.snapshot_rewind</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionSnapshotRewindData Data { get; set; }
}
/// <summary>Session termination metrics including usage statistics, code changes, and shutdown reason.</summary>
/// <remarks>Represents the <c>session.shutdown</c> event.</remarks>
public partial class SessionShutdownEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.shutdown";
/// <summary>The <c>session.shutdown</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionShutdownData Data { get; set; }
}
/// <summary>Updated working directory and git context after the change.</summary>
/// <remarks>Represents the <c>session.context_changed</c> event.</remarks>
public partial class SessionContextChangedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.context_changed";
/// <summary>The <c>session.context_changed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionContextChangedData Data { get; set; }
}
/// <summary>Current context window usage statistics including token and message counts.</summary>
/// <remarks>Represents the <c>session.usage_info</c> event.</remarks>
public partial class SessionUsageInfoEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.usage_info";
/// <summary>The <c>session.usage_info</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionUsageInfoData Data { get; set; }
}
/// <summary>Context window breakdown at the start of LLM-powered conversation compaction.</summary>
/// <remarks>Represents the <c>session.compaction_start</c> event.</remarks>
public partial class SessionCompactionStartEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.compaction_start";
/// <summary>The <c>session.compaction_start</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionCompactionStartData Data { get; set; }
}
/// <summary>Conversation compaction results including success status, metrics, and optional error details.</summary>
/// <remarks>Represents the <c>session.compaction_complete</c> event.</remarks>
public partial class SessionCompactionCompleteEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.compaction_complete";
/// <summary>The <c>session.compaction_complete</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionCompactionCompleteData Data { get; set; }
}
/// <summary>Task completion notification with summary from the agent.</summary>
/// <remarks>Represents the <c>session.task_complete</c> event.</remarks>
public partial class SessionTaskCompleteEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "session.task_complete";
/// <summary>The <c>session.task_complete</c> event payload.</summary>
[JsonPropertyName("data")]
public required SessionTaskCompleteData Data { get; set; }
}
/// <summary>Represents the <c>user.message</c> event.</summary>
public partial class UserMessageEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "user.message";
/// <summary>The <c>user.message</c> event payload.</summary>
[JsonPropertyName("data")]
public required UserMessageData Data { get; set; }
}
/// <summary>Empty payload; the event signals that the pending message queue has changed.</summary>
/// <remarks>Represents the <c>pending_messages.modified</c> event.</remarks>
public partial class PendingMessagesModifiedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "pending_messages.modified";
/// <summary>The <c>pending_messages.modified</c> event payload.</summary>
[JsonPropertyName("data")]
public required PendingMessagesModifiedData Data { get; set; }
}
/// <summary>Turn initialization metadata including identifier and interaction tracking.</summary>
/// <remarks>Represents the <c>assistant.turn_start</c> event.</remarks>
public partial class AssistantTurnStartEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.turn_start";
/// <summary>The <c>assistant.turn_start</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantTurnStartData Data { get; set; }
}
/// <summary>Agent intent description for current activity or plan.</summary>
/// <remarks>Represents the <c>assistant.intent</c> event.</remarks>
public partial class AssistantIntentEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.intent";
/// <summary>The <c>assistant.intent</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantIntentData Data { get; set; }
}
/// <summary>Assistant reasoning content for timeline display with complete thinking text.</summary>
/// <remarks>Represents the <c>assistant.reasoning</c> event.</remarks>
public partial class AssistantReasoningEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.reasoning";
/// <summary>The <c>assistant.reasoning</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantReasoningData Data { get; set; }
}
/// <summary>Streaming reasoning delta for incremental extended thinking updates.</summary>
/// <remarks>Represents the <c>assistant.reasoning_delta</c> event.</remarks>
public partial class AssistantReasoningDeltaEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.reasoning_delta";
/// <summary>The <c>assistant.reasoning_delta</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantReasoningDeltaData Data { get; set; }
}
/// <summary>Streaming response progress with cumulative byte count.</summary>
/// <remarks>Represents the <c>assistant.streaming_delta</c> event.</remarks>
public partial class AssistantStreamingDeltaEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.streaming_delta";
/// <summary>The <c>assistant.streaming_delta</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantStreamingDeltaData Data { get; set; }
}
/// <summary>Assistant response containing text content, optional tool requests, and interaction metadata.</summary>
/// <remarks>Represents the <c>assistant.message</c> event.</remarks>
public partial class AssistantMessageEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.message";
/// <summary>The <c>assistant.message</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantMessageData Data { get; set; }
}
/// <summary>Streaming assistant message delta for incremental response updates.</summary>
/// <remarks>Represents the <c>assistant.message_delta</c> event.</remarks>
public partial class AssistantMessageDeltaEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.message_delta";
/// <summary>The <c>assistant.message_delta</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantMessageDeltaData Data { get; set; }
}
/// <summary>Turn completion metadata including the turn identifier.</summary>
/// <remarks>Represents the <c>assistant.turn_end</c> event.</remarks>
public partial class AssistantTurnEndEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.turn_end";
/// <summary>The <c>assistant.turn_end</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantTurnEndData Data { get; set; }
}
/// <summary>LLM API call usage metrics including tokens, costs, quotas, and billing information.</summary>
/// <remarks>Represents the <c>assistant.usage</c> event.</remarks>
public partial class AssistantUsageEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "assistant.usage";
/// <summary>The <c>assistant.usage</c> event payload.</summary>
[JsonPropertyName("data")]
public required AssistantUsageData Data { get; set; }
}
/// <summary>Turn abort information including the reason for termination.</summary>
/// <remarks>Represents the <c>abort</c> event.</remarks>
public partial class AbortEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "abort";
/// <summary>The <c>abort</c> event payload.</summary>
[JsonPropertyName("data")]
public required AbortData Data { get; set; }
}
/// <summary>User-initiated tool invocation request with tool name and arguments.</summary>
/// <remarks>Represents the <c>tool.user_requested</c> event.</remarks>
public partial class ToolUserRequestedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "tool.user_requested";
/// <summary>The <c>tool.user_requested</c> event payload.</summary>
[JsonPropertyName("data")]
public required ToolUserRequestedData Data { get; set; }
}
/// <summary>Tool execution startup details including MCP server information when applicable.</summary>
/// <remarks>Represents the <c>tool.execution_start</c> event.</remarks>
public partial class ToolExecutionStartEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "tool.execution_start";
/// <summary>The <c>tool.execution_start</c> event payload.</summary>
[JsonPropertyName("data")]
public required ToolExecutionStartData Data { get; set; }
}
/// <summary>Streaming tool execution output for incremental result display.</summary>
/// <remarks>Represents the <c>tool.execution_partial_result</c> event.</remarks>
public partial class ToolExecutionPartialResultEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "tool.execution_partial_result";
/// <summary>The <c>tool.execution_partial_result</c> event payload.</summary>
[JsonPropertyName("data")]
public required ToolExecutionPartialResultData Data { get; set; }
}
/// <summary>Tool execution progress notification with status message.</summary>
/// <remarks>Represents the <c>tool.execution_progress</c> event.</remarks>
public partial class ToolExecutionProgressEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "tool.execution_progress";
/// <summary>The <c>tool.execution_progress</c> event payload.</summary>
[JsonPropertyName("data")]
public required ToolExecutionProgressData Data { get; set; }
}
/// <summary>Tool execution completion results including success status, detailed output, and error information.</summary>
/// <remarks>Represents the <c>tool.execution_complete</c> event.</remarks>
public partial class ToolExecutionCompleteEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "tool.execution_complete";
/// <summary>The <c>tool.execution_complete</c> event payload.</summary>
[JsonPropertyName("data")]
public required ToolExecutionCompleteData Data { get; set; }
}
/// <summary>Skill invocation details including content, allowed tools, and plugin metadata.</summary>
/// <remarks>Represents the <c>skill.invoked</c> event.</remarks>
public partial class SkillInvokedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "skill.invoked";
/// <summary>The <c>skill.invoked</c> event payload.</summary>
[JsonPropertyName("data")]
public required SkillInvokedData Data { get; set; }
}
/// <summary>Sub-agent startup details including parent tool call and agent information.</summary>
/// <remarks>Represents the <c>subagent.started</c> event.</remarks>
public partial class SubagentStartedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "subagent.started";
/// <summary>The <c>subagent.started</c> event payload.</summary>
[JsonPropertyName("data")]
public required SubagentStartedData Data { get; set; }
}
/// <summary>Sub-agent completion details for successful execution.</summary>
/// <remarks>Represents the <c>subagent.completed</c> event.</remarks>
public partial class SubagentCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "subagent.completed";
/// <summary>The <c>subagent.completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SubagentCompletedData Data { get; set; }
}
/// <summary>Sub-agent failure details including error message and agent information.</summary>
/// <remarks>Represents the <c>subagent.failed</c> event.</remarks>
public partial class SubagentFailedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "subagent.failed";
/// <summary>The <c>subagent.failed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SubagentFailedData Data { get; set; }
}
/// <summary>Custom agent selection details including name and available tools.</summary>
/// <remarks>Represents the <c>subagent.selected</c> event.</remarks>
public partial class SubagentSelectedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "subagent.selected";
/// <summary>The <c>subagent.selected</c> event payload.</summary>
[JsonPropertyName("data")]
public required SubagentSelectedData Data { get; set; }
}
/// <summary>Empty payload; the event signals that the custom agent was deselected, returning to the default agent.</summary>
/// <remarks>Represents the <c>subagent.deselected</c> event.</remarks>
public partial class SubagentDeselectedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "subagent.deselected";
/// <summary>The <c>subagent.deselected</c> event payload.</summary>
[JsonPropertyName("data")]
public required SubagentDeselectedData Data { get; set; }
}
/// <summary>Hook invocation start details including type and input data.</summary>
/// <remarks>Represents the <c>hook.start</c> event.</remarks>
public partial class HookStartEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "hook.start";
/// <summary>The <c>hook.start</c> event payload.</summary>
[JsonPropertyName("data")]
public required HookStartData Data { get; set; }
}
/// <summary>Hook invocation completion details including output, success status, and error information.</summary>
/// <remarks>Represents the <c>hook.end</c> event.</remarks>
public partial class HookEndEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "hook.end";
/// <summary>The <c>hook.end</c> event payload.</summary>
[JsonPropertyName("data")]
public required HookEndData Data { get; set; }
}
/// <summary>System or developer message content with role and optional template metadata.</summary>
/// <remarks>Represents the <c>system.message</c> event.</remarks>
public partial class SystemMessageEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "system.message";
/// <summary>The <c>system.message</c> event payload.</summary>
[JsonPropertyName("data")]
public required SystemMessageData Data { get; set; }
}
/// <summary>System-generated notification for runtime events like background task completion.</summary>
/// <remarks>Represents the <c>system.notification</c> event.</remarks>
public partial class SystemNotificationEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "system.notification";
/// <summary>The <c>system.notification</c> event payload.</summary>
[JsonPropertyName("data")]
public required SystemNotificationData Data { get; set; }
}
/// <summary>Permission request notification requiring client approval with request details.</summary>
/// <remarks>Represents the <c>permission.requested</c> event.</remarks>
public partial class PermissionRequestedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "permission.requested";
/// <summary>The <c>permission.requested</c> event payload.</summary>
[JsonPropertyName("data")]
public required PermissionRequestedData Data { get; set; }
}
/// <summary>Permission request completion notification signaling UI dismissal.</summary>
/// <remarks>Represents the <c>permission.completed</c> event.</remarks>
public partial class PermissionCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "permission.completed";
/// <summary>The <c>permission.completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required PermissionCompletedData Data { get; set; }
}
/// <summary>User input request notification with question and optional predefined choices.</summary>
/// <remarks>Represents the <c>user_input.requested</c> event.</remarks>
public partial class UserInputRequestedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "user_input.requested";
/// <summary>The <c>user_input.requested</c> event payload.</summary>
[JsonPropertyName("data")]
public required UserInputRequestedData Data { get; set; }
}
/// <summary>User input request completion notification signaling UI dismissal.</summary>
/// <remarks>Represents the <c>user_input.completed</c> event.</remarks>
public partial class UserInputCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "user_input.completed";
/// <summary>The <c>user_input.completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required UserInputCompletedData Data { get; set; }
}
/// <summary>Elicitation request; may be form-based (structured input) or URL-based (browser redirect).</summary>
/// <remarks>Represents the <c>elicitation.requested</c> event.</remarks>
public partial class ElicitationRequestedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "elicitation.requested";
/// <summary>The <c>elicitation.requested</c> event payload.</summary>
[JsonPropertyName("data")]
public required ElicitationRequestedData Data { get; set; }
}
/// <summary>Elicitation request completion notification signaling UI dismissal.</summary>
/// <remarks>Represents the <c>elicitation.completed</c> event.</remarks>
public partial class ElicitationCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "elicitation.completed";
/// <summary>The <c>elicitation.completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required ElicitationCompletedData Data { get; set; }
}
/// <summary>Sampling request from an MCP server; contains the server name and a requestId for correlation.</summary>
/// <remarks>Represents the <c>sampling.requested</c> event.</remarks>
public partial class SamplingRequestedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "sampling.requested";
/// <summary>The <c>sampling.requested</c> event payload.</summary>
[JsonPropertyName("data")]
public required SamplingRequestedData Data { get; set; }
}
/// <summary>Sampling request completion notification signaling UI dismissal.</summary>
/// <remarks>Represents the <c>sampling.completed</c> event.</remarks>
public partial class SamplingCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "sampling.completed";
/// <summary>The <c>sampling.completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required SamplingCompletedData Data { get; set; }
}
/// <summary>OAuth authentication request for an MCP server.</summary>
/// <remarks>Represents the <c>mcp.oauth_required</c> event.</remarks>
public partial class McpOauthRequiredEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "mcp.oauth_required";
/// <summary>The <c>mcp.oauth_required</c> event payload.</summary>
[JsonPropertyName("data")]
public required McpOauthRequiredData Data { get; set; }
}
/// <summary>MCP OAuth request completion notification.</summary>
/// <remarks>Represents the <c>mcp.oauth_completed</c> event.</remarks>
public partial class McpOauthCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "mcp.oauth_completed";
/// <summary>The <c>mcp.oauth_completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required McpOauthCompletedData Data { get; set; }
}
/// <summary>External tool invocation request for client-side tool execution.</summary>
/// <remarks>Represents the <c>external_tool.requested</c> event.</remarks>
public partial class ExternalToolRequestedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "external_tool.requested";
/// <summary>The <c>external_tool.requested</c> event payload.</summary>
[JsonPropertyName("data")]
public required ExternalToolRequestedData Data { get; set; }
}
/// <summary>External tool completion notification signaling UI dismissal.</summary>
/// <remarks>Represents the <c>external_tool.completed</c> event.</remarks>
public partial class ExternalToolCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "external_tool.completed";
/// <summary>The <c>external_tool.completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required ExternalToolCompletedData Data { get; set; }
}
/// <summary>Queued slash command dispatch request for client execution.</summary>
/// <remarks>Represents the <c>command.queued</c> event.</remarks>
public partial class CommandQueuedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "command.queued";
/// <summary>The <c>command.queued</c> event payload.</summary>
[JsonPropertyName("data")]
public required CommandQueuedData Data { get; set; }
}
/// <summary>Registered command dispatch request routed to the owning client.</summary>
/// <remarks>Represents the <c>command.execute</c> event.</remarks>
public partial class CommandExecuteEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "command.execute";
/// <summary>The <c>command.execute</c> event payload.</summary>
[JsonPropertyName("data")]
public required CommandExecuteData Data { get; set; }
}
/// <summary>Queued command completion notification signaling UI dismissal.</summary>
/// <remarks>Represents the <c>command.completed</c> event.</remarks>
public partial class CommandCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "command.completed";
/// <summary>The <c>command.completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required CommandCompletedData Data { get; set; }
}
/// <summary>SDK command registration change notification.</summary>
/// <remarks>Represents the <c>commands.changed</c> event.</remarks>
public partial class CommandsChangedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "commands.changed";
/// <summary>The <c>commands.changed</c> event payload.</summary>
[JsonPropertyName("data")]
public required CommandsChangedData Data { get; set; }
}
/// <summary>Session capability change notification.</summary>
/// <remarks>Represents the <c>capabilities.changed</c> event.</remarks>
public partial class CapabilitiesChangedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "capabilities.changed";
/// <summary>The <c>capabilities.changed</c> event payload.</summary>
[JsonPropertyName("data")]
public required CapabilitiesChangedData Data { get; set; }
}
/// <summary>Plan approval request with plan content and available user actions.</summary>
/// <remarks>Represents the <c>exit_plan_mode.requested</c> event.</remarks>
public partial class ExitPlanModeRequestedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "exit_plan_mode.requested";
/// <summary>The <c>exit_plan_mode.requested</c> event payload.</summary>
[JsonPropertyName("data")]
public required ExitPlanModeRequestedData Data { get; set; }
}
/// <summary>Plan mode exit completion notification signaling UI dismissal.</summary>
/// <remarks>Represents the <c>exit_plan_mode.completed</c> event.</remarks>
public partial class ExitPlanModeCompletedEvent : SessionEvent
{
/// <inheritdoc />
[JsonIgnore]
public override string Type => "exit_plan_mode.completed";
/// <summary>The <c>exit_plan_mode.completed</c> event payload.</summary>
[JsonPropertyName("data")]
public required ExitPlanModeCompletedData Data { get; set; }
}