/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: session-events.schema.json #pragma warning disable CS0612 // Type or member is obsolete #pragma warning disable CS0618 // Type or member is obsolete (with message) using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Text.Json.Serialization; namespace GitHub.Copilot; /// /// Provides the base class from which all session events derive. /// [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(AssistantMessageStartEvent), "assistant.message_start")] [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(AutoModeSwitchCompletedEvent), "auto_mode_switch.completed")] [JsonDerivedType(typeof(AutoModeSwitchRequestedEvent), "auto_mode_switch.requested")] [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(ModelCallFailureEvent), "model.call_failure")] [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(SessionCustomNotificationEvent), "session.custom_notification")] [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(SessionScheduleCancelledEvent), "session.schedule_cancelled")] [JsonDerivedType(typeof(SessionScheduleCreatedEvent), "session.schedule_created")] [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 { /// Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("agentId")] public string? AgentId { get; set; } /// When true, the event is transient and not persisted to the session event log on disk. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("ephemeral")] public bool? Ephemeral { get; set; } /// Unique event identifier (UUID v4), generated when the event is emitted. [JsonPropertyName("id")] public Guid Id { get; set; } /// ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. [JsonPropertyName("parentId")] public Guid? ParentId { get; set; } /// ISO 8601 timestamp when the event was created. [JsonPropertyName("timestamp")] public DateTimeOffset Timestamp { get; set; } /// /// The event type discriminator. /// [JsonIgnore] public virtual string Type => "unknown"; /// Deserializes a JSON string into a . public static SessionEvent FromJson(string json) => JsonSerializer.Deserialize(json, SessionEventsJsonContext.Default.SessionEvent)!; /// Serializes this event to a JSON string. public string ToJson() => JsonSerializer.Serialize(this, SessionEventsJsonContext.Default.SessionEvent); [DebuggerBrowsable(DebuggerBrowsableState.Never)] private string DebuggerDisplay => ToJson(); } /// Session initialization metadata including context and configuration. /// Represents the session.start event. public sealed partial class SessionStartEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.start"; /// The session.start event payload. [JsonPropertyName("data")] public required SessionStartData Data { get; set; } } /// Session resume metadata including current context and event count. /// Represents the session.resume event. public sealed partial class SessionResumeEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.resume"; /// The session.resume event payload. [JsonPropertyName("data")] public required SessionResumeData Data { get; set; } } /// Notifies that the session's remote steering capability has changed. /// Represents the session.remote_steerable_changed event. public sealed partial class SessionRemoteSteerableChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.remote_steerable_changed"; /// The session.remote_steerable_changed event payload. [JsonPropertyName("data")] public required SessionRemoteSteerableChangedData Data { get; set; } } /// Error details for timeline display including message and optional diagnostic information. /// Represents the session.error event. public sealed partial class SessionErrorEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.error"; /// The session.error event payload. [JsonPropertyName("data")] public required SessionErrorData Data { get; set; } } /// Payload indicating the session is idle with no background agents in flight. /// Represents the session.idle event. public sealed partial class SessionIdleEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.idle"; /// The session.idle event payload. [JsonPropertyName("data")] public required SessionIdleData Data { get; set; } } /// Session title change payload containing the new display title. /// Represents the session.title_changed event. public sealed partial class SessionTitleChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.title_changed"; /// The session.title_changed event payload. [JsonPropertyName("data")] public required SessionTitleChangedData Data { get; set; } } /// Scheduled prompt registered via /every or /after. /// Represents the session.schedule_created event. public sealed partial class SessionScheduleCreatedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.schedule_created"; /// The session.schedule_created event payload. [JsonPropertyName("data")] public required SessionScheduleCreatedData Data { get; set; } } /// Scheduled prompt cancelled from the schedule manager dialog. /// Represents the session.schedule_cancelled event. public sealed partial class SessionScheduleCancelledEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.schedule_cancelled"; /// The session.schedule_cancelled event payload. [JsonPropertyName("data")] public required SessionScheduleCancelledData Data { get; set; } } /// Informational message for timeline display with categorization. /// Represents the session.info event. public sealed partial class SessionInfoEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.info"; /// The session.info event payload. [JsonPropertyName("data")] public required SessionInfoData Data { get; set; } } /// Warning message for timeline display with categorization. /// Represents the session.warning event. public sealed partial class SessionWarningEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.warning"; /// The session.warning event payload. [JsonPropertyName("data")] public required SessionWarningData Data { get; set; } } /// Model change details including previous and new model identifiers. /// Represents the session.model_change event. public sealed partial class SessionModelChangeEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.model_change"; /// The session.model_change event payload. [JsonPropertyName("data")] public required SessionModelChangeData Data { get; set; } } /// Agent mode change details including previous and new modes. /// Represents the session.mode_changed event. public sealed partial class SessionModeChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.mode_changed"; /// The session.mode_changed event payload. [JsonPropertyName("data")] public required SessionModeChangedData Data { get; set; } } /// Plan file operation details indicating what changed. /// Represents the session.plan_changed event. public sealed partial class SessionPlanChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.plan_changed"; /// The session.plan_changed event payload. [JsonPropertyName("data")] public required SessionPlanChangedData Data { get; set; } } /// Workspace file change details including path and operation type. /// Represents the session.workspace_file_changed event. public sealed partial class SessionWorkspaceFileChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.workspace_file_changed"; /// The session.workspace_file_changed event payload. [JsonPropertyName("data")] public required SessionWorkspaceFileChangedData Data { get; set; } } /// Session handoff metadata including source, context, and repository information. /// Represents the session.handoff event. public sealed partial class SessionHandoffEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.handoff"; /// The session.handoff event payload. [JsonPropertyName("data")] public required SessionHandoffData Data { get; set; } } /// Conversation truncation statistics including token counts and removed content metrics. /// Represents the session.truncation event. public sealed partial class SessionTruncationEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.truncation"; /// The session.truncation event payload. [JsonPropertyName("data")] public required SessionTruncationData Data { get; set; } } /// Session rewind details including target event and count of removed events. /// Represents the session.snapshot_rewind event. public sealed partial class SessionSnapshotRewindEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.snapshot_rewind"; /// The session.snapshot_rewind event payload. [JsonPropertyName("data")] public required SessionSnapshotRewindData Data { get; set; } } /// Session termination metrics including usage statistics, code changes, and shutdown reason. /// Represents the session.shutdown event. public sealed partial class SessionShutdownEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.shutdown"; /// The session.shutdown event payload. [JsonPropertyName("data")] public required SessionShutdownData Data { get; set; } } /// Working directory and git context at session start. /// Represents the session.context_changed event. public sealed partial class SessionContextChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.context_changed"; /// The session.context_changed event payload. [JsonPropertyName("data")] public required SessionContextChangedData Data { get; set; } } /// Current context window usage statistics including token and message counts. /// Represents the session.usage_info event. public sealed partial class SessionUsageInfoEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.usage_info"; /// The session.usage_info event payload. [JsonPropertyName("data")] public required SessionUsageInfoData Data { get; set; } } /// Context window breakdown at the start of LLM-powered conversation compaction. /// Represents the session.compaction_start event. public sealed partial class SessionCompactionStartEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.compaction_start"; /// The session.compaction_start event payload. [JsonPropertyName("data")] public required SessionCompactionStartData Data { get; set; } } /// Conversation compaction results including success status, metrics, and optional error details. /// Represents the session.compaction_complete event. public sealed partial class SessionCompactionCompleteEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.compaction_complete"; /// The session.compaction_complete event payload. [JsonPropertyName("data")] public required SessionCompactionCompleteData Data { get; set; } } /// Task completion notification with summary from the agent. /// Represents the session.task_complete event. public sealed partial class SessionTaskCompleteEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.task_complete"; /// The session.task_complete event payload. [JsonPropertyName("data")] public required SessionTaskCompleteData Data { get; set; } } /// Schema for the `UserMessageData` type. /// Represents the user.message event. public sealed partial class UserMessageEvent : SessionEvent { /// [JsonIgnore] public override string Type => "user.message"; /// The user.message event payload. [JsonPropertyName("data")] public required UserMessageData Data { get; set; } } /// Empty payload; the event signals that the pending message queue has changed. /// Represents the pending_messages.modified event. public sealed partial class PendingMessagesModifiedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "pending_messages.modified"; /// The pending_messages.modified event payload. [JsonPropertyName("data")] public required PendingMessagesModifiedData Data { get; set; } } /// Turn initialization metadata including identifier and interaction tracking. /// Represents the assistant.turn_start event. public sealed partial class AssistantTurnStartEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.turn_start"; /// The assistant.turn_start event payload. [JsonPropertyName("data")] public required AssistantTurnStartData Data { get; set; } } /// Agent intent description for current activity or plan. /// Represents the assistant.intent event. public sealed partial class AssistantIntentEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.intent"; /// The assistant.intent event payload. [JsonPropertyName("data")] public required AssistantIntentData Data { get; set; } } /// Assistant reasoning content for timeline display with complete thinking text. /// Represents the assistant.reasoning event. public sealed partial class AssistantReasoningEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.reasoning"; /// The assistant.reasoning event payload. [JsonPropertyName("data")] public required AssistantReasoningData Data { get; set; } } /// Streaming reasoning delta for incremental extended thinking updates. /// Represents the assistant.reasoning_delta event. public sealed partial class AssistantReasoningDeltaEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.reasoning_delta"; /// The assistant.reasoning_delta event payload. [JsonPropertyName("data")] public required AssistantReasoningDeltaData Data { get; set; } } /// Streaming response progress with cumulative byte count. /// Represents the assistant.streaming_delta event. public sealed partial class AssistantStreamingDeltaEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.streaming_delta"; /// The assistant.streaming_delta event payload. [JsonPropertyName("data")] public required AssistantStreamingDeltaData Data { get; set; } } /// Assistant response containing text content, optional tool requests, and interaction metadata. /// Represents the assistant.message event. public sealed partial class AssistantMessageEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.message"; /// The assistant.message event payload. [JsonPropertyName("data")] public required AssistantMessageData Data { get; set; } } /// Streaming assistant message start metadata. /// Represents the assistant.message_start event. public sealed partial class AssistantMessageStartEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.message_start"; /// The assistant.message_start event payload. [JsonPropertyName("data")] public required AssistantMessageStartData Data { get; set; } } /// Streaming assistant message delta for incremental response updates. /// Represents the assistant.message_delta event. public sealed partial class AssistantMessageDeltaEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.message_delta"; /// The assistant.message_delta event payload. [JsonPropertyName("data")] public required AssistantMessageDeltaData Data { get; set; } } /// Turn completion metadata including the turn identifier. /// Represents the assistant.turn_end event. public sealed partial class AssistantTurnEndEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.turn_end"; /// The assistant.turn_end event payload. [JsonPropertyName("data")] public required AssistantTurnEndData Data { get; set; } } /// LLM API call usage metrics including tokens, costs, quotas, and billing information. /// Represents the assistant.usage event. public sealed partial class AssistantUsageEvent : SessionEvent { /// [JsonIgnore] public override string Type => "assistant.usage"; /// The assistant.usage event payload. [JsonPropertyName("data")] public required AssistantUsageData Data { get; set; } } /// Failed LLM API call metadata for telemetry. /// Represents the model.call_failure event. public sealed partial class ModelCallFailureEvent : SessionEvent { /// [JsonIgnore] public override string Type => "model.call_failure"; /// The model.call_failure event payload. [JsonPropertyName("data")] public required ModelCallFailureData Data { get; set; } } /// Turn abort information including the reason for termination. /// Represents the abort event. public sealed partial class AbortEvent : SessionEvent { /// [JsonIgnore] public override string Type => "abort"; /// The abort event payload. [JsonPropertyName("data")] public required AbortData Data { get; set; } } /// User-initiated tool invocation request with tool name and arguments. /// Represents the tool.user_requested event. public sealed partial class ToolUserRequestedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "tool.user_requested"; /// The tool.user_requested event payload. [JsonPropertyName("data")] public required ToolUserRequestedData Data { get; set; } } /// Tool execution startup details including MCP server information when applicable. /// Represents the tool.execution_start event. public sealed partial class ToolExecutionStartEvent : SessionEvent { /// [JsonIgnore] public override string Type => "tool.execution_start"; /// The tool.execution_start event payload. [JsonPropertyName("data")] public required ToolExecutionStartData Data { get; set; } } /// Streaming tool execution output for incremental result display. /// Represents the tool.execution_partial_result event. public sealed partial class ToolExecutionPartialResultEvent : SessionEvent { /// [JsonIgnore] public override string Type => "tool.execution_partial_result"; /// The tool.execution_partial_result event payload. [JsonPropertyName("data")] public required ToolExecutionPartialResultData Data { get; set; } } /// Tool execution progress notification with status message. /// Represents the tool.execution_progress event. public sealed partial class ToolExecutionProgressEvent : SessionEvent { /// [JsonIgnore] public override string Type => "tool.execution_progress"; /// The tool.execution_progress event payload. [JsonPropertyName("data")] public required ToolExecutionProgressData Data { get; set; } } /// Tool execution completion results including success status, detailed output, and error information. /// Represents the tool.execution_complete event. public sealed partial class ToolExecutionCompleteEvent : SessionEvent { /// [JsonIgnore] public override string Type => "tool.execution_complete"; /// The tool.execution_complete event payload. [JsonPropertyName("data")] public required ToolExecutionCompleteData Data { get; set; } } /// Skill invocation details including content, allowed tools, and plugin metadata. /// Represents the skill.invoked event. public sealed partial class SkillInvokedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "skill.invoked"; /// The skill.invoked event payload. [JsonPropertyName("data")] public required SkillInvokedData Data { get; set; } } /// Sub-agent startup details including parent tool call and agent information. /// Represents the subagent.started event. public sealed partial class SubagentStartedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "subagent.started"; /// The subagent.started event payload. [JsonPropertyName("data")] public required SubagentStartedData Data { get; set; } } /// Sub-agent completion details for successful execution. /// Represents the subagent.completed event. public sealed partial class SubagentCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "subagent.completed"; /// The subagent.completed event payload. [JsonPropertyName("data")] public required SubagentCompletedData Data { get; set; } } /// Sub-agent failure details including error message and agent information. /// Represents the subagent.failed event. public sealed partial class SubagentFailedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "subagent.failed"; /// The subagent.failed event payload. [JsonPropertyName("data")] public required SubagentFailedData Data { get; set; } } /// Custom agent selection details including name and available tools. /// Represents the subagent.selected event. public sealed partial class SubagentSelectedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "subagent.selected"; /// The subagent.selected event payload. [JsonPropertyName("data")] public required SubagentSelectedData Data { get; set; } } /// Empty payload; the event signals that the custom agent was deselected, returning to the default agent. /// Represents the subagent.deselected event. public sealed partial class SubagentDeselectedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "subagent.deselected"; /// The subagent.deselected event payload. [JsonPropertyName("data")] public required SubagentDeselectedData Data { get; set; } } /// Hook invocation start details including type and input data. /// Represents the hook.start event. public sealed partial class HookStartEvent : SessionEvent { /// [JsonIgnore] public override string Type => "hook.start"; /// The hook.start event payload. [JsonPropertyName("data")] public required HookStartData Data { get; set; } } /// Hook invocation completion details including output, success status, and error information. /// Represents the hook.end event. public sealed partial class HookEndEvent : SessionEvent { /// [JsonIgnore] public override string Type => "hook.end"; /// The hook.end event payload. [JsonPropertyName("data")] public required HookEndData Data { get; set; } } /// System/developer instruction content with role and optional template metadata. /// Represents the system.message event. public sealed partial class SystemMessageEvent : SessionEvent { /// [JsonIgnore] public override string Type => "system.message"; /// The system.message event payload. [JsonPropertyName("data")] public required SystemMessageData Data { get; set; } } /// System-generated notification for runtime events like background task completion. /// Represents the system.notification event. public sealed partial class SystemNotificationEvent : SessionEvent { /// [JsonIgnore] public override string Type => "system.notification"; /// The system.notification event payload. [JsonPropertyName("data")] public required SystemNotificationData Data { get; set; } } /// Permission request notification requiring client approval with request details. /// Represents the permission.requested event. public sealed partial class PermissionRequestedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "permission.requested"; /// The permission.requested event payload. [JsonPropertyName("data")] public required PermissionRequestedData Data { get; set; } } /// Permission request completion notification signaling UI dismissal. /// Represents the permission.completed event. public sealed partial class PermissionCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "permission.completed"; /// The permission.completed event payload. [JsonPropertyName("data")] public required PermissionCompletedData Data { get; set; } } /// User input request notification with question and optional predefined choices. /// Represents the user_input.requested event. public sealed partial class UserInputRequestedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "user_input.requested"; /// The user_input.requested event payload. [JsonPropertyName("data")] public required UserInputRequestedData Data { get; set; } } /// User input request completion with the user's response. /// Represents the user_input.completed event. public sealed partial class UserInputCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "user_input.completed"; /// The user_input.completed event payload. [JsonPropertyName("data")] public required UserInputCompletedData Data { get; set; } } /// Elicitation request; may be form-based (structured input) or URL-based (browser redirect). /// Represents the elicitation.requested event. public sealed partial class ElicitationRequestedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "elicitation.requested"; /// The elicitation.requested event payload. [JsonPropertyName("data")] public required ElicitationRequestedData Data { get; set; } } /// Elicitation request completion with the user's response. /// Represents the elicitation.completed event. public sealed partial class ElicitationCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "elicitation.completed"; /// The elicitation.completed event payload. [JsonPropertyName("data")] public required ElicitationCompletedData Data { get; set; } } /// Sampling request from an MCP server; contains the server name and a requestId for correlation. /// Represents the sampling.requested event. public sealed partial class SamplingRequestedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "sampling.requested"; /// The sampling.requested event payload. [JsonPropertyName("data")] public required SamplingRequestedData Data { get; set; } } /// Sampling request completion notification signaling UI dismissal. /// Represents the sampling.completed event. public sealed partial class SamplingCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "sampling.completed"; /// The sampling.completed event payload. [JsonPropertyName("data")] public required SamplingCompletedData Data { get; set; } } /// OAuth authentication request for an MCP server. /// Represents the mcp.oauth_required event. public sealed partial class McpOauthRequiredEvent : SessionEvent { /// [JsonIgnore] public override string Type => "mcp.oauth_required"; /// The mcp.oauth_required event payload. [JsonPropertyName("data")] public required McpOauthRequiredData Data { get; set; } } /// MCP OAuth request completion notification. /// Represents the mcp.oauth_completed event. public sealed partial class McpOauthCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "mcp.oauth_completed"; /// The mcp.oauth_completed event payload. [JsonPropertyName("data")] public required McpOauthCompletedData Data { get; set; } } /// Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined. /// Represents the session.custom_notification event. public sealed partial class SessionCustomNotificationEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.custom_notification"; /// The session.custom_notification event payload. [JsonPropertyName("data")] public required SessionCustomNotificationData Data { get; set; } } /// External tool invocation request for client-side tool execution. /// Represents the external_tool.requested event. public sealed partial class ExternalToolRequestedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "external_tool.requested"; /// The external_tool.requested event payload. [JsonPropertyName("data")] public required ExternalToolRequestedData Data { get; set; } } /// External tool completion notification signaling UI dismissal. /// Represents the external_tool.completed event. public sealed partial class ExternalToolCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "external_tool.completed"; /// The external_tool.completed event payload. [JsonPropertyName("data")] public required ExternalToolCompletedData Data { get; set; } } /// Queued slash command dispatch request for client execution. /// Represents the command.queued event. public sealed partial class CommandQueuedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "command.queued"; /// The command.queued event payload. [JsonPropertyName("data")] public required CommandQueuedData Data { get; set; } } /// Registered command dispatch request routed to the owning client. /// Represents the command.execute event. public sealed partial class CommandExecuteEvent : SessionEvent { /// [JsonIgnore] public override string Type => "command.execute"; /// The command.execute event payload. [JsonPropertyName("data")] public required CommandExecuteData Data { get; set; } } /// Queued command completion notification signaling UI dismissal. /// Represents the command.completed event. public sealed partial class CommandCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "command.completed"; /// The command.completed event payload. [JsonPropertyName("data")] public required CommandCompletedData Data { get; set; } } /// Auto mode switch request notification requiring user approval. /// Represents the auto_mode_switch.requested event. public sealed partial class AutoModeSwitchRequestedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "auto_mode_switch.requested"; /// The auto_mode_switch.requested event payload. [JsonPropertyName("data")] public required AutoModeSwitchRequestedData Data { get; set; } } /// Auto mode switch completion notification. /// Represents the auto_mode_switch.completed event. public sealed partial class AutoModeSwitchCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "auto_mode_switch.completed"; /// The auto_mode_switch.completed event payload. [JsonPropertyName("data")] public required AutoModeSwitchCompletedData Data { get; set; } } /// SDK command registration change notification. /// Represents the commands.changed event. public sealed partial class CommandsChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "commands.changed"; /// The commands.changed event payload. [JsonPropertyName("data")] public required CommandsChangedData Data { get; set; } } /// Session capability change notification. /// Represents the capabilities.changed event. public sealed partial class CapabilitiesChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "capabilities.changed"; /// The capabilities.changed event payload. [JsonPropertyName("data")] public required CapabilitiesChangedData Data { get; set; } } /// Plan approval request with plan content and available user actions. /// Represents the exit_plan_mode.requested event. public sealed partial class ExitPlanModeRequestedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "exit_plan_mode.requested"; /// The exit_plan_mode.requested event payload. [JsonPropertyName("data")] public required ExitPlanModeRequestedData Data { get; set; } } /// Plan mode exit completion with the user's approval decision and optional feedback. /// Represents the exit_plan_mode.completed event. public sealed partial class ExitPlanModeCompletedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "exit_plan_mode.completed"; /// The exit_plan_mode.completed event payload. [JsonPropertyName("data")] public required ExitPlanModeCompletedData Data { get; set; } } /// Schema for the `ToolsUpdatedData` type. /// Represents the session.tools_updated event. public sealed partial class SessionToolsUpdatedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.tools_updated"; /// The session.tools_updated event payload. [JsonPropertyName("data")] public required SessionToolsUpdatedData Data { get; set; } } /// Schema for the `BackgroundTasksChangedData` type. /// Represents the session.background_tasks_changed event. public sealed partial class SessionBackgroundTasksChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.background_tasks_changed"; /// The session.background_tasks_changed event payload. [JsonPropertyName("data")] public required SessionBackgroundTasksChangedData Data { get; set; } } /// Schema for the `SkillsLoadedData` type. /// Represents the session.skills_loaded event. public sealed partial class SessionSkillsLoadedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.skills_loaded"; /// The session.skills_loaded event payload. [JsonPropertyName("data")] public required SessionSkillsLoadedData Data { get; set; } } /// Schema for the `CustomAgentsUpdatedData` type. /// Represents the session.custom_agents_updated event. public sealed partial class SessionCustomAgentsUpdatedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.custom_agents_updated"; /// The session.custom_agents_updated event payload. [JsonPropertyName("data")] public required SessionCustomAgentsUpdatedData Data { get; set; } } /// Schema for the `McpServersLoadedData` type. /// Represents the session.mcp_servers_loaded event. public sealed partial class SessionMcpServersLoadedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.mcp_servers_loaded"; /// The session.mcp_servers_loaded event payload. [JsonPropertyName("data")] public required SessionMcpServersLoadedData Data { get; set; } } /// Schema for the `McpServerStatusChangedData` type. /// Represents the session.mcp_server_status_changed event. public sealed partial class SessionMcpServerStatusChangedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.mcp_server_status_changed"; /// The session.mcp_server_status_changed event payload. [JsonPropertyName("data")] public required SessionMcpServerStatusChangedData Data { get; set; } } /// Schema for the `ExtensionsLoadedData` type. /// Represents the session.extensions_loaded event. public sealed partial class SessionExtensionsLoadedEvent : SessionEvent { /// [JsonIgnore] public override string Type => "session.extensions_loaded"; /// The session.extensions_loaded event payload. [JsonPropertyName("data")] public required SessionExtensionsLoadedData Data { get; set; } } /// Session initialization metadata including context and configuration. public sealed partial class SessionStartData { /// Whether the session was already in use by another client at start time. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("alreadyInUse")] public bool? AlreadyInUse { get; set; } /// Working directory and git context at session start. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("context")] public WorkingDirectoryContext? Context { get; set; } /// Version string of the Copilot application. [JsonPropertyName("copilotVersion")] public required string CopilotVersion { get; set; } /// When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("detachedFromSpawningParentSessionId")] public string? DetachedFromSpawningParentSessionId { get; set; } /// Identifier of the software producing the events (e.g., "copilot-agent"). [JsonPropertyName("producer")] public required string Producer { get; set; } /// Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max"). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } /// Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed"). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningSummary")] public ReasoningSummary? ReasoningSummary { get; set; } /// Whether this session supports remote steering via GitHub. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("remoteSteerable")] public bool? RemoteSteerable { get; set; } /// Model selected at session creation time, if any. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("selectedModel")] public string? SelectedModel { get; set; } /// Unique identifier for the session. [JsonPropertyName("sessionId")] public required string SessionId { get; set; } /// ISO 8601 timestamp when the session was created. [JsonPropertyName("startTime")] public required DateTimeOffset StartTime { get; set; } /// Schema version number for the session event format. [JsonPropertyName("version")] public required long Version { get; set; } } /// Session resume metadata including current context and event count. public sealed partial class SessionResumeData { /// Whether the session was already in use by another client at resume time. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("alreadyInUse")] public bool? AlreadyInUse { get; set; } /// Updated working directory and git context at resume time. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("context")] public WorkingDirectoryContext? Context { get; set; } /// When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("continuePendingWork")] public bool? ContinuePendingWork { get; set; } /// Total number of persisted events in the session at the time of resume. [JsonPropertyName("eventCount")] public required long EventCount { get; set; } /// Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max"). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } /// Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed"). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningSummary")] public ReasoningSummary? ReasoningSummary { get; set; } /// Whether this session supports remote steering via GitHub. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("remoteSteerable")] public bool? RemoteSteerable { get; set; } /// ISO 8601 timestamp when the session was resumed. [JsonPropertyName("resumeTime")] public required DateTimeOffset ResumeTime { get; set; } /// Model currently selected at resume time. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("selectedModel")] public string? SelectedModel { get; set; } /// True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("sessionWasActive")] public bool? SessionWasActive { get; set; } } /// Notifies that the session's remote steering capability has changed. public sealed partial class SessionRemoteSteerableChangedData { /// Whether this session now supports remote steering via GitHub. [JsonPropertyName("remoteSteerable")] public required bool RemoteSteerable { get; set; } } /// Error details for timeline display including message and optional diagnostic information. public sealed partial class SessionErrorData { /// Only set on `errorType: "rate_limit"`. When `true`, the runtime will follow this error with an `auto_mode_switch.requested` event (or silently switch if `continueOnAutoMode` is enabled). UI clients can use this flag to suppress duplicate rendering of the rate-limit error when they show their own auto-mode-switch prompt. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("eligibleForAutoSwitch")] public bool? EligibleForAutoSwitch { get; set; } /// Fine-grained error code from the upstream provider, when available. For `errorType: "rate_limit"`, this is one of the `RateLimitErrorCode` values (e.g., `"user_weekly_rate_limited"`, `"user_global_rate_limited"`, `"rate_limited"`, `"user_model_rate_limited"`, `"integration_rate_limited"`). For `errorType: "quota"`, this is the CAPI quota error code (e.g., `"quota_exceeded"`, `"session_quota_exceeded"`, `"billing_not_configured"`). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("errorCode")] public string? ErrorCode { get; set; } /// Category of error (e.g., "authentication", "authorization", "quota", "rate_limit", "context_limit", "query"). [JsonPropertyName("errorType")] public required string ErrorType { get; set; } /// Human-readable error message. [JsonPropertyName("message")] public required string Message { get; set; } /// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("providerCallId")] public string? ProviderCallId { get; set; } /// Error stack trace, when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("stack")] public string? Stack { get; set; } /// HTTP status code from the upstream request, if applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("statusCode")] public int? StatusCode { get; set; } /// Optional URL associated with this error that the user can open in a browser. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("url")] public string? Url { get; set; } } /// Payload indicating the session is idle with no background agents in flight. public sealed partial class SessionIdleData { /// True when the preceding agentic loop was cancelled via abort signal. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("aborted")] public bool? Aborted { get; set; } } /// Session title change payload containing the new display title. public sealed partial class SessionTitleChangedData { /// The new display title for the session. [JsonPropertyName("title")] public required string Title { get; set; } } /// Scheduled prompt registered via /every or /after. public sealed partial class SessionScheduleCreatedData { /// Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("displayPrompt")] public string? DisplayPrompt { get; set; } /// Sequential id assigned to the scheduled prompt within the session. [JsonPropertyName("id")] public required long Id { get; set; } /// Interval between ticks in milliseconds. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonPropertyName("intervalMs")] public required TimeSpan Interval { get; set; } /// Prompt text that gets enqueued on every tick. [JsonPropertyName("prompt")] public required string Prompt { get; set; } /// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("recurring")] public bool? Recurring { get; set; } } /// Scheduled prompt cancelled from the schedule manager dialog. public sealed partial class SessionScheduleCancelledData { /// Id of the scheduled prompt that was cancelled. [JsonPropertyName("id")] public required long Id { get; set; } } /// Informational message for timeline display with categorization. public sealed partial class SessionInfoData { /// Category of informational message (e.g., "notification", "timing", "context_window", "mcp", "snapshot", "configuration", "authentication", "model"). [JsonPropertyName("infoType")] public required string InfoType { get; set; } /// Human-readable informational message for display in the timeline. [JsonPropertyName("message")] public required string Message { get; set; } /// Optional actionable tip displayed with this message. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("tip")] public string? Tip { get; set; } /// Optional URL associated with this message that the user can open in a browser. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("url")] public string? Url { get; set; } } /// Warning message for timeline display with categorization. public sealed partial class SessionWarningData { /// Human-readable warning message for display in the timeline. [JsonPropertyName("message")] public required string Message { get; set; } /// Optional URL associated with this warning that the user can open in a browser. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("url")] public string? Url { get; set; } /// Category of warning (e.g., "subscription", "policy", "mcp"). [JsonPropertyName("warningType")] public required string WarningType { get; set; } } /// Model change details including previous and new model identifiers. public sealed partial class SessionModelChangeData { /// Reason the change happened, when not user-initiated. Currently `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cause")] public string? Cause { get; set; } /// Newly selected model identifier. [JsonPropertyName("newModel")] public required string NewModel { get; set; } /// Model that was previously selected, if any. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("previousModel")] public string? PreviousModel { get; set; } /// Reasoning effort level before the model change, if applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("previousReasoningEffort")] public string? PreviousReasoningEffort { get; set; } /// Reasoning summary mode before the model change, if applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("previousReasoningSummary")] public ReasoningSummary? PreviousReasoningSummary { get; set; } /// Reasoning effort level after the model change, if applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } /// Reasoning summary mode after the model change, if applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningSummary")] public ReasoningSummary? ReasoningSummary { get; set; } } /// Agent mode change details including previous and new modes. public sealed partial class SessionModeChangedData { /// The session mode the agent is operating in. [JsonPropertyName("newMode")] public required SessionMode NewMode { get; set; } /// The session mode the agent is operating in. [JsonPropertyName("previousMode")] public required SessionMode PreviousMode { get; set; } } /// Plan file operation details indicating what changed. public sealed partial class SessionPlanChangedData { /// The type of operation performed on the plan file. [JsonPropertyName("operation")] public required PlanChangedOperation Operation { get; set; } } /// Workspace file change details including path and operation type. public sealed partial class SessionWorkspaceFileChangedData { /// Whether the file was newly created or updated. [JsonPropertyName("operation")] public required WorkspaceFileChangedOperation Operation { get; set; } /// Relative path within the session workspace files directory. [JsonPropertyName("path")] public required string Path { get; set; } } /// Session handoff metadata including source, context, and repository information. public sealed partial class SessionHandoffData { /// Additional context information for the handoff. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("context")] public string? Context { get; set; } /// ISO 8601 timestamp when the handoff occurred. [JsonPropertyName("handoffTime")] public required DateTimeOffset HandoffTime { get; set; } /// GitHub host URL for the source session (e.g., https://github.com or https://tenant.ghe.com). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("host")] public string? Host { get; set; } /// Session ID of the remote session being handed off. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("remoteSessionId")] public string? RemoteSessionId { get; set; } /// Repository context for the handed-off session. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("repository")] public HandoffRepository? Repository { get; set; } /// Origin type of the session being handed off. [JsonPropertyName("sourceType")] public required HandoffSourceType SourceType { get; set; } /// Summary of the work done in the source session. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("summary")] public string? Summary { get; set; } } /// Conversation truncation statistics including token counts and removed content metrics. public sealed partial class SessionTruncationData { /// Number of messages removed by truncation. [JsonPropertyName("messagesRemovedDuringTruncation")] public required long MessagesRemovedDuringTruncation { get; set; } /// Identifier of the component that performed truncation (e.g., "BasicTruncator"). [JsonPropertyName("performedBy")] public required string PerformedBy { get; set; } /// Number of conversation messages after truncation. [JsonPropertyName("postTruncationMessagesLength")] public required long PostTruncationMessagesLength { get; set; } /// Total tokens in conversation messages after truncation. [JsonPropertyName("postTruncationTokensInMessages")] public required long PostTruncationTokensInMessages { get; set; } /// Number of conversation messages before truncation. [JsonPropertyName("preTruncationMessagesLength")] public required long PreTruncationMessagesLength { get; set; } /// Total tokens in conversation messages before truncation. [JsonPropertyName("preTruncationTokensInMessages")] public required long PreTruncationTokensInMessages { get; set; } /// Maximum token count for the model's context window. [JsonPropertyName("tokenLimit")] public required long TokenLimit { get; set; } /// Number of tokens removed by truncation. [JsonPropertyName("tokensRemovedDuringTruncation")] public required long TokensRemovedDuringTruncation { get; set; } } /// Session rewind details including target event and count of removed events. public sealed partial class SessionSnapshotRewindData { /// Number of events that were removed by the rewind. [JsonPropertyName("eventsRemoved")] public required long EventsRemoved { get; set; } /// Event ID that was rewound to; this event and all after it were removed. [JsonPropertyName("upToEventId")] public required string UpToEventId { get; set; } } /// Session termination metrics including usage statistics, code changes, and shutdown reason. public sealed partial class SessionShutdownData { /// Aggregate code change metrics for the session. [JsonPropertyName("codeChanges")] public required ShutdownCodeChanges CodeChanges { get; set; } /// Non-system message token count at shutdown. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("conversationTokens")] public long? ConversationTokens { get; set; } /// Model that was selected at the time of shutdown. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("currentModel")] public string? CurrentModel { get; set; } /// Total tokens in context window at shutdown. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("currentTokens")] public long? CurrentTokens { get; set; } /// Error description when shutdownType is "error". [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("errorReason")] public string? ErrorReason { get; set; } /// Per-model usage breakdown, keyed by model identifier. [JsonPropertyName("modelMetrics")] public required IDictionary ModelMetrics { get; set; } /// Unix timestamp (milliseconds) when the session started. [JsonPropertyName("sessionStartTime")] public required long SessionStartTime { get; set; } /// Whether the session ended normally ("routine") or due to a crash/fatal error ("error"). [JsonPropertyName("shutdownType")] public required ShutdownType ShutdownType { get; set; } /// System message token count at shutdown. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("systemTokens")] public long? SystemTokens { get; set; } /// Session-wide per-token-type accumulated token counts. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("tokenDetails")] public IDictionary? TokenDetails { get; set; } /// Tool definitions token count at shutdown. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolDefinitionsTokens")] public long? ToolDefinitionsTokens { get; set; } /// Cumulative time spent in API calls during the session, in milliseconds. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonPropertyName("totalApiDurationMs")] public required TimeSpan TotalApiDuration { get; set; } /// Session-wide accumulated nano-AI units cost. [Experimental(Diagnostics.Experimental)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("totalNanoAiu")] public double? TotalNanoAiu { get; set; } /// Total number of premium API requests used during the session. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonInclude] [JsonPropertyName("totalPremiumRequests")] internal double? TotalPremiumRequests { get; set; } } /// Working directory and git context at session start. public sealed partial class SessionContextChangedData { /// Base commit of current git branch at session start time. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("baseCommit")] public string? BaseCommit { get; set; } /// Current git branch name. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("branch")] public string? Branch { get; set; } /// Current working directory path. [JsonPropertyName("cwd")] public required string Cwd { get; set; } /// Root directory of the git repository, resolved via git rev-parse. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("gitRoot")] public string? GitRoot { get; set; } /// Head commit of current git branch at session start time. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("headCommit")] public string? HeadCommit { get; set; } /// Hosting platform type of the repository (github or ado). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("hostType")] public WorkingDirectoryContextHostType? HostType { get; set; } /// Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("repository")] public string? Repository { get; set; } /// Raw host string from the git remote URL (e.g. "github.com", "mycompany.ghe.com", "dev.azure.com"). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("repositoryHost")] public string? RepositoryHost { get; set; } } /// Current context window usage statistics including token and message counts. public sealed partial class SessionUsageInfoData { /// Token count from non-system messages (user, assistant, tool). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("conversationTokens")] public long? ConversationTokens { get; set; } /// Current number of tokens in the context window. [JsonPropertyName("currentTokens")] public required long CurrentTokens { get; set; } /// Whether this is the first usage_info event emitted in this session. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("isInitial")] public bool? IsInitial { get; set; } /// Current number of messages in the conversation. [JsonPropertyName("messagesLength")] public required long MessagesLength { get; set; } /// Token count from system message(s). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("systemTokens")] public long? SystemTokens { get; set; } /// Maximum token count for the model's context window. [JsonPropertyName("tokenLimit")] public required long TokenLimit { get; set; } /// Token count from tool definitions. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolDefinitionsTokens")] public long? ToolDefinitionsTokens { get; set; } } /// Context window breakdown at the start of LLM-powered conversation compaction. public sealed partial class SessionCompactionStartData { /// Token count from non-system messages (user, assistant, tool) at compaction start. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("conversationTokens")] public long? ConversationTokens { get; set; } /// Token count from system message(s) at compaction start. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("systemTokens")] public long? SystemTokens { get; set; } /// Token count from tool definitions at compaction start. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolDefinitionsTokens")] public long? ToolDefinitionsTokens { get; set; } } /// Conversation compaction results including success status, metrics, and optional error details. public sealed partial class SessionCompactionCompleteData { /// Checkpoint snapshot number created for recovery. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("checkpointNumber")] public long? CheckpointNumber { get; set; } /// File path where the checkpoint was stored. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("checkpointPath")] public string? CheckpointPath { get; set; } /// Token usage breakdown for the compaction LLM call (aligned with assistant.usage format). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("compactionTokensUsed")] public CompactionCompleteCompactionTokensUsed? CompactionTokensUsed { get; set; } /// Token count from non-system messages (user, assistant, tool) after compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("conversationTokens")] public long? ConversationTokens { get; set; } /// User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("customInstructions")] public string? CustomInstructions { get; set; } /// Error message if compaction failed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("error")] public string? Error { get; set; } /// Number of messages removed during compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("messagesRemoved")] public long? MessagesRemoved { get; set; } /// Total tokens in conversation after compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("postCompactionTokens")] public long? PostCompactionTokens { get; set; } /// Number of messages before compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("preCompactionMessagesLength")] public long? PreCompactionMessagesLength { get; set; } /// Total tokens in conversation before compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("preCompactionTokens")] public long? PreCompactionTokens { get; set; } /// GitHub request tracing ID (x-github-request-id header) for the compaction LLM call. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("requestId")] public string? RequestId { get; set; } /// Whether compaction completed successfully. [JsonPropertyName("success")] public required bool Success { get; set; } /// LLM-generated summary of the compacted conversation history. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("summaryContent")] public string? SummaryContent { get; set; } /// Token count from system message(s) after compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("systemTokens")] public long? SystemTokens { get; set; } /// Number of tokens removed during compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("tokensRemoved")] public long? TokensRemoved { get; set; } /// Token count from tool definitions after compaction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolDefinitionsTokens")] public long? ToolDefinitionsTokens { get; set; } } /// Task completion notification with summary from the agent. public sealed partial class SessionTaskCompleteData { /// Whether the tool call succeeded. False when validation failed (e.g., invalid arguments). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("success")] public bool? Success { get; set; } /// Summary of the completed task, provided by the agent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("summary")] public string? Summary { get; set; } } /// Schema for the `UserMessageData` type. public sealed partial class UserMessageData { /// The agent mode that was active when this message was sent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("agentMode")] public UserMessageAgentMode? AgentMode { get; set; } /// Files, selections, or GitHub references attached to the message. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("attachments")] public UserMessageAttachment[]? Attachments { get; set; } /// The user's message text as displayed in the timeline. [JsonPropertyName("content")] public required string Content { get; set; } /// CAPI interaction ID for correlating this user message with its turn. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("interactionId")] public string? InteractionId { get; set; } /// True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("isAutopilotContinuation")] public bool? IsAutopilotContinuation { get; set; } /// Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("nativeDocumentPathFallbackPaths")] public string[]? NativeDocumentPathFallbackPaths { get; set; } /// Parent agent task ID for background telemetry correlated to this user turn. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("parentAgentTaskId")] public string? ParentAgentTaskId { get; set; } /// Origin of this message, used for timeline filtering (e.g., "skill-pdf" for skill-injected messages that should be hidden from the user). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("source")] public string? Source { get; set; } /// Normalized document MIME types that were sent natively instead of through tagged_files XML. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("supportedNativeDocumentMimeTypes")] public string[]? SupportedNativeDocumentMimeTypes { get; set; } /// Transformed version of the message sent to the model, with XML wrapping, timestamps, and other augmentations for prompt caching. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("transformedContent")] public string? TransformedContent { get; set; } } /// Empty payload; the event signals that the pending message queue has changed. public sealed partial class PendingMessagesModifiedData { } /// Turn initialization metadata including identifier and interaction tracking. public sealed partial class AssistantTurnStartData { /// CAPI interaction ID for correlating this turn with upstream telemetry. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("interactionId")] public string? InteractionId { get; set; } /// Identifier for this turn within the agentic loop, typically a stringified turn number. [JsonPropertyName("turnId")] public required string TurnId { get; set; } } /// Agent intent description for current activity or plan. public sealed partial class AssistantIntentData { /// Short description of what the agent is currently doing or planning to do. [JsonPropertyName("intent")] public required string Intent { get; set; } } /// Assistant reasoning content for timeline display with complete thinking text. public sealed partial class AssistantReasoningData { /// The complete extended thinking text from the model. [JsonPropertyName("content")] public required string Content { get; set; } /// Unique identifier for this reasoning block. [JsonPropertyName("reasoningId")] public required string ReasoningId { get; set; } } /// Streaming reasoning delta for incremental extended thinking updates. public sealed partial class AssistantReasoningDeltaData { /// Incremental text chunk to append to the reasoning content. [JsonPropertyName("deltaContent")] public required string DeltaContent { get; set; } /// Reasoning block ID this delta belongs to, matching the corresponding assistant.reasoning event. [JsonPropertyName("reasoningId")] public required string ReasoningId { get; set; } } /// Streaming response progress with cumulative byte count. public sealed partial class AssistantStreamingDeltaData { /// Cumulative total bytes received from the streaming response so far. [JsonPropertyName("totalResponseSizeBytes")] public required long TotalResponseSizeBytes { get; set; } } /// Assistant response containing text content, optional tool requests, and interaction metadata. public sealed partial class AssistantMessageData { /// Raw Anthropic content array with advisor blocks (server_tool_use, advisor_tool_result) for verbatim round-tripping. [Experimental(Diagnostics.Experimental)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("anthropicAdvisorBlocks")] public JsonElement[]? AnthropicAdvisorBlocks { get; set; } /// Anthropic advisor model ID used for this response, for timeline display on replay. [Experimental(Diagnostics.Experimental)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("anthropicAdvisorModel")] public string? AnthropicAdvisorModel { get; set; } /// The assistant's text response content. [JsonPropertyName("content")] public required string Content { get; set; } /// Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("encryptedContent")] public string? EncryptedContent { get; set; } /// CAPI interaction ID for correlating this message with upstream telemetry. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("interactionId")] public string? InteractionId { get; set; } /// Unique identifier for this assistant message. [JsonPropertyName("messageId")] public required string MessageId { get; set; } /// Model that produced this assistant message, if known. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// Actual output token count from the API response (completion_tokens), used for accurate token accounting. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("outputTokens")] public long? OutputTokens { get; set; } /// Tool call ID of the parent tool invocation when this event originates from a sub-agent. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This member is deprecated and will be removed in a future version.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("parentToolCallId")] public string? ParentToolCallId { get; set; } /// Generation phase for phased-output models (e.g., thinking vs. response phases). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("phase")] public string? Phase { get; set; } /// Opaque/encrypted extended thinking data from Anthropic models. Session-bound and stripped on resume. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningOpaque")] public string? ReasoningOpaque { get; set; } /// Readable reasoning text from the model's extended thinking. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningText")] public string? ReasoningText { get; set; } /// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("requestId")] public string? RequestId { get; set; } /// Tool invocations requested by the assistant in this message. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolRequests")] public AssistantMessageToolRequest[]? ToolRequests { get; set; } /// Identifier for the agent loop turn that produced this message, matching the corresponding assistant.turn_start event. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("turnId")] public string? TurnId { get; set; } } /// Streaming assistant message start metadata. public sealed partial class AssistantMessageStartData { /// Message ID this start event belongs to, matching subsequent deltas and assistant.message. [JsonPropertyName("messageId")] public required string MessageId { get; set; } /// Generation phase this message belongs to for phased-output models. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("phase")] public string? Phase { get; set; } } /// Streaming assistant message delta for incremental response updates. public sealed partial class AssistantMessageDeltaData { /// Incremental text chunk to append to the message content. [JsonPropertyName("deltaContent")] public required string DeltaContent { get; set; } /// Message ID this delta belongs to, matching the corresponding assistant.message event. [JsonPropertyName("messageId")] public required string MessageId { get; set; } /// Tool call ID of the parent tool invocation when this event originates from a sub-agent. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This member is deprecated and will be removed in a future version.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("parentToolCallId")] public string? ParentToolCallId { get; set; } } /// Turn completion metadata including the turn identifier. public sealed partial class AssistantTurnEndData { /// Identifier of the turn that has ended, matching the corresponding assistant.turn_start event. [JsonPropertyName("turnId")] public required string TurnId { get; set; } } /// LLM API call usage metrics including tokens, costs, quotas, and billing information. public sealed partial class AssistantUsageData { /// Completion ID from the model provider (e.g., chatcmpl-abc123). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("apiCallId")] public string? ApiCallId { get; set; } /// API endpoint used for this model call, matching CAPI supported_endpoints vocabulary. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("apiEndpoint")] public AssistantUsageApiEndpoint? ApiEndpoint { get; set; } /// Number of tokens read from prompt cache. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cacheReadTokens")] public long? CacheReadTokens { get; set; } /// Number of tokens written to prompt cache. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cacheWriteTokens")] public long? CacheWriteTokens { get; set; } /// Per-request cost and usage data from the CAPI copilot_usage response field. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonInclude] [JsonPropertyName("copilotUsage")] internal AssistantUsageCopilotUsage? CopilotUsage { get; set; } /// Model multiplier cost for billing purposes. [Experimental(Diagnostics.Experimental)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cost")] public double? Cost { get; set; } /// Duration of the API call in milliseconds. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("duration")] public TimeSpan? Duration { get; set; } /// What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("initiator")] public string? Initiator { get; set; } /// Number of input tokens consumed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("inputTokens")] public long? InputTokens { get; set; } /// Average inter-token latency in milliseconds. Only available for streaming requests. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("interTokenLatencyMs")] public TimeSpan? InterTokenLatency { get; set; } /// Model identifier used for this API call. [JsonPropertyName("model")] public required string Model { get; set; } /// Number of output tokens produced. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("outputTokens")] public long? OutputTokens { get; set; } /// Parent tool call ID when this usage originates from a sub-agent. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This member is deprecated and will be removed in a future version.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("parentToolCallId")] public string? ParentToolCallId { get; set; } /// GitHub request tracing ID (x-github-request-id header) for server-side log correlation. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("providerCallId")] public string? ProviderCallId { get; set; } /// Per-quota resource usage snapshots, keyed by quota identifier. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonInclude] [JsonPropertyName("quotaSnapshots")] internal IDictionary? QuotaSnapshots { get; set; } /// Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max"). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } /// Number of output tokens used for reasoning (e.g., chain-of-thought). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningTokens")] public long? ReasoningTokens { get; set; } /// Time to first token in milliseconds. Only available for streaming requests. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("timeToFirstTokenMs")] public TimeSpan? TimeToFirstToken { get; set; } } /// Failed LLM API call metadata for telemetry. public sealed partial class ModelCallFailureData { /// Completion ID from the model provider (e.g., chatcmpl-abc123). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("apiCallId")] public string? ApiCallId { get; set; } /// Duration of the failed API call in milliseconds. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("durationMs")] public TimeSpan? Duration { get; set; } /// Raw provider/runtime error message for restricted telemetry. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("errorMessage")] public string? ErrorMessage { get; set; } /// What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("initiator")] public string? Initiator { get; set; } /// Model identifier used for the failed API call. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// GitHub request tracing ID (x-github-request-id header) for server-side log correlation. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("providerCallId")] public string? ProviderCallId { get; set; } /// Where the failed model call originated. [JsonPropertyName("source")] public required ModelCallFailureSource Source { get; set; } /// HTTP status code from the failed request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("statusCode")] public int? StatusCode { get; set; } } /// Turn abort information including the reason for termination. public sealed partial class AbortData { /// Finite reason code describing why the current turn was aborted. [JsonPropertyName("reason")] public required AbortReason Reason { get; set; } } /// User-initiated tool invocation request with tool name and arguments. public sealed partial class ToolUserRequestedData { /// Arguments for the tool invocation. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("arguments")] public JsonElement? Arguments { get; set; } /// Unique identifier for this tool call. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } /// Name of the tool the user wants to invoke. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Tool execution startup details including MCP server information when applicable. public sealed partial class ToolExecutionStartData { /// Arguments passed to the tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("arguments")] public JsonElement? Arguments { get; set; } /// Name of the MCP server hosting this tool, when the tool is an MCP tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mcpServerName")] public string? McpServerName { get; set; } /// Original tool name on the MCP server, when the tool is an MCP tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mcpToolName")] public string? McpToolName { get; set; } /// Tool call ID of the parent tool invocation when this event originates from a sub-agent. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This member is deprecated and will be removed in a future version.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("parentToolCallId")] public string? ParentToolCallId { get; set; } /// Unique identifier for this tool call. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } /// Name of the tool being executed. [JsonPropertyName("toolName")] public required string ToolName { get; set; } /// Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("turnId")] public string? TurnId { get; set; } } /// Streaming tool execution output for incremental result display. public sealed partial class ToolExecutionPartialResultData { /// Incremental output chunk from the running tool. [JsonPropertyName("partialOutput")] public required string PartialOutput { get; set; } /// Tool call ID this partial result belongs to. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } } /// Tool execution progress notification with status message. public sealed partial class ToolExecutionProgressData { /// Human-readable progress status message (e.g., from an MCP server). [JsonPropertyName("progressMessage")] public required string ProgressMessage { get; set; } /// Tool call ID this progress notification belongs to. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } } /// Tool execution completion results including success status, detailed output, and error information. public sealed partial class ToolExecutionCompleteData { /// Error details when the tool execution failed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("error")] public ToolExecutionCompleteError? Error { get; set; } /// CAPI interaction ID for correlating this tool execution with upstream telemetry. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("interactionId")] public string? InteractionId { get; set; } /// Whether this tool call was explicitly requested by the user rather than the assistant. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("isUserRequested")] public bool? IsUserRequested { get; set; } /// Model identifier that generated this tool call. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// Tool call ID of the parent tool invocation when this event originates from a sub-agent. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This member is deprecated and will be removed in a future version.")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("parentToolCallId")] public string? ParentToolCallId { get; set; } /// Tool execution result on success. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("result")] public ToolExecutionCompleteResult? Result { get; set; } /// Whether this tool execution ran inside a sandbox container. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("sandboxed")] public bool? Sandboxed { get; set; } /// Whether the tool execution completed successfully. [JsonPropertyName("success")] public required bool Success { get; set; } /// Unique identifier for the completed tool call. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } /// Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolTelemetry")] public IDictionary? ToolTelemetry { get; set; } /// Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("turnId")] public string? TurnId { get; set; } } /// Skill invocation details including content, allowed tools, and plugin metadata. public sealed partial class SkillInvokedData { /// Tool names that should be auto-approved when this skill is active. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("allowedTools")] public string[]? AllowedTools { get; set; } /// Full content of the skill file, injected into the conversation for the model. [JsonPropertyName("content")] public required string Content { get; set; } /// Description of the skill from its SKILL.md frontmatter. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("description")] public string? Description { get; set; } /// Name of the invoked skill. [JsonPropertyName("name")] public required string Name { get; set; } /// File path to the SKILL.md definition. [JsonPropertyName("path")] public required string Path { get; set; } /// Name of the plugin this skill originated from, when applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("pluginName")] public string? PluginName { get; set; } /// Version of the plugin this skill originated from, when applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("pluginVersion")] public string? PluginVersion { get; set; } } /// Sub-agent startup details including parent tool call and agent information. public sealed partial class SubagentStartedData { /// Description of what the sub-agent does. [JsonPropertyName("agentDescription")] public required string AgentDescription { get; set; } /// Human-readable display name of the sub-agent. [JsonPropertyName("agentDisplayName")] public required string AgentDisplayName { get; set; } /// Internal name of the sub-agent. [JsonPropertyName("agentName")] public required string AgentName { get; set; } /// Model the sub-agent will run with, when known at start. Surfaced in the timeline for auto-selected sub-agents (e.g. rubber-duck). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// Tool call ID of the parent tool invocation that spawned this sub-agent. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } } /// Sub-agent completion details for successful execution. public sealed partial class SubagentCompletedData { /// Human-readable display name of the sub-agent. [JsonPropertyName("agentDisplayName")] public required string AgentDisplayName { get; set; } /// Internal name of the sub-agent. [JsonPropertyName("agentName")] public required string AgentName { get; set; } /// Wall-clock duration of the sub-agent execution in milliseconds. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("durationMs")] public TimeSpan? Duration { get; set; } /// Model used by the sub-agent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// Tool call ID of the parent tool invocation that spawned this sub-agent. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } /// Total tokens (input + output) consumed by the sub-agent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("totalTokens")] public long? TotalTokens { get; set; } /// Total number of tool calls made by the sub-agent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("totalToolCalls")] public long? TotalToolCalls { get; set; } } /// Sub-agent failure details including error message and agent information. public sealed partial class SubagentFailedData { /// Human-readable display name of the sub-agent. [JsonPropertyName("agentDisplayName")] public required string AgentDisplayName { get; set; } /// Internal name of the sub-agent. [JsonPropertyName("agentName")] public required string AgentName { get; set; } /// Wall-clock duration of the sub-agent execution in milliseconds. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("durationMs")] public TimeSpan? Duration { get; set; } /// Error message describing why the sub-agent failed. [JsonPropertyName("error")] public required string Error { get; set; } /// Model used by the sub-agent (if any model calls succeeded before failure). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// Tool call ID of the parent tool invocation that spawned this sub-agent. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } /// Total tokens (input + output) consumed before the sub-agent failed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("totalTokens")] public long? TotalTokens { get; set; } /// Total number of tool calls made before the sub-agent failed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("totalToolCalls")] public long? TotalToolCalls { get; set; } } /// Custom agent selection details including name and available tools. public sealed partial class SubagentSelectedData { /// Human-readable display name of the selected custom agent. [JsonPropertyName("agentDisplayName")] public required string AgentDisplayName { get; set; } /// Internal name of the selected custom agent. [JsonPropertyName("agentName")] public required string AgentName { get; set; } /// List of tool names available to this agent, or null for all tools. [JsonPropertyName("tools")] public string[]? Tools { get; set; } } /// Empty payload; the event signals that the custom agent was deselected, returning to the default agent. public sealed partial class SubagentDeselectedData { } /// Hook invocation start details including type and input data. public sealed partial class HookStartData { /// Unique identifier for this hook invocation. [JsonPropertyName("hookInvocationId")] public required string HookInvocationId { get; set; } /// Type of hook being invoked (e.g., "preToolUse", "postToolUse", "sessionStart"). [JsonPropertyName("hookType")] public required string HookType { get; set; } /// Input data passed to the hook. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("input")] public JsonElement? Input { get; set; } } /// Hook invocation completion details including output, success status, and error information. public sealed partial class HookEndData { /// Error details when the hook failed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("error")] public HookEndError? Error { get; set; } /// Identifier matching the corresponding hook.start event. [JsonPropertyName("hookInvocationId")] public required string HookInvocationId { get; set; } /// Type of hook that was invoked (e.g., "preToolUse", "postToolUse", "sessionStart"). [JsonPropertyName("hookType")] public required string HookType { get; set; } /// Output data produced by the hook. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("output")] public JsonElement? Output { get; set; } /// Whether the hook completed successfully. [JsonPropertyName("success")] public required bool Success { get; set; } } /// System/developer instruction content with role and optional template metadata. public sealed partial class SystemMessageData { /// The system or developer prompt text sent as model input. [JsonPropertyName("content")] public required string Content { get; set; } /// Metadata about the prompt template and its construction. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("metadata")] public SystemMessageMetadata? Metadata { get; set; } /// Optional name identifier for the message source. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("name")] public string? Name { get; set; } /// Message role: "system" for system prompts, "developer" for developer-injected instructions. [JsonPropertyName("role")] public required SystemMessageRole Role { get; set; } } /// System-generated notification for runtime events like background task completion. public sealed partial class SystemNotificationData { /// The notification text, typically wrapped in <system_notification> XML tags. [JsonPropertyName("content")] public required string Content { get; set; } /// Structured metadata identifying what triggered this notification. [JsonPropertyName("kind")] public required SystemNotification Kind { get; set; } } /// Permission request notification requiring client approval with request details. public sealed partial class PermissionRequestedData { /// Details of the permission being requested. [JsonPropertyName("permissionRequest")] public required PermissionRequest PermissionRequest { get; set; } /// Derived user-facing permission prompt details for UI consumers. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("promptRequest")] public PermissionPromptRequest? PromptRequest { get; set; } /// Unique identifier for this permission request; used to respond via session.respondToPermission(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// When true, this permission was already resolved by a permissionRequest hook and requires no client action. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("resolvedByHook")] public bool? ResolvedByHook { get; set; } } /// Permission request completion notification signaling UI dismissal. public sealed partial class PermissionCompletedData { /// Request ID of the resolved permission request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// The result of the permission request. [JsonPropertyName("result")] public required PermissionResult Result { get; set; } /// Optional tool call ID associated with this permission prompt; clients may use it to correlate UI created from tool-scoped prompts. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// User input request notification with question and optional predefined choices. public sealed partial class UserInputRequestedData { /// Whether the user can provide a free-form text response in addition to predefined choices. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("allowFreeform")] public bool? AllowFreeform { get; set; } /// Predefined choices for the user to select from, if applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("choices")] public string[]? Choices { get; set; } /// The question or prompt to present to the user. [JsonPropertyName("question")] public required string Question { get; set; } /// Unique identifier for this input request; used to respond via session.respondToUserInput(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// The LLM-assigned tool call ID that triggered this request; used by remote UIs to correlate responses. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// User input request completion with the user's response. public sealed partial class UserInputCompletedData { /// The user's answer to the input request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("answer")] public string? Answer { get; set; } /// Request ID of the resolved user input request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// Whether the answer was typed as free-form text rather than selected from choices. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("wasFreeform")] public bool? WasFreeform { get; set; } } /// Elicitation request; may be form-based (structured input) or URL-based (browser redirect). public sealed partial class ElicitationRequestedData { /// The source that initiated the request (MCP server name, or absent for agent-initiated). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("elicitationSource")] public string? ElicitationSource { get; set; } /// Message describing what information is needed from the user. [JsonPropertyName("message")] public required string Message { get; set; } /// Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mode")] public ElicitationRequestedMode? Mode { get; set; } /// JSON Schema describing the form fields to present to the user (form mode only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("requestedSchema")] public ElicitationRequestedSchema? RequestedSchema { get; set; } /// Unique identifier for this elicitation request; used to respond via session.respondToElicitation(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// Tool call ID from the LLM completion; used to correlate with CompletionChunk.toolCall.id for remote UIs. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// URL to open in the user's browser (url mode only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("url")] public string? Url { get; set; } } /// Elicitation request completion with the user's response. public sealed partial class ElicitationCompletedData { /// The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("action")] public ElicitationCompletedAction? Action { get; set; } /// The submitted form data when action is 'accept'; keys match the requested schema fields. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("content")] public IDictionary? Content { get; set; } /// Request ID of the resolved elicitation request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } } /// Sampling request from an MCP server; contains the server name and a requestId for correlation. public sealed partial class SamplingRequestedData { /// The JSON-RPC request ID from the MCP protocol. [JsonPropertyName("mcpRequestId")] public required JsonElement McpRequestId { get; set; } /// Unique identifier for this sampling request; used to respond via session.respondToSampling(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// Name of the MCP server that initiated the sampling request. [JsonPropertyName("serverName")] public required string ServerName { get; set; } } /// Sampling request completion notification signaling UI dismissal. public sealed partial class SamplingCompletedData { /// Request ID of the resolved sampling request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } } /// OAuth authentication request for an MCP server. public sealed partial class McpOauthRequiredData { /// Unique identifier for this OAuth request; used to respond via session.respondToMcpOAuth(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// Display name of the MCP server that requires OAuth. [JsonPropertyName("serverName")] public required string ServerName { get; set; } /// URL of the MCP server that requires OAuth. [JsonPropertyName("serverUrl")] public required string ServerUrl { get; set; } /// Static OAuth client configuration, if the server specifies one. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("staticClientConfig")] public McpOauthRequiredStaticClientConfig? StaticClientConfig { get; set; } } /// MCP OAuth request completion notification. public sealed partial class McpOauthCompletedData { /// Request ID of the resolved OAuth request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } } /// Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined. public sealed partial class SessionCustomNotificationData { /// Source-defined custom notification name. [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] [MinLength(1)] [JsonPropertyName("name")] public required string Name { get; set; } /// Source-defined JSON payload for the custom notification. [JsonPropertyName("payload")] public required JsonElement Payload { get; set; } /// Namespace for the custom notification producer. [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] [MinLength(1)] [JsonPropertyName("source")] public required string Source { get; set; } /// Optional source-defined string identifiers describing the payload subject. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("subject")] public IDictionary? Subject { get; set; } /// Optional source-defined payload schema version. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("version")] public long? Version { get; set; } } /// External tool invocation request for client-side tool execution. public sealed partial class ExternalToolRequestedData { /// Arguments to pass to the external tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("arguments")] public JsonElement? Arguments { get; set; } /// Unique identifier for this request; used to respond via session.respondToExternalTool(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// Session ID that this external tool request belongs to. [JsonPropertyName("sessionId")] public required string SessionId { get; set; } /// Tool call ID assigned to this external tool invocation. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } /// Name of the external tool to invoke. [JsonPropertyName("toolName")] public required string ToolName { get; set; } /// W3C Trace Context traceparent header for the execute_tool span. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("traceparent")] public string? Traceparent { get; set; } /// W3C Trace Context tracestate header for the execute_tool span. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("tracestate")] public string? Tracestate { get; set; } } /// External tool completion notification signaling UI dismissal. public sealed partial class ExternalToolCompletedData { /// Request ID of the resolved external tool request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } } /// Queued slash command dispatch request for client execution. public sealed partial class CommandQueuedData { /// The slash command text to be executed (e.g., /help, /clear). [JsonPropertyName("command")] public required string Command { get; set; } /// Unique identifier for this request; used to respond via session.respondToQueuedCommand(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } } /// Registered command dispatch request routed to the owning client. public sealed partial class CommandExecuteData { /// Raw argument string after the command name. [JsonPropertyName("args")] public required string Args { get; set; } /// The full command text (e.g., /deploy production). [JsonPropertyName("command")] public required string Command { get; set; } /// Command name without leading /. [JsonPropertyName("commandName")] public required string CommandName { get; set; } /// Unique identifier; used to respond via session.commands.handlePendingCommand(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } } /// Queued command completion notification signaling UI dismissal. public sealed partial class CommandCompletedData { /// Request ID of the resolved command request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } } /// Auto mode switch request notification requiring user approval. public sealed partial class AutoModeSwitchRequestedData { /// The rate limit error code that triggered this request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("errorCode")] public string? ErrorCode { get; set; } /// Unique identifier for this request; used to respond via session.respondToAutoModeSwitch(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// Seconds until the rate limit resets, when known. Lets clients render a humanized reset time alongside the prompt. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("retryAfterSeconds")] public long? RetryAfterSeconds { get; set; } } /// Auto mode switch completion notification. public sealed partial class AutoModeSwitchCompletedData { /// Request ID of the resolved request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// The user's auto-mode-switch choice. [JsonPropertyName("response")] public required AutoModeSwitchResponse Response { get; set; } } /// SDK command registration change notification. public sealed partial class CommandsChangedData { /// Current list of registered SDK commands. [JsonPropertyName("commands")] public required CommandsChangedCommand[] Commands { get; set; } } /// Session capability change notification. public sealed partial class CapabilitiesChangedData { /// UI capability changes. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("ui")] public CapabilitiesChangedUI? Ui { get; set; } } /// Plan approval request with plan content and available user actions. public sealed partial class ExitPlanModeRequestedData { /// Available actions the user can take. [JsonPropertyName("actions")] public required ExitPlanModeAction[] Actions { get; set; } /// Full content of the plan file. [JsonPropertyName("planContent")] public required string PlanContent { get; set; } /// Recommended action to preselect for the user. [JsonPropertyName("recommendedAction")] public required ExitPlanModeAction RecommendedAction { get; set; } /// Unique identifier for this request; used to respond via session.respondToExitPlanMode(). [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// Summary of the plan that was created. [JsonPropertyName("summary")] public required string Summary { get; set; } } /// Plan mode exit completion with the user's approval decision and optional feedback. public sealed partial class ExitPlanModeCompletedData { /// Whether the plan was approved by the user. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("approved")] public bool? Approved { get; set; } /// Whether edits should be auto-approved without confirmation. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("autoApproveEdits")] public bool? AutoApproveEdits { get; set; } /// Free-form feedback from the user if they requested changes to the plan. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("feedback")] public string? Feedback { get; set; } /// Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request. [JsonPropertyName("requestId")] public required string RequestId { get; set; } /// Action selected by the user. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("selectedAction")] public ExitPlanModeAction? SelectedAction { get; set; } } /// Schema for the `ToolsUpdatedData` type. public sealed partial class SessionToolsUpdatedData { /// Identifier of the model the resolved tools apply to. [JsonPropertyName("model")] public required string Model { get; set; } } /// Schema for the `BackgroundTasksChangedData` type. public sealed partial class SessionBackgroundTasksChangedData { } /// Schema for the `SkillsLoadedData` type. public sealed partial class SessionSkillsLoadedData { /// Array of resolved skill metadata. [JsonPropertyName("skills")] public required SkillsLoadedSkill[] Skills { get; set; } } /// Schema for the `CustomAgentsUpdatedData` type. public sealed partial class SessionCustomAgentsUpdatedData { /// Array of loaded custom agent metadata. [JsonPropertyName("agents")] public required CustomAgentsUpdatedAgent[] Agents { get; set; } /// Fatal errors from agent loading. [JsonPropertyName("errors")] public required string[] Errors { get; set; } /// Non-fatal warnings from agent loading. [JsonPropertyName("warnings")] public required string[] Warnings { get; set; } } /// Schema for the `McpServersLoadedData` type. public sealed partial class SessionMcpServersLoadedData { /// Array of MCP server status summaries. [JsonPropertyName("servers")] public required McpServersLoadedServer[] Servers { get; set; } } /// Schema for the `McpServerStatusChangedData` type. public sealed partial class SessionMcpServerStatusChangedData { /// Name of the MCP server whose status changed. [JsonPropertyName("serverName")] public required string ServerName { get; set; } /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured. [JsonPropertyName("status")] public required McpServerStatus Status { get; set; } } /// Schema for the `ExtensionsLoadedData` type. public sealed partial class SessionExtensionsLoadedData { /// Array of discovered extensions and their status. [JsonPropertyName("extensions")] public required ExtensionsLoadedExtension[] Extensions { get; set; } } /// Working directory and git context at session start. /// Nested data type for WorkingDirectoryContext. public sealed partial class WorkingDirectoryContext { /// Base commit of current git branch at session start time. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("baseCommit")] public string? BaseCommit { get; set; } /// Current git branch name. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("branch")] public string? Branch { get; set; } /// Current working directory path. [JsonPropertyName("cwd")] public required string Cwd { get; set; } /// Root directory of the git repository, resolved via git rev-parse. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("gitRoot")] public string? GitRoot { get; set; } /// Head commit of current git branch at session start time. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("headCommit")] public string? HeadCommit { get; set; } /// Hosting platform type of the repository (github or ado). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("hostType")] public WorkingDirectoryContextHostType? HostType { get; set; } /// Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("repository")] public string? Repository { get; set; } /// Raw host string from the git remote URL (e.g. "github.com", "mycompany.ghe.com", "dev.azure.com"). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("repositoryHost")] public string? RepositoryHost { get; set; } } /// Repository context for the handed-off session. /// Nested data type for HandoffRepository. public sealed partial class HandoffRepository { /// Git branch name, if applicable. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("branch")] public string? Branch { get; set; } /// Repository name. [JsonPropertyName("name")] public required string Name { get; set; } /// Repository owner (user or organization). [JsonPropertyName("owner")] public required string Owner { get; set; } } /// Aggregate code change metrics for the session. /// Nested data type for ShutdownCodeChanges. public sealed partial class ShutdownCodeChanges { /// List of file paths that were modified during the session. [JsonPropertyName("filesModified")] public required string[] FilesModified { get; set; } /// Total number of lines added during the session. [JsonPropertyName("linesAdded")] public required long LinesAdded { get; set; } /// Total number of lines removed during the session. [JsonPropertyName("linesRemoved")] public required long LinesRemoved { get; set; } } /// Request count and cost metrics. /// Nested data type for ShutdownModelMetricRequests. public sealed partial class ShutdownModelMetricRequests { /// Cumulative cost multiplier for requests to this model. [Experimental(Diagnostics.Experimental)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cost")] public double? Cost { get; set; } /// Total number of API requests made to this model. [Experimental(Diagnostics.Experimental)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("count")] public long? Count { get; set; } } /// Schema for the `ShutdownModelMetricTokenDetail` type. /// Nested data type for ShutdownModelMetricTokenDetail. public sealed partial class ShutdownModelMetricTokenDetail { /// Accumulated token count for this token type. [JsonPropertyName("tokenCount")] public required long TokenCount { get; set; } } /// Token usage breakdown. /// Nested data type for ShutdownModelMetricUsage. public sealed partial class ShutdownModelMetricUsage { /// Total tokens read from prompt cache across all requests. [JsonPropertyName("cacheReadTokens")] public required long CacheReadTokens { get; set; } /// Total tokens written to prompt cache across all requests. [JsonPropertyName("cacheWriteTokens")] public required long CacheWriteTokens { get; set; } /// Total input tokens consumed across all requests to this model. [JsonPropertyName("inputTokens")] public required long InputTokens { get; set; } /// Total output tokens produced across all requests to this model. [JsonPropertyName("outputTokens")] public required long OutputTokens { get; set; } /// Total reasoning tokens produced across all requests to this model. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reasoningTokens")] public long? ReasoningTokens { get; set; } } /// Schema for the `ShutdownModelMetric` type. /// Nested data type for ShutdownModelMetric. public sealed partial class ShutdownModelMetric { /// Request count and cost metrics. [JsonPropertyName("requests")] public required ShutdownModelMetricRequests Requests { get; set; } /// Token count details per type. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("tokenDetails")] public IDictionary? TokenDetails { get; set; } /// Accumulated nano-AI units cost for this model. [Experimental(Diagnostics.Experimental)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("totalNanoAiu")] public double? TotalNanoAiu { get; set; } /// Token usage breakdown. [JsonPropertyName("usage")] public required ShutdownModelMetricUsage Usage { get; set; } } /// Schema for the `ShutdownTokenDetail` type. /// Nested data type for ShutdownTokenDetail. public sealed partial class ShutdownTokenDetail { /// Accumulated token count for this token type. [JsonPropertyName("tokenCount")] public required long TokenCount { get; set; } } /// Token usage detail for a single billing category. /// Nested data type for CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail. public sealed partial class CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail { /// Number of tokens in this billing batch. [JsonPropertyName("batchSize")] public required long BatchSize { get; set; } /// Cost per batch of tokens. [JsonPropertyName("costPerBatch")] public required long CostPerBatch { get; set; } /// Total token count for this entry. [JsonPropertyName("tokenCount")] public required long TokenCount { get; set; } /// Token category (e.g., "input", "output"). [JsonPropertyName("tokenType")] public required string TokenType { get; set; } } /// Per-request cost and usage data from the CAPI copilot_usage response field. /// Nested data type for CompactionCompleteCompactionTokensUsedCopilotUsage. internal sealed partial class CompactionCompleteCompactionTokensUsedCopilotUsage { /// Itemized token usage breakdown. [JsonPropertyName("tokenDetails")] public required CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail[] TokenDetails { get; set; } /// Total cost in nano-AI units for this request. [JsonPropertyName("totalNanoAiu")] public required double TotalNanoAiu { get; set; } } /// Token usage breakdown for the compaction LLM call (aligned with assistant.usage format). /// Nested data type for CompactionCompleteCompactionTokensUsed. public sealed partial class CompactionCompleteCompactionTokensUsed { /// Cached input tokens reused in the compaction LLM call. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cacheReadTokens")] public long? CacheReadTokens { get; set; } /// Tokens written to prompt cache in the compaction LLM call. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cacheWriteTokens")] public long? CacheWriteTokens { get; set; } /// Per-request cost and usage data from the CAPI copilot_usage response field. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonInclude] [JsonPropertyName("copilotUsage")] internal CompactionCompleteCompactionTokensUsedCopilotUsage? CopilotUsage { get; set; } /// Duration of the compaction LLM call in milliseconds. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("duration")] public TimeSpan? Duration { get; set; } /// Input tokens consumed by the compaction LLM call. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("inputTokens")] public long? InputTokens { get; set; } /// Model identifier used for the compaction LLM call. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// Output tokens produced by the compaction LLM call. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("outputTokens")] public long? OutputTokens { get; set; } } /// Optional line range to scope the attachment to a specific section of the file. /// Nested data type for UserMessageAttachmentFileLineRange. public sealed partial class UserMessageAttachmentFileLineRange { /// End line number (1-based, inclusive). [JsonPropertyName("end")] public required long End { get; set; } /// Start line number (1-based). [JsonPropertyName("start")] public required long Start { get; set; } } /// File attachment. /// The file variant of . public sealed partial class UserMessageAttachmentFile : UserMessageAttachment { /// [JsonIgnore] public override string Type => "file"; /// User-facing display name for the attachment. [JsonPropertyName("displayName")] public required string DisplayName { get; set; } /// Optional line range to scope the attachment to a specific section of the file. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("lineRange")] public UserMessageAttachmentFileLineRange? LineRange { get; set; } /// Absolute file path. [JsonPropertyName("path")] public required string Path { get; set; } } /// Directory attachment. /// The directory variant of . public sealed partial class UserMessageAttachmentDirectory : UserMessageAttachment { /// [JsonIgnore] public override string Type => "directory"; /// User-facing display name for the attachment. [JsonPropertyName("displayName")] public required string DisplayName { get; set; } /// Absolute directory path. [JsonPropertyName("path")] public required string Path { get; set; } } /// End position of the selection. /// Nested data type for UserMessageAttachmentSelectionDetailsEnd. public sealed partial class UserMessageAttachmentSelectionDetailsEnd { /// End character offset within the line (0-based). [JsonPropertyName("character")] public required long Character { get; set; } /// End line number (0-based). [JsonPropertyName("line")] public required long Line { get; set; } } /// Start position of the selection. /// Nested data type for UserMessageAttachmentSelectionDetailsStart. public sealed partial class UserMessageAttachmentSelectionDetailsStart { /// Start character offset within the line (0-based). [JsonPropertyName("character")] public required long Character { get; set; } /// Start line number (0-based). [JsonPropertyName("line")] public required long Line { get; set; } } /// Position range of the selection within the file. /// Nested data type for UserMessageAttachmentSelectionDetails. public sealed partial class UserMessageAttachmentSelectionDetails { /// End position of the selection. [JsonPropertyName("end")] public required UserMessageAttachmentSelectionDetailsEnd End { get; set; } /// Start position of the selection. [JsonPropertyName("start")] public required UserMessageAttachmentSelectionDetailsStart Start { get; set; } } /// Code selection attachment from an editor. /// The selection variant of . public sealed partial class UserMessageAttachmentSelection : UserMessageAttachment { /// [JsonIgnore] public override string Type => "selection"; /// User-facing display name for the selection. [JsonPropertyName("displayName")] public required string DisplayName { get; set; } /// Absolute path to the file containing the selection. [JsonPropertyName("filePath")] public required string FilePath { get; set; } /// Position range of the selection within the file. [JsonPropertyName("selection")] public required UserMessageAttachmentSelectionDetails Selection { get; set; } /// The selected text content. [JsonPropertyName("text")] public required string Text { get; set; } } /// GitHub issue, pull request, or discussion reference. /// The github_reference variant of . public sealed partial class UserMessageAttachmentGithubReference : UserMessageAttachment { /// [JsonIgnore] public override string Type => "github_reference"; /// Issue, pull request, or discussion number. [JsonPropertyName("number")] public required long Number { get; set; } /// Type of GitHub reference. [JsonPropertyName("referenceType")] public required UserMessageAttachmentGithubReferenceType ReferenceType { get; set; } /// Current state of the referenced item (e.g., open, closed, merged). [JsonPropertyName("state")] public required string State { get; set; } /// Title of the referenced item. [JsonPropertyName("title")] public required string Title { get; set; } /// URL to the referenced item on GitHub. [JsonPropertyName("url")] public required string Url { get; set; } } /// Blob attachment with inline base64-encoded data. /// The blob variant of . public sealed partial class UserMessageAttachmentBlob : UserMessageAttachment { /// [JsonIgnore] public override string Type => "blob"; /// Base64-encoded content. [Base64String] [JsonPropertyName("data")] public required string Data { get; set; } /// User-facing display name for the attachment. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("displayName")] public string? DisplayName { get; set; } /// MIME type of the inline data. [JsonPropertyName("mimeType")] public required string MimeType { get; set; } } /// A user message attachment — a file, directory, code selection, blob, or GitHub reference. /// Polymorphic base type discriminated by type. [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(UserMessageAttachmentFile), "file")] [JsonDerivedType(typeof(UserMessageAttachmentDirectory), "directory")] [JsonDerivedType(typeof(UserMessageAttachmentSelection), "selection")] [JsonDerivedType(typeof(UserMessageAttachmentGithubReference), "github_reference")] [JsonDerivedType(typeof(UserMessageAttachmentBlob), "blob")] public partial class UserMessageAttachment { /// The type discriminator. [JsonPropertyName("type")] public virtual string Type { get; set; } = string.Empty; } /// A tool invocation request from the assistant. /// Nested data type for AssistantMessageToolRequest. public sealed partial class AssistantMessageToolRequest { /// Arguments to pass to the tool, format depends on the tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("arguments")] public JsonElement? Arguments { get; set; } /// Resolved intention summary describing what this specific call does. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("intentionSummary")] public string? IntentionSummary { get; set; } /// Name of the MCP server hosting this tool, when the tool is an MCP tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mcpServerName")] public string? McpServerName { get; set; } /// Original tool name on the MCP server, when the tool is an MCP tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mcpToolName")] public string? McpToolName { get; set; } /// Name of the tool being invoked. [JsonPropertyName("name")] public required string Name { get; set; } /// Unique identifier for this tool call. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } /// Human-readable display title for the tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolTitle")] public string? ToolTitle { get; set; } /// Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("type")] public AssistantMessageToolRequestType? Type { get; set; } } /// Token usage detail for a single billing category. /// Nested data type for AssistantUsageCopilotUsageTokenDetail. public sealed partial class AssistantUsageCopilotUsageTokenDetail { /// Number of tokens in this billing batch. [JsonPropertyName("batchSize")] public required long BatchSize { get; set; } /// Cost per batch of tokens. [JsonPropertyName("costPerBatch")] public required long CostPerBatch { get; set; } /// Total token count for this entry. [JsonPropertyName("tokenCount")] public required long TokenCount { get; set; } /// Token category (e.g., "input", "output"). [JsonPropertyName("tokenType")] public required string TokenType { get; set; } } /// Per-request cost and usage data from the CAPI copilot_usage response field. /// Nested data type for AssistantUsageCopilotUsage. internal sealed partial class AssistantUsageCopilotUsage { /// Itemized token usage breakdown. [JsonPropertyName("tokenDetails")] public required AssistantUsageCopilotUsageTokenDetail[] TokenDetails { get; set; } /// Total cost in nano-AI units for this request. [JsonPropertyName("totalNanoAiu")] public required double TotalNanoAiu { get; set; } } /// Schema for the `AssistantUsageQuotaSnapshot` type. /// Nested data type for AssistantUsageQuotaSnapshot. internal sealed partial class AssistantUsageQuotaSnapshot { /// Total requests allowed by the entitlement. [JsonInclude] [JsonPropertyName("entitlementRequests")] internal required long EntitlementRequests { get; set; } /// Whether the user has an unlimited usage entitlement. [JsonInclude] [JsonPropertyName("isUnlimitedEntitlement")] internal required bool IsUnlimitedEntitlement { get; set; } /// Number of additional usage requests made this period. [JsonInclude] [JsonPropertyName("overage")] internal required double Overage { get; set; } /// Whether additional usage is allowed when quota is exhausted. [JsonInclude] [JsonPropertyName("overageAllowedWithExhaustedQuota")] internal required bool OverageAllowedWithExhaustedQuota { get; set; } /// Percentage of quota remaining (0 to 100). [JsonInclude] [JsonPropertyName("remainingPercentage")] internal required double RemainingPercentage { get; set; } /// Date when the quota resets. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonInclude] [JsonPropertyName("resetDate")] internal DateTimeOffset? ResetDate { get; set; } /// Whether usage is still permitted after quota exhaustion. [JsonInclude] [JsonPropertyName("usageAllowedWithExhaustedQuota")] internal required bool UsageAllowedWithExhaustedQuota { get; set; } /// Number of requests already consumed. [JsonInclude] [JsonPropertyName("usedRequests")] internal required long UsedRequests { get; set; } } /// Error details when the tool execution failed. /// Nested data type for ToolExecutionCompleteError. public sealed partial class ToolExecutionCompleteError { /// Machine-readable error code. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("code")] public string? Code { get; set; } /// Human-readable error message. [JsonPropertyName("message")] public required string Message { get; set; } } /// Plain text content block. /// The text variant of . public sealed partial class ToolExecutionCompleteContentText : ToolExecutionCompleteContent { /// [JsonIgnore] public override string Type => "text"; /// The text content. [JsonPropertyName("text")] public required string Text { get; set; } } /// Terminal/shell output content block with optional exit code and working directory. /// The terminal variant of . public sealed partial class ToolExecutionCompleteContentTerminal : ToolExecutionCompleteContent { /// [JsonIgnore] public override string Type => "terminal"; /// Working directory where the command was executed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("cwd")] public string? Cwd { get; set; } /// Process exit code, if the command has completed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("exitCode")] public long? ExitCode { get; set; } /// Terminal/shell output text. [JsonPropertyName("text")] public required string Text { get; set; } } /// Image content block with base64-encoded data. /// The image variant of . public sealed partial class ToolExecutionCompleteContentImage : ToolExecutionCompleteContent { /// [JsonIgnore] public override string Type => "image"; /// Base64-encoded image data. [Base64String] [JsonPropertyName("data")] public required string Data { get; set; } /// MIME type of the image (e.g., image/png, image/jpeg). [JsonPropertyName("mimeType")] public required string MimeType { get; set; } } /// Audio content block with base64-encoded data. /// The audio variant of . public sealed partial class ToolExecutionCompleteContentAudio : ToolExecutionCompleteContent { /// [JsonIgnore] public override string Type => "audio"; /// Base64-encoded audio data. [Base64String] [JsonPropertyName("data")] public required string Data { get; set; } /// MIME type of the audio (e.g., audio/wav, audio/mpeg). [JsonPropertyName("mimeType")] public required string MimeType { get; set; } } /// Icon image for a resource. /// Nested data type for ToolExecutionCompleteContentResourceLinkIcon. public sealed partial class ToolExecutionCompleteContentResourceLinkIcon { /// MIME type of the icon image. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mimeType")] public string? MimeType { get; set; } /// Available icon sizes (e.g., ['16x16', '32x32']). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("sizes")] public string[]? Sizes { get; set; } /// URL or path to the icon image. [JsonPropertyName("src")] public required string Src { get; set; } /// Theme variant this icon is intended for. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("theme")] public ToolExecutionCompleteContentResourceLinkIconTheme? Theme { get; set; } } /// Resource link content block referencing an external resource. /// The resource_link variant of . public sealed partial class ToolExecutionCompleteContentResourceLink : ToolExecutionCompleteContent { /// [JsonIgnore] public override string Type => "resource_link"; /// Human-readable description of the resource. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("description")] public string? Description { get; set; } /// Icons associated with this resource. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("icons")] public ToolExecutionCompleteContentResourceLinkIcon[]? Icons { get; set; } /// MIME type of the resource content. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mimeType")] public string? MimeType { get; set; } /// Resource name identifier. [JsonPropertyName("name")] public required string Name { get; set; } /// Size of the resource in bytes. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("size")] public long? Size { get; set; } /// Human-readable display title for the resource. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("title")] public string? Title { get; set; } /// URI identifying the resource. [JsonPropertyName("uri")] public required string Uri { get; set; } } /// Schema for the `EmbeddedTextResourceContents` type. /// Nested data type for EmbeddedTextResourceContents. public sealed partial class EmbeddedTextResourceContents { /// MIME type of the text content. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mimeType")] public string? MimeType { get; set; } /// Text content of the resource. [JsonPropertyName("text")] public required string Text { get; set; } /// URI identifying the resource. [JsonPropertyName("uri")] public required string Uri { get; set; } } /// Schema for the `EmbeddedBlobResourceContents` type. /// Nested data type for EmbeddedBlobResourceContents. public sealed partial class EmbeddedBlobResourceContents { /// Base64-encoded binary content of the resource. [Base64String] [JsonPropertyName("blob")] public required string Blob { get; set; } /// MIME type of the blob content. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mimeType")] public string? MimeType { get; set; } /// URI identifying the resource. [JsonPropertyName("uri")] public required string Uri { get; set; } } /// The embedded resource contents, either text or base64-encoded binary. /// JSON union data type for ToolExecutionCompleteContentResourceDetails. [JsonConverter(typeof(Converter))] public sealed partial class ToolExecutionCompleteContentResourceDetails { /// Gets the value when this instance contains . public EmbeddedTextResourceContents? EmbeddedTextResourceContents { get; } /// Gets the value when this instance contains . public EmbeddedBlobResourceContents? EmbeddedBlobResourceContents { get; } /// Initializes a new instance of the class from . public ToolExecutionCompleteContentResourceDetails(EmbeddedTextResourceContents value) { ArgumentNullException.ThrowIfNull(value); EmbeddedTextResourceContents = value; } /// Converts to . public static implicit operator ToolExecutionCompleteContentResourceDetails(EmbeddedTextResourceContents value) => new(value); /// Initializes a new instance of the class from . public ToolExecutionCompleteContentResourceDetails(EmbeddedBlobResourceContents value) { ArgumentNullException.ThrowIfNull(value); EmbeddedBlobResourceContents = value; } /// Converts to . public static implicit operator ToolExecutionCompleteContentResourceDetails(EmbeddedBlobResourceContents value) => new(value); /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ToolExecutionCompleteContentResourceDetails Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType == JsonTokenType.Null) { throw new JsonException("Expected JSON object for ToolExecutionCompleteContentResourceDetails."); } using var document = JsonDocument.ParseValue(ref reader); var element = document.RootElement; if (element.ValueKind == JsonValueKind.Object && element.TryGetProperty("text", out _) && !element.TryGetProperty("blob", out _)) { var embeddedTextResourceContents = JsonSerializer.Deserialize(element, SessionEventsJsonContext.Default.EmbeddedTextResourceContents); return embeddedTextResourceContents is null ? throw new JsonException("Expected EmbeddedTextResourceContents value.") : new ToolExecutionCompleteContentResourceDetails(embeddedTextResourceContents); } if (element.ValueKind == JsonValueKind.Object && element.TryGetProperty("blob", out _) && !element.TryGetProperty("text", out _)) { var embeddedBlobResourceContents = JsonSerializer.Deserialize(element, SessionEventsJsonContext.Default.EmbeddedBlobResourceContents); return embeddedBlobResourceContents is null ? throw new JsonException("Expected EmbeddedBlobResourceContents value.") : new ToolExecutionCompleteContentResourceDetails(embeddedBlobResourceContents); } throw new JsonException("JSON value did not match any ToolExecutionCompleteContentResourceDetails variant."); } /// public override void Write(Utf8JsonWriter writer, ToolExecutionCompleteContentResourceDetails value, JsonSerializerOptions options) { if (value.EmbeddedTextResourceContents is { } embeddedTextResourceContents) { JsonSerializer.Serialize(writer, embeddedTextResourceContents, SessionEventsJsonContext.Default.EmbeddedTextResourceContents); return; } if (value.EmbeddedBlobResourceContents is { } embeddedBlobResourceContents) { JsonSerializer.Serialize(writer, embeddedBlobResourceContents, SessionEventsJsonContext.Default.EmbeddedBlobResourceContents); return; } throw new JsonException("No ToolExecutionCompleteContentResourceDetails variant value is set."); } } } /// Embedded resource content block with inline text or binary data. /// The resource variant of . public sealed partial class ToolExecutionCompleteContentResource : ToolExecutionCompleteContent { /// [JsonIgnore] public override string Type => "resource"; /// The embedded resource contents, either text or base64-encoded binary. [JsonPropertyName("resource")] public required ToolExecutionCompleteContentResourceDetails Resource { get; set; } } /// A content block within a tool result, which may be text, terminal output, image, audio, or a resource. /// Polymorphic base type discriminated by type. [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(ToolExecutionCompleteContentText), "text")] [JsonDerivedType(typeof(ToolExecutionCompleteContentTerminal), "terminal")] [JsonDerivedType(typeof(ToolExecutionCompleteContentImage), "image")] [JsonDerivedType(typeof(ToolExecutionCompleteContentAudio), "audio")] [JsonDerivedType(typeof(ToolExecutionCompleteContentResourceLink), "resource_link")] [JsonDerivedType(typeof(ToolExecutionCompleteContentResource), "resource")] public partial class ToolExecutionCompleteContent { /// The type discriminator. [JsonPropertyName("type")] public virtual string Type { get; set; } = string.Empty; } /// Tool execution result on success. /// Nested data type for ToolExecutionCompleteResult. public sealed partial class ToolExecutionCompleteResult { /// Concise tool result text sent to the LLM for chat completion, potentially truncated for token efficiency. [JsonPropertyName("content")] public required string Content { get; set; } /// Structured content blocks (text, images, audio, resources) returned by the tool in their native format. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("contents")] public ToolExecutionCompleteContent[]? Contents { get; set; } /// Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("detailedContent")] public string? DetailedContent { get; set; } } /// Error details when the hook failed. /// Nested data type for HookEndError. public sealed partial class HookEndError { /// Human-readable error message. [JsonPropertyName("message")] public required string Message { get; set; } /// Error stack trace, when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("stack")] public string? Stack { get; set; } } /// Metadata about the prompt template and its construction. /// Nested data type for SystemMessageMetadata. public sealed partial class SystemMessageMetadata { /// Version identifier of the prompt template used. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("promptVersion")] public string? PromptVersion { get; set; } /// Template variables used when constructing the prompt. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("variables")] public IDictionary? Variables { get; set; } } /// Schema for the `SystemNotificationAgentCompleted` type. /// The agent_completed variant of . public sealed partial class SystemNotificationAgentCompleted : SystemNotification { /// [JsonIgnore] public override string Type => "agent_completed"; /// Unique identifier of the background agent. [JsonPropertyName("agentId")] public required string AgentId { get; set; } /// Type of the agent (e.g., explore, task, general-purpose). [JsonPropertyName("agentType")] public required string AgentType { get; set; } /// Human-readable description of the agent task. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("description")] public string? Description { get; set; } /// The full prompt given to the background agent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("prompt")] public string? Prompt { get; set; } /// Whether the agent completed successfully or failed. [JsonPropertyName("status")] public required SystemNotificationAgentCompletedStatus Status { get; set; } } /// Schema for the `SystemNotificationAgentIdle` type. /// The agent_idle variant of . public sealed partial class SystemNotificationAgentIdle : SystemNotification { /// [JsonIgnore] public override string Type => "agent_idle"; /// Unique identifier of the background agent. [JsonPropertyName("agentId")] public required string AgentId { get; set; } /// Type of the agent (e.g., explore, task, general-purpose). [JsonPropertyName("agentType")] public required string AgentType { get; set; } /// Human-readable description of the agent task. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("description")] public string? Description { get; set; } } /// Schema for the `SystemNotificationNewInboxMessage` type. /// The new_inbox_message variant of . public sealed partial class SystemNotificationNewInboxMessage : SystemNotification { /// [JsonIgnore] public override string Type => "new_inbox_message"; /// Unique identifier of the inbox entry. [JsonPropertyName("entryId")] public required string EntryId { get; set; } /// Human-readable name of the sender. [JsonPropertyName("senderName")] public required string SenderName { get; set; } /// Category of the sender (e.g., sidekick-agent, plugin, hook). [JsonPropertyName("senderType")] public required string SenderType { get; set; } /// Short summary shown before the agent decides whether to read the inbox. [JsonPropertyName("summary")] public required string Summary { get; set; } } /// Schema for the `SystemNotificationShellCompleted` type. /// The shell_completed variant of . public sealed partial class SystemNotificationShellCompleted : SystemNotification { /// [JsonIgnore] public override string Type => "shell_completed"; /// Human-readable description of the command. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("description")] public string? Description { get; set; } /// Exit code of the shell command, if available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("exitCode")] public long? ExitCode { get; set; } /// Unique identifier of the shell session. [JsonPropertyName("shellId")] public required string ShellId { get; set; } } /// Schema for the `SystemNotificationShellDetachedCompleted` type. /// The shell_detached_completed variant of . public sealed partial class SystemNotificationShellDetachedCompleted : SystemNotification { /// [JsonIgnore] public override string Type => "shell_detached_completed"; /// Human-readable description of the command. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("description")] public string? Description { get; set; } /// Unique identifier of the detached shell session. [JsonPropertyName("shellId")] public required string ShellId { get; set; } } /// Schema for the `SystemNotificationInstructionDiscovered` type. /// The instruction_discovered variant of . public sealed partial class SystemNotificationInstructionDiscovered : SystemNotification { /// [JsonIgnore] public override string Type => "instruction_discovered"; /// Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/'). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("description")] public string? Description { get; set; } /// Relative path to the discovered instruction file. [JsonPropertyName("sourcePath")] public required string SourcePath { get; set; } /// Path of the file access that triggered discovery. [JsonPropertyName("triggerFile")] public required string TriggerFile { get; set; } /// Tool command that triggered discovery (currently always 'view'). [JsonPropertyName("triggerTool")] public required string TriggerTool { get; set; } } /// Structured metadata identifying what triggered this notification. /// Polymorphic base type discriminated by type. [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(SystemNotificationAgentCompleted), "agent_completed")] [JsonDerivedType(typeof(SystemNotificationAgentIdle), "agent_idle")] [JsonDerivedType(typeof(SystemNotificationNewInboxMessage), "new_inbox_message")] [JsonDerivedType(typeof(SystemNotificationShellCompleted), "shell_completed")] [JsonDerivedType(typeof(SystemNotificationShellDetachedCompleted), "shell_detached_completed")] [JsonDerivedType(typeof(SystemNotificationInstructionDiscovered), "instruction_discovered")] public partial class SystemNotification { /// The type discriminator. [JsonPropertyName("type")] public virtual string Type { get; set; } = string.Empty; } /// Schema for the `PermissionRequestShellCommand` type. /// Nested data type for PermissionRequestShellCommand. public sealed partial class PermissionRequestShellCommand { /// Command identifier (e.g., executable name). [JsonPropertyName("identifier")] public required string Identifier { get; set; } /// Whether this command is read-only (no side effects). [JsonPropertyName("readOnly")] public required bool ReadOnly { get; set; } } /// Schema for the `PermissionRequestShellPossibleUrl` type. /// Nested data type for PermissionRequestShellPossibleUrl. public sealed partial class PermissionRequestShellPossibleUrl { /// URL that may be accessed by the command. [JsonPropertyName("url")] public required string Url { get; set; } } /// Shell command permission request. /// The shell variant of . public sealed partial class PermissionRequestShell : PermissionRequest { /// [JsonIgnore] public override string Kind => "shell"; /// Whether the UI can offer session-wide approval for this command pattern. [JsonPropertyName("canOfferSessionApproval")] public required bool CanOfferSessionApproval { get; set; } /// Parsed command identifiers found in the command text. [JsonPropertyName("commands")] public required PermissionRequestShellCommand[] Commands { get; set; } /// The complete shell command text to be executed. [JsonPropertyName("fullCommandText")] public required string FullCommandText { get; set; } /// Whether the command includes a file write redirection (e.g., > or >>). [JsonPropertyName("hasWriteFileRedirection")] public required bool HasWriteFileRedirection { get; set; } /// Human-readable description of what the command intends to do. [JsonPropertyName("intention")] public required string Intention { get; set; } /// File paths that may be read or written by the command. [JsonPropertyName("possiblePaths")] public required string[] PossiblePaths { get; set; } /// URLs that may be accessed by the command. [JsonPropertyName("possibleUrls")] public required PermissionRequestShellPossibleUrl[] PossibleUrls { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// Optional warning message about risks of running this command. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("warning")] public string? Warning { get; set; } } /// File write permission request. /// The write variant of . public sealed partial class PermissionRequestWrite : PermissionRequest { /// [JsonIgnore] public override string Kind => "write"; /// Whether the UI can offer session-wide approval for file write operations. [JsonPropertyName("canOfferSessionApproval")] public required bool CanOfferSessionApproval { get; set; } /// Unified diff showing the proposed changes. [JsonPropertyName("diff")] public required string Diff { get; set; } /// Path of the file being written to. [JsonPropertyName("fileName")] public required string FileName { get; set; } /// Human-readable description of the intended file change. [JsonPropertyName("intention")] public required string Intention { get; set; } /// Complete new file contents for newly created files. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("newFileContents")] public string? NewFileContents { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// File or directory read permission request. /// The read variant of . public sealed partial class PermissionRequestRead : PermissionRequest { /// [JsonIgnore] public override string Kind => "read"; /// Human-readable description of why the file is being read. [JsonPropertyName("intention")] public required string Intention { get; set; } /// Path of the file or directory being read. [JsonPropertyName("path")] public required string Path { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// MCP tool invocation permission request. /// The mcp variant of . public sealed partial class PermissionRequestMcp : PermissionRequest { /// [JsonIgnore] public override string Kind => "mcp"; /// Arguments to pass to the MCP tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("args")] public JsonElement? Args { get; set; } /// Whether this MCP tool is read-only (no side effects). [JsonPropertyName("readOnly")] public required bool ReadOnly { get; set; } /// Name of the MCP server providing the tool. [JsonPropertyName("serverName")] public required string ServerName { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// Internal name of the MCP tool. [JsonPropertyName("toolName")] public required string ToolName { get; set; } /// Human-readable title of the MCP tool. [JsonPropertyName("toolTitle")] public required string ToolTitle { get; set; } } /// URL access permission request. /// The url variant of . public sealed partial class PermissionRequestUrl : PermissionRequest { /// [JsonIgnore] public override string Kind => "url"; /// Human-readable description of why the URL is being accessed. [JsonPropertyName("intention")] public required string Intention { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// URL to be fetched. [JsonPropertyName("url")] public required string Url { get; set; } } /// Memory operation permission request. /// The memory variant of . public sealed partial class PermissionRequestMemory : PermissionRequest { /// [JsonIgnore] public override string Kind => "memory"; /// Whether this is a store or vote memory operation. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("action")] public PermissionRequestMemoryAction? Action { get; set; } /// Source references for the stored fact (store only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("citations")] public string? Citations { get; set; } /// Vote direction (vote only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("direction")] public PermissionRequestMemoryDirection? Direction { get; set; } /// The fact being stored or voted on. [JsonPropertyName("fact")] public required string Fact { get; set; } /// Reason for the vote (vote only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reason")] public string? Reason { get; set; } /// Topic or subject of the memory (store only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("subject")] public string? Subject { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// Custom tool invocation permission request. /// The custom-tool variant of . public sealed partial class PermissionRequestCustomTool : PermissionRequest { /// [JsonIgnore] public override string Kind => "custom-tool"; /// Arguments to pass to the custom tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("args")] public JsonElement? Args { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// Description of what the custom tool does. [JsonPropertyName("toolDescription")] public required string ToolDescription { get; set; } /// Name of the custom tool. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Hook confirmation permission request. /// The hook variant of . public sealed partial class PermissionRequestHook : PermissionRequest { /// [JsonIgnore] public override string Kind => "hook"; /// Optional message from the hook explaining why confirmation is needed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("hookMessage")] public string? HookMessage { get; set; } /// Arguments of the tool call being gated. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolArgs")] public JsonElement? ToolArgs { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// Name of the tool the hook is gating. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Extension management permission request. /// The extension-management variant of . public sealed partial class PermissionRequestExtensionManagement : PermissionRequest { /// [JsonIgnore] public override string Kind => "extension-management"; /// Name of the extension being managed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("extensionName")] public string? ExtensionName { get; set; } /// The extension management operation (scaffold, reload). [JsonPropertyName("operation")] public required string Operation { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// Extension permission access request. /// The extension-permission-access variant of . public sealed partial class PermissionRequestExtensionPermissionAccess : PermissionRequest { /// [JsonIgnore] public override string Kind => "extension-permission-access"; /// Capabilities the extension is requesting. [JsonPropertyName("capabilities")] public required string[] Capabilities { get; set; } /// Name of the extension requesting permission access. [JsonPropertyName("extensionName")] public required string ExtensionName { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// Details of the permission being requested. /// Polymorphic base type discriminated by kind. [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(PermissionRequestShell), "shell")] [JsonDerivedType(typeof(PermissionRequestWrite), "write")] [JsonDerivedType(typeof(PermissionRequestRead), "read")] [JsonDerivedType(typeof(PermissionRequestMcp), "mcp")] [JsonDerivedType(typeof(PermissionRequestUrl), "url")] [JsonDerivedType(typeof(PermissionRequestMemory), "memory")] [JsonDerivedType(typeof(PermissionRequestCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionRequestHook), "hook")] [JsonDerivedType(typeof(PermissionRequestExtensionManagement), "extension-management")] [JsonDerivedType(typeof(PermissionRequestExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionRequest { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Shell command permission prompt. /// The commands variant of . public sealed partial class PermissionPromptRequestCommands : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "commands"; /// Whether the UI can offer session-wide approval for this command pattern. [JsonPropertyName("canOfferSessionApproval")] public required bool CanOfferSessionApproval { get; set; } /// Command identifiers covered by this approval prompt. [JsonPropertyName("commandIdentifiers")] public required string[] CommandIdentifiers { get; set; } /// The complete shell command text to be executed. [JsonPropertyName("fullCommandText")] public required string FullCommandText { get; set; } /// Human-readable description of what the command intends to do. [JsonPropertyName("intention")] public required string Intention { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// Optional warning message about risks of running this command. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("warning")] public string? Warning { get; set; } } /// File write permission prompt. /// The write variant of . public sealed partial class PermissionPromptRequestWrite : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "write"; /// Whether the UI can offer session-wide approval for file write operations. [JsonPropertyName("canOfferSessionApproval")] public required bool CanOfferSessionApproval { get; set; } /// Unified diff showing the proposed changes. [JsonPropertyName("diff")] public required string Diff { get; set; } /// Path of the file being written to. [JsonPropertyName("fileName")] public required string FileName { get; set; } /// Human-readable description of the intended file change. [JsonPropertyName("intention")] public required string Intention { get; set; } /// Complete new file contents for newly created files. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("newFileContents")] public string? NewFileContents { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// File read permission prompt. /// The read variant of . public sealed partial class PermissionPromptRequestRead : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "read"; /// Human-readable description of why the file is being read. [JsonPropertyName("intention")] public required string Intention { get; set; } /// Path of the file or directory being read. [JsonPropertyName("path")] public required string Path { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// MCP tool invocation permission prompt. /// The mcp variant of . public sealed partial class PermissionPromptRequestMcp : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "mcp"; /// Arguments to pass to the MCP tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("args")] public JsonElement? Args { get; set; } /// Name of the MCP server providing the tool. [JsonPropertyName("serverName")] public required string ServerName { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// Internal name of the MCP tool. [JsonPropertyName("toolName")] public required string ToolName { get; set; } /// Human-readable title of the MCP tool. [JsonPropertyName("toolTitle")] public required string ToolTitle { get; set; } } /// URL access permission prompt. /// The url variant of . public sealed partial class PermissionPromptRequestUrl : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "url"; /// Human-readable description of why the URL is being accessed. [JsonPropertyName("intention")] public required string Intention { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// URL to be fetched. [JsonPropertyName("url")] public required string Url { get; set; } } /// Memory operation permission prompt. /// The memory variant of . public sealed partial class PermissionPromptRequestMemory : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "memory"; /// Whether this is a store or vote memory operation. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("action")] public PermissionRequestMemoryAction? Action { get; set; } /// Source references for the stored fact (store only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("citations")] public string? Citations { get; set; } /// Vote direction (vote only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("direction")] public PermissionRequestMemoryDirection? Direction { get; set; } /// The fact being stored or voted on. [JsonPropertyName("fact")] public required string Fact { get; set; } /// Reason for the vote (vote only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reason")] public string? Reason { get; set; } /// Topic or subject of the memory (store only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("subject")] public string? Subject { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// Custom tool invocation permission prompt. /// The custom-tool variant of . public sealed partial class PermissionPromptRequestCustomTool : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "custom-tool"; /// Arguments to pass to the custom tool. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("args")] public JsonElement? Args { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// Description of what the custom tool does. [JsonPropertyName("toolDescription")] public required string ToolDescription { get; set; } /// Name of the custom tool. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Path access permission prompt. /// The path variant of . public sealed partial class PermissionPromptRequestPath : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "path"; /// Underlying permission kind that needs path approval. [JsonPropertyName("accessKind")] public required PermissionPromptRequestPathAccessKind AccessKind { get; set; } /// File paths that require explicit approval. [JsonPropertyName("paths")] public required string[] Paths { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// Hook confirmation permission prompt. /// The hook variant of . public sealed partial class PermissionPromptRequestHook : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "hook"; /// Optional message from the hook explaining why confirmation is needed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("hookMessage")] public string? HookMessage { get; set; } /// Arguments of the tool call being gated. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolArgs")] public JsonElement? ToolArgs { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } /// Name of the tool the hook is gating. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Extension management permission prompt. /// The extension-management variant of . public sealed partial class PermissionPromptRequestExtensionManagement : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "extension-management"; /// Name of the extension being managed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("extensionName")] public string? ExtensionName { get; set; } /// The extension management operation (scaffold, reload). [JsonPropertyName("operation")] public required string Operation { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// Extension permission access prompt. /// The extension-permission-access variant of . public sealed partial class PermissionPromptRequestExtensionPermissionAccess : PermissionPromptRequest { /// [JsonIgnore] public override string Kind => "extension-permission-access"; /// Capabilities the extension is requesting. [JsonPropertyName("capabilities")] public required string[] Capabilities { get; set; } /// Name of the extension requesting permission access. [JsonPropertyName("extensionName")] public required string ExtensionName { get; set; } /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] public string? ToolCallId { get; set; } } /// Derived user-facing permission prompt details for UI consumers. /// Polymorphic base type discriminated by kind. [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(PermissionPromptRequestCommands), "commands")] [JsonDerivedType(typeof(PermissionPromptRequestWrite), "write")] [JsonDerivedType(typeof(PermissionPromptRequestRead), "read")] [JsonDerivedType(typeof(PermissionPromptRequestMcp), "mcp")] [JsonDerivedType(typeof(PermissionPromptRequestUrl), "url")] [JsonDerivedType(typeof(PermissionPromptRequestMemory), "memory")] [JsonDerivedType(typeof(PermissionPromptRequestCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionPromptRequestPath), "path")] [JsonDerivedType(typeof(PermissionPromptRequestHook), "hook")] [JsonDerivedType(typeof(PermissionPromptRequestExtensionManagement), "extension-management")] [JsonDerivedType(typeof(PermissionPromptRequestExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionPromptRequest { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Schema for the `PermissionApproved` type. /// The approved variant of . public sealed partial class PermissionResultApproved : PermissionResult { /// [JsonIgnore] public override string Kind => "approved"; } /// Schema for the `UserToolSessionApprovalCommands` type. /// The commands variant of . public sealed partial class UserToolSessionApprovalCommands : UserToolSessionApproval { /// [JsonIgnore] public override string Kind => "commands"; /// Command identifiers approved by the user. [JsonPropertyName("commandIdentifiers")] public required string[] CommandIdentifiers { get; set; } } /// Schema for the `UserToolSessionApprovalRead` type. /// The read variant of . public sealed partial class UserToolSessionApprovalRead : UserToolSessionApproval { /// [JsonIgnore] public override string Kind => "read"; } /// Schema for the `UserToolSessionApprovalWrite` type. /// The write variant of . public sealed partial class UserToolSessionApprovalWrite : UserToolSessionApproval { /// [JsonIgnore] public override string Kind => "write"; } /// Schema for the `UserToolSessionApprovalMcp` type. /// The mcp variant of . public sealed partial class UserToolSessionApprovalMcp : UserToolSessionApproval { /// [JsonIgnore] public override string Kind => "mcp"; /// MCP server name. [JsonPropertyName("serverName")] public required string ServerName { get; set; } /// Optional MCP tool name, or null for all tools on the server. [JsonPropertyName("toolName")] public string? ToolName { get; set; } } /// Schema for the `UserToolSessionApprovalMemory` type. /// The memory variant of . public sealed partial class UserToolSessionApprovalMemory : UserToolSessionApproval { /// [JsonIgnore] public override string Kind => "memory"; } /// Schema for the `UserToolSessionApprovalCustomTool` type. /// The custom-tool variant of . public sealed partial class UserToolSessionApprovalCustomTool : UserToolSessionApproval { /// [JsonIgnore] public override string Kind => "custom-tool"; /// Custom tool name. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Schema for the `UserToolSessionApprovalExtensionManagement` type. /// The extension-management variant of . public sealed partial class UserToolSessionApprovalExtensionManagement : UserToolSessionApproval { /// [JsonIgnore] public override string Kind => "extension-management"; /// Optional operation identifier. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("operation")] public string? Operation { get; set; } } /// Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type. /// The extension-permission-access variant of . public sealed partial class UserToolSessionApprovalExtensionPermissionAccess : UserToolSessionApproval { /// [JsonIgnore] public override string Kind => "extension-permission-access"; /// Extension name. [JsonPropertyName("extensionName")] public required string ExtensionName { get; set; } } /// The approval to add as a session-scoped rule. /// Polymorphic base type discriminated by kind. [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(UserToolSessionApprovalCommands), "commands")] [JsonDerivedType(typeof(UserToolSessionApprovalRead), "read")] [JsonDerivedType(typeof(UserToolSessionApprovalWrite), "write")] [JsonDerivedType(typeof(UserToolSessionApprovalMcp), "mcp")] [JsonDerivedType(typeof(UserToolSessionApprovalMemory), "memory")] [JsonDerivedType(typeof(UserToolSessionApprovalCustomTool), "custom-tool")] [JsonDerivedType(typeof(UserToolSessionApprovalExtensionManagement), "extension-management")] [JsonDerivedType(typeof(UserToolSessionApprovalExtensionPermissionAccess), "extension-permission-access")] public partial class UserToolSessionApproval { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Schema for the `PermissionApprovedForSession` type. /// The approved-for-session variant of . public sealed partial class PermissionResultApprovedForSession : PermissionResult { /// [JsonIgnore] public override string Kind => "approved-for-session"; /// The approval to add as a session-scoped rule. [JsonPropertyName("approval")] public required UserToolSessionApproval Approval { get; set; } } /// Schema for the `PermissionApprovedForLocation` type. /// The approved-for-location variant of . public sealed partial class PermissionResultApprovedForLocation : PermissionResult { /// [JsonIgnore] public override string Kind => "approved-for-location"; /// The approval to persist for this location. [JsonPropertyName("approval")] public required UserToolSessionApproval Approval { get; set; } /// The location key (git root or cwd) to persist the approval to. [JsonPropertyName("locationKey")] public required string LocationKey { get; set; } } /// Schema for the `PermissionCancelled` type. /// The cancelled variant of . public sealed partial class PermissionResultCancelled : PermissionResult { /// [JsonIgnore] public override string Kind => "cancelled"; /// Optional explanation of why the request was cancelled. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reason")] public string? Reason { get; set; } } /// Schema for the `PermissionRule` type. /// Nested data type for PermissionRule. public sealed partial class PermissionRule { /// Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory'). [JsonPropertyName("argument")] public string? Argument { get; set; } /// The rule kind, such as Shell or GitHubMCP. [JsonPropertyName("kind")] public required string Kind { get; set; } } /// Schema for the `PermissionDeniedByRules` type. /// The denied-by-rules variant of . public sealed partial class PermissionResultDeniedByRules : PermissionResult { /// [JsonIgnore] public override string Kind => "denied-by-rules"; /// Rules that denied the request. [JsonPropertyName("rules")] public required PermissionRule[] Rules { get; set; } } /// Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type. /// The denied-no-approval-rule-and-could-not-request-from-user variant of . public sealed partial class PermissionResultDeniedNoApprovalRuleAndCouldNotRequestFromUser : PermissionResult { /// [JsonIgnore] public override string Kind => "denied-no-approval-rule-and-could-not-request-from-user"; } /// Schema for the `PermissionDeniedInteractivelyByUser` type. /// The denied-interactively-by-user variant of . public sealed partial class PermissionResultDeniedInteractivelyByUser : PermissionResult { /// [JsonIgnore] public override string Kind => "denied-interactively-by-user"; /// Optional feedback from the user explaining the denial. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("feedback")] public string? Feedback { get; set; } /// Whether to force-reject the current agent turn. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("forceReject")] public bool? ForceReject { get; set; } } /// Schema for the `PermissionDeniedByContentExclusionPolicy` type. /// The denied-by-content-exclusion-policy variant of . public sealed partial class PermissionResultDeniedByContentExclusionPolicy : PermissionResult { /// [JsonIgnore] public override string Kind => "denied-by-content-exclusion-policy"; /// Human-readable explanation of why the path was excluded. [JsonPropertyName("message")] public required string Message { get; set; } /// File path that triggered the exclusion. [JsonPropertyName("path")] public required string Path { get; set; } } /// Schema for the `PermissionDeniedByPermissionRequestHook` type. /// The denied-by-permission-request-hook variant of . public sealed partial class PermissionResultDeniedByPermissionRequestHook : PermissionResult { /// [JsonIgnore] public override string Kind => "denied-by-permission-request-hook"; /// Whether to interrupt the current agent turn. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("interrupt")] public bool? Interrupt { get; set; } /// Optional message from the hook explaining the denial. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("message")] public string? Message { get; set; } } /// The result of the permission request. /// Polymorphic base type discriminated by kind. [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(PermissionResultApproved), "approved")] [JsonDerivedType(typeof(PermissionResultApprovedForSession), "approved-for-session")] [JsonDerivedType(typeof(PermissionResultApprovedForLocation), "approved-for-location")] [JsonDerivedType(typeof(PermissionResultCancelled), "cancelled")] [JsonDerivedType(typeof(PermissionResultDeniedByRules), "denied-by-rules")] [JsonDerivedType(typeof(PermissionResultDeniedNoApprovalRuleAndCouldNotRequestFromUser), "denied-no-approval-rule-and-could-not-request-from-user")] [JsonDerivedType(typeof(PermissionResultDeniedInteractivelyByUser), "denied-interactively-by-user")] [JsonDerivedType(typeof(PermissionResultDeniedByContentExclusionPolicy), "denied-by-content-exclusion-policy")] [JsonDerivedType(typeof(PermissionResultDeniedByPermissionRequestHook), "denied-by-permission-request-hook")] public partial class PermissionResult { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// JSON Schema describing the form fields to present to the user (form mode only). /// Nested data type for ElicitationRequestedSchema. public sealed partial class ElicitationRequestedSchema { /// Form field definitions, keyed by field name. [JsonPropertyName("properties")] public required IDictionary Properties { get; set; } /// List of required field names. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("required")] public string[]? Required { get; set; } /// Schema type indicator (always 'object'). [JsonPropertyName("type")] public required string Type { get; set; } } /// Static OAuth client configuration, if the server specifies one. /// Nested data type for McpOauthRequiredStaticClientConfig. public sealed partial class McpOauthRequiredStaticClientConfig { /// OAuth client ID for the server. [JsonPropertyName("clientId")] public required string ClientId { get; set; } /// Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("grantType")] public string? GrantType { get; set; } /// Whether this is a public OAuth client. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("publicClient")] public bool? PublicClient { get; set; } } /// Schema for the `CommandsChangedCommand` type. /// Nested data type for CommandsChangedCommand. public sealed partial class CommandsChangedCommand { /// Optional human-readable command description. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("description")] public string? Description { get; set; } /// Slash command name without the leading slash. [JsonPropertyName("name")] public required string Name { get; set; } } /// UI capability changes. /// Nested data type for CapabilitiesChangedUI. public sealed partial class CapabilitiesChangedUI { /// Whether elicitation is now supported. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("elicitation")] public bool? Elicitation { get; set; } } /// Schema for the `SkillsLoadedSkill` type. /// Nested data type for SkillsLoadedSkill. public sealed partial class SkillsLoadedSkill { /// Description of what the skill does. [JsonPropertyName("description")] public required string Description { get; set; } /// Whether the skill is currently enabled. [JsonPropertyName("enabled")] public required bool Enabled { get; set; } /// Unique identifier for the skill. [JsonPropertyName("name")] public required string Name { get; set; } /// Absolute path to the skill file, if available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("path")] public string? Path { get; set; } /// Source location type (e.g., project, personal-copilot, plugin, builtin). [JsonPropertyName("source")] public required SkillSource Source { get; set; } /// Whether the skill can be invoked by the user as a slash command. [JsonPropertyName("userInvocable")] public required bool UserInvocable { get; set; } } /// Schema for the `CustomAgentsUpdatedAgent` type. /// Nested data type for CustomAgentsUpdatedAgent. public sealed partial class CustomAgentsUpdatedAgent { /// Description of what the agent does. [JsonPropertyName("description")] public required string Description { get; set; } /// Human-readable display name. [JsonPropertyName("displayName")] public required string DisplayName { get; set; } /// Unique identifier for the agent. [JsonPropertyName("id")] public required string Id { get; set; } /// Model override for this agent, if set. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// Internal name of the agent. [JsonPropertyName("name")] public required string Name { get; set; } /// Source location: user, project, inherited, remote, or plugin. [JsonPropertyName("source")] public required string Source { get; set; } /// List of tool names available to this agent, or null when all tools are available. [JsonPropertyName("tools")] public string[]? Tools { get; set; } /// Whether the agent can be selected by the user. [JsonPropertyName("userInvocable")] public required bool UserInvocable { get; set; } } /// Schema for the `McpServersLoadedServer` type. /// Nested data type for McpServersLoadedServer. public sealed partial class McpServersLoadedServer { /// Error message if the server failed to connect. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("error")] public string? Error { get; set; } /// Server name (config key). [JsonPropertyName("name")] public required string Name { get; set; } /// Configuration source: user, workspace, plugin, or builtin. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("source")] public McpServerSource? Source { get; set; } /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured. [JsonPropertyName("status")] public required McpServerStatus Status { get; set; } } /// Schema for the `ExtensionsLoadedExtension` type. /// Nested data type for ExtensionsLoadedExtension. public sealed partial class ExtensionsLoadedExtension { /// Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper'). [JsonPropertyName("id")] public required string Id { get; set; } /// Extension name (directory name). [JsonPropertyName("name")] public required string Name { get; set; } /// Discovery source. [JsonPropertyName("source")] public required ExtensionsLoadedExtensionSource Source { get; set; } /// Current status: running, disabled, failed, or starting. [JsonPropertyName("status")] public required ExtensionsLoadedExtensionStatus Status { get; set; } } /// Hosting platform type of the repository (github or ado). [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct WorkingDirectoryContextHostType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public WorkingDirectoryContextHostType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Repository is hosted on GitHub. public static WorkingDirectoryContextHostType Github { get; } = new("github"); /// Repository is hosted on Azure DevOps. public static WorkingDirectoryContextHostType Ado { get; } = new("ado"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(WorkingDirectoryContextHostType left, WorkingDirectoryContextHostType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(WorkingDirectoryContextHostType left, WorkingDirectoryContextHostType right) => !(left == right); /// public override bool Equals(object? obj) => obj is WorkingDirectoryContextHostType other && Equals(other); /// public bool Equals(WorkingDirectoryContextHostType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override WorkingDirectoryContextHostType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, WorkingDirectoryContextHostType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(WorkingDirectoryContextHostType)); } } } /// Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed"). [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ReasoningSummary : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ReasoningSummary(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Do not request reasoning summaries from the model. public static ReasoningSummary None { get; } = new("none"); /// Request a concise summary of the model's reasoning. public static ReasoningSummary Concise { get; } = new("concise"); /// Request a detailed summary of the model's reasoning. public static ReasoningSummary Detailed { get; } = new("detailed"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ReasoningSummary left, ReasoningSummary right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ReasoningSummary left, ReasoningSummary right) => !(left == right); /// public override bool Equals(object? obj) => obj is ReasoningSummary other && Equals(other); /// public bool Equals(ReasoningSummary other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ReasoningSummary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ReasoningSummary value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ReasoningSummary)); } } } /// The session mode the agent is operating in. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The agent is responding interactively to the user. public static SessionMode Interactive { get; } = new("interactive"); /// The agent is preparing a plan before making changes. public static SessionMode Plan { get; } = new("plan"); /// The agent is working autonomously toward task completion. public static SessionMode Autopilot { get; } = new("autopilot"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionMode left, SessionMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionMode left, SessionMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionMode other && Equals(other); /// public bool Equals(SessionMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override SessionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionMode)); } } } /// The type of operation performed on the plan file. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PlanChangedOperation : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PlanChangedOperation(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The plan file was created. public static PlanChangedOperation Create { get; } = new("create"); /// The plan file was updated. public static PlanChangedOperation Update { get; } = new("update"); /// The plan file was deleted. public static PlanChangedOperation Delete { get; } = new("delete"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PlanChangedOperation left, PlanChangedOperation right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PlanChangedOperation left, PlanChangedOperation right) => !(left == right); /// public override bool Equals(object? obj) => obj is PlanChangedOperation other && Equals(other); /// public bool Equals(PlanChangedOperation other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override PlanChangedOperation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PlanChangedOperation value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PlanChangedOperation)); } } } /// Whether the file was newly created or updated. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct WorkspaceFileChangedOperation : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public WorkspaceFileChangedOperation(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The workspace file was created. public static WorkspaceFileChangedOperation Create { get; } = new("create"); /// The workspace file was updated. public static WorkspaceFileChangedOperation Update { get; } = new("update"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(WorkspaceFileChangedOperation left, WorkspaceFileChangedOperation right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(WorkspaceFileChangedOperation left, WorkspaceFileChangedOperation right) => !(left == right); /// public override bool Equals(object? obj) => obj is WorkspaceFileChangedOperation other && Equals(other); /// public bool Equals(WorkspaceFileChangedOperation other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override WorkspaceFileChangedOperation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, WorkspaceFileChangedOperation value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(WorkspaceFileChangedOperation)); } } } /// Origin type of the session being handed off. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct HandoffSourceType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public HandoffSourceType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The handoff originated from a remote session. public static HandoffSourceType Remote { get; } = new("remote"); /// The handoff originated from a local session. public static HandoffSourceType Local { get; } = new("local"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(HandoffSourceType left, HandoffSourceType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(HandoffSourceType left, HandoffSourceType right) => !(left == right); /// public override bool Equals(object? obj) => obj is HandoffSourceType other && Equals(other); /// public bool Equals(HandoffSourceType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override HandoffSourceType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, HandoffSourceType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(HandoffSourceType)); } } } /// Whether the session ended normally ("routine") or due to a crash/fatal error ("error"). [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ShutdownType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ShutdownType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The session ended normally. public static ShutdownType Routine { get; } = new("routine"); /// The session ended because of a crash or fatal error. public static ShutdownType Error { get; } = new("error"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ShutdownType left, ShutdownType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ShutdownType left, ShutdownType right) => !(left == right); /// public override bool Equals(object? obj) => obj is ShutdownType other && Equals(other); /// public bool Equals(ShutdownType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ShutdownType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ShutdownType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ShutdownType)); } } } /// The agent mode that was active when this message was sent. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct UserMessageAgentMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public UserMessageAgentMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The agent is responding interactively to the user. public static UserMessageAgentMode Interactive { get; } = new("interactive"); /// The agent is preparing a plan before making changes. public static UserMessageAgentMode Plan { get; } = new("plan"); /// The agent is working autonomously toward task completion. public static UserMessageAgentMode Autopilot { get; } = new("autopilot"); /// The agent is in shell-focused UI mode. public static UserMessageAgentMode Shell { get; } = new("shell"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(UserMessageAgentMode left, UserMessageAgentMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(UserMessageAgentMode left, UserMessageAgentMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is UserMessageAgentMode other && Equals(other); /// public bool Equals(UserMessageAgentMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override UserMessageAgentMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, UserMessageAgentMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UserMessageAgentMode)); } } } /// Type of GitHub reference. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct UserMessageAttachmentGithubReferenceType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public UserMessageAttachmentGithubReferenceType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// GitHub issue reference. public static UserMessageAttachmentGithubReferenceType Issue { get; } = new("issue"); /// GitHub pull request reference. public static UserMessageAttachmentGithubReferenceType Pr { get; } = new("pr"); /// GitHub discussion reference. public static UserMessageAttachmentGithubReferenceType Discussion { get; } = new("discussion"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(UserMessageAttachmentGithubReferenceType left, UserMessageAttachmentGithubReferenceType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(UserMessageAttachmentGithubReferenceType left, UserMessageAttachmentGithubReferenceType right) => !(left == right); /// public override bool Equals(object? obj) => obj is UserMessageAttachmentGithubReferenceType other && Equals(other); /// public bool Equals(UserMessageAttachmentGithubReferenceType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override UserMessageAttachmentGithubReferenceType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, UserMessageAttachmentGithubReferenceType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UserMessageAttachmentGithubReferenceType)); } } } /// Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AssistantMessageToolRequestType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AssistantMessageToolRequestType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Standard function-style tool call. public static AssistantMessageToolRequestType Function { get; } = new("function"); /// Custom grammar-based tool call. public static AssistantMessageToolRequestType Custom { get; } = new("custom"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AssistantMessageToolRequestType left, AssistantMessageToolRequestType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AssistantMessageToolRequestType left, AssistantMessageToolRequestType right) => !(left == right); /// public override bool Equals(object? obj) => obj is AssistantMessageToolRequestType other && Equals(other); /// public bool Equals(AssistantMessageToolRequestType other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override AssistantMessageToolRequestType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AssistantMessageToolRequestType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AssistantMessageToolRequestType)); } } } /// API endpoint used for this model call, matching CAPI supported_endpoints vocabulary. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AssistantUsageApiEndpoint : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AssistantUsageApiEndpoint(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Chat Completions API endpoint. public static AssistantUsageApiEndpoint ChatCompletions { get; } = new("/chat/completions"); /// Anthropic Messages API endpoint. public static AssistantUsageApiEndpoint V1Messages { get; } = new("/v1/messages"); /// Responses API endpoint. public static AssistantUsageApiEndpoint Responses { get; } = new("/responses"); /// WebSocket Responses API endpoint. public static AssistantUsageApiEndpoint WsResponses { get; } = new("ws:/responses"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AssistantUsageApiEndpoint left, AssistantUsageApiEndpoint right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AssistantUsageApiEndpoint left, AssistantUsageApiEndpoint right) => !(left == right); /// public override bool Equals(object? obj) => obj is AssistantUsageApiEndpoint other && Equals(other); /// public bool Equals(AssistantUsageApiEndpoint other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override AssistantUsageApiEndpoint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AssistantUsageApiEndpoint value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AssistantUsageApiEndpoint)); } } } /// Where the failed model call originated. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ModelCallFailureSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ModelCallFailureSource(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Model call from the top-level agent. public static ModelCallFailureSource TopLevel { get; } = new("top_level"); /// Model call from a sub-agent. public static ModelCallFailureSource Subagent { get; } = new("subagent"); /// Model call from MCP sampling. public static ModelCallFailureSource McpSampling { get; } = new("mcp_sampling"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ModelCallFailureSource left, ModelCallFailureSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ModelCallFailureSource left, ModelCallFailureSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is ModelCallFailureSource other && Equals(other); /// public bool Equals(ModelCallFailureSource other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ModelCallFailureSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ModelCallFailureSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelCallFailureSource)); } } } /// Finite reason code describing why the current turn was aborted. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AbortReason : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AbortReason(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The local user requested the abort, for example by pressing Ctrl+C in the CLI. public static AbortReason UserInitiated { get; } = new("user_initiated"); /// A remote command requested the abort. public static AbortReason RemoteCommand { get; } = new("remote_command"); /// An MCP server delivered a user.abort notification. public static AbortReason UserAbort { get; } = new("user_abort"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AbortReason left, AbortReason right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AbortReason left, AbortReason right) => !(left == right); /// public override bool Equals(object? obj) => obj is AbortReason other && Equals(other); /// public bool Equals(AbortReason other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override AbortReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AbortReason value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AbortReason)); } } } /// Theme variant this icon is intended for. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ToolExecutionCompleteContentResourceLinkIconTheme : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ToolExecutionCompleteContentResourceLinkIconTheme(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Icon intended for light themes. public static ToolExecutionCompleteContentResourceLinkIconTheme Light { get; } = new("light"); /// Icon intended for dark themes. public static ToolExecutionCompleteContentResourceLinkIconTheme Dark { get; } = new("dark"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ToolExecutionCompleteContentResourceLinkIconTheme left, ToolExecutionCompleteContentResourceLinkIconTheme right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ToolExecutionCompleteContentResourceLinkIconTheme left, ToolExecutionCompleteContentResourceLinkIconTheme right) => !(left == right); /// public override bool Equals(object? obj) => obj is ToolExecutionCompleteContentResourceLinkIconTheme other && Equals(other); /// public bool Equals(ToolExecutionCompleteContentResourceLinkIconTheme other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ToolExecutionCompleteContentResourceLinkIconTheme Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ToolExecutionCompleteContentResourceLinkIconTheme value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ToolExecutionCompleteContentResourceLinkIconTheme)); } } } /// Message role: "system" for system prompts, "developer" for developer-injected instructions. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SystemMessageRole : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SystemMessageRole(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// System prompt message. public static SystemMessageRole System { get; } = new("system"); /// Developer instruction message. public static SystemMessageRole Developer { get; } = new("developer"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SystemMessageRole left, SystemMessageRole right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SystemMessageRole left, SystemMessageRole right) => !(left == right); /// public override bool Equals(object? obj) => obj is SystemMessageRole other && Equals(other); /// public bool Equals(SystemMessageRole other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override SystemMessageRole Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SystemMessageRole value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SystemMessageRole)); } } } /// Whether the agent completed successfully or failed. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SystemNotificationAgentCompletedStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SystemNotificationAgentCompletedStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The agent completed successfully. public static SystemNotificationAgentCompletedStatus Completed { get; } = new("completed"); /// The agent failed. public static SystemNotificationAgentCompletedStatus Failed { get; } = new("failed"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SystemNotificationAgentCompletedStatus left, SystemNotificationAgentCompletedStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SystemNotificationAgentCompletedStatus left, SystemNotificationAgentCompletedStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is SystemNotificationAgentCompletedStatus other && Equals(other); /// public bool Equals(SystemNotificationAgentCompletedStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override SystemNotificationAgentCompletedStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SystemNotificationAgentCompletedStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SystemNotificationAgentCompletedStatus)); } } } /// Whether this is a store or vote memory operation. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PermissionRequestMemoryAction : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PermissionRequestMemoryAction(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Store a new memory. public static PermissionRequestMemoryAction Store { get; } = new("store"); /// Vote on an existing memory. public static PermissionRequestMemoryAction Vote { get; } = new("vote"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PermissionRequestMemoryAction left, PermissionRequestMemoryAction right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PermissionRequestMemoryAction left, PermissionRequestMemoryAction right) => !(left == right); /// public override bool Equals(object? obj) => obj is PermissionRequestMemoryAction other && Equals(other); /// public bool Equals(PermissionRequestMemoryAction other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override PermissionRequestMemoryAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PermissionRequestMemoryAction value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionRequestMemoryAction)); } } } /// Vote direction (vote only). [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PermissionRequestMemoryDirection : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PermissionRequestMemoryDirection(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Vote that the memory is useful or accurate. public static PermissionRequestMemoryDirection Upvote { get; } = new("upvote"); /// Vote that the memory is incorrect or outdated. public static PermissionRequestMemoryDirection Downvote { get; } = new("downvote"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PermissionRequestMemoryDirection left, PermissionRequestMemoryDirection right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PermissionRequestMemoryDirection left, PermissionRequestMemoryDirection right) => !(left == right); /// public override bool Equals(object? obj) => obj is PermissionRequestMemoryDirection other && Equals(other); /// public bool Equals(PermissionRequestMemoryDirection other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override PermissionRequestMemoryDirection Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PermissionRequestMemoryDirection value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionRequestMemoryDirection)); } } } /// Underlying permission kind that needs path approval. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PermissionPromptRequestPathAccessKind : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PermissionPromptRequestPathAccessKind(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Read access to a filesystem path. public static PermissionPromptRequestPathAccessKind Read { get; } = new("read"); /// Shell command access involving a filesystem path. public static PermissionPromptRequestPathAccessKind Shell { get; } = new("shell"); /// Write access to a filesystem path. public static PermissionPromptRequestPathAccessKind Write { get; } = new("write"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PermissionPromptRequestPathAccessKind left, PermissionPromptRequestPathAccessKind right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PermissionPromptRequestPathAccessKind left, PermissionPromptRequestPathAccessKind right) => !(left == right); /// public override bool Equals(object? obj) => obj is PermissionPromptRequestPathAccessKind other && Equals(other); /// public bool Equals(PermissionPromptRequestPathAccessKind other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override PermissionPromptRequestPathAccessKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PermissionPromptRequestPathAccessKind value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionPromptRequestPathAccessKind)); } } } /// Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ElicitationRequestedMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ElicitationRequestedMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Structured form-based elicitation. public static ElicitationRequestedMode Form { get; } = new("form"); /// Browser URL-based elicitation. public static ElicitationRequestedMode Url { get; } = new("url"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ElicitationRequestedMode left, ElicitationRequestedMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ElicitationRequestedMode left, ElicitationRequestedMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is ElicitationRequestedMode other && Equals(other); /// public bool Equals(ElicitationRequestedMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ElicitationRequestedMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ElicitationRequestedMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ElicitationRequestedMode)); } } } /// The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed). [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ElicitationCompletedAction : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ElicitationCompletedAction(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The user submitted the requested form. public static ElicitationCompletedAction Accept { get; } = new("accept"); /// The user explicitly declined the request. public static ElicitationCompletedAction Decline { get; } = new("decline"); /// The user dismissed the request. public static ElicitationCompletedAction Cancel { get; } = new("cancel"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ElicitationCompletedAction left, ElicitationCompletedAction right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ElicitationCompletedAction left, ElicitationCompletedAction right) => !(left == right); /// public override bool Equals(object? obj) => obj is ElicitationCompletedAction other && Equals(other); /// public bool Equals(ElicitationCompletedAction other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ElicitationCompletedAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ElicitationCompletedAction value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ElicitationCompletedAction)); } } } /// The user's auto-mode-switch choice. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AutoModeSwitchResponse : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AutoModeSwitchResponse(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Switch models for this request. public static AutoModeSwitchResponse Yes { get; } = new("yes"); /// Switch models now and keep using the replacement automatically. public static AutoModeSwitchResponse YesAlways { get; } = new("yes_always"); /// Do not switch models. public static AutoModeSwitchResponse No { get; } = new("no"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AutoModeSwitchResponse left, AutoModeSwitchResponse right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AutoModeSwitchResponse left, AutoModeSwitchResponse right) => !(left == right); /// public override bool Equals(object? obj) => obj is AutoModeSwitchResponse other && Equals(other); /// public bool Equals(AutoModeSwitchResponse other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override AutoModeSwitchResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AutoModeSwitchResponse value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutoModeSwitchResponse)); } } } /// Exit plan mode action. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ExitPlanModeAction : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ExitPlanModeAction(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Exit plan mode without starting implementation. public static ExitPlanModeAction ExitOnly { get; } = new("exit_only"); /// Exit plan mode and continue in interactive mode. public static ExitPlanModeAction Interactive { get; } = new("interactive"); /// Exit plan mode and continue autonomously. public static ExitPlanModeAction Autopilot { get; } = new("autopilot"); /// Exit plan mode and continue with parallel autonomous workers. public static ExitPlanModeAction AutopilotFleet { get; } = new("autopilot_fleet"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ExitPlanModeAction left, ExitPlanModeAction right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ExitPlanModeAction left, ExitPlanModeAction right) => !(left == right); /// public override bool Equals(object? obj) => obj is ExitPlanModeAction other && Equals(other); /// public bool Equals(ExitPlanModeAction other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ExitPlanModeAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ExitPlanModeAction value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExitPlanModeAction)); } } } /// Source location type (e.g., project, personal-copilot, plugin, builtin). [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SkillSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SkillSource(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Skill defined in the current project's skill directories. public static SkillSource Project { get; } = new("project"); /// Skill discovered from a parent directory in the current workspace tree. public static SkillSource Inherited { get; } = new("inherited"); /// Skill defined in the user's Copilot skill directory. public static SkillSource PersonalCopilot { get; } = new("personal-copilot"); /// Skill defined in the user's personal agents skill directory. public static SkillSource PersonalAgents { get; } = new("personal-agents"); /// Skill provided by an installed plugin. public static SkillSource Plugin { get; } = new("plugin"); /// Skill loaded from a configured custom skill directory. public static SkillSource Custom { get; } = new("custom"); /// Skill bundled with the runtime. public static SkillSource Builtin { get; } = new("builtin"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SkillSource left, SkillSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SkillSource left, SkillSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is SkillSource other && Equals(other); /// public bool Equals(SkillSource other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override SkillSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SkillSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SkillSource)); } } } /// Configuration source: user, workspace, plugin, or builtin. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpServerSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpServerSource(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Server configured in the user's global MCP configuration. public static McpServerSource User { get; } = new("user"); /// Server configured by the current workspace. public static McpServerSource Workspace { get; } = new("workspace"); /// Server contributed by an installed plugin. public static McpServerSource Plugin { get; } = new("plugin"); /// Server bundled with the runtime. public static McpServerSource Builtin { get; } = new("builtin"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpServerSource left, McpServerSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpServerSource left, McpServerSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpServerSource other && Equals(other); /// public bool Equals(McpServerSource other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override McpServerSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpServerSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpServerSource)); } } } /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpServerStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpServerStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The server is connected and available. public static McpServerStatus Connected { get; } = new("connected"); /// The server failed to connect or initialize. public static McpServerStatus Failed { get; } = new("failed"); /// The server requires authentication before it can connect. public static McpServerStatus NeedsAuth { get; } = new("needs-auth"); /// The server connection is still being established. public static McpServerStatus Pending { get; } = new("pending"); /// The server is configured but disabled. public static McpServerStatus Disabled { get; } = new("disabled"); /// The server is not configured for this session. public static McpServerStatus NotConfigured { get; } = new("not_configured"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpServerStatus left, McpServerStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpServerStatus left, McpServerStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpServerStatus other && Equals(other); /// public bool Equals(McpServerStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override McpServerStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpServerStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpServerStatus)); } } } /// Discovery source. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ExtensionsLoadedExtensionSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ExtensionsLoadedExtensionSource(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Extension discovered from the current project. public static ExtensionsLoadedExtensionSource Project { get; } = new("project"); /// Extension discovered from the user's extension directory. public static ExtensionsLoadedExtensionSource User { get; } = new("user"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ExtensionsLoadedExtensionSource left, ExtensionsLoadedExtensionSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ExtensionsLoadedExtensionSource left, ExtensionsLoadedExtensionSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is ExtensionsLoadedExtensionSource other && Equals(other); /// public bool Equals(ExtensionsLoadedExtensionSource other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ExtensionsLoadedExtensionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExtensionsLoadedExtensionSource)); } } } /// Current status: running, disabled, failed, or starting. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ExtensionsLoadedExtensionStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ExtensionsLoadedExtensionStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The extension process is running. public static ExtensionsLoadedExtensionStatus Running { get; } = new("running"); /// The extension is installed but disabled. public static ExtensionsLoadedExtensionStatus Disabled { get; } = new("disabled"); /// The extension failed to start or crashed. public static ExtensionsLoadedExtensionStatus Failed { get; } = new("failed"); /// The extension process is starting. public static ExtensionsLoadedExtensionStatus Starting { get; } = new("starting"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ExtensionsLoadedExtensionStatus left, ExtensionsLoadedExtensionStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ExtensionsLoadedExtensionStatus left, ExtensionsLoadedExtensionStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is ExtensionsLoadedExtensionStatus other && Equals(other); /// public bool Equals(ExtensionsLoadedExtensionStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); /// public override string ToString() => Value; /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] public sealed class Converter : JsonConverter { /// public override ExtensionsLoadedExtensionStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExtensionsLoadedExtensionStatus)); } } } [JsonSourceGenerationOptions( JsonSerializerDefaults.Web, AllowOutOfOrderMetadataProperties = true, NumberHandling = JsonNumberHandling.AllowReadingFromString, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)] [JsonSerializable(typeof(AbortData))] [JsonSerializable(typeof(AbortEvent))] [JsonSerializable(typeof(AssistantIntentData))] [JsonSerializable(typeof(AssistantIntentEvent))] [JsonSerializable(typeof(AssistantMessageData))] [JsonSerializable(typeof(AssistantMessageDeltaData))] [JsonSerializable(typeof(AssistantMessageDeltaEvent))] [JsonSerializable(typeof(AssistantMessageEvent))] [JsonSerializable(typeof(AssistantMessageStartData))] [JsonSerializable(typeof(AssistantMessageStartEvent))] [JsonSerializable(typeof(AssistantMessageToolRequest))] [JsonSerializable(typeof(AssistantReasoningData))] [JsonSerializable(typeof(AssistantReasoningDeltaData))] [JsonSerializable(typeof(AssistantReasoningDeltaEvent))] [JsonSerializable(typeof(AssistantReasoningEvent))] [JsonSerializable(typeof(AssistantStreamingDeltaData))] [JsonSerializable(typeof(AssistantStreamingDeltaEvent))] [JsonSerializable(typeof(AssistantTurnEndData))] [JsonSerializable(typeof(AssistantTurnEndEvent))] [JsonSerializable(typeof(AssistantTurnStartData))] [JsonSerializable(typeof(AssistantTurnStartEvent))] [JsonSerializable(typeof(AssistantUsageCopilotUsage))] [JsonSerializable(typeof(AssistantUsageCopilotUsageTokenDetail))] [JsonSerializable(typeof(AssistantUsageData))] [JsonSerializable(typeof(AssistantUsageEvent))] [JsonSerializable(typeof(AssistantUsageQuotaSnapshot))] [JsonSerializable(typeof(AutoModeSwitchCompletedData))] [JsonSerializable(typeof(AutoModeSwitchCompletedEvent))] [JsonSerializable(typeof(AutoModeSwitchRequestedData))] [JsonSerializable(typeof(AutoModeSwitchRequestedEvent))] [JsonSerializable(typeof(CapabilitiesChangedData))] [JsonSerializable(typeof(CapabilitiesChangedEvent))] [JsonSerializable(typeof(CapabilitiesChangedUI))] [JsonSerializable(typeof(CommandCompletedData))] [JsonSerializable(typeof(CommandCompletedEvent))] [JsonSerializable(typeof(CommandExecuteData))] [JsonSerializable(typeof(CommandExecuteEvent))] [JsonSerializable(typeof(CommandQueuedData))] [JsonSerializable(typeof(CommandQueuedEvent))] [JsonSerializable(typeof(CommandsChangedCommand))] [JsonSerializable(typeof(CommandsChangedData))] [JsonSerializable(typeof(CommandsChangedEvent))] [JsonSerializable(typeof(CompactionCompleteCompactionTokensUsed))] [JsonSerializable(typeof(CompactionCompleteCompactionTokensUsedCopilotUsage))] [JsonSerializable(typeof(CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail))] [JsonSerializable(typeof(CustomAgentsUpdatedAgent))] [JsonSerializable(typeof(ElicitationCompletedData))] [JsonSerializable(typeof(ElicitationCompletedEvent))] [JsonSerializable(typeof(ElicitationRequestedData))] [JsonSerializable(typeof(ElicitationRequestedEvent))] [JsonSerializable(typeof(ElicitationRequestedSchema))] [JsonSerializable(typeof(EmbeddedBlobResourceContents))] [JsonSerializable(typeof(EmbeddedTextResourceContents))] [JsonSerializable(typeof(ExitPlanModeCompletedData))] [JsonSerializable(typeof(ExitPlanModeCompletedEvent))] [JsonSerializable(typeof(ExitPlanModeRequestedData))] [JsonSerializable(typeof(ExitPlanModeRequestedEvent))] [JsonSerializable(typeof(ExtensionsLoadedExtension))] [JsonSerializable(typeof(ExternalToolCompletedData))] [JsonSerializable(typeof(ExternalToolCompletedEvent))] [JsonSerializable(typeof(ExternalToolRequestedData))] [JsonSerializable(typeof(ExternalToolRequestedEvent))] [JsonSerializable(typeof(HandoffRepository))] [JsonSerializable(typeof(HookEndData))] [JsonSerializable(typeof(HookEndError))] [JsonSerializable(typeof(HookEndEvent))] [JsonSerializable(typeof(HookStartData))] [JsonSerializable(typeof(HookStartEvent))] [JsonSerializable(typeof(McpOauthCompletedData))] [JsonSerializable(typeof(McpOauthCompletedEvent))] [JsonSerializable(typeof(McpOauthRequiredData))] [JsonSerializable(typeof(McpOauthRequiredEvent))] [JsonSerializable(typeof(McpOauthRequiredStaticClientConfig))] [JsonSerializable(typeof(McpServersLoadedServer))] [JsonSerializable(typeof(ModelCallFailureData))] [JsonSerializable(typeof(ModelCallFailureEvent))] [JsonSerializable(typeof(PendingMessagesModifiedData))] [JsonSerializable(typeof(PendingMessagesModifiedEvent))] [JsonSerializable(typeof(PermissionCompletedData))] [JsonSerializable(typeof(PermissionCompletedEvent))] [JsonSerializable(typeof(PermissionPromptRequest))] [JsonSerializable(typeof(PermissionPromptRequestCommands))] [JsonSerializable(typeof(PermissionPromptRequestCustomTool))] [JsonSerializable(typeof(PermissionPromptRequestExtensionManagement))] [JsonSerializable(typeof(PermissionPromptRequestExtensionPermissionAccess))] [JsonSerializable(typeof(PermissionPromptRequestHook))] [JsonSerializable(typeof(PermissionPromptRequestMcp))] [JsonSerializable(typeof(PermissionPromptRequestMemory))] [JsonSerializable(typeof(PermissionPromptRequestPath))] [JsonSerializable(typeof(PermissionPromptRequestRead))] [JsonSerializable(typeof(PermissionPromptRequestUrl))] [JsonSerializable(typeof(PermissionPromptRequestWrite))] [JsonSerializable(typeof(PermissionRequest))] [JsonSerializable(typeof(PermissionRequestCustomTool))] [JsonSerializable(typeof(PermissionRequestExtensionManagement))] [JsonSerializable(typeof(PermissionRequestExtensionPermissionAccess))] [JsonSerializable(typeof(PermissionRequestHook))] [JsonSerializable(typeof(PermissionRequestMcp))] [JsonSerializable(typeof(PermissionRequestMemory))] [JsonSerializable(typeof(PermissionRequestRead))] [JsonSerializable(typeof(PermissionRequestShell))] [JsonSerializable(typeof(PermissionRequestShellCommand))] [JsonSerializable(typeof(PermissionRequestShellPossibleUrl))] [JsonSerializable(typeof(PermissionRequestUrl))] [JsonSerializable(typeof(PermissionRequestWrite))] [JsonSerializable(typeof(PermissionRequestedData))] [JsonSerializable(typeof(PermissionRequestedEvent))] [JsonSerializable(typeof(PermissionResult))] [JsonSerializable(typeof(PermissionResultApproved))] [JsonSerializable(typeof(PermissionResultApprovedForLocation))] [JsonSerializable(typeof(PermissionResultApprovedForSession))] [JsonSerializable(typeof(PermissionResultCancelled))] [JsonSerializable(typeof(PermissionResultDeniedByContentExclusionPolicy))] [JsonSerializable(typeof(PermissionResultDeniedByPermissionRequestHook))] [JsonSerializable(typeof(PermissionResultDeniedByRules))] [JsonSerializable(typeof(PermissionResultDeniedInteractivelyByUser))] [JsonSerializable(typeof(PermissionResultDeniedNoApprovalRuleAndCouldNotRequestFromUser))] [JsonSerializable(typeof(PermissionRule))] [JsonSerializable(typeof(SamplingCompletedData))] [JsonSerializable(typeof(SamplingCompletedEvent))] [JsonSerializable(typeof(SamplingRequestedData))] [JsonSerializable(typeof(SamplingRequestedEvent))] [JsonSerializable(typeof(SessionBackgroundTasksChangedData))] [JsonSerializable(typeof(SessionBackgroundTasksChangedEvent))] [JsonSerializable(typeof(SessionCompactionCompleteData))] [JsonSerializable(typeof(SessionCompactionCompleteEvent))] [JsonSerializable(typeof(SessionCompactionStartData))] [JsonSerializable(typeof(SessionCompactionStartEvent))] [JsonSerializable(typeof(SessionContextChangedData))] [JsonSerializable(typeof(SessionContextChangedEvent))] [JsonSerializable(typeof(SessionCustomAgentsUpdatedData))] [JsonSerializable(typeof(SessionCustomAgentsUpdatedEvent))] [JsonSerializable(typeof(SessionCustomNotificationData))] [JsonSerializable(typeof(SessionCustomNotificationEvent))] [JsonSerializable(typeof(SessionErrorData))] [JsonSerializable(typeof(SessionErrorEvent))] [JsonSerializable(typeof(SessionEvent))] [JsonSerializable(typeof(SessionExtensionsLoadedData))] [JsonSerializable(typeof(SessionExtensionsLoadedEvent))] [JsonSerializable(typeof(SessionHandoffData))] [JsonSerializable(typeof(SessionHandoffEvent))] [JsonSerializable(typeof(SessionIdleData))] [JsonSerializable(typeof(SessionIdleEvent))] [JsonSerializable(typeof(SessionInfoData))] [JsonSerializable(typeof(SessionInfoEvent))] [JsonSerializable(typeof(SessionMcpServerStatusChangedData))] [JsonSerializable(typeof(SessionMcpServerStatusChangedEvent))] [JsonSerializable(typeof(SessionMcpServersLoadedData))] [JsonSerializable(typeof(SessionMcpServersLoadedEvent))] [JsonSerializable(typeof(SessionModeChangedData))] [JsonSerializable(typeof(SessionModeChangedEvent))] [JsonSerializable(typeof(SessionModelChangeData))] [JsonSerializable(typeof(SessionModelChangeEvent))] [JsonSerializable(typeof(SessionPlanChangedData))] [JsonSerializable(typeof(SessionPlanChangedEvent))] [JsonSerializable(typeof(SessionRemoteSteerableChangedData))] [JsonSerializable(typeof(SessionRemoteSteerableChangedEvent))] [JsonSerializable(typeof(SessionResumeData))] [JsonSerializable(typeof(SessionResumeEvent))] [JsonSerializable(typeof(SessionScheduleCancelledData))] [JsonSerializable(typeof(SessionScheduleCancelledEvent))] [JsonSerializable(typeof(SessionScheduleCreatedData))] [JsonSerializable(typeof(SessionScheduleCreatedEvent))] [JsonSerializable(typeof(SessionShutdownData))] [JsonSerializable(typeof(SessionShutdownEvent))] [JsonSerializable(typeof(SessionSkillsLoadedData))] [JsonSerializable(typeof(SessionSkillsLoadedEvent))] [JsonSerializable(typeof(SessionSnapshotRewindData))] [JsonSerializable(typeof(SessionSnapshotRewindEvent))] [JsonSerializable(typeof(SessionStartData))] [JsonSerializable(typeof(SessionStartEvent))] [JsonSerializable(typeof(SessionTaskCompleteData))] [JsonSerializable(typeof(SessionTaskCompleteEvent))] [JsonSerializable(typeof(SessionTitleChangedData))] [JsonSerializable(typeof(SessionTitleChangedEvent))] [JsonSerializable(typeof(SessionToolsUpdatedData))] [JsonSerializable(typeof(SessionToolsUpdatedEvent))] [JsonSerializable(typeof(SessionTruncationData))] [JsonSerializable(typeof(SessionTruncationEvent))] [JsonSerializable(typeof(SessionUsageInfoData))] [JsonSerializable(typeof(SessionUsageInfoEvent))] [JsonSerializable(typeof(SessionWarningData))] [JsonSerializable(typeof(SessionWarningEvent))] [JsonSerializable(typeof(SessionWorkspaceFileChangedData))] [JsonSerializable(typeof(SessionWorkspaceFileChangedEvent))] [JsonSerializable(typeof(ShutdownCodeChanges))] [JsonSerializable(typeof(ShutdownModelMetric))] [JsonSerializable(typeof(ShutdownModelMetricRequests))] [JsonSerializable(typeof(ShutdownModelMetricTokenDetail))] [JsonSerializable(typeof(ShutdownModelMetricUsage))] [JsonSerializable(typeof(ShutdownTokenDetail))] [JsonSerializable(typeof(SkillInvokedData))] [JsonSerializable(typeof(SkillInvokedEvent))] [JsonSerializable(typeof(SkillsLoadedSkill))] [JsonSerializable(typeof(SubagentCompletedData))] [JsonSerializable(typeof(SubagentCompletedEvent))] [JsonSerializable(typeof(SubagentDeselectedData))] [JsonSerializable(typeof(SubagentDeselectedEvent))] [JsonSerializable(typeof(SubagentFailedData))] [JsonSerializable(typeof(SubagentFailedEvent))] [JsonSerializable(typeof(SubagentSelectedData))] [JsonSerializable(typeof(SubagentSelectedEvent))] [JsonSerializable(typeof(SubagentStartedData))] [JsonSerializable(typeof(SubagentStartedEvent))] [JsonSerializable(typeof(SystemMessageData))] [JsonSerializable(typeof(SystemMessageEvent))] [JsonSerializable(typeof(SystemMessageMetadata))] [JsonSerializable(typeof(SystemNotification))] [JsonSerializable(typeof(SystemNotificationAgentCompleted))] [JsonSerializable(typeof(SystemNotificationAgentIdle))] [JsonSerializable(typeof(SystemNotificationData))] [JsonSerializable(typeof(SystemNotificationEvent))] [JsonSerializable(typeof(SystemNotificationInstructionDiscovered))] [JsonSerializable(typeof(SystemNotificationNewInboxMessage))] [JsonSerializable(typeof(SystemNotificationShellCompleted))] [JsonSerializable(typeof(SystemNotificationShellDetachedCompleted))] [JsonSerializable(typeof(ToolExecutionCompleteContent))] [JsonSerializable(typeof(ToolExecutionCompleteContentAudio))] [JsonSerializable(typeof(ToolExecutionCompleteContentImage))] [JsonSerializable(typeof(ToolExecutionCompleteContentResource))] [JsonSerializable(typeof(ToolExecutionCompleteContentResourceDetails))] [JsonSerializable(typeof(ToolExecutionCompleteContentResourceLink))] [JsonSerializable(typeof(ToolExecutionCompleteContentResourceLinkIcon))] [JsonSerializable(typeof(ToolExecutionCompleteContentTerminal))] [JsonSerializable(typeof(ToolExecutionCompleteContentText))] [JsonSerializable(typeof(ToolExecutionCompleteData))] [JsonSerializable(typeof(ToolExecutionCompleteError))] [JsonSerializable(typeof(ToolExecutionCompleteEvent))] [JsonSerializable(typeof(ToolExecutionCompleteResult))] [JsonSerializable(typeof(ToolExecutionPartialResultData))] [JsonSerializable(typeof(ToolExecutionPartialResultEvent))] [JsonSerializable(typeof(ToolExecutionProgressData))] [JsonSerializable(typeof(ToolExecutionProgressEvent))] [JsonSerializable(typeof(ToolExecutionStartData))] [JsonSerializable(typeof(ToolExecutionStartEvent))] [JsonSerializable(typeof(ToolUserRequestedData))] [JsonSerializable(typeof(ToolUserRequestedEvent))] [JsonSerializable(typeof(UserInputCompletedData))] [JsonSerializable(typeof(UserInputCompletedEvent))] [JsonSerializable(typeof(UserInputRequestedData))] [JsonSerializable(typeof(UserInputRequestedEvent))] [JsonSerializable(typeof(UserMessageAttachment))] [JsonSerializable(typeof(UserMessageAttachmentBlob))] [JsonSerializable(typeof(UserMessageAttachmentDirectory))] [JsonSerializable(typeof(UserMessageAttachmentFile))] [JsonSerializable(typeof(UserMessageAttachmentFileLineRange))] [JsonSerializable(typeof(UserMessageAttachmentGithubReference))] [JsonSerializable(typeof(UserMessageAttachmentSelection))] [JsonSerializable(typeof(UserMessageAttachmentSelectionDetails))] [JsonSerializable(typeof(UserMessageAttachmentSelectionDetailsEnd))] [JsonSerializable(typeof(UserMessageAttachmentSelectionDetailsStart))] [JsonSerializable(typeof(UserMessageData))] [JsonSerializable(typeof(UserMessageEvent))] [JsonSerializable(typeof(UserToolSessionApproval))] [JsonSerializable(typeof(UserToolSessionApprovalCommands))] [JsonSerializable(typeof(UserToolSessionApprovalCustomTool))] [JsonSerializable(typeof(UserToolSessionApprovalExtensionManagement))] [JsonSerializable(typeof(UserToolSessionApprovalExtensionPermissionAccess))] [JsonSerializable(typeof(UserToolSessionApprovalMcp))] [JsonSerializable(typeof(UserToolSessionApprovalMemory))] [JsonSerializable(typeof(UserToolSessionApprovalRead))] [JsonSerializable(typeof(UserToolSessionApprovalWrite))] [JsonSerializable(typeof(WorkingDirectoryContext))] [JsonSerializable(typeof(JsonElement))] internal sealed partial class SessionEventsJsonContext : JsonSerializerContext;