Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 116 additions & 13 deletions dotnet/src/Generated/SessionEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// Generated from: @github/copilot/session-events.schema.json
// Generated by: scripts/generate-session-types.ts
// Generated at: 2026-01-22T14:30:57.371Z
// Generated at: 2026-01-26T18:08:34.014Z
//
// To update these types:
// 1. Update the schema in copilot-agent-runtime
Expand Down Expand Up @@ -43,6 +43,7 @@ namespace GitHub.Copilot.SDK;
[JsonDerivedType(typeof(SessionInfoEvent), "session.info")]
[JsonDerivedType(typeof(SessionModelChangeEvent), "session.model_change")]
[JsonDerivedType(typeof(SessionResumeEvent), "session.resume")]
[JsonDerivedType(typeof(SessionSnapshotRewindEvent), "session.snapshot_rewind")]
[JsonDerivedType(typeof(SessionStartEvent), "session.start")]
[JsonDerivedType(typeof(SessionTruncationEvent), "session.truncation")]
[JsonDerivedType(typeof(SessionUsageInfoEvent), "session.usage_info")]
Expand Down Expand Up @@ -181,6 +182,18 @@ public partial class SessionTruncationEvent : SessionEvent
public required SessionTruncationData Data { get; set; }
}

/// <summary>
/// Event: session.snapshot_rewind
/// </summary>
public partial class SessionSnapshotRewindEvent : SessionEvent
{
[JsonIgnore]
public override string Type => "session.snapshot_rewind";

[JsonPropertyName("data")]
public required SessionSnapshotRewindData Data { get; set; }
}

/// <summary>
/// Event: session.usage_info
/// </summary>
Expand Down Expand Up @@ -620,6 +633,15 @@ public partial class SessionTruncationData
public required string PerformedBy { get; set; }
}

public partial class SessionSnapshotRewindData
{
[JsonPropertyName("upToEventId")]
public required string UpToEventId { get; set; }

[JsonPropertyName("eventsRemoved")]
public required double EventsRemoved { get; set; }
}

public partial class SessionUsageInfoData
{
[JsonPropertyName("tokenLimit")]
Expand Down Expand Up @@ -844,6 +866,14 @@ public partial class ToolExecutionStartData
[JsonPropertyName("arguments")]
public object? Arguments { get; set; }

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("mcpServerName")]
public string? McpServerName { get; set; }

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("mcpToolName")]
public string? McpToolName { get; set; }

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("parentToolCallId")]
public string? ParentToolCallId { get; set; }
Expand Down Expand Up @@ -1055,10 +1085,22 @@ public partial class SessionCompactionCompleteDataCompactionTokensUsed
public required double CachedInput { get; set; }
}

public partial class UserMessageDataAttachmentsItem
public partial class UserMessageDataAttachmentsItemFile : UserMessageDataAttachmentsItem
{
[JsonPropertyName("type")]
public required UserMessageDataAttachmentsItemType Type { get; set; }
[JsonIgnore]
public override string Type => "file";

[JsonPropertyName("path")]
public required string Path { get; set; }

[JsonPropertyName("displayName")]
public required string DisplayName { get; set; }
}

public partial class UserMessageDataAttachmentsItemDirectory : UserMessageDataAttachmentsItem
{
[JsonIgnore]
public override string Type => "directory";

[JsonPropertyName("path")]
public required string Path { get; set; }
Expand All @@ -1067,6 +1109,64 @@ public partial class UserMessageDataAttachmentsItem
public required string DisplayName { get; set; }
}

public partial class UserMessageDataAttachmentsItemSelectionSelectionStart
{
[JsonPropertyName("line")]
public required double Line { get; set; }

[JsonPropertyName("character")]
public required double Character { get; set; }
}

public partial class UserMessageDataAttachmentsItemSelectionSelectionEnd
{
[JsonPropertyName("line")]
public required double Line { get; set; }

[JsonPropertyName("character")]
public required double Character { get; set; }
}

public partial class UserMessageDataAttachmentsItemSelectionSelection
{
[JsonPropertyName("start")]
public required UserMessageDataAttachmentsItemSelectionSelectionStart Start { get; set; }

[JsonPropertyName("end")]
public required UserMessageDataAttachmentsItemSelectionSelectionEnd End { get; set; }
}

public partial class UserMessageDataAttachmentsItemSelection : UserMessageDataAttachmentsItem
{
[JsonIgnore]
public override string Type => "selection";

[JsonPropertyName("filePath")]
public required string FilePath { get; set; }

[JsonPropertyName("displayName")]
public required string DisplayName { get; set; }

[JsonPropertyName("text")]
public required string Text { get; set; }

[JsonPropertyName("selection")]
public required UserMessageDataAttachmentsItemSelectionSelection Selection { get; set; }
}

[JsonPolymorphic(
TypeDiscriminatorPropertyName = "type",
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
[JsonDerivedType(typeof(UserMessageDataAttachmentsItemFile), "file")]
[JsonDerivedType(typeof(UserMessageDataAttachmentsItemDirectory), "directory")]
[JsonDerivedType(typeof(UserMessageDataAttachmentsItemSelection), "selection")]
public partial class UserMessageDataAttachmentsItem
{
[JsonPropertyName("type")]
public virtual string Type { get; set; } = string.Empty;
}


public partial class AssistantMessageDataToolRequestsItem
{
[JsonPropertyName("toolCallId")]
Expand All @@ -1088,6 +1188,10 @@ public partial class ToolExecutionCompleteDataResult
{
[JsonPropertyName("content")]
public required string Content { get; set; }

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("detailedContent")]
public string? DetailedContent { get; set; }
}

public partial class ToolExecutionCompleteDataError
Expand Down Expand Up @@ -1130,15 +1234,6 @@ public enum SessionHandoffDataSourceType
Local,
}

[JsonConverter(typeof(JsonStringEnumConverter<UserMessageDataAttachmentsItemType>))]
public enum UserMessageDataAttachmentsItemType
{
[JsonStringEnumMemberName("file")]
File,
[JsonStringEnumMemberName("directory")]
Directory,
}

[JsonConverter(typeof(JsonStringEnumConverter<AssistantMessageDataToolRequestsItemType>))]
public enum AssistantMessageDataToolRequestsItemType
{
Expand Down Expand Up @@ -1208,6 +1303,8 @@ public enum SystemMessageDataRole
[JsonSerializable(typeof(SessionResumeData))]
[JsonSerializable(typeof(SessionResumeDataContext))]
[JsonSerializable(typeof(SessionResumeEvent))]
[JsonSerializable(typeof(SessionSnapshotRewindData))]
[JsonSerializable(typeof(SessionSnapshotRewindEvent))]
[JsonSerializable(typeof(SessionStartData))]
[JsonSerializable(typeof(SessionStartDataContext))]
[JsonSerializable(typeof(SessionStartEvent))]
Expand Down Expand Up @@ -1240,5 +1337,11 @@ public enum SystemMessageDataRole
[JsonSerializable(typeof(ToolUserRequestedEvent))]
[JsonSerializable(typeof(UserMessageData))]
[JsonSerializable(typeof(UserMessageDataAttachmentsItem))]
[JsonSerializable(typeof(UserMessageDataAttachmentsItemDirectory))]
[JsonSerializable(typeof(UserMessageDataAttachmentsItemFile))]
[JsonSerializable(typeof(UserMessageDataAttachmentsItemSelection))]
[JsonSerializable(typeof(UserMessageDataAttachmentsItemSelectionSelection))]
[JsonSerializable(typeof(UserMessageDataAttachmentsItemSelectionSelectionEnd))]
[JsonSerializable(typeof(UserMessageDataAttachmentsItemSelectionSelectionStart))]
[JsonSerializable(typeof(UserMessageEvent))]
internal partial class SessionEventsJsonContext : JsonSerializerContext;
35 changes: 30 additions & 5 deletions go/generated_session_events.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading