/*---------------------------------------------------------------------------------------------
* 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(AssistantIdleEvent), "assistant.idle")]
[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(HookProgressEvent), "hook.progress")]
[JsonDerivedType(typeof(HookStartEvent), "hook.start")]
[JsonDerivedType(typeof(McpAppToolCallCompleteEvent), "mcp_app.tool_call_complete")]
[JsonDerivedType(typeof(McpHeadersRefreshCompletedEvent), "mcp.headers_refresh_completed")]
[JsonDerivedType(typeof(McpHeadersRefreshRequiredEvent), "mcp.headers_refresh_required")]
[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(SessionLimitsExhaustedCompletedEvent), "session_limits_exhausted.completed")]
[JsonDerivedType(typeof(SessionLimitsExhaustedRequestedEvent), "session_limits_exhausted.requested")]
[JsonDerivedType(typeof(SessionAutopilotObjectiveChangedEvent), "session.autopilot_objective_changed")]
[JsonDerivedType(typeof(SessionBackgroundTasksChangedEvent), "session.background_tasks_changed")]
[JsonDerivedType(typeof(SessionBinaryAssetEvent), "session.binary_asset")]
[JsonDerivedType(typeof(SessionCanvasClosedEvent), "session.canvas.closed")]
[JsonDerivedType(typeof(SessionCanvasOpenedEvent), "session.canvas.opened")]
[JsonDerivedType(typeof(SessionCanvasRecordedEvent), "session.canvas.recorded")]
[JsonDerivedType(typeof(SessionCanvasRegistryChangedEvent), "session.canvas.registry_changed")]
[JsonDerivedType(typeof(SessionCanvasRemovedEvent), "session.canvas.removed")]
[JsonDerivedType(typeof(SessionCanvasUnavailableEvent), "session.canvas.unavailable")]
[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(SessionExtensionsAttachmentsPushedEvent), "session.extensions.attachments_pushed")]
[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(SessionPermissionsChangedEvent), "session.permissions_changed")]
[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(SessionScheduleRearmedEvent), "session.schedule_rearmed")]
[JsonDerivedType(typeof(SessionSessionLimitsChangedEvent), "session.session_limits_changed")]
[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(SessionTodosChangedEvent), "session.todos_changed")]
[JsonDerivedType(typeof(SessionToolsUpdatedEvent), "session.tools_updated")]
[JsonDerivedType(typeof(SessionTruncationEvent), "session.truncation")]
[JsonDerivedType(typeof(SessionUsageCheckpointEvent), "session.usage_checkpoint")]
[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 or attached shell commands 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; }
}
/// Self-paced schedule re-armed for its next run.
/// Represents the session.schedule_rearmed event.
public sealed partial class SessionScheduleRearmedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.schedule_rearmed";
/// The session.schedule_rearmed event payload.
[JsonPropertyName("data")]
public required SessionScheduleRearmedData Data { get; set; }
}
/// Autopilot objective state file operation details indicating what changed.
/// Represents the session.autopilot_objective_changed event.
public sealed partial class SessionAutopilotObjectiveChangedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.autopilot_objective_changed";
/// The session.autopilot_objective_changed event payload.
[JsonPropertyName("data")]
public required SessionAutopilotObjectiveChangedData 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; }
}
/// Session limits update details. Null clears the limits.
/// Represents the session.session_limits_changed event.
public sealed partial class SessionSessionLimitsChangedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.session_limits_changed";
/// The session.session_limits_changed event payload.
[JsonPropertyName("data")]
public required SessionSessionLimitsChangedData Data { get; set; }
}
/// Permissions change details carrying the aggregate allow-all boolean transition.
/// Represents the session.permissions_changed event.
public sealed partial class SessionPermissionsChangedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.permissions_changed";
/// The session.permissions_changed event payload.
[JsonPropertyName("data")]
public required SessionPermissionsChangedData 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; }
}
/// Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed.
/// Represents the session.todos_changed event.
public sealed partial class SessionTodosChangedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.todos_changed";
/// The session.todos_changed event payload.
[JsonPropertyName("data")]
public required SessionTodosChangedData 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; }
}
/// Durable session usage checkpoint for reconstructing aggregate accounting on resume.
/// Represents the session.usage_checkpoint event.
public sealed partial class SessionUsageCheckpointEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.usage_checkpoint";
/// The session.usage_checkpoint event payload.
[JsonPropertyName("data")]
public required SessionUsageCheckpointData 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; }
}
/// Payload emitted whenever the main agent's processing loop goes idle, including while related background work (running agents or in-flight attached shell commands) is still pending and the session-level idle event is therefore deferred.
/// Represents the assistant.idle event.
public sealed partial class AssistantIdleEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "assistant.idle";
/// The assistant.idle event payload.
[JsonPropertyName("data")]
public required AssistantIdleData 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; }
}
/// Ephemeral progress update from a running hook process.
/// Represents the hook.progress event.
public sealed partial class HookProgressEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "hook.progress";
/// The hook.progress event payload.
[JsonPropertyName("data")]
public required HookProgressData Data { get; set; }
}
/// Canonical bytes for a content-addressed binary asset shared by reference across events.
/// Represents the session.binary_asset event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionBinaryAssetEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.binary_asset";
/// The session.binary_asset event payload.
[JsonPropertyName("data")]
public required SessionBinaryAssetData 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; }
}
/// Dynamic headers refresh request for a remote MCP server.
/// Represents the mcp.headers_refresh_required event.
public sealed partial class McpHeadersRefreshRequiredEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "mcp.headers_refresh_required";
/// The mcp.headers_refresh_required event payload.
[JsonPropertyName("data")]
public required McpHeadersRefreshRequiredData Data { get; set; }
}
/// MCP headers refresh request completion notification.
/// Represents the mcp.headers_refresh_completed event.
public sealed partial class McpHeadersRefreshCompletedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "mcp.headers_refresh_completed";
/// The mcp.headers_refresh_completed event payload.
[JsonPropertyName("data")]
public required McpHeadersRefreshCompletedData 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; }
}
/// Session limit exhaustion notification requiring user action.
/// Represents the session_limits_exhausted.requested event.
public sealed partial class SessionLimitsExhaustedRequestedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session_limits_exhausted.requested";
/// The session_limits_exhausted.requested event payload.
[JsonPropertyName("data")]
public required SessionLimitsExhaustedRequestedData Data { get; set; }
}
/// Session limit exhaustion prompt completion notification.
/// Represents the session_limits_exhausted.completed event.
public sealed partial class SessionLimitsExhaustedCompletedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session_limits_exhausted.completed";
/// The session_limits_exhausted.completed event payload.
[JsonPropertyName("data")]
public required SessionLimitsExhaustedCompletedData 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; }
}
/// Schema for the `CanvasOpenedData` type.
/// Represents the session.canvas.opened event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasOpenedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.canvas.opened";
/// The session.canvas.opened event payload.
[JsonPropertyName("data")]
public required SessionCanvasOpenedData Data { get; set; }
}
/// Schema for the `CanvasRegistryChangedData` type.
/// Represents the session.canvas.registry_changed event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasRegistryChangedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.canvas.registry_changed";
/// The session.canvas.registry_changed event payload.
[JsonPropertyName("data")]
public required SessionCanvasRegistryChangedData Data { get; set; }
}
/// Schema for the `CanvasClosedData` type.
/// Represents the session.canvas.closed event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasClosedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.canvas.closed";
/// The session.canvas.closed event payload.
[JsonPropertyName("data")]
public required SessionCanvasClosedData Data { get; set; }
}
/// Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume.
/// Represents the session.canvas.unavailable event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasUnavailableEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.canvas.unavailable";
/// The session.canvas.unavailable event payload.
[JsonPropertyName("data")]
public required SessionCanvasUnavailableData Data { get; set; }
}
/// Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability.
/// Represents the session.canvas.recorded event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasRecordedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.canvas.recorded";
/// The session.canvas.recorded event payload.
[JsonPropertyName("data")]
public required SessionCanvasRecordedData Data { get; set; }
}
/// Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay.
/// Represents the session.canvas.removed event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasRemovedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.canvas.removed";
/// The session.canvas.removed event payload.
[JsonPropertyName("data")]
public required SessionCanvasRemovedData Data { get; set; }
}
/// Schema for the `ExtensionsAttachmentsPushedData` type.
/// Represents the session.extensions.attachments_pushed event.
public sealed partial class SessionExtensionsAttachmentsPushedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.extensions.attachments_pushed";
/// The session.extensions.attachments_pushed event payload.
[JsonPropertyName("data")]
public required SessionExtensionsAttachmentsPushedData Data { get; set; }
}
/// MCP App view called a tool on a connected MCP server (SEP-1865).
/// Represents the mcp_app.tool_call_complete event.
public sealed partial class McpAppToolCallCompleteEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "mcp_app.tool_call_complete";
/// The mcp_app.tool_call_complete event payload.
[JsonPropertyName("data")]
public required McpAppToolCallCompleteData 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; }
/// Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("contextTier")]
public ContextTier? ContextTier { 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; }
/// Session limits configured at session creation time, if any.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("sessionLimits")]
public SessionLimitsConfig? SessionLimits { 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; }
/// Context tier currently selected at resume time; null when no tier is active.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("contextTier")]
public ContextTier? ContextTier { 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; }
/// On-disk byte size of the session's persisted events.jsonl file at resume time; omitted when the file does not exist or cannot be stat'd.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("eventsFileSizeBytes")]
public long? EventsFileSizeBytes { 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; }
/// Session limits currently configured at resume time; null when no limits are active.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("sessionLimits")]
public SessionLimitsConfig? SessionLimits { 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; }
/// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serviceRequestId")]
public string? ServiceRequestId { 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 or attached shell commands 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
{
/// Absolute fire time (epoch milliseconds) for a one-shot calendar schedule.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("at")]
public long? At { get; set; }
/// 5-field cron expression for a recurring calendar schedule, evaluated in `tz`.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cron")]
public string? Cron { get; set; }
/// 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 (relative-interval schedules).
[JsonConverter(typeof(MillisecondsTimeSpanConverter))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("intervalMs")]
public 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; }
/// True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("selfPaced")]
public bool? SelfPaced { get; set; }
/// IANA timezone the `cron` expression is evaluated in.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("tz")]
public string? Tz { 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; }
}
/// Self-paced schedule re-armed for its next run.
public sealed partial class SessionScheduleRearmedData
{
/// Id of the self-paced schedule that was re-armed.
[JsonPropertyName("id")]
public required long Id { get; set; }
/// Absolute time (epoch milliseconds) the model armed the next run to fire.
[JsonPropertyName("nextRunAt")]
public required long NextRunAt { get; set; }
}
/// Autopilot objective state file operation details indicating what changed.
public sealed partial class SessionAutopilotObjectiveChangedData
{
/// Current autopilot objective id, if one exists.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("id")]
public long? Id { get; set; }
/// The type of operation performed on the autopilot objective state file.
[JsonPropertyName("operation")]
public required AutopilotObjectiveChangedOperation Operation { get; set; }
/// Current autopilot objective status, if one exists.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("status")]
public AutopilotObjectiveChangedStatus? Status { 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; }
/// Context tier after the model change; null explicitly clears a previously selected tier.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("contextTier")]
public ContextTier? ContextTier { 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; }
}
/// Session limits update details. Null clears the limits.
public sealed partial class SessionSessionLimitsChangedData
{
/// Current session limits, or null when no limits are active.
[JsonPropertyName("sessionLimits")]
public SessionLimitsConfig? SessionLimits { get; set; }
}
/// Permissions change details carrying the aggregate allow-all boolean transition.
public sealed partial class SessionPermissionsChangedData
{
/// Aggregate allow-all flag after the change.
[JsonPropertyName("allowAllPermissions")]
public required bool AllowAllPermissions { get; set; }
/// Aggregate allow-all flag before the change.
[JsonPropertyName("previousAllowAllPermissions")]
public required bool PreviousAllowAllPermissions { 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; }
}
/// Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed.
public sealed partial class SessionTodosChangedData
{
}
/// 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; }
/// On-disk byte size of the session's persisted events.jsonl file at shutdown time; omitted when the file does not exist or cannot be stat'd.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("eventsFileSizeBytes")]
public long? EventsFileSizeBytes { 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; }
}
/// Durable session usage checkpoint for reconstructing aggregate accounting on resume.
public sealed partial class SessionUsageCheckpointData
{
/// Session-wide accumulated nano-AI units cost at checkpoint time.
[JsonPropertyName("totalNanoAiu")]
public required double TotalNanoAiu { get; set; }
/// Total number of premium API requests used at checkpoint time.
[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; }
/// Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serviceRequestId")]
public string? ServiceRequestId { get; set; }
/// For failed compaction only: the HTTP status code of the compaction LLM call failure, when it carried one. Absent for successful compaction and for failures without an HTTP status (e.g. an empty model response or a transport error).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("statusCode")]
public long? StatusCode { 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 Attachment[]? Attachments { get; set; }
/// The user's message text as displayed in the timeline.
[JsonPropertyName("content")]
public required string Content { get; set; }
/// How this message was delivered to the agentic loop relative to loop state (idle-start vs. steering/queued while busy). The timing axis; combine with `source` (origin) for the full picture. Used for telemetry attribution.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("delivery")]
public UserMessageDelivery? Delivery { 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
{
/// Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("apiCallId")]
public string? ApiCallId { get; set; }
/// Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("citations")]
public Citations? Citations { 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)]
#if NET5_0_OR_GREATER
[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")]
#endif
[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; }
/// OpenAI-compatible wire field the provider used for reasoning (e.g. reasoning_content/reasoning). Populated only when non-canonical, so the dialect round-trips across turns.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reasoningWireField")]
public string? ReasoningWireField { 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; }
/// Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serverTools")]
public AssistantMessageServerTools? ServerTools { get; set; }
/// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serviceRequestId")]
public string? ServiceRequestId { 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)]
#if NET5_0_OR_GREATER
[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")]
#endif
[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; }
}
/// Payload emitted whenever the main agent's processing loop goes idle, including while related background work (running agents or in-flight attached shell commands) is still pending and the session-level idle event is therefore deferred.
public sealed partial class AssistantIdleData
{
/// True when the preceding agentic loop was cancelled via abort signal.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("aborted")]
public bool? Aborted { 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; }
/// Whether the model response was blocked or truncated by content filtering (finish_reason === 'content_filter'). For Anthropic models this corresponds to a 'refusal' stop reason.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("contentFilterTriggered")]
public bool? ContentFilterTriggered { get; set; }
/// Per-request cost and usage data from the CAPI copilot_usage response field.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("copilotUsage")]
public 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; }
/// Finish reason reported by the model for this API call (e.g. "stop", "length", "tool_calls", "content_filter"). Normalized to OpenAI vocabulary; for Anthropic models a "refusal" stop reason maps to "content_filter".
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("finishReason")]
public string? FinishReason { 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)]
#if NET5_0_OR_GREATER
[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")]
#endif
[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; }
/// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serviceRequestId")]
public string? ServiceRequestId { 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; }
/// For HTTP 400 failures only: whether the response carried a structured CAPI error envelope (structured_error, a deterministic validation failure) or no error body (bodyless, the transient gateway/proxy signature). Absent for non-400 failures.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("badRequestKind")]
public ModelCallFailureBadRequestKind? BadRequestKind { get; set; }
/// Duration of the failed API call in milliseconds.
[JsonConverter(typeof(MillisecondsTimeSpanConverter))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("durationMs")]
public TimeSpan? Duration { get; set; }
/// For HTTP 400 failures only: the `code` from the CAPI error envelope (e.g. 'model_max_prompt_tokens_exceeded') identifying which deterministic validation failure occurred. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("errorCode")]
public string? ErrorCode { get; set; }
/// Raw provider/runtime error message for restricted telemetry.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("errorMessage")]
public string? ErrorMessage { get; set; }
/// For HTTP 400 failures only: the `type` from the CAPI error envelope (e.g. 'websocket_error'), a coarser companion to errorCode for envelopes that carry no code. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("errorType")]
public string? ErrorType { 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; }
/// Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("quotaSnapshots")]
internal IDictionary? QuotaSnapshots { get; set; }
/// Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("requestFingerprint")]
public ModelCallFailureRequestFingerprint? RequestFingerprint { get; set; }
/// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serviceRequestId")]
public string? ServiceRequestId { 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; }
/// When true, the tool output should be displayed expanded (verbatim) in the CLI timeline.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("displayVerbatim")]
public bool? DisplayVerbatim { 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; }
/// 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)]
#if NET5_0_OR_GREATER
[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")]
#endif
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("parentToolCallId")]
public string? ParentToolCallId { get; set; }
/// Shell-tool path hints derived from the command at start time for shell tools (bash/powershell/local_shell). Produced by the same shell-aware extractor as PermissionRequestShell.possiblePaths, so it is present even when the command is auto-approved and no permission request fires. Absent for non-shell tools.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("shellToolInfo")]
public ToolExecutionStartShellToolInfo? ShellToolInfo { get; set; }
/// Unique identifier for this tool call.
[JsonPropertyName("toolCallId")]
public required string ToolCallId { get; set; }
/// Tool definition metadata, present for MCP tools with MCP Apps support.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolDescription")]
public ToolExecutionStartToolDescription? ToolDescription { 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)]
#if NET5_0_OR_GREATER
[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")]
#endif
[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 definition metadata, present for MCP tools with MCP Apps support.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolDescription")]
public ToolExecutionCompleteToolDescription? ToolDescription { 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; }
/// Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("source")]
public string? Source { get; set; }
/// What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("trigger")]
public SkillInvokedTrigger? Trigger { 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.
[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 selected for the sub-agent, when known.
[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; }
}
/// Ephemeral progress update from a running hook process.
public sealed partial class HookProgressData
{
/// Human-readable progress message from the hook process.
[JsonPropertyName("message")]
public required string Message { get; set; }
/// When true, this status message replaces the previous temporary one instead of accumulating.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("temporary")]
public bool? Temporary { get; set; }
}
/// Canonical bytes for a content-addressed binary asset shared by reference across events.
public sealed partial class SessionBinaryAssetData
{
/// Content-addressed id for this binary asset (e.g. "sha256:...").
[JsonPropertyName("assetId")]
public required string AssetId { get; set; }
/// Decoded byte length of the binary asset.
[JsonPropertyName("byteLength")]
public required long ByteLength { get; set; }
/// Base64-encoded binary data.
[Base64String]
[JsonPropertyName("data")]
public required string Data { get; set; }
/// Human-readable description of the binary data.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }
/// Optional metadata from the producing tool.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("metadata")]
public IDictionary? Metadata { get; set; }
/// MIME type of the binary asset.
[JsonPropertyName("mimeType")]
public required string MimeType { get; set; }
/// Binary asset type discriminator. Use "image" for images and "resource" otherwise.
[JsonPropertyName("type")]
public required BinaryAssetType Type { 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
{
/// Why the runtime is requesting host-provided OAuth credentials.
[JsonPropertyName("reason")]
public required McpOauthRequestReason Reason { get; set; }
/// Unique identifier for this OAuth request; used to respond via session.mcp.oauth.handlePendingRequest.
[JsonPropertyName("requestId")]
public required string RequestId { get; set; }
/// Raw OAuth protected-resource metadata document fetched for the MCP server, if available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resourceMetadata")]
public string? ResourceMetadata { 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; }
/// OAuth WWW-Authenticate parameters parsed from the auth challenge, if available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("wwwAuthenticateParams")]
public McpOauthWWWAuthenticateParams? WwwAuthenticateParams { get; set; }
}
/// MCP OAuth request completion notification.
public sealed partial class McpOauthCompletedData
{
/// How the pending OAuth request was completed.
[JsonPropertyName("outcome")]
public required McpOauthCompletionOutcome Outcome { get; set; }
/// Request ID of the resolved OAuth request.
[JsonPropertyName("requestId")]
public required string RequestId { get; set; }
}
/// Dynamic headers refresh request for a remote MCP server.
public sealed partial class McpHeadersRefreshRequiredData
{
/// Why dynamic headers are being requested.
[JsonPropertyName("reason")]
public required McpHeadersRefreshRequiredReason Reason { get; set; }
/// Unique identifier for this headers refresh request; used to respond via session.mcp.headers.handlePendingHeadersRefreshRequest().
[JsonPropertyName("requestId")]
public required string RequestId { get; set; }
/// Display name of the remote MCP server requesting headers.
[JsonPropertyName("serverName")]
public required string ServerName { get; set; }
/// URL of the remote MCP server requesting headers.
[JsonPropertyName("serverUrl")]
public required string ServerUrl { get; set; }
}
/// MCP headers refresh request completion notification.
public sealed partial class McpHeadersRefreshCompletedData
{
/// How the pending MCP headers refresh request resolved.
[JsonPropertyName("outcome")]
public required McpHeadersRefreshCompletedOutcome Outcome { get; set; }
/// Request ID of the resolved headers refresh 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; }
/// Active session working directory, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("workingDirectory")]
public string? WorkingDirectory { 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; }
}
/// Session limit exhaustion notification requiring user action.
public sealed partial class SessionLimitsExhaustedRequestedData
{
/// Configured max AI Credits for the current accounting window.
[JsonPropertyName("maxAiCredits")]
public required double MaxAiCredits { get; set; }
/// Unique identifier for this request; used to respond via session.ui.handlePendingSessionLimitsExhausted().
[JsonPropertyName("requestId")]
public required string RequestId { get; set; }
/// AI Credits already consumed in the current accounting window.
[JsonPropertyName("usedAiCredits")]
public required double UsedAiCredits { get; set; }
}
/// Session limit exhaustion prompt completion notification.
public sealed partial class SessionLimitsExhaustedCompletedData
{
/// 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 selected session-limit action.
[JsonPropertyName("response")]
public required SessionLimitsExhaustedResponse 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
{
/// Error message if the server entered a failed state.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("error")]
public string? Error { get; set; }
/// 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; }
}
/// Schema for the `CanvasOpenedData` type.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasOpenedData
{
/// Provider-local canvas identifier.
[JsonPropertyName("canvasId")]
public required string CanvasId { get; set; }
/// Owning provider identifier.
[JsonPropertyName("extensionId")]
public required string ExtensionId { get; set; }
/// Owning extension display name, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("extensionName")]
public string? ExtensionName { get; set; }
/// Input supplied when the instance was opened.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("input")]
public JsonElement? Input { get; set; }
/// Stable caller-supplied canvas instance identifier.
[JsonPropertyName("instanceId")]
public required string InstanceId { get; set; }
/// Provider-supplied status text.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("status")]
public string? Status { get; set; }
/// Rendered title.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("title")]
public string? Title { get; set; }
/// URL for web-rendered canvases.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("url")]
public string? Url { get; set; }
}
/// Schema for the `CanvasRegistryChangedData` type.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasRegistryChangedData
{
/// Canvas declarations currently available.
[JsonPropertyName("canvases")]
public required CanvasRegistryChangedCanvas[] Canvases { get; set; }
}
/// Schema for the `CanvasClosedData` type.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasClosedData
{
/// Provider-local canvas identifier.
[JsonPropertyName("canvasId")]
public required string CanvasId { get; set; }
/// Owning provider identifier.
[JsonPropertyName("extensionId")]
public required string ExtensionId { get; set; }
/// Stable caller-supplied identifier of the canvas instance that was closed.
[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("instanceId")]
public required string InstanceId { get; set; }
}
/// Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasUnavailableData
{
/// Provider-local canvas identifier.
[JsonPropertyName("canvasId")]
public required string CanvasId { get; set; }
/// Owning provider identifier.
[JsonPropertyName("extensionId")]
public required string ExtensionId { get; set; }
/// Stable caller-supplied identifier of the canvas instance whose provider became unavailable.
[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("instanceId")]
public required string InstanceId { get; set; }
}
/// Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasRecordedData
{
/// Provider-local canvas identifier.
[JsonPropertyName("canvasId")]
public required string CanvasId { get; set; }
/// Owning provider identifier.
[JsonPropertyName("extensionId")]
public required string ExtensionId { get; set; }
/// Input supplied when the instance was opened.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("input")]
public JsonElement? Input { get; set; }
/// Stable caller-supplied canvas instance identifier.
[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("instanceId")]
public required string InstanceId { get; set; }
/// Rendered title.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("title")]
public string? Title { get; set; }
}
/// Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasRemovedData
{
/// Provider-local canvas identifier.
[JsonPropertyName("canvasId")]
public required string CanvasId { get; set; }
/// Owning provider identifier.
[JsonPropertyName("extensionId")]
public required string ExtensionId { get; set; }
/// Stable caller-supplied identifier of the canvas instance that was closed.
[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("instanceId")]
public required string InstanceId { get; set; }
}
/// Schema for the `ExtensionsAttachmentsPushedData` type.
public sealed partial class SessionExtensionsAttachmentsPushedData
{
/// Attachments contributed by an extension; the host should surface these as composer pills and forward them via the next session.send call.
[JsonPropertyName("attachments")]
public required Attachment[] Attachments { get; set; }
}
/// MCP App view called a tool on a connected MCP server (SEP-1865).
public sealed partial class McpAppToolCallCompleteData
{
/// Arguments passed to the tool by the app view, if any.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("arguments")]
public IDictionary? Arguments { get; set; }
/// Wall-clock duration of the underlying tools/call in milliseconds.
[JsonPropertyName("durationMs")]
public required double DurationMs { get; set; }
/// Set when the underlying tools/call threw an error before returning a CallToolResult.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("error")]
public McpAppToolCallCompleteError? Error { get; set; }
/// Standard MCP CallToolResult returned by the server. Present whether or not the call set isError.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("result")]
public IDictionary? Result { get; set; }
/// Name of the MCP server hosting the tool.
[JsonPropertyName("serverName")]
public required string ServerName { get; set; }
/// True when the call completed without throwing AND the MCP CallToolResult did not set isError.
[JsonPropertyName("success")]
public required bool Success { get; set; }
/// The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolMeta")]
public McpAppToolCallCompleteToolMeta? ToolMeta { get; set; }
/// MCP tool name that was invoked.
[JsonPropertyName("toolName")]
public required string ToolName { 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; }
}
/// Optional session limits.
/// Nested data type for SessionLimitsConfig.
public sealed partial class SessionLimitsConfig
{
/// Maximum AI Credits allowed across the session's current accounting window.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxAiCredits")]
public double? MaxAiCredits { 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.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("tokenDetails")]
internal 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 AttachmentFileLineRange.
public sealed partial class AttachmentFileLineRange
{
/// 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 AttachmentFile : Attachment
{
///
[JsonIgnore]
public override string Type => "file";
/// Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. "sha256:..."). Absent externally.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assetId")]
public string? AssetId { get; set; }
/// Internal: decoded byte length of the attachment's model-facing bytes. Absent externally.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("byteLength")]
public long? ByteLength { get; set; }
/// 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 AttachmentFileLineRange? LineRange { get; set; }
/// Internal: MIME type of the file's model-facing bytes (post-resize for images). Set when the file's bytes are interned to an asset. Absent externally.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("mimeType")]
public string? MimeType { get; set; }
/// Internal: why model-facing bytes are absent from persistence. Absent externally.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("omittedReason")]
public OmittedBinaryOmittedReason? OmittedReason { get; set; }
/// Absolute file path.
[JsonPropertyName("path")]
public required string Path { get; set; }
/// Frozen rendered line this attachment contributed to the <tagged_files> prompt block (e.g. "* /path (123 lines)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. Present only for attachments routed to <tagged_files> (mutually exclusive with assetId, which marks bytes sent natively).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("taggedFilesEntry")]
public string? TaggedFilesEntry { get; set; }
}
/// Directory attachment.
/// The directory variant of .
public sealed partial class AttachmentDirectory : Attachment
{
///
[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; }
/// Frozen rendered line this attachment contributed to the <tagged_files> prompt block (e.g. "* /path (12 items)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("taggedFilesEntry")]
public string? TaggedFilesEntry { get; set; }
}
/// End position of the selection.
/// Nested data type for AttachmentSelectionDetailsEnd.
public sealed partial class AttachmentSelectionDetailsEnd
{
/// 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 AttachmentSelectionDetailsStart.
public sealed partial class AttachmentSelectionDetailsStart
{
/// 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 AttachmentSelectionDetails.
public sealed partial class AttachmentSelectionDetails
{
/// End position of the selection.
[JsonPropertyName("end")]
public required AttachmentSelectionDetailsEnd End { get; set; }
/// Start position of the selection.
[JsonPropertyName("start")]
public required AttachmentSelectionDetailsStart Start { get; set; }
}
/// Code selection attachment from an editor.
/// The selection variant of .
public sealed partial class AttachmentSelection : Attachment
{
///
[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 AttachmentSelectionDetails 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 AttachmentGitHubReference : Attachment
{
///
[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 AttachmentGitHubReferenceType 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; }
}
/// Pointer to a GitHub repository.
/// Nested data type for GitHubRepoRef.
public sealed partial class GitHubRepoRef
{
/// Numeric GitHub repository id.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("id")]
public long? Id { get; set; }
/// Repository name (without owner).
[JsonPropertyName("name")]
public required string Name { get; set; }
/// Repository owner login (user or organization).
[JsonPropertyName("owner")]
public required string Owner { get; set; }
}
/// Pointer to a GitHub commit.
/// The github_commit variant of .
public sealed partial class AttachmentGitHubCommit : Attachment
{
///
[JsonIgnore]
public override string Type => "github_commit";
/// First line of the commit message.
[JsonPropertyName("message")]
public required string Message { get; set; }
/// Full commit SHA.
[JsonPropertyName("oid")]
public required string Oid { get; set; }
/// Repository the commit belongs to.
[JsonPropertyName("repo")]
public required GitHubRepoRef Repo { get; set; }
/// URL to the commit on GitHub.
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// Pointer to a GitHub release.
/// The github_release variant of .
public sealed partial class AttachmentGitHubRelease : Attachment
{
///
[JsonIgnore]
public override string Type => "github_release";
/// Human-readable release name.
[JsonPropertyName("name")]
public required string Name { get; set; }
/// Repository the release belongs to.
[JsonPropertyName("repo")]
public required GitHubRepoRef Repo { get; set; }
/// Git tag the release is anchored to.
[JsonPropertyName("tagName")]
public required string TagName { get; set; }
/// URL to the release on GitHub.
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// Pointer to a GitHub Actions job.
/// The github_actions_job variant of .
public sealed partial class AttachmentGitHubActionsJob : Attachment
{
///
[JsonIgnore]
public override string Type => "github_actions_job";
/// Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("conclusion")]
public string? Conclusion { get; set; }
/// Job id within the workflow run.
[JsonPropertyName("jobId")]
public required long JobId { get; set; }
/// Display name of the job.
[JsonPropertyName("jobName")]
public required string JobName { get; set; }
/// Repository the workflow run belongs to.
[JsonPropertyName("repo")]
public required GitHubRepoRef Repo { get; set; }
/// URL to the job on GitHub.
[JsonPropertyName("url")]
public required string Url { get; set; }
/// Display name of the workflow the job ran in.
[JsonPropertyName("workflowName")]
public required string WorkflowName { get; set; }
}
/// Pointer to a GitHub repository.
/// The github_repository variant of .
public sealed partial class AttachmentGitHubRepository : Attachment
{
///
[JsonIgnore]
public override string Type => "github_repository";
/// Short description of the repository.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }
/// Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ref")]
public string? Ref { get; set; }
/// Repository pointer.
[JsonPropertyName("repo")]
public required GitHubRepoRef Repo { get; set; }
/// URL to the repository on GitHub.
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// One side of a file diff (head or base).
/// Nested data type for AttachmentGitHubFileDiffSide.
public sealed partial class AttachmentGitHubFileDiffSide
{
/// Repository-relative path to the file.
[JsonPropertyName("path")]
public required string Path { get; set; }
/// Git ref (branch, tag, or commit SHA) the file is read at.
[JsonPropertyName("ref")]
public required string Ref { get; set; }
/// Repository the file lives in.
[JsonPropertyName("repo")]
public required GitHubRepoRef Repo { get; set; }
}
/// Pointer to a single-file diff. At least one of `head` and `base` must be present.
/// The github_file_diff variant of .
public sealed partial class AttachmentGitHubFileDiff : Attachment
{
///
[JsonIgnore]
public override string Type => "github_file_diff";
/// File location on the base side of the diff. Absent for additions.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("base")]
public AttachmentGitHubFileDiffSide? Base { get; set; }
/// File location on the head side of the diff. Absent for deletions.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("head")]
public AttachmentGitHubFileDiffSide? Head { get; set; }
/// URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL).
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// One side of a tree comparison (head or base).
/// Nested data type for AttachmentGitHubTreeComparisonSide.
public sealed partial class AttachmentGitHubTreeComparisonSide
{
/// Repository the revision belongs to.
[JsonPropertyName("repo")]
public required GitHubRepoRef Repo { get; set; }
/// Git revision (branch, tag, or commit SHA).
[JsonPropertyName("revision")]
public required string Revision { get; set; }
}
/// Pointer to a comparison between two git revisions.
/// The github_tree_comparison variant of .
public sealed partial class AttachmentGitHubTreeComparison : Attachment
{
///
[JsonIgnore]
public override string Type => "github_tree_comparison";
/// Base side of the comparison.
[JsonPropertyName("base")]
public required AttachmentGitHubTreeComparisonSide Base { get; set; }
/// Head side of the comparison.
[JsonPropertyName("head")]
public required AttachmentGitHubTreeComparisonSide Head { get; set; }
/// URL to the comparison on GitHub.
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// Generic GitHub URL reference.
/// The github_url variant of .
public sealed partial class AttachmentGitHubUrl : Attachment
{
///
[JsonIgnore]
public override string Type => "github_url";
/// URL to the GitHub resource.
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// Pointer to a file in a GitHub repository at a specific ref.
/// The github_file variant of .
public sealed partial class AttachmentGitHubFile : Attachment
{
///
[JsonIgnore]
public override string Type => "github_file";
/// Repository-relative path to the file.
[JsonPropertyName("path")]
public required string Path { get; set; }
/// Git ref the file is read at (branch, tag, or commit SHA).
[JsonPropertyName("ref")]
public required string Ref { get; set; }
/// Repository the file lives in.
[JsonPropertyName("repo")]
public required GitHubRepoRef Repo { get; set; }
/// URL to the file on GitHub.
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// Pointer to a line range inside a file in a GitHub repository.
/// The github_snippet variant of .
public sealed partial class AttachmentGitHubSnippet : Attachment
{
///
[JsonIgnore]
public override string Type => "github_snippet";
/// Line range the snippet covers.
[JsonPropertyName("lineRange")]
public required AttachmentFileLineRange LineRange { get; set; }
/// Repository-relative path to the file.
[JsonPropertyName("path")]
public required string Path { get; set; }
/// Git ref the file is read at (branch, tag, or commit SHA).
[JsonPropertyName("ref")]
public required string Ref { get; set; }
/// Repository the file lives in.
[JsonPropertyName("repo")]
public required GitHubRepoRef Repo { get; set; }
/// URL to the snippet on GitHub (with line anchor).
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// Blob attachment with inline base64-encoded data.
/// The blob variant of .
public sealed partial class AttachmentBlob : Attachment
{
///
[JsonIgnore]
public override string Type => "blob";
/// Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. "sha256:..."). Absent externally.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assetId")]
public string? AssetId { get; set; }
/// Internal: decoded byte length of the attachment's model-facing bytes. Absent externally.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("byteLength")]
public long? ByteLength { get; set; }
/// Base64-encoded content. Present on input and for external consumers; replaced by an internal `assetId` reference in persisted events when interned to a content-addressed asset.
[Base64String]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("data")]
public 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; }
/// Internal: why model-facing bytes are absent from persistence. Absent externally.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("omittedReason")]
public OmittedBinaryOmittedReason? OmittedReason { get; set; }
}
/// Structured context contributed by an extension. Composer pills displayed in the host are forwarded back through session.send.attachments, then rendered into the model prompt as an <extension_context> XML block.
/// The extension_context variant of .
public sealed partial class AttachmentExtensionContext : Attachment
{
///
[JsonIgnore]
public override string Type => "extension_context";
/// Provider-local canvas identifier when the push was bound to a canvas instance.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("canvasId")]
public string? CanvasId { get; set; }
/// ISO 8601 timestamp captured by the runtime when the push was accepted.
[JsonPropertyName("capturedAt")]
public required DateTimeOffset CapturedAt { get; set; }
/// Owning extension identifier. Runtime-derived from the caller's connection when produced via session.extensions.sendAttachmentsToMessage; preserved verbatim on subsequent transports.
[JsonPropertyName("extensionId")]
public required string ExtensionId { get; set; }
/// Open canvas instance identifier when the push was bound to a canvas instance.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("instanceId")]
public string? InstanceId { get; set; }
/// Caller-supplied JSON payload.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payload")]
public JsonElement? Payload { get; set; }
/// Human-readable composer pill label.
[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("title")]
public required string Title { get; set; }
}
/// A user message attachment — a file, directory, code selection, blob, GitHub reference, GitHub-anchored pointer, or extension-supplied context payload.
/// Polymorphic base type discriminated by type.
[JsonPolymorphic(
TypeDiscriminatorPropertyName = "type",
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
[JsonDerivedType(typeof(AttachmentFile), "file")]
[JsonDerivedType(typeof(AttachmentDirectory), "directory")]
[JsonDerivedType(typeof(AttachmentSelection), "selection")]
[JsonDerivedType(typeof(AttachmentGitHubReference), "github_reference")]
[JsonDerivedType(typeof(AttachmentGitHubCommit), "github_commit")]
[JsonDerivedType(typeof(AttachmentGitHubRelease), "github_release")]
[JsonDerivedType(typeof(AttachmentGitHubActionsJob), "github_actions_job")]
[JsonDerivedType(typeof(AttachmentGitHubRepository), "github_repository")]
[JsonDerivedType(typeof(AttachmentGitHubFileDiff), "github_file_diff")]
[JsonDerivedType(typeof(AttachmentGitHubTreeComparison), "github_tree_comparison")]
[JsonDerivedType(typeof(AttachmentGitHubUrl), "github_url")]
[JsonDerivedType(typeof(AttachmentGitHubFile), "github_file")]
[JsonDerivedType(typeof(AttachmentGitHubSnippet), "github_snippet")]
[JsonDerivedType(typeof(AttachmentBlob), "blob")]
[JsonDerivedType(typeof(AttachmentExtensionContext), "extension_context")]
public partial class Attachment
{
/// The type discriminator.
[JsonPropertyName("type")]
public virtual string Type { get; set; } = string.Empty;
}
/// A source that backs one or more cited spans in the assistant's response.
/// Nested data type for CitationSource.
[Experimental(Diagnostics.Experimental)]
public sealed partial class CitationSource
{
/// Stable, turn-scoped identifier for this source, referenced by CitationReference.sourceId.
[JsonPropertyName("id")]
public required string Id { get; set; }
/// File path relative to the agent's workspace root, when the source is a file.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("path")]
public string? Path { get; set; }
/// The system that produced this citation.
[JsonPropertyName("provider")]
public required CitationProvider Provider { get; set; }
/// Human-readable title of the source.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("title")]
public string? Title { get; set; }
/// URL of the source, when it is a web resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("url")]
public string? Url { get; set; }
}
/// A character range within the source's text content.
/// The char variant of .
[Experimental(Diagnostics.Experimental)]
public sealed partial class CitationLocationChar : CitationLocation
{
///
[JsonIgnore]
public override string Type => "char";
/// End character offset within the source text (zero-based, exclusive).
[JsonPropertyName("endIndex")]
public required long EndIndex { get; set; }
/// Start character offset within the source text (zero-based, inclusive).
[JsonPropertyName("startIndex")]
public required long StartIndex { get; set; }
}
/// A page range within a paginated source document.
/// The page variant of .
[Experimental(Diagnostics.Experimental)]
public sealed partial class CitationLocationPage : CitationLocation
{
///
[JsonIgnore]
public override string Type => "page";
/// Last page number of the cited range (inclusive).
[JsonPropertyName("endPage")]
public required long EndPage { get; set; }
/// First page number of the cited range.
[JsonPropertyName("startPage")]
public required long StartPage { get; set; }
}
/// A content-block range within a structured source document.
/// The block variant of .
[Experimental(Diagnostics.Experimental)]
public sealed partial class CitationLocationBlock : CitationLocation
{
///
[JsonIgnore]
public override string Type => "block";
/// Index of the last content block of the cited range (zero-based, exclusive).
[JsonPropertyName("endBlock")]
public required long EndBlock { get; set; }
/// Index of the first content block of the cited range (zero-based, inclusive).
[JsonPropertyName("startBlock")]
public required long StartBlock { get; set; }
}
/// Location within a cited source (character, page, or content-block range) that supports a span.
/// Polymorphic base type discriminated by type.
[Experimental(Diagnostics.Experimental)]
[JsonPolymorphic(
TypeDiscriminatorPropertyName = "type",
UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)]
[JsonDerivedType(typeof(CitationLocationChar), "char")]
[JsonDerivedType(typeof(CitationLocationPage), "page")]
[JsonDerivedType(typeof(CitationLocationBlock), "block")]
public partial class CitationLocation
{
/// The type discriminator.
[JsonPropertyName("type")]
public virtual string Type { get; set; } = string.Empty;
}
/// A single citation occurrence linking a span of generated text to a supporting source.
/// Nested data type for CitationReference.
[Experimental(Diagnostics.Experimental)]
public sealed partial class CitationReference
{
/// The exact text from the source that supports the cited span, when provided by the model.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("citedText")]
public string? CitedText { get; set; }
/// Location within the source that supports the cited span, when the provider reports one.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("location")]
public CitationLocation? Location { get; set; }
/// Provider-native citation correlation data (e.g. Anthropic search_result_index / document_index), passed through opaquely for debugging and forward compatibility.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("providerMetadata")]
public JsonElement? ProviderMetadata { get; set; }
/// Identifier of the CitationSource this reference points to (CitationSource.id).
[JsonPropertyName("sourceId")]
public required string SourceId { get; set; }
}
/// A contiguous span of generated assistant text and the source references that support it.
/// Nested data type for CitationSpan.
[Experimental(Diagnostics.Experimental)]
public sealed partial class CitationSpan
{
/// End offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, exclusive).
[JsonPropertyName("endIndex")]
public required long EndIndex { get; set; }
/// The sources that support this span of generated text.
[JsonPropertyName("references")]
public required CitationReference[] References { get; set; }
/// Start offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, inclusive).
[JsonPropertyName("startIndex")]
public required long StartIndex { get; set; }
}
/// Provider-agnostic citations linking spans of the assistant's response to their supporting sources.
/// Nested data type for Citations.
[Experimental(Diagnostics.Experimental)]
public sealed partial class Citations
{
/// Deduplicated set of sources referenced by the citation spans.
[JsonPropertyName("sources")]
public required CitationSource[] Sources { get; set; }
/// Spans of generated text annotated with the sources that support them.
[JsonPropertyName("spans")]
public required CitationSpan[] Spans { get; set; }
}
/// Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping.
/// Nested data type for AssistantMessageServerTools.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantMessageServerTools
{
/// Gets or sets the advisorModel value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("advisorModel")]
public string? AdvisorModel { get; set; }
/// Gets or sets the functionCallNamespaces value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("functionCallNamespaces")]
public IDictionary? FunctionCallNamespaces { get; set; }
/// Gets or sets the items value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("items")]
public JsonElement[]? Items { get; set; }
/// Gets or sets the provider value.
[JsonPropertyName("provider")]
public required string Provider { get; set; }
/// Gets or sets the rawContentBlocks value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rawContentBlocks")]
public JsonElement[]? RawContentBlocks { get; set; }
}
/// 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.
public sealed partial class AssistantUsageCopilotUsage
{
/// Itemized token usage breakdown.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("tokenDetails")]
internal 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 currently has quota available for use.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("hasQuota")]
internal bool? HasQuota { 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; }
/// Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("overageEntitlement")]
internal double? OverageEntitlement { 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 this snapshot uses token-based billing (AI-credits allocation).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("tokenBasedBilling")]
internal bool? TokenBasedBilling { 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; }
}
/// Content-free structural summary of the failing request for diagnosing malformed 4xx calls.
/// Nested data type for ModelCallFailureRequestFingerprint.
public sealed partial class ModelCallFailureRequestFingerprint
{
/// Total number of image content parts.
[JsonPropertyName("imagePartCount")]
public required long ImagePartCount { get; set; }
/// Image parts whose media type cannot be determined (rejected by strict providers).
[JsonPropertyName("imagePartsMissingMediaType")]
public required long ImagePartsMissingMediaType { get; set; }
/// Role of the final message in the request.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("lastMessageRole")]
public string? LastMessageRole { get; set; }
/// Total number of messages in the request.
[JsonPropertyName("messageCount")]
public required long MessageCount { get; set; }
/// Tool calls whose name is missing or empty (rejected by strict providers).
[JsonPropertyName("namelessToolCallCount")]
public required long NamelessToolCallCount { get; set; }
/// Total number of tool calls across assistant messages.
[JsonPropertyName("toolCallCount")]
public required long ToolCallCount { get; set; }
/// Number of "tool" result messages in the request.
[JsonPropertyName("toolResultMessageCount")]
public required long ToolResultMessageCount { get; set; }
}
/// Shell-aware path hints for a shell tool's command, captured at start time so consumers can snapshot a file's pre-image before the tool runs.
/// Nested data type for ToolExecutionStartShellToolInfo.
public sealed partial class ToolExecutionStartShellToolInfo
{
/// Whether the command includes a file write redirection (e.g., > or >>).
[JsonPropertyName("hasWriteFileRedirection")]
public required bool HasWriteFileRedirection { get; set; }
/// File paths the command may read or write, derived from the command at start time. Produced by the same shell-aware extractor as PermissionRequestShell.possiblePaths, so it is present even when the command is auto-approved and no permission request fires.
[JsonPropertyName("possiblePaths")]
public required string[] PossiblePaths { get; set; }
}
/// Schema for the `ToolExecutionStartToolDescriptionMetaUI` type.
/// Nested data type for ToolExecutionStartToolDescriptionMetaUI.
public sealed partial class ToolExecutionStartToolDescriptionMetaUI
{
/// URI of the UI resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resourceUri")]
public string? ResourceUri { get; set; }
/// Who can access this tool.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("visibility")]
public ToolExecutionStartToolDescriptionMetaUIVisibility[]? Visibility { get; set; }
}
/// MCP Apps metadata for UI resource association.
/// Nested data type for ToolExecutionStartToolDescriptionMeta.
public sealed partial class ToolExecutionStartToolDescriptionMeta
{
/// Schema for the `ToolExecutionStartToolDescriptionMetaUI` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ui")]
public ToolExecutionStartToolDescriptionMetaUI? Ui { get; set; }
}
/// Tool definition metadata, present for MCP tools with MCP Apps support.
/// Nested data type for ToolExecutionStartToolDescription.
public sealed partial class ToolExecutionStartToolDescription
{
/// MCP Apps metadata for UI resource association.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("_meta")]
public ToolExecutionStartToolDescriptionMeta? _meta { get; set; }
/// Tool description.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }
/// Tool name.
[JsonPropertyName("name")]
public required string Name { 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; }
}
/// Binary result returned by a tool for the model.
/// Nested data type for PersistedBinaryImage.
public sealed partial class PersistedBinaryImage
{
/// Base64-encoded binary data.
[Base64String]
[JsonPropertyName("data")]
public required string Data { get; set; }
/// Human-readable description of the binary data.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }
/// Optional metadata from the producing tool.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("metadata")]
public IDictionary? Metadata { get; set; }
/// MIME type of the binary data.
[JsonPropertyName("mimeType")]
public required string MimeType { get; set; }
/// Binary result type discriminator. Use "image" for images and "resource" for other binary data.
[JsonPropertyName("type")]
public required PersistedBinaryImageType Type { get; set; }
}
/// A binary result whose data was omitted from persistence due to the inline size limit.
/// Nested data type for OmittedBinaryResult.
[Experimental(Diagnostics.Experimental)]
public sealed partial class OmittedBinaryResult
{
/// Decoded byte length of the omitted binary data.
[JsonPropertyName("byteLength")]
public required long ByteLength { get; set; }
/// Human-readable description of the binary data.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }
/// Optional metadata from the producing tool.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("metadata")]
public IDictionary? Metadata { get; set; }
/// MIME type of the omitted binary data.
[JsonPropertyName("mimeType")]
public required string MimeType { get; set; }
/// Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable.
[JsonPropertyName("omittedReason")]
public required OmittedBinaryOmittedReason OmittedReason { get; set; }
/// Binary result type discriminator. Use "image" for images and "resource" for other binary data.
[JsonPropertyName("type")]
public required OmittedBinaryType Type { get; set; }
}
/// A reference to binary data persisted once on a session.binary_asset event and shared by id.
/// Nested data type for BinaryAssetReference.
[Experimental(Diagnostics.Experimental)]
public sealed partial class BinaryAssetReference
{
/// Content-addressed id of the session.binary_asset event that holds this binary's bytes (e.g. "sha256:...").
[JsonPropertyName("assetId")]
public required string AssetId { get; set; }
/// Decoded byte length of the referenced binary data.
[JsonPropertyName("byteLength")]
public required long ByteLength { get; set; }
/// Human-readable description of the binary data.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }
/// Optional metadata from the producing tool.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("metadata")]
public IDictionary? Metadata { get; set; }
/// MIME type of the referenced binary data.
[JsonPropertyName("mimeType")]
public required string MimeType { get; set; }
/// Binary result type discriminator. Use "image" for images and "resource" for other binary data.
[JsonPropertyName("type")]
public required BinaryAssetReferenceType Type { get; set; }
}
/// A model-facing binary result as persisted: full inline data, a size-omitted marker, or a deduplicated asset reference.
/// JSON union data type for PersistedBinaryResult.
[JsonConverter(typeof(Converter))]
public sealed partial class PersistedBinaryResult
{
/// Gets the value when this instance contains .
public PersistedBinaryImage? PersistedBinaryImage { get; }
/// Gets the value when this instance contains .
public OmittedBinaryResult? OmittedBinaryResult { get; }
/// Gets the value when this instance contains .
public BinaryAssetReference? BinaryAssetReference { get; }
/// Initializes a new instance of the class from .
public PersistedBinaryResult(PersistedBinaryImage value)
{
ArgumentNullException.ThrowIfNull(value);
PersistedBinaryImage = value;
}
/// Converts to .
public static implicit operator PersistedBinaryResult(PersistedBinaryImage value) => new(value);
/// Initializes a new instance of the class from .
public PersistedBinaryResult(OmittedBinaryResult value)
{
ArgumentNullException.ThrowIfNull(value);
OmittedBinaryResult = value;
}
/// Converts to .
public static implicit operator PersistedBinaryResult(OmittedBinaryResult value) => new(value);
/// Initializes a new instance of the class from .
public PersistedBinaryResult(BinaryAssetReference value)
{
ArgumentNullException.ThrowIfNull(value);
BinaryAssetReference = value;
}
/// Converts to .
public static implicit operator PersistedBinaryResult(BinaryAssetReference value) => new(value);
/// Provides a for serializing instances.
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class Converter : JsonConverter
{
///
public override PersistedBinaryResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
throw new JsonException("Expected JSON object for PersistedBinaryResult.");
}
using var document = JsonDocument.ParseValue(ref reader);
var element = document.RootElement;
if (element.ValueKind == JsonValueKind.Object && element.TryGetProperty("data", out _) && !element.TryGetProperty("assetId", out _) && !element.TryGetProperty("byteLength", out _) && !element.TryGetProperty("omittedReason", out _))
{
var persistedBinaryImage = JsonSerializer.Deserialize(element, SessionEventsJsonContext.Default.PersistedBinaryImage);
return persistedBinaryImage is null ? throw new JsonException("Expected PersistedBinaryImage value.") : new PersistedBinaryResult(persistedBinaryImage);
}
if (element.ValueKind == JsonValueKind.Object && element.TryGetProperty("omittedReason", out _) && !element.TryGetProperty("assetId", out _) && !element.TryGetProperty("data", out _))
{
var omittedBinaryResult = JsonSerializer.Deserialize(element, SessionEventsJsonContext.Default.OmittedBinaryResult);
return omittedBinaryResult is null ? throw new JsonException("Expected OmittedBinaryResult value.") : new PersistedBinaryResult(omittedBinaryResult);
}
if (element.ValueKind == JsonValueKind.Object && element.TryGetProperty("assetId", out _) && !element.TryGetProperty("data", out _) && !element.TryGetProperty("omittedReason", out _))
{
var binaryAssetReference = JsonSerializer.Deserialize(element, SessionEventsJsonContext.Default.BinaryAssetReference);
return binaryAssetReference is null ? throw new JsonException("Expected BinaryAssetReference value.") : new PersistedBinaryResult(binaryAssetReference);
}
throw new JsonException("JSON value did not match any PersistedBinaryResult variant.");
}
///
public override void Write(Utf8JsonWriter writer, PersistedBinaryResult value, JsonSerializerOptions options)
{
if (value.PersistedBinaryImage is { } persistedBinaryImage)
{
JsonSerializer.Serialize(writer, persistedBinaryImage, SessionEventsJsonContext.Default.PersistedBinaryImage);
return;
}
if (value.OmittedBinaryResult is { } omittedBinaryResult)
{
JsonSerializer.Serialize(writer, omittedBinaryResult, SessionEventsJsonContext.Default.OmittedBinaryResult);
return;
}
if (value.BinaryAssetReference is { } binaryAssetReference)
{
JsonSerializer.Serialize(writer, binaryAssetReference, SessionEventsJsonContext.Default.BinaryAssetReference);
return;
}
throw new JsonException("No PersistedBinaryResult variant value is set.");
}
}
}
/// A source supplied by a tool that should be made available to the model as citable content.
/// Nested data type for CitableSource.
[Experimental(Diagnostics.Experimental)]
public sealed partial class CitableSource
{
/// The source text made available to the model as citable content.
[JsonPropertyName("content")]
public required string Content { get; set; }
/// Stable identifier for this source within the tool result. Used for deduplication and may be used by future provider integrations to correlate response citations back to the originating source.
[JsonPropertyName("id")]
public required string Id { get; set; }
/// File path relative to the agent's workspace root, when the source is a file.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("path")]
public string? Path { get; set; }
/// Human-readable title of the source.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("title")]
public string? Title { get; set; }
/// URL of the source, when it is a web resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("url")]
public string? Url { 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; }
}
/// Deprecated for shell command exit metadata. Use ToolExecutionCompleteContentShellExit instead.
/// The terminal variant of .
[EditorBrowsable(EditorBrowsableState.Never)]
#if NET5_0_OR_GREATER
[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")]
#endif
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; }
}
/// Shell command exit metadata with optional output preview.
/// The shell_exit variant of .
public sealed partial class ToolExecutionCompleteContentShellExit : ToolExecutionCompleteContent
{
///
[JsonIgnore]
public override string Type => "shell_exit";
/// Working directory where the shell command was executed.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cwd")]
public string? Cwd { get; set; }
/// Exit code from the completed shell command.
[JsonPropertyName("exitCode")]
public required long ExitCode { get; set; }
/// Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("outputPreview")]
public string? OutputPreview { get; set; }
/// Whether outputPreview is known to be incomplete or truncated.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("outputTruncated")]
public bool? OutputTruncated { get; set; }
/// Shell id, as assigned by Copilot runtime.
[JsonPropertyName("shellId")]
public required string ShellId { 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(ToolExecutionCompleteContentShellExit), "shell_exit")]
[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;
}
/// Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUICsp.
public sealed partial class ToolExecutionCompleteUIResourceMetaUICsp
{
/// Gets or sets the baseUriDomains value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("baseUriDomains")]
public string[]? BaseUriDomains { get; set; }
/// Gets or sets the connectDomains value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("connectDomains")]
public string[]? ConnectDomains { get; set; }
/// Gets or sets the frameDomains value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("frameDomains")]
public string[]? FrameDomains { get; set; }
/// Gets or sets the resourceDomains value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resourceDomains")]
public string[]? ResourceDomains { get; set; }
}
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsCamera.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsCamera
{
}
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite
{
}
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation
{
}
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone
{
}
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissions.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissions
{
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("camera")]
public ToolExecutionCompleteUIResourceMetaUIPermissionsCamera? Camera { get; set; }
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("clipboardWrite")]
public ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite? ClipboardWrite { get; set; }
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("geolocation")]
public ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation? Geolocation { get; set; }
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("microphone")]
public ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone? Microphone { get; set; }
}
/// Schema for the `ToolExecutionCompleteUIResourceMetaUI` type.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUI.
public sealed partial class ToolExecutionCompleteUIResourceMetaUI
{
/// Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("csp")]
public ToolExecutionCompleteUIResourceMetaUICsp? Csp { get; set; }
/// Gets or sets the domain value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("domain")]
public string? Domain { get; set; }
/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("permissions")]
public ToolExecutionCompleteUIResourceMetaUIPermissions? Permissions { get; set; }
/// Gets or sets the prefersBorder value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("prefersBorder")]
public bool? PrefersBorder { get; set; }
}
/// Resource-level UI metadata (CSP, permissions, visual preferences).
/// Nested data type for ToolExecutionCompleteUIResourceMeta.
public sealed partial class ToolExecutionCompleteUIResourceMeta
{
/// Schema for the `ToolExecutionCompleteUIResourceMetaUI` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ui")]
public ToolExecutionCompleteUIResourceMetaUI? Ui { get; set; }
}
/// MCP Apps UI resource content for rendering in a sandboxed iframe.
/// Nested data type for ToolExecutionCompleteUIResource.
public sealed partial class ToolExecutionCompleteUIResource
{
/// Resource-level UI metadata (CSP, permissions, visual preferences).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("_meta")]
public ToolExecutionCompleteUIResourceMeta? _meta { get; set; }
/// Base64-encoded HTML content.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("blob")]
public string? Blob { get; set; }
/// MIME type of the content.
[JsonPropertyName("mimeType")]
public required string MimeType { get; set; }
/// HTML content as a string.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("text")]
public string? Text { get; set; }
/// The ui:// URI of the resource.
[JsonPropertyName("uri")]
public required string Uri { get; set; }
}
/// Tool execution result on success.
/// Nested data type for ToolExecutionCompleteResult.
public sealed partial class ToolExecutionCompleteResult
{
/// Model-facing binary results (base64 inline or size-omitted markers) sent to the LLM for this tool call.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("binaryResultsForLlm")]
public PersistedBinaryResult[]? BinaryResultsForLlm { get; set; }
/// Provider-neutral source material this tool makes available to the model as citable content. Persisted so it survives session resume. Experimental.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("citableSources")]
public CitableSource[]? CitableSources { get; set; }
/// 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; }
/// Structured content (arbitrary JSON) returned verbatim by the MCP tool.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("structuredContent")]
public JsonElement? StructuredContent { get; set; }
/// MCP Apps UI resource content for rendering in a sandboxed iframe.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("uiResource")]
public ToolExecutionCompleteUIResource? UiResource { get; set; }
}
/// Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type.
/// Nested data type for ToolExecutionCompleteToolDescriptionMetaUI.
public sealed partial class ToolExecutionCompleteToolDescriptionMetaUI
{
/// URI of the UI resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resourceUri")]
public string? ResourceUri { get; set; }
/// Who can access this tool.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("visibility")]
public ToolExecutionCompleteToolDescriptionMetaUIVisibility[]? Visibility { get; set; }
}
/// MCP Apps metadata for UI resource association.
/// Nested data type for ToolExecutionCompleteToolDescriptionMeta.
public sealed partial class ToolExecutionCompleteToolDescriptionMeta
{
/// Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ui")]
public ToolExecutionCompleteToolDescriptionMetaUI? Ui { get; set; }
}
/// Tool definition metadata, present for MCP tools with MCP Apps support.
/// Nested data type for ToolExecutionCompleteToolDescription.
public sealed partial class ToolExecutionCompleteToolDescription
{
/// MCP Apps metadata for UI resource association.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("_meta")]
public ToolExecutionCompleteToolDescriptionMeta? _meta { get; set; }
/// Tool description.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }
/// Tool name.
[JsonPropertyName("name")]
public required string Name { 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; }
/// Source label of the hook that errored (e.g. the plugin it was loaded from), when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("source")]
public string? Source { 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; }
/// True when the model has requested to run this command outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("requestSandboxBypass")]
public bool? RequestSandboxBypass { get; set; }
/// Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("requestSandboxBypassReason")]
public string? RequestSandboxBypassReason { 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; }
/// True when the model has requested to run this search outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("requestSandboxBypass")]
public bool? RequestSandboxBypass { get; set; }
/// Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("requestSandboxBypassReason")]
public string? RequestSandboxBypassReason { 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 OAuth client secret for confidential static clients, when the runtime can resolve one.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("clientSecret")]
public string? ClientSecret { 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; }
}
/// OAuth WWW-Authenticate parameters parsed from an MCP auth challenge.
/// Nested data type for McpOauthWWWAuthenticateParams.
public sealed partial class McpOauthWWWAuthenticateParams
{
/// OAuth error from the WWW-Authenticate error parameter, if present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("error")]
public string? Error { get; set; }
/// Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter, if present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resourceMetadataUrl")]
public string? ResourceMetadataUrl { get; set; }
/// Requested OAuth scopes from the WWW-Authenticate scope parameter, if present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("scope")]
public string? Scope { get; set; }
}
/// The user's selected action for an exhausted session limit.
/// Nested data type for SessionLimitsExhaustedResponse.
public sealed partial class SessionLimitsExhaustedResponse
{
/// Action selected by the user.
[JsonPropertyName("action")]
public required SessionLimitsExhaustedResponseAction Action { get; set; }
/// AI Credits to add to the current max when action is 'add'.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("additionalAiCredits")]
public double? AdditionalAiCredits { get; set; }
/// New absolute max AI Credits when action is 'set'.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxAiCredits")]
public double? MaxAiCredits { 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 canvas rendering is now supported.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("canvases")]
public bool? Canvases { get; set; }
/// Whether elicitation is now supported.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("elicitation")]
public bool? Elicitation { get; set; }
/// Whether MCP Apps (SEP-1865) UI passthrough is now supported.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("mcpApps")]
public bool? McpApps { get; set; }
}
/// Schema for the `SkillsLoadedSkill` type.
/// Nested data type for SkillsLoadedSkill.
public sealed partial class SkillsLoadedSkill
{
/// Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("argumentHint")]
public string? ArgumentHint { get; set; }
/// 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; }
/// Name of the plugin that supplied the effective MCP server config, only when source is plugin.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("pluginName")]
public string? PluginName { get; set; }
/// Version of the plugin that supplied the effective MCP server config, only when source is plugin.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("pluginVersion")]
public string? PluginVersion { 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; }
/// Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("transport")]
public McpServerTransport? Transport { 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', 'plugin:my-plugin:my-ext').
[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; }
}
/// Schema for the `CanvasRegistryChangedCanvasAction` type.
/// Nested data type for CanvasRegistryChangedCanvasAction.
[Experimental(Diagnostics.Experimental)]
public sealed partial class CanvasRegistryChangedCanvasAction
{
/// Action description.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("description")]
public string? Description { get; set; }
/// JSON Schema for action input.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("inputSchema")]
public JsonElement? InputSchema { get; set; }
/// Action name.
[JsonPropertyName("name")]
public required string Name { get; set; }
}
/// Schema for the `CanvasRegistryChangedCanvas` type.
/// Nested data type for CanvasRegistryChangedCanvas.
[Experimental(Diagnostics.Experimental)]
public sealed partial class CanvasRegistryChangedCanvas
{
/// Actions the agent or host may invoke.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("actions")]
public CanvasRegistryChangedCanvasAction[]? Actions { get; set; }
/// Provider-local canvas identifier.
[JsonPropertyName("canvasId")]
public required string CanvasId { get; set; }
/// Short, single-sentence description shown to the agent in canvas catalogs.
[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("description")]
public required string Description { get; set; }
/// Human-readable canvas name.
[JsonPropertyName("displayName")]
public required string DisplayName { get; set; }
/// Owning provider identifier.
[JsonPropertyName("extensionId")]
public required string ExtensionId { get; set; }
/// Owning extension display name, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("extensionName")]
public string? ExtensionName { get; set; }
/// JSON Schema for canvas open input.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("inputSchema")]
public JsonElement? InputSchema { get; set; }
}
/// Set when the underlying tools/call threw an error before returning a CallToolResult.
/// Nested data type for McpAppToolCallCompleteError.
public sealed partial class McpAppToolCallCompleteError
{
/// Human-readable error message.
[JsonPropertyName("message")]
public required string Message { get; set; }
}
/// Schema for the `McpAppToolCallCompleteToolMetaUI` type.
/// Nested data type for McpAppToolCallCompleteToolMetaUI.
public sealed partial class McpAppToolCallCompleteToolMetaUI
{
/// `ui://` URI declared by the tool's `_meta.ui.resourceUri`.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resourceUri")]
public string? ResourceUri { get; set; }
/// Tool visibility per SEP-1865 (typically a subset of `["model","app"]`).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("visibility")]
public string[]? Visibility { get; set; }
}
/// The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.
/// Nested data type for McpAppToolCallCompleteToolMeta.
public sealed partial class McpAppToolCallCompleteToolMeta
{
/// Schema for the `McpAppToolCallCompleteToolMetaUI` type.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ui")]
public McpAppToolCallCompleteToolMetaUI? Ui { 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));
}
}
}
/// Allowed values for the `ContextTier` enumeration.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ContextTier : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ContextTier(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Default context tier with standard context window size.
public static ContextTier Default { get; } = new("default");
/// Extended context tier with a larger context window.
public static ContextTier LongContext { get; } = new("long_context");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ContextTier left, ContextTier right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ContextTier left, ContextTier right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ContextTier other && Equals(other);
///
public bool Equals(ContextTier 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 ContextTier Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ContextTier value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ContextTier));
}
}
}
/// 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 type of operation performed on the autopilot objective state file.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AutopilotObjectiveChangedOperation : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AutopilotObjectiveChangedOperation(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Autopilot objective state file was created for a new objective.
public static AutopilotObjectiveChangedOperation Create { get; } = new("create");
/// Autopilot objective state file was updated for an existing objective.
public static AutopilotObjectiveChangedOperation Update { get; } = new("update");
/// Autopilot objective state file was deleted or cleared.
public static AutopilotObjectiveChangedOperation Delete { get; } = new("delete");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AutopilotObjectiveChangedOperation left, AutopilotObjectiveChangedOperation right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AutopilotObjectiveChangedOperation left, AutopilotObjectiveChangedOperation right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AutopilotObjectiveChangedOperation other && Equals(other);
///
public bool Equals(AutopilotObjectiveChangedOperation 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 AutopilotObjectiveChangedOperation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AutopilotObjectiveChangedOperation value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutopilotObjectiveChangedOperation));
}
}
}
/// Current autopilot objective status, if one exists.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AutopilotObjectiveChangedStatus : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AutopilotObjectiveChangedStatus(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Objective is active and can drive autopilot continuations.
public static AutopilotObjectiveChangedStatus Active { get; } = new("active");
/// Objective is paused and will not drive autopilot continuations.
public static AutopilotObjectiveChangedStatus Paused { get; } = new("paused");
/// Legacy objective state indicating the previous continuation cap was reached.
public static AutopilotObjectiveChangedStatus CapReached { get; } = new("cap_reached");
/// Objective was completed by the agent.
public static AutopilotObjectiveChangedStatus Completed { get; } = new("completed");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AutopilotObjectiveChangedStatus left, AutopilotObjectiveChangedStatus right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AutopilotObjectiveChangedStatus left, AutopilotObjectiveChangedStatus right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AutopilotObjectiveChangedStatus other && Equals(other);
///
public bool Equals(AutopilotObjectiveChangedStatus 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 AutopilotObjectiveChangedStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AutopilotObjectiveChangedStatus value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutopilotObjectiveChangedStatus));
}
}
}
/// 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));
}
}
}
/// Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct OmittedBinaryOmittedReason : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public OmittedBinaryOmittedReason(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Bytes exceeded the session's inline size limit.
public static OmittedBinaryOmittedReason TooLarge { get; } = new("too_large");
/// The referenced binary asset could not be found (e.g. a truncated log).
public static OmittedBinaryOmittedReason AssetUnavailable { get; } = new("asset_unavailable");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(OmittedBinaryOmittedReason left, OmittedBinaryOmittedReason right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(OmittedBinaryOmittedReason left, OmittedBinaryOmittedReason right) => !(left == right);
///
public override bool Equals(object? obj) => obj is OmittedBinaryOmittedReason other && Equals(other);
///
public bool Equals(OmittedBinaryOmittedReason 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 OmittedBinaryOmittedReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, OmittedBinaryOmittedReason value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OmittedBinaryOmittedReason));
}
}
}
/// Type of GitHub reference.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AttachmentGitHubReferenceType : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AttachmentGitHubReferenceType(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// GitHub issue reference.
public static AttachmentGitHubReferenceType Issue { get; } = new("issue");
/// GitHub pull request reference.
public static AttachmentGitHubReferenceType Pr { get; } = new("pr");
/// GitHub discussion reference.
public static AttachmentGitHubReferenceType Discussion { get; } = new("discussion");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AttachmentGitHubReferenceType left, AttachmentGitHubReferenceType right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AttachmentGitHubReferenceType left, AttachmentGitHubReferenceType right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AttachmentGitHubReferenceType other && Equals(other);
///
public bool Equals(AttachmentGitHubReferenceType 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 AttachmentGitHubReferenceType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AttachmentGitHubReferenceType value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AttachmentGitHubReferenceType));
}
}
}
/// How this user message was delivered to the agentic loop, relative to whether the loop was already running. This is the timing axis only; the message's origin (human vs. system/command/schedule/skill/etc.) is carried separately by `source`. A system-injected message has a delivery too — e.g. a background-task notification waking an idle agent is `idle`, the same mechanism as a human starting a fresh turn.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct UserMessageDelivery : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public UserMessageDelivery(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Delivered while the loop was idle; starts its own run immediately (a human's fresh turn, or a system notification waking an idle agent).
public static UserMessageDelivery Idle { get; } = new("idle");
/// Injected into the current in-flight run while the agent was busy (immediate mode).
public static UserMessageDelivery Steering { get; } = new("steering");
/// Enqueued while the agent was busy; processed as its own run afterward.
public static UserMessageDelivery Queued { get; } = new("queued");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(UserMessageDelivery left, UserMessageDelivery right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(UserMessageDelivery left, UserMessageDelivery right) => !(left == right);
///
public override bool Equals(object? obj) => obj is UserMessageDelivery other && Equals(other);
///
public bool Equals(UserMessageDelivery 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 UserMessageDelivery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, UserMessageDelivery value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UserMessageDelivery));
}
}
}
/// The system that produced a citation.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct CitationProvider : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public CitationProvider(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Citation produced by an Anthropic (Claude) model response.
public static CitationProvider Anthropic { get; } = new("anthropic");
/// Citation produced by an OpenAI model response.
public static CitationProvider Openai { get; } = new("openai");
/// Citation synthesized client-side by the runtime from tool output.
public static CitationProvider Client { get; } = new("client");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(CitationProvider left, CitationProvider right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(CitationProvider left, CitationProvider right) => !(left == right);
///
public override bool Equals(object? obj) => obj is CitationProvider other && Equals(other);
///
public bool Equals(CitationProvider 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 CitationProvider Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, CitationProvider value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(CitationProvider));
}
}
}
/// 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));
}
}
}
/// For HTTP 400 failures only: whether the response carried a structured CAPI error envelope (structured_error, a deterministic validation failure) or no error body (bodyless, the transient gateway/proxy signature). Absent for non-400 failures.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ModelCallFailureBadRequestKind : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ModelCallFailureBadRequestKind(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The 400 response carried no error body (transient gateway/proxy signature).
public static ModelCallFailureBadRequestKind Bodyless { get; } = new("bodyless");
/// The 400 response carried a structured CAPI error envelope (deterministic validation failure).
public static ModelCallFailureBadRequestKind StructuredError { get; } = new("structured_error");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ModelCallFailureBadRequestKind left, ModelCallFailureBadRequestKind right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ModelCallFailureBadRequestKind left, ModelCallFailureBadRequestKind right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ModelCallFailureBadRequestKind other && Equals(other);
///
public bool Equals(ModelCallFailureBadRequestKind 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 ModelCallFailureBadRequestKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ModelCallFailureBadRequestKind value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelCallFailureBadRequestKind));
}
}
}
/// 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));
}
}
}
/// Allowed values for the `ToolExecutionStartToolDescriptionMetaUIVisibility` enumeration.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ToolExecutionStartToolDescriptionMetaUIVisibility : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ToolExecutionStartToolDescriptionMetaUIVisibility(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Tool is callable by the model (LLM tool surface).
public static ToolExecutionStartToolDescriptionMetaUIVisibility Model { get; } = new("model");
/// Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool.
public static ToolExecutionStartToolDescriptionMetaUIVisibility App { get; } = new("app");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ToolExecutionStartToolDescriptionMetaUIVisibility left, ToolExecutionStartToolDescriptionMetaUIVisibility right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ToolExecutionStartToolDescriptionMetaUIVisibility left, ToolExecutionStartToolDescriptionMetaUIVisibility right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ToolExecutionStartToolDescriptionMetaUIVisibility other && Equals(other);
///
public bool Equals(ToolExecutionStartToolDescriptionMetaUIVisibility 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 ToolExecutionStartToolDescriptionMetaUIVisibility Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ToolExecutionStartToolDescriptionMetaUIVisibility value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ToolExecutionStartToolDescriptionMetaUIVisibility));
}
}
}
/// Binary result type discriminator. Use "image" for images and "resource" for other binary data.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct PersistedBinaryImageType : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public PersistedBinaryImageType(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Binary image data.
public static PersistedBinaryImageType Image { get; } = new("image");
/// Other binary resource data.
public static PersistedBinaryImageType Resource { get; } = new("resource");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(PersistedBinaryImageType left, PersistedBinaryImageType right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(PersistedBinaryImageType left, PersistedBinaryImageType right) => !(left == right);
///
public override bool Equals(object? obj) => obj is PersistedBinaryImageType other && Equals(other);
///
public bool Equals(PersistedBinaryImageType 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 PersistedBinaryImageType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, PersistedBinaryImageType value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PersistedBinaryImageType));
}
}
}
/// Binary result type discriminator. Use "image" for images and "resource" for other binary data.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct OmittedBinaryType : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public OmittedBinaryType(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Binary image data.
public static OmittedBinaryType Image { get; } = new("image");
/// Other binary resource data.
public static OmittedBinaryType Resource { get; } = new("resource");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(OmittedBinaryType left, OmittedBinaryType right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(OmittedBinaryType left, OmittedBinaryType right) => !(left == right);
///
public override bool Equals(object? obj) => obj is OmittedBinaryType other && Equals(other);
///
public bool Equals(OmittedBinaryType 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 OmittedBinaryType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, OmittedBinaryType value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OmittedBinaryType));
}
}
}
/// Binary result type discriminator. Use "image" for images and "resource" for other binary data.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct BinaryAssetReferenceType : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public BinaryAssetReferenceType(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Binary image data.
public static BinaryAssetReferenceType Image { get; } = new("image");
/// Other binary resource data.
public static BinaryAssetReferenceType Resource { get; } = new("resource");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(BinaryAssetReferenceType left, BinaryAssetReferenceType right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(BinaryAssetReferenceType left, BinaryAssetReferenceType right) => !(left == right);
///
public override bool Equals(object? obj) => obj is BinaryAssetReferenceType other && Equals(other);
///
public bool Equals(BinaryAssetReferenceType 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 BinaryAssetReferenceType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, BinaryAssetReferenceType value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(BinaryAssetReferenceType));
}
}
}
/// 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));
}
}
}
/// Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ToolExecutionCompleteToolDescriptionMetaUIVisibility : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ToolExecutionCompleteToolDescriptionMetaUIVisibility(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Tool is callable by the model (LLM tool surface).
public static ToolExecutionCompleteToolDescriptionMetaUIVisibility Model { get; } = new("model");
/// Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool.
public static ToolExecutionCompleteToolDescriptionMetaUIVisibility App { get; } = new("app");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ToolExecutionCompleteToolDescriptionMetaUIVisibility left, ToolExecutionCompleteToolDescriptionMetaUIVisibility right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ToolExecutionCompleteToolDescriptionMetaUIVisibility left, ToolExecutionCompleteToolDescriptionMetaUIVisibility right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ToolExecutionCompleteToolDescriptionMetaUIVisibility other && Equals(other);
///
public bool Equals(ToolExecutionCompleteToolDescriptionMetaUIVisibility 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 ToolExecutionCompleteToolDescriptionMetaUIVisibility Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ToolExecutionCompleteToolDescriptionMetaUIVisibility value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ToolExecutionCompleteToolDescriptionMetaUIVisibility));
}
}
}
/// What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent).
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct SkillInvokedTrigger : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public SkillInvokedTrigger(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Skill invocation requested explicitly by the user, such as via a slash command or UI affordance.
public static SkillInvokedTrigger UserInvoked { get; } = new("user-invoked");
/// Skill invocation requested by the agent.
public static SkillInvokedTrigger AgentInvoked { get; } = new("agent-invoked");
/// Skill content loaded as part of another context, such as a configured custom agent or subagent.
public static SkillInvokedTrigger ContextLoad { get; } = new("context-load");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(SkillInvokedTrigger left, SkillInvokedTrigger right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(SkillInvokedTrigger left, SkillInvokedTrigger right) => !(left == right);
///
public override bool Equals(object? obj) => obj is SkillInvokedTrigger other && Equals(other);
///
public bool Equals(SkillInvokedTrigger 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 SkillInvokedTrigger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, SkillInvokedTrigger value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SkillInvokedTrigger));
}
}
}
/// Binary asset type discriminator. Use "image" for images and "resource" otherwise.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct BinaryAssetType : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public BinaryAssetType(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Binary image data.
public static BinaryAssetType Image { get; } = new("image");
/// Other binary resource data.
public static BinaryAssetType Resource { get; } = new("resource");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(BinaryAssetType left, BinaryAssetType right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(BinaryAssetType left, BinaryAssetType right) => !(left == right);
///
public override bool Equals(object? obj) => obj is BinaryAssetType other && Equals(other);
///
public bool Equals(BinaryAssetType 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 BinaryAssetType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, BinaryAssetType value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(BinaryAssetType));
}
}
}
/// 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));
}
}
}
/// Reason the runtime is requesting host-provided MCP OAuth credentials.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct McpOauthRequestReason : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public McpOauthRequestReason(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Initial credentials are required before connecting to the MCP server.
public static McpOauthRequestReason Initial { get; } = new("initial");
/// The current host-provided credential was rejected and a replacement is requested.
public static McpOauthRequestReason Refresh { get; } = new("refresh");
/// The server requires a new host authorization flow before continuing.
public static McpOauthRequestReason Reauth { get; } = new("reauth");
/// The server requires a credential with additional scope or audience.
public static McpOauthRequestReason Upscope { get; } = new("upscope");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(McpOauthRequestReason left, McpOauthRequestReason right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(McpOauthRequestReason left, McpOauthRequestReason right) => !(left == right);
///
public override bool Equals(object? obj) => obj is McpOauthRequestReason other && Equals(other);
///
public bool Equals(McpOauthRequestReason 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 McpOauthRequestReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, McpOauthRequestReason value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpOauthRequestReason));
}
}
}
/// How the pending MCP OAuth request was completed.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct McpOauthCompletionOutcome : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public McpOauthCompletionOutcome(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The request completed with a token-backed OAuth provider.
public static McpOauthCompletionOutcome Token { get; } = new("token");
/// The request completed without an OAuth provider.
public static McpOauthCompletionOutcome Cancelled { get; } = new("cancelled");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(McpOauthCompletionOutcome left, McpOauthCompletionOutcome right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(McpOauthCompletionOutcome left, McpOauthCompletionOutcome right) => !(left == right);
///
public override bool Equals(object? obj) => obj is McpOauthCompletionOutcome other && Equals(other);
///
public bool Equals(McpOauthCompletionOutcome 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 McpOauthCompletionOutcome Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, McpOauthCompletionOutcome value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpOauthCompletionOutcome));
}
}
}
/// Why dynamic headers are being requested.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct McpHeadersRefreshRequiredReason : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public McpHeadersRefreshRequiredReason(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The transport is making its first dynamic header request for this server.
public static McpHeadersRefreshRequiredReason Startup { get; } = new("startup");
/// The previously cached dynamic headers expired.
public static McpHeadersRefreshRequiredReason TtlExpired { get; } = new("ttl-expired");
/// The server returned 401 and stale dynamic headers were invalidated.
public static McpHeadersRefreshRequiredReason AuthFailed { get; } = new("auth-failed");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(McpHeadersRefreshRequiredReason left, McpHeadersRefreshRequiredReason right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(McpHeadersRefreshRequiredReason left, McpHeadersRefreshRequiredReason right) => !(left == right);
///
public override bool Equals(object? obj) => obj is McpHeadersRefreshRequiredReason other && Equals(other);
///
public bool Equals(McpHeadersRefreshRequiredReason 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 McpHeadersRefreshRequiredReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, McpHeadersRefreshRequiredReason value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpHeadersRefreshRequiredReason));
}
}
}
/// How the pending MCP headers refresh request resolved.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct McpHeadersRefreshCompletedOutcome : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public McpHeadersRefreshCompletedOutcome(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The host supplied dynamic headers.
public static McpHeadersRefreshCompletedOutcome Headers { get; } = new("headers");
/// The host responded with no dynamic headers.
public static McpHeadersRefreshCompletedOutcome None { get; } = new("none");
/// No response arrived within the bounded window.
public static McpHeadersRefreshCompletedOutcome Timeout { get; } = new("timeout");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(McpHeadersRefreshCompletedOutcome left, McpHeadersRefreshCompletedOutcome right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(McpHeadersRefreshCompletedOutcome left, McpHeadersRefreshCompletedOutcome right) => !(left == right);
///
public override bool Equals(object? obj) => obj is McpHeadersRefreshCompletedOutcome other && Equals(other);
///
public bool Equals(McpHeadersRefreshCompletedOutcome 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 McpHeadersRefreshCompletedOutcome Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, McpHeadersRefreshCompletedOutcome value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpHeadersRefreshCompletedOutcome));
}
}
}
/// 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));
}
}
}
/// User action selected for an exhausted session limit.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct SessionLimitsExhaustedResponseAction : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public SessionLimitsExhaustedResponseAction(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Increase the current max by an exact AI Credits amount.
public static SessionLimitsExhaustedResponseAction Add { get; } = new("add");
/// Set a new absolute max AI Credits value.
public static SessionLimitsExhaustedResponseAction Set { get; } = new("set");
/// Remove the current session limit.
public static SessionLimitsExhaustedResponseAction Unset { get; } = new("unset");
/// Leave the limit unchanged and cancel the blocked model request.
public static SessionLimitsExhaustedResponseAction Cancel { get; } = new("cancel");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(SessionLimitsExhaustedResponseAction left, SessionLimitsExhaustedResponseAction right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(SessionLimitsExhaustedResponseAction left, SessionLimitsExhaustedResponseAction right) => !(left == right);
///
public override bool Equals(object? obj) => obj is SessionLimitsExhaustedResponseAction other && Equals(other);
///
public bool Equals(SessionLimitsExhaustedResponseAction 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 SessionLimitsExhaustedResponseAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, SessionLimitsExhaustedResponseAction value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionLimitsExhaustedResponseAction));
}
}
}
/// 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));
}
}
}
/// Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server).
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct McpServerTransport : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public McpServerTransport(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Server communicates over stdio with a local child process.
public static McpServerTransport Stdio { get; } = new("stdio");
/// Server communicates over streamable HTTP.
public static McpServerTransport Http { get; } = new("http");
/// Server communicates over Server-Sent Events (deprecated).
public static McpServerTransport Sse { get; } = new("sse");
/// Server is backed by an in-memory runtime implementation.
public static McpServerTransport Memory { get; } = new("memory");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(McpServerTransport left, McpServerTransport right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(McpServerTransport left, McpServerTransport right) => !(left == right);
///
public override bool Equals(object? obj) => obj is McpServerTransport other && Equals(other);
///
public bool Equals(McpServerTransport 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 McpServerTransport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, McpServerTransport value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpServerTransport));
}
}
}
/// 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");
/// Extension contributed by an installed plugin.
public static ExtensionsLoadedExtensionSource Plugin { get; } = new("plugin");
/// Extension discovered from the current session's state directory.
public static ExtensionsLoadedExtensionSource Session { get; } = new("session");
/// 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(AssistantIdleData))]
[JsonSerializable(typeof(AssistantIdleEvent))]
[JsonSerializable(typeof(AssistantIntentData))]
[JsonSerializable(typeof(AssistantIntentEvent))]
[JsonSerializable(typeof(AssistantMessageData))]
[JsonSerializable(typeof(AssistantMessageDeltaData))]
[JsonSerializable(typeof(AssistantMessageDeltaEvent))]
[JsonSerializable(typeof(AssistantMessageEvent))]
[JsonSerializable(typeof(AssistantMessageServerTools))]
[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(Attachment))]
[JsonSerializable(typeof(AttachmentBlob))]
[JsonSerializable(typeof(AttachmentDirectory))]
[JsonSerializable(typeof(AttachmentExtensionContext))]
[JsonSerializable(typeof(AttachmentFile))]
[JsonSerializable(typeof(AttachmentFileLineRange))]
[JsonSerializable(typeof(AttachmentGitHubActionsJob))]
[JsonSerializable(typeof(AttachmentGitHubCommit))]
[JsonSerializable(typeof(AttachmentGitHubFile))]
[JsonSerializable(typeof(AttachmentGitHubFileDiff))]
[JsonSerializable(typeof(AttachmentGitHubFileDiffSide))]
[JsonSerializable(typeof(AttachmentGitHubReference))]
[JsonSerializable(typeof(AttachmentGitHubRelease))]
[JsonSerializable(typeof(AttachmentGitHubRepository))]
[JsonSerializable(typeof(AttachmentGitHubSnippet))]
[JsonSerializable(typeof(AttachmentGitHubTreeComparison))]
[JsonSerializable(typeof(AttachmentGitHubTreeComparisonSide))]
[JsonSerializable(typeof(AttachmentGitHubUrl))]
[JsonSerializable(typeof(AttachmentSelection))]
[JsonSerializable(typeof(AttachmentSelectionDetails))]
[JsonSerializable(typeof(AttachmentSelectionDetailsEnd))]
[JsonSerializable(typeof(AttachmentSelectionDetailsStart))]
[JsonSerializable(typeof(AutoModeSwitchCompletedData))]
[JsonSerializable(typeof(AutoModeSwitchCompletedEvent))]
[JsonSerializable(typeof(AutoModeSwitchRequestedData))]
[JsonSerializable(typeof(AutoModeSwitchRequestedEvent))]
[JsonSerializable(typeof(BinaryAssetReference))]
[JsonSerializable(typeof(CanvasRegistryChangedCanvas))]
[JsonSerializable(typeof(CanvasRegistryChangedCanvasAction))]
[JsonSerializable(typeof(CapabilitiesChangedData))]
[JsonSerializable(typeof(CapabilitiesChangedEvent))]
[JsonSerializable(typeof(CapabilitiesChangedUI))]
[JsonSerializable(typeof(CitableSource))]
[JsonSerializable(typeof(CitationLocation))]
[JsonSerializable(typeof(CitationLocationBlock))]
[JsonSerializable(typeof(CitationLocationChar))]
[JsonSerializable(typeof(CitationLocationPage))]
[JsonSerializable(typeof(CitationReference))]
[JsonSerializable(typeof(CitationSource))]
[JsonSerializable(typeof(CitationSpan))]
[JsonSerializable(typeof(Citations))]
[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(GitHubRepoRef))]
[JsonSerializable(typeof(HandoffRepository))]
[JsonSerializable(typeof(HookEndData))]
[JsonSerializable(typeof(HookEndError))]
[JsonSerializable(typeof(HookEndEvent))]
[JsonSerializable(typeof(HookProgressData))]
[JsonSerializable(typeof(HookProgressEvent))]
[JsonSerializable(typeof(HookStartData))]
[JsonSerializable(typeof(HookStartEvent))]
[JsonSerializable(typeof(McpAppToolCallCompleteData))]
[JsonSerializable(typeof(McpAppToolCallCompleteError))]
[JsonSerializable(typeof(McpAppToolCallCompleteEvent))]
[JsonSerializable(typeof(McpAppToolCallCompleteToolMeta))]
[JsonSerializable(typeof(McpAppToolCallCompleteToolMetaUI))]
[JsonSerializable(typeof(McpHeadersRefreshCompletedData))]
[JsonSerializable(typeof(McpHeadersRefreshCompletedEvent))]
[JsonSerializable(typeof(McpHeadersRefreshRequiredData))]
[JsonSerializable(typeof(McpHeadersRefreshRequiredEvent))]
[JsonSerializable(typeof(McpOauthCompletedData))]
[JsonSerializable(typeof(McpOauthCompletedEvent))]
[JsonSerializable(typeof(McpOauthRequiredData))]
[JsonSerializable(typeof(McpOauthRequiredEvent))]
[JsonSerializable(typeof(McpOauthRequiredStaticClientConfig))]
[JsonSerializable(typeof(McpOauthWWWAuthenticateParams))]
[JsonSerializable(typeof(McpServersLoadedServer))]
[JsonSerializable(typeof(ModelCallFailureData))]
[JsonSerializable(typeof(ModelCallFailureEvent))]
[JsonSerializable(typeof(ModelCallFailureRequestFingerprint))]
[JsonSerializable(typeof(OmittedBinaryResult))]
[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(PersistedBinaryImage))]
[JsonSerializable(typeof(PersistedBinaryResult))]
[JsonSerializable(typeof(SamplingCompletedData))]
[JsonSerializable(typeof(SamplingCompletedEvent))]
[JsonSerializable(typeof(SamplingRequestedData))]
[JsonSerializable(typeof(SamplingRequestedEvent))]
[JsonSerializable(typeof(SessionAutopilotObjectiveChangedData))]
[JsonSerializable(typeof(SessionAutopilotObjectiveChangedEvent))]
[JsonSerializable(typeof(SessionBackgroundTasksChangedData))]
[JsonSerializable(typeof(SessionBackgroundTasksChangedEvent))]
[JsonSerializable(typeof(SessionBinaryAssetData))]
[JsonSerializable(typeof(SessionBinaryAssetEvent))]
[JsonSerializable(typeof(SessionCanvasClosedData))]
[JsonSerializable(typeof(SessionCanvasClosedEvent))]
[JsonSerializable(typeof(SessionCanvasOpenedData))]
[JsonSerializable(typeof(SessionCanvasOpenedEvent))]
[JsonSerializable(typeof(SessionCanvasRecordedData))]
[JsonSerializable(typeof(SessionCanvasRecordedEvent))]
[JsonSerializable(typeof(SessionCanvasRegistryChangedData))]
[JsonSerializable(typeof(SessionCanvasRegistryChangedEvent))]
[JsonSerializable(typeof(SessionCanvasRemovedData))]
[JsonSerializable(typeof(SessionCanvasRemovedEvent))]
[JsonSerializable(typeof(SessionCanvasUnavailableData))]
[JsonSerializable(typeof(SessionCanvasUnavailableEvent))]
[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(SessionExtensionsAttachmentsPushedData))]
[JsonSerializable(typeof(SessionExtensionsAttachmentsPushedEvent))]
[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(SessionLimitsConfig))]
[JsonSerializable(typeof(SessionLimitsExhaustedCompletedData))]
[JsonSerializable(typeof(SessionLimitsExhaustedCompletedEvent))]
[JsonSerializable(typeof(SessionLimitsExhaustedRequestedData))]
[JsonSerializable(typeof(SessionLimitsExhaustedRequestedEvent))]
[JsonSerializable(typeof(SessionLimitsExhaustedResponse))]
[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(SessionPermissionsChangedData))]
[JsonSerializable(typeof(SessionPermissionsChangedEvent))]
[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(SessionScheduleRearmedData))]
[JsonSerializable(typeof(SessionScheduleRearmedEvent))]
[JsonSerializable(typeof(SessionSessionLimitsChangedData))]
[JsonSerializable(typeof(SessionSessionLimitsChangedEvent))]
[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(SessionTodosChangedData))]
[JsonSerializable(typeof(SessionTodosChangedEvent))]
[JsonSerializable(typeof(SessionToolsUpdatedData))]
[JsonSerializable(typeof(SessionToolsUpdatedEvent))]
[JsonSerializable(typeof(SessionTruncationData))]
[JsonSerializable(typeof(SessionTruncationEvent))]
[JsonSerializable(typeof(SessionUsageCheckpointData))]
[JsonSerializable(typeof(SessionUsageCheckpointEvent))]
[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(ToolExecutionCompleteContentShellExit))]
[JsonSerializable(typeof(ToolExecutionCompleteContentTerminal))]
[JsonSerializable(typeof(ToolExecutionCompleteContentText))]
[JsonSerializable(typeof(ToolExecutionCompleteData))]
[JsonSerializable(typeof(ToolExecutionCompleteError))]
[JsonSerializable(typeof(ToolExecutionCompleteEvent))]
[JsonSerializable(typeof(ToolExecutionCompleteResult))]
[JsonSerializable(typeof(ToolExecutionCompleteToolDescription))]
[JsonSerializable(typeof(ToolExecutionCompleteToolDescriptionMeta))]
[JsonSerializable(typeof(ToolExecutionCompleteToolDescriptionMetaUI))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResource))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMeta))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUI))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUICsp))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissions))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissionsCamera))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation))]
[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone))]
[JsonSerializable(typeof(ToolExecutionPartialResultData))]
[JsonSerializable(typeof(ToolExecutionPartialResultEvent))]
[JsonSerializable(typeof(ToolExecutionProgressData))]
[JsonSerializable(typeof(ToolExecutionProgressEvent))]
[JsonSerializable(typeof(ToolExecutionStartData))]
[JsonSerializable(typeof(ToolExecutionStartEvent))]
[JsonSerializable(typeof(ToolExecutionStartShellToolInfo))]
[JsonSerializable(typeof(ToolExecutionStartToolDescription))]
[JsonSerializable(typeof(ToolExecutionStartToolDescriptionMeta))]
[JsonSerializable(typeof(ToolExecutionStartToolDescriptionMetaUI))]
[JsonSerializable(typeof(ToolUserRequestedData))]
[JsonSerializable(typeof(ToolUserRequestedEvent))]
[JsonSerializable(typeof(UserInputCompletedData))]
[JsonSerializable(typeof(UserInputCompletedEvent))]
[JsonSerializable(typeof(UserInputRequestedData))]
[JsonSerializable(typeof(UserInputRequestedEvent))]
[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;