/*---------------------------------------------------------------------------------------------
* 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(AgentInterruptedEvent), "agent.interrupted")]
[JsonDerivedType(typeof(AssistantFusionPhaseActivityEvent), "assistant.fusion_phase_activity")]
[JsonDerivedType(typeof(AssistantFusionPhaseCompletedEvent), "assistant.fusion_phase_completed")]
[JsonDerivedType(typeof(AssistantFusionPhaseFailedEvent), "assistant.fusion_phase_failed")]
[JsonDerivedType(typeof(AssistantFusionPhaseStartedEvent), "assistant.fusion_phase_started")]
[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(AssistantServerToolProgressEvent), "assistant.server_tool_progress")]
[JsonDerivedType(typeof(AssistantStreamingDeltaEvent), "assistant.streaming_delta")]
[JsonDerivedType(typeof(AssistantToolCallDeltaEvent), "assistant.tool_call_delta")]
[JsonDerivedType(typeof(AssistantTurnEndEvent), "assistant.turn_end")]
[JsonDerivedType(typeof(AssistantTurnRetryEvent), "assistant.turn_retry")]
[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(FactoryRunSettledEvent), "factory.run_settled")]
[JsonDerivedType(typeof(FactoryRunStartedEvent), "factory.run_started")]
[JsonDerivedType(typeof(FactoryRunUpdatedEvent), "factory.run_updated")]
[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(McpPromptsListChangedEvent), "mcp.prompts.list_changed")]
[JsonDerivedType(typeof(McpResourcesListChangedEvent), "mcp.resources.list_changed")]
[JsonDerivedType(typeof(McpToolsListChangedEvent), "mcp.tools.list_changed")]
[JsonDerivedType(typeof(ModelCallFailureEvent), "model.call_failure")]
[JsonDerivedType(typeof(ModelCallFinishedEvent), "model.call_finished")]
[JsonDerivedType(typeof(ModelCallStartEvent), "model.call_start")]
[JsonDerivedType(typeof(PendingMessagesModifiedEvent), "pending_messages.modified")]
[JsonDerivedType(typeof(PermissionCompletedEvent), "permission.completed")]
[JsonDerivedType(typeof(PermissionRequestedEvent), "permission.requested")]
[JsonDerivedType(typeof(PromptCacheBreakEvent), "prompt_cache_break")]
[JsonDerivedType(typeof(SamplingCompletedEvent), "sampling.completed")]
[JsonDerivedType(typeof(SamplingRequestedEvent), "sampling.requested")]
[JsonDerivedType(typeof(SandboxDecisionEvent), "sandbox.decision")]
[JsonDerivedType(typeof(SessionLimitsExhaustedCompletedEvent), "session_limits_exhausted.completed")]
[JsonDerivedType(typeof(SessionLimitsExhaustedRequestedEvent), "session_limits_exhausted.requested")]
[JsonDerivedType(typeof(SessionAutoModeResolvedEvent), "session.auto_mode_resolved")]
[JsonDerivedType(typeof(SessionAutoTierSwitchFailedEvent), "session.auto_tier_switch_failed")]
[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(SessionCompletionReceiptEvent), "session.completion_receipt")]
[JsonDerivedType(typeof(SessionContextChangedEvent), "session.context_changed")]
[JsonDerivedType(typeof(SessionContextClearedEvent), "session.context_cleared")]
[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(SessionFusionCompletedEvent), "session.fusion_completed")]
[JsonDerivedType(typeof(SessionFusionResolvedEvent), "session.fusion_resolved")]
[JsonDerivedType(typeof(SessionFusionRouteFailedEvent), "session.fusion_route_failed")]
[JsonDerivedType(typeof(SessionFusionRouteStartedEvent), "session.fusion_route_started")]
[JsonDerivedType(typeof(SessionHandoffEvent), "session.handoff")]
[JsonDerivedType(typeof(SessionIdleEvent), "session.idle")]
[JsonDerivedType(typeof(SessionInfoEvent), "session.info")]
[JsonDerivedType(typeof(SessionManagedSettingsEnforcedEvent), "session.managed_settings_enforced")]
[JsonDerivedType(typeof(SessionManagedSettingsResolvedEvent), "session.managed_settings_resolved")]
[JsonDerivedType(typeof(SessionMcpServerNeedsReconnectEvent), "session.mcp_server_needs_reconnect")]
[JsonDerivedType(typeof(SessionMcpServerRemovedEvent), "session.mcp_server_removed")]
[JsonDerivedType(typeof(SessionMcpServerStatusChangedEvent), "session.mcp_server_status_changed")]
[JsonDerivedType(typeof(SessionMcpServersLoadedEvent), "session.mcp_servers_loaded")]
[JsonDerivedType(typeof(SessionModeChangedEvent), "session.mode_changed")]
[JsonDerivedType(typeof(SessionModeNoticeDeliveredEvent), "session.mode_notice_delivered")]
[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(SubagentConfiguredEvent), "subagent.configured")]
[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(ToolSearchActivatedEvent), "tool_search.activated")]
[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(UiEphemeralQueryEvent), "ui.ephemeral_query")]
[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; }
}
/// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume.
/// Represents the session.auto_tier_switch_failed event.
public sealed partial class SessionAutoTierSwitchFailedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.auto_tier_switch_failed";
/// The session.auto_tier_switch_failed event payload.
[JsonPropertyName("data")]
public required SessionAutoTierSwitchFailedData 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; }
}
/// Records that a mode transition notice reached the model so cache-stable mode tools can remain offered across resume.
/// Represents the session.mode_notice_delivered event.
public sealed partial class SessionModeNoticeDeliveredEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.mode_notice_delivered";
/// The session.mode_notice_delivered event payload.
[JsonPropertyName("data")]
public required SessionModeNoticeDeliveredData 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; }
}
/// Permission-mode transition details.
/// Represents the session.permissions_changed event.
[Experimental(Diagnostics.Experimental)]
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-cleared details emitted when the host clears the conversation (the session.history.clearContext RPC / Session.clearContextMessages).
/// Represents the session.context_cleared event.
public sealed partial class SessionContextClearedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.context_cleared";
/// The session.context_cleared event payload.
[JsonPropertyName("data")]
public required SessionContextClearedData 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; }
}
/// Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted.
/// Represents the session.completion_receipt event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCompletionReceiptEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.completion_receipt";
/// The session.completion_receipt event payload.
[JsonPropertyName("data")]
public required SessionCompletionReceiptData Data { get; set; }
}
/// Experimental transient signal that HydraFusion routing has started for an eligible turn.
/// Represents the session.fusion_route_started event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionFusionRouteStartedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.fusion_route_started";
/// The session.fusion_route_started event payload.
[JsonPropertyName("data")]
public required SessionFusionRouteStartedData Data { get; set; }
}
/// Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn.
/// Represents the session.fusion_route_failed event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionFusionRouteFailedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.fusion_route_failed";
/// The session.fusion_route_failed event payload.
[JsonPropertyName("data")]
public required SessionFusionRouteFailedData Data { get; set; }
}
/// Experimental durable validated HydraFusion route and turn policy.
/// Represents the session.fusion_resolved event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionFusionResolvedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.fusion_resolved";
/// The session.fusion_resolved event payload.
[JsonPropertyName("data")]
public required SessionFusionResolvedData Data { get; set; }
}
/// Experimental durable aggregate outcome of a HydraFusion turn.
/// Represents the session.fusion_completed event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionFusionCompletedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.fusion_completed";
/// The session.fusion_completed event payload.
[JsonPropertyName("data")]
public required SessionFusionCompletedData Data { get; set; }
}
/// Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs.
/// 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; }
}
/// Metadata for an additional model inference attempt within an existing assistant turn.
/// Represents the assistant.turn_retry event.
public sealed partial class AssistantTurnRetryEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "assistant.turn_retry";
/// The assistant.turn_retry event payload.
[JsonPropertyName("data")]
public required AssistantTurnRetryData Data { get; set; }
}
/// Metadata for work the user interrupted while the agent was running.
/// Represents the agent.interrupted event.
public sealed partial class AgentInterruptedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "agent.interrupted";
/// The agent.interrupted event payload.
[JsonPropertyName("data")]
public required AgentInterruptedData 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; }
}
/// Experimental transient HydraFusion phase/model/role signal.
/// Represents the assistant.fusion_phase_started event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantFusionPhaseStartedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "assistant.fusion_phase_started";
/// The assistant.fusion_phase_started event payload.
[JsonPropertyName("data")]
public required AssistantFusionPhaseStartedData Data { get; set; }
}
/// Experimental content-safe activity signal for a running HydraFusion phase.
/// Represents the assistant.fusion_phase_activity event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantFusionPhaseActivityEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "assistant.fusion_phase_activity";
/// The assistant.fusion_phase_activity event payload.
[JsonPropertyName("data")]
public required AssistantFusionPhaseActivityData Data { get; set; }
}
/// Experimental durable HydraFusion phase output and lossless replay checkpoint.
/// Represents the assistant.fusion_phase_completed event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantFusionPhaseCompletedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "assistant.fusion_phase_completed";
/// The assistant.fusion_phase_completed event payload.
[JsonPropertyName("data")]
public required AssistantFusionPhaseCompletedData Data { get; set; }
}
/// Experimental durable typed HydraFusion phase failure and degradation transition.
/// Represents the assistant.fusion_phase_failed event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantFusionPhaseFailedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "assistant.fusion_phase_failed";
/// The assistant.fusion_phase_failed event payload.
[JsonPropertyName("data")]
public required AssistantFusionPhaseFailedData Data { get; set; }
}
/// Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message.
/// Represents the assistant.server_tool_progress event.
public sealed partial class AssistantServerToolProgressEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "assistant.server_tool_progress";
/// The assistant.server_tool_progress event payload.
[JsonPropertyName("data")]
public required AssistantServerToolProgressData 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 tool-call input delta for incremental tool-call updates.
/// Represents the assistant.tool_call_delta event.
public sealed partial class AssistantToolCallDeltaEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "assistant.tool_call_delta";
/// The assistant.tool_call_delta event payload.
[JsonPropertyName("data")]
public required AssistantToolCallDeltaData 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; }
}
/// A detected loss of a previously cached prompt prefix.
/// Represents the prompt_cache_break event.
public sealed partial class PromptCacheBreakEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "prompt_cache_break";
/// The prompt_cache_break event payload.
[JsonPropertyName("data")]
public required PromptCacheBreakData 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; }
}
/// Final lifecycle outcome for one logical model dispatch. A logical dispatch may include internal reconnect or fallback work, so event count is not provider HTTP-request count.
/// Represents the model.call_finished event.
public sealed partial class ModelCallFinishedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "model.call_finished";
/// The model.call_finished event payload.
[JsonPropertyName("data")]
public required ModelCallFinishedData Data { get; set; }
}
/// Model API dispatch metadata for internal telemetry.
/// Represents the model.call_start event.
public sealed partial class ModelCallStartEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "model.call_start";
/// The model.call_start event payload.
[JsonPropertyName("data")]
public required ModelCallStartData 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; }
}
/// Persisted generic client-side tool activations restored when a session resumes.
/// Represents the tool_search.activated event.
public sealed partial class ToolSearchActivatedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "tool_search.activated";
/// The tool_search.activated event payload.
[JsonPropertyName("data")]
public required ToolSearchActivatedData 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; }
}
/// Payload of `sandbox.decision`, a bounded governance record of what the process sandbox was configured to do and whether it took effect. Discriminated by `kind`.
/// Represents the sandbox.decision event.
public sealed partial class SandboxDecisionEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "sandbox.decision";
/// The sandbox.decision event payload.
[JsonPropertyName("data")]
public required SandboxDecisionData 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; }
}
/// Resolved runtime configuration for a configured sub-agent.
/// Represents the subagent.configured event.
public sealed partial class SubagentConfiguredEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "subagent.configured";
/// The subagent.configured event payload.
[JsonPropertyName("data")]
public required SubagentConfiguredData 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; }
}
/// Ordered output and terminal state for a transient query that does not modify conversation history.
/// Represents the ui.ephemeral_query event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class UiEphemeralQueryEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "ui.ephemeral_query";
/// The ui.ephemeral_query event payload.
[JsonPropertyName("data")]
public required UiEphemeralQueryData 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; }
}
/// Auto Intent resolution: the concrete model the session settled on for the first prompt of an auto-mode session, and why. Lets SDK clients render the chosen model and the full reason it was picked. The core selection fields (chosenModel/reasoningBucket/categoryScores) are stable; the routing-analytics fields (predictedLabel/confidence/candidateModels) mirror the upstream intent service and may evolve, hence the event's experimental stability.
/// Represents the session.auto_mode_resolved event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionAutoModeResolvedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.auto_mode_resolved";
/// The session.auto_mode_resolved event payload.
[JsonPropertyName("data")]
public required SessionAutoModeResolvedData Data { get; set; }
}
/// Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes.
/// Represents the session.managed_settings_resolved event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionManagedSettingsResolvedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.managed_settings_resolved";
/// The session.managed_settings_resolved event payload.
[JsonPropertyName("data")]
public required SessionManagedSettingsResolvedData Data { get; set; }
}
/// Runtime enforcement of enterprise managed settings: fires when the session blocks or caps a runtime action because enterprise policy governs it, so SDK clients can explain *why* an action was governed. Unlike `session.managed_settings_resolved` (which reports *what* is managed), this reports a concrete governed action — e.g. a user or host tried to turn on a bypass-permissions escalation while policy disables it. Emitted live (not persisted to the session event log) on user/host-initiated attempts only, never for silent policy application. Marked experimental while the managed-settings surface stabilizes.
/// Represents the session.managed_settings_enforced event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionManagedSettingsEnforcedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.managed_settings_enforced";
/// The session.managed_settings_enforced event payload.
[JsonPropertyName("data")]
public required SessionManagedSettingsEnforcedData 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; }
}
/// Payload of `session.tools_updated` identifying the model whose resolved tools were updated.
/// 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; }
}
/// Empty payload for `session.background_tasks_changed`, indicating background task state changed.
/// 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; }
}
/// Ephemeral invalidation signal for a changed factory run.
/// Represents the factory.run_updated event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FactoryRunUpdatedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "factory.run_updated";
/// The factory.run_updated event payload.
[JsonPropertyName("data")]
public required FactoryRunUpdatedData Data { get; set; }
}
/// Ephemeral signal that a factory run attempt began executing.
/// Represents the factory.run_started event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FactoryRunStartedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "factory.run_started";
/// The factory.run_started event payload.
[JsonPropertyName("data")]
public required FactoryRunStartedData Data { get; set; }
}
/// Ephemeral signal that a factory run reached a terminal status.
/// Represents the factory.run_settled event.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FactoryRunSettledEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "factory.run_settled";
/// The factory.run_settled event payload.
[JsonPropertyName("data")]
public required FactoryRunSettledData Data { get; set; }
}
/// Payload of `session.skills_loaded` listing resolved skill metadata.
/// 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; }
}
/// Payload of `session.custom_agents_updated` with loaded custom agents plus non-fatal warnings and fatal errors.
/// 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; }
}
/// Payload of `session.mcp_servers_loaded` listing MCP server status summaries.
/// 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; }
}
/// Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error.
/// 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; }
}
/// Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs.
/// Represents the session.mcp_server_removed event.
public sealed partial class SessionMcpServerRemovedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.mcp_server_removed";
/// The session.mcp_server_removed event payload.
[JsonPropertyName("data")]
public required SessionMcpServerRemovedData Data { get; set; }
}
/// Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established.
/// Represents the session.mcp_server_needs_reconnect event.
public sealed partial class SessionMcpServerNeedsReconnectEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "session.mcp_server_needs_reconnect";
/// The session.mcp_server_needs_reconnect event payload.
[JsonPropertyName("data")]
public required SessionMcpServerNeedsReconnectData Data { get; set; }
}
/// Payload identifying the MCP server associated with a list change.
/// Represents the mcp.tools.list_changed event.
public sealed partial class McpToolsListChangedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "mcp.tools.list_changed";
/// The mcp.tools.list_changed event payload.
[JsonPropertyName("data")]
public required McpToolsListChangedData Data { get; set; }
}
/// Payload identifying the MCP server associated with a list change.
/// Represents the mcp.resources.list_changed event.
public sealed partial class McpResourcesListChangedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "mcp.resources.list_changed";
/// The mcp.resources.list_changed event payload.
[JsonPropertyName("data")]
public required McpResourcesListChangedData Data { get; set; }
}
/// Payload identifying the MCP server associated with a list change.
/// Represents the mcp.prompts.list_changed event.
public sealed partial class McpPromptsListChangedEvent : SessionEvent
{
///
[JsonIgnore]
public override string Type => "mcp.prompts.list_changed";
/// The mcp.prompts.list_changed event payload.
[JsonPropertyName("data")]
public required McpPromptsListChangedData Data { get; set; }
}
/// Payload of `session.extensions_loaded` listing discovered extensions and their statuses.
/// 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; }
}
/// Payload of `session.canvas.opened` with canvas instance and provider IDs plus optional icon, title, status, URL, and input.
/// 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; }
}
/// Payload of `session.canvas.registry_changed` listing the canvas declarations currently available.
/// 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; }
}
/// Payload of `session.canvas.closed` with the closed canvas instance ID, provider ID, and canvas ID.
/// 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; }
}
/// Payload of `session.extensions.attachments_pushed` with extension-contributed attachments for the next send.
/// 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; }
/// Auto routing preference selected at session creation time.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("autoTier")]
public AutoTier? AutoTier { 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; }
/// Per-session GitHub MCP override persisted for cold resume.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("githubMcpToolConfig")]
public GitHubMcpToolConfig? GitHubMcpToolConfig { 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; }
/// Output verbosity level used for model calls, if applicable (e.g. "low", "medium", "high").
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("verbosity")]
public Verbosity? Verbosity { 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; }
/// Auto routing preference active at resume time.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("autoTier")]
public AutoTier? AutoTier { 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 or omitted, pending work is normally marked as interrupted unless the resume passively joined live work owned by another client; sessionWasActive distinguishes that case.
[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 passively joined a session that already had live work running in the runtime - an agent turn, a native queue run, a queued resume continuation, or an in-flight send (for example, an extension joining a session another client was actively driving). False (or omitted) when the session had no live work or when the resume explicitly abandoned pending work, including cold resumes and suspended sessions that remain resident in memory.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("sessionWasActive")]
public bool? SessionWasActive { get; set; }
/// Output verbosity level used for model calls, if applicable (e.g. "low", "medium", "high").
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("verbosity")]
public Verbosity? Verbosity { 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; }
/// What the user must do to recover, when the runtime knows of an action. The `message` never names a client affordance, so a client that offers one — a slash command, a settings pane, a link — renders it from this value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("remediation")]
public RemediationAction? Remediation { 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; }
/// The session mode the agent was operating in when it went idle, when the mode is known. Lets turn-scoped consumers distinguish an autopilot continuation boundary (where the agent keeps working after this idle) from a genuine turn completion.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("mode")]
public SessionMode? Mode { 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; }
/// Who created the schedule (`user` or `model`). Persisted so a resumed session keeps gating non-user schedules from firing skills that opted out of model invocation. Absent on entries created before this field existed; a missing origin fails closed (treated the same as a non-user origin), so such a schedule may not resolve a `disable-model-invocation` skill.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("origin")]
public ScheduleOrigin? Origin { 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; }
/// What the user must do to recover, when the runtime knows of an action. The `message` never names a client affordance, so a client that offers one — a slash command, a settings pane, a link — renders it from this value.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("remediation")]
public RemediationAction? Remediation { 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
{
/// Committed Auto preference after the model configuration change, when applicable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("autoTier")]
public AutoTier? AutoTier { get; set; }
/// Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. 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; }
/// Previously committed Auto preference, when one was explicitly selected.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("previousAutoTier")]
public AutoTier? PreviousAutoTier { 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; }
/// Output verbosity level before the model change, if applicable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("previousVerbosity")]
public Verbosity? PreviousVerbosity { 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; }
/// Origin of the effective model change, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("source")]
public ModelChangeSource? Source { get; set; }
/// Output verbosity level after the model change, if applicable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("verbosity")]
public Verbosity? Verbosity { get; set; }
}
/// A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume.
public sealed partial class SessionAutoTierSwitchFailedData
{
/// Auto preference that remains effective after the failed request.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("effectiveAutoTier")]
public AutoTier? EffectiveAutoTier { get; set; }
/// Low-cardinality failure outcome reported by Auto resolution.
[JsonPropertyName("reason")]
public required AutoTierSwitchFailureReason Reason { get; set; }
/// Auto preference that failed to activate, or null when returning to provider-default routing failed.
[JsonPropertyName("requestedAutoTier")]
public AutoTier? RequestedAutoTier { 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; }
}
/// Records that a mode transition notice reached the model so cache-stable mode tools can remain offered across resume.
public sealed partial class SessionModeNoticeDeliveredData
{
/// Model-visible transition notice persisted for a mid-turn delivery.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("content")]
public string? Content { get; set; }
/// Mode established by the delivered transition notice.
[JsonPropertyName("mode")]
public required SessionMode Mode { 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; }
}
/// Permission-mode transition details.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionPermissionsChangedData
{
/// Explicit LLM judge model override used by assisted mode; omitted when the provider default applies.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApprovalModel")]
public string? AssistedApprovalModel { get; set; }
/// Permission mode after the change.
[Experimental(Diagnostics.Experimental)]
[JsonPropertyName("mode")]
public required PermissionMode Mode { get; set; }
/// Permission mode before the change.
[Experimental(Diagnostics.Experimental)]
[JsonPropertyName("previousMode")]
public required PermissionMode PreviousMode { get; set; }
}
/// Plan file operation details indicating what changed.
public sealed partial class SessionPlanChangedData
{
/// The type of operation performed on the plan file.
[JsonPropertyName("operation")]
public required PlanChangedOperation Operation { get; set; }
}
/// 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
{
/// Per-agent usage breakdown, keyed by agent instance identifier. The main conversation uses the stable key `main`.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("agentMetrics")]
public IDictionary? AgentMetrics { get; set; }
/// 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
{
/// Internal per-model prompt-cache state used to restore expiration tracking on resume.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("modelCacheState")]
internal UsageCheckpointModelCacheState[]? ModelCacheState { get; set; }
/// Internal per-conversation prompt-cache-break detector baselines restored on resume.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("promptCacheBreakState")]
internal JsonElement[]? PromptCacheBreakState { get; set; }
/// 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; }
/// Set on the immediate preliminary event of a working-directory change, before the git context is resolved. A settled follow-up event (enriched with git context, or cwd-only for a non-repository) is always emitted afterward, so observers may defer to it. Absent on standalone/final events (e.g. relay context changes).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("pendingGitContext")]
public bool? PendingGitContext { 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-cleared details emitted when the host clears the conversation (the session.history.clearContext RPC / Session.clearContextMessages).
public sealed partial class SessionContextClearedData
{
/// Optional initial message set after clearing.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("initialMessage")]
public string? InitialMessage { get; set; }
/// Number of conversation messages that were cleared.
[JsonPropertyName("messagesCleared")]
public required long MessagesCleared { 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; }
/// Total context tokens (system + conversation + tool definitions) at compaction start, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("currentTokens")]
public long? CurrentTokens { get; set; }
/// Model identifier used for compaction, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Token count from system message(s) at compaction start.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("systemTokens")]
public long? SystemTokens { get; set; }
/// Model context window token limit the compaction is targeting, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("tokenLimit")]
public long? TokenLimit { get; set; }
/// Token count from tool definitions at compaction start.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolDefinitionsTokens")]
public long? ToolDefinitionsTokens { get; set; }
/// What initiated this compaction, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("trigger")]
public CompactionTrigger? Trigger { get; set; }
}
/// Conversation compaction results including success status, metrics, and optional error details.
public sealed partial class SessionCompactionCompleteData
{
/// Canonical model identifier used for model-specific behavior when replaying compaction.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("behaviorModelId")]
public string? BehaviorModelId { get; set; }
/// 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; }
/// Model context window token limit the compaction was targeting, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("tokenLimit")]
public long? TokenLimit { 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; }
/// What initiated this compaction, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("trigger")]
public CompactionTrigger? Trigger { get; set; }
}
/// Task completion notification with summary from the agent.
public sealed partial class SessionTaskCompleteData
{
/// Active autopilot objective ID evaluated by the completion reviewer.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("objectiveId")]
public long? ObjectiveId { get; set; }
/// Semantic completion decision. Absent on legacy events and invalid tool calls.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("outcome")]
public TaskCompletionOutcome? Outcome { get; set; }
/// Label-safe runtime rationale for the completion decision (e.g. a cancellation or pause/resume downgrade), when one applies. Reviewer-authored rationale is intentionally omitted here because this event has no IFC label channel; the reviewer's findings remain available through its own labeled sub-agent events.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reason")]
public string? Reason { get; set; }
/// Whether the task was accepted as complete. False when validation failed or completion was rejected or blocked by the reviewer.
[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; }
}
/// Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCompletionReceiptData
{
/// One-based accepted completion receipt ordinal in the durable session history.
[JsonPropertyName("attempt")]
public required long Attempt { get; set; }
/// Inclusive durable event range summarized by this receipt.
[JsonPropertyName("eventRange")]
public required CompletionReceiptEventRange EventRange { get; set; }
/// Number of failed structured tool completions in the covered range.
[JsonPropertyName("failedToolCount")]
public required long FailedToolCount { get; set; }
/// Final structured tool completion in the covered range, when one exists.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("finalTool")]
public CompletionReceiptFinalTool? FinalTool { get; set; }
/// Version of the completion receipt payload.
[JsonPropertyName("schemaVersion")]
public required long SchemaVersion { get; set; }
/// Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId.
[JsonPropertyName("sourceEventId")]
public required string SourceEventId { get; set; }
/// Runtime reason the completion decision was accepted.
[JsonPropertyName("stopReason")]
public required CompletionReceiptStopReason StopReason { get; set; }
/// Number of successful structured tool completions in the covered range.
[JsonPropertyName("successfulToolCount")]
public required long SuccessfulToolCount { get; set; }
}
/// Experimental transient signal that HydraFusion routing has started for an eligible turn.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionFusionRouteStartedData
{
/// Identifier for this routing attempt before a durable Fusion turn exists.
[JsonPropertyName("attemptId")]
public required string AttemptId { get; set; }
/// HydraFusion routing policy requested for the turn.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("policy")]
public string? Policy { get; set; }
/// Synthetic HydraFusion model selected for the session.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("syntheticModel")]
public string? SyntheticModel { get; set; }
/// Kind of turn being routed.
[JsonPropertyName("turnKind")]
public required FusionTurnKind TurnKind { get; set; }
}
/// Experimental durable HydraFusion routing failure and the deterministic concrete fallback selected for the turn.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionFusionRouteFailedData
{
/// Identifier of the routing attempt that failed.
[JsonPropertyName("attemptId")]
public required string AttemptId { get; set; }
/// Provider or validation error detail, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("errorMessage")]
public string? ErrorMessage { get; set; }
/// Concrete model selected as the deterministic fallback.
[JsonPropertyName("fallbackModel")]
public required string FallbackModel { get; set; }
/// HydraFusion routing policy requested for the turn.
[JsonPropertyName("policy")]
public required string Policy { get; set; }
/// Stable machine-readable reason for the routing failure.
[JsonPropertyName("reason")]
public required string Reason { get; set; }
/// Elapsed routing time in milliseconds before the failure.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("routingLatencyMs")]
public double? RoutingLatencyMs { get; set; }
/// Synthetic HydraFusion model selected for the session.
[JsonPropertyName("syntheticModel")]
public required string SyntheticModel { get; set; }
}
/// Experimental durable validated HydraFusion route and turn policy.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionFusionResolvedData
{
/// Version of the validated HydraFusion event contract.
[JsonPropertyName("contractVersion")]
public required long ContractVersion { get; set; }
/// Concrete model used when the planned primary model cannot execute.
[JsonPropertyName("fallbackModel")]
public required string FallbackModel { get; set; }
/// Router recommendation controlling reuse or rerouting on later turns.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("followUp")]
public FusionFollowUpRecommendation? FollowUp { get; set; }
/// Concrete model recommended for eligible follow-up turns.
[JsonPropertyName("followUpModel")]
public required string FollowUpModel { get; set; }
/// Stable identifier for the resolved HydraFusion turn.
[JsonPropertyName("fusionId")]
public required string FusionId { get; set; }
/// Version of the executable model universe used for selection.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("modelUniverseVersion")]
public string? ModelUniverseVersion { get; set; }
/// Validated orchestration pattern selected for the turn.
[JsonPropertyName("pattern")]
public required FusionPattern Pattern { get; set; }
/// Presentation-neutral phase plan for clients that render workflow progress.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("phasePlan")]
public FusionPhasePlanStep[]? PhasePlan { get; set; }
/// Version of the validated execution-plan format.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("planVersion")]
public string? PlanVersion { get; set; }
/// HydraFusion routing policy used to resolve the plan.
[JsonPropertyName("policy")]
public required string Policy { get; set; }
/// Version of the local routing policy.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("policyVersion")]
public string? PolicyVersion { get; set; }
/// Concrete model selected for the primary solver phase.
[JsonPropertyName("primaryModel")]
public required string PrimaryModel { get; set; }
/// Router implementation that supplied the plan.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("routeSource")]
public string? RouteSource { get; set; }
/// Elapsed time in milliseconds required to resolve and validate the route.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("routingLatencyMs")]
public double? RoutingLatencyMs { get; set; }
/// Identifier of the local policy rule that matched.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ruleId")]
public string? RuleId { get; set; }
/// Zero-based index of the local policy rule that matched.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ruleIndex")]
public long? RuleIndex { get; set; }
/// Human-readable name of the local policy rule that matched.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ruleName")]
public string? RuleName { get; set; }
/// Validated capability scores used to select the route.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("scores")]
public FusionScores? Scores { get; set; }
/// Concrete model selected for the review or judge phase, when required.
[JsonPropertyName("secondaryModel")]
public string? SecondaryModel { get; set; }
/// Synthetic HydraFusion model selected for the session.
[JsonPropertyName("syntheticModel")]
public required string SyntheticModel { get; set; }
/// Identifier of the session turn associated with the route.
[JsonPropertyName("turnId")]
public required string TurnId { get; set; }
}
/// Experimental durable aggregate outcome of a HydraFusion turn.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionFusionCompletedData
{
/// Total cached input tokens reported across all phases.
[JsonPropertyName("cachedTokens")]
public required long CachedTokens { get; set; }
/// Total tokens written to prompt cache across all phases.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cacheWriteTokens")]
public long? CacheWriteTokens { get; set; }
/// Idempotency identifier for the authoritative final commit.
[JsonPropertyName("commitId")]
public required string CommitId { get; set; }
/// Reason the turn used a degraded route, when applicable.
[JsonPropertyName("degradedReason")]
public string? DegradedReason { get; set; }
/// Total elapsed execution time for the HydraFusion turn in milliseconds.
[JsonPropertyName("durationMs")]
public required double DurationMs { get; set; }
/// Concrete model that supplied the authoritative final content.
[JsonPropertyName("finalSourceModel")]
public string? FinalSourceModel { get; set; }
/// Phase whose output supplied the authoritative final content.
[JsonPropertyName("finalSourcePhaseId")]
public string? FinalSourcePhaseId { get; set; }
/// Concrete model recommended for eligible follow-up turns.
[JsonPropertyName("followUpModel")]
public required string FollowUpModel { get; set; }
/// Stable identifier for the completed HydraFusion turn.
[JsonPropertyName("fusionId")]
public required string FusionId { get; set; }
/// Total input tokens consumed across all phases.
[JsonPropertyName("inputTokens")]
public required long InputTokens { get; set; }
/// Stable aggregate outcome of the HydraFusion turn.
[JsonPropertyName("outcome")]
public required string Outcome { get; set; }
/// Total output tokens produced across all phases.
[JsonPropertyName("outputTokens")]
public required long OutputTokens { get; set; }
/// HydraFusion orchestration pattern executed for the turn.
[JsonPropertyName("pattern")]
public required FusionPattern Pattern { get; set; }
/// Number of concrete phases attempted by the turn.
[JsonPropertyName("phaseCount")]
public required long PhaseCount { get; set; }
/// Total concrete model requests made across all phases.
[JsonPropertyName("requestCount")]
public required long RequestCount { get; set; }
/// Synthetic HydraFusion model selected for the session.
[JsonPropertyName("syntheticModel")]
public required string SyntheticModel { get; set; }
/// Total normalized AI-unit cost reported across all phases, in nano-AIU.
[JsonPropertyName("totalNanoAiu")]
public required double TotalNanoAiu { get; set; }
/// Identifier of the session turn associated with the completion.
[JsonPropertyName("turnId")]
public required string TurnId { get; set; }
}
/// Payload of `user.message` with displayed and model-transformed content, attachments, source/delivery metadata, mode, and telemetry IDs.
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; }
/// Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("messageId")]
public string? MessageId { 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 and attribution (e.g., `skill-pdf` for hidden skill injection or `agent-<agent-id>` for an inter-agent prompt).
[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; }
/// The agent-loop turn ID that consumed this message; absent when no agent-loop turn consumed it.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("turnId")]
public string? TurnId { 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; }
/// Model identifier used for this turn, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Identifier for this turn within the agentic loop, typically a stringified turn number.
[JsonPropertyName("turnId")]
public required string TurnId { get; set; }
}
/// Metadata for an additional model inference attempt within an existing assistant turn.
public sealed partial class AssistantTurnRetryData
{
/// Model identifier used for this retry, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Provider or runtime classification that caused the retry, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reason")]
public string? Reason { get; set; }
/// Identifier of the turn whose model inference is being retried.
[JsonPropertyName("turnId")]
public required string TurnId { get; set; }
}
/// Metadata for work the user interrupted while the agent was running.
public sealed partial class AgentInterruptedData
{
/// What the agent was doing when the user interrupted it.
[JsonPropertyName("activity")]
public required AgentInterruptedActivity Activity { get; set; }
/// For an interrupted model call: the provider endpoint the request targeted.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("apiEndpoint")]
public string? ApiEndpoint { get; set; }
/// For an interrupted model call: whether the user interrupted before any token arrived or while the response was streaming.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cancelPhase")]
public AgentInterruptedCancelPhase? CancelPhase { get; set; }
/// How long the interrupted work had been running, in milliseconds.
[JsonConverter(typeof(MillisecondsTimeSpanConverter))]
[JsonPropertyName("elapsedMs")]
public required TimeSpan Elapsed { get; set; }
/// For an interrupted background-agent batch: how many background sub-agents the stop swept. Counts accepted cancellations, so an agent cancelled as a cascade of its interrupted parent is covered by that parent rather than counted again.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("interruptedAgentCount")]
public long? InterruptedAgentCount { get; set; }
/// For an interrupted model call: the model the request targeted.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// For a mid-stream interrupt: the observed time to first observable output, in milliseconds. Deliberately distinct from the `ttftMs` reported on a successful model call, which measures time to first stream event.
[JsonConverter(typeof(MillisecondsTimeSpanConverter))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("outputTtftMs")]
public TimeSpan? OutputTtft { get; set; }
/// For an interrupted model call: the reasoning effort the request asked for.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reasoningEffort")]
public string? ReasoningEffort { get; set; }
/// Subset of `toolNames` whose tool metadata marks the tool name as safe to record unhashed in telemetry.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("safeToolNames")]
public string[]? SafeToolNames { get; set; }
/// Tool call identifiers that were still running.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolCallIds")]
public string[]? ToolCallIds { get; set; }
/// Names of the tools that were still running. More than one when the model requested a parallel fan-out.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolNames")]
public string[]? ToolNames { get; set; }
/// For an interrupted model call: the transport the request used.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("transport")]
public ModelCallFailureTransport? Transport { get; set; }
/// Zero-based agentic-loop iteration the interrupt landed in.
[JsonPropertyName("turn")]
public required long Turn { 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; }
}
/// Experimental transient HydraFusion phase/model/role signal.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantFusionPhaseStartedData
{
/// Conversation scope in which the phase executes.
[JsonPropertyName("conversationScope")]
public required FusionConversationScope ConversationScope { get; set; }
/// Identifier of the HydraFusion turn containing the phase.
[JsonPropertyName("fusionId")]
public required string FusionId { get; set; }
/// Concrete model executing the phase.
[JsonPropertyName("model")]
public required string Model { get; set; }
/// HydraFusion orchestration pattern containing the phase.
[JsonPropertyName("pattern")]
public required FusionPattern Pattern { get; set; }
/// Stable identifier for the concrete phase.
[JsonPropertyName("phaseId")]
public required string PhaseId { get; set; }
/// Kind of phase being executed.
[JsonPropertyName("phaseKind")]
public required FusionPhaseKind PhaseKind { get; set; }
/// Semantic role assigned to the phase.
[JsonPropertyName("role")]
public required string Role { get; set; }
}
/// Experimental content-safe activity signal for a running HydraFusion phase.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantFusionPhaseActivityData
{
/// Kind of real activity observed.
[JsonPropertyName("activity")]
public required FusionPhaseActivityKind Activity { get; set; }
/// Conversation scope in which the phase executes.
[JsonPropertyName("conversationScope")]
public required FusionConversationScope ConversationScope { get; set; }
/// Identifier of the HydraFusion turn containing the phase.
[JsonPropertyName("fusionId")]
public required string FusionId { get; set; }
/// HydraFusion orchestration pattern containing the phase.
[JsonPropertyName("pattern")]
public required FusionPattern Pattern { get; set; }
/// Stable identifier for the concrete phase.
[JsonPropertyName("phaseId")]
public required string PhaseId { get; set; }
/// Kind of phase currently executing.
[JsonPropertyName("phaseKind")]
public required FusionPhaseKind PhaseKind { get; set; }
/// Semantic role assigned to the phase.
[JsonPropertyName("role")]
public required string Role { get; set; }
/// Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolCallId")]
public string? ToolCallId { get; set; }
/// Cumulative private response bytes observed for this model call. The event never includes response text.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("totalResponseSizeBytes")]
public long? TotalResponseSizeBytes { get; set; }
}
/// Experimental durable HydraFusion phase output and lossless replay checkpoint.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantFusionPhaseCompletedData
{
/// Provider-normalized textual output produced by the phase.
[JsonPropertyName("content")]
public required string Content { get; set; }
/// Conversation scope in which the phase executed.
[JsonPropertyName("conversationScope")]
public required FusionConversationScope ConversationScope { get; set; }
/// Elapsed execution time for the phase in milliseconds.
[JsonPropertyName("durationMs")]
public required double DurationMs { get; set; }
/// Identifier of the HydraFusion turn containing the phase.
[JsonPropertyName("fusionId")]
public required string FusionId { get; set; }
/// Concrete model that executed the phase.
[JsonPropertyName("model")]
public required string Model { get; set; }
/// Stable identifier for the completed phase.
[JsonPropertyName("phaseId")]
public required string PhaseId { get; set; }
/// Kind of phase that completed.
[JsonPropertyName("phaseKind")]
public required FusionPhaseKind PhaseKind { get; set; }
/// Exact provider-normalized message used to reconstruct canonical model history.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("projectionMessage")]
internal JsonElement? ProjectionMessage { get; set; }
/// Projection action for the exact internal message.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("projectionMode")]
internal FusionProjectionMode? ProjectionMode { get; set; }
/// Semantic role assigned to the completed phase.
[JsonPropertyName("role")]
public required string Role { get; set; }
/// Terminal request held outside canonical state until selected by the final commit.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("stagedTerminal")]
internal FusionStagedTerminal? StagedTerminal { get; set; }
/// Durable outcome status of the phase.
[JsonPropertyName("status")]
public required FusionPhaseStatus Status { get; set; }
/// Aggregate concrete-model usage consumed by the phase.
[JsonPropertyName("usage")]
public required FusionPhaseUsage Usage { get; set; }
/// Structured judge or critic verdict, when the phase produces one.
[JsonPropertyName("verdict")]
public string? Verdict { get; set; }
}
/// Experimental durable typed HydraFusion phase failure and degradation transition.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantFusionPhaseFailedData
{
/// Conversation scope in which the phase executed.
[JsonPropertyName("conversationScope")]
public required FusionConversationScope ConversationScope { get; set; }
/// Identifier of the fallback phase used to continue the turn after degradation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("degradedToPhaseId")]
public string? DegradedToPhaseId { get; set; }
/// Elapsed execution time before the phase failed, in milliseconds.
[JsonPropertyName("durationMs")]
public required double DurationMs { get; set; }
/// Provider or execution error detail, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("errorMessage")]
public string? ErrorMessage { get; set; }
/// Identifier of the HydraFusion turn containing the phase.
[JsonPropertyName("fusionId")]
public required string FusionId { get; set; }
/// Concrete model that attempted the phase.
[JsonPropertyName("model")]
public required string Model { get; set; }
/// Stable identifier for the failed phase.
[JsonPropertyName("phaseId")]
public required string PhaseId { get; set; }
/// Kind of phase that failed.
[JsonPropertyName("phaseKind")]
public required FusionPhaseKind PhaseKind { get; set; }
/// Stable machine-readable reason for the phase failure.
[JsonPropertyName("reason")]
public required string Reason { get; set; }
/// Semantic role assigned to the failed phase.
[JsonPropertyName("role")]
public required string Role { get; set; }
/// Durable outcome status of the phase.
[JsonPropertyName("status")]
public required FusionPhaseStatus Status { get; set; }
/// Aggregate concrete-model usage consumed before the failure.
[JsonPropertyName("usage")]
public required FusionPhaseUsage Usage { get; set; }
}
/// Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message.
public sealed partial class AssistantServerToolProgressData
{
/// Kind of hosted server tool that is running. Only `web_search` is emitted today.
[JsonPropertyName("kind")]
public required string Kind { get; set; }
/// Position of the hosted tool call in the response output. Stable across the call's lifecycle events (unlike the provider's per-event item id, which CAPI rotates), so the host keys the live in-progress row on it.
[JsonPropertyName("outputIndex")]
public required long OutputIndex { get; set; }
/// Lifecycle status of the hosted call: `in_progress`, `searching`, or `completed`.
[JsonPropertyName("status")]
public required string Status { 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; }
/// Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rte")]
public bool? Rte { 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 tool-call input delta for incremental tool-call updates.
public sealed partial class AssistantToolCallDeltaData
{
/// Raw provider tool input fragment to append for this tool call. Function/tool-use providers stream serialized JSON argument text (so newlines inside JSON string values may appear as escaped `\n` until the accumulated JSON is parsed); custom tool calls stream raw custom input.
[JsonPropertyName("inputDelta")]
public required string InputDelta { get; set; }
/// Tool call ID this delta belongs to, matching the corresponding assistant.message tool request.
[JsonPropertyName("toolCallId")]
public required string ToolCallId { get; set; }
/// Name of the tool being invoked, when known from the stream.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolName")]
public string? ToolName { get; set; }
/// Tool call type, when known from the stream.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolType")]
public AssistantMessageToolRequestType? ToolType { 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; }
/// Total messages the model call's response was split into, one per reasoning boundary. Absent for a single-message response; the last chunk is the one where chunkIndex is chunkCount - 1.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("chunkCount")]
public long? ChunkCount { get; set; }
/// Zero-based position of this message within its model call's response. Absent when the response was not split into chunks.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("chunkIndex")]
public long? ChunkIndex { 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; }
/// Client-minted request id (x-request-id header) echoed by the server. Distinct from requestId (x-github-request-id) and serviceRequestId (x-copilot-service-request-id).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("clientRequestId")]
public string? ClientRequestId { 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; }
/// Experimental HydraFusion source attribution for this ordinary authoritative assistant message.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fusion")]
public FusionAttribution? Fusion { 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; }
/// Neutral provider-tagged reasoning content blocks preserved verbatim for round-tripping. `reasoningText` and `reasoningOpaque` are a lossy derived view of these blocks, retained for display.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reasoningBlocks")]
public AssistantMessageReasoningBlocks? ReasoningBlocks { 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; }
/// Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rte")]
public bool? Rte { 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
{
/// Model identifier used for this turn, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// 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
{
/// Number of accepted speculative prediction tokens.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("acceptedPredictionTokens")]
public long? AcceptedPredictionTokens { get; set; }
/// 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 tools available to the model for this call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("availableToolCount")]
internal long? AvailableToolCount { get; set; }
/// Whether the provider reported prompt-cache usage details for this call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("cacheDetailsReported")]
internal bool? CacheDetailsReported { get; set; }
/// Updated prompt-cache expiration for this model call. Present only when the call establishes or refreshes known cache state.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cacheExpiresAt")]
public DateTimeOffset? CacheExpiresAt { get; set; }
/// Number of tokens read from prompt cache.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cacheReadTokens")]
public long? CacheReadTokens { get; set; }
/// Effective prompt-cache lifetime in seconds for this call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("cacheTtlSeconds")]
internal long? CacheTtlSeconds { 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; }
/// How the prompt-cache frontier was determined for this call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("frontierSource")]
internal string? FrontierSource { get; set; }
/// Experimental HydraFusion attribution for this concrete model call's usage.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fusion")]
public FusionAttribution? Fusion { 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; }
/// Coarse classification of the interaction that produced this call, mirroring the session's per-request agent context (e.g. `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, `conversation-user`). Non-billing; lets consumers attribute a model call to a call class (e.g. sub-agent/sidekick) independently of the billing initiator. Absent when the runtime did not classify the request.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("interactionType")]
public string? InteractionType { 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; }
/// Whether Auto mode was selected for this model call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("isAuto")]
public bool? IsAuto { get; set; }
/// Whether this model call used a bring-your-own-key provider.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("isByok")]
public bool? IsByok { get; set; }
/// Requested maximum output tokens used for this model call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxOutputTokens")]
public long? MaxOutputTokens { get; set; }
/// Effective maximum prompt-token limit used for this model call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxPromptTokens")]
public long? MaxPromptTokens { get; set; }
/// Model identifier used for this API call.
[JsonPropertyName("model")]
public required string Model { get; set; }
/// Number of tool calls returned by the model.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("numToolCalls")]
internal long? NumToolCalls { get; set; }
/// Number of output tokens produced.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("outputTokens")]
public long? OutputTokens { get; set; }
/// Time to first observable model output in milliseconds. Includes text, reasoning, and tool-call output; only available for streaming requests that produce observable output.
[JsonConverter(typeof(MillisecondsTimeSpanConverter))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("outputTtftMs")]
public TimeSpan? OutputTtft { 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; }
/// Reasoning summary mode used for this model call, if applicable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reasoningSummary")]
public ReasoningSummary? ReasoningSummary { 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; }
/// Number of rejected speculative prediction tokens.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rejectedPredictionTokens")]
public long? RejectedPredictionTokens { get; set; }
/// Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rte")]
public bool? Rte { 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; }
/// Tool-call counts keyed by tool name.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolCounts")]
internal IDictionary? ToolCounts { get; set; }
/// Number of tokens used by tool definitions for this call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolTokenCount")]
internal long? ToolTokenCount { get; set; }
/// Transport used for this model call (http or websocket).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("transport")]
public AssistantUsageTransport? Transport { get; set; }
}
/// A detected loss of a previously cached prompt prefix.
public sealed partial class PromptCacheBreakData
{
/// Request state whose cached prefix fell short.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("afterRequest")]
internal JsonElement? AfterRequest { get; set; }
/// Name of the sub-agent whose conversation broke, stamped by the parent bridge.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("agentName")]
internal string? AgentName { get; set; }
/// Request state that established the prior cache frontier.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("beforeRequest")]
internal JsonElement? BeforeRequest { get; set; }
/// Names of the cache-configuration fields that changed.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("cacheConfigChangedFields")]
internal string[]? CacheConfigChangedFields { get; set; }
/// All reasons that contributed to the cache break, ordered by precedence.
[JsonPropertyName("contributingReasons")]
public required string[] ContributingReasons { get; set; }
/// Prior cached prompt frontier in tokens.
[JsonPropertyName("frontierTokens")]
public required long FrontierTokens { get; set; }
/// Model that held the prior cache frontier, when the call changed models.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("modelFrom")]
internal string? ModelFrom { get; set; }
/// Model this call targeted, when the call changed models.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("modelTo")]
internal string? ModelTo { get; set; }
/// The highest-precedence reason for the cache break.
[JsonPropertyName("primaryReason")]
public required string PrimaryReason { get; set; }
/// Fraction of the prior cache frontier that survived.
[JsonPropertyName("retentionRatio")]
public required double RetentionRatio { get; set; }
/// Index of the first conversation message whose content changed.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("rewriteMessageIndex")]
internal long? RewriteMessageIndex { get; set; }
/// Shape of the history rewrite, for example whether the history grew or shrank.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("rewriteShape")]
internal string? RewriteShape { get; set; }
/// Subsystems that announced a history rewrite before this call, for example compaction or truncation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("rewriteSource")]
internal string[]? RewriteSource { get; set; }
/// Cached prefix tokens lost since the prior call.
[JsonPropertyName("shortfallTokens")]
public required long ShortfallTokens { get; set; }
/// Number of cached prefix tokens that survived.
[JsonPropertyName("survivedTokens")]
public required long SurvivedTokens { get; set; }
/// Names of the system-prompt segments whose content changed.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("systemSegmentsChanged")]
internal string[]? SystemSegmentsChanged { get; set; }
/// Telemetry-safe names of tools added since the prior call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolsAdded")]
internal string[]? ToolsAdded { get; set; }
/// Raw names of tools added since the prior call, restricted because a tool name can be user-authored.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolsAddedRaw")]
internal string[]? ToolsAddedRaw { get; set; }
/// Telemetry-safe names of tools whose definition changed since the prior call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolsRedefined")]
internal string[]? ToolsRedefined { get; set; }
/// Raw names of tools redefined since the prior call, restricted because a tool name can be user-authored.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolsRedefinedRaw")]
internal string[]? ToolsRedefinedRaw { get; set; }
/// Telemetry-safe names of tools removed since the prior call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolsRemoved")]
internal string[]? ToolsRemoved { get; set; }
/// Raw names of tools removed since the prior call, restricted because a tool name can be user-authored.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolsRemovedRaw")]
internal string[]? ToolsRemovedRaw { get; set; }
/// Whether the tool list kept its members but changed their order.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("toolsReordered")]
internal bool? ToolsReordered { 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; }
/// API endpoint used for this model call, matching CAPI supported_endpoints vocabulary.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("apiEndpoint")]
public AssistantUsageApiEndpoint? ApiEndpoint { 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; }
/// Whether the failure originated from an API response or the request transport.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("failureKind")]
public ModelCallFailureKind? FailureKind { get; set; }
/// Experimental HydraFusion attribution for this failed concrete model call.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fusion")]
public FusionAttribution? Fusion { 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; }
/// Authoritative interaction classification for the failed call, matching `assistant.usage.interactionType` (for example `conversation-agent`, `conversation-subagent`, or `conversation-sampling`). Absent when the producer cannot classify the interaction.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("interactionType")]
public string? InteractionType { get; set; }
/// Whether the session selected Auto mode for the failed call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("isAuto")]
public bool? IsAuto { get; set; }
/// Whether the failed call used a bring-your-own-key provider.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("isByok")]
public bool? IsByok { get; set; }
/// Effective maximum output-token limit for the failed call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxOutputTokens")]
public long? MaxOutputTokens { get; set; }
/// Effective maximum prompt-token limit for the failed call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxPromptTokens")]
public long? MaxPromptTokens { 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; }
/// Reasoning effort level used for the failed model call, if applicable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reasoningEffort")]
public string? ReasoningEffort { 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; }
/// Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rte")]
public bool? Rte { 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; }
/// Transport used for the failed model call (http or websocket).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("transport")]
public ModelCallFailureTransport? Transport { get; set; }
}
/// Final lifecycle outcome for one logical model dispatch. A logical dispatch may include internal reconnect or fallback work, so event count is not provider HTTP-request count.
public sealed partial class ModelCallFinishedData
{
/// Whether an accepted successful response requested the exact name and command semantics of a built-in file edit tool, including an external tool explicitly replacing that built-in name. Absent when the logical dispatch did not produce an accepted response.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("containsBuiltInFileEditRequest")]
public bool? ContainsBuiltInFileEditRequest { get; set; }
/// Monotonic elapsed time spent in the logical model dispatch, including any internal transport reconnect or fallback and excluding orchestrator retry backoff, tool execution, confirmations, and post-response processing.
[JsonConverter(typeof(MillisecondsTimeSpanConverter))]
[JsonPropertyName("dispatchDurationMs")]
public required TimeSpan DispatchDuration { get; set; }
/// Version of the built-in file-edit semantic classifier used for this event.
[JsonPropertyName("editClassifierVersion")]
public required long EditClassifierVersion { get; set; }
/// Identifier of the user interaction that owns the model dispatch, matching assistant.turn_start.interactionId when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("interactionId")]
public string? InteractionId { get; set; }
/// Final outcome after post-response acceptance processing.
[JsonPropertyName("outcome")]
public required ModelCallFinishedOutcome Outcome { get; set; }
/// Agent-loop iteration within the interaction that initiated the model dispatch.
[JsonPropertyName("turnId")]
public required string TurnId { get; set; }
}
/// Model API dispatch metadata for internal telemetry.
public sealed partial class ModelCallStartData
{
/// Experimental HydraFusion attribution for this concrete model call.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fusion")]
public FusionAttribution? Fusion { get; set; }
/// Model identifier used for this API call, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Previous response or interaction identifier included in the model request, when present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonInclude]
[JsonPropertyName("previousResponseId")]
internal string? PreviousResponseId { get; set; }
/// Identifier of the assistant turn that initiated the model call.
[JsonPropertyName("turnId")]
public required string TurnId { 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; }
/// Experimental HydraFusion attribution for this tool execution.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fusion")]
public FusionAttribution? Fusion { 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; }
/// Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rte")]
public bool? Rte { 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; }
/// Experimental HydraFusion attribution for this tool completion.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fusion")]
public FusionAttribution? Fusion { 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; }
/// FIDES IFC label projected from tool ingress metadata (MCP `CallToolResult._meta` or synthesized built-in ingress labels). Persisted as `{ ifc: ... }` so the label survives session resume, including model-visible failure results. Experimental.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("mcpMeta")]
public JsonElement? McpMeta { 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; }
/// Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rte")]
public bool? Rte { 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; }
}
/// Persisted generic client-side tool activations restored when a session resumes.
public sealed partial class ToolSearchActivatedData
{
/// Tool-search strategy that activated the definitions.
[JsonPropertyName("strategy")]
public required string Strategy { get; set; }
/// Names of tool definitions activated by this search invocation.
[JsonPropertyName("toolNames")]
public required string[] ToolNames { 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; }
/// Whether model invocation is disabled for this skill.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("disableModelInvocation")]
public bool? DisableModelInvocation { get; set; }
/// Model identifier active when the skill was invoked, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Name of the invoked skill.
[JsonPropertyName("name")]
public required string Name { get; set; }
/// File path to the SKILL.md definition, or an empty string for an SDK-provided skill without a filesystem identity.
[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), remote (org/enterprise skill), and sdk (SDK-provided 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; }
}
/// Payload of `sandbox.decision`, a bounded governance record of what the process sandbox was configured to do and whether it took effect. Discriminated by `kind`.
public sealed partial class SandboxDecisionData { }
/// 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; }
/// Type of the sub-agent selected at spawn time.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("agentType")]
public string? AgentType { get; set; }
/// Whether the sub-agent runs synchronously or in the background.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("executionMode")]
public string? ExecutionMode { get; set; }
/// Root id of the factory run that spawned this sub-agent, when it was spawned by one.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("factoryRunId")]
public string? FactoryRunId { get; set; }
/// Model the sub-agent will run with, when known at start.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Task-registry ID of the spawning sub-agent. Absent when the root session spawned this child.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("parentId")]
public string? ParentId { get; set; }
/// Whether this sub-agent can be resumed. Currently always false.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resumable")]
public bool? Resumable { get; set; }
/// Tool call ID of the parent tool invocation that spawned this sub-agent.
[JsonPropertyName("toolCallId")]
public required string ToolCallId { get; set; }
}
/// Resolved runtime configuration for a configured sub-agent.
public sealed partial class SubagentConfiguredData
{
/// Resolved context tier, when configured for the model.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("contextTier")]
public string? ContextTier { get; set; }
/// Resolved model the sub-agent will run with.
[JsonPropertyName("model")]
public required string Model { get; set; }
/// Whether the sub-agent accepts follow-up turns.
[JsonPropertyName("multiTurn")]
public required bool MultiTurn { get; set; }
/// Resolved reasoning effort, when configured for the model.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reasoningEffort")]
public string? ReasoningEffort { 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; }
/// Whether the sub-agent was torn down by cancellation - its own abort, or an ancestor being killed - instead of finishing its work. Cancellation is not a failure, so the run still reports completion; this distinguishes a torn-down sub-agent from one that ran to the end.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cancelled")]
public bool? Cancelled { get; set; }
/// Whether the first model actually dispatched matched the user's configured preference.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("configuredModelMatchesActual")]
public bool? ConfiguredModelMatchesActual { get; set; }
/// Concrete model the user configured for this sub-agent via `/subagents`, when present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("configuredModelPreference")]
public string? ConfiguredModelPreference { 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; }
/// Whether the explicit task-call model matched the user's configured preference.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("explicitModelMatchesPreference")]
public bool? ExplicitModelMatchesPreference { get; set; }
/// Explicit model supplied by the parent agent on the task call, when present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("explicitModelOverride")]
public string? ExplicitModelOverride { get; set; }
/// First model for which the sub-agent started an inference request, when one was dispatched.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("firstDispatchedModel")]
public string? FirstDispatchedModel { get; set; }
/// Model used by the sub-agent.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Why an explicit task-call model did not become the effective model.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("modelOverrideReason")]
public string? ModelOverrideReason { 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; }
/// Whether the first model actually dispatched matched the user's configured preference.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("configuredModelMatchesActual")]
public bool? ConfiguredModelMatchesActual { get; set; }
/// Concrete model the user configured for this sub-agent via `/subagents`, when present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("configuredModelPreference")]
public string? ConfiguredModelPreference { 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; }
/// Whether the explicit task-call model matched the user's configured preference.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("explicitModelMatchesPreference")]
public bool? ExplicitModelMatchesPreference { get; set; }
/// Explicit model supplied by the parent agent on the task call, when present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("explicitModelOverride")]
public string? ExplicitModelOverride { get; set; }
/// First model for which the sub-agent started an inference request, when one was dispatched.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("firstDispatchedModel")]
public string? FirstDispatchedModel { get; set; }
/// Model selected for the sub-agent, when known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Why an explicit task-call model did not become the effective model.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("modelOverrideReason")]
public string? ModelOverrideReason { 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. For postToolUse hooks the retained copy served by session.eventLog.read (and by a resumed session) elides the tool result's inline `contents`/`uiResource` and replaces an over-long `textResultForLlm` with a `[copilot:elided ...]` marker, to keep a multi-megabyte payload out of the durable event log; the live subscription stream still delivers the full value. Read the adjacent tool.execution_complete event for the tool result itself.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("input")]
public JsonElement? Input { get; set; }
/// Tool call ID of the parent tool invocation when this event originates from a sub-agent.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("parentToolCallId")]
public string? ParentToolCallId { 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; }
/// Tool call ID of the parent tool invocation when this event originates from a sub-agent.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("parentToolCallId")]
public string? ParentToolCallId { 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; }
/// Logical interaction identifier for the model run receiving this prompt.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("interactionId")]
public string? InteractionId { 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
{
/// Agent mode captured from the owning turn when permission evaluation began.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("agentMode")]
public SessionMode? AgentMode { get; set; }
/// 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; }
/// Neutral risk metadata supplied by the tool host. Consumers may display this value but must not use it to bypass the permission decision.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("riskAssessment")]
public JsonElement? RiskAssessment { 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
{
/// Raw HTTP response details from the OAuth auth challenge, as observed by the runtime. Header order and casing are transport-dependent, and duplicate header names may appear multiple times.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("httpResponse")]
public McpOauthHttpResponse? HttpResponse { get; set; }
/// 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; }
}
/// Ordered output and terminal state for a transient query that does not modify conversation history.
[Experimental(Diagnostics.Experimental)]
public sealed partial class UiEphemeralQueryData
{
/// Full response text, present for the `completed` phase.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("answer")]
public string? Answer { get; set; }
/// Ordered text delta, present for the `chunk` phase.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("chunk")]
public string? Chunk { get; set; }
/// Model or transport failure message, present for the `failed` phase.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("error")]
public string? Error { get; set; }
/// Current query lifecycle phase.
[JsonPropertyName("phase")]
public required UIEphemeralQueryPhase Phase { get; set; }
/// Runtime-minted query identifier.
[JsonPropertyName("requestId")]
public required string RequestId { 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; }
/// Stable provider identity captured with an extension-owned tool definition; hosts use it to route the request to the same provider that was offered to the model.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("providerId")]
public string? ProviderId { 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; }
}
/// Auto Intent resolution: the concrete model the session settled on for the first prompt of an auto-mode session, and why. Lets SDK clients render the chosen model and the full reason it was picked. The core selection fields (chosenModel/reasoningBucket/categoryScores) are stable; the routing-analytics fields (predictedLabel/confidence/candidateModels) mirror the upstream intent service and may evolve, hence the event's experimental stability.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionAutoModeResolvedData
{
/// Models offered to the router for this resolution.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("availableModels")]
public string[]? AvailableModels { get; set; }
/// Ordered candidate model list the router returned, when not a fallback.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("candidateModels")]
public string[]? CandidateModels { get; set; }
/// Per-category classifier scores (0-1) behind the bucket: the granular HYDRA capability scores (reasoning, code_gen, debugging, tool_use), or the binary needs_reasoning/no_reasoning scores when HYDRA didn't run. Lets clients show a breakdown rather than just the bucket.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("categoryScores")]
public IDictionary? CategoryScores { get; set; }
/// The concrete model the session will use after any intent refinement.
[JsonPropertyName("chosenModel")]
public required string ChosenModel { get; set; }
/// The chosen model's score shortfall relative to the top candidate.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("chosenShortfall")]
public double? ChosenShortfall { get; set; }
/// Classifier confidence for the predicted label, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("confidence")]
public double? Confidence { get; set; }
/// End-to-end client wait time for the router request in milliseconds.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("endToEndLatencyMs")]
public double? EndToEndLatencyMs { get; set; }
/// Whether the router fell back to the standard Auto selection.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fallback")]
public bool? Fallback { get; set; }
/// Server-provided reason for falling back, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fallbackReason")]
public string? FallbackReason { get; set; }
/// Whether the routed prompt contained an image.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("hasImage")]
public bool? HasImage { get; set; }
/// The predicted classifier label (e.g. `needs_reasoning`), when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("predictedLabel")]
public string? PredictedLabel { get; set; }
/// Coarse request-difficulty bucket, for explaining why a model was chosen ("picked X because this looks like high-reasoning work").
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reasoningBucket")]
public AutoModeResolvedReasoningBucket? ReasoningBucket { get; set; }
/// Server-reported router processing time in milliseconds.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("routerLatencyMs")]
public double? RouterLatencyMs { get; set; }
/// The routing method the server applied, when Auto Intent ran.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("routingMethod")]
public string? RoutingMethod { get; set; }
/// Whether a sticky model choice overrode the router result.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("stickyOverride")]
public bool? StickyOverride { get; set; }
}
/// Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionManagedSettingsResolvedData
{
/// Whether enterprise policy disables bypass-permissions ("yolo") mode for this session. Deny-wins across layers, and forced on when `failClosed` is true.
[JsonPropertyName("bypassPermissionsDisabled")]
public required bool BypassPermissionsDisabled { get; set; }
/// Whether a session-local permissions layer injected by the SDK host was present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("clientManaged")]
public bool? ClientManaged { get; set; }
/// Whether an actual device MDM/plist/registry/file managed-settings layer was present.
[JsonPropertyName("deviceManaged")]
public required bool DeviceManaged { get; set; }
/// Whether managed policy could not be determined (e.g. a failed server fetch) and the session fell back to the fail-closed restriction. When true, restrictions such as disabling bypass-permissions are enforced even though `settings` may be absent.
[JsonPropertyName("failClosed")]
public required bool FailClosed { get; set; }
/// The setting keys under enterprise management in the effective managed settings (e.g. `model`, `enabledPlugins`, `permissions`). Empty when no managed settings are in force.
[JsonPropertyName("managedKeys")]
public required string[] ManagedKeys { get; set; }
/// Whether at least two managed sources supplied permission allowlists, so enforcement intersects them and the flattened settings payload omits `permissions.allow`.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("permissionsAllowIntersected")]
public bool? PermissionsAllowIntersected { get; set; }
/// Whether the policy-helper managed-settings layer was present. The policy helper is the weakest channel: it fills keys no enterprise source set and can never replace one.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("policyHelperManaged")]
public bool? PolicyHelperManaged { get; set; }
/// Whether the effective sandbox policy forces the sandbox on *only* because managed policy could not be determined, rather than because the policy requires it. Lets clients tell a user whose `--no-sandbox` was overridden that the sandbox stayed on as a fail-closed fallback, instead of attributing it to an administrator who set no such policy.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("sandboxEnabledByUndeterminedPolicy")]
public bool? SandboxEnabledByUndeterminedPolicy { get; set; }
/// Whether the server (account/org) managed-settings layer was present.
[JsonPropertyName("serverManaged")]
public required bool ServerManaged { get; set; }
/// The effective (resolved) managed settings values, so clients can render exactly what is enforced. Absent when no managed policy is in force.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("settings")]
public JsonElement? Settings { get; set; }
/// Channel summary: `server`, `device`, `client`, or `policyHelper` when exactly one channel contributed; `mixed` when multiple channels contributed; otherwise `none`. Consult the per-channel booleans for exact provenance.
[JsonPropertyName("source")]
public required ManagedSettingsResolvedSource Source { get; set; }
}
/// Runtime enforcement of enterprise managed settings: fires when the session blocks or caps a runtime action because enterprise policy governs it, so SDK clients can explain *why* an action was governed. Unlike `session.managed_settings_resolved` (which reports *what* is managed), this reports a concrete governed action — e.g. a user or host tried to turn on a bypass-permissions escalation while policy disables it. Emitted live (not persisted to the session event log) on user/host-initiated attempts only, never for silent policy application. Marked experimental while the managed-settings surface stabilizes.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionManagedSettingsEnforcedData
{
/// The category of runtime action that managed policy governed.
[JsonPropertyName("action")]
public required ManagedSettingsEnforcedAction Action { get; set; }
/// For a `bypass_permissions_blocked` action, which permission-escalation primitive was refused. Absent for actions without a specific escalation primitive.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("escalation")]
public ManagedSettingsEnforcedEscalation? Escalation { get; set; }
/// Whether the enforcement was forced by fail-closed handling (managed policy could not be determined) rather than an explicit managed setting. When true, `setting` still names the restriction that was applied.
[JsonPropertyName("failClosed")]
public required bool FailClosed { get; set; }
/// A human-readable explanation of why the action was governed, suitable for surfacing to the user.
[JsonPropertyName("message")]
public required string Message { get; set; }
/// The managed setting key responsible for the enforcement (e.g. `permissions.disableBypassPermissionsMode`).
[JsonPropertyName("setting")]
public required string Setting { 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; }
/// Model the session had selected when the plan was authored, when one is known.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { 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; }
}
/// Payload of `session.tools_updated` identifying the model whose resolved tools were updated.
public sealed partial class SessionToolsUpdatedData
{
/// Identifier of the model the resolved tools apply to.
[JsonPropertyName("model")]
public required string Model { get; set; }
}
/// Empty payload for `session.background_tasks_changed`, indicating background task state changed.
public sealed partial class SessionBackgroundTasksChangedData
{
}
/// Ephemeral invalidation signal for a changed factory run.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FactoryRunUpdatedData
{
/// Monotonic revision now available for the run.
[JsonPropertyName("revision")]
public required long Revision { get; set; }
/// Factory run identifier.
[JsonPropertyName("runId")]
public required string RunId { get; set; }
}
/// Ephemeral signal that a factory run attempt began executing.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FactoryRunStartedData
{
/// Attempt number this start committed; a resumed run increments it.
[JsonPropertyName("attempt")]
public required long Attempt { get; set; }
/// Name of the factory this run executes. Low cardinality by construction.
[JsonPropertyName("factoryName")]
public required string FactoryName { get; set; }
/// Identifier of the factory run that started.
[JsonPropertyName("runId")]
public required string RunId { get; set; }
}
/// Ephemeral signal that a factory run reached a terminal status.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FactoryRunSettledData
{
/// AI credits this run consumed, in nano-AIU.
[JsonPropertyName("consumedNanoAiu")]
public required long ConsumedNanoAiu { get; set; }
/// Subagents this run consumed against its limits.
[JsonPropertyName("consumedSubagents")]
public required long ConsumedSubagents { get; set; }
/// Active milliseconds accumulated across every attempt of this run.
[JsonPropertyName("elapsedMs")]
public required long ElapsedMs { get; set; }
/// Typed failure class recorded on the run, when it failed with one (e.g. `factory_limit_reached`).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("failureType")]
public string? FailureType { get; set; }
/// Identifier of the factory run that settled.
[JsonPropertyName("runId")]
public required string RunId { get; set; }
/// Terminal status the run committed.
[JsonPropertyName("status")]
public required FactoryRunSettledStatus Status { get; set; }
}
/// Payload of `session.skills_loaded` listing resolved skill metadata.
public sealed partial class SessionSkillsLoadedData
{
/// Array of resolved skill metadata.
[JsonPropertyName("skills")]
public required SkillsLoadedSkill[] Skills { get; set; }
}
/// Payload of `session.custom_agents_updated` with loaded custom agents plus non-fatal warnings and fatal errors.
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; }
}
/// Payload of `session.mcp_servers_loaded` listing MCP server status summaries.
public sealed partial class SessionMcpServersLoadedData
{
/// Array of MCP server status summaries.
[JsonPropertyName("servers")]
public required McpServersLoadedServer[] Servers { get; set; }
}
/// Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error.
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, stopped, or not_configured.
[JsonPropertyName("status")]
public required McpServerStatus Status { get; set; }
}
/// Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs.
public sealed partial class SessionMcpServerRemovedData
{
/// Name of the MCP server that was removed from the graph.
[JsonPropertyName("serverName")]
public required string ServerName { get; set; }
}
/// Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established.
public sealed partial class SessionMcpServerNeedsReconnectData
{
/// Name of the MCP server that needs to reconnect.
[JsonPropertyName("serverName")]
public required string ServerName { get; set; }
}
/// Payload identifying the MCP server associated with a list change.
public sealed partial class McpToolsListChangedData
{
/// Name of the MCP server whose list changed.
[JsonPropertyName("serverName")]
public required string ServerName { get; set; }
}
/// Payload identifying the MCP server associated with a list change.
public sealed partial class McpResourcesListChangedData
{
/// Name of the MCP server whose list changed.
[JsonPropertyName("serverName")]
public required string ServerName { get; set; }
}
/// Payload identifying the MCP server associated with a list change.
public sealed partial class McpPromptsListChangedData
{
/// Name of the MCP server whose list changed.
[JsonPropertyName("serverName")]
public required string ServerName { get; set; }
}
/// Payload of `session.extensions_loaded` listing discovered extensions and their statuses.
public sealed partial class SessionExtensionsLoadedData
{
/// Array of discovered extensions and their status.
[JsonPropertyName("extensions")]
public required ExtensionsLoadedExtension[] Extensions { get; set; }
}
/// Payload of `session.canvas.opened` with canvas instance and provider IDs plus optional icon, title, status, URL, and input.
[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; }
/// Host-local PNG path for the canvas icon, when supplied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("icon")]
public string? Icon { 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; }
}
/// Payload of `session.canvas.registry_changed` listing the canvas declarations currently available.
[Experimental(Diagnostics.Experimental)]
public sealed partial class SessionCanvasRegistryChangedData
{
/// Canvas declarations currently available.
[JsonPropertyName("canvases")]
public required CanvasRegistryChangedCanvas[] Canvases { get; set; }
}
/// Payload of `session.canvas.closed` with the closed canvas instance ID, provider ID, and canvas ID.
[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; }
}
/// Payload of `session.extensions.attachments_pushed` with extension-contributed attachments for the next send.
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; }
/// Set on the immediate preliminary event of a working-directory change, before the git context is resolved. A settled follow-up event (enriched with git context, or cwd-only for a non-repository) is always emitted afterward, so observers may defer to it. Absent on standalone/final events (e.g. relay context changes).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("pendingGitContext")]
public bool? PendingGitContext { 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; }
}
/// 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; }
}
/// A token-type entry in a shutdown model metric, storing the accumulated token count.
/// 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; }
}
/// Per-model shutdown metrics with request counts, token usage, nano-AI units, and token details.
/// 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; }
}
/// Usage attributed to one agent instance at session shutdown.
/// Nested data type for ShutdownAgentMetric.
public sealed partial class ShutdownAgentMetric
{
/// Human-readable label for this subagent invocation, copied from the originating `subagent.started` event. For task-tool subagents this is the invocation's task description rather than the agent's configured display name, so group by `agentName` for stable per-agent labels.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("agentDisplayName")]
public string? AgentDisplayName { get; set; }
/// Configured agent name, when this is a subagent.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("agentName")]
public string? AgentName { get; set; }
/// Per-model usage for this agent, keyed by model identifier.
[JsonPropertyName("modelMetrics")]
public required IDictionary ModelMetrics { get; set; }
/// Time spent in model API calls by this agent, in milliseconds.
[JsonConverter(typeof(MillisecondsTimeSpanConverter))]
[JsonPropertyName("totalApiDurationMs")]
public required TimeSpan TotalApiDuration { get; set; }
/// Accumulated nano-AI units cost for this agent.
[JsonPropertyName("totalNanoAiu")]
public required double TotalNanoAiu { 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; }
}
/// A session-wide shutdown token-type entry storing the accumulated token count.
/// 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; }
}
/// Internal prompt-cache expiration state for one model.
/// Nested data type for UsageCheckpointModelCacheState.
internal sealed partial class UsageCheckpointModelCacheState
{
/// Latest known prompt-cache expiration.
[JsonPropertyName("cacheExpiresAt")]
public required DateTimeOffset CacheExpiresAt { get; set; }
/// Retained cache lifetime in seconds, used to refresh expiration after a cache read.
[JsonInclude]
[JsonPropertyName("cacheTtlSeconds")]
internal required long CacheTtlSeconds { get; set; }
/// Model identifier associated with this cache state.
[JsonPropertyName("modelId")]
public required string ModelId { 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; }
}
/// Inclusive durable event range summarized by a completion receipt.
/// Nested data type for CompletionReceiptEventRange.
public sealed partial class CompletionReceiptEventRange
{
/// Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key.
[JsonPropertyName("endEventId")]
public required string EndEventId { get; set; }
/// Identifier of the user message that starts the covered exchange.
[JsonPropertyName("startEventId")]
public required string StartEventId { get; set; }
}
/// Final structured tool completion in the covered event range.
/// Nested data type for CompletionReceiptFinalTool.
public sealed partial class CompletionReceiptFinalTool
{
/// Process exit code from a structured shell result, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("exitCode")]
public long? ExitCode { get; set; }
/// Structured success or failure status from the tool completion event.
[JsonPropertyName("status")]
public required CompletionReceiptToolStatus Status { get; set; }
/// Unique identifier of the completed tool call.
[JsonPropertyName("toolCallId")]
public required string ToolCallId { get; set; }
/// Tool name from the matching tool execution start event, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("toolName")]
public string? ToolName { get; set; }
}
/// Durable server recommendation for subsequent HydraFusion turns.
/// Nested data type for FusionFollowUpRecommendation.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FusionFollowUpRecommendation
{
/// Recommended routing action for the next compaction turn.
[JsonPropertyName("compactionTurn")]
public required FusionFollowUpAction CompactionTurn { get; set; }
/// Recommended routing action for the next user-message turn.
[JsonPropertyName("userTurn")]
public required FusionFollowUpAction UserTurn { get; set; }
}
/// Presentation-neutral phase planned for a HydraFusion turn.
/// Nested data type for FusionPhasePlanStep.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FusionPhasePlanStep
{
/// Whether the phase executes only when an earlier phase requests it.
[JsonPropertyName("conditional")]
public required bool Conditional { get; set; }
/// Kind of phase that may execute.
[JsonPropertyName("kind")]
public required FusionPhaseKind Kind { get; set; }
/// Semantic role assigned to the phase.
[JsonPropertyName("role")]
public required string Role { get; set; }
/// Conversation scope in which the phase executes.
[JsonPropertyName("scope")]
public required FusionConversationScope Scope { get; set; }
}
/// Validated HydraFusion routing capability scores.
/// Nested data type for FusionScores.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FusionScores
{
/// Code-generation capability score returned by the authenticated router.
[JsonPropertyName("codeGen")]
public required double CodeGen { get; set; }
/// Debugging capability score returned by the authenticated router.
[JsonPropertyName("debugging")]
public required double Debugging { get; set; }
/// Reasoning capability score returned by the authenticated router.
[JsonPropertyName("reasoning")]
public required double Reasoning { get; set; }
/// Tool-use capability score returned by the authenticated router.
[JsonPropertyName("toolUse")]
public required double ToolUse { 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;
}
/// Internal durable terminal request staged by a HydraFusion phase until an idempotent final commit selects it.
/// Nested data type for FusionStagedTerminal.
[Experimental(Diagnostics.Experimental)]
internal sealed partial class FusionStagedTerminal
{
/// Gets or sets the arguments value.
[JsonPropertyName("arguments")]
public required string Arguments { get; set; }
/// Gets or sets the assistantMessage value.
[JsonPropertyName("assistantMessage")]
public required JsonElement AssistantMessage { get; set; }
/// Gets or sets the phaseId value.
[JsonPropertyName("phaseId")]
public required string PhaseId { get; set; }
/// Gets or sets the toolCallId value.
[JsonPropertyName("toolCallId")]
public required string ToolCallId { get; set; }
/// Gets or sets the toolName value.
[JsonPropertyName("toolName")]
public required string ToolName { get; set; }
}
/// Aggregate concrete-model usage for one HydraFusion phase.
/// Nested data type for FusionPhaseUsage.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FusionPhaseUsage
{
/// Total cached input tokens reported for the phase.
[JsonPropertyName("cachedTokens")]
public required long CachedTokens { get; set; }
/// Total tokens written to prompt cache during the phase.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cacheWriteTokens")]
public long? CacheWriteTokens { get; set; }
/// Total input tokens consumed by the phase.
[JsonPropertyName("inputTokens")]
public required long InputTokens { get; set; }
/// Total output tokens produced by the phase.
[JsonPropertyName("outputTokens")]
public required long OutputTokens { get; set; }
/// Number of concrete model requests made by the phase.
[JsonPropertyName("requestCount")]
public required long RequestCount { get; set; }
/// Total normalized AI-unit cost reported for the phase, in nano-AIU.
[JsonPropertyName("totalNanoAiu")]
public required double TotalNanoAiu { get; set; }
}
/// 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; }
}
/// Experimental attribution linking an ordinary event to the HydraFusion turn, phase, and concrete source that produced it.
/// Nested data type for FusionAttribution.
[Experimental(Diagnostics.Experimental)]
public sealed partial class FusionAttribution
{
/// Idempotency identifier for the authoritative commit, when the event belongs to the selected output.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("commitId")]
public string? CommitId { get; set; }
/// Conversation scope in which the concrete phase executed.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("conversationScope")]
public string? ConversationScope { get; set; }
/// Stable identifier for the HydraFusion turn that produced the event.
[JsonPropertyName("fusionId")]
public required string FusionId { get; set; }
/// HydraFusion orchestration pattern selected for the turn.
[JsonPropertyName("pattern")]
public required string Pattern { get; set; }
/// Identifier of the concrete phase that produced the event.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("phaseId")]
public string? PhaseId { get; set; }
/// Kind of concrete phase that produced the event.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("phaseKind")]
public string? PhaseKind { get; set; }
/// HydraFusion routing policy used for the turn.
[JsonPropertyName("policy")]
public required string Policy { get; set; }
/// Semantic role assigned to the concrete phase.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("role")]
public string? Role { get; set; }
/// Concrete model that produced the attributed event.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("sourceModel")]
public string? SourceModel { get; set; }
/// Phase whose output supplied the authoritative content, when different from the executing phase.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("sourcePhaseId")]
public string? SourcePhaseId { get; set; }
/// Synthetic HydraFusion model selected for the session.
[JsonPropertyName("syntheticModel")]
public required string SyntheticModel { get; set; }
}
/// Neutral provider-tagged reasoning content blocks preserved verbatim for round-tripping.
/// Nested data type for AssistantMessageReasoningBlocks.
[Experimental(Diagnostics.Experimental)]
public sealed partial class AssistantMessageReasoningBlocks
{
/// Provider-native reasoning items or content blocks preserved verbatim, in order. A single response can carry several, and provider signatures or identifiers may depend on their exact content and ordering.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("blocks")]
public JsonElement[]? Blocks { get; set; }
/// Model provider that produced these reasoning blocks.
[JsonPropertyName("provider")]
public required string Provider { 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
{
/// Advisor model identifier associated with the server-tool payload.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("advisorModel")]
public string? AdvisorModel { get; set; }
/// Provider function-call namespaces keyed by function-call identifier.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("functionCallNamespaces")]
public IDictionary? FunctionCallNamespaces { get; set; }
/// Provider-native server-tool call and output items preserved verbatim for replay.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("items")]
public JsonElement[]? Items { get; set; }
/// Model provider that produced this server-tool payload.
[JsonPropertyName("provider")]
public required string Provider { get; set; }
/// Raw provider content blocks retained for verbatim round-tripping.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("rawContentBlocks")]
public JsonElement[]? RawContentBlocks { get; set; }
}
/// Hosted program that requested this client tool call.
/// Nested data type for AssistantMessageToolRequestCaller.
public sealed partial class AssistantMessageToolRequestCaller
{
/// Provider-assigned identifier for the hosted caller.
[JsonPropertyName("callerId")]
public required string CallerId { get; set; }
/// Kind of hosted caller that requested the client tool call.
[JsonPropertyName("type")]
public required AssistantMessageToolRequestCallerType Type { 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; }
/// Hosted program that requested this client tool call.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("caller")]
public AssistantMessageToolRequestCaller? Caller { 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; }
}
/// Internal per-quota snapshot for assistant usage, including entitlement, consumed requests, overage, reset date, and remaining quota.
/// 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
{
/// The command with a redundant leading `cd` into the working directory removed, present only when there was one to remove. Computed with the same routine the shell driver applies before spawning, so a surface that renders this shows the text that actually runs. Consumers that display it should keep the original tool arguments available on demand.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("displayCommand")]
public string? DisplayCommand { get; set; }
/// 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; }
}
/// MCP Apps tool `_meta.ui` resource URI and visibility captured on `tool.execution_start`.
/// 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
{
/// MCP Apps tool `_meta.ui` resource URI and visibility captured on `tool.execution_start`.
[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; }
/// What the user must do to recover, when the runtime knows of an action. Set on sandbox policy denials, where `message` names the rule that blocked the call but never the client affordance that relaxes it.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("remediation")]
public RemediationAction? Remediation { 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; }
/// Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("outputFilePath")]
public string? OutputFilePath { 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; }
}
/// Embedded text resource contents identified by a URI, with an optional MIME type and a text payload.
/// 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; }
}
/// Embedded binary resource contents identified by a URI, with an optional MIME type and a base64-encoded blob.
/// 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;
}
/// CSP domain allowlists for an MCP Apps UI resource, including connect, resource, frame, and base URI domains.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUICsp.
public sealed partial class ToolExecutionCompleteUIResourceMetaUICsp
{
/// Domains the UI resource may use as document base URIs.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("baseUriDomains")]
public string[]? BaseUriDomains { get; set; }
/// Domains the UI resource may connect to.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("connectDomains")]
public string[]? ConnectDomains { get; set; }
/// Domains the UI resource may embed as nested frames.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("frameDomains")]
public string[]? FrameDomains { get; set; }
/// Domains from which the UI resource may load scripts, styles, images, and other resources.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resourceDomains")]
public string[]? ResourceDomains { get; set; }
}
/// Marker object for camera permission on an MCP Apps UI resource.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsCamera.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsCamera
{
}
/// Marker object for clipboard-write permission on an MCP Apps UI resource.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite
{
}
/// Marker object for geolocation permission on an MCP Apps UI resource.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation
{
}
/// Marker object for microphone permission on an MCP Apps UI resource.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone
{
}
/// Browser permission metadata for an MCP Apps UI resource, including camera, microphone, geolocation, and clipboard-write.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissions.
public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissions
{
/// Marker object for camera permission on an MCP Apps UI resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("camera")]
public ToolExecutionCompleteUIResourceMetaUIPermissionsCamera? Camera { get; set; }
/// Marker object for clipboard-write permission on an MCP Apps UI resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("clipboardWrite")]
public ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite? ClipboardWrite { get; set; }
/// Marker object for geolocation permission on an MCP Apps UI resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("geolocation")]
public ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation? Geolocation { get; set; }
/// Marker object for microphone permission on an MCP Apps UI resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("microphone")]
public ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone? Microphone { get; set; }
}
/// MCP Apps UI resource metadata for a completed tool result, including CSP, permissions, domain, and border preference.
/// Nested data type for ToolExecutionCompleteUIResourceMetaUI.
public sealed partial class ToolExecutionCompleteUIResourceMetaUI
{
/// CSP domain allowlists for an MCP Apps UI resource, including connect, resource, frame, and base URI domains.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("csp")]
public ToolExecutionCompleteUIResourceMetaUICsp? Csp { get; set; }
/// Optional dedicated origin for the rendered MCP Apps UI resource.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("domain")]
public string? Domain { get; set; }
/// Browser permission metadata for an MCP Apps UI resource, including camera, microphone, geolocation, and clipboard-write.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("permissions")]
public ToolExecutionCompleteUIResourceMetaUIPermissions? Permissions { get; set; }
/// Whether the host should render a border around the MCP Apps UI resource.
[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
{
/// MCP Apps UI resource metadata for a completed tool result, including CSP, permissions, domain, and border preference.
[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; }
/// FIDES IFC label projected from tool ingress metadata (MCP `CallToolResult._meta` or synthesized built-in ingress labels) — persisted as `{ ifc: ... }` (only the `ifc` key, not the whole `_meta`). Persisted so the FIDES IFC label survives session resume: the engine rehydrates accumulated taint by replaying these on load. Populated for ingress sources when FIDES IFC is on. Experimental.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("mcpMeta")]
public JsonElement? McpMeta { 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; }
}
/// MCP Apps tool `_meta.ui` resource URI and visibility captured on `tool.execution_complete`.
/// 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
{
/// MCP Apps tool `_meta.ui` resource URI and visibility captured on `tool.execution_complete`.
[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; }
}
/// System notification metadata for a background agent that completed or failed, including agent ID, type, status, description, and prompt.
/// The agent_completed variant of .
public sealed partial class SystemNotificationAgentCompleted : SystemNotification
{
///
[JsonIgnore]
public override string Type => "agent_completed";
/// Unique task identifier.
[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; }
/// Friendly, non-unique name intended for display.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("displayName")]
public string? DisplayName { 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; }
}
/// System notification metadata for a background agent that became idle, including agent ID, type, and description.
/// The agent_idle variant of .
public sealed partial class SystemNotificationAgentIdle : SystemNotification
{
///
[JsonIgnore]
public override string Type => "agent_idle";
/// Unique task identifier.
[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; }
/// Friendly, non-unique name intended for display.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }
}
/// System notification metadata for a new inbox message, including entry ID, sender details, and summary.
/// 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; }
}
/// System notification metadata for a shell session that completed, including shell ID, optional exit code, and description.
/// 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; }
}
/// System notification metadata for a detached shell session that completed, including shell ID and description.
/// 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; }
}
/// System notification metadata for an instruction file discovered during tool access, including source, trigger file, and tool.
/// 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; }
}
/// System notification metadata for a factory execution attempt that reached a terminal state.
/// The factory_completed variant of .
public sealed partial class SystemNotificationFactoryCompleted : SystemNotification
{
///
[JsonIgnore]
public override string Type => "factory_completed";
/// Execution attempt that reached this terminal state.
[JsonPropertyName("attempt")]
public required long Attempt { get; set; }
/// Consumed AI usage in nano-AIU.
[JsonPropertyName("consumedNanoAiu")]
public required long ConsumedNanoAiu { get; set; }
/// Subagents consumed by the run across all attempts.
[JsonPropertyName("consumedSubagents")]
public required long ConsumedSubagents { get; set; }
/// Accumulated active execution time in milliseconds.
[JsonPropertyName("elapsedMs")]
public required long ElapsedMs { get; set; }
/// Persisted factory name.
[JsonPropertyName("factoryName")]
public required string FactoryName { get; set; }
/// Machine-readable terminal failure details, when present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("failure")]
public JsonElement? Failure { get; set; }
/// Bounded prompt-safe preview of the completed result.
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")]
[MaxLength(256)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("resultPreview")]
public string? ResultPreview { get; set; }
/// Actionable run_factory resume guidance for a resource-limit failure.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("retryGuidance")]
public string? RetryGuidance { get; set; }
/// Factory run identifier.
[JsonPropertyName("runId")]
public required string RunId { get; set; }
/// Terminal status reached by this execution attempt.
[JsonPropertyName("status")]
public required SystemNotificationFactoryCompletedStatus Status { get; set; }
}
/// System notification metadata from an external host that does not match a runtime-owned notification kind.
/// The unclassified variant of .
public sealed partial class SystemNotificationUnclassified : SystemNotification
{
///
[JsonIgnore]
public override string Type => "unclassified";
/// Opaque metadata supplied by the external host, when present.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("metadata")]
public JsonElement? Metadata { 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")]
[JsonDerivedType(typeof(SystemNotificationFactoryCompleted), "factory_completed")]
[JsonDerivedType(typeof(SystemNotificationUnclassified), "unclassified")]
public partial class SystemNotification
{
/// The type discriminator.
[JsonPropertyName("type")]
public virtual string Type { get; set; } = string.Empty;
}
/// A parsed command identifier in a shell permission request, including whether it is read-only.
/// 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; }
}
/// A parsed shell command segment used for argument-aware managed policy matching.
/// Nested data type for PermissionRequestShellCommandSegment.
public sealed partial class PermissionRequestShellCommandSegment
{
/// Full text of this command segment, including arguments.
[JsonPropertyName("fullCommandText")]
public required string FullCommandText { get; set; }
/// Command identifier (e.g., executable name).
[JsonPropertyName("identifier")]
public required string Identifier { get; set; }
}
/// A URL that may be accessed by a command in a shell permission request.
/// 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; }
/// Parsed command segments, including arguments, used for managed policy matching.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("commandSegments")]
public PermissionRequestShellCommandSegment[]? CommandSegments { 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; }
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public override bool? ManagedApprovalRequired
{
get => base.ManagedApprovalRequired;
set => base.ManagedApprovalRequired = value;
}
/// 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 tool is asking to run this command outside the sandbox, either because the command detaches and cannot be sandboxed at all, or because a sandboxed run looked blocked (host opted in via sandbox.allowBypass). The model cannot ask for this; only the tool raises it. 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; }
/// What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. 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; }
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public override bool? ManagedApprovalRequired
{
get => base.ManagedApprovalRequired;
set => base.ManagedApprovalRequired = value;
}
/// Complete new file contents for newly created files.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("newFileContents")]
public string? NewFileContents { get; set; }
/// True when a built-in file tool (apply_patch / str_replace_editor) asked to write a path the sandbox filesystem policy would block, and the host opted in via sandbox.allowBypass. This is a request, not a grant: the write happens 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; }
/// 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; }
}
/// 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; }
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public override bool? ManagedApprovalRequired
{
get => base.ManagedApprovalRequired;
set => base.ManagedApprovalRequired = value;
}
/// Path of the file or directory being read.
[JsonPropertyName("path")]
public required string Path { get; set; }
/// True when the tool is asking to re-run this search outside the sandbox, after a sandboxed run looked blocked (host opted in via sandbox.allowBypass). The model cannot ask for this; only the tool raises it. 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; }
/// What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. 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; }
/// Advisory runtime permission recommendation. The SDK host remains responsible for deciding the request and may reject it.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("permissionRecommendation")]
public PermissionRecommendation? PermissionRecommendation { 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; }
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public override bool? ManagedApprovalRequired
{
get => base.ManagedApprovalRequired;
set => base.ManagedApprovalRequired = value;
}
/// Immediately preceding URL when this request is for a redirect target.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("redirectedFrom")]
public string? RedirectedFrom { get; set; }
/// True when the tool is asking to run this URL fetch outside the sandbox, after the network policy denied the approved URL or the sandbox proxy could not reach it (host opted in via sandbox.allowBypass). The model cannot ask for this; only the tool raises it. This is a request, not a grant: the fetch runs 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; }
/// What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. 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; }
/// URL to be fetched.
[JsonPropertyName("url")]
public required string Url { get; set; }
}
/// Assisted-approval judge information attached to a permission request. Present only in assisted mode; its absence means the judge did not evaluate the request. The `recommendation` conveys the judge's disposition for this request.
/// Nested data type for PermissionAssistedApproval.
[Experimental(Diagnostics.Experimental)]
public sealed partial class PermissionAssistedApproval
{
/// Classified cause of an `error` recommendation. Absent for every other recommendation.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("failureReason")]
public AssistedApprovalJudgeFailureReason? FailureReason { get; set; }
/// Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("model")]
public string? Model { get; set; }
/// Human-readable reason for the judge's recommendation, when available.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reason")]
public string? Reason { get; set; }
/// The assisted-approval safety judge's outcome for this request.
[JsonPropertyName("recommendation")]
public required AssistedApprovalRecommendation Recommendation { 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; }
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { 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; }
/// Repository name with owner associated with the stored memory (store only).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("repoNwo")]
public string? RepoNwo { get; set; }
/// Scope of the stored memory (store only).
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("scope")]
public PermissionRequestMemoryScope? Scope { 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; }
/// Whether the tool declared that permission may be skipped unless a deny rule matches.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("skipPermission")]
public bool? SkipPermission { 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; }
}
/// A declared phase shown in a factory permission prompt.
/// Nested data type for FactoryPermissionPhase.
public sealed partial class FactoryPermissionPhase
{
/// Optional phase detail.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("detail")]
public string? Detail { get; set; }
/// Phase title.
[JsonPropertyName("title")]
public required string Title { get; set; }
}
/// Factory run or authoring permission request.
/// The factory variant of .
public sealed partial class PermissionRequestFactory : PermissionRequest
{
///
[JsonIgnore]
public override string Kind => "factory";
/// Canonical key used for scoped factory approvals.
[JsonPropertyName("approvalKey")]
public required string ApprovalKey { get; set; }
/// Whether this factory is eligible for persistent approval.
[JsonPropertyName("canPersistApproval")]
public required bool CanPersistApproval { get; set; }
/// Factory-declared AI-credit limit before any run/resume caller override is applied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("declaredMaxAiCredits")]
public double? DeclaredMaxAiCredits { get; set; }
/// Factory-declared concurrent-subagent limit before any run/resume caller override is applied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("declaredMaxConcurrentSubagents")]
public long? DeclaredMaxConcurrentSubagents { get; set; }
/// Factory-declared total-subagent limit before any run/resume caller override is applied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("declaredMaxTotalSubagents")]
public long? DeclaredMaxTotalSubagents { get; set; }
/// Factory-declared active-time limit in seconds before any run/resume caller override is applied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("declaredTimeoutSeconds")]
public double? DeclaredTimeoutSeconds { get; set; }
/// Factory description.
[JsonPropertyName("description")]
public required string Description { get; set; }
/// Effective AI-credit limit; omitted means unlimited.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxAiCredits")]
public double? MaxAiCredits { get; set; }
/// Effective concurrent-subagent limit; omitted means unlimited.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxConcurrentSubagents")]
public long? MaxConcurrentSubagents { get; set; }
/// Effective total-subagent limit; omitted means unlimited.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxTotalSubagents")]
public long? MaxTotalSubagents { get; set; }
/// Factory name.
[JsonPropertyName("name")]
public required string Name { get; set; }
/// Factory operation, either run or author.
[JsonPropertyName("operation")]
public required FactoryPermissionOperation Operation { get; set; }
/// Declared factory phases.
[JsonPropertyName("phases")]
public required FactoryPermissionPhase[] Phases { get; set; }
/// Effective active-time limit in seconds; omitted means unlimited.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("timeoutSeconds")]
public double? TimeoutSeconds { 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; }
}
/// Extension sensitive environment variable access request.
/// The extension-env-access variant of .
public sealed partial class PermissionRequestExtensionEnvAccess : PermissionRequest
{
///
[JsonIgnore]
public override string Kind => "extension-env-access";
/// Names of the sensitive environment variables the extension is requesting. Values never appear here.
[JsonPropertyName("environmentVariables")]
public required string[] EnvironmentVariables { get; set; }
/// Name of the extension requesting environment variable 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(PermissionRequestFactory), "factory")]
[JsonDerivedType(typeof(PermissionRequestExtensionPermissionAccess), "extension-permission-access")]
[JsonDerivedType(typeof(PermissionRequestExtensionEnvAccess), "extension-env-access")]
public partial class PermissionRequest
{
/// The type discriminator.
[JsonPropertyName("kind")]
public virtual string Kind { get; set; } = string.Empty;
/// Whether managed policy requires a human response and forbids host auto-approval.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public virtual bool? ManagedApprovalRequired { get; set; }
}
/// Shell command permission prompt.
/// The commands variant of .
public sealed partial class PermissionPromptRequestCommands : PermissionPromptRequest
{
///
[JsonIgnore]
public override string Kind => "commands";
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// 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; }
/// Whether managed policy requires a human response and forbids host auto-approval.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public bool? ManagedApprovalRequired { 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";
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// 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; }
/// Whether managed policy requires a human response and forbids host auto-approval.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public bool? ManagedApprovalRequired { 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";
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// Human-readable description of why the file is being read.
[JsonPropertyName("intention")]
public required string Intention { get; set; }
/// Whether managed policy requires a human response and forbids host auto-approval.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public bool? ManagedApprovalRequired { 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; }
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// Whether the host may offer a server-wide "approve all tools from this server" blanket. Absent is treated as true; the runtime sends false when managed policy disables bypass-permissions mode, which forbids the server-wide escalation while still allowing per-tool approval.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("canOfferServerWideApproval")]
public bool? CanOfferServerWideApproval { get; set; }
/// Advisory runtime permission recommendation. The host remains responsible for deciding the request and may reject it.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("permissionRecommendation")]
public PermissionRecommendation? PermissionRecommendation { 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";
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// Human-readable description of why the URL is being accessed.
[JsonPropertyName("intention")]
public required string Intention { get; set; }
/// Whether managed policy requires a human response and forbids host auto-approval.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public bool? ManagedApprovalRequired { get; set; }
/// Immediately preceding URL when this prompt is for a redirect target.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("redirectedFrom")]
public string? RedirectedFrom { get; set; }
/// True when the tool is asking to run this URL fetch outside the sandbox, after the network policy denied the approved URL or the sandbox proxy could not reach it (host opted in via sandbox.allowBypass). The model cannot ask for this; only the tool raises it. This is a request, not a grant: the fetch runs 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; }
/// What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. 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; }
/// 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; }
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { 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; }
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { 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; }
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { 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";
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// 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";
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// 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; }
}
/// Factory run or authoring permission prompt.
/// The factory variant of .
public sealed partial class PermissionPromptRequestFactory : PermissionPromptRequest
{
///
[JsonIgnore]
public override string Kind => "factory";
/// Canonical key used for scoped factory approvals.
[JsonPropertyName("approvalKey")]
public required string ApprovalKey { get; set; }
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// Whether this factory is eligible for persistent approval.
[JsonPropertyName("canPersistApproval")]
public required bool CanPersistApproval { get; set; }
/// Factory-declared AI-credit limit before any run/resume caller override is applied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("declaredMaxAiCredits")]
public double? DeclaredMaxAiCredits { get; set; }
/// Factory-declared concurrent-subagent limit before any run/resume caller override is applied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("declaredMaxConcurrentSubagents")]
public long? DeclaredMaxConcurrentSubagents { get; set; }
/// Factory-declared total-subagent limit before any run/resume caller override is applied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("declaredMaxTotalSubagents")]
public long? DeclaredMaxTotalSubagents { get; set; }
/// Factory-declared active-time limit in seconds before any run/resume caller override is applied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("declaredTimeoutSeconds")]
public double? DeclaredTimeoutSeconds { get; set; }
/// Factory description.
[JsonPropertyName("description")]
public required string Description { get; set; }
/// Whether managed policy requires a human response and forbids host auto-approval.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalRequired")]
public bool? ManagedApprovalRequired { get; set; }
/// Effective AI-credit limit; omitted means unlimited.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxAiCredits")]
public double? MaxAiCredits { get; set; }
/// Effective concurrent-subagent limit; omitted means unlimited.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxConcurrentSubagents")]
public long? MaxConcurrentSubagents { get; set; }
/// Effective total-subagent limit; omitted means unlimited.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("maxTotalSubagents")]
public long? MaxTotalSubagents { get; set; }
/// Factory name.
[JsonPropertyName("name")]
public required string Name { get; set; }
/// Factory operation, either run or author.
[JsonPropertyName("operation")]
public required FactoryPermissionOperation Operation { get; set; }
/// Declared factory phases.
[JsonPropertyName("phases")]
public required FactoryPermissionPhase[] Phases { get; set; }
/// Effective active-time limit in seconds; omitted means unlimited.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("timeoutSeconds")]
public double? TimeoutSeconds { 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";
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// 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; }
}
/// Extension sensitive environment variable access prompt.
/// The extension-env-access variant of .
public sealed partial class PermissionPromptRequestExtensionEnvAccess : PermissionPromptRequest
{
///
[JsonIgnore]
public override string Kind => "extension-env-access";
/// Assisted-approval judge information for this request; present only in assisted mode.
[Experimental(Diagnostics.Experimental)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("assistedApproval")]
public PermissionAssistedApproval? AssistedApproval { get; set; }
/// Names of the sensitive environment variables the extension is requesting. Values never appear here.
[JsonPropertyName("environmentVariables")]
public required string[] EnvironmentVariables { get; set; }
/// Name of the extension requesting environment variable 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(PermissionPromptRequestFactory), "factory")]
[JsonDerivedType(typeof(PermissionPromptRequestExtensionPermissionAccess), "extension-permission-access")]
[JsonDerivedType(typeof(PermissionPromptRequestExtensionEnvAccess), "extension-env-access")]
public partial class PermissionPromptRequest
{
/// The type discriminator.
[JsonPropertyName("kind")]
public virtual string Kind { get; set; } = string.Empty;
}
/// Permission response variant indicating the request was approved without persisting an approval rule.
/// The approved variant of .
public sealed partial class PermissionResultApproved : PermissionResult
{
///
[JsonIgnore]
public override string Kind => "approved";
/// Whether a managed approval policy already handled this request.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalHandled")]
public bool? ManagedApprovalHandled { get; set; }
}
/// Session-scoped tool-approval rule for specific shell command identifiers.
/// 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; }
}
/// Session-scoped tool-approval rule for read-only filesystem operations.
/// The read variant of .
public sealed partial class UserToolSessionApprovalRead : UserToolSessionApproval
{
///
[JsonIgnore]
public override string Kind => "read";
}
/// Session-scoped tool-approval rule for filesystem write operations.
/// The write variant of .
public sealed partial class UserToolSessionApprovalWrite : UserToolSessionApproval
{
///
[JsonIgnore]
public override string Kind => "write";
}
/// Session-scoped tool-approval rule for an MCP server tool, or all tools on the server when `toolName` is null.
/// 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; }
}
/// Session-scoped tool-approval rule for writes to long-term memory.
/// The memory variant of .
public sealed partial class UserToolSessionApprovalMemory : UserToolSessionApproval
{
///
[JsonIgnore]
public override string Kind => "memory";
}
/// Session-scoped tool-approval rule for a custom tool, keyed by tool name.
/// 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; }
}
/// Session-scoped tool-approval rule for extension-management operations, optionally narrowed by operation.
/// 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; }
}
/// Session-scoped factory approval, optionally narrowed by approval key.
/// The factory variant of .
public sealed partial class UserToolSessionApprovalFactory : UserToolSessionApproval
{
///
[JsonIgnore]
public override string Kind => "factory";
/// Optional factory operation name or canonical approval key.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("approvalKey")]
public string? ApprovalKey { get; set; }
}
/// Session-scoped tool-approval rule for an extension's permission-gated capability access, keyed by extension name.
/// 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; }
}
/// Session-scoped tool-approval rule for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names.
/// The extension-env-access variant of .
public sealed partial class UserToolSessionApprovalExtensionEnvAccess : UserToolSessionApproval
{
///
[JsonIgnore]
public override string Kind => "extension-env-access";
/// Names of the sensitive environment variables this approval covers. Values are never persisted.
[JsonPropertyName("environmentVariables")]
public required string[] EnvironmentVariables { get; set; }
/// 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(UserToolSessionApprovalFactory), "factory")]
[JsonDerivedType(typeof(UserToolSessionApprovalExtensionPermissionAccess), "extension-permission-access")]
[JsonDerivedType(typeof(UserToolSessionApprovalExtensionEnvAccess), "extension-env-access")]
public partial class UserToolSessionApproval
{
/// The type discriminator.
[JsonPropertyName("kind")]
public virtual string Kind { get; set; } = string.Empty;
}
/// Permission response variant that approves a request and remembers the provided approval for the rest of the session.
/// 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; }
/// Whether a managed approval policy already handled this request.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalHandled")]
public bool? ManagedApprovalHandled { get; set; }
}
/// Permission response variant that approves a request and persists the provided approval to a project location key.
/// 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; }
/// Whether a managed approval policy already handled this request.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("managedApprovalHandled")]
public bool? ManagedApprovalHandled { get; set; }
}
/// Permission response variant indicating the request was cancelled before use, with an optional reason.
/// 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; }
}
/// A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value.
/// 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; }
}
/// Permission response variant denied because matching approval rules explicitly blocked the request.
/// 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; }
}
/// Permission response variant denied because no approval rule matched and user confirmation was unavailable.
/// 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";
}
/// Permission response variant denied in an interactive user prompt, with optional feedback and force-reject flag.
/// 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; }
}
/// Permission response variant denying a path under content exclusion policy, with the path and message.
/// 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; }
}
/// Permission response variant denied by a permission-request hook, with optional message and interrupt flag.
/// 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; }
}
/// Single HTTP header entry as a name/value pair.
/// Nested data type for HeaderEntry.
public sealed partial class HeaderEntry
{
/// HTTP response header name as observed by the runtime.
[JsonPropertyName("name")]
public required string Name { get; set; }
/// HTTP response header value as observed by the runtime.
[JsonPropertyName("value")]
public required string Value { get; set; }
}
/// Raw HTTP response details from the OAuth auth challenge, as observed by the runtime.
/// Nested data type for McpOauthHttpResponse.
public sealed partial class McpOauthHttpResponse
{
/// Complete UTF-8 response body for host-specific challenge handling, including an empty string for an empty body. Omitted when the complete body is not valid UTF-8; body read failures fail the HTTP operation rather than exposing a partial response.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("body")]
public string? Body { get; set; }
/// HTTP response headers as observed by the runtime. Order and casing are transport-dependent, and duplicate header names may appear multiple times.
[JsonPropertyName("headers")]
public required HeaderEntry[] Headers { get; set; }
/// HTTP status code returned with the auth challenge.
[JsonPropertyName("statusCode")]
public required int StatusCode { 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; }
}
/// A single slash command available in the session, as listed by the `commands.changed` event.
/// 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; }
}
/// A single resolved skill in `session.skills_loaded`, including source, invocability, enabled state, path, and argument hint.
/// 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; }
/// Canonical slash command name used to invoke the skill, without the leading '/'.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("commandName")]
public string? CommandName { 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, remote, sdk).
[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; }
}
/// A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration.
/// 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; }
/// Whether authored models are preferences or required constraints.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("modelPolicy")]
public AgentModelPolicy? ModelPolicy { get; set; }
/// Authored model ids in priority order, if configured.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("models")]
public string[]? Models { 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; }
}
/// Server-advertised metadata learned through modern discovery or legacy initialization.
/// Nested data type for McpServerMetadata.
public sealed partial class McpServerMetadata
{
/// Non-empty natural-language guidance for using the server, or null when the server omitted instructions or advertised an empty string.
[JsonPropertyName("instructions")]
public string? Instructions { get; set; }
}
/// A single MCP server status summary in `session.mcp_servers_loaded`, including name, status, source, transport, and plugin metadata.
/// 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; }
/// Server-advertised metadata for a connected server. Omitted when no live connection metadata is available, including while pending or when failed, disabled, stopped, or not configured.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("serverMetadata")]
public McpServerMetadata? ServerMetadata { 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, stopped, 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; }
}
/// A single extension discovered by `session.extensions_loaded`, including qualified ID, source, and current status.
/// 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; }
}
/// A single action within a canvas declaration, with its name, optional description, and optional input schema.
/// 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; }
}
/// A single canvas declaration in `session.canvas.registry_changed`, including provider IDs, display metadata, input schema, and actions.
/// 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; }
/// Host-local PNG path for the canvas icon, when supplied.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("icon")]
public string? Icon { 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; }
}
/// MCP App tool `_meta.ui` resource URI and SEP-1865 visibility captured with an `mcp_app.tool_call_complete` result.
/// 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
{
/// MCP App tool `_meta.ui` resource URI and SEP-1865 visibility captured with an `mcp_app.tool_call_complete` result.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("ui")]
public McpAppToolCallCompleteToolMetaUI? Ui { get; set; }
}
/// Routing preference used when the session model is `auto`.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AutoTier : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AutoTier(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Optimize for efficiency.
public static AutoTier Efficiency { get; } = new("efficiency");
/// Balance efficiency and intelligence.
public static AutoTier Balance { get; } = new("balance");
/// Optimize for intelligence.
public static AutoTier Intelligence { get; } = new("intelligence");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AutoTier left, AutoTier right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AutoTier left, AutoTier right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AutoTier other && Equals(other);
///
public bool Equals(AutoTier 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 AutoTier Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AutoTier value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutoTier));
}
}
}
/// 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));
}
}
}
/// Output verbosity level used for supported model calls (e.g. "low", "medium", "high").
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct Verbosity : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public Verbosity(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// A terse response was requested.
public static Verbosity Low { get; } = new("low");
/// A medium amount of response detail was requested.
public static Verbosity Medium { get; } = new("medium");
/// A more detailed response was requested.
public static Verbosity High { get; } = new("high");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(Verbosity left, Verbosity right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(Verbosity left, Verbosity right) => !(left == right);
///
public override bool Equals(object? obj) => obj is Verbosity other && Equals(other);
///
public bool Equals(Verbosity 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 Verbosity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, Verbosity value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(Verbosity));
}
}
}
/// What the user must do to recover from a failure, named as an action rather than as one client's affordance. The runtime cannot know which affordance a client offers — a slash command, a settings pane, a link — so the accompanying message stays host-agnostic and each client renders its own copy from this value. Absent when the runtime knows of no action the user can take.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct RemediationAction : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public RemediationAction(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Authenticate again with the Copilot backend. The current credential is absent, expired, or rejected.
public static RemediationAction SignIn { get; } = new("sign_in");
/// Authenticate as a different account. The current account exists but lacks access to the requested resource.
public static RemediationAction SwitchAccount { get; } = new("switch_account");
/// Inspect which account is currently authenticated before deciding what to change.
public static RemediationAction ShowAccount { get; } = new("show_account");
/// Review or widen the sandbox policy. The blocked path or host is named by the accompanying message or by the tool result the action arrived with.
public static RemediationAction ReviewSandboxPolicy { get; } = new("review_sandbox_policy");
/// Permit outbound network access in the sandbox policy.
public static RemediationAction AllowSandboxOutbound { get; } = new("allow_sandbox_outbound");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(RemediationAction left, RemediationAction right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(RemediationAction left, RemediationAction right) => !(left == right);
///
public override bool Equals(object? obj) => obj is RemediationAction other && Equals(other);
///
public bool Equals(RemediationAction 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 RemediationAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, RemediationAction value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(RemediationAction));
}
}
}
/// 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));
}
}
}
/// Who created the schedule: `user` (an explicit user action such as `/every` or `/after`) or `model` (the agent via the `manage_schedule` tool). Gates whether a scheduled skill that opted out of model invocation may fire: only user-created schedules may.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ScheduleOrigin : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ScheduleOrigin(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The schedule was created by an explicit user action, such as `/every` or `/after`.
public static ScheduleOrigin User { get; } = new("user");
/// The schedule was created by the agent via the `manage_schedule` tool.
public static ScheduleOrigin Model { get; } = new("model");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ScheduleOrigin left, ScheduleOrigin right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ScheduleOrigin left, ScheduleOrigin right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ScheduleOrigin other && Equals(other);
///
public bool Equals(ScheduleOrigin 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 ScheduleOrigin Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ScheduleOrigin value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ScheduleOrigin));
}
}
}
/// 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));
}
}
}
/// Origin of an effective session model change.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ModelChangeSource : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ModelChangeSource(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The user selected a model directly with `/model <id>`.
public static ModelChangeSource ModelCommand { get; } = new("model_command");
/// The user selected the model with `/settings`.
public static ModelChangeSource SettingsCommand { get; } = new("settings_command");
/// The user selected the model with the `/config` alias.
public static ModelChangeSource ConfigCommand { get; } = new("config_command");
/// The user selected the model in the model picker, including the picker opened by bare `/model`.
public static ModelChangeSource ModelPicker { get; } = new("model_picker");
/// Organization-managed settings selected the model.
public static ModelChangeSource ManagedSettings { get; } = new("managed_settings");
/// Repository settings selected the model.
public static ModelChangeSource RepoSettings { get; } = new("repo_settings");
/// Startup model resolution selected the model.
public static ModelChangeSource Startup { get; } = new("startup");
/// Selecting an agent selected its configured model.
public static ModelChangeSource Agent { get; } = new("agent");
/// Entering, leaving, or reconfiguring plan mode selected the model.
public static ModelChangeSource PlanMode { get; } = new("plan_mode");
/// The runtime selected the model automatically, such as rate-limit recovery or refusal fallback.
public static ModelChangeSource Automatic { get; } = new("automatic");
/// An SDK or RPC caller selected the model.
public static ModelChangeSource Sdk { get; } = new("sdk");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ModelChangeSource left, ModelChangeSource right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ModelChangeSource left, ModelChangeSource right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ModelChangeSource other && Equals(other);
///
public bool Equals(ModelChangeSource 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 ModelChangeSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ModelChangeSource value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelChangeSource));
}
}
}
/// Terminal reason an Auto preference activation failed.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AutoTierSwitchFailureReason : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AutoTierSwitchFailureReason(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The candidate model was rejected by model policy.
public static AutoTierSwitchFailureReason PolicyRejected { get; } = new("policy_rejected");
/// The Auto routing request failed or returned an unusable response.
public static AutoTierSwitchFailureReason RequestFailed { get; } = new("request_failed");
/// The runtime could not prepare the Auto routing request.
public static AutoTierSwitchFailureReason SetupFailed { get; } = new("setup_failed");
/// The provider does not support Auto routing.
public static AutoTierSwitchFailureReason Unsupported { get; } = new("unsupported");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AutoTierSwitchFailureReason left, AutoTierSwitchFailureReason right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AutoTierSwitchFailureReason left, AutoTierSwitchFailureReason right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AutoTierSwitchFailureReason other && Equals(other);
///
public bool Equals(AutoTierSwitchFailureReason 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 AutoTierSwitchFailureReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AutoTierSwitchFailureReason value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutoTierSwitchFailureReason));
}
}
}
/// Permission mode for the session.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct PermissionMode : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public PermissionMode(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Permission requests follow the normal approval flow.
public static PermissionMode Manual { get; } = new("manual");
/// Permission requests include an LLM safety recommendation; clients may automatically approve requests judged acceptable.
public static PermissionMode Assisted { get; } = new("assisted");
/// Tool, path, and URL permission requests are automatically approved.
public static PermissionMode AllowAll { get; } = new("allow-all");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(PermissionMode left, PermissionMode right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(PermissionMode left, PermissionMode right) => !(left == right);
///
public override bool Equals(object? obj) => obj is PermissionMode other && Equals(other);
///
public bool Equals(PermissionMode 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 PermissionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, PermissionMode value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionMode));
}
}
}
/// 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));
}
}
}
/// What initiated a conversation compaction.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct CompactionTrigger : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public CompactionTrigger(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Background compaction started automatically because context utilization crossed the background threshold.
public static CompactionTrigger Threshold { get; } = new("threshold");
/// Compaction forced by a context-limit model response (e.g. HTTP 413) before retrying the request.
public static CompactionTrigger ContextLimitRetry { get; } = new("context_limit_retry");
/// User-requested compaction, e.g. the /compact command or the history.compact API.
public static CompactionTrigger Manual { get; } = new("manual");
/// Emergency compaction triggered by high process memory usage.
public static CompactionTrigger MemoryPressure { get; } = new("memory_pressure");
/// Compaction requested while switching to a model with a smaller context window.
public static CompactionTrigger ModelSwitch { get; } = new("model_switch");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(CompactionTrigger left, CompactionTrigger right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(CompactionTrigger left, CompactionTrigger right) => !(left == right);
///
public override bool Equals(object? obj) => obj is CompactionTrigger other && Equals(other);
///
public bool Equals(CompactionTrigger 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 CompactionTrigger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, CompactionTrigger value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(CompactionTrigger));
}
}
}
/// Semantic result of evaluating a task completion request.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct TaskCompletionOutcome : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public TaskCompletionOutcome(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The completion request was accepted and the objective is complete.
public static TaskCompletionOutcome Completed { get; } = new("completed");
/// The completion request was rejected because more work or validation remains.
public static TaskCompletionOutcome Continue { get; } = new("continue");
/// Completion cannot proceed without intervention; the active objective is paused when one is identified.
public static TaskCompletionOutcome Blocked { get; } = new("blocked");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(TaskCompletionOutcome left, TaskCompletionOutcome right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(TaskCompletionOutcome left, TaskCompletionOutcome right) => !(left == right);
///
public override bool Equals(object? obj) => obj is TaskCompletionOutcome other && Equals(other);
///
public bool Equals(TaskCompletionOutcome 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 TaskCompletionOutcome Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, TaskCompletionOutcome value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskCompletionOutcome));
}
}
}
/// Structured terminal status from a tool completion event.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct CompletionReceiptToolStatus : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public CompletionReceiptToolStatus(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The tool completed successfully.
public static CompletionReceiptToolStatus Success { get; } = new("success");
/// The tool failed without a more specific structured status.
public static CompletionReceiptToolStatus Failure { get; } = new("failure");
/// The tool exceeded its time budget.
public static CompletionReceiptToolStatus Timeout { get; } = new("timeout");
/// The user rejected the tool call.
public static CompletionReceiptToolStatus Rejected { get; } = new("rejected");
/// The permissions service denied the tool call.
public static CompletionReceiptToolStatus Denied { get; } = new("denied");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(CompletionReceiptToolStatus left, CompletionReceiptToolStatus right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(CompletionReceiptToolStatus left, CompletionReceiptToolStatus right) => !(left == right);
///
public override bool Equals(object? obj) => obj is CompletionReceiptToolStatus other && Equals(other);
///
public bool Equals(CompletionReceiptToolStatus 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 CompletionReceiptToolStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, CompletionReceiptToolStatus value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(CompletionReceiptToolStatus));
}
}
}
/// Runtime reason the completion decision was accepted.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct CompletionReceiptStopReason : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public CompletionReceiptStopReason(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The model reached a natural terminal response.
public static CompletionReceiptStopReason Natural { get; } = new("natural");
/// A terminal tool ended the interaction.
public static CompletionReceiptStopReason TerminalTool { get; } = new("terminal_tool");
/// The configured agentStop continuation limit was reached.
public static CompletionReceiptStopReason AgentStopBlockLimit { get; } = new("agent_stop_block_limit");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(CompletionReceiptStopReason left, CompletionReceiptStopReason right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(CompletionReceiptStopReason left, CompletionReceiptStopReason right) => !(left == right);
///
public override bool Equals(object? obj) => obj is CompletionReceiptStopReason other && Equals(other);
///
public bool Equals(CompletionReceiptStopReason 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 CompletionReceiptStopReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, CompletionReceiptStopReason value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(CompletionReceiptStopReason));
}
}
}
/// Kind of turn for which HydraFusion routing is running.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FusionTurnKind : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FusionTurnKind(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// A user-message turn.
public static FusionTurnKind User { get; } = new("user");
/// A conversation-compaction turn.
public static FusionTurnKind Compaction { get; } = new("compaction");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FusionTurnKind left, FusionTurnKind right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FusionTurnKind left, FusionTurnKind right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FusionTurnKind other && Equals(other);
///
public bool Equals(FusionTurnKind 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 FusionTurnKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FusionTurnKind value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionTurnKind));
}
}
}
/// Server-recommended routing behavior for a later HydraFusion turn.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FusionFollowUpAction : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FusionFollowUpAction(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Reuse the durable primary model without routing.
public static FusionFollowUpAction ReusePrimary { get; } = new("reuse_primary");
/// Request a new routing decision.
public static FusionFollowUpAction Reroute { get; } = new("reroute");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FusionFollowUpAction left, FusionFollowUpAction right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FusionFollowUpAction left, FusionFollowUpAction right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FusionFollowUpAction other && Equals(other);
///
public bool Equals(FusionFollowUpAction 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 FusionFollowUpAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FusionFollowUpAction value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionFollowUpAction));
}
}
}
/// Validated HydraFusion execution pattern.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FusionPattern : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FusionPattern(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Run one primary solver phase.
public static FusionPattern Single { get; } = new("single");
/// Run a primary phase, a judge, and an optional repair.
public static FusionPattern Cascade { get; } = new("cascade");
/// Run a primary draft, a read-only critique, and a revision.
public static FusionPattern Critique { get; } = new("critique");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FusionPattern left, FusionPattern right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FusionPattern left, FusionPattern right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FusionPattern other && Equals(other);
///
public bool Equals(FusionPattern 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 FusionPattern Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FusionPattern value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPattern));
}
}
}
/// HydraFusion phase kind.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FusionPhaseKind : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FusionPhaseKind(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Primary solver phase.
public static FusionPhaseKind Primary { get; } = new("primary");
/// Read-only cascade judge phase.
public static FusionPhaseKind Judge { get; } = new("judge");
/// Cascade repair phase.
public static FusionPhaseKind Repair { get; } = new("repair");
/// Initial critique-pattern draft phase.
public static FusionPhaseKind Draft { get; } = new("draft");
/// Read-only critique phase.
public static FusionPhaseKind Critic { get; } = new("critic");
/// Critique-pattern revision phase.
public static FusionPhaseKind Revision { get; } = new("revision");
/// Follow-up phase continuing from the resolved model.
public static FusionPhaseKind FollowUp { get; } = new("follow_up");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FusionPhaseKind left, FusionPhaseKind right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FusionPhaseKind left, FusionPhaseKind right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FusionPhaseKind other && Equals(other);
///
public bool Equals(FusionPhaseKind 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 FusionPhaseKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FusionPhaseKind value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPhaseKind));
}
}
}
/// Conversation scope in which a HydraFusion phase executes.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FusionConversationScope : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FusionConversationScope(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Canonical root conversation history.
public static FusionConversationScope Root { get; } = new("root");
/// Isolated read-only review history that does not enter the root conversation.
public static FusionConversationScope Review { get; } = new("review");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FusionConversationScope left, FusionConversationScope right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FusionConversationScope left, FusionConversationScope right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FusionConversationScope other && Equals(other);
///
public bool Equals(FusionConversationScope 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 FusionConversationScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FusionConversationScope value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionConversationScope));
}
}
}
/// 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));
}
}
}
/// What the agent was doing when the user interrupted it.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AgentInterruptedActivity : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AgentInterruptedActivity(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// A request to the model was open.
public static AgentInterruptedActivity ModelCall { get; } = new("model_call");
/// The turn was sleeping between retry attempts.
public static AgentInterruptedActivity RetryBackoff { get; } = new("retry_backoff");
/// One or more tools were executing.
public static AgentInterruptedActivity ToolCall { get; } = new("tool_call");
/// Background sub-agents were running while the main loop was idle.
public static AgentInterruptedActivity BackgroundAgent { get; } = new("background_agent");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AgentInterruptedActivity left, AgentInterruptedActivity right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AgentInterruptedActivity left, AgentInterruptedActivity right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AgentInterruptedActivity other && Equals(other);
///
public bool Equals(AgentInterruptedActivity 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 AgentInterruptedActivity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AgentInterruptedActivity value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentInterruptedActivity));
}
}
}
/// Where the interruption landed relative to the first streamed token.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AgentInterruptedCancelPhase : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AgentInterruptedCancelPhase(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// No output had been produced when the request was cancelled.
public static AgentInterruptedCancelPhase PreFirstToken { get; } = new("pre_first_token");
/// The response was already streaming when the request was cancelled.
public static AgentInterruptedCancelPhase MidStream { get; } = new("mid_stream");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AgentInterruptedCancelPhase left, AgentInterruptedCancelPhase right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AgentInterruptedCancelPhase left, AgentInterruptedCancelPhase right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AgentInterruptedCancelPhase other && Equals(other);
///
public bool Equals(AgentInterruptedCancelPhase 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 AgentInterruptedCancelPhase Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AgentInterruptedCancelPhase value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentInterruptedCancelPhase));
}
}
}
/// Transport used for a failed model call.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ModelCallFailureTransport : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ModelCallFailureTransport(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// HTTP transport, including SSE streams.
public static ModelCallFailureTransport Http { get; } = new("http");
/// WebSocket transport.
public static ModelCallFailureTransport Websocket { get; } = new("websocket");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ModelCallFailureTransport left, ModelCallFailureTransport right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ModelCallFailureTransport left, ModelCallFailureTransport right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ModelCallFailureTransport other && Equals(other);
///
public bool Equals(ModelCallFailureTransport 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 ModelCallFailureTransport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ModelCallFailureTransport value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelCallFailureTransport));
}
}
}
/// Content-safe activity observed while a HydraFusion phase is running.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FusionPhaseActivityKind : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FusionPhaseActivityKind(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The provider produced additional private output bytes.
public static FusionPhaseActivityKind ModelOutput { get; } = new("model_output");
/// A tool began executing inside the phase.
public static FusionPhaseActivityKind ToolStarted { get; } = new("tool_started");
/// A tool finished executing inside the phase.
public static FusionPhaseActivityKind ToolCompleted { get; } = new("tool_completed");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FusionPhaseActivityKind left, FusionPhaseActivityKind right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FusionPhaseActivityKind left, FusionPhaseActivityKind right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FusionPhaseActivityKind other && Equals(other);
///
public bool Equals(FusionPhaseActivityKind 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 FusionPhaseActivityKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FusionPhaseActivityKind value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPhaseActivityKind));
}
}
}
/// How a durable phase checkpoint contributes its exact message to canonical root history.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FusionProjectionMode : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FusionProjectionMode(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Append the exact root message immediately.
public static FusionProjectionMode Append { get; } = new("append");
/// Hold a terminal message outside canonical history until the final commit selects it.
public static FusionProjectionMode Staged { get; } = new("staged");
/// Do not project the checkpoint into root history.
public static FusionProjectionMode None { get; } = new("none");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FusionProjectionMode left, FusionProjectionMode right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FusionProjectionMode left, FusionProjectionMode right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FusionProjectionMode other && Equals(other);
///
public bool Equals(FusionProjectionMode 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 FusionProjectionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FusionProjectionMode value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionProjectionMode));
}
}
}
/// Durable outcome status of a HydraFusion phase.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FusionPhaseStatus : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FusionPhaseStatus(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The phase completed successfully.
public static FusionPhaseStatus Succeeded { get; } = new("succeeded");
/// The phase failed.
public static FusionPhaseStatus Failed { get; } = new("failed");
/// The phase was cancelled.
public static FusionPhaseStatus Cancelled { get; } = new("cancelled");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FusionPhaseStatus left, FusionPhaseStatus right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FusionPhaseStatus left, FusionPhaseStatus right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FusionPhaseStatus other && Equals(other);
///
public bool Equals(FusionPhaseStatus 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 FusionPhaseStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FusionPhaseStatus value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FusionPhaseStatus));
}
}
}
/// 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));
}
}
}
/// 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));
}
}
}
/// Hosted program caller type.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AssistantMessageToolRequestCallerType : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AssistantMessageToolRequestCallerType(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Gets the program value.
public static AssistantMessageToolRequestCallerType Program { get; } = new("program");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AssistantMessageToolRequestCallerType left, AssistantMessageToolRequestCallerType right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AssistantMessageToolRequestCallerType left, AssistantMessageToolRequestCallerType right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AssistantMessageToolRequestCallerType other && Equals(other);
///
public bool Equals(AssistantMessageToolRequestCallerType 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 AssistantMessageToolRequestCallerType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AssistantMessageToolRequestCallerType value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AssistantMessageToolRequestCallerType));
}
}
}
/// 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));
}
}
}
/// Transport used for a successful model call.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AssistantUsageTransport : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AssistantUsageTransport(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// HTTP transport, including SSE streams.
public static AssistantUsageTransport Http { get; } = new("http");
/// WebSocket transport.
public static AssistantUsageTransport Websocket { get; } = new("websocket");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AssistantUsageTransport left, AssistantUsageTransport right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AssistantUsageTransport left, AssistantUsageTransport right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AssistantUsageTransport other && Equals(other);
///
public bool Equals(AssistantUsageTransport 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 AssistantUsageTransport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AssistantUsageTransport value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AssistantUsageTransport));
}
}
}
/// 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));
}
}
}
/// Boundary that produced a model call failure.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ModelCallFailureKind : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ModelCallFailureKind(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The provider returned an API error response.
public static ModelCallFailureKind Api { get; } = new("api");
/// The request transport failed before a usable API response completed.
public static ModelCallFailureKind Transport { get; } = new("transport");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ModelCallFailureKind left, ModelCallFailureKind right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ModelCallFailureKind left, ModelCallFailureKind right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ModelCallFailureKind other && Equals(other);
///
public bool Equals(ModelCallFailureKind 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 ModelCallFailureKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ModelCallFailureKind value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelCallFailureKind));
}
}
}
/// 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));
}
}
}
/// Final outcome of one logical model dispatch after response acceptance processing.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ModelCallFinishedOutcome : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ModelCallFinishedOutcome(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The provider response was accepted for continued agent processing.
public static ModelCallFinishedOutcome Success { get; } = new("success");
/// The dispatch ended with a provider or transport error.
public static ModelCallFinishedOutcome Error { get; } = new("error");
/// The dispatch was cancelled before an accepted response was produced.
public static ModelCallFinishedOutcome Cancelled { get; } = new("cancelled");
/// The provider response was rejected during post-response acceptance processing.
public static ModelCallFinishedOutcome Rejected { get; } = new("rejected");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ModelCallFinishedOutcome left, ModelCallFinishedOutcome right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ModelCallFinishedOutcome left, ModelCallFinishedOutcome right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ModelCallFinishedOutcome other && Equals(other);
///
public bool Equals(ModelCallFinishedOutcome 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 ModelCallFinishedOutcome Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ModelCallFinishedOutcome value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelCallFinishedOutcome));
}
}
}
/// 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");
/// Autopilot stopped the run because the active objective reached its user-set --max-ai-credits limit.
public static AbortReason AutopilotCreditLimit { get; } = new("autopilot_credit_limit");
/// 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));
}
}
}
/// Terminal status reached by a factory execution attempt.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct SystemNotificationFactoryCompletedStatus : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public SystemNotificationFactoryCompletedStatus(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The factory completed successfully.
public static SystemNotificationFactoryCompletedStatus Completed { get; } = new("completed");
/// The factory was halted.
public static SystemNotificationFactoryCompletedStatus Halted { get; } = new("halted");
/// The factory was cancelled.
public static SystemNotificationFactoryCompletedStatus Cancelled { get; } = new("cancelled");
/// The factory failed.
public static SystemNotificationFactoryCompletedStatus Error { get; } = new("error");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(SystemNotificationFactoryCompletedStatus left, SystemNotificationFactoryCompletedStatus right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(SystemNotificationFactoryCompletedStatus left, SystemNotificationFactoryCompletedStatus right) => !(left == right);
///
public override bool Equals(object? obj) => obj is SystemNotificationFactoryCompletedStatus other && Equals(other);
///
public bool Equals(SystemNotificationFactoryCompletedStatus 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 SystemNotificationFactoryCompletedStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, SystemNotificationFactoryCompletedStatus value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SystemNotificationFactoryCompletedStatus));
}
}
}
/// Advisory recommendation the runtime attaches to a permission request whose origin it can vouch for by construction. Unlike the auto-approval judge this does not depend on auto mode and does not evaluate what the tool call does; its absence simply means the runtime has no opinion and the request follows the host's normal approval flow.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct PermissionRecommendation : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public PermissionRecommendation(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The runtime vouches for the request's origin and recommends approving it without prompting. The host still owns the decision and may deny it; deny rules, managed policy, and the auto-approval safety judge all outrank this recommendation.
public static PermissionRecommendation Approve { get; } = new("approve");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(PermissionRecommendation left, PermissionRecommendation right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(PermissionRecommendation left, PermissionRecommendation right) => !(left == right);
///
public override bool Equals(object? obj) => obj is PermissionRecommendation other && Equals(other);
///
public bool Equals(PermissionRecommendation 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 PermissionRecommendation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, PermissionRecommendation value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionRecommendation));
}
}
}
/// 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));
}
}
}
/// Why the assisted-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AssistedApprovalJudgeFailureReason : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AssistedApprovalJudgeFailureReason(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The judge model call exceeded its deadline.
public static AssistedApprovalJudgeFailureReason Timeout { get; } = new("timeout");
/// The judge model call was cancelled before it returned.
public static AssistedApprovalJudgeFailureReason Abort { get; } = new("abort");
/// The judge model call completed but returned no content.
public static AssistedApprovalJudgeFailureReason EmptyResponse { get; } = new("empty_response");
/// The judge model call failed (for example a transport, authentication, or rate-limit error).
public static AssistedApprovalJudgeFailureReason ModelError { get; } = new("model_error");
/// The judge model replied, but the reply carried no ALLOW/DENY verdict.
public static AssistedApprovalJudgeFailureReason ParseError { get; } = new("parse_error");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AssistedApprovalJudgeFailureReason left, AssistedApprovalJudgeFailureReason right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AssistedApprovalJudgeFailureReason left, AssistedApprovalJudgeFailureReason right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AssistedApprovalJudgeFailureReason other && Equals(other);
///
public bool Equals(AssistedApprovalJudgeFailureReason 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 AssistedApprovalJudgeFailureReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AssistedApprovalJudgeFailureReason value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AssistedApprovalJudgeFailureReason));
}
}
}
/// Outcome of the assisted-approval safety judge for a permission request. Present only in assisted mode; its absence means the judge did not evaluate the request.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AssistedApprovalRecommendation : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AssistedApprovalRecommendation(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The judge evaluated the request and recommends automatically approving it.
public static AssistedApprovalRecommendation Approve { get; } = new("approve");
/// The judge evaluated the request and does not recommend automatically approving it; explicit approval is required. Whether that means prompting, denying, or something else is the consumer's decision.
public static AssistedApprovalRecommendation RequireApproval { get; } = new("requireApproval");
/// Assisted mode is enabled, but this request category is never automatically approvable (for example, sandbox-bypass requests), so the judge was not consulted.
public static AssistedApprovalRecommendation Excluded { get; } = new("excluded");
/// The judge was consulted but did not return a usable recommendation, so the request requires explicit approval.
public static AssistedApprovalRecommendation Error { get; } = new("error");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AssistedApprovalRecommendation left, AssistedApprovalRecommendation right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AssistedApprovalRecommendation left, AssistedApprovalRecommendation right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AssistedApprovalRecommendation other && Equals(other);
///
public bool Equals(AssistedApprovalRecommendation 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 AssistedApprovalRecommendation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AssistedApprovalRecommendation value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AssistedApprovalRecommendation));
}
}
}
/// 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));
}
}
}
/// Scope of a stored memory.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct PermissionRequestMemoryScope : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public PermissionRequestMemoryScope(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Store the memory for the current repository.
public static PermissionRequestMemoryScope Repository { get; } = new("repository");
/// Store the memory for the current user.
public static PermissionRequestMemoryScope User { get; } = new("user");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(PermissionRequestMemoryScope left, PermissionRequestMemoryScope right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(PermissionRequestMemoryScope left, PermissionRequestMemoryScope right) => !(left == right);
///
public override bool Equals(object? obj) => obj is PermissionRequestMemoryScope other && Equals(other);
///
public bool Equals(PermissionRequestMemoryScope 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 PermissionRequestMemoryScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, PermissionRequestMemoryScope value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionRequestMemoryScope));
}
}
}
/// Operation gated by a factory permission request.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FactoryPermissionOperation : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FactoryPermissionOperation(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Running a registered factory, which spends subagents, active time, and AI credits under the approved limits.
public static FactoryPermissionOperation Run { get; } = new("run");
/// Authoring a factory, which writes JavaScript into a session-scoped extension and loads it.
public static FactoryPermissionOperation Author { get; } = new("author");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FactoryPermissionOperation left, FactoryPermissionOperation right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FactoryPermissionOperation left, FactoryPermissionOperation right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FactoryPermissionOperation other && Equals(other);
///
public bool Equals(FactoryPermissionOperation 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 FactoryPermissionOperation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FactoryPermissionOperation value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FactoryPermissionOperation));
}
}
}
/// 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));
}
}
}
/// Lifecycle phase for a Rust-owned ephemeral query stream.
[Experimental(Diagnostics.Experimental)]
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct UIEphemeralQueryPhase : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public UIEphemeralQueryPhase(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The ephemeral query stream has begun.
public static UIEphemeralQueryPhase Started { get; } = new("started");
/// A partial result chunk was produced by the stream.
public static UIEphemeralQueryPhase Chunk { get; } = new("chunk");
/// The ephemeral query stream finished successfully.
public static UIEphemeralQueryPhase Completed { get; } = new("completed");
/// The ephemeral query stream ended with an error.
public static UIEphemeralQueryPhase Failed { get; } = new("failed");
/// The ephemeral query stream was cancelled before completing.
public static UIEphemeralQueryPhase Aborted { get; } = new("aborted");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(UIEphemeralQueryPhase left, UIEphemeralQueryPhase right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(UIEphemeralQueryPhase left, UIEphemeralQueryPhase right) => !(left == right);
///
public override bool Equals(object? obj) => obj is UIEphemeralQueryPhase other && Equals(other);
///
public bool Equals(UIEphemeralQueryPhase 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 UIEphemeralQueryPhase Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, UIEphemeralQueryPhase value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UIEphemeralQueryPhase));
}
}
}
/// 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));
}
}
}
/// Coarse request-difficulty bucket for UX explainability.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AutoModeResolvedReasoningBucket : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AutoModeResolvedReasoningBucket(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The request looks low-reasoning; a lighter model is appropriate.
public static AutoModeResolvedReasoningBucket Low { get; } = new("low");
/// The request needs a moderate amount of reasoning.
public static AutoModeResolvedReasoningBucket Medium { get; } = new("medium");
/// The request looks high-reasoning; a stronger model is appropriate.
public static AutoModeResolvedReasoningBucket High { get; } = new("high");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AutoModeResolvedReasoningBucket left, AutoModeResolvedReasoningBucket right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AutoModeResolvedReasoningBucket left, AutoModeResolvedReasoningBucket right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AutoModeResolvedReasoningBucket other && Equals(other);
///
public bool Equals(AutoModeResolvedReasoningBucket 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 AutoModeResolvedReasoningBucket Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AutoModeResolvedReasoningBucket value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AutoModeResolvedReasoningBucket));
}
}
}
/// Summary of which managed-settings channels contributed to the effective session policy. Use the per-channel booleans for exact provenance.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ManagedSettingsResolvedSource : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ManagedSettingsResolvedSource(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Only the server/account channel contributed.
public static ManagedSettingsResolvedSource Server { get; } = new("server");
/// Only the device MDM/plist/registry/file channel contributed.
public static ManagedSettingsResolvedSource Device { get; } = new("device");
/// Only session-local SDK-host injection contributed.
public static ManagedSettingsResolvedSource Client { get; } = new("client");
/// A policy helper registered by device or server policy contributed. Device registration takes priority when present.
public static ManagedSettingsResolvedSource PolicyHelper { get; } = new("policyHelper");
/// More than one channel contributed. Ordinary keys resolve device over server over policy helper per key, while permissions compose restrictively across all present layers.
public static ManagedSettingsResolvedSource Mixed { get; } = new("mixed");
/// No managed policy is in force (no channel contributed).
public static ManagedSettingsResolvedSource None { get; } = new("none");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ManagedSettingsResolvedSource left, ManagedSettingsResolvedSource right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ManagedSettingsResolvedSource left, ManagedSettingsResolvedSource right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ManagedSettingsResolvedSource other && Equals(other);
///
public bool Equals(ManagedSettingsResolvedSource 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 ManagedSettingsResolvedSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ManagedSettingsResolvedSource value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ManagedSettingsResolvedSource));
}
}
}
/// The category of runtime action that enterprise managed settings governed (blocked or capped).
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ManagedSettingsEnforcedAction : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ManagedSettingsEnforcedAction(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// An attempt to turn on a bypass-permissions ("yolo") escalation was refused or capped because policy disables bypass-permissions mode.
public static ManagedSettingsEnforcedAction BypassPermissionsBlocked { get; } = new("bypass_permissions_blocked");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ManagedSettingsEnforcedAction left, ManagedSettingsEnforcedAction right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ManagedSettingsEnforcedAction left, ManagedSettingsEnforcedAction right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ManagedSettingsEnforcedAction other && Equals(other);
///
public bool Equals(ManagedSettingsEnforcedAction 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 ManagedSettingsEnforcedAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ManagedSettingsEnforcedAction value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ManagedSettingsEnforcedAction));
}
}
}
/// For a `bypass_permissions_blocked` action, which permission-escalation primitive was refused.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct ManagedSettingsEnforcedEscalation : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public ManagedSettingsEnforcedEscalation(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Full allow-all permissions — automatically approving tools, paths, and URLs.
public static ManagedSettingsEnforcedEscalation AllowAll { get; } = new("allow_all");
/// Automatic approval of all tool permission requests.
public static ManagedSettingsEnforcedEscalation ApproveAll { get; } = new("approve_all");
/// Assisted mode — keeps normal prompt paths and adds an LLM recommendation, distinct from allow-all.
public static ManagedSettingsEnforcedEscalation AssistedApproval { get; } = new("assisted_approval");
/// Unrestricted filesystem access outside the session's allowed directories.
public static ManagedSettingsEnforcedEscalation UnrestrictedPaths { get; } = new("unrestricted_paths");
/// Unrestricted URL fetch access.
public static ManagedSettingsEnforcedEscalation UnrestrictedUrls { get; } = new("unrestricted_urls");
/// A server-wide MCP "Always Allow" (or `--allow-tool <server>`) blanket that would auto-approve every tool from an MCP server. Capped to per-tool approval; each tool still prompts.
public static ManagedSettingsEnforcedEscalation ServerWideMcpApproval { get; } = new("server_wide_mcp_approval");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(ManagedSettingsEnforcedEscalation left, ManagedSettingsEnforcedEscalation right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(ManagedSettingsEnforcedEscalation left, ManagedSettingsEnforcedEscalation right) => !(left == right);
///
public override bool Equals(object? obj) => obj is ManagedSettingsEnforcedEscalation other && Equals(other);
///
public bool Equals(ManagedSettingsEnforcedEscalation 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 ManagedSettingsEnforcedEscalation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, ManagedSettingsEnforcedEscalation value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ManagedSettingsEnforcedEscalation));
}
}
}
/// 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));
}
}
}
/// Terminal status a factory run committed. A settled run is never `pending` or `running`, so those two members of the run-status domain are deliberately absent.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct FactoryRunSettledStatus : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public FactoryRunSettledStatus(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// The factory body resolved and its result was committed.
public static FactoryRunSettledStatus Completed { get; } = new("completed");
/// The run was stopped by a limit, an approval refusal or another policy decision.
public static FactoryRunSettledStatus Halted { get; } = new("halted");
/// The run was cancelled by its caller or by session disposal.
public static FactoryRunSettledStatus Cancelled { get; } = new("cancelled");
/// The run failed, with `failureType` carrying the class when it has one.
public static FactoryRunSettledStatus Error { get; } = new("error");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(FactoryRunSettledStatus left, FactoryRunSettledStatus right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(FactoryRunSettledStatus left, FactoryRunSettledStatus right) => !(left == right);
///
public override bool Equals(object? obj) => obj is FactoryRunSettledStatus other && Equals(other);
///
public bool Equals(FactoryRunSettledStatus 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 FactoryRunSettledStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, FactoryRunSettledStatus value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(FactoryRunSettledStatus));
}
}
}
/// Source location type (e.g., project, personal-copilot, plugin, builtin, sdk).
[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");
/// Pathless skill supplied lazily by an SDK skill provider.
public static SkillSource Sdk { get; } = new("sdk");
/// 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));
}
}
}
/// Whether configured models are advisory preferences or required constraints.
[JsonConverter(typeof(Converter))]
[DebuggerDisplay("{Value,nq}")]
public readonly struct AgentModelPolicy : IEquatable
{
private readonly string? _value;
/// Initializes a new instance of the struct.
/// The value to associate with this .
[JsonConstructor]
public AgentModelPolicy(string value)
{
ArgumentException.ThrowIfNullOrWhiteSpace(value);
_value = value;
}
/// Gets the value associated with this .
public string Value => _value ?? string.Empty;
/// Treat the authored models as advisory preferences that callers may override.
public static AgentModelPolicy Preferred { get; } = new("preferred");
/// Require subagent execution to use one of the authored models.
public static AgentModelPolicy Required { get; } = new("required");
/// Returns a value indicating whether two instances are equivalent.
public static bool operator ==(AgentModelPolicy left, AgentModelPolicy right) => left.Equals(right);
/// Returns a value indicating whether two instances are not equivalent.
public static bool operator !=(AgentModelPolicy left, AgentModelPolicy right) => !(left == right);
///
public override bool Equals(object? obj) => obj is AgentModelPolicy other && Equals(other);
///
public bool Equals(AgentModelPolicy 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 AgentModelPolicy Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert));
}
///
public override void Write(Utf8JsonWriter writer, AgentModelPolicy value, JsonSerializerOptions options)
{
GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentModelPolicy));
}
}
}
/// 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, stopped, 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 was intentionally stopped and can be restarted on demand when policy permits; a server quarantined by restrictive managed policy stays stopped and cannot be restarted until the policy allows it.
public static McpServerStatus Stopped { get; } = new("stopped");
/// 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(AgentInterruptedData))]
[JsonSerializable(typeof(AgentInterruptedEvent))]
[JsonSerializable(typeof(AssistantFusionPhaseActivityData))]
[JsonSerializable(typeof(AssistantFusionPhaseActivityEvent))]
[JsonSerializable(typeof(AssistantFusionPhaseCompletedData))]
[JsonSerializable(typeof(AssistantFusionPhaseCompletedEvent))]
[JsonSerializable(typeof(AssistantFusionPhaseFailedData))]
[JsonSerializable(typeof(AssistantFusionPhaseFailedEvent))]
[JsonSerializable(typeof(AssistantFusionPhaseStartedData))]
[JsonSerializable(typeof(AssistantFusionPhaseStartedEvent))]
[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(AssistantMessageReasoningBlocks))]
[JsonSerializable(typeof(AssistantMessageServerTools))]
[JsonSerializable(typeof(AssistantMessageStartData))]
[JsonSerializable(typeof(AssistantMessageStartEvent))]
[JsonSerializable(typeof(AssistantMessageToolRequest))]
[JsonSerializable(typeof(AssistantMessageToolRequestCaller))]
[JsonSerializable(typeof(AssistantReasoningData))]
[JsonSerializable(typeof(AssistantReasoningDeltaData))]
[JsonSerializable(typeof(AssistantReasoningDeltaEvent))]
[JsonSerializable(typeof(AssistantReasoningEvent))]
[JsonSerializable(typeof(AssistantServerToolProgressData))]
[JsonSerializable(typeof(AssistantServerToolProgressEvent))]
[JsonSerializable(typeof(AssistantStreamingDeltaData))]
[JsonSerializable(typeof(AssistantStreamingDeltaEvent))]
[JsonSerializable(typeof(AssistantToolCallDeltaData))]
[JsonSerializable(typeof(AssistantToolCallDeltaEvent))]
[JsonSerializable(typeof(AssistantTurnEndData))]
[JsonSerializable(typeof(AssistantTurnEndEvent))]
[JsonSerializable(typeof(AssistantTurnRetryData))]
[JsonSerializable(typeof(AssistantTurnRetryEvent))]
[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(CompletionReceiptEventRange))]
[JsonSerializable(typeof(CompletionReceiptFinalTool))]
[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(FactoryPermissionPhase))]
[JsonSerializable(typeof(FactoryRunSettledData))]
[JsonSerializable(typeof(FactoryRunSettledEvent))]
[JsonSerializable(typeof(FactoryRunStartedData))]
[JsonSerializable(typeof(FactoryRunStartedEvent))]
[JsonSerializable(typeof(FactoryRunUpdatedData))]
[JsonSerializable(typeof(FactoryRunUpdatedEvent))]
[JsonSerializable(typeof(FusionAttribution))]
[JsonSerializable(typeof(FusionFollowUpRecommendation))]
[JsonSerializable(typeof(FusionPhasePlanStep))]
[JsonSerializable(typeof(FusionPhaseUsage))]
[JsonSerializable(typeof(FusionScores))]
[JsonSerializable(typeof(FusionStagedTerminal))]
[JsonSerializable(typeof(GitHubMcpToolConfig))]
[JsonSerializable(typeof(GitHubRepoRef))]
[JsonSerializable(typeof(HandoffRepository))]
[JsonSerializable(typeof(HeaderEntry))]
[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(McpOauthHttpResponse))]
[JsonSerializable(typeof(McpOauthRequiredData))]
[JsonSerializable(typeof(McpOauthRequiredEvent))]
[JsonSerializable(typeof(McpOauthRequiredStaticClientConfig))]
[JsonSerializable(typeof(McpOauthWWWAuthenticateParams))]
[JsonSerializable(typeof(McpPromptsListChangedData))]
[JsonSerializable(typeof(McpPromptsListChangedEvent))]
[JsonSerializable(typeof(McpResourcesListChangedData))]
[JsonSerializable(typeof(McpResourcesListChangedEvent))]
[JsonSerializable(typeof(McpServerMetadata))]
[JsonSerializable(typeof(McpServersLoadedServer))]
[JsonSerializable(typeof(McpToolsListChangedData))]
[JsonSerializable(typeof(McpToolsListChangedEvent))]
[JsonSerializable(typeof(ModelCallFailureData))]
[JsonSerializable(typeof(ModelCallFailureEvent))]
[JsonSerializable(typeof(ModelCallFailureRequestFingerprint))]
[JsonSerializable(typeof(ModelCallFinishedData))]
[JsonSerializable(typeof(ModelCallFinishedEvent))]
[JsonSerializable(typeof(ModelCallStartData))]
[JsonSerializable(typeof(ModelCallStartEvent))]
[JsonSerializable(typeof(OmittedBinaryResult))]
[JsonSerializable(typeof(PendingMessagesModifiedData))]
[JsonSerializable(typeof(PendingMessagesModifiedEvent))]
[JsonSerializable(typeof(PermissionAssistedApproval))]
[JsonSerializable(typeof(PermissionCompletedData))]
[JsonSerializable(typeof(PermissionCompletedEvent))]
[JsonSerializable(typeof(PermissionPromptRequest))]
[JsonSerializable(typeof(PermissionPromptRequestCommands))]
[JsonSerializable(typeof(PermissionPromptRequestCustomTool))]
[JsonSerializable(typeof(PermissionPromptRequestExtensionEnvAccess))]
[JsonSerializable(typeof(PermissionPromptRequestExtensionManagement))]
[JsonSerializable(typeof(PermissionPromptRequestExtensionPermissionAccess))]
[JsonSerializable(typeof(PermissionPromptRequestFactory))]
[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(PermissionRequestExtensionEnvAccess))]
[JsonSerializable(typeof(PermissionRequestExtensionManagement))]
[JsonSerializable(typeof(PermissionRequestExtensionPermissionAccess))]
[JsonSerializable(typeof(PermissionRequestFactory))]
[JsonSerializable(typeof(PermissionRequestHook))]
[JsonSerializable(typeof(PermissionRequestMcp))]
[JsonSerializable(typeof(PermissionRequestMemory))]
[JsonSerializable(typeof(PermissionRequestRead))]
[JsonSerializable(typeof(PermissionRequestShell))]
[JsonSerializable(typeof(PermissionRequestShellCommand))]
[JsonSerializable(typeof(PermissionRequestShellCommandSegment))]
[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(PromptCacheBreakData))]
[JsonSerializable(typeof(PromptCacheBreakEvent))]
[JsonSerializable(typeof(SamplingCompletedData))]
[JsonSerializable(typeof(SamplingCompletedEvent))]
[JsonSerializable(typeof(SamplingRequestedData))]
[JsonSerializable(typeof(SamplingRequestedEvent))]
[JsonSerializable(typeof(SandboxDecisionData))]
[JsonSerializable(typeof(SandboxDecisionEvent))]
[JsonSerializable(typeof(SessionAutoModeResolvedData))]
[JsonSerializable(typeof(SessionAutoModeResolvedEvent))]
[JsonSerializable(typeof(SessionAutoTierSwitchFailedData))]
[JsonSerializable(typeof(SessionAutoTierSwitchFailedEvent))]
[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(SessionCompletionReceiptData))]
[JsonSerializable(typeof(SessionCompletionReceiptEvent))]
[JsonSerializable(typeof(SessionContextChangedData))]
[JsonSerializable(typeof(SessionContextChangedEvent))]
[JsonSerializable(typeof(SessionContextClearedData))]
[JsonSerializable(typeof(SessionContextClearedEvent))]
[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(SessionFusionCompletedData))]
[JsonSerializable(typeof(SessionFusionCompletedEvent))]
[JsonSerializable(typeof(SessionFusionResolvedData))]
[JsonSerializable(typeof(SessionFusionResolvedEvent))]
[JsonSerializable(typeof(SessionFusionRouteFailedData))]
[JsonSerializable(typeof(SessionFusionRouteFailedEvent))]
[JsonSerializable(typeof(SessionFusionRouteStartedData))]
[JsonSerializable(typeof(SessionFusionRouteStartedEvent))]
[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(SessionManagedSettingsEnforcedData))]
[JsonSerializable(typeof(SessionManagedSettingsEnforcedEvent))]
[JsonSerializable(typeof(SessionManagedSettingsResolvedData))]
[JsonSerializable(typeof(SessionManagedSettingsResolvedEvent))]
[JsonSerializable(typeof(SessionMcpServerNeedsReconnectData))]
[JsonSerializable(typeof(SessionMcpServerNeedsReconnectEvent))]
[JsonSerializable(typeof(SessionMcpServerRemovedData))]
[JsonSerializable(typeof(SessionMcpServerRemovedEvent))]
[JsonSerializable(typeof(SessionMcpServerStatusChangedData))]
[JsonSerializable(typeof(SessionMcpServerStatusChangedEvent))]
[JsonSerializable(typeof(SessionMcpServersLoadedData))]
[JsonSerializable(typeof(SessionMcpServersLoadedEvent))]
[JsonSerializable(typeof(SessionModeChangedData))]
[JsonSerializable(typeof(SessionModeChangedEvent))]
[JsonSerializable(typeof(SessionModeNoticeDeliveredData))]
[JsonSerializable(typeof(SessionModeNoticeDeliveredEvent))]
[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(ShutdownAgentMetric))]
[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(SubagentConfiguredData))]
[JsonSerializable(typeof(SubagentConfiguredEvent))]
[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(SystemNotificationFactoryCompleted))]
[JsonSerializable(typeof(SystemNotificationInstructionDiscovered))]
[JsonSerializable(typeof(SystemNotificationNewInboxMessage))]
[JsonSerializable(typeof(SystemNotificationShellCompleted))]
[JsonSerializable(typeof(SystemNotificationShellDetachedCompleted))]
[JsonSerializable(typeof(SystemNotificationUnclassified))]
[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(ToolSearchActivatedData))]
[JsonSerializable(typeof(ToolSearchActivatedEvent))]
[JsonSerializable(typeof(ToolUserRequestedData))]
[JsonSerializable(typeof(ToolUserRequestedEvent))]
[JsonSerializable(typeof(UiEphemeralQueryData))]
[JsonSerializable(typeof(UiEphemeralQueryEvent))]
[JsonSerializable(typeof(UsageCheckpointModelCacheState))]
[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(UserToolSessionApprovalExtensionEnvAccess))]
[JsonSerializable(typeof(UserToolSessionApprovalExtensionManagement))]
[JsonSerializable(typeof(UserToolSessionApprovalExtensionPermissionAccess))]
[JsonSerializable(typeof(UserToolSessionApprovalFactory))]
[JsonSerializable(typeof(UserToolSessionApprovalMcp))]
[JsonSerializable(typeof(UserToolSessionApprovalMemory))]
[JsonSerializable(typeof(UserToolSessionApprovalRead))]
[JsonSerializable(typeof(UserToolSessionApprovalWrite))]
[JsonSerializable(typeof(WorkingDirectoryContext))]
[JsonSerializable(typeof(JsonElement))]
internal sealed partial class SessionEventsJsonContext : JsonSerializerContext;