@@ -51,6 +51,7 @@ namespace GitHub.Copilot.SDK;
5151[ JsonDerivedType ( typeof ( SessionWorkspaceFileChangedEvent ) , "session.workspace_file_changed" ) ]
5252[ JsonDerivedType ( typeof ( SkillInvokedEvent ) , "skill.invoked" ) ]
5353[ JsonDerivedType ( typeof ( SubagentCompletedEvent ) , "subagent.completed" ) ]
54+ [ JsonDerivedType ( typeof ( SubagentDeselectedEvent ) , "subagent.deselected" ) ]
5455[ JsonDerivedType ( typeof ( SubagentFailedEvent ) , "subagent.failed" ) ]
5556[ JsonDerivedType ( typeof ( SubagentSelectedEvent ) , "subagent.selected" ) ]
5657[ JsonDerivedType ( typeof ( SubagentStartedEvent ) , "subagent.started" ) ]
@@ -593,6 +594,18 @@ public partial class SubagentSelectedEvent : SessionEvent
593594 public required SubagentSelectedData Data { get ; set ; }
594595}
595596
597+ /// <summary>
598+ /// Event: subagent.deselected
599+ /// </summary>
600+ public partial class SubagentDeselectedEvent : SessionEvent
601+ {
602+ [ JsonIgnore ]
603+ public override string Type => "subagent.deselected" ;
604+
605+ [ JsonPropertyName ( "data" ) ]
606+ public required SubagentDeselectedData Data { get ; set ; }
607+ }
608+
596609/// <summary>
597610/// Event: hook.start
598611/// </summary>
@@ -952,6 +965,10 @@ public partial class UserMessageData
952965 [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
953966 [ JsonPropertyName ( "agentMode" ) ]
954967 public UserMessageDataAgentMode ? AgentMode { get ; set ; }
968+
969+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
970+ [ JsonPropertyName ( "interactionId" ) ]
971+ public string ? InteractionId { get ; set ; }
955972}
956973
957974public partial class PendingMessagesModifiedData
@@ -962,6 +979,10 @@ public partial class AssistantTurnStartData
962979{
963980 [ JsonPropertyName ( "turnId" ) ]
964981 public required string TurnId { get ; set ; }
982+
983+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
984+ [ JsonPropertyName ( "interactionId" ) ]
985+ public string ? InteractionId { get ; set ; }
965986}
966987
967988public partial class AssistantIntentData
@@ -1022,6 +1043,10 @@ public partial class AssistantMessageData
10221043 [ JsonPropertyName ( "phase" ) ]
10231044 public string ? Phase { get ; set ; }
10241045
1046+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
1047+ [ JsonPropertyName ( "interactionId" ) ]
1048+ public string ? InteractionId { get ; set ; }
1049+
10251050 [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
10261051 [ JsonPropertyName ( "parentToolCallId" ) ]
10271052 public string ? ParentToolCallId { get ; set ; }
@@ -1094,6 +1119,10 @@ public partial class AssistantUsageData
10941119 [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
10951120 [ JsonPropertyName ( "quotaSnapshots" ) ]
10961121 public Dictionary < string , object > ? QuotaSnapshots { get ; set ; }
1122+
1123+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
1124+ [ JsonPropertyName ( "copilotUsage" ) ]
1125+ public AssistantUsageDataCopilotUsage ? CopilotUsage { get ; set ; }
10971126}
10981127
10991128public partial class AbortData
@@ -1166,6 +1195,14 @@ public partial class ToolExecutionCompleteData
11661195 [ JsonPropertyName ( "success" ) ]
11671196 public required bool Success { get ; set ; }
11681197
1198+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
1199+ [ JsonPropertyName ( "model" ) ]
1200+ public string ? Model { get ; set ; }
1201+
1202+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
1203+ [ JsonPropertyName ( "interactionId" ) ]
1204+ public string ? InteractionId { get ; set ; }
1205+
11691206 [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
11701207 [ JsonPropertyName ( "isUserRequested" ) ]
11711208 public bool ? IsUserRequested { get ; set ; }
@@ -1201,6 +1238,14 @@ public partial class SkillInvokedData
12011238 [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
12021239 [ JsonPropertyName ( "allowedTools" ) ]
12031240 public string [ ] ? AllowedTools { get ; set ; }
1241+
1242+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
1243+ [ JsonPropertyName ( "pluginName" ) ]
1244+ public string ? PluginName { get ; set ; }
1245+
1246+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
1247+ [ JsonPropertyName ( "pluginVersion" ) ]
1248+ public string ? PluginVersion { get ; set ; }
12041249}
12051250
12061251public partial class SubagentStartedData
@@ -1257,6 +1302,10 @@ public partial class SubagentSelectedData
12571302 public string [ ] ? Tools { get ; set ; }
12581303}
12591304
1305+ public partial class SubagentDeselectedData
1306+ {
1307+ }
1308+
12601309public partial class HookStartData
12611310{
12621311 [ JsonPropertyName ( "hookInvocationId" ) ]
@@ -1475,12 +1524,34 @@ public partial class UserMessageDataAttachmentsItemSelection : UserMessageDataAt
14751524 public required UserMessageDataAttachmentsItemSelectionSelection Selection { get ; set ; }
14761525}
14771526
1527+ public partial class UserMessageDataAttachmentsItemGithubReference : UserMessageDataAttachmentsItem
1528+ {
1529+ [ JsonIgnore ]
1530+ public override string Type => "github_reference" ;
1531+
1532+ [ JsonPropertyName ( "number" ) ]
1533+ public required double Number { get ; set ; }
1534+
1535+ [ JsonPropertyName ( "title" ) ]
1536+ public required string Title { get ; set ; }
1537+
1538+ [ JsonPropertyName ( "referenceType" ) ]
1539+ public required UserMessageDataAttachmentsItemGithubReferenceReferenceType ReferenceType { get ; set ; }
1540+
1541+ [ JsonPropertyName ( "state" ) ]
1542+ public required string State { get ; set ; }
1543+
1544+ [ JsonPropertyName ( "url" ) ]
1545+ public required string Url { get ; set ; }
1546+ }
1547+
14781548[ JsonPolymorphic (
14791549 TypeDiscriminatorPropertyName = "type" ,
14801550 UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling . FallBackToBaseType ) ]
14811551[ JsonDerivedType ( typeof ( UserMessageDataAttachmentsItemFile ) , "file" ) ]
14821552[ JsonDerivedType ( typeof ( UserMessageDataAttachmentsItemDirectory ) , "directory" ) ]
14831553[ JsonDerivedType ( typeof ( UserMessageDataAttachmentsItemSelection ) , "selection" ) ]
1554+ [ JsonDerivedType ( typeof ( UserMessageDataAttachmentsItemGithubReference ) , "github_reference" ) ]
14841555public partial class UserMessageDataAttachmentsItem
14851556{
14861557 [ JsonPropertyName ( "type" ) ]
@@ -1505,6 +1576,30 @@ public partial class AssistantMessageDataToolRequestsItem
15051576 public AssistantMessageDataToolRequestsItemType ? Type { get ; set ; }
15061577}
15071578
1579+ public partial class AssistantUsageDataCopilotUsageTokenDetailsItem
1580+ {
1581+ [ JsonPropertyName ( "batchSize" ) ]
1582+ public required double BatchSize { get ; set ; }
1583+
1584+ [ JsonPropertyName ( "costPerBatch" ) ]
1585+ public required double CostPerBatch { get ; set ; }
1586+
1587+ [ JsonPropertyName ( "tokenCount" ) ]
1588+ public required double TokenCount { get ; set ; }
1589+
1590+ [ JsonPropertyName ( "tokenType" ) ]
1591+ public required string TokenType { get ; set ; }
1592+ }
1593+
1594+ public partial class AssistantUsageDataCopilotUsage
1595+ {
1596+ [ JsonPropertyName ( "tokenDetails" ) ]
1597+ public required AssistantUsageDataCopilotUsageTokenDetailsItem [ ] TokenDetails { get ; set ; }
1598+
1599+ [ JsonPropertyName ( "totalNanoAiu" ) ]
1600+ public required double TotalNanoAiu { get ; set ; }
1601+ }
1602+
15081603public partial class ToolExecutionCompleteDataResultContentsItemText : ToolExecutionCompleteDataResultContentsItem
15091604{
15101605 [ JsonIgnore ]
@@ -1713,6 +1808,17 @@ public enum SessionShutdownDataShutdownType
17131808 Error ,
17141809}
17151810
1811+ [ JsonConverter ( typeof ( JsonStringEnumConverter < UserMessageDataAttachmentsItemGithubReferenceReferenceType > ) ) ]
1812+ public enum UserMessageDataAttachmentsItemGithubReferenceReferenceType
1813+ {
1814+ [ JsonStringEnumMemberName ( "issue" ) ]
1815+ Issue ,
1816+ [ JsonStringEnumMemberName ( "pr" ) ]
1817+ Pr ,
1818+ [ JsonStringEnumMemberName ( "discussion" ) ]
1819+ Discussion ,
1820+ }
1821+
17161822[ JsonConverter ( typeof ( JsonStringEnumConverter < UserMessageDataAgentMode > ) ) ]
17171823public enum UserMessageDataAgentMode
17181824{
@@ -1778,6 +1884,8 @@ public enum SystemMessageDataRole
17781884[ JsonSerializable ( typeof ( AssistantTurnStartData ) ) ]
17791885[ JsonSerializable ( typeof ( AssistantTurnStartEvent ) ) ]
17801886[ JsonSerializable ( typeof ( AssistantUsageData ) ) ]
1887+ [ JsonSerializable ( typeof ( AssistantUsageDataCopilotUsage ) ) ]
1888+ [ JsonSerializable ( typeof ( AssistantUsageDataCopilotUsageTokenDetailsItem ) ) ]
17811889[ JsonSerializable ( typeof ( AssistantUsageEvent ) ) ]
17821890[ JsonSerializable ( typeof ( HookEndData ) ) ]
17831891[ JsonSerializable ( typeof ( HookEndDataError ) ) ]
@@ -1836,6 +1944,8 @@ public enum SystemMessageDataRole
18361944[ JsonSerializable ( typeof ( SkillInvokedEvent ) ) ]
18371945[ JsonSerializable ( typeof ( SubagentCompletedData ) ) ]
18381946[ JsonSerializable ( typeof ( SubagentCompletedEvent ) ) ]
1947+ [ JsonSerializable ( typeof ( SubagentDeselectedData ) ) ]
1948+ [ JsonSerializable ( typeof ( SubagentDeselectedEvent ) ) ]
18391949[ JsonSerializable ( typeof ( SubagentFailedData ) ) ]
18401950[ JsonSerializable ( typeof ( SubagentFailedEvent ) ) ]
18411951[ JsonSerializable ( typeof ( SubagentSelectedData ) ) ]
@@ -1871,6 +1981,7 @@ public enum SystemMessageDataRole
18711981[ JsonSerializable ( typeof ( UserMessageDataAttachmentsItemDirectoryLineRange ) ) ]
18721982[ JsonSerializable ( typeof ( UserMessageDataAttachmentsItemFile ) ) ]
18731983[ JsonSerializable ( typeof ( UserMessageDataAttachmentsItemFileLineRange ) ) ]
1984+ [ JsonSerializable ( typeof ( UserMessageDataAttachmentsItemGithubReference ) ) ]
18741985[ JsonSerializable ( typeof ( UserMessageDataAttachmentsItemSelection ) ) ]
18751986[ JsonSerializable ( typeof ( UserMessageDataAttachmentsItemSelectionSelection ) ) ]
18761987[ JsonSerializable ( typeof ( UserMessageDataAttachmentsItemSelectionSelectionEnd ) ) ]
0 commit comments