/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ // AUTO-GENERATED FILE - DO NOT EDIT // Generated from: api.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; using System.Threading; namespace GitHub.Copilot.Rpc; /// Server liveness response, including the echoed message, current server timestamp, and protocol version. [Experimental(Diagnostics.Experimental)] public sealed class PingResult { /// Echoed message (or default greeting). [JsonPropertyName("message")] public string Message { get; set; } = string.Empty; /// Server protocol version number. [JsonPropertyName("protocolVersion")] public long ProtocolVersion { get; set; } /// ISO 8601 timestamp when the server handled the ping. [JsonPropertyName("timestamp")] public DateTimeOffset Timestamp { get; set; } } /// Optional message to echo back to the caller. [Experimental(Diagnostics.Experimental)] internal sealed class PingRequest { /// Optional message to echo back. [JsonPropertyName("message")] public string? Message { get; set; } } /// Handshake result reporting the server's protocol version and package version on success. [Experimental(Diagnostics.Experimental)] internal sealed class ConnectResult { /// Always true on success. [JsonPropertyName("ok")] public bool Ok { get; set; } /// Server protocol version number. [JsonPropertyName("protocolVersion")] public long ProtocolVersion { get; set; } /// Server package version. [JsonPropertyName("version")] public string Version { get; set; } = string.Empty; } /// Optional connection token presented by the SDK client during the handshake. [Experimental(Diagnostics.Experimental)] internal sealed class ConnectRequest { /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN. [JsonPropertyName("token")] public string? Token { get; set; } } /// Long context tier pricing (available for models with extended context windows). [Experimental(Diagnostics.Experimental)] public sealed class ModelBillingTokenPricesLongContext { /// Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens. [EditorBrowsable(EditorBrowsableState.Never)] #if NET5_0_OR_GREATER [Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] #endif [JsonPropertyName("cachePrice")] public double? CachePrice { get; set; } /// AI Credits cost per billing batch of cached (read) tokens. [JsonPropertyName("cacheReadPrice")] public double? CacheReadPrice { get; set; } /// AI Credits cost per billing batch of cache-write (cache creation) tokens. [JsonPropertyName("cacheWritePrice")] public double? CacheWritePrice { get; set; } /// Use maxPromptTokens instead. Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens. [EditorBrowsable(EditorBrowsableState.Never)] #if NET5_0_OR_GREATER [Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] #endif [JsonPropertyName("contextMax")] public long? ContextMax { get; set; } /// AI Credits cost per billing batch of input tokens. [JsonPropertyName("inputPrice")] public double? InputPrice { get; set; } /// Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens. [JsonPropertyName("maxPromptTokens")] public long? MaxPromptTokens { get; set; } /// AI Credits cost per billing batch of output tokens. [JsonPropertyName("outputPrice")] public double? OutputPrice { get; set; } } /// Token-level pricing information for this model. [Experimental(Diagnostics.Experimental)] public sealed class ModelBillingTokenPrices { /// Number of tokens per standard billing batch. [JsonPropertyName("batchSize")] public long? BatchSize { get; set; } /// Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens. [EditorBrowsable(EditorBrowsableState.Never)] #if NET5_0_OR_GREATER [Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] #endif [JsonPropertyName("cachePrice")] public double? CachePrice { get; set; } /// AI Credits cost per billing batch of cached (read) tokens. [JsonPropertyName("cacheReadPrice")] public double? CacheReadPrice { get; set; } /// AI Credits cost per billing batch of cache-write (cache creation) tokens. [JsonPropertyName("cacheWritePrice")] public double? CacheWritePrice { get; set; } /// Use maxPromptTokens instead. Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens. [EditorBrowsable(EditorBrowsableState.Never)] #if NET5_0_OR_GREATER [Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] #endif [JsonPropertyName("contextMax")] public long? ContextMax { get; set; } /// AI Credits cost per billing batch of input tokens. [JsonPropertyName("inputPrice")] public double? InputPrice { get; set; } /// Long context tier pricing (available for models with extended context windows). [JsonPropertyName("longContext")] public ModelBillingTokenPricesLongContext? LongContext { get; set; } /// Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens. [JsonPropertyName("maxPromptTokens")] public long? MaxPromptTokens { get; set; } /// AI Credits cost per billing batch of output tokens. [JsonPropertyName("outputPrice")] public double? OutputPrice { get; set; } } /// Billing information. [Experimental(Diagnostics.Experimental)] public sealed class ModelBilling { /// Whole-number percentage discount (0-100) applied to usage billed through this model. Populated for the synthetic `auto` model, where requests routed by auto-mode are billed at a reduced rate; absent for concrete models. [JsonPropertyName("discountPercent")] public int? DiscountPercent { get; set; } /// Billing cost multiplier relative to the base rate. [JsonPropertyName("multiplier")] public double? Multiplier { get; set; } /// Token-level pricing information for this model. [JsonPropertyName("tokenPrices")] public ModelBillingTokenPrices? TokenPrices { get; set; } } /// Vision-specific limits. [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesLimitsVision { /// Maximum image size in bytes. [JsonPropertyName("max_prompt_image_size")] public long MaxPromptImageSize { get; set; } /// Maximum number of images per prompt. [JsonPropertyName("max_prompt_images")] public long MaxPromptImages { get; set; } /// MIME types the model accepts. [JsonPropertyName("supported_media_types")] public IList SupportedMediaTypes { get => field ??= []; set; } } /// Token limits for prompts, outputs, and context window. [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesLimits { /// Maximum total context window size in tokens. [JsonPropertyName("max_context_window_tokens")] public long? MaxContextWindowTokens { get; set; } /// Maximum number of output/completion tokens. [JsonPropertyName("max_output_tokens")] public long? MaxOutputTokens { get; set; } /// Maximum number of prompt/input tokens. [JsonPropertyName("max_prompt_tokens")] public long? MaxPromptTokens { get; set; } /// Vision-specific limits. [JsonPropertyName("vision")] public ModelCapabilitiesLimitsVision? Vision { get; set; } } /// Feature flags indicating what the model supports. [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesSupports { /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). [JsonPropertyName("adaptive_thinking")] public AdaptiveThinkingSupport? AdaptiveThinking { get; set; } /// Whether this model supports reasoning effort configuration. [JsonPropertyName("reasoningEffort")] public bool? ReasoningEffort { get; set; } /// Whether this model supports vision/image input. [JsonPropertyName("vision")] public bool? Vision { get; set; } } /// Model capabilities and limits. [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilities { /// Token limits for prompts, outputs, and context window. [JsonPropertyName("limits")] public ModelCapabilitiesLimits? Limits { get; set; } /// Feature flags indicating what the model supports. [JsonPropertyName("supports")] public ModelCapabilitiesSupports? Supports { get; set; } } /// Policy state (if applicable). [Experimental(Diagnostics.Experimental)] public sealed class ModelPolicy { /// Current policy state for this model. [JsonPropertyName("state")] public ModelPolicyState State { get; set; } /// Usage terms or conditions for this model. [JsonPropertyName("terms")] public string? Terms { get; set; } } /// Schema for the `Model` type. [Experimental(Diagnostics.Experimental)] public sealed class Model { /// Billing information. [JsonPropertyName("billing")] public ModelBilling? Billing { get; set; } /// Model capabilities and limits. [JsonPropertyName("capabilities")] public ModelCapabilities Capabilities { get => field ??= new(); set; } /// Default reasoning effort level (only present if model supports reasoning effort). [JsonPropertyName("defaultReasoningEffort")] public string? DefaultReasoningEffort { get; set; } /// Model identifier (e.g., "claude-sonnet-4.5"). [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Model capability category for grouping in the model picker. [JsonPropertyName("modelPickerCategory")] public ModelPickerCategory? ModelPickerCategory { get; set; } /// Relative cost tier for token-based billing users. [JsonPropertyName("modelPickerPriceCategory")] public ModelPickerPriceCategory? ModelPickerPriceCategory { get; set; } /// Display name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Policy state (if applicable). [JsonPropertyName("policy")] public ModelPolicy? Policy { get; set; } /// Supported reasoning effort levels (only present if model supports reasoning effort). [JsonPropertyName("supportedReasoningEfforts")] public IList? SupportedReasoningEfforts { get; set; } } /// List of Copilot models available to the resolved user, including capabilities and billing metadata. [Experimental(Diagnostics.Experimental)] public sealed class ModelList { /// List of available models with full metadata. [JsonPropertyName("models")] public IList Models { get => field ??= []; set; } } /// RPC data type for ModelsList operations. [Experimental(Diagnostics.Experimental)] internal sealed class ModelsListRequest { /// GitHub token for per-user model listing. When provided, resolves this token to determine the user's Copilot plan and available models instead of using the global auth. [JsonPropertyName("gitHubToken")] public string? GitHubToken { get; set; } } /// Schema for the `Tool` type. [Experimental(Diagnostics.Experimental)] public sealed class Tool { /// Description of what the tool does. [JsonPropertyName("description")] public string Description { get; set; } = string.Empty; /// Optional instructions for how to use this tool effectively. [JsonPropertyName("instructions")] public string? Instructions { get; set; } /// Tool identifier (e.g., "bash", "grep", "str_replace_editor"). [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Optional namespaced name for declarative filtering (e.g., "playwright/navigate" for MCP tools). [JsonPropertyName("namespacedName")] public string? NamespacedName { get; set; } /// JSON Schema for the tool's input parameters. [JsonPropertyName("parameters")] public IDictionary? Parameters { get; set; } } /// Built-in tools available for the requested model, with their parameters and instructions. [Experimental(Diagnostics.Experimental)] public sealed class ToolList { /// List of available built-in tools with metadata. [JsonPropertyName("tools")] public IList Tools { get => field ??= []; set; } } /// Optional model identifier whose tool overrides should be applied to the listing. [Experimental(Diagnostics.Experimental)] internal sealed class ToolsListRequest { /// Optional model ID — when provided, the returned tool list reflects model-specific overrides. [JsonPropertyName("model")] public string? Model { get; set; } } /// Schema for the `AccountQuotaSnapshot` type. [Experimental(Diagnostics.Experimental)] public sealed class AccountQuotaSnapshot { /// Number of requests included in the entitlement, or -1 for unlimited entitlements. [JsonPropertyName("entitlementRequests")] public long EntitlementRequests { get; set; } /// Whether the user has an unlimited usage entitlement. [JsonPropertyName("isUnlimitedEntitlement")] public bool IsUnlimitedEntitlement { get; set; } /// Number of additional usage requests made this period. [JsonPropertyName("overage")] public double Overage { get; set; } /// Whether additional usage is allowed when quota is exhausted. [JsonPropertyName("overageAllowedWithExhaustedQuota")] public bool OverageAllowedWithExhaustedQuota { get; set; } /// Percentage of entitlement remaining. [JsonPropertyName("remainingPercentage")] public double RemainingPercentage { get; set; } /// Date when the quota resets (ISO 8601 string). [JsonPropertyName("resetDate")] public DateTimeOffset? ResetDate { get; set; } /// Whether usage is still permitted after quota exhaustion. [JsonPropertyName("usageAllowedWithExhaustedQuota")] public bool UsageAllowedWithExhaustedQuota { get; set; } /// Number of requests used so far this period. [JsonPropertyName("usedRequests")] public long UsedRequests { get; set; } } /// Quota usage snapshots for the resolved user, keyed by quota type. [Experimental(Diagnostics.Experimental)] public sealed class AccountGetQuotaResult { /// Quota snapshots keyed by type (e.g., chat, completions, premium_interactions). [JsonPropertyName("quotaSnapshots")] public IDictionary QuotaSnapshots { get => field ??= new Dictionary(); set; } } /// RPC data type for AccountGetQuota operations. [Experimental(Diagnostics.Experimental)] internal sealed class AccountGetQuotaRequest { /// GitHub token for per-user quota lookup. When provided, resolves this token to determine the user's quota instead of using the global auth. [JsonPropertyName("gitHubToken")] public string? GitHubToken { get; set; } } /// Initial authentication info for the session. /// Polymorphic base type discriminated by type. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(AuthInfoHmac), "hmac")] [JsonDerivedType(typeof(AuthInfoEnv), "env")] [JsonDerivedType(typeof(AuthInfoToken), "token")] [JsonDerivedType(typeof(AuthInfoCopilotApiToken), "copilot-api-token")] [JsonDerivedType(typeof(AuthInfoUser), "user")] [JsonDerivedType(typeof(AuthInfoGhCli), "gh-cli")] [JsonDerivedType(typeof(AuthInfoApiKey), "api-key")] public partial class AuthInfo { /// The type discriminator. [JsonPropertyName("type")] public virtual string Type { get; set; } = string.Empty; } /// Schema for the `CopilotUserResponseEndpoints` type. [Experimental(Diagnostics.Experimental)] public sealed class CopilotUserResponseEndpoints { /// Gets or sets the api value. [JsonPropertyName("api")] public string? Api { get; set; } /// Gets or sets the origin-tracker value. [JsonPropertyName("origin-tracker")] public string? OriginTracker { get; set; } /// Gets or sets the proxy value. [JsonPropertyName("proxy")] public string? Proxy { get; set; } /// Gets or sets the telemetry value. [JsonPropertyName("telemetry")] public string? Telemetry { get; set; } } /// RPC data type for CopilotUserResponseOrganizationListItem operations. public sealed class CopilotUserResponseOrganizationListItem { /// Gets or sets the login value. [JsonPropertyName("login")] public string? Login { get; set; } /// Gets or sets the name value. [JsonPropertyName("name")] public string? Name { get; set; } } /// Schema for the `CopilotUserResponseQuotaSnapshotsChat` type. [Experimental(Diagnostics.Experimental)] public sealed class CopilotUserResponseQuotaSnapshotsChat { /// Gets or sets the entitlement value. [JsonPropertyName("entitlement")] public double? Entitlement { get; set; } /// Gets or sets the has_quota value. [JsonPropertyName("has_quota")] public bool? HasQuota { get; set; } /// Gets or sets the overage_count value. [JsonPropertyName("overage_count")] public double? OverageCount { get; set; } /// Gets or sets the overage_permitted value. [JsonPropertyName("overage_permitted")] public bool? OveragePermitted { get; set; } /// Gets or sets the percent_remaining value. [JsonPropertyName("percent_remaining")] public double? PercentRemaining { get; set; } /// Gets or sets the quota_id value. [JsonPropertyName("quota_id")] public string? QuotaId { get; set; } /// Gets or sets the quota_remaining value. [JsonPropertyName("quota_remaining")] public double? QuotaRemaining { get; set; } /// Gets or sets the quota_reset_at value. [JsonPropertyName("quota_reset_at")] public double? QuotaResetAt { get; set; } /// Gets or sets the remaining value. [JsonPropertyName("remaining")] public double? Remaining { get; set; } /// Gets or sets the timestamp_utc value. [JsonPropertyName("timestamp_utc")] public string? TimestampUtc { get; set; } /// Gets or sets the token_based_billing value. [JsonPropertyName("token_based_billing")] public bool? TokenBasedBilling { get; set; } /// Gets or sets the unlimited value. [JsonPropertyName("unlimited")] public bool? Unlimited { get; set; } } /// Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type. [Experimental(Diagnostics.Experimental)] public sealed class CopilotUserResponseQuotaSnapshotsCompletions { /// Gets or sets the entitlement value. [JsonPropertyName("entitlement")] public double? Entitlement { get; set; } /// Gets or sets the has_quota value. [JsonPropertyName("has_quota")] public bool? HasQuota { get; set; } /// Gets or sets the overage_count value. [JsonPropertyName("overage_count")] public double? OverageCount { get; set; } /// Gets or sets the overage_permitted value. [JsonPropertyName("overage_permitted")] public bool? OveragePermitted { get; set; } /// Gets or sets the percent_remaining value. [JsonPropertyName("percent_remaining")] public double? PercentRemaining { get; set; } /// Gets or sets the quota_id value. [JsonPropertyName("quota_id")] public string? QuotaId { get; set; } /// Gets or sets the quota_remaining value. [JsonPropertyName("quota_remaining")] public double? QuotaRemaining { get; set; } /// Gets or sets the quota_reset_at value. [JsonPropertyName("quota_reset_at")] public double? QuotaResetAt { get; set; } /// Gets or sets the remaining value. [JsonPropertyName("remaining")] public double? Remaining { get; set; } /// Gets or sets the timestamp_utc value. [JsonPropertyName("timestamp_utc")] public string? TimestampUtc { get; set; } /// Gets or sets the token_based_billing value. [JsonPropertyName("token_based_billing")] public bool? TokenBasedBilling { get; set; } /// Gets or sets the unlimited value. [JsonPropertyName("unlimited")] public bool? Unlimited { get; set; } } /// Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type. [Experimental(Diagnostics.Experimental)] public sealed class CopilotUserResponseQuotaSnapshotsPremiumInteractions { /// Gets or sets the entitlement value. [JsonPropertyName("entitlement")] public double? Entitlement { get; set; } /// Gets or sets the has_quota value. [JsonPropertyName("has_quota")] public bool? HasQuota { get; set; } /// Gets or sets the overage_count value. [JsonPropertyName("overage_count")] public double? OverageCount { get; set; } /// Gets or sets the overage_permitted value. [JsonPropertyName("overage_permitted")] public bool? OveragePermitted { get; set; } /// Gets or sets the percent_remaining value. [JsonPropertyName("percent_remaining")] public double? PercentRemaining { get; set; } /// Gets or sets the quota_id value. [JsonPropertyName("quota_id")] public string? QuotaId { get; set; } /// Gets or sets the quota_remaining value. [JsonPropertyName("quota_remaining")] public double? QuotaRemaining { get; set; } /// Gets or sets the quota_reset_at value. [JsonPropertyName("quota_reset_at")] public double? QuotaResetAt { get; set; } /// Gets or sets the remaining value. [JsonPropertyName("remaining")] public double? Remaining { get; set; } /// Gets or sets the timestamp_utc value. [JsonPropertyName("timestamp_utc")] public string? TimestampUtc { get; set; } /// Gets or sets the token_based_billing value. [JsonPropertyName("token_based_billing")] public bool? TokenBasedBilling { get; set; } /// Gets or sets the unlimited value. [JsonPropertyName("unlimited")] public bool? Unlimited { get; set; } } /// Schema for the `CopilotUserResponseQuotaSnapshots` type. [Experimental(Diagnostics.Experimental)] public sealed class CopilotUserResponseQuotaSnapshots { /// Schema for the `CopilotUserResponseQuotaSnapshotsChat` type. [JsonPropertyName("chat")] public CopilotUserResponseQuotaSnapshotsChat? Chat { get; set; } /// Schema for the `CopilotUserResponseQuotaSnapshotsCompletions` type. [JsonPropertyName("completions")] public CopilotUserResponseQuotaSnapshotsCompletions? Completions { get; set; } /// Schema for the `CopilotUserResponseQuotaSnapshotsPremiumInteractions` type. [JsonPropertyName("premium_interactions")] public CopilotUserResponseQuotaSnapshotsPremiumInteractions? PremiumInteractions { get; set; } } /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. [Experimental(Diagnostics.Experimental)] public sealed class CopilotUserResponse { /// Gets or sets the access_type_sku value. [JsonPropertyName("access_type_sku")] public string? AccessTypeSku { get; set; } /// Gets or sets the analytics_tracking_id value. [JsonPropertyName("analytics_tracking_id")] public string? AnalyticsTrackingId { get; set; } /// Gets or sets the assigned_date value. [JsonPropertyName("assigned_date")] public string? AssignedDate { get; set; } /// Gets or sets the can_signup_for_limited value. [JsonPropertyName("can_signup_for_limited")] public bool? CanSignupForLimited { get; set; } /// Gets or sets the can_upgrade_plan value. [JsonPropertyName("can_upgrade_plan")] public bool? CanUpgradePlan { get; set; } /// Gets or sets the chat_enabled value. [JsonPropertyName("chat_enabled")] public bool? ChatEnabled { get; set; } /// Gets or sets the cli_remote_control_enabled value. [JsonPropertyName("cli_remote_control_enabled")] public bool? CliRemoteControlEnabled { get; set; } /// Gets or sets the cloud_session_storage_enabled value. [JsonPropertyName("cloud_session_storage_enabled")] public bool? CloudSessionStorageEnabled { get; set; } /// Gets or sets the codex_agent_enabled value. [JsonPropertyName("codex_agent_enabled")] public bool? CodexAgentEnabled { get; set; } /// Gets or sets the copilot_plan value. [JsonPropertyName("copilot_plan")] public string? CopilotPlan { get; set; } /// Gets or sets the copilotignore_enabled value. [JsonPropertyName("copilotignore_enabled")] public bool? CopilotignoreEnabled { get; set; } /// Schema for the `CopilotUserResponseEndpoints` type. [JsonPropertyName("endpoints")] public CopilotUserResponseEndpoints? Endpoints { get; set; } /// Gets or sets the is_mcp_enabled value. [JsonPropertyName("is_mcp_enabled")] public bool? IsMcpEnabled { get; set; } /// Gets or sets the is_staff value. [JsonPropertyName("is_staff")] public bool? IsStaff { get; set; } /// Gets or sets the limited_user_quotas value. [JsonPropertyName("limited_user_quotas")] public IDictionary? LimitedUserQuotas { get; set; } /// Gets or sets the limited_user_reset_date value. [JsonPropertyName("limited_user_reset_date")] public string? LimitedUserResetDate { get; set; } /// Gets or sets the login value. [JsonPropertyName("login")] public string? Login { get; set; } /// Gets or sets the monthly_quotas value. [JsonPropertyName("monthly_quotas")] public IDictionary? MonthlyQuotas { get; set; } /// Gets or sets the organization_list value. [JsonPropertyName("organization_list")] public IList? OrganizationList { get; set; } /// Gets or sets the organization_login_list value. [JsonPropertyName("organization_login_list")] public IList? OrganizationLoginList { get; set; } /// Gets or sets the quota_reset_date value. [JsonPropertyName("quota_reset_date")] public string? QuotaResetDate { get; set; } /// Gets or sets the quota_reset_date_utc value. [JsonPropertyName("quota_reset_date_utc")] public string? QuotaResetDateUtc { get; set; } /// Schema for the `CopilotUserResponseQuotaSnapshots` type. [JsonPropertyName("quota_snapshots")] public CopilotUserResponseQuotaSnapshots? QuotaSnapshots { get; set; } /// Gets or sets the restricted_telemetry value. [JsonPropertyName("restricted_telemetry")] public bool? RestrictedTelemetry { get; set; } /// Gets or sets the te value. [JsonPropertyName("te")] public bool? Te { get; set; } /// Gets or sets the token_based_billing value. [JsonPropertyName("token_based_billing")] public bool? TokenBasedBilling { get; set; } } /// Schema for the `HMACAuthInfo` type. /// The hmac variant of . [Experimental(Diagnostics.Experimental)] public partial class AuthInfoHmac : AuthInfo { /// [JsonIgnore] public override string Type => "hmac"; /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("copilotUser")] public CopilotUserResponse? CopilotUser { get; set; } /// HMAC secret used to sign requests. [JsonPropertyName("hmac")] public required string Hmac { get; set; } /// Authentication host. HMAC auth always targets the public GitHub host. [JsonPropertyName("host")] public required string Host { get; set; } } /// Schema for the `EnvAuthInfo` type. /// The env variant of . [Experimental(Diagnostics.Experimental)] public partial class AuthInfoEnv : AuthInfo { /// [JsonIgnore] public override string Type => "env"; /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("copilotUser")] public CopilotUserResponse? CopilotUser { get; set; } /// Name of the environment variable the token was sourced from. [JsonPropertyName("envVar")] public required string EnvVar { get; set; } /// Authentication host (e.g. https://github.com or a GHES host). [JsonPropertyName("host")] public required string Host { get; set; } /// User login associated with the token. Undefined for server-to-server tokens (those starting with `ghs_`). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("login")] public string? Login { get; set; } /// The token value itself. Treat as a secret. [JsonPropertyName("token")] public required string Token { get; set; } } /// Schema for the `TokenAuthInfo` type. /// The token variant of . [Experimental(Diagnostics.Experimental)] public partial class AuthInfoToken : AuthInfo { /// [JsonIgnore] public override string Type => "token"; /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("copilotUser")] public CopilotUserResponse? CopilotUser { get; set; } /// Authentication host. [JsonPropertyName("host")] public required string Host { get; set; } /// The token value itself. Treat as a secret. [JsonPropertyName("token")] public required string Token { get; set; } } /// Schema for the `CopilotApiTokenAuthInfo` type. /// The copilot-api-token variant of . [Experimental(Diagnostics.Experimental)] public partial class AuthInfoCopilotApiToken : AuthInfo { /// [JsonIgnore] public override string Type => "copilot-api-token"; /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("copilotUser")] public CopilotUserResponse? CopilotUser { get; set; } /// Authentication host (always the public GitHub host). [JsonPropertyName("host")] public required string Host { get; set; } } /// Schema for the `UserAuthInfo` type. /// The user variant of . [Experimental(Diagnostics.Experimental)] public partial class AuthInfoUser : AuthInfo { /// [JsonIgnore] public override string Type => "user"; /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("copilotUser")] public CopilotUserResponse? CopilotUser { get; set; } /// Authentication host. [JsonPropertyName("host")] public required string Host { get; set; } /// OAuth user login. [JsonPropertyName("login")] public required string Login { get; set; } } /// Schema for the `GhCliAuthInfo` type. /// The gh-cli variant of . [Experimental(Diagnostics.Experimental)] public partial class AuthInfoGhCli : AuthInfo { /// [JsonIgnore] public override string Type => "gh-cli"; /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("copilotUser")] public CopilotUserResponse? CopilotUser { get; set; } /// Authentication host. [JsonPropertyName("host")] public required string Host { get; set; } /// User login as reported by `gh auth status`. [JsonPropertyName("login")] public required string Login { get; set; } /// The token returned by `gh auth token`. Treat as a secret. [JsonPropertyName("token")] public required string Token { get; set; } } /// Schema for the `ApiKeyAuthInfo` type. /// The api-key variant of . [Experimental(Diagnostics.Experimental)] public partial class AuthInfoApiKey : AuthInfo { /// [JsonIgnore] public override string Type => "api-key"; /// The API key. Treat as a secret. [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } /// Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("copilotUser")] public CopilotUserResponse? CopilotUser { get; set; } /// Authentication host. [JsonPropertyName("host")] public required string Host { get; set; } } /// Current authentication state. [Experimental(Diagnostics.Experimental)] public sealed class AccountGetCurrentAuthResult { /// Authentication errors from the last auth attempt, if any. [JsonPropertyName("authErrors")] public IList? AuthErrors { get; set; } /// Current authentication information, if authenticated. [JsonPropertyName("authInfo")] public AuthInfo? AuthInfo { get; set; } } /// Schema for the `AccountAllUsers` type. [Experimental(Diagnostics.Experimental)] public sealed class AccountAllUsers { /// Authentication information for this user. [JsonPropertyName("authInfo")] public AuthInfo AuthInfo { get => field ??= new(); set; } /// Associated token, if available. [JsonPropertyName("token")] public string? Token { get; set; } } /// Result of a successful login; throws on failure. [Experimental(Diagnostics.Experimental)] public sealed class AccountLoginResult { /// Whether the credential was persisted to a secure store (system keychain, or the config file when plaintext storage is enabled). False when no secure store was available and the token was not saved, so the consumer can decide how to proceed. [JsonPropertyName("storedInVault")] public bool StoredInVault { get; set; } } /// Credentials to store after successful authentication. [Experimental(Diagnostics.Experimental)] internal sealed class AccountLoginRequest { /// GitHub host URL. [JsonPropertyName("host")] public string Host { get; set; } = string.Empty; /// User login/username. [JsonPropertyName("login")] public string Login { get; set; } = string.Empty; /// GitHub authentication token. [JsonPropertyName("token")] public string Token { get; set; } = string.Empty; } /// Logout result indicating if more users remain. [Experimental(Diagnostics.Experimental)] public sealed class AccountLogoutResult { /// Whether other authenticated users remain after logout. [JsonPropertyName("hasMoreUsers")] public bool HasMoreUsers { get; set; } } /// User to log out. [Experimental(Diagnostics.Experimental)] internal sealed class AccountLogoutRequest { /// Authentication information for the user to log out. [JsonPropertyName("authInfo")] public AuthInfo AuthInfo { get => field ??= new(); set; } } /// Confirmation that the secret values were registered. [Experimental(Diagnostics.Experimental)] public sealed class SecretsAddFilterValuesResult { /// Whether the values were successfully registered. [JsonPropertyName("ok")] public bool Ok { get; set; } } /// Secret values to add to the redaction filter. [Experimental(Diagnostics.Experimental)] internal sealed class SecretsAddFilterValuesRequest { /// Raw secret values to register for redaction. [JsonPropertyName("values")] public IList Values { get => field ??= []; set; } } /// Schema for the `DiscoveredMcpServer` type. [Experimental(Diagnostics.Experimental)] public sealed class DiscoveredMcpServer { /// Whether the server is enabled (not in the disabled list). [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Server name (config key). [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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 string Name { get; set; } = string.Empty; /// Configuration source: user, workspace, plugin, or builtin. [JsonPropertyName("source")] public McpServerSource Source { get; set; } /// Plugin name that provided this server, when source is plugin. [JsonPropertyName("sourcePlugin")] public string? SourcePlugin { get; set; } /// Plugin version that provided this server, when source is plugin. [JsonPropertyName("sourcePluginVersion")] public string? SourcePluginVersion { get; set; } /// Server transport type: stdio, http, sse (deprecated), or memory. [JsonPropertyName("type")] public DiscoveredMcpServerType? Type { get; set; } } /// MCP servers discovered from user, workspace, plugin, and built-in sources. [Experimental(Diagnostics.Experimental)] public sealed class McpDiscoverResult { /// MCP servers discovered from all sources. [JsonPropertyName("servers")] public IList Servers { get => field ??= []; set; } } /// Optional working directory used as context for MCP server discovery. [Experimental(Diagnostics.Experimental)] internal sealed class McpDiscoverRequest { /// Working directory used as context for discovery (e.g., plugin resolution). [JsonPropertyName("workingDirectory")] public string? WorkingDirectory { get; set; } } /// User-configured MCP servers, keyed by server name. [Experimental(Diagnostics.Experimental)] public sealed class McpConfigList { /// All MCP servers from user config, keyed by name. [JsonPropertyName("servers")] public IDictionary Servers { get => field ??= new Dictionary(); set; } } /// MCP server name and configuration to add to user configuration. [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigAddRequest { /// MCP server configuration (stdio process or remote HTTP/SSE). [JsonPropertyName("config")] public JsonElement Config { get; set; } /// Unique name for the MCP server. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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 string Name { get; set; } = string.Empty; } /// MCP server name and replacement configuration to write to user configuration. [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigUpdateRequest { /// MCP server configuration (stdio process or remote HTTP/SSE). [JsonPropertyName("config")] public JsonElement Config { get; set; } /// Name of the MCP server to update. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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 string Name { get; set; } = string.Empty; } /// MCP server name to remove from user configuration. [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigRemoveRequest { /// Name of the MCP server to remove. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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 string Name { get; set; } = string.Empty; } /// MCP server names to enable for new sessions. [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigEnableRequest { /// Names of MCP servers to enable. Each server is removed from the persisted disabled list so new sessions spawn it. Unknown or already-enabled names are ignored. [JsonPropertyName("names")] public IList Names { get => field ??= []; set; } } /// MCP server names to disable for new sessions. [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigDisableRequest { /// Names of MCP servers to disable. Each server is added to the persisted disabled list so new sessions skip it. Already-disabled names are ignored. Active sessions keep their current connections until they end. [JsonPropertyName("names")] public IList Names { get => field ??= []; set; } } /// Information about an installed plugin tracked in global state. [Experimental(Diagnostics.Experimental)] public sealed class InstalledPluginInfo { /// Opaque, stable hash identifying a direct (non-marketplace) install source. Present only for direct repo / URL / local installs; absent for marketplace plugins. Same source yields the same id; distinct sources never collide. [JsonPropertyName("directSourceId")] public string? DirectSourceId { get; set; } /// Whether the plugin is currently enabled for new sessions. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Marketplace the plugin came from. Empty string ("") for direct repo / URL / local installs. [JsonPropertyName("marketplace")] public string Marketplace { get; set; } = string.Empty; /// Plugin name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Installed version (when reported by the plugin manifest). [JsonPropertyName("version")] public string? Version { get; set; } } /// Plugins installed in user/global state. [Experimental(Diagnostics.Experimental)] public sealed class PluginListResult { /// Installed plugins. [JsonPropertyName("plugins")] public IList Plugins { get => field ??= []; set; } } /// Result of installing a plugin. [Experimental(Diagnostics.Experimental)] public sealed class PluginInstallResult { /// Set when the install path is deprecated (e.g. direct repo / URL / local installs). Callers should surface this to end users. [JsonPropertyName("deprecationWarning")] public string? DeprecationWarning { get; set; } /// The newly installed plugin's metadata. [JsonPropertyName("plugin")] public InstalledPluginInfo Plugin { get => field ??= new(); set; } /// Optional post-install message provided by the plugin (e.g. setup instructions). [JsonPropertyName("postInstallMessage")] public string? PostInstallMessage { get; set; } /// Number of skills discovered and installed from the plugin. [JsonPropertyName("skillsInstalled")] public long SkillsInstalled { get; set; } } /// Plugin source and optional working directory for relative-path resolution. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsInstallRequest { /// Plugin install spec. Accepts the same forms as the CLI: "plugin@marketplace" (marketplace install), "owner/repo" or "owner/repo:subpath" (GitHub direct), an http/https/ssh URL, or a local path. Direct (non-marketplace) installs are deprecated and will produce a deprecationWarning in the result. [JsonPropertyName("source")] public string Source { get; set; } = string.Empty; /// Working directory used to resolve relative local paths in `source`. Defaults to the server's current working directory. [JsonPropertyName("workingDirectory")] public string? WorkingDirectory { get; set; } } /// Name (or spec) of the plugin to uninstall. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsUninstallRequest { /// Stable source identity for a direct (non-marketplace) install. Disambiguates uninstall when multiple installed plugins share the same name. [JsonPropertyName("directSourceId")] public string? DirectSourceId { get; set; } /// Plugin name or "plugin@marketplace" spec to uninstall. When ambiguous, prefer the fully-qualified spec. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Result of updating a single plugin. [Experimental(Diagnostics.Experimental)] public sealed class PluginUpdateResult { /// Version after the update, when reported by the plugin manifest. [JsonPropertyName("newVersion")] public string? NewVersion { get; set; } /// Version that was previously installed, when available. [JsonPropertyName("previousVersion")] public string? PreviousVersion { get; set; } /// Number of skills discovered and installed after the update. [JsonPropertyName("skillsInstalled")] public long SkillsInstalled { get; set; } } /// Name (or spec) of the plugin to update. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsUpdateRequest { /// Plugin name or "plugin@marketplace" spec to update. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Schema for the `PluginUpdateAllEntry` type. [Experimental(Diagnostics.Experimental)] public sealed class PluginUpdateAllEntry { /// Error message (failure only). [JsonPropertyName("error")] public string? Error { get; set; } /// Marketplace the plugin came from. Empty string ("") for direct installs. [JsonPropertyName("marketplace")] public string Marketplace { get; set; } = string.Empty; /// Plugin name that was updated. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Version after the update, when available. [JsonPropertyName("newVersion")] public string? NewVersion { get; set; } /// Previously installed version, when available. [JsonPropertyName("previousVersion")] public string? PreviousVersion { get; set; } /// Number of skills installed after the update (success only). [JsonPropertyName("skillsInstalled")] public long? SkillsInstalled { get; set; } /// Whether the update succeeded for this plugin. [JsonPropertyName("success")] public bool Success { get; set; } } /// Result of updating all installed plugins. [Experimental(Diagnostics.Experimental)] public sealed class PluginUpdateAllResult { /// Per-plugin update results in deterministic order. [JsonPropertyName("results")] public IList Results { get => field ??= []; set; } } /// Plugin names (or specs) to enable. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsEnableRequest { /// Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. [JsonPropertyName("names")] public IList Names { get => field ??= []; set; } } /// Plugin names (or specs) to disable. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsDisableRequest { /// Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. [JsonPropertyName("names")] public IList Names { get => field ??= []; set; } } /// Registered marketplace summary. [Experimental(Diagnostics.Experimental)] public sealed class MarketplaceInfo { /// True when this is a default marketplace shipped with the runtime. Defaults are not removable. [JsonPropertyName("isDefault")] public bool? IsDefault { get; set; } /// Marketplace name (matches the @marketplace suffix in plugin specs). [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Human-readable description of where the marketplace data is fetched from (e.g. "GitHub: owner/repo"). [JsonPropertyName("source")] public string Source { get; set; } = string.Empty; } /// All registered marketplaces, including built-in defaults. [Experimental(Diagnostics.Experimental)] public sealed class MarketplaceListResult { /// Registered marketplaces. [JsonPropertyName("marketplaces")] public IList Marketplaces { get => field ??= []; set; } } /// Result of registering a new marketplace. [Experimental(Diagnostics.Experimental)] public sealed class MarketplaceAddResult { /// Final name of the marketplace as resolved from its manifest. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Marketplace source to register. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsMarketplacesAddRequest { /// Marketplace source. Accepts the same forms as the CLI: "owner/repo" or "owner/repo#ref" (GitHub), an http/https/ssh URL (optionally with #ref), a git scp-style URL (user@host:path), or a local path. The marketplace's own name (from its manifest) is used as the registration key. [JsonPropertyName("source")] public string Source { get; set; } = string.Empty; } /// Outcome of the remove attempt, including dependent-plugin info when applicable. [Experimental(Diagnostics.Experimental)] public sealed class MarketplaceRemoveResult { /// Names of installed plugins that prevented removal. Populated only when `removed=false`. [JsonPropertyName("dependentPlugins")] public IList? DependentPlugins { get; set; } /// True when the marketplace was actually removed. False when removal was skipped because the marketplace has dependent plugins and `force` was not set. [JsonPropertyName("removed")] public bool Removed { get; set; } } /// Name of the marketplace to remove and an optional force flag. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsMarketplacesRemoveRequest { /// When true, also uninstall every plugin sourced from this marketplace. When false (default), removal is a no-op if any plugin from this marketplace is installed and the dependent plugin names are returned in the result. [JsonPropertyName("force")] public bool? Force { get; set; } /// Marketplace name to remove. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Plugin entry advertised by a marketplace. [Experimental(Diagnostics.Experimental)] public sealed class MarketplacePluginInfo { /// Short description from the marketplace catalog, when present. [JsonPropertyName("description")] public string? Description { get; set; } /// Plugin name as listed in the marketplace catalog. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Plugins advertised by the marketplace. [Experimental(Diagnostics.Experimental)] public sealed class MarketplaceBrowseResult { /// Plugins advertised by the marketplace. [JsonPropertyName("plugins")] public IList Plugins { get => field ??= []; set; } } /// Name of the marketplace whose plugin catalog to fetch. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsMarketplacesBrowseRequest { /// Marketplace name to browse. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Schema for the `MarketplaceRefreshEntry` type. [Experimental(Diagnostics.Experimental)] public sealed class MarketplaceRefreshEntry { /// Error message (failure only). [JsonPropertyName("error")] public string? Error { get; set; } /// Marketplace name that was refreshed. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Whether the refresh succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Result of refreshing one or more marketplace catalogs. [Experimental(Diagnostics.Experimental)] public sealed class MarketplaceRefreshResult { /// Per-marketplace refresh results in deterministic order. [JsonPropertyName("results")] public IList Results { get => field ??= []; set; } } /// RPC data type for PluginsMarketplacesRefresh operations. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsMarketplacesRefreshRequest { /// Marketplace name to refresh. When omitted, every registered marketplace is refreshed. [JsonPropertyName("name")] public string? Name { get; set; } } /// Schema for the `ServerSkill` type. [Experimental(Diagnostics.Experimental)] public sealed class ServerSkill { /// Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field. [JsonPropertyName("argumentHint")] public string? ArgumentHint { get; set; } /// Description of what the skill does. [JsonPropertyName("description")] public string Description { get; set; } = string.Empty; /// Whether the skill is currently enabled (based on global config). [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Unique identifier for the skill. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Absolute path to the skill file. [JsonPropertyName("path")] public string? Path { get; set; } /// The project path this skill belongs to (only for project/inherited skills). [JsonPropertyName("projectPath")] public string? ProjectPath { get; set; } /// Source location type (e.g., project, personal-copilot, plugin, builtin). [JsonPropertyName("source")] public SkillSource Source { get; set; } /// Whether the skill can be invoked by the user as a slash command. [JsonPropertyName("userInvocable")] public bool UserInvocable { get; set; } } /// Skills discovered across global and project sources. [Experimental(Diagnostics.Experimental)] public sealed class ServerSkillList { /// All discovered skills across all sources. [JsonPropertyName("skills")] public IList Skills { get => field ??= []; set; } } /// Optional project paths and additional skill directories to include in discovery. [Experimental(Diagnostics.Experimental)] internal sealed class SkillsDiscoverRequest { /// When true, omit skills from the host's global sources (personal, custom, plugin, and built-in), returning only project-scoped skills. For multitenant deployments. [JsonPropertyName("excludeHostSkills")] public bool? ExcludeHostSkills { get; set; } /// Optional list of project directory paths to scan for project-scoped skills. [JsonPropertyName("projectPaths")] public IList? ProjectPaths { get; set; } /// Optional list of additional skill directory paths to include. [JsonPropertyName("skillDirectories")] public IList? SkillDirectories { get; set; } } /// Schema for the `SkillDiscoveryPath` type. [Experimental(Diagnostics.Experimental)] public sealed class SkillDiscoveryPath { /// Absolute path of the create/discovery target (may not exist on disk yet). [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Whether this is the canonical directory to create a new skill in its tier. At most one entry per tier is preferred; the `personal-agents` and `custom` scopes are never preferred. [JsonPropertyName("preferredForCreation")] public bool PreferredForCreation { get; set; } /// The input project path this directory was derived from (only for project scope). [JsonPropertyName("projectPath")] public string? ProjectPath { get; set; } /// Which tier this directory belongs to. [JsonPropertyName("scope")] public SkillDiscoveryScope Scope { get; set; } } /// Canonical locations where skills can be created so the runtime will recognize them. [Experimental(Diagnostics.Experimental)] public sealed class SkillDiscoveryPathList { /// Canonical skill create/discovery directories, in priority order. [JsonPropertyName("paths")] public IList Paths { get => field ??= []; set; } } /// Optional project paths to enumerate. [Experimental(Diagnostics.Experimental)] internal sealed class SkillsGetDiscoveryPathsRequest { /// When true, omit the host's personal and custom skill directories, leaving only project directories. For multitenant deployments. [JsonPropertyName("excludeHostSkills")] public bool? ExcludeHostSkills { get; set; } /// Optional list of project directory paths. When omitted or empty, only personal and custom directories are returned. [JsonPropertyName("projectPaths")] public IList? ProjectPaths { get; set; } } /// Skill names to mark as disabled in global configuration, replacing any previous list. [Experimental(Diagnostics.Experimental)] internal sealed class SkillsConfigSetDisabledSkillsRequest { /// List of skill names to disable. [JsonPropertyName("disabledSkills")] public IList DisabledSkills { get => field ??= []; set; } } /// Schema for the `AgentInfo` type. [Experimental(Diagnostics.Experimental)] public sealed class AgentInfo { /// Description of the agent's purpose. [JsonPropertyName("description")] public string Description { get; set; } = string.Empty; /// Human-readable display name. [JsonPropertyName("displayName")] public string DisplayName { get; set; } = string.Empty; /// Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned. [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema. [Experimental(Diagnostics.Experimental)] [JsonPropertyName("mcpServers")] public IDictionary? McpServers { get; set; } /// Preferred model id for this agent. When omitted, inherits the outer agent's model. [JsonPropertyName("model")] public string? Model { get; set; } /// Unique identifier of the custom agent. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path. [JsonPropertyName("path")] public string? Path { get; set; } /// Skill names preloaded into this agent's context. Omitted means none. [JsonPropertyName("skills")] public IList? Skills { get; set; } /// Where the agent definition was loaded from. [JsonPropertyName("source")] public AgentInfoSource? Source { get; set; } /// Allowed tool names for this agent. Empty array means none; omitted means inherit defaults. [JsonPropertyName("tools")] public IList? Tools { get; set; } /// Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only. [JsonPropertyName("userInvocable")] public bool? UserInvocable { get; set; } } /// Agents discovered across user, project, plugin, and remote sources. [Experimental(Diagnostics.Experimental)] public sealed class ServerAgentList { /// All discovered agents across all sources. [JsonPropertyName("agents")] public IList Agents { get => field ??= []; set; } } /// Optional project paths to include in agent discovery. [Experimental(Diagnostics.Experimental)] internal sealed class AgentsDiscoverRequest { /// When true, omit the host's agents (the user-level agent directory and all plugin agents), leaving only project and remote agents. For multitenant deployments. [JsonPropertyName("excludeHostAgents")] public bool? ExcludeHostAgents { get; set; } /// Optional list of project directory paths to scan for project-scoped agents. When omitted or empty, only user/plugin/remote-independent agents are returned (no project scan). [JsonPropertyName("projectPaths")] public IList? ProjectPaths { get; set; } } /// Schema for the `AgentDiscoveryPath` type. [Experimental(Diagnostics.Experimental)] public sealed class AgentDiscoveryPath { /// Absolute path of the search/create directory (may not exist on disk yet). [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Whether this is the canonical directory to create a new agent in its tier. At most one entry per tier is preferred. [JsonPropertyName("preferredForCreation")] public bool PreferredForCreation { get; set; } /// The input project path this directory was derived from (only for project scope). [JsonPropertyName("projectPath")] public string? ProjectPath { get; set; } /// Which tier this directory belongs to. [JsonPropertyName("scope")] public AgentDiscoveryPathScope Scope { get; set; } } /// Canonical locations where custom agents can be created so the runtime will recognize them. [Experimental(Diagnostics.Experimental)] public sealed class AgentDiscoveryPathList { /// Canonical agent create/discovery directories, in priority order. [JsonPropertyName("paths")] public IList Paths { get => field ??= []; set; } } /// Optional project paths to include when enumerating agent discovery directories. [Experimental(Diagnostics.Experimental)] internal sealed class AgentsGetDiscoveryPathsRequest { /// When true, omit the host's user-level agent directory, leaving only project directories. For multitenant deployments (mirrors `discover`'s `excludeHostAgents`). [JsonPropertyName("excludeHostAgents")] public bool? ExcludeHostAgents { get; set; } /// Optional list of project directory paths. When omitted or empty, only the user-level directory is returned. [JsonPropertyName("projectPaths")] public IList? ProjectPaths { get; set; } } /// Schema for the `InstructionSource` type. [Experimental(Diagnostics.Experimental)] public sealed class InstructionSource { /// Glob pattern(s) from frontmatter — when set, this instruction applies only to matching files. [JsonPropertyName("applyTo")] public IList? ApplyTo { get; set; } /// Raw content of the instruction file. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; /// When true, this source starts disabled and must be toggled on by the user. [JsonPropertyName("defaultDisabled")] public bool? DefaultDisabled { get; set; } /// Short description (body after frontmatter) for use in instruction tables. [JsonPropertyName("description")] public string? Description { get; set; } /// Unique identifier for this source (used for toggling). [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Human-readable label. [JsonPropertyName("label")] public string Label { get; set; } = string.Empty; /// Where this source lives — used for UI grouping. [JsonPropertyName("location")] public InstructionSourceLocation Location { get; set; } /// The project path this source was discovered from. Only set by sessionless discovery for repository/working-directory sources, where it disambiguates same-named files (e.g. .github/copilot-instructions.md) across multiple workspace roots. The session-scoped getSources leaves it unset. [JsonPropertyName("projectPath")] public string? ProjectPath { get; set; } /// File path relative to repo or absolute for home. [JsonPropertyName("sourcePath")] public string SourcePath { get; set; } = string.Empty; /// Category of instruction source — used for merge logic. [JsonPropertyName("type")] public InstructionSourceType Type { get; set; } } /// Instruction sources discovered across user, repository, and plugin sources. [Experimental(Diagnostics.Experimental)] public sealed class ServerInstructionSourceList { /// All discovered instruction sources. [JsonPropertyName("sources")] public IList Sources { get => field ??= []; set; } } /// Optional project paths to include in instruction discovery. [Experimental(Diagnostics.Experimental)] internal sealed class InstructionsDiscoverRequest { /// When true, omit the host's instruction sources (user/home-level files and plugin rules), leaving only repository and working-directory sources. For multitenant deployments. [JsonPropertyName("excludeHostInstructions")] public bool? ExcludeHostInstructions { get; set; } /// Optional list of project directory paths to scan for repository/working-directory instruction sources. When omitted or empty, only user-level and plugin instruction sources are returned (no project scan). [JsonPropertyName("projectPaths")] public IList? ProjectPaths { get; set; } } /// Schema for the `InstructionDiscoveryPath` type. [Experimental(Diagnostics.Experimental)] public sealed class InstructionDiscoveryPath { /// Whether the target is a single file or a directory of instruction files. [JsonPropertyName("kind")] public InstructionDiscoveryPathKind Kind { get; set; } /// Which tier this target belongs to. [JsonPropertyName("location")] public InstructionDiscoveryPathLocation Location { get; set; } /// Absolute path of the file or directory (may not exist on disk yet). [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Whether this is the canonical target to create new instructions in its tier. At most one entry per tier is preferred. [JsonPropertyName("preferredForCreation")] public bool PreferredForCreation { get; set; } /// The input project path this target was derived from (only for repository targets). [JsonPropertyName("projectPath")] public string? ProjectPath { get; set; } } /// Canonical files and directories where custom instructions can be created so the runtime will recognize them. [Experimental(Diagnostics.Experimental)] public sealed class InstructionDiscoveryPathList { /// Canonical instruction create/discovery files and directories, in priority order. [JsonPropertyName("paths")] public IList Paths { get => field ??= []; set; } } /// Optional project paths to include when enumerating instruction discovery targets. [Experimental(Diagnostics.Experimental)] internal sealed class InstructionsGetDiscoveryPathsRequest { /// When true, omit the host's user-level instruction targets, leaving only repository targets. For multitenant deployments (mirrors `discover`'s `excludeHostInstructions`). [JsonPropertyName("excludeHostInstructions")] public bool? ExcludeHostInstructions { get; set; } /// Optional list of project directory paths. When omitted or empty, only the user-level targets are returned. [JsonPropertyName("projectPaths")] public IList? ProjectPaths { get; set; } } /// A single user setting's effective value alongside its default, so consumers can render settings left at their default. [Experimental(Diagnostics.Experimental)] public sealed class UserSettingMetadata { /// The centrally-known default for this setting (null when no default is registered). [JsonPropertyName("default")] public JsonElement Default { get; set; } /// True when the user has not set an explicit value for this setting (i.e. it is left at its default). Reflects whether the user has overridden the key, not whether the effective value happens to equal the default — a key explicitly set to a value identical to the default still reports false. [JsonPropertyName("isDefault")] public bool IsDefault { get; set; } /// The effective value: the user's value if set, otherwise the default. [JsonPropertyName("value")] public JsonElement Value { get; set; } } /// Per-key metadata for every known user setting (settings.json overlaid with the legacy config.json, config.json wins), including settings left at their default. Excludes repository- and enterprise-managed overrides. [Experimental(Diagnostics.Experimental)] public sealed class UserSettingsGetResult { /// Every known user setting keyed by setting name, each with its effective value, default, and whether it is at the default. [JsonPropertyName("settings")] public IDictionary Settings { get => field ??= new Dictionary(); set; } } /// Outcome of writing user settings. [Experimental(Diagnostics.Experimental)] public sealed class UserSettingsSetResult { /// Top-level keys whose write landed in settings.json but is shadowed by a value still present in the legacy config.json (config.json wins on read). The write does not take effect until the legacy value is removed. [JsonPropertyName("shadowedKeys")] public IList ShadowedKeys { get => field ??= []; set; } } /// Partial user settings to write to settings.json. Each top-level key is written individually, replacing the existing value; a key whose value is null is removed. [Experimental(Diagnostics.Experimental)] internal sealed class UserSettingsSetRequest { /// Partial user settings to write, as a free-form object keyed by setting name. [JsonPropertyName("settings")] public JsonElement Settings { get; set; } } /// Indicates whether the calling client was registered as the session filesystem provider. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsSetProviderResult { /// Whether the provider was set successfully. [JsonPropertyName("success")] public bool Success { get; set; } } /// Optional capabilities declared by the provider. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsSetProviderCapabilities { /// Whether the provider supports SQLite query/exists operations. [JsonPropertyName("sqlite")] public bool? Sqlite { get; set; } } /// Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider. [Experimental(Diagnostics.Experimental)] internal sealed class SessionFsSetProviderRequest { /// Optional capabilities declared by the provider. [JsonPropertyName("capabilities")] public SessionFsSetProviderCapabilities? Capabilities { get; set; } /// Path conventions used by this filesystem. [JsonPropertyName("conventions")] public SessionFsSetProviderConventions Conventions { get; set; } /// Initial working directory for sessions. [JsonPropertyName("initialCwd")] public string InitialCwd { get; set; } = string.Empty; /// Path within each session's SessionFs where the runtime stores files for that session. [JsonPropertyName("sessionStatePath")] public string SessionStatePath { get; set; } = string.Empty; } /// Indicates whether the calling client was registered as the LLM inference provider. [Experimental(Diagnostics.Experimental)] public sealed class LlmInferenceSetProviderResult { /// Whether the provider was set successfully. [JsonPropertyName("success")] public bool Success { get; set; } } /// Whether the start frame was accepted. [Experimental(Diagnostics.Experimental)] public sealed class LlmInferenceHttpResponseStartResult { /// True when the response start was matched to a pending request; false when unknown. [JsonPropertyName("accepted")] public bool Accepted { get; set; } } /// Response head. [Experimental(Diagnostics.Experimental)] internal sealed class LlmInferenceHttpResponseStartRequest { /// Gets or sets the headers value. [JsonPropertyName("headers")] public IDictionary> Headers { get => field ??= new Dictionary>(); set; } /// Matches the requestId from the originating httpRequestStart frame. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// HTTP status code. [JsonPropertyName("status")] public long Status { get; set; } /// Optional HTTP status reason phrase. [JsonPropertyName("statusText")] public string? StatusText { get; set; } } /// Whether the chunk was accepted. [Experimental(Diagnostics.Experimental)] public sealed class LlmInferenceHttpResponseChunkResult { /// True when the chunk was matched to a pending request; false when unknown. [JsonPropertyName("accepted")] public bool Accepted { get; set; } } /// Set to terminate the response with a transport-level failure. Implies end-of-stream; any further chunks for this requestId are ignored. [Experimental(Diagnostics.Experimental)] public sealed class LlmInferenceHttpResponseChunkError { /// Optional machine-readable error code. [JsonPropertyName("code")] public string? Code { get; set; } /// Human-readable failure description. [JsonPropertyName("message")] public string Message { get; set; } = string.Empty; } /// A response body chunk or terminal error. [Experimental(Diagnostics.Experimental)] internal sealed class LlmInferenceHttpResponseChunkRequest { /// When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text. [JsonPropertyName("binary")] public bool? Binary { get; set; } /// Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty (e.g. when the response body is empty: send a single chunk with empty data and end=true). [JsonPropertyName("data")] public string Data { get; set; } = string.Empty; /// When true, this is the final body chunk for the response. The runtime treats the response body as complete after receiving an end-marked chunk. [JsonPropertyName("end")] public bool? End { get; set; } /// Set to terminate the response with a transport-level failure. Implies end-of-stream; any further chunks for this requestId are ignored. [JsonPropertyName("error")] public LlmInferenceHttpResponseChunkError? Error { get; set; } /// Matches the requestId from the originating httpRequestStart frame. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; } /// Pre-resolved working-directory context for session startup. [Experimental(Diagnostics.Experimental)] public sealed class SessionContext { /// Active git branch. [JsonPropertyName("branch")] public string? Branch { get; set; } /// Most recent working directory for this session. [JsonPropertyName("cwd")] public string Cwd { get; set; } = string.Empty; /// Git repository root, if the cwd was inside a git repo. [JsonPropertyName("gitRoot")] public string? GitRoot { get; set; } /// Repository host type. [JsonPropertyName("hostType")] public SessionContextHostType? HostType { get; set; } /// Repository slug in `owner/name` form, when known. [JsonPropertyName("repository")] public string? Repository { get; set; } } /// GitHub repository the remote session belongs to. [Experimental(Diagnostics.Experimental)] public sealed class RemoteSessionMetadataRepository { /// Branch associated with the remote session. [JsonPropertyName("branch")] public string Branch { get; set; } = string.Empty; /// Repository name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Repository owner. [JsonPropertyName("owner")] public string Owner { get; set; } = string.Empty; } /// Remote session metadata for the session to hand off (typically obtained from `sessions.list` with `source: "remote"`). [Experimental(Diagnostics.Experimental)] public sealed class RemoteSessionMetadataValue { /// Most recent working directory context. [JsonPropertyName("context")] public SessionContext? Context { get; set; } /// Always true for remote sessions. [JsonPropertyName("isRemote")] public bool IsRemote { get; set; } /// Last-modified time as an ISO 8601 timestamp. [JsonPropertyName("modifiedTime")] public string ModifiedTime { get; set; } = string.Empty; /// Optional human-friendly name set via /rename. [JsonPropertyName("name")] public string? Name { get; set; } /// Pull request number associated with the session. [JsonPropertyName("pullRequestNumber")] public long? PullRequestNumber { get; set; } /// Backing remote session IDs (most recent first). [JsonPropertyName("remoteSessionIds")] public IList RemoteSessionIds { get => field ??= []; set; } /// GitHub repository the remote session belongs to. [JsonPropertyName("repository")] public RemoteSessionMetadataRepository Repository { get => field ??= new(); set; } /// Original remote resource identifier (task ID or PR node ID). [JsonPropertyName("resourceId")] public string? ResourceId { get; set; } /// Stable session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Deadline (ISO 8601) at which a CLI remote session becomes stale without further heartbeats. [JsonPropertyName("staleAt")] public string? StaleAt { get; set; } /// Session creation time as an ISO 8601 timestamp. [JsonPropertyName("startTime")] public string StartTime { get; set; } = string.Empty; /// Server-side task state returned by GitHub. [JsonPropertyName("state")] public string? State { get; set; } /// Short summary of the session, when one has been derived. [JsonPropertyName("summary")] public string? Summary { get; set; } /// Whether the remote task originated from CCA or CLI `--remote`. [JsonPropertyName("taskType")] public RemoteSessionMetadataTaskType? TaskType { get; set; } } /// Schema for the `SessionsOpenProgress` type. [Experimental(Diagnostics.Experimental)] public sealed class SessionsOpenProgress { /// Optional step message. [JsonPropertyName("message")] public string? Message { get; set; } /// Step status. [JsonPropertyName("status")] public SessionsOpenProgressStatus Status { get; set; } /// Handoff step. [JsonPropertyName("step")] public SessionsOpenProgressStep Step { get; set; } } /// Result of opening a session. [Experimental(Diagnostics.Experimental)] public sealed class SessionOpenResult { /// Remote session metadata, present when status is `connected`. [JsonPropertyName("metadata")] public RemoteSessionMetadataValue? Metadata { get; set; } /// Handoff progress steps, present when status is `handed_off`. [JsonPropertyName("progress")] public IList? Progress { get; set; } /// Remote session ID, present when status is `connected`. [JsonPropertyName("remoteSessionId")] public string? RemoteSessionId { get; set; } /// In-process SessionClientApi handle for the opened session, returned to CLI callers as a transitional shortcut. Marked internal so the public SDK surface does not expose it; SDK consumers should construct per-session clients from `sessionId` instead. [JsonInclude] [JsonPropertyName("sessionApi")] internal JsonElement? SessionApi { get; set; } /// Opened session ID. Omitted when status is `not_found`. [JsonPropertyName("sessionId")] public string? SessionId { get; set; } /// Startup prompts queued by user-level hook configs at session creation. Only populated when status is `created`; resumed sessions return an empty array. [JsonPropertyName("startupPrompts")] public IList? StartupPrompts { get; set; } /// Outcome of the open request. [JsonPropertyName("status")] public SessionsOpenStatus Status { get; set; } } /// Identifier and optional friendly name assigned to the newly forked session. [Experimental(Diagnostics.Experimental)] public sealed class SessionsForkResult { /// Friendly name assigned to the forked session, if any. [JsonPropertyName("name")] public string? Name { get; set; } /// The new forked session's ID. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsForkRequest { /// Optional friendly name to assign to the forked session. [JsonPropertyName("name")] public string? Name { get; set; } /// Source session ID to fork from. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included. [JsonPropertyName("toEventId")] public string? ToEventId { get; set; } } /// Repository associated with the connected remote session. [Experimental(Diagnostics.Experimental)] public sealed class ConnectedRemoteSessionMetadataRepository { /// Branch associated with the remote session. [JsonPropertyName("branch")] public string Branch { get; set; } = string.Empty; /// Repository name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Repository owner or organization login. [JsonPropertyName("owner")] public string Owner { get; set; } = string.Empty; } /// Metadata for a connected remote session. [Experimental(Diagnostics.Experimental)] public sealed class ConnectedRemoteSessionMetadata { /// Neutral SDK discriminator for the connected remote session kind. [JsonPropertyName("kind")] public ConnectedRemoteSessionMetadataKind Kind { get; set; } /// Last session update time as an ISO 8601 string. [JsonPropertyName("modifiedTime")] public DateTimeOffset ModifiedTime { get; set; } /// Optional friendly session name. [JsonPropertyName("name")] public string? Name { get; set; } /// Pull request number associated with the session. [JsonPropertyName("pullRequestNumber")] public long? PullRequestNumber { get; set; } /// Repository associated with the connected remote session. [JsonPropertyName("repository")] public ConnectedRemoteSessionMetadataRepository Repository { get => field ??= new(); set; } /// Original remote resource identifier. [JsonPropertyName("resourceId")] public string? ResourceId { get; set; } /// SDK session ID for the connected remote session. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Remote session staleness deadline as an ISO 8601 string. [JsonPropertyName("staleAt")] public DateTimeOffset? StaleAt { get; set; } /// Session start time as an ISO 8601 string. [JsonPropertyName("startTime")] public DateTimeOffset StartTime { get; set; } /// Remote session state returned by the backing service. [JsonPropertyName("state")] public string? State { get; set; } /// Optional session summary. [JsonPropertyName("summary")] public string? Summary { get; set; } } /// Remote session connection result. [Experimental(Diagnostics.Experimental)] public sealed class RemoteSessionConnectionResult { /// Metadata for a connected remote session. [JsonPropertyName("metadata")] public ConnectedRemoteSessionMetadata Metadata { get => field ??= new(); set; } /// SDK session ID for the connected remote session. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Remote session connection parameters. [Experimental(Diagnostics.Experimental)] internal sealed class ConnectRemoteSessionParams { /// Session ID to connect to. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Local or remote session metadata entry. Narrow on `isRemote` to access source-specific fields. /// Data type discriminated by isRemote. [Experimental(Diagnostics.Experimental)] public partial class SessionListEntry { /// The boolean discriminator. [JsonPropertyName("isRemote")] public bool IsRemote { get; set; } /// Runtime client name that created/last resumed this session. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("clientName")] public string? ClientName { get; set; } /// Pre-resolved working-directory context for session startup. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("context")] public SessionContext? Context { get; set; } /// True for detached maintenance sessions that should be hidden from normal resume lists. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("isDetached")] public bool? IsDetached { get; set; } /// GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mcTaskId")] public string? McTaskId { get; set; } /// Last-modified time of the session's persisted state, as ISO 8601. [JsonPropertyName("modifiedTime")] public required string ModifiedTime { get; set; } /// Optional human-friendly name set via /rename. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("name")] public string? Name { get; set; } /// Pull request number associated with the session. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("pullRequestNumber")] public long? PullRequestNumber { get; set; } /// Backing remote session IDs (most recent first). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("remoteSessionIds")] public IList? RemoteSessionIds { get; set; } /// GitHub repository the remote session belongs to. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("repository")] public RemoteSessionMetadataRepository? Repository { get; set; } /// Original remote resource identifier (task ID or PR node ID). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("resourceId")] public string? ResourceId { get; set; } /// Stable session identifier. [JsonPropertyName("sessionId")] public required string SessionId { get; set; } /// Deadline (ISO 8601) at which a CLI remote session becomes stale without further heartbeats. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("staleAt")] public string? StaleAt { get; set; } /// Session creation time as an ISO 8601 timestamp. [JsonPropertyName("startTime")] public required string StartTime { get; set; } /// Server-side task state returned by GitHub. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("state")] public string? State { get; set; } /// Short summary of the session, when one has been derived. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("summary")] public string? Summary { get; set; } /// Whether the remote task originated from CCA or CLI `--remote`. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("taskType")] public RemoteSessionMetadataTaskType? TaskType { get; set; } } /// Sessions matching the filter, ordered most-recently-modified first. [Experimental(Diagnostics.Experimental)] public sealed class SessionList { /// Sessions ordered most-recently-modified first. Discriminated by `isRemote`. [JsonPropertyName("sessions")] public IList Sessions { get => field ??= []; set; } } /// Optional filter applied to the returned sessions. [Experimental(Diagnostics.Experimental)] public sealed class SessionListFilter { /// Match sessions whose context.branch equals this value. [JsonPropertyName("branch")] public string? Branch { get; set; } /// Match sessions whose context.cwd equals this value. [JsonPropertyName("cwd")] public string? Cwd { get; set; } /// Match sessions whose context.gitRoot equals this value. [JsonPropertyName("gitRoot")] public string? GitRoot { get; set; } /// Match sessions whose context.repository equals this value. [JsonPropertyName("repository")] public string? Repository { get; set; } } /// Optional source filter, metadata-load limit, and context filter applied to the returned sessions. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsListRequest { /// Optional filter applied to the returned sessions. [JsonPropertyName("filter")] public SessionListFilter? Filter { get; set; } /// When true, include detached maintenance sessions. Defaults to false for user-facing session lists. [JsonPropertyName("includeDetached")] public bool? IncludeDetached { get; set; } /// When provided, only the first N local sessions (sorted by modification time, newest first) load full metadata; remaining sessions return basic info only. Use 0 to return only basic info for every local session. Has no effect on remote entries (which always carry their full shape). [JsonPropertyName("metadataLimit")] public long? MetadataLimit { get; set; } /// Which session sources to include. Defaults to `local` for backward compatibility. [JsonPropertyName("source")] public SessionSource? Source { get; set; } /// Only meaningful when `source` includes remote. When true, propagates errors from the remote service instead of silently returning an empty remote list. Defaults to false. [JsonPropertyName("throwOnError")] public bool? ThrowOnError { get; set; } } /// ID of the local session bound to the given GitHub task, or omitted when none. [Experimental(Diagnostics.Experimental)] public sealed class SessionsFindByTaskIDResult { /// Omitted when no local session is bound to that GitHub task. [JsonPropertyName("sessionId")] public string? SessionId { get; set; } } /// GitHub task ID to look up. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsFindByTaskIDRequest { /// GitHub task ID to look up. [JsonPropertyName("taskId")] public string TaskId { get; set; } = string.Empty; } /// Session ID matching the prefix, omitted when no unique match exists. [Experimental(Diagnostics.Experimental)] public sealed class SessionsFindByPrefixResult { /// Omitted when no unique session matches the prefix (no match or ambiguous). [JsonPropertyName("sessionId")] public string? SessionId { get; set; } } /// UUID prefix to resolve to a unique session ID. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsFindByPrefixRequest { /// UUID prefix (>=7 hex chars, <36 chars). Returns the unique session ID, or undefined when there is no match or the prefix matches multiple sessions. [JsonPropertyName("prefix")] public string Prefix { get; set; } = string.Empty; } /// Most-relevant session ID for the supplied context, or omitted when no sessions exist. [Experimental(Diagnostics.Experimental)] public sealed class SessionsGetLastForContextResult { /// Most-relevant session ID for the supplied context, or omitted when no sessions exist. [JsonPropertyName("sessionId")] public string? SessionId { get; set; } } /// Optional working-directory context used to score session relevance. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsGetLastForContextRequest { /// Optional working-directory context used to score session relevance. When omitted the most-recently-modified session wins. [JsonPropertyName("context")] public SessionContext? Context { get; set; } } /// Absolute path to the session's events.jsonl file on disk. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsGetEventFilePathResult { /// Absolute path to the session's events.jsonl file. [JsonPropertyName("filePath")] public string FilePath { get; set; } = string.Empty; } /// Session ID whose event-log file path to compute. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsGetEventFilePathRequest { /// Session ID whose event-log file path to compute. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Map of sessionId -> on-disk size in bytes for each session's workspace directory. [Experimental(Diagnostics.Experimental)] public sealed class SessionSizes { /// Map of sessionId -> on-disk size in bytes for the session's workspace directory. [JsonPropertyName("sizes")] public IDictionary Sizes { get => field ??= new Dictionary(); set; } } /// Session IDs from the input set that are currently in use by another process. [Experimental(Diagnostics.Experimental)] public sealed class SessionsCheckInUseResult { /// Session IDs from the input set that are currently held by another running process via an alive lock file. [JsonPropertyName("inUse")] public IList InUse { get => field ??= []; set; } } /// Session IDs to test for live in-use locks. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsCheckInUseRequest { /// Session IDs to test for live in-use locks. [JsonPropertyName("sessionIds")] public IList SessionIds { get => field ??= []; set; } } /// The session's persisted remote-steerable flag, or omitted when no value has been persisted. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsGetPersistedRemoteSteerableResult { /// The session's persisted remote-steerable flag if recorded; omitted when no value has been persisted. [JsonPropertyName("remoteSteerable")] public bool? RemoteSteerable { get; set; } } /// Session ID to look up the persisted remote-steerable flag for. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsGetPersistedRemoteSteerableRequest { /// Session ID to look up the persisted remote-steerable flag for. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active. [Experimental(Diagnostics.Experimental)] public sealed class SessionsCloseResult { } /// Session ID to close. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsCloseRequest { /// Session ID to close. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Map of sessionId -> bytes freed by removing the session's workspace directory. [Experimental(Diagnostics.Experimental)] public sealed class SessionBulkDeleteResult { /// Map of sessionId -> bytes freed by removing the session's workspace directory. Sessions whose deletion failed are omitted from this map (failures are logged on the server but not surfaced per-id; check the map for absent IDs to detect them). [JsonPropertyName("freedBytes")] public IDictionary FreedBytes { get => field ??= new Dictionary(); set; } } /// Session IDs to close, deactivate, and delete from disk. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsBulkDeleteRequest { /// Session IDs to close, deactivate, and delete from disk. [JsonPropertyName("sessionIds")] public IList SessionIds { get => field ??= []; set; } } /// Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag. [Experimental(Diagnostics.Experimental)] public sealed class SessionPruneResult { /// Session IDs that would be deleted in dry-run mode (always empty otherwise). [JsonPropertyName("candidates")] public IList Candidates { get => field ??= []; set; } /// Session IDs that were deleted (always empty in dry-run mode). [JsonPropertyName("deleted")] public IList Deleted { get => field ??= []; set; } /// True when no deletions were actually performed. [JsonPropertyName("dryRun")] public bool DryRun { get; set; } /// Total bytes freed (actual when not dry-run, projected when dry-run). [JsonPropertyName("freedBytes")] public long FreedBytes { get; set; } /// Session IDs that were skipped (e.g., named sessions). [JsonPropertyName("skipped")] public IList Skipped { get => field ??= []; set; } } /// Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true). [Experimental(Diagnostics.Experimental)] internal sealed class SessionsPruneOldRequest { /// When true, only report what would be deleted without performing any deletion. [JsonPropertyName("dryRun")] public bool? DryRun { get; set; } /// Session IDs that should never be considered for pruning. [JsonPropertyName("excludeSessionIds")] public IList? ExcludeSessionIds { get; set; } /// When true, named sessions (set via /rename) are also eligible for pruning. [JsonPropertyName("includeNamed")] public bool? IncludeNamed { get; set; } /// Delete sessions whose modifiedTime is at least this many days old. [JsonPropertyName("olderThanDays")] public long OlderThanDays { get; set; } } /// Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed). [Experimental(Diagnostics.Experimental)] public sealed class SessionsSaveResult { } /// Session ID whose pending events should be flushed to disk. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsSaveRequest { /// Session ID whose pending events should be flushed to disk. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session. [Experimental(Diagnostics.Experimental)] public sealed class SessionsReleaseLockResult { } /// Session ID whose in-use lock should be released. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsReleaseLockRequest { /// Session ID whose in-use lock should be released. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `LocalSessionMetadataValue` type. [Experimental(Diagnostics.Experimental)] public sealed class LocalSessionMetadataValue { /// Runtime client name that created/last resumed this session. [JsonPropertyName("clientName")] public string? ClientName { get; set; } /// Pre-resolved working-directory context for session startup. [JsonPropertyName("context")] public SessionContext? Context { get; set; } /// True for detached maintenance sessions that should be hidden from normal resume lists. [JsonPropertyName("isDetached")] public bool? IsDetached { get; set; } /// Always false for local sessions. [JsonPropertyName("isRemote")] public bool IsRemote { get; set; } /// GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control. [JsonPropertyName("mcTaskId")] public string? McTaskId { get; set; } /// Last-modified time of the session's persisted state, as ISO 8601. [JsonPropertyName("modifiedTime")] public string ModifiedTime { get; set; } = string.Empty; /// Optional human-friendly name set via /rename. [JsonPropertyName("name")] public string? Name { get; set; } /// Stable session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Session creation time as an ISO 8601 timestamp. [JsonPropertyName("startTime")] public string StartTime { get; set; } = string.Empty; /// Short summary of the session, when one has been derived. [JsonPropertyName("summary")] public string? Summary { get; set; } } /// The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted. [Experimental(Diagnostics.Experimental)] public sealed class SessionEnrichMetadataResult { /// Enriched records, with summary and context backfilled. Sessions confirmed empty and unnamed may be omitted. [JsonPropertyName("sessions")] public IList Sessions { get => field ??= []; set; } } /// Session metadata records to enrich with summary and context information. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsEnrichMetadataRequest { /// Session metadata records to enrich. Records that already have summary and context are returned unchanged. [JsonPropertyName("sessions")] public IList Sessions { get => field ??= []; set; } } /// Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId. [Experimental(Diagnostics.Experimental)] public sealed class SessionsReloadPluginHooksResult { } /// Active session ID and an optional flag for deferring repo-level hooks until folder trust. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsReloadPluginHooksRequest { /// When true, skip repo-level hooks. Use before folder trust is confirmed; loadDeferredRepoHooks loads them post-trust. [JsonPropertyName("deferRepoHooks")] public bool? DeferRepoHooks { get; set; } /// Active session ID to reload hooks for. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Queued repo-level startup prompts and the total hook command count after loading. [Experimental(Diagnostics.Experimental)] public sealed class SessionLoadDeferredRepoHooksResult { /// Total hook command count (user + plugin + repo) loaded for the session by this call. Captured atomically with startupPrompts so callers don't need to read a separate counter. [JsonPropertyName("hookCount")] public long HookCount { get; set; } /// Repo-level startup prompts queued from repo hook configs. Empty on resume, when no repo configs were pending, or when disableAllHooks is set. [JsonPropertyName("startupPrompts")] public IList StartupPrompts { get => field ??= []; set; } } /// Active session ID whose deferred repo-level hooks should be loaded. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsLoadDeferredRepoHooksRequest { /// Active session ID whose deferred repo-level hooks should be loaded. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload. [Experimental(Diagnostics.Experimental)] public sealed class SessionsSetAdditionalPluginsResult { } /// Schema for the `InstalledPlugin` type. [Experimental(Diagnostics.Experimental)] public sealed class InstalledPlugin { /// Path where the plugin is cached locally. [JsonPropertyName("cache_path")] public string? CachePath { get; set; } /// Whether the plugin is currently enabled. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Installation timestamp. [JsonPropertyName("installed_at")] public string InstalledAt { get; set; } = string.Empty; /// Marketplace the plugin came from (empty string for direct repo installs). [JsonPropertyName("marketplace")] public string Marketplace { get; set; } = string.Empty; /// Plugin name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Source for direct repo installs (when marketplace is empty). [JsonPropertyName("source")] public JsonElement? Source { get; set; } /// Version installed (if available). [JsonPropertyName("version")] public string? Version { get; set; } } /// Manager-wide additional plugins to register; replaces any previously-configured set. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsSetAdditionalPluginsRequest { /// Manager-wide additional plugins to register. Replaces any previously-configured set. Pass an empty array to clear. [JsonPropertyName("plugins")] public IList Plugins { get => field ??= []; set; } } /// Dynamic-context board entry count, when available. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsGetBoardEntryCountResult { /// Board entry count, when available. [JsonPropertyName("count")] public long? Count { get; set; } } /// Session ID whose board entry count should be returned. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsGetBoardEntryCountRequest { /// Session ID whose board entry count should be returned. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// State of the runtime-managed remote-control singleton. /// Polymorphic base type discriminated by state. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "state", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(RemoteControlStatusOff), "off")] [JsonDerivedType(typeof(RemoteControlStatusConnecting), "connecting")] [JsonDerivedType(typeof(RemoteControlStatusActive), "active")] [JsonDerivedType(typeof(RemoteControlStatusError), "error")] public partial class RemoteControlStatus { /// The type discriminator. [JsonPropertyName("state")] public virtual string State { get; set; } = string.Empty; } /// Remote control is not connected. /// The off variant of . [Experimental(Diagnostics.Experimental)] public partial class RemoteControlStatusOff : RemoteControlStatus { /// [JsonIgnore] public override string State => "off"; } /// Remote control is in the middle of initial setup. /// The connecting variant of . [Experimental(Diagnostics.Experimental)] public partial class RemoteControlStatusConnecting : RemoteControlStatus { /// [JsonIgnore] public override string State => "connecting"; /// Session id the connection is attaching to. [JsonPropertyName("attachedSessionId")] public required string AttachedSessionId { get; set; } } /// Remote control is connected to a local session. /// The active variant of . [Experimental(Diagnostics.Experimental)] public partial class RemoteControlStatusActive : RemoteControlStatus { /// [JsonIgnore] public override string State => "active"; /// Session id remote control is pointed at. [JsonPropertyName("attachedSessionId")] public required string AttachedSessionId { get; set; } /// MC frontend URL for this session, when known. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("frontendUrl")] public string? FrontendUrl { get; set; } /// Whether the MC session may steer this session. [JsonPropertyName("isSteerable")] public required bool IsSteerable { get; set; } /// In-process prompt-manager handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. When the CLI migrates to a process-separated SDK, the same bidirectional prompt-routing handshake is expressed via dedicated remote-control RPCs (register/resolve) rather than a shared in-process object. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonInclude] [JsonPropertyName("promptManager")] internal JsonElement? PromptManager { get; set; } } /// The last setup attempt failed. The singleton is otherwise off. /// The error variant of . [Experimental(Diagnostics.Experimental)] public partial class RemoteControlStatusError : RemoteControlStatus { /// [JsonIgnore] public override string State => "error"; /// Session id the failing setup attempt targeted, when known. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("attachedSessionId")] public string? AttachedSessionId { get; set; } /// Human-readable error message from the last setup attempt. [JsonPropertyName("error")] public required string Error { get; set; } } /// Wrapper for the singleton's current status. [Experimental(Diagnostics.Experimental)] public sealed class RemoteControlStatusResult { /// State of the runtime-managed remote-control singleton. [JsonPropertyName("status")] public RemoteControlStatus Status { get => field ??= new(); set; } } /// Reattach to an existing MC session without creating a new one. [Experimental(Diagnostics.Experimental)] public sealed class RemoteControlConfigExistingMcSession { /// Existing MC session ID to reattach to. [JsonPropertyName("mcSessionId")] public string McSessionId { get; set; } = string.Empty; /// Existing MC task ID for the reattached session. [JsonPropertyName("mcTaskId")] public string McTaskId { get; set; } = string.Empty; } /// Configuration for the runtime-managed remote-control singleton. [Experimental(Diagnostics.Experimental)] public sealed class RemoteControlConfig { /// Reattach to an existing MC session without creating a new one. [JsonPropertyName("existingMcSession")] public RemoteControlConfigExistingMcSession? ExistingMcSession { get; set; } /// Whether the user explicitly requested remote (vs. implicit session-sync). Controls warning surfacing for missing-repo cases. [JsonPropertyName("explicit")] public bool Explicit { get; set; } /// Whether remote export should be enabled. [JsonPropertyName("remote")] public bool Remote { get; set; } /// When true, suppresses timeline messages on successful setup. [JsonPropertyName("silent")] public bool Silent { get; set; } /// Whether the MC session may steer the local session (write mode). [JsonPropertyName("steerable")] public bool Steerable { get; set; } /// Existing Mission Control task ID to attach the exported session to. [JsonPropertyName("taskId")] public string? TaskId { get; set; } } /// Parameters for attaching the remote-control singleton to a session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsStartRemoteControlRequest { /// Configuration for the runtime-managed remote-control singleton. [JsonPropertyName("config")] public RemoteControlConfig Config { get => field ??= new(); set; } /// Local session id to attach remote control to. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Outcome of a transferRemoteControl call. [Experimental(Diagnostics.Experimental)] public sealed class RemoteControlTransferResult { /// State of the runtime-managed remote-control singleton. [JsonPropertyName("status")] public RemoteControlStatus Status { get => field ??= new(); set; } /// Whether the rebinding actually happened. [JsonPropertyName("transferred")] public bool Transferred { get; set; } } /// Parameters for atomically rebinding the remote-control singleton. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsTransferRemoteControlRequest { /// When provided, the transfer is rejected unless the singleton currently points at this session id (compare-and-swap semantics to avoid clobbering newer state). [JsonPropertyName("expectedFromSessionId")] public string? ExpectedFromSessionId { get; set; } /// Local session id to point remote control at. [JsonPropertyName("toSessionId")] public string ToSessionId { get; set; } = string.Empty; } /// Patch for the singleton's steering state. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsSetRemoteControlSteeringRequest { /// Target steering state. Today only `true` is actionable on the underlying exporter; `false` is reserved for future use. [JsonPropertyName("enabled")] public bool Enabled { get; set; } } /// Outcome of a stopRemoteControl call. [Experimental(Diagnostics.Experimental)] public sealed class RemoteControlStopResult { /// State of the runtime-managed remote-control singleton. [JsonPropertyName("status")] public RemoteControlStatus Status { get => field ??= new(); set; } /// Whether the singleton was actually torn down by this call. [JsonPropertyName("stopped")] public bool Stopped { get; set; } } /// RPC data type for SessionsStopRemoteControl operations. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsStopRemoteControlRequest { /// When provided, the stop is rejected unless the singleton currently points at this session id (compare-and-swap semantics). [JsonPropertyName("expectedSessionId")] public string? ExpectedSessionId { get; set; } /// When true, the singleton is unconditionally torn down regardless of `expectedSessionId`. Use during shutdown or explicit `/remote off`. [JsonPropertyName("force")] public bool? Force { get; set; } } /// Schema for the `SessionsPollSpawnedSessionsEvent` type. [Experimental(Diagnostics.Experimental)] public sealed class SessionsPollSpawnedSessionsEvent { /// Session id of the newly-spawned session. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Batch of spawn events plus a cursor for follow-up polls. [Experimental(Diagnostics.Experimental)] internal sealed class PollSpawnedSessionsResult { /// Opaque cursor to pass back to receive only events after this batch. [JsonPropertyName("cursor")] public string Cursor { get; set; } = string.Empty; /// Spawn events emitted since the supplied cursor. [JsonPropertyName("events")] public IList Events { get => field ??= []; set; } } /// RPC data type for SessionsPollSpawnedSessions operations. [Experimental(Diagnostics.Experimental)] internal sealed class SessionsPollSpawnedSessionsRequest { /// Opaque cursor returned by a previous poll. Omit on the first call to receive any spawn events buffered since the runtime started. [JsonPropertyName("cursor")] public string? Cursor { get; set; } /// Milliseconds to wait for new spawn events when the cursor is at the tail. 0 (default) returns immediately even if no events are buffered. Capped at 60000ms. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonPropertyName("waitMs")] public TimeSpan? Wait { get; set; } } /// Handle for releasing the extension tool registration. [Experimental(Diagnostics.Experimental)] internal sealed class RegisterExtensionToolsResult { /// In-process unsubscribe function (CLI-only optimization). Marked internal: replaced by an explicit `extensions.unregister` RPC in the SDK migration. [JsonInclude] [JsonPropertyName("unsubscribe")] internal JsonElement Unsubscribe { get; set; } } /// Optional registration options. [Experimental(Diagnostics.Experimental)] public sealed class SessionsRegisterExtensionToolsOnSessionOptions { /// In-process `() => boolean` gating callback (CLI-only optimization). Marked internal: replaced by runtime-side enable/disable RPCs in the SDK migration. [JsonInclude] [JsonPropertyName("enabled")] internal JsonElement? Enabled { get; set; } } /// Params to attach an extension loader's tools to a session. [Experimental(Diagnostics.Experimental)] internal sealed class RegisterExtensionToolsParams { /// In-process ExtensionLoader handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. When the CLI migrates to a process-separated SDK, extension discovery/launch moves entirely into the runtime — the CLI passes pure config (search paths, disabled ids) via SessionOptions instead. [JsonInclude] [JsonPropertyName("loader")] internal JsonElement Loader { get; set; } /// Optional registration options. [JsonPropertyName("options")] public SessionsRegisterExtensionToolsOnSessionOptions? Options { get; set; } /// Session to register extension tools on. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Params to attach or detach an in-process ExtensionController delegate. [Experimental(Diagnostics.Experimental)] internal sealed class ConfigureSessionExtensionsParams { /// In-process ExtensionController delegate (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. The post-SDK extension surface exposes list/enable/disable/reload via dedicated RPCs served by the runtime. [JsonInclude] [JsonPropertyName("controller")] internal JsonElement? Controller { get; set; } /// Session to attach the extension controller delegate to. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Outcome of an agentRegistry.spawn call. /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(AgentRegistrySpawnResultSpawned), "spawned")] [JsonDerivedType(typeof(AgentRegistrySpawnResultSpawnError), "spawn-error")] [JsonDerivedType(typeof(AgentRegistrySpawnResultRegistryTimeout), "registry-timeout")] [JsonDerivedType(typeof(AgentRegistrySpawnResultValidationError), "validation-error")] public partial class AgentRegistrySpawnResult { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Full registry entry for the spawned child. Lets the controller call `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a TOCTOU window). [Experimental(Diagnostics.Experimental)] public sealed class AgentRegistryLiveTargetEntry { /// Kind of attention required when status === "attention". Meaningful only when status === "attention". [JsonPropertyName("attentionKind")] public AgentRegistryLiveTargetEntryAttentionKind? AttentionKind { get; set; } /// Git branch of the session (when known). [JsonPropertyName("branch")] public string? Branch { get; set; } /// Copilot CLI version that wrote the entry. [JsonPropertyName("copilotVersion")] public string CopilotVersion { get; set; } = string.Empty; /// Working directory of the session (when known). [JsonPropertyName("cwd")] public string? Cwd { get; set; } /// Bind host for the entry's JSON-RPC server. [JsonPropertyName("host")] public string Host { get; set; } = string.Empty; /// Process kind tag for the registry entry. [JsonPropertyName("kind")] public AgentRegistryLiveTargetEntryKind Kind { get; set; } /// Wall-clock milliseconds since the watcher last observed this entry (heartbeat freshness). [JsonPropertyName("lastSeenMs")] public long LastSeenMs { get; set; } /// How the most recent turn ended (clean vs aborted). Lets the renderer distinguish done from done_cancelled. [JsonPropertyName("lastTerminalEvent")] public AgentRegistryLiveTargetEntryLastTerminalEvent? LastTerminalEvent { get; set; } /// Model identifier currently selected for the session. [JsonPropertyName("model")] public string? Model { get; set; } /// Operating-system pid of the process owning this entry. [JsonPropertyName("pid")] public long Pid { get; set; } /// TCP port the entry's JSON-RPC server is listening on. [JsonPropertyName("port")] public long Port { get; set; } /// Registry entry schema version (1 = ui-server, 2 = managed-server). [JsonPropertyName("schemaVersion")] public long SchemaVersion { get; set; } /// Session ID of the foreground session for this entry. [JsonPropertyName("sessionId")] public string? SessionId { get; set; } /// Friendly session name (when set). [JsonPropertyName("sessionName")] public string? SessionName { get; set; } /// ISO 8601 timestamp captured at registration. [JsonPropertyName("startedAt")] public string StartedAt { get; set; } = string.Empty; /// Coarse lifecycle status of the foreground session. [JsonPropertyName("status")] public AgentRegistryLiveTargetEntryStatus? Status { get; set; } /// Monotonic per-publisher revision counter incremented on every status update. Lets watchers detect transient flips. [JsonPropertyName("statusRevision")] public long? StatusRevision { get; set; } /// Connection token (null when the target is unauthenticated). [JsonInclude] [JsonPropertyName("token")] internal string? Token { get; set; } } /// Per-spawn log-capture outcome; populated from spawnLiveTarget. [Experimental(Diagnostics.Experimental)] public sealed class AgentRegistryLogCapture { /// Whether per-spawn log capture is on (false when env-disabled or open failed). [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Human-readable open failure message (only set when enabled === false AND the env-disable opt-out was NOT used). [JsonPropertyName("openError")] public string? OpenError { get; set; } /// Categorized reason for log-open failure. [JsonPropertyName("openErrorReason")] public AgentRegistryLogCaptureOpenErrorReason? OpenErrorReason { get; set; } /// Absolute path to the per-spawn log file (only set when enabled). [JsonPropertyName("path")] public string? Path { get; set; } } /// Managed-server child was spawned and registered successfully. /// The spawned variant of . [Experimental(Diagnostics.Experimental)] public partial class AgentRegistrySpawnResultSpawned : AgentRegistrySpawnResult { /// [JsonIgnore] public override string Kind => "spawned"; /// Full registry entry for the spawned child. Lets the controller call `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a TOCTOU window). [JsonPropertyName("entry")] public required AgentRegistryLiveTargetEntry Entry { get; set; } /// If the delegate attempted to send the initial prompt and failed, the categorized error message. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("initialPromptError")] public string? InitialPromptError { get; set; } /// Whether the delegate already sent the initial prompt. Always omitted in the current wiring: the controller sends the prompt post-attach via the standard LocalRpcSession.send path. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("initialPromptSent")] public bool? InitialPromptSent { get; set; } /// Per-spawn log-capture outcome; populated from spawnLiveTarget. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("logCapture")] public AgentRegistryLogCapture? LogCapture { get; set; } } /// `child_process.spawn` itself failed before the child entered the registry. /// The spawn-error variant of . [Experimental(Diagnostics.Experimental)] public partial class AgentRegistrySpawnResultSpawnError : AgentRegistrySpawnResult { /// [JsonIgnore] public override string Kind => "spawn-error"; /// Underlying errno code (e.g. ENOENT, EACCES) when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("code")] public string? Code { get; set; } /// Human-readable error message. [JsonPropertyName("message")] public required string Message { get; set; } } /// Spawn succeeded but the child did not publish a matching managed-server entry within the timeout. /// The registry-timeout variant of . [Experimental(Diagnostics.Experimental)] public partial class AgentRegistrySpawnResultRegistryTimeout : AgentRegistrySpawnResult { /// [JsonIgnore] public override string Kind => "registry-timeout"; /// Process ID of the orphaned child (so the caller can offer 'kill the pid' guidance). [JsonPropertyName("childPid")] public required long ChildPid { get; set; } /// Per-spawn log-capture outcome; populated from spawnLiveTarget. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("logCapture")] public AgentRegistryLogCapture? LogCapture { get; set; } } /// Synchronous pre-validation rejected the spawn request. /// The validation-error variant of . [Experimental(Diagnostics.Experimental)] public partial class AgentRegistrySpawnResultValidationError : AgentRegistrySpawnResult { /// [JsonIgnore] public override string Kind => "validation-error"; /// Which parameter field was invalid. Omitted when the rejection is not field-specific. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("field")] public AgentRegistrySpawnValidationErrorField? Field { get; set; } /// Human-readable explanation; safe to surface in the UI banner. Never logged to unrestricted telemetry. [JsonPropertyName("message")] public required string Message { get; set; } /// Categorized reason for the rejection. Low-cardinality enum so telemetry can aggregate by reason without leaking raw paths or agent/model names. [JsonPropertyName("reason")] public required AgentRegistrySpawnValidationErrorReason Reason { get; set; } } /// Inputs to spawn a managed-server child via the controller's spawn delegate. [Experimental(Diagnostics.Experimental)] internal sealed class AgentRegistrySpawnRequest { /// Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own default. [JsonPropertyName("agentName")] public string? AgentName { get; set; } /// Working directory for the spawned child (must be an existing directory). [JsonPropertyName("cwd")] public string Cwd { get; set; } = string.Empty; /// Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it post-attach via the standard LocalRpcSession.send path). [JsonPropertyName("initialPrompt")] public string? InitialPrompt { get; set; } /// Model identifier to apply to the new session. [JsonPropertyName("model")] public string? Model { get; set; } /// Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing whitespace, <=100 chars, no control chars, no double quotes. [JsonPropertyName("name")] public string? Name { get; set; } /// Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode. [JsonPropertyName("permissionMode")] public AgentRegistrySpawnPermissionMode? PermissionMode { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionSuspendRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Result of sending a user message. [Experimental(Diagnostics.Experimental)] public sealed class SendResult { /// Unique identifier assigned to the message. [JsonPropertyName("messageId")] public string MessageId { get; set; } = string.Empty; } /// Parameters for sending a user message to the session. [Experimental(Diagnostics.Experimental)] internal sealed class SendRequest { /// The UI mode the agent was in when this message was sent. Defaults to the session's current mode. [JsonPropertyName("agentMode")] public SendAgentMode? AgentMode { get; set; } /// Optional attachments (files, directories, selections, blobs, GitHub references) to include with the message. [JsonPropertyName("attachments")] public IList? Attachments { get; set; } /// If false, this message will not trigger a Premium Request Unit charge. User messages default to billable. [JsonPropertyName("billable")] public bool? Billable { get; set; } /// If provided, this is shown in the timeline instead of `prompt`. [JsonPropertyName("displayPrompt")] public string? DisplayPrompt { get; set; } /// How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. [JsonPropertyName("mode")] public SendMode? Mode { get; set; } /// If true, adds the message to the front of the queue instead of the end. [JsonPropertyName("prepend")] public bool? Prepend { get; set; } /// The user message text. [JsonPropertyName("prompt")] public string Prompt { get; set; } = string.Empty; /// Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. [JsonPropertyName("requestHeaders")] public IDictionary? RequestHeaders { get; set; } /// If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange. [JsonPropertyName("requiredTool")] public string? RequiredTool { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Optional provenance tag copied to the resulting user.message event. Must match one of three forms: the literal `system`, `command-<command-id>` for messages originating from a command (e.g. slash command, Mission Control command), or `schedule-<numeric-id>` for messages originating from a scheduled job. [RegularExpression("^(system|command-.*|schedule-\\d+)$")] [JsonInclude] [JsonPropertyName("source")] internal string? Source { get; set; } /// W3C Trace Context traceparent header for distributed tracing of this agent turn. [JsonPropertyName("traceparent")] public string? Traceparent { get; set; } /// W3C Trace Context tracestate header for distributed tracing. [JsonPropertyName("tracestate")] public string? Tracestate { get; set; } /// If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. [JsonPropertyName("wait")] public bool? Wait { get; set; } } /// Result of aborting the current turn. [Experimental(Diagnostics.Experimental)] public sealed class AbortResult { /// Error message if the abort failed. [JsonPropertyName("error")] public string? Error { get; set; } /// Whether the abort completed successfully. [JsonPropertyName("success")] public bool Success { get; set; } } /// Parameters for aborting the current turn. [Experimental(Diagnostics.Experimental)] internal sealed class AbortRequest { /// Finite reason code describing why the current turn was aborted. [JsonPropertyName("reason")] public AbortReason? Reason { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Parameters for shutting down the session. [Experimental(Diagnostics.Experimental)] internal sealed class ShutdownRequest { /// Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'. [JsonPropertyName("reason")] public string? Reason { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Why the session is being shut down. Defaults to "routine" when omitted. [JsonPropertyName("type")] public ShutdownType? Type { get; set; } } /// Identifier of the session event that was emitted for the log message. [Experimental(Diagnostics.Experimental)] public sealed class LogResult { /// The unique identifier of the emitted session event. [JsonPropertyName("eventId")] public Guid EventId { get; set; } } /// Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip. [Experimental(Diagnostics.Experimental)] internal sealed class LogRequest { /// When true, the message is transient and not persisted to the session event log on disk. [JsonPropertyName("ephemeral")] public bool? Ephemeral { get; set; } /// Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". [JsonPropertyName("level")] public SessionLogLevel? Level { get; set; } /// Human-readable message. [JsonPropertyName("message")] public string Message { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Optional actionable tip displayed alongside the message. Only honored on `level: "info"`. [JsonPropertyName("tip")] public string? Tip { get; set; } /// Domain category for this log entry (e.g., "mcp", "subscription", "policy", "model"). Maps to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to "notification". [JsonPropertyName("type")] public string? Type { get; set; } /// Optional URL the user can open in their browser for more details. [Url] [StringSyntax(StringSyntaxAttribute.Uri)] [JsonPropertyName("url")] public string? Url { get; set; } } /// Authentication status and account metadata for the session. [Experimental(Diagnostics.Experimental)] public sealed class SessionAuthStatus { /// Authentication type. [JsonPropertyName("authType")] public AuthInfoType? AuthType { get; set; } /// Copilot plan tier (e.g., individual_pro, business). [JsonPropertyName("copilotPlan")] public string? CopilotPlan { get; set; } /// Authentication host URL. [Url] [StringSyntax(StringSyntaxAttribute.Uri)] [JsonPropertyName("host")] public string? Host { get; set; } /// Whether the session has resolved authentication. [JsonPropertyName("isAuthenticated")] public bool IsAuthenticated { get; set; } /// Authenticated login/username, if available. [JsonPropertyName("login")] public string? Login { get; set; } /// Human-readable authentication status description. [JsonPropertyName("statusMessage")] public string? StatusMessage { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionGitHubAuthGetStatusRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the credential update succeeded. [Experimental(Diagnostics.Experimental)] public sealed class SessionSetCredentialsResult { /// Whether the session ended up with a populated `copilotUser` for the installed credentials. `true` when the supplied credential already carried `copilotUser` or it was successfully re-resolved server-side. `false` when the credential is installed without `copilotUser` — either re-resolution failed, or the variant cannot be re-resolved from the credential alone (only the raw-token variants `token`, `env`, and `gh-cli` can). In both `false` cases the token swap still applied, but plan/quota/billing metadata is degraded. Present whenever a credential was supplied; omitted only when no credential was supplied (no-op call). [JsonPropertyName("copilotUserResolved")] public bool? CopilotUserResolved { get; set; } /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// New auth credentials to install on the session. Omit to leave credentials unchanged. [Experimental(Diagnostics.Experimental)] internal sealed class SessionSetCredentialsParams { /// The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime installs the supplied value immediately for outbound model/API requests. When the credential carries a raw token (`token`, `env`, or `gh-cli`) but no `copilotUser`, the runtime additionally re-resolves `copilotUser` server-side (best-effort, asynchronously, after the synchronous install) so plan/quota/billing metadata regains fidelity; on resolution failure the verbatim credential remains installed. It does NOT otherwise validate the credential. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit. [JsonPropertyName("credentials")] public AuthInfo? Credentials { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Canvas action that the agent or host can invoke. To discover the input schema for a particular action, call the list_canvas_capabilities tool. [Experimental(Diagnostics.Experimental)] public sealed class CanvasAction { /// Description of the action. [JsonPropertyName("description")] public string? Description { get; set; } /// JSON Schema for the action input. [JsonPropertyName("inputSchema")] public JsonElement? InputSchema { get; set; } /// Action name exposed by the canvas provider. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Canvas available in the current session. [Experimental(Diagnostics.Experimental)] public sealed class DiscoveredCanvas { /// Actions the agent or host may invoke on an open instance. [JsonPropertyName("actions")] public IList? Actions { get; set; } /// Provider-local canvas identifier. [JsonPropertyName("canvasId")] public string CanvasId { get; set; } = string.Empty; /// 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 string Description { get; set; } = string.Empty; /// Human-readable canvas name. [JsonPropertyName("displayName")] public string DisplayName { get; set; } = string.Empty; /// Owning provider identifier. [JsonPropertyName("extensionId")] public string ExtensionId { get; set; } = string.Empty; /// Owning extension display name, when available. [JsonPropertyName("extensionName")] public string? ExtensionName { get; set; } /// JSON Schema for canvas open input. [JsonPropertyName("inputSchema")] public JsonElement? InputSchema { get; set; } } /// Declared canvases available in this session. [Experimental(Diagnostics.Experimental)] public sealed class CanvasList { /// Declared canvases available in this session. [JsonPropertyName("canvases")] public IList Canvases { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionCanvasListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Open canvas instance snapshot. [Experimental(Diagnostics.Experimental)] public sealed class OpenCanvasInstance { /// Provider-local canvas identifier. [JsonPropertyName("canvasId")] public string CanvasId { get; set; } = string.Empty; /// Owning provider identifier. [JsonPropertyName("extensionId")] public string ExtensionId { get; set; } = string.Empty; /// Owning extension display name, when available. [JsonPropertyName("extensionName")] public string? ExtensionName { get; set; } /// Input supplied when the instance was opened. [JsonPropertyName("input")] public JsonElement? Input { get; set; } /// Stable caller-supplied canvas instance identifier. [JsonPropertyName("instanceId")] public string InstanceId { get; set; } = string.Empty; /// Provider-supplied status text. [JsonPropertyName("status")] public string? Status { get; set; } /// Rendered title. [JsonPropertyName("title")] public string? Title { get; set; } /// URL for web-rendered canvases. [JsonPropertyName("url")] public string? Url { get; set; } } /// Live open-canvas snapshot. [Experimental(Diagnostics.Experimental)] public sealed class CanvasListOpenResult { /// Currently open canvas instances. [JsonPropertyName("openCanvases")] public IList OpenCanvases { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionCanvasListOpenRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Canvas open parameters. [Experimental(Diagnostics.Experimental)] internal sealed class CanvasOpenRequest { /// Provider-local canvas identifier. [JsonPropertyName("canvasId")] public string CanvasId { get; set; } = string.Empty; /// Owning provider identifier. Optional when the canvasId is unique across providers; required to disambiguate when multiple providers register the same canvasId. [JsonPropertyName("extensionId")] public string? ExtensionId { get; set; } /// Canvas open input. [JsonPropertyName("input")] public JsonElement? Input { get; set; } /// Caller-supplied stable instance identifier. [JsonPropertyName("instanceId")] public string InstanceId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Canvas close parameters. [Experimental(Diagnostics.Experimental)] internal sealed class CanvasCloseRequest { /// Open canvas instance identifier. [JsonPropertyName("instanceId")] public string InstanceId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Canvas action invocation result. [Experimental(Diagnostics.Experimental)] public sealed class CanvasActionInvokeResult { /// Provider-supplied action result. [JsonPropertyName("result")] public JsonElement? Result { get; set; } } /// Canvas action invocation parameters. [Experimental(Diagnostics.Experimental)] internal sealed class CanvasActionInvokeRequest { /// Action name to invoke. [JsonPropertyName("actionName")] public string ActionName { get; set; } = string.Empty; /// Action input. [JsonPropertyName("input")] public JsonElement? Input { get; set; } /// Open canvas instance identifier. [JsonPropertyName("instanceId")] public string InstanceId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. [Experimental(Diagnostics.Experimental)] public sealed class CurrentModel { /// Context tier for models that support multiple context-window sizes. [JsonPropertyName("contextTier")] public ContextTier? ContextTier { get; set; } /// Currently active model identifier. [JsonPropertyName("modelId")] public string? ModelId { get; set; } /// Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot. [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionModelGetCurrentRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The model identifier active on the session after the switch. [Experimental(Diagnostics.Experimental)] public sealed class ModelSwitchToResult { /// Currently active model identifier after the switch. [JsonPropertyName("modelId")] public string? ModelId { get; set; } } /// Vision-specific limits. [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesOverrideLimitsVision { /// Maximum image size in bytes. [JsonPropertyName("max_prompt_image_size")] public long? MaxPromptImageSize { get; set; } /// Maximum number of images per prompt. [JsonPropertyName("max_prompt_images")] public long? MaxPromptImages { get; set; } /// MIME types the model accepts. [JsonPropertyName("supported_media_types")] public IList? SupportedMediaTypes { get; set; } } /// Token limits for prompts, outputs, and context window. [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesOverrideLimits { /// Maximum total context window size in tokens. [JsonPropertyName("max_context_window_tokens")] public long? MaxContextWindowTokens { get; set; } /// Maximum number of output/completion tokens. [JsonPropertyName("max_output_tokens")] public long? MaxOutputTokens { get; set; } /// Maximum number of prompt/input tokens. [JsonPropertyName("max_prompt_tokens")] public long? MaxPromptTokens { get; set; } /// Vision-specific limits. [JsonPropertyName("vision")] public ModelCapabilitiesOverrideLimitsVision? Vision { get; set; } } /// Feature flags indicating what the model supports. [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesOverrideSupports { /// Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). [JsonPropertyName("adaptive_thinking")] public AdaptiveThinkingSupport? AdaptiveThinking { get; set; } /// Whether this model supports reasoning effort configuration. [JsonPropertyName("reasoningEffort")] public bool? ReasoningEffort { get; set; } /// Whether this model supports vision/image input. [JsonPropertyName("vision")] public bool? Vision { get; set; } } /// Optional capability overrides (vision, tool_calls, reasoning, etc.). [Experimental(Diagnostics.Experimental)] public sealed class ModelCapabilitiesOverride { /// Token limits for prompts, outputs, and context window. [JsonPropertyName("limits")] public ModelCapabilitiesOverrideLimits? Limits { get; set; } /// Feature flags indicating what the model supports. [JsonPropertyName("supports")] public ModelCapabilitiesOverrideSupports? Supports { get; set; } } /// Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. [Experimental(Diagnostics.Experimental)] internal sealed class ModelSwitchToRequest { /// Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier. [JsonPropertyName("contextTier")] public ContextTier? ContextTier { get; set; } /// Override individual model capabilities resolved by the runtime. [JsonPropertyName("modelCapabilities")] public ModelCapabilitiesOverride? ModelCapabilities { get; set; } /// Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model. [JsonPropertyName("modelId")] public string ModelId { get; set; } = string.Empty; /// Reasoning effort level to use for the model. "none" disables reasoning. [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } /// Reasoning summary mode to request for supported model clients. [JsonPropertyName("reasoningSummary")] public ReasoningSummary? ReasoningSummary { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. [Experimental(Diagnostics.Experimental)] public sealed class ModelSetReasoningEffortResult { /// Reasoning effort level recorded on the session after the update. [JsonPropertyName("reasoningEffort")] public string ReasoningEffort { get; set; } = string.Empty; } /// Reasoning effort level to apply to the currently selected model. [Experimental(Diagnostics.Experimental)] internal sealed class ModelSetReasoningEffortRequest { /// Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling. [JsonPropertyName("reasoningEffort")] public string ReasoningEffort { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The list of models available to this session. [Experimental(Diagnostics.Experimental)] public sealed class SessionModelList { /// Available models, ordered with the most preferred default first. Includes both Copilot (CAPI) models and any registry BYOK models; a BYOK model appears under its provider-qualified selection id (`provider/id`). [JsonPropertyName("list")] public IList List { get => field ??= []; set; } /// Per-quota snapshots returned alongside the model list, keyed by quota type. [JsonPropertyName("quotaSnapshots")] public IDictionary? QuotaSnapshots { get; set; } } /// Optional listing options. [Experimental(Diagnostics.Experimental)] public sealed class ModelListRequest { /// If true, bypasses the per-session model list cache and re-fetches from CAPI. [JsonPropertyName("skipCache")] public bool? SkipCache { get; set; } } /// Optional listing options. [Experimental(Diagnostics.Experimental)] internal sealed class ModelListRequestWithSession { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// If true, bypasses the per-session model list cache and re-fetches from CAPI. [JsonPropertyName("skipCache")] public bool? SkipCache { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionModeGetRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Agent interaction mode to apply to the session. [Experimental(Diagnostics.Experimental)] internal sealed class ModeSetRequest { /// The session mode the agent is operating in. [JsonPropertyName("mode")] public SessionMode Mode { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The session's friendly name, or null when not yet set. [Experimental(Diagnostics.Experimental)] public sealed class NameGetResult { /// The session name (user-set or auto-generated), or null if not yet set. [JsonPropertyName("name")] public string? Name { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionNameGetRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// New friendly name to apply to the session. [Experimental(Diagnostics.Experimental)] internal sealed class NameSetRequest { /// New session name (1–100 characters, trimmed of leading/trailing whitespace). [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)] [MaxLength(100)] [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the auto-generated summary was applied as the session's name. [Experimental(Diagnostics.Experimental)] public sealed class NameSetAutoResult { /// Whether the auto-generated summary was persisted. False if the session already has a user-set name, the summary normalized to empty, or the session does not have a workspace. [JsonPropertyName("applied")] public bool Applied { get; set; } } /// Auto-generated session summary to apply as the session's name when no user-set name exists. [Experimental(Diagnostics.Experimental)] internal sealed class NameSetAutoRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting. [JsonPropertyName("summary")] public string Summary { get; set; } = string.Empty; } /// Existence, contents, and resolved path of the session plan file. [Experimental(Diagnostics.Experimental)] public sealed class PlanReadResult { /// The content of the plan file, or null if it does not exist. [JsonPropertyName("content")] public string? Content { get; set; } /// Whether the plan file exists in the workspace. [JsonPropertyName("exists")] public bool Exists { get; set; } /// Absolute file path of the plan file, or null if workspace is not enabled. [JsonPropertyName("path")] public string? Path { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionPlanReadRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Replacement contents to write to the session plan file. [Experimental(Diagnostics.Experimental)] internal sealed class PlanUpdateRequest { /// The new content for the plan file. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionPlanDeleteRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// A single todo row read from the session SQL `todos` table. All fields are optional because the SQL schema is best-effort and the agent may not have populated every column. [Experimental(Diagnostics.Experimental)] public sealed class PlanSqlTodosRow { /// Todo description. [JsonPropertyName("description")] public string? Description { get; set; } /// Todo identifier. [JsonPropertyName("id")] public string? Id { get; set; } /// Todo status. [JsonPropertyName("status")] public string? Status { get; set; } /// Todo title. [JsonPropertyName("title")] public string? Title { get; set; } } /// Todo rows read from the session SQL database. Empty when no session database is available. [Experimental(Diagnostics.Experimental)] public sealed class PlanReadSqlTodosResult { /// Rows from the session SQL todos table, ordered by creation time and id. [JsonPropertyName("rows")] public IList Rows { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionPlanReadSqlTodosRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// A single dependency edge read from the session SQL `todo_deps` table, indicating that one todo must complete before another. [Experimental(Diagnostics.Experimental)] public sealed class PlanSqlTodoDependency { /// ID of the todo it depends on. [JsonPropertyName("dependsOn")] public string DependsOn { get; set; } = string.Empty; /// ID of the todo that has the dependency. [JsonPropertyName("todoId")] public string TodoId { get; set; } = string.Empty; } /// Todo rows + dependency edges read from the session SQL database. [Experimental(Diagnostics.Experimental)] public sealed class PlanReadSqlTodosWithDependenciesResult { /// Edges from the session SQL todo_deps table. Empty when no database, no todo_deps table, or the SELECT failed. Read independently from `rows`, so a broken todo_deps table does not affect the rows result and vice versa. [JsonPropertyName("dependencies")] public IList Dependencies { get => field ??= []; set; } /// Rows from the session SQL todos table, ordered by creation time and id. Empty when no database, no todos table, or the SELECT failed. [JsonPropertyName("rows")] public IList Rows { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionPlanReadSqlTodosWithDependenciesRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// RPC data type for WorkspacesGetWorkspaceResultWorkspace operations. public sealed class WorkspacesGetWorkspaceResultWorkspace { /// Gets or sets the branch value. [JsonPropertyName("branch")] public string? Branch { get; set; } /// Gets or sets the chronicle_sync_dismissed value. [JsonPropertyName("chronicle_sync_dismissed")] public bool? ChronicleSyncDismissed { get; set; } /// Gets or sets the client_name value. [JsonPropertyName("client_name")] public string? ClientName { get; set; } /// Gets or sets the created_at value. [JsonPropertyName("created_at")] public DateTimeOffset? CreatedAt { get; set; } /// Gets or sets the cwd value. [JsonPropertyName("cwd")] public string? Cwd { get; set; } /// Gets or sets the git_root value. [JsonPropertyName("git_root")] public string? GitRoot { get; set; } /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. [JsonPropertyName("host_type")] public WorkspacesWorkspaceDetailsHostType? HostType { get; set; } /// Gets or sets the id value. [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("id")] public string Id { get; set; } = string.Empty; /// Gets or sets the mc_last_event_id value. [JsonPropertyName("mc_last_event_id")] public string? McLastEventId { get; set; } /// Gets or sets the mc_session_id value. [JsonPropertyName("mc_session_id")] public string? McSessionId { get; set; } /// Gets or sets the mc_task_id value. [JsonPropertyName("mc_task_id")] public string? McTaskId { get; set; } /// Gets or sets the name value. [JsonPropertyName("name")] public string? Name { get; set; } /// Gets or sets the remote_steerable value. [JsonPropertyName("remote_steerable")] public bool? RemoteSteerable { get; set; } /// Gets or sets the repository value. [JsonPropertyName("repository")] public string? Repository { get; set; } /// Gets or sets the summary_count value. [JsonPropertyName("summary_count")] public long? SummaryCount { get; set; } /// Gets or sets the updated_at value. [JsonPropertyName("updated_at")] public DateTimeOffset? UpdatedAt { get; set; } /// Gets or sets the user_named value. [JsonPropertyName("user_named")] public bool? UserNamed { get; set; } } /// Current workspace metadata for the session, including its absolute filesystem path when available. [Experimental(Diagnostics.Experimental)] public sealed class WorkspacesGetWorkspaceResult { /// Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions). [JsonPropertyName("path")] public string? Path { get; set; } /// Current workspace metadata, or null if not available. [JsonPropertyName("workspace")] public WorkspacesGetWorkspaceResultWorkspace? Workspace { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionWorkspacesGetWorkspaceRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Relative paths of files stored in the session workspace files directory. [Experimental(Diagnostics.Experimental)] public sealed class WorkspacesListFilesResult { /// Relative file paths in the workspace files directory. [JsonPropertyName("files")] public IList Files { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionWorkspacesListFilesRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Contents of the requested workspace file as a UTF-8 string. [Experimental(Diagnostics.Experimental)] public sealed class WorkspacesReadFileResult { /// File content as a UTF-8 string. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; } /// Relative path of the workspace file to read. [Experimental(Diagnostics.Experimental)] internal sealed class WorkspacesReadFileRequest { /// Relative path within the workspace files directory. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Relative path and UTF-8 content for the workspace file to create or overwrite. [Experimental(Diagnostics.Experimental)] internal sealed class WorkspacesCreateFileRequest { /// File content to write as a UTF-8 string. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; /// Relative path within the workspace files directory. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `WorkspacesCheckpoints` type. [Experimental(Diagnostics.Experimental)] public sealed class WorkspacesCheckpoints { /// Filename of the checkpoint within the workspace checkpoints directory. [JsonPropertyName("filename")] public string Filename { get; set; } = string.Empty; /// Checkpoint number assigned by the workspace manager. [JsonPropertyName("number")] public long Number { get; set; } /// Human-readable checkpoint title. [JsonPropertyName("title")] public string Title { get; set; } = string.Empty; } /// Workspace checkpoints in chronological order; empty when the workspace is not enabled. [Experimental(Diagnostics.Experimental)] public sealed class WorkspacesListCheckpointsResult { /// Workspace checkpoints in chronological order. Empty when workspace is not enabled. [JsonPropertyName("checkpoints")] public IList Checkpoints { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionWorkspacesListCheckpointsRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. [Experimental(Diagnostics.Experimental)] public sealed class WorkspacesReadCheckpointResult { /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. [JsonPropertyName("content")] public string? Content { get; set; } } /// Checkpoint number to read. [Experimental(Diagnostics.Experimental)] internal sealed class WorkspacesReadCheckpointRequest { /// Checkpoint number to read. [JsonPropertyName("number")] public long Number { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// RPC data type for WorkspacesSaveLargePasteResultSaved operations. public sealed class WorkspacesSaveLargePasteResultSaved { /// Filename within the workspace files directory. [JsonPropertyName("filename")] public string Filename { get; set; } = string.Empty; /// Absolute filesystem path to the saved paste file. [JsonPropertyName("filePath")] public string FilePath { get; set; } = string.Empty; /// Size of the saved file in bytes. [JsonPropertyName("sizeBytes")] public long SizeBytes { get; set; } } /// Descriptor for the saved paste file, or null when the workspace is unavailable. [Experimental(Diagnostics.Experimental)] public sealed class WorkspacesSaveLargePasteResult { /// Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions). [JsonPropertyName("saved")] public WorkspacesSaveLargePasteResultSaved? Saved { get; set; } } /// Pasted content to save as a UTF-8 file in the session workspace. [Experimental(Diagnostics.Experimental)] internal sealed class WorkspacesSaveLargePasteRequest { /// Pasted content to save as a UTF-8 file. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// A single changed file and its unified diff. [Experimental(Diagnostics.Experimental)] public sealed class WorkspaceDiffFileChange { /// Type of change represented by this file diff. [JsonPropertyName("changeType")] public WorkspaceDiffFileChangeType ChangeType { get; set; } /// Unified diff content for the file. Empty when the diff was truncated. [JsonPropertyName("diff")] public string Diff { get; set; } = string.Empty; /// Whether the diff content was omitted because it exceeded the per-file size limit. [JsonPropertyName("isTruncated")] public bool? IsTruncated { get; set; } /// Original file path for renamed files. [JsonPropertyName("oldPath")] public string? OldPath { get; set; } /// Path to the changed file, relative to the workspace root. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; } /// Workspace diff result for the requested mode. [Experimental(Diagnostics.Experimental)] public sealed class WorkspaceDiffResult { /// Default branch used for a branch diff, when branch mode was requested. [JsonPropertyName("baseBranch")] public string? BaseBranch { get; set; } /// Changed files and their unified diffs. [JsonPropertyName("changes")] public IList Changes { get => field ??= []; set; } /// Whether a requested branch diff fell back to unstaged changes because branch diff failed. [JsonPropertyName("isFallback")] public bool IsFallback { get; set; } /// Effective mode used for the returned changes. [JsonPropertyName("mode")] public WorkspaceDiffMode Mode { get; set; } /// Diff mode requested by the client. [JsonPropertyName("requestedMode")] public WorkspaceDiffMode RequestedMode { get; set; } } /// Parameters for computing a workspace diff. [Experimental(Diagnostics.Experimental)] internal sealed class WorkspacesDiffRequest { /// When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false. [JsonPropertyName("ignoreWhitespace")] public bool? IgnoreWhitespace { get; set; } /// Diff mode requested by the client. [JsonPropertyName("mode")] public WorkspaceDiffMode Mode { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). [Experimental(Diagnostics.Experimental)] public sealed class CompletionsGetTriggerCharactersResult { /// Trigger characters advertised by the host (e.g. `["@", "#"]`). Empty disables host-driven completions for the session. [JsonPropertyName("triggerCharacters")] public IList TriggerCharacters { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionCompletionsGetTriggerCharactersRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced. [Experimental(Diagnostics.Experimental)] public sealed class SessionCompletionItem { /// Text spliced into the composer when the item is accepted. [JsonPropertyName("insertText")] public string InsertText { get; set; } = string.Empty; /// Render-kind hint for the picker row (e.g. `"document"`, `"directory"`), derived from the host's display kind. [JsonPropertyName("kind")] public string? Kind { get; set; } /// Primary display label for the picker row. Falls back to `insertText` when absent. [JsonPropertyName("label")] public string? Label { get; set; } /// End (exclusive) of the replacement range in `text`, in UTF-16 code units. [JsonPropertyName("rangeEnd")] public long? RangeEnd { get; set; } /// Start of the replacement range in `text`, in UTF-16 code units. [JsonPropertyName("rangeStart")] public long? RangeStart { get; set; } } /// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. [Experimental(Diagnostics.Experimental)] public sealed class CompletionsRequestResult { /// Completion items in host-ranked order. [JsonPropertyName("items")] public IList Items { get => field ??= []; set; } } /// Request host-driven completions for the current composer input. [Experimental(Diagnostics.Experimental)] internal sealed class CompletionsRequestRequest { /// Cursor offset within `text`, in UTF-16 code units. [JsonPropertyName("offset")] public long Offset { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// The full composed composer input. [JsonPropertyName("text")] public string Text { get; set; } = string.Empty; } /// Instruction sources loaded for the session, in merge order. [Experimental(Diagnostics.Experimental)] public sealed class InstructionsGetSourcesResult { /// Instruction sources for the session. [JsonPropertyName("sources")] public IList Sources { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionInstructionsGetSourcesRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether fleet mode was successfully activated. [Experimental(Diagnostics.Experimental)] public sealed class FleetStartResult { /// Whether fleet mode was successfully activated. [JsonPropertyName("started")] public bool Started { get; set; } } /// Optional user prompt to combine with the fleet orchestration instructions. [Experimental(Diagnostics.Experimental)] internal sealed class FleetStartRequest { /// Optional user prompt to combine with fleet instructions. [JsonPropertyName("prompt")] public string? Prompt { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Custom agents available to the session. [Experimental(Diagnostics.Experimental)] public sealed class AgentList { /// Available custom agents. [JsonPropertyName("agents")] public IList Agents { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionAgentListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The currently selected custom agent, or null when using the default agent. [Experimental(Diagnostics.Experimental)] public sealed class AgentGetCurrentResult { /// Currently selected custom agent, or null if using the default agent. [JsonPropertyName("agent")] public AgentInfo? Agent { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionAgentGetCurrentRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The newly selected custom agent. [Experimental(Diagnostics.Experimental)] public sealed class AgentSelectResult { /// The newly selected custom agent. [JsonPropertyName("agent")] public AgentInfo Agent { get => field ??= new(); set; } } /// Name of the custom agent to select for subsequent turns. [Experimental(Diagnostics.Experimental)] internal sealed class AgentSelectRequest { /// Name of the custom agent to select. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionAgentDeselectRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Custom agents available to the session after reloading definitions from disk. [Experimental(Diagnostics.Experimental)] public sealed class AgentReloadResult { /// Reloaded custom agents. [JsonPropertyName("agents")] public IList Agents { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionAgentReloadRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifier assigned to the newly started background agent task. [Experimental(Diagnostics.Experimental)] public sealed class TasksStartAgentResult { /// Generated agent ID for the background task. [JsonPropertyName("agentId")] public string AgentId { get; set; } = string.Empty; } /// Agent type, prompt, name, and optional description and model override for the new task. [Experimental(Diagnostics.Experimental)] internal sealed class TasksStartAgentRequest { /// Type of agent to start (e.g., 'explore', 'task', 'general-purpose'). [JsonPropertyName("agentType")] public string AgentType { get; set; } = string.Empty; /// Short description of the task. [JsonPropertyName("description")] public string? Description { get; set; } /// Optional model override. [JsonPropertyName("model")] public string? Model { get; set; } /// Short name for the agent, used to generate a human-readable ID. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Task prompt for the agent. [JsonPropertyName("prompt")] public string Prompt { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `TaskInfo` type. /// Polymorphic base type discriminated by type. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(TaskInfoAgent), "agent")] [JsonDerivedType(typeof(TaskInfoShell), "shell")] public partial class TaskInfo { /// The type discriminator. [JsonPropertyName("type")] public virtual string Type { get; set; } = string.Empty; } /// Schema for the `TaskAgentInfo` type. /// The agent variant of . [Experimental(Diagnostics.Experimental)] public partial class TaskInfoAgent : TaskInfo { /// [JsonIgnore] public override string Type => "agent"; /// ISO 8601 timestamp when the current active period began. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("activeStartedAt")] public DateTimeOffset? ActiveStartedAt { get; set; } /// Accumulated active execution time in milliseconds. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("activeTimeMs")] public TimeSpan? ActiveTime { get; set; } /// Type of agent running this task. [JsonPropertyName("agentType")] public required string AgentType { get; set; } /// Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("canPromoteToBackground")] public bool? CanPromoteToBackground { get; set; } /// ISO 8601 timestamp when the task finished. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("completedAt")] public DateTimeOffset? CompletedAt { get; set; } /// Short description of the task. [JsonPropertyName("description")] public required string Description { get; set; } /// Error message when the task failed. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("error")] public string? Error { get; set; } /// Whether task execution is synchronously awaited or managed in the background. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("executionMode")] public TaskExecutionMode? ExecutionMode { get; set; } /// Unique task identifier. [JsonPropertyName("id")] public required string Id { get; set; } /// ISO 8601 timestamp when the agent entered idle state. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("idleSince")] public DateTimeOffset? IdleSince { get; set; } /// Most recent response text from the agent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("latestResponse")] public string? LatestResponse { get; set; } /// Requested model override for the task when specified. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("model")] public string? Model { get; set; } /// Most recent prompt delivered to the agent. Updated whenever the agent receives a follow-up message. [JsonPropertyName("prompt")] public required string Prompt { get; set; } /// Runtime model resolved for the task when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("resolvedModel")] public string? ResolvedModel { get; set; } /// Result text from the task when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("result")] public string? Result { get; set; } /// ISO 8601 timestamp when the task was started. [JsonPropertyName("startedAt")] public required DateTimeOffset StartedAt { get; set; } /// Current lifecycle status of the task. [JsonPropertyName("status")] public required TaskStatus Status { get; set; } /// Tool call ID associated with this agent task. [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } } /// Schema for the `TaskShellInfo` type. /// The shell variant of . [Experimental(Diagnostics.Experimental)] public partial class TaskInfoShell : TaskInfo { /// [JsonIgnore] public override string Type => "shell"; /// Whether the shell runs inside a managed PTY session or as an independent background process. [JsonPropertyName("attachmentMode")] public required TaskShellInfoAttachmentMode AttachmentMode { get; set; } /// Whether this shell task can be promoted to background mode. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("canPromoteToBackground")] public bool? CanPromoteToBackground { get; set; } /// Command being executed. [JsonPropertyName("command")] public required string Command { get; set; } /// ISO 8601 timestamp when the task finished. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("completedAt")] public DateTimeOffset? CompletedAt { get; set; } /// Short description of the task. [JsonPropertyName("description")] public required string Description { get; set; } /// Whether task execution is synchronously awaited or managed in the background. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("executionMode")] public TaskExecutionMode? ExecutionMode { get; set; } /// Unique task identifier. [JsonPropertyName("id")] public required string Id { get; set; } /// Path to the detached shell log, when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("logPath")] public string? LogPath { get; set; } /// Process ID when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("pid")] public long? Pid { get; set; } /// ISO 8601 timestamp when the task was started. [JsonPropertyName("startedAt")] public required DateTimeOffset StartedAt { get; set; } /// Current lifecycle status of the task. [JsonPropertyName("status")] public required TaskStatus Status { get; set; } } /// Background tasks currently tracked by the session. [Experimental(Diagnostics.Experimental)] public sealed class TaskList { /// Currently tracked tasks. [JsonPropertyName("tasks")] public IList Tasks { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionTasksListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop. [Experimental(Diagnostics.Experimental)] public sealed class TasksRefreshResult { } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionTasksRefreshRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS). [Experimental(Diagnostics.Experimental)] public sealed class TasksWaitForPendingResult { } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionTasksWaitForPendingRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Polymorphic base type discriminated by type. [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(TasksGetProgressResultProgressAgent), "agent")] [JsonDerivedType(typeof(TasksGetProgressResultProgressShell), "shell")] public partial class TasksGetProgressResultProgress { /// The type discriminator. [JsonPropertyName("type")] public virtual string Type { get; set; } = string.Empty; } /// Schema for the `TaskProgressLine` type. [Experimental(Diagnostics.Experimental)] public sealed class TaskProgressLine { /// Display message, e.g., "▸ bash", "✓ edit src/foo.ts". [JsonPropertyName("message")] public string Message { get; set; } = string.Empty; /// ISO 8601 timestamp when this event occurred. [JsonPropertyName("timestamp")] public DateTimeOffset Timestamp { get; set; } } /// Schema for the `TaskAgentProgress` type. /// The agent variant of . public partial class TasksGetProgressResultProgressAgent : TasksGetProgressResultProgress { /// [JsonIgnore] public override string Type => "agent"; /// The most recent intent reported by the agent. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("latestIntent")] public string? LatestIntent { get; set; } /// Recent tool execution events converted to display lines. [JsonPropertyName("recentActivity")] public required IList RecentActivity { get; set; } } /// Schema for the `TaskShellProgress` type. /// The shell variant of . public partial class TasksGetProgressResultProgressShell : TasksGetProgressResultProgress { /// [JsonIgnore] public override string Type => "shell"; /// Process ID when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("pid")] public long? Pid { get; set; } /// Recent stdout/stderr lines from the running shell command. [JsonPropertyName("recentOutput")] public required string RecentOutput { get; set; } } /// Progress information for the task, or null when no task with that ID is tracked. [Experimental(Diagnostics.Experimental)] public sealed class TasksGetProgressResult { /// Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked. [JsonPropertyName("progress")] public TasksGetProgressResultProgress? Progress { get; set; } } /// Identifier of the background task to fetch progress for. [Experimental(Diagnostics.Experimental)] internal sealed class TasksGetProgressRequest { /// Task identifier (agent ID or shell ID). [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The first sync-waiting task that can currently be promoted to background mode. [Experimental(Diagnostics.Experimental)] public sealed class TasksGetCurrentPromotableResult { /// The first sync-waiting task (agent first, then shell) that can currently be promoted to background mode. Omitted if no such task exists. The returned task is guaranteed to have executionMode='sync' and canPromoteToBackground=true at the time of the call. [JsonPropertyName("task")] public TaskInfo? Task { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionTasksGetCurrentPromotableRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the task was successfully promoted to background mode. [Experimental(Diagnostics.Experimental)] public sealed class TasksPromoteToBackgroundResult { /// Whether the task was successfully promoted to background mode. [JsonPropertyName("promoted")] public bool Promoted { get; set; } } /// Identifier of the task to promote to background mode. [Experimental(Diagnostics.Experimental)] internal sealed class TasksPromoteToBackgroundRequest { /// Task identifier. [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The promoted task as it now exists in background mode, omitted if no promotable task was waiting. [Experimental(Diagnostics.Experimental)] public sealed class TasksPromoteCurrentToBackgroundResult { /// The promoted task as it now exists in background mode, omitted if no promotable task was waiting. Atomic operation: avoids the race window of getCurrentPromotable + promoteToBackground. [JsonPropertyName("task")] public TaskInfo? Task { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionTasksPromoteCurrentToBackgroundRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the background task was successfully cancelled. [Experimental(Diagnostics.Experimental)] public sealed class TasksCancelResult { /// Whether the task was successfully cancelled. [JsonPropertyName("cancelled")] public bool Cancelled { get; set; } } /// Identifier of the background task to cancel. [Experimental(Diagnostics.Experimental)] internal sealed class TasksCancelRequest { /// Task identifier. [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the task was removed. False when the task does not exist or is still running/idle. [Experimental(Diagnostics.Experimental)] public sealed class TasksRemoveResult { /// Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first). [JsonPropertyName("removed")] public bool Removed { get; set; } } /// Identifier of the completed or cancelled task to remove from tracking. [Experimental(Diagnostics.Experimental)] internal sealed class TasksRemoveRequest { /// Task identifier. [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the message was delivered, with an error message when delivery failed. [Experimental(Diagnostics.Experimental)] public sealed class TasksSendMessageResult { /// Error message if delivery failed. [JsonPropertyName("error")] public string? Error { get; set; } /// Whether the message was successfully delivered or steered. [JsonPropertyName("sent")] public bool Sent { get; set; } } /// Identifier of the target agent task, message content, and optional sender agent ID. [Experimental(Diagnostics.Experimental)] internal sealed class TasksSendMessageRequest { /// Agent ID of the sender, if sent on behalf of another agent. [JsonPropertyName("fromAgentId")] public string? FromAgentId { get; set; } /// Agent task identifier. [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Message content to send to the agent. [JsonPropertyName("message")] public string Message { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `Skill` type. [Experimental(Diagnostics.Experimental)] public sealed class Skill { /// Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field. [JsonPropertyName("argumentHint")] public string? ArgumentHint { get; set; } /// Description of what the skill does. [JsonPropertyName("description")] public string Description { get; set; } = string.Empty; /// Whether the skill is currently enabled. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Unique identifier for the skill. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Absolute path to the skill file. [JsonPropertyName("path")] public string? Path { get; set; } /// Name of the plugin that provides the skill, when source is 'plugin'. [JsonPropertyName("pluginName")] public string? PluginName { get; set; } /// Source location type (e.g., project, personal-copilot, plugin, builtin). [JsonPropertyName("source")] public SkillSource Source { get; set; } /// Whether the skill can be invoked by the user as a slash command. [JsonPropertyName("userInvocable")] public bool UserInvocable { get; set; } } /// Skills available to the session, with their enabled state. [Experimental(Diagnostics.Experimental)] public sealed class SkillList { /// Available skills. [JsonPropertyName("skills")] public IList Skills { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionSkillsListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `SkillsInvokedSkill` type. [Experimental(Diagnostics.Experimental)] public sealed class SkillsInvokedSkill { /// Tools that should be auto-approved when this skill is active, captured at invocation time. [JsonPropertyName("allowedTools")] public IList? AllowedTools { get; set; } /// Full content of the skill file. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; /// Turn number when the skill was invoked. [JsonPropertyName("invokedAtTurn")] public long InvokedAtTurn { get; set; } /// Unique identifier for the skill. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Path to the SKILL.md file. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; } /// Skills invoked during this session, ordered by invocation time (most recent last). [Experimental(Diagnostics.Experimental)] public sealed class SkillsGetInvokedResult { /// Skills invoked during this session, ordered by invocation time (most recent last). [JsonPropertyName("skills")] public IList Skills { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionSkillsGetInvokedRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Name of the skill to enable for the session. [Experimental(Diagnostics.Experimental)] internal sealed class SkillsEnableRequest { /// Name of the skill to enable. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Name of the skill to disable for the session. [Experimental(Diagnostics.Experimental)] internal sealed class SkillsDisableRequest { /// Name of the skill to disable. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Diagnostics from reloading skill definitions, with warnings and errors as separate lists. [Experimental(Diagnostics.Experimental)] public sealed class SkillsLoadDiagnostics { /// Errors emitted while loading skills (e.g. skills that failed to load entirely). [JsonPropertyName("errors")] public IList Errors { get => field ??= []; set; } /// Warnings emitted while loading skills (e.g. skills that loaded but had issues). [JsonPropertyName("warnings")] public IList Warnings { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionSkillsReloadRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionSkillsEnsureLoadedRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Recorded MCP server connection failure. [Experimental(Diagnostics.Experimental)] public sealed class McpServerFailureInfo { /// Failure message produced when the MCP server connection failed. [JsonPropertyName("message")] public string Message { get; set; } = string.Empty; /// epoch-ms timestamp at which the failure was recorded. [JsonPropertyName("timestamp")] public long Timestamp { get; set; } } /// Recorded MCP server pending-auth state. [Experimental(Diagnostics.Experimental)] public sealed class McpServerNeedsAuthInfo { /// epoch-ms timestamp at which the server signalled it needs authentication. [JsonPropertyName("timestamp")] public long Timestamp { get; set; } } /// Host-level state, omitted when no MCP host is initialized. [Experimental(Diagnostics.Experimental)] public sealed class McpHostState { /// Names of currently-connected MCP clients. [JsonPropertyName("clients")] public IList Clients { get => field ??= []; set; } /// Configured servers that are explicitly disabled. [JsonPropertyName("disabledServers")] public IList DisabledServers { get => field ??= []; set; } /// Map of server name to recorded connection failure. [JsonPropertyName("failedServers")] public IDictionary FailedServers { get => field ??= new Dictionary(); set; } /// Configured servers filtered out by enterprise allowlist policy. [JsonPropertyName("filteredServers")] public IList FilteredServers { get => field ??= []; set; } /// Whether third-party MCP servers are policy-enabled for this session. [JsonPropertyName("mcp3pEnabled")] public bool Mcp3pEnabled { get; set; } /// Map of server name to recorded pending-auth state. [JsonPropertyName("needsAuthServers")] public IDictionary NeedsAuthServers { get => field ??= new Dictionary(); set; } /// Names of servers with in-flight connection attempts. [JsonPropertyName("pendingConnections")] public IList PendingConnections { get => field ??= []; set; } } /// Schema for the `McpServer` type. [Experimental(Diagnostics.Experimental)] public sealed class McpServer { /// Error message if the server failed to connect. [JsonPropertyName("error")] public string? Error { get; set; } /// Server name (config key). [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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 string Name { get; set; } = string.Empty; /// Configuration source: user, workspace, plugin, or builtin. [JsonPropertyName("source")] public McpServerSource? Source { get; set; } /// Plugin name that provided this server, when source is plugin. [JsonPropertyName("sourcePlugin")] public string? SourcePlugin { get; set; } /// Plugin version that provided this server, when source is plugin. [JsonPropertyName("sourcePluginVersion")] public string? SourcePluginVersion { get; set; } /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured. [JsonPropertyName("status")] public McpServerStatus Status { get; set; } } /// MCP servers configured for the session, with their connection status and host-level state. [Experimental(Diagnostics.Experimental)] public sealed class McpServerList { /// Host-level state, omitted when no MCP host is initialized. [JsonPropertyName("host")] public McpHostState? Host { get; set; } /// Configured MCP servers. [JsonPropertyName("servers")] public IList Servers { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionMcpListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `McpTools` type. [Experimental(Diagnostics.Experimental)] public sealed class McpTools { /// Tool description, when provided. [JsonPropertyName("description")] public string? Description { get; set; } /// Tool name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Tools exposed by the connected MCP server. Throws when the server is not connected. [Experimental(Diagnostics.Experimental)] public sealed class McpListToolsResult { /// Tools exposed by the server. [JsonPropertyName("tools")] public IList Tools { get => field ??= []; set; } } /// Server name whose tool list should be returned. [Experimental(Diagnostics.Experimental)] internal sealed class McpListToolsRequest { /// Name of the connected MCP server whose tools to list. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Name of the MCP server to enable for the session. [Experimental(Diagnostics.Experimental)] internal sealed class McpEnableRequest { /// Name of the MCP server to enable. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Name of the MCP server to disable for the session. [Experimental(Diagnostics.Experimental)] internal sealed class McpDisableRequest { /// Name of the MCP server to disable. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionMcpReloadRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `McpAllowedServer` type. [Experimental(Diagnostics.Experimental)] public sealed class McpAllowedServer { /// Allowed server name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// PII-free note explaining why the server was allowed. [JsonPropertyName("redactedNote")] public string? RedactedNote { get; set; } } /// Schema for the `McpFilteredServer` type. [Experimental(Diagnostics.Experimental)] public sealed class McpFilteredServer { /// Enterprise login associated with an allowlist policy. [JsonPropertyName("enterpriseName")] public string? EnterpriseName { get; set; } /// Filtered server name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Human-readable filter reason. [JsonPropertyName("reason")] public string Reason { get; set; } = string.Empty; /// PII-free filter reason. [JsonPropertyName("redactedReason")] public string? RedactedReason { get; set; } } /// MCP server startup filtering result. [Experimental(Diagnostics.Experimental)] internal sealed class McpStartServersResult { /// Non-default servers allowed by policy. [JsonPropertyName("allowedServers")] public IList? AllowedServers { get; set; } /// Servers filtered out before startup. [JsonPropertyName("filteredServers")] public IList FilteredServers { get => field ??= []; set; } } /// Opaque MCP reload configuration. [Experimental(Diagnostics.Experimental)] internal sealed class McpReloadWithConfigRequest { /// Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire). [JsonInclude] [JsonPropertyName("config")] internal JsonElement Config { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape. [Experimental(Diagnostics.Experimental)] public sealed class McpExecuteSamplingResult { } /// Outcome of an MCP sampling execution: success result, failure error, or cancellation. [Experimental(Diagnostics.Experimental)] public sealed class McpSamplingExecutionResult { /// Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution. [JsonPropertyName("action")] public McpSamplingExecutionAction Action { get; set; } /// Error description, present when action='failure'. [JsonPropertyName("error")] public string? Error { get; set; } /// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape. [JsonPropertyName("result")] public McpExecuteSamplingResult? Result { get; set; } } /// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally. [Experimental(Diagnostics.Experimental)] public sealed class McpExecuteSamplingRequest { } /// Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference. [Experimental(Diagnostics.Experimental)] internal sealed class McpExecuteSamplingParams { /// The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle). [JsonPropertyName("mcpRequestId")] public JsonElement McpRequestId { get; set; } /// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally. [JsonPropertyName("request")] public McpExecuteSamplingRequest Request { get => field ??= new(); set; } /// Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Name of the MCP server that initiated the sampling request. [JsonPropertyName("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether an in-flight sampling execution with the given requestId was found and cancelled. [Experimental(Diagnostics.Experimental)] public sealed class McpCancelSamplingExecutionResult { /// True if an in-flight execution with the given requestId was found and signalled to cancel. False when no such execution is in flight (already completed, never started, or cancelled by another caller). [JsonPropertyName("cancelled")] public bool Cancelled { get; set; } } /// The requestId previously passed to executeSampling that should be cancelled. [Experimental(Diagnostics.Experimental)] internal sealed class McpCancelSamplingExecutionParams { /// The requestId previously passed to executeSampling that should be cancelled. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Env-value mode recorded on the session after the update. [Experimental(Diagnostics.Experimental)] public sealed class McpSetEnvValueModeResult { /// Mode recorded on the session after the update. [JsonPropertyName("mode")] public McpSetEnvValueModeDetails Mode { get; set; } } /// Mode controlling how MCP server env values are resolved (`direct` or `indirect`). [Experimental(Diagnostics.Experimental)] internal sealed class McpSetEnvValueModeParams { /// How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct". [JsonPropertyName("mode")] public McpSetEnvValueModeDetails Mode { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove). [Experimental(Diagnostics.Experimental)] public sealed class McpRemoveGitHubResult { /// True when the auto-managed `github` MCP server was removed; false when no removal happened (e.g. user has explicitly configured a `github` server, or the server was not registered). [JsonPropertyName("removed")] public bool Removed { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionMcpRemoveGitHubRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Result of configuring GitHub MCP. [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigureGitHubResult { /// Whether GitHub MCP configuration changed. [JsonPropertyName("changed")] public bool Changed { get; set; } } /// Opaque auth info used to configure GitHub MCP. [Experimental(Diagnostics.Experimental)] internal sealed class McpConfigureGitHubRequest { /// Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire). [JsonInclude] [JsonPropertyName("authInfo")] internal JsonElement AuthInfo { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Server name and opaque configuration for an individual MCP server start. [Experimental(Diagnostics.Experimental)] internal sealed class McpStartServerRequest { /// Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime shape supplied only by in-process CLI callers. [JsonInclude] [JsonPropertyName("config")] internal JsonElement Config { get; set; } /// Name of the MCP server to start. [JsonPropertyName("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Server name and opaque configuration for an individual MCP server restart. [Experimental(Diagnostics.Experimental)] internal sealed class McpRestartServerRequest { /// Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime shape supplied only by in-process CLI callers. [JsonInclude] [JsonPropertyName("config")] internal JsonElement Config { get; set; } /// Name of the MCP server to restart. [JsonPropertyName("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Server name for an individual MCP server stop. [Experimental(Diagnostics.Experimental)] internal sealed class McpStopServerRequest { /// Name of the MCP server to stop. [JsonPropertyName("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Registration parameters for an external MCP client. [Experimental(Diagnostics.Experimental)] internal sealed class McpRegisterExternalClientRequest { /// In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary. [JsonInclude] [JsonPropertyName("client")] internal JsonElement Client { get; set; } /// In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions. [JsonInclude] [JsonPropertyName("config")] internal JsonElement Config { get; set; } /// Logical server name for the external client. [JsonPropertyName("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary. [JsonInclude] [JsonPropertyName("transport")] internal JsonElement Transport { get; set; } } /// Server name identifying the external client to remove. [Experimental(Diagnostics.Experimental)] internal sealed class McpUnregisterExternalClientRequest { /// Server name of the external client to unregister. [JsonPropertyName("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Whether the named MCP server is running. [Experimental(Diagnostics.Experimental)] public sealed class McpIsServerRunningResult { /// True if the server has an active client and transport. [JsonPropertyName("running")] public bool Running { get; set; } } /// Server name to check running status for. [Experimental(Diagnostics.Experimental)] internal sealed class McpIsServerRunningRequest { /// Name of the MCP server to check. [JsonPropertyName("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Empty result after recording the MCP OAuth response. [Experimental(Diagnostics.Experimental)] internal sealed class McpOauthRespondResult { } /// MCP OAuth request id and optional provider response. [Experimental(Diagnostics.Experimental)] internal sealed class McpOauthRespondRequest { /// In-process OAuthClientProvider instance, or omitted to deny. Marked internal: cannot be serialized across the JSON-RPC boundary. [JsonInclude] [JsonPropertyName("provider")] internal JsonElement? Provider { get; set; } /// OAuth request identifier from mcp.oauth_required. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the pending MCP OAuth response was accepted. [Experimental(Diagnostics.Experimental)] public sealed class McpOauthHandlePendingResult { /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved. [JsonPropertyName("success")] public bool Success { get; set; } } /// Host response to the pending OAuth request. /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(McpOauthPendingRequestResponseToken), "token")] [JsonDerivedType(typeof(McpOauthPendingRequestResponseCancelled), "cancelled")] public partial class McpOauthPendingRequestResponse { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// The token variant of . [Experimental(Diagnostics.Experimental)] public partial class McpOauthPendingRequestResponseToken : McpOauthPendingRequestResponse { /// [JsonIgnore] public override string Kind => "token"; /// Access token acquired by the SDK host. [JsonPropertyName("accessToken")] public required string AccessToken { get; set; } /// Token lifetime in seconds, if known. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("expiresIn")] public long? ExpiresIn { get; set; } /// OAuth token type. Defaults to Bearer when omitted. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("tokenType")] public string? TokenType { get; set; } } /// The cancelled variant of . [Experimental(Diagnostics.Experimental)] public partial class McpOauthPendingRequestResponseCancelled : McpOauthPendingRequestResponse { /// [JsonIgnore] public override string Kind => "cancelled"; } /// Pending MCP OAuth request ID and host-provided token or cancellation response. [Experimental(Diagnostics.Experimental)] internal sealed class McpOauthHandlePendingRequest { /// OAuth request identifier from the mcp.oauth_required event. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Host response to the pending OAuth request. [JsonPropertyName("result")] public McpOauthPendingRequestResponse Result { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. [Experimental(Diagnostics.Experimental)] public sealed class McpOauthLoginResult { /// URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed. [Url] [StringSyntax(StringSyntaxAttribute.Uri)] [JsonPropertyName("authorizationUrl")] public string? AuthorizationUrl { get; set; } } /// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. [Experimental(Diagnostics.Experimental)] internal sealed class McpOauthLoginRequest { /// Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return. [JsonPropertyName("callbackSuccessMessage")] public string? CallbackSuccessMessage { get; set; } /// Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration. [JsonPropertyName("clientId")] public string? ClientId { get; set; } /// Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees. [JsonPropertyName("clientName")] public string? ClientName { get; set; } /// Optional OAuth client secret override for this login. The runtime treats this as an ephemeral host-owned secret, uses it for this authentication attempt and does not persist it. [JsonPropertyName("clientSecret")] public string? ClientSecret { get; set; } /// When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck. [JsonPropertyName("forceReauth")] public bool? ForceReauth { get; set; } /// Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified. [JsonPropertyName("grantType")] public McpOauthLoginGrantType? GrantType { get; set; } /// Optional override indicating whether the static OAuth client is public. When false, the runtime treats it as confidential and uses the per-login clientSecret if provided, otherwise retrieving the client secret from the MCP OAuth secret store. [JsonPropertyName("publicClient")] public bool? PublicClient { get; set; } /// Name of the remote MCP server to authenticate. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the pending MCP headers refresh response was accepted. [Experimental(Diagnostics.Experimental)] public sealed class McpHeadersHandlePendingHeadersRefreshRequestResult { /// Whether the response was accepted. False if the request was unknown, timed out, or already resolved. [JsonPropertyName("success")] public bool Success { get; set; } } /// Host response: supply dynamic headers or decline this refresh. /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(McpHeadersHandlePendingHeadersRefreshRequestHeaders), "headers")] [JsonDerivedType(typeof(McpHeadersHandlePendingHeadersRefreshRequestNone), "none")] public partial class McpHeadersHandlePendingHeadersRefreshRequest { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// The headers variant of . [Experimental(Diagnostics.Experimental)] public partial class McpHeadersHandlePendingHeadersRefreshRequestHeaders : McpHeadersHandlePendingHeadersRefreshRequest { /// [JsonIgnore] public override string Kind => "headers"; /// Headers to overlay onto the MCP request. Dynamic headers override static config headers but do not replace SDK-managed request headers. [JsonPropertyName("headers")] public required IDictionary Headers { get; set; } } /// The none variant of . [Experimental(Diagnostics.Experimental)] public partial class McpHeadersHandlePendingHeadersRefreshRequestNone : McpHeadersHandlePendingHeadersRefreshRequest { /// [JsonIgnore] public override string Kind => "none"; } /// MCP headers refresh request id and the host response. [Experimental(Diagnostics.Experimental)] internal sealed class McpHeadersHandlePendingHeadersRefreshRequestRequest { /// Headers refresh request identifier from mcp.headers_refresh_required. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Host response: supply dynamic headers or decline this refresh. [JsonPropertyName("result")] public McpHeadersHandlePendingHeadersRefreshRequest Result { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `McpAppsResourceContent` type. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsResourceContent { /// Resource-level metadata (CSP, permissions, etc.). [JsonPropertyName("_meta")] public IDictionary? _meta { get; set; } /// Base64-encoded binary content. [JsonPropertyName("blob")] public string? Blob { get; set; } /// MIME type of the content. [JsonPropertyName("mimeType")] public string? MimeType { get; set; } /// Text content (e.g. HTML). [JsonPropertyName("text")] public string? Text { get; set; } /// The resource URI (typically ui://...). [JsonPropertyName("uri")] public string Uri { get; set; } = string.Empty; } /// Resource contents returned by the MCP server. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsReadResourceResult { /// Resource contents returned by the server. [JsonPropertyName("contents")] public IList Contents { get => field ??= []; set; } } /// MCP server and resource URI to fetch. [Experimental(Diagnostics.Experimental)] internal sealed class McpAppsReadResourceRequest { /// Name of the MCP server hosting the resource. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Resource URI (typically ui://...). [JsonPropertyName("uri")] public string Uri { get; set; } = string.Empty; } /// App-callable tools from the named MCP server. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsListToolsResult { /// App-callable tools from the server. [JsonPropertyName("tools")] public IList> Tools { get => field ??= []; set; } } /// MCP server to list app-callable tools for. [Experimental(Diagnostics.Experimental)] internal sealed class McpAppsListToolsRequest { /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("originServerName")] public string OriginServerName { get; set; } = string.Empty; /// MCP server hosting the app. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// MCP server, tool name, and arguments to invoke from an MCP App view. [Experimental(Diagnostics.Experimental)] internal sealed class McpAppsCallToolRequest { /// Tool arguments. [JsonPropertyName("arguments")] public IDictionary? Arguments { get; set; } /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("originServerName")] public string OriginServerName { get; set; } = string.Empty; /// MCP server hosting the tool. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// MCP tool name. [JsonPropertyName("toolName")] public string ToolName { get; set; } = string.Empty; } /// Host context advertised to MCP App guests. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsSetHostContextDetails { /// Display modes the host supports. [JsonPropertyName("availableDisplayModes")] public IList? AvailableDisplayModes { get; set; } /// Current display mode (SEP-1865). [JsonPropertyName("displayMode")] public McpAppsSetHostContextDetailsDisplayMode? DisplayMode { get; set; } /// BCP-47 locale, e.g. 'en-US'. [JsonPropertyName("locale")] public string? Locale { get; set; } /// Platform type for responsive design. [JsonPropertyName("platform")] public McpAppsSetHostContextDetailsPlatform? Platform { get; set; } /// UI theme preference per SEP-1865. [JsonPropertyName("theme")] public McpAppsSetHostContextDetailsTheme? Theme { get; set; } /// IANA timezone, e.g. 'America/New_York'. [JsonPropertyName("timeZone")] public string? TimeZone { get; set; } /// Host application identifier. [JsonPropertyName("userAgent")] public string? UserAgent { get; set; } } /// Host context to advertise to MCP App guests. [Experimental(Diagnostics.Experimental)] internal sealed class McpAppsSetHostContextRequest { /// Host context advertised to MCP App guests. [JsonPropertyName("context")] public McpAppsSetHostContextDetails Context { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Current host context. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsHostContextDetails { /// Display modes the host supports. [JsonPropertyName("availableDisplayModes")] public IList? AvailableDisplayModes { get; set; } /// Current display mode (SEP-1865). [JsonPropertyName("displayMode")] public McpAppsHostContextDetailsDisplayMode? DisplayMode { get; set; } /// BCP-47 locale, e.g. 'en-US'. [JsonPropertyName("locale")] public string? Locale { get; set; } /// Platform type for responsive design. [JsonPropertyName("platform")] public McpAppsHostContextDetailsPlatform? Platform { get; set; } /// UI theme preference per SEP-1865. [JsonPropertyName("theme")] public McpAppsHostContextDetailsTheme? Theme { get; set; } /// IANA timezone, e.g. 'America/New_York'. [JsonPropertyName("timeZone")] public string? TimeZone { get; set; } /// Host application identifier. [JsonPropertyName("userAgent")] public string? UserAgent { get; set; } } /// Current host context advertised to MCP App guests. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsHostContext { /// Current host context. [JsonPropertyName("context")] public McpAppsHostContextDetails Context { get => field ??= new(); set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionMcpAppsGetHostContextRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Capability negotiation snapshot. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsDiagnoseCapability { /// Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers. [JsonPropertyName("advertised")] public bool Advertised { get; set; } /// Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on. [JsonPropertyName("featureFlagEnabled")] public bool FeatureFlagEnabled { get; set; } /// Whether the session has the `mcp-apps` capability. [JsonPropertyName("sessionHasMcpApps")] public bool SessionHasMcpApps { get; set; } } /// What the server returned for this session. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsDiagnoseServer { /// Whether the named server is currently connected. [JsonPropertyName("connected")] public bool Connected { get; set; } /// Up to 5 tool names with `_meta.ui` for quick inspection. [JsonPropertyName("sampleToolNames")] public IList SampleToolNames { get => field ??= []; set; } /// Total tools returned by the server's tools/list. [JsonPropertyName("toolCount")] public double ToolCount { get; set; } /// Tools whose `_meta.ui` is populated (resourceUri and/or visibility set). [JsonPropertyName("toolsWithUiMeta")] public double ToolsWithUiMeta { get; set; } } /// Diagnostic snapshot of MCP Apps wiring for the named server. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsDiagnoseResult { /// Capability negotiation snapshot. [JsonPropertyName("capability")] public McpAppsDiagnoseCapability Capability { get => field ??= new(); set; } /// What the server returned for this session. [JsonPropertyName("server")] public McpAppsDiagnoseServer Server { get => field ??= new(); set; } } /// MCP server to diagnose MCP Apps wiring for. [Experimental(Diagnostics.Experimental)] internal sealed class McpAppsDiagnoseRequest { /// MCP server to probe. [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] [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("serverName")] public string ServerName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `Plugin` type. [Experimental(Diagnostics.Experimental)] public sealed class Plugin { /// Whether the plugin is currently enabled. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Marketplace the plugin came from. [JsonPropertyName("marketplace")] public string Marketplace { get; set; } = string.Empty; /// Plugin name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Installed version. [JsonPropertyName("version")] public string? Version { get; set; } } /// Plugins installed for the session, with their enabled state and version metadata. [Experimental(Diagnostics.Experimental)] public sealed class PluginList { /// Installed plugins. [JsonPropertyName("plugins")] public IList Plugins { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionPluginsListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Optional flags controlling which side effects the reload performs. [Experimental(Diagnostics.Experimental)] public sealed class PluginsReloadRequest { /// When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`. [JsonPropertyName("deferRepoHooks")] public bool? DeferRepoHooks { get; set; } /// Re-run custom-agent discovery after refreshing plugins. Defaults to true. [JsonPropertyName("reloadCustomAgents")] public bool? ReloadCustomAgents { get; set; } /// Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions). [JsonPropertyName("reloadHooks")] public bool? ReloadHooks { get; set; } /// Reload MCP server connections after refreshing plugins. Defaults to true. [JsonPropertyName("reloadMcp")] public bool? ReloadMcp { get; set; } } /// Optional flags controlling which side effects the reload performs. [Experimental(Diagnostics.Experimental)] internal sealed class PluginsReloadRequestWithSession { /// When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`. [JsonPropertyName("deferRepoHooks")] public bool? DeferRepoHooks { get; set; } /// Re-run custom-agent discovery after refreshing plugins. Defaults to true. [JsonPropertyName("reloadCustomAgents")] public bool? ReloadCustomAgents { get; set; } /// Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions). [JsonPropertyName("reloadHooks")] public bool? ReloadHooks { get; set; } /// Reload MCP server connections after refreshing plugins. Defaults to true. [JsonPropertyName("reloadMcp")] public bool? ReloadMcp { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one. [Experimental(Diagnostics.Experimental)] public sealed class ProviderSessionToken { /// When the token expires, if known. Callers should refresh by calling `getEndpoint` again before this time, or reactively on any 401/403 response from `baseUrl`. [JsonPropertyName("expiresAt")] public DateTimeOffset? ExpiresAt { get; set; } /// HTTP header name the token must be sent under. [JsonPropertyName("header")] public string Header { get; set; } = string.Empty; /// The model the token is bound to, when applicable. When set, the token is only valid for requests against this model. [JsonPropertyName("model")] public string? Model { get; set; } /// The short-lived token value. [JsonPropertyName("token")] public string Token { get; set; } = string.Empty; } /// A snapshot of the provider endpoint the session is currently configured to talk to. [Experimental(Diagnostics.Experimental)] public sealed class ProviderEndpoint { /// A credential the caller should use with this endpoint. Omitted only when the endpoint accepts unauthenticated requests. [JsonPropertyName("apiKey")] public string? ApiKey { get; set; } /// Base URL to pass to the LLM client library. [Url] [StringSyntax(StringSyntaxAttribute.Uri)] [JsonPropertyName("baseUrl")] public string BaseUrl { get; set; } = string.Empty; /// HTTP headers the caller must include on every outbound request. [JsonPropertyName("headers")] public IDictionary Headers { get => field ??= new Dictionary(); set; } /// Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one. [JsonPropertyName("sessionToken")] public ProviderSessionToken? SessionToken { get; set; } /// Transport to be used for provider requests. [JsonPropertyName("transport")] public ProviderEndpointTransport? Transport { get; set; } /// Provider family. Matches the `type` field of a BYOK provider config. [JsonPropertyName("type")] public ProviderEndpointType Type { get; set; } /// Wire API to be used, when required for the provider type. [JsonPropertyName("wireApi")] public ProviderEndpointWireApi? WireApi { get; set; } } /// Optional model identifier to scope the endpoint snapshot to. [Experimental(Diagnostics.Experimental)] public sealed class ProviderGetEndpointRequest { /// Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using. [JsonPropertyName("modelId")] public string? ModelId { get; set; } } /// Optional model identifier to scope the endpoint snapshot to. [Experimental(Diagnostics.Experimental)] internal sealed class ProviderGetEndpointRequestWithSession { /// Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using. [JsonPropertyName("modelId")] public string? ModelId { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The selectable model entries synthesized for the models added by this call. [Experimental(Diagnostics.Experimental)] public sealed class ProviderAddResult { /// Synthesized selectable model entries for the newly added BYOK models, each under its provider-qualified selection id (`provider/id`). Empty when only providers were added. [JsonPropertyName("models")] public IList Models { get => field ??= []; set; } } /// A BYOK model definition referencing a named provider. [Experimental(Diagnostics.Experimental)] public sealed class ProviderModelConfig { /// Optional capability overrides (vision, tool_calls, reasoning, etc.). [JsonPropertyName("capabilities")] public ModelCapabilitiesOverride? Capabilities { get; set; } /// Provider-local model id, unique within its provider. The session-wide selection id (shown in the model list and passed to switchTo) is the provider-qualified `provider/id`. [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Maximum context window tokens for the model. [JsonPropertyName("maxContextWindowTokens")] public double? MaxContextWindowTokens { get; set; } /// Maximum output tokens for the model. [JsonPropertyName("maxOutputTokens")] public double? MaxOutputTokens { get; set; } /// Maximum prompt/input tokens for the model. [JsonPropertyName("maxPromptTokens")] public double? MaxPromptTokens { get; set; } /// Well-known base model id used for behavior/capability/config lookup. Defaults to `id`. [JsonPropertyName("modelId")] public string? ModelId { get; set; } /// Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`). [JsonPropertyName("name")] public string? Name { get; set; } /// Name of the NamedProviderConfig that serves this model. [JsonPropertyName("provider")] public string Provider { get; set; } = string.Empty; /// The model name sent to the provider API for inference. Defaults to `id`. [JsonPropertyName("wireModel")] public string? WireModel { get; set; } } /// Azure-specific provider options. [Experimental(Diagnostics.Experimental)] public sealed class ProviderConfigAzure { /// API version. When set, uses the versioned deployment route. When omitted, uses the GA versionless v1 route. [JsonPropertyName("apiVersion")] public string? ApiVersion { get; set; } } /// A named BYOK provider connection (transport + credentials). [Experimental(Diagnostics.Experimental)] public sealed class NamedProviderConfig { /// API key. Optional for local providers like Ollama. [JsonPropertyName("apiKey")] public string? ApiKey { get; set; } /// Azure-specific provider options. [JsonPropertyName("azure")] public ProviderConfigAzure? Azure { get; set; } /// API endpoint URL. [JsonPropertyName("baseUrl")] public string BaseUrl { get; set; } = string.Empty; /// Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set. [JsonPropertyName("bearerToken")] public string? BearerToken { get; set; } /// When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer <token>` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential. [JsonPropertyName("hasBearerTokenProvider")] public bool? HasBearerTokenProvider { get; set; } /// Custom HTTP headers to include in all outbound requests to the provider. [JsonPropertyName("headers")] public IDictionary? Headers { get; set; } /// Stable identifier referenced by BYOK model definitions. Must not contain '/'. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Provider transport. Defaults to "http". [JsonPropertyName("transport")] public ProviderConfigTransport? Transport { get; set; } /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. [JsonPropertyName("type")] public ProviderConfigType? Type { get; set; } /// Wire API format (openai/azure only). Defaults to "completions". [JsonPropertyName("wireApi")] public ProviderConfigWireApi? WireApi { get; set; } } /// BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both. [Experimental(Diagnostics.Experimental)] internal sealed class ProviderAddRequest { /// BYOK model definitions to register. Each must reference a provider that is already registered or included in this same call. Selection ids (`provider/id`) must be unique across the registry. [JsonPropertyName("models")] public IList? Models { get; set; } /// Named BYOK provider connections to register, additive to any providers already in the registry. Each name must be unique across the registry and must not contain '/'. [JsonPropertyName("providers")] public IList? Providers { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the session options patch was applied successfully. [Experimental(Diagnostics.Experimental)] public sealed class SessionUpdateOptionsResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRuleSource` type. [Experimental(Diagnostics.Experimental)] public sealed class OptionsUpdateAdditionalContentExclusionPolicyRuleSource { /// Gets or sets the name value. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Gets or sets the type value. [JsonPropertyName("type")] public string Type { get; set; } = string.Empty; } /// Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRule` type. [Experimental(Diagnostics.Experimental)] public sealed class OptionsUpdateAdditionalContentExclusionPolicyRule { /// Gets or sets the ifAnyMatch value. [JsonPropertyName("ifAnyMatch")] public IList? IfAnyMatch { get; set; } /// Gets or sets the ifNoneMatch value. [JsonPropertyName("ifNoneMatch")] public IList? IfNoneMatch { get; set; } /// Gets or sets the paths value. [JsonPropertyName("paths")] public IList Paths { get => field ??= []; set; } /// Schema for the `OptionsUpdateAdditionalContentExclusionPolicyRuleSource` type. [JsonPropertyName("source")] public OptionsUpdateAdditionalContentExclusionPolicyRuleSource Source { get => field ??= new(); set; } } /// Schema for the `OptionsUpdateAdditionalContentExclusionPolicy` type. [Experimental(Diagnostics.Experimental)] public sealed class OptionsUpdateAdditionalContentExclusionPolicy { /// Gets or sets the last_updated_at value. [JsonPropertyName("last_updated_at")] public JsonElement LastUpdatedAt { get; set; } /// Gets or sets the rules value. [JsonPropertyName("rules")] public IList Rules { get => field ??= []; set; } /// Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration. [JsonPropertyName("scope")] public OptionsUpdateAdditionalContentExclusionPolicyScope Scope { get; set; } } /// Options scoped to the built-in CAPI (Copilot API) provider. [Experimental(Diagnostics.Experimental)] public sealed class CapiSessionOptions { /// Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable. [JsonPropertyName("enableWebSocketResponses")] public bool? EnableWebSocketResponses { get; set; } } /// Schema for the `SessionInstalledPlugin` type. [Experimental(Diagnostics.Experimental)] public sealed class SessionInstalledPlugin { /// Path where the plugin is cached locally. [JsonPropertyName("cache_path")] public string? CachePath { get; set; } /// Whether the plugin is currently enabled. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Installation timestamp (ISO-8601). [JsonPropertyName("installed_at")] public string InstalledAt { get; set; } = string.Empty; /// Marketplace the plugin came from (empty string for direct repo installs). [JsonPropertyName("marketplace")] public string Marketplace { get; set; } = string.Empty; /// Plugin name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Source descriptor for direct repo installs (when marketplace is empty). [JsonPropertyName("source")] public JsonElement? Source { get; set; } /// Installed version, if known. [JsonPropertyName("version")] public string? Version { get; set; } } /// Custom model-provider configuration (BYOK). [Experimental(Diagnostics.Experimental)] public sealed class ProviderConfig { /// API key. Optional for local providers like Ollama. [JsonPropertyName("apiKey")] public string? ApiKey { get; set; } /// Azure-specific provider options. [JsonPropertyName("azure")] public ProviderConfigAzure? Azure { get; set; } /// API endpoint URL. [JsonPropertyName("baseUrl")] public string BaseUrl { get; set; } = string.Empty; /// Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set. [JsonPropertyName("bearerToken")] public string? BearerToken { get; set; } /// When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer <token>` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential. [JsonPropertyName("hasBearerTokenProvider")] public bool? HasBearerTokenProvider { get; set; } /// Custom HTTP headers to include in all outbound requests to the provider. [JsonPropertyName("headers")] public IDictionary? Headers { get; set; } /// Maximum context window tokens for the model. [JsonPropertyName("maxContextWindowTokens")] public double? MaxContextWindowTokens { get; set; } /// Maximum output tokens for the model. [JsonPropertyName("maxOutputTokens")] public double? MaxOutputTokens { get; set; } /// Maximum prompt/input tokens for the model. [JsonPropertyName("maxPromptTokens")] public double? MaxPromptTokens { get; set; } /// Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model. [JsonPropertyName("modelId")] public string? ModelId { get; set; } /// Provider transport. Defaults to "http". [JsonPropertyName("transport")] public ProviderConfigTransport? Transport { get; set; } /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. [JsonPropertyName("type")] public ProviderConfigType? Type { get; set; } /// Wire API format (openai/azure only). Defaults to "completions". [JsonPropertyName("wireApi")] public ProviderConfigWireApi? WireApi { get; set; } /// The model identifier sent to the provider API for inference (the "wire" model), as opposed to modelId which is the well-known base. [JsonPropertyName("wireModel")] public string? WireModel { get; set; } } /// macOS seatbelt experimental options. [Experimental(Diagnostics.Experimental)] public sealed class SandboxConfigUserPolicyExperimentalSeatbelt { /// Whether the macOS seatbelt profile may access the keychain. [JsonPropertyName("keychainAccess")] public bool? KeychainAccess { get; set; } } /// Platform-specific experimental policy fields. [Experimental(Diagnostics.Experimental)] public sealed class SandboxConfigUserPolicyExperimental { /// macOS seatbelt experimental options. [JsonPropertyName("seatbelt")] public SandboxConfigUserPolicyExperimentalSeatbelt? Seatbelt { get; set; } } /// Filesystem rules to merge into the base policy. [Experimental(Diagnostics.Experimental)] public sealed class SandboxConfigUserPolicyFilesystem { /// Whether to clear the policy when the session exits. [JsonPropertyName("clearPolicyOnExit")] public bool? ClearPolicyOnExit { get; set; } /// Paths explicitly denied. [JsonPropertyName("deniedPaths")] public IList? DeniedPaths { get; set; } /// Paths granted read-only access. [JsonPropertyName("readonlyPaths")] public IList? ReadonlyPaths { get; set; } /// Paths granted read/write access. [JsonPropertyName("readwritePaths")] public IList? ReadwritePaths { get; set; } } /// Network rules to merge into the base policy. [Experimental(Diagnostics.Experimental)] public sealed class SandboxConfigUserPolicyNetwork { /// Hosts allowed in addition to the base policy. [JsonPropertyName("allowedHosts")] public IList? AllowedHosts { get; set; } /// Whether traffic to local/loopback addresses is allowed. [JsonPropertyName("allowLocalNetwork")] public bool? AllowLocalNetwork { get; set; } /// Whether outbound network traffic is allowed at all. [JsonPropertyName("allowOutbound")] public bool? AllowOutbound { get; set; } /// Hosts explicitly blocked. [JsonPropertyName("blockedHosts")] public IList? BlockedHosts { get; set; } } /// macOS seatbelt-specific options. [Experimental(Diagnostics.Experimental)] public sealed class SandboxConfigUserPolicySeatbelt { /// Whether the macOS seatbelt profile may access the keychain. [JsonPropertyName("keychainAccess")] public bool? KeychainAccess { get; set; } } /// User-managed sandbox policy fragment merged into the auto-discovered base policy. [Experimental(Diagnostics.Experimental)] public sealed class SandboxConfigUserPolicy { /// Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent. [JsonPropertyName("experimental")] public SandboxConfigUserPolicyExperimental? Experimental { get; set; } /// Filesystem rules to merge into the base policy. [JsonPropertyName("filesystem")] public SandboxConfigUserPolicyFilesystem? Filesystem { get; set; } /// Network rules to merge into the base policy. [JsonPropertyName("network")] public SandboxConfigUserPolicyNetwork? Network { get; set; } /// macOS seatbelt options to merge into the base policy. [JsonPropertyName("seatbelt")] public SandboxConfigUserPolicySeatbelt? Seatbelt { get; set; } } /// Resolved sandbox configuration. [Experimental(Diagnostics.Experimental)] public sealed class SandboxConfig { /// Whether to auto-add the current working directory to readwritePaths. Default: true. [JsonPropertyName("addCurrentWorkingDirectory")] public bool? AddCurrentWorkingDirectory { get; set; } /// Whether sandboxing is enabled for the session. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// User-managed sandbox policy fragment merged into the auto-discovered base policy. [JsonPropertyName("userPolicy")] public SandboxConfigUserPolicy? UserPolicy { get; set; } } /// Patch of mutable session options to apply to the running session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionUpdateOptionsParams { /// Additional content-exclusion policies to merge into the session's policy set. [Experimental(Diagnostics.Experimental)] [JsonPropertyName("additionalContentExclusionPolicies")] public IList? AdditionalContentExclusionPolicies { get; set; } /// Runtime context discriminator (e.g., `cli`, `actions`). [JsonPropertyName("agentContext")] public string? AgentContext { get; set; } /// Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers. [JsonPropertyName("allowAllMcpServerInstructions")] public bool? AllowAllMcpServerInstructions { get; set; } /// Whether to disable the `ask_user` tool (encourages autonomous behavior). [JsonPropertyName("askUserDisabled")] public bool? AskUserDisabled { get; set; } /// Allowlist of tool names available to this session. [JsonPropertyName("availableTools")] public IList? AvailableTools { get; set; } /// Options scoped to the built-in CAPI (Copilot API) provider. [JsonPropertyName("capi")] public CapiSessionOptions? Capi { get; set; } /// Identifier of the client driving the session. [JsonPropertyName("clientName")] public string? ClientName { get; set; } /// Whether to include the `Co-authored-by` trailer in commit messages. [JsonPropertyName("coauthorEnabled")] public bool? CoauthorEnabled { get; set; } /// Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier. [JsonPropertyName("contextTier")] public OptionsUpdateContextTier? ContextTier { get; set; } /// Whether to allow auto-mode continuation across turns. [JsonPropertyName("continueOnAutoMode")] public bool? ContinueOnAutoMode { get; set; } /// Override URL for the Copilot API endpoint. [JsonPropertyName("copilotUrl")] public string? CopilotUrl { get; set; } /// Whether to default custom agents to local-only execution. [JsonPropertyName("customAgentsLocalOnly")] public bool? CustomAgentsLocalOnly { get; set; } /// Instruction source IDs to exclude from the system prompt. [JsonPropertyName("disabledInstructionSources")] public IList? DisabledInstructionSources { get; set; } /// Skill IDs that should be excluded from this session. [JsonPropertyName("disabledSkills")] public IList? DisabledSkills { get; set; } /// Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism. [JsonPropertyName("enableFileHooks")] public bool? EnableFileHooks { get; set; } /// Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt). [JsonPropertyName("enableHostGitOperations")] public bool? EnableHostGitOperations { get; set; } /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. [JsonPropertyName("enableOnDemandInstructionDiscovery")] public bool? EnableOnDemandInstructionDiscovery { get; set; } /// Whether to surface reasoning-summary events from the model. [JsonPropertyName("enableReasoningSummaries")] public bool? EnableReasoningSummaries { get; set; } /// Whether shell-script safety heuristics are enabled. [JsonPropertyName("enableScriptSafety")] public bool? EnableScriptSafety { get; set; } /// Whether to enable cross-session store writes and reads. [JsonPropertyName("enableSessionStore")] public bool? EnableSessionStore { get; set; } /// Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset. [JsonPropertyName("enableSkills")] public bool? EnableSkills { get; set; } /// Whether to stream model responses. [JsonPropertyName("enableStreaming")] public bool? EnableStreaming { get; set; } /// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). [JsonPropertyName("envValueMode")] public OptionsUpdateEnvValueMode? EnvValueMode { get; set; } /// Override directory for the session-events log. When unset, the runtime's default events log directory is used. [JsonPropertyName("eventsLogDirectory")] public string? EventsLogDirectory { get; set; } /// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. [JsonPropertyName("excludedBuiltinAgents")] public IList? ExcludedBuiltinAgents { get; set; } /// Denylist of tool names for this session. [JsonPropertyName("excludedTools")] public IList? ExcludedTools { get; set; } /// Map of feature-flag IDs to their boolean enabled state. [JsonPropertyName("featureFlags")] public IDictionary? FeatureFlags { get; set; } /// Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes. [JsonPropertyName("installedPlugins")] public IList? InstalledPlugins { get; set; } /// Stable integration identifier used for analytics and rate-limit attribution. [JsonPropertyName("integrationId")] public string? IntegrationId { get; set; } /// Whether experimental capabilities are enabled. [JsonPropertyName("isExperimentalMode")] public bool? IsExperimentalMode { get; set; } /// Whether interactive shell sessions are logged. [JsonPropertyName("logInteractiveShells")] public bool? LogInteractiveShells { get; set; } /// Identifier sent to LSP-style integrations. [JsonPropertyName("lspClientName")] public string? LspClientName { get; set; } /// Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users). [JsonPropertyName("manageScheduleEnabled")] public bool? ManageScheduleEnabled { get; set; } /// Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB. [JsonPropertyName("maxInlineBinaryBytes")] public long? MaxInlineBinaryBytes { get; set; } /// The model ID to use for assistant turns. [JsonPropertyName("model")] public string? Model { get; set; } /// Per-property model capability overrides for the selected model. [JsonPropertyName("modelCapabilitiesOverrides")] public ModelCapabilitiesOverride? ModelCapabilitiesOverrides { get; set; } /// Organization-level custom instructions to inject into the system prompt. [JsonPropertyName("organizationCustomInstructions")] public string? OrganizationCustomInstructions { get; set; } /// Custom model-provider configuration (BYOK). [JsonPropertyName("provider")] public ProviderConfig? Provider { get; set; } /// Reasoning effort for the selected model (model-defined enum). [JsonPropertyName("reasoningEffort")] public string? ReasoningEffort { get; set; } /// Reasoning summary mode for supported model clients. [JsonPropertyName("reasoningSummary")] public OptionsUpdateReasoningSummary? ReasoningSummary { get; set; } /// Whether the session is running in an interactive UI. [JsonPropertyName("runningInInteractiveMode")] public bool? RunningInInteractiveMode { get; set; } /// Resolved sandbox configuration. [JsonPropertyName("sandboxConfig")] public SandboxConfig? SandboxConfig { get; set; } /// Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged. [JsonPropertyName("sessionCapabilities")] public IList? SessionCapabilities { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Optional session limits. Pass null to clear the session limits. [JsonPropertyName("sessionLimits")] public SessionLimitsConfig? SessionLimits { get; set; } /// Shell init profile (`None` or `NonInteractive`). [JsonPropertyName("shellInitProfile")] public string? ShellInitProfile { get; set; } /// Per-shell process flags (e.g., `pwsh` arguments). [JsonPropertyName("shellProcessFlags")] public IList? ShellProcessFlags { get; set; } /// Additional directories to search for skills. [JsonPropertyName("skillDirectories")] public IList? SkillDirectories { get; set; } /// Whether to skip loading custom instruction sources. [JsonPropertyName("skipCustomInstructions")] public bool? SkipCustomInstructions { get; set; } /// Whether to skip embedding retrieval pipeline initialization and execution. [JsonPropertyName("skipEmbeddingRetrieval")] public bool? SkipEmbeddingRetrieval { get; set; } /// When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement. [JsonPropertyName("suppressCustomAgentPrompt")] public bool? SuppressCustomAgentPrompt { get; set; } /// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. [JsonPropertyName("toolFilterPrecedence")] public OptionsUpdateToolFilterPrecedence? ToolFilterPrecedence { get; set; } /// Optional path for trajectory output. [JsonPropertyName("trajectoryFile")] public string? TrajectoryFile { get; set; } /// Absolute working-directory path for shell tools. [JsonPropertyName("workingDirectory")] public string? WorkingDirectory { get; set; } } /// Parameters for (re)loading the merged LSP configuration set. [Experimental(Diagnostics.Experimental)] internal sealed class LspInitializeRequest { /// Force re-initialization even when LSP configs were already loaded for the working directory. [JsonPropertyName("force")] public bool? Force { get; set; } /// Git root used as the boundary when traversing for project-level LSP configs (supports monorepos). [JsonPropertyName("gitRoot")] public string? GitRoot { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted. [JsonPropertyName("workingDirectory")] public string? WorkingDirectory { get; set; } } /// Schema for the `Extension` type. [Experimental(Diagnostics.Experimental)] public sealed class Extension { /// Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext'). [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Extension name (directory name). [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Process ID if the extension is running. [JsonPropertyName("pid")] public long? Pid { get; set; } /// Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state/<id>/extensions/). [JsonPropertyName("source")] public ExtensionSource Source { get; set; } /// Current status: running, disabled, failed, or starting. [JsonPropertyName("status")] public ExtensionStatus Status { get; set; } } /// Extensions discovered for the session, with their current status. [Experimental(Diagnostics.Experimental)] public sealed class ExtensionList { /// Discovered extensions and their current status. [JsonPropertyName("extensions")] public IList Extensions { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionExtensionsListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Source-qualified extension identifier to enable for the session. [Experimental(Diagnostics.Experimental)] internal sealed class ExtensionsEnableRequest { /// Source-qualified extension ID to enable. [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Source-qualified extension identifier to disable for the session. [Experimental(Diagnostics.Experimental)] internal sealed class ExtensionsDisableRequest { /// Source-qualified extension ID to disable. [JsonPropertyName("id")] public string Id { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionExtensionsReloadRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `PushAttachment` type. /// Polymorphic base type discriminated by type. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "type", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(PushAttachmentFile), "file")] [JsonDerivedType(typeof(PushAttachmentDirectory), "directory")] [JsonDerivedType(typeof(PushAttachmentSelection), "selection")] [JsonDerivedType(typeof(PushAttachmentGitHubReference), "github_reference")] [JsonDerivedType(typeof(PushAttachmentGitHubCommit), "github_commit")] [JsonDerivedType(typeof(PushAttachmentGitHubRelease), "github_release")] [JsonDerivedType(typeof(PushAttachmentGitHubActionsJob), "github_actions_job")] [JsonDerivedType(typeof(PushAttachmentGitHubRepository), "github_repository")] [JsonDerivedType(typeof(PushAttachmentGitHubFileDiff), "github_file_diff")] [JsonDerivedType(typeof(PushAttachmentGitHubTreeComparison), "github_tree_comparison")] [JsonDerivedType(typeof(PushAttachmentGitHubUrl), "github_url")] [JsonDerivedType(typeof(PushAttachmentGitHubFile), "github_file")] [JsonDerivedType(typeof(PushAttachmentGitHubSnippet), "github_snippet")] [JsonDerivedType(typeof(PushAttachmentBlob), "blob")] [JsonDerivedType(typeof(PushAttachmentExtensionContext), "extension_context")] public partial class PushAttachment { /// The type discriminator. [JsonPropertyName("type")] public virtual string Type { get; set; } = string.Empty; } /// Optional line range to scope the attachment to a specific section of the file. [Experimental(Diagnostics.Experimental)] public sealed class PushAttachmentFileLineRange { /// End line number (1-based, inclusive). [JsonPropertyName("end")] public long End { get; set; } /// Start line number (1-based). [JsonPropertyName("start")] public long Start { get; set; } } /// File attachment. /// The file variant of . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentFile : PushAttachment { /// [JsonIgnore] public override string Type => "file"; /// User-facing display name for the attachment. [JsonPropertyName("displayName")] public required string DisplayName { get; set; } /// Optional line range to scope the attachment to a specific section of the file. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("lineRange")] public PushAttachmentFileLineRange? LineRange { get; set; } /// Absolute file path. [JsonPropertyName("path")] public required string Path { get; set; } } /// Directory attachment. /// The directory variant of . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentDirectory : PushAttachment { /// [JsonIgnore] public override string Type => "directory"; /// User-facing display name for the attachment. [JsonPropertyName("displayName")] public required string DisplayName { get; set; } /// Absolute directory path. [JsonPropertyName("path")] public required string Path { get; set; } } /// End position of the selection. [Experimental(Diagnostics.Experimental)] public sealed class PushAttachmentSelectionDetailsEnd { /// End character offset within the line (0-based). [JsonPropertyName("character")] public long Character { get; set; } /// End line number (0-based). [JsonPropertyName("line")] public long Line { get; set; } } /// Start position of the selection. [Experimental(Diagnostics.Experimental)] public sealed class PushAttachmentSelectionDetailsStart { /// Start character offset within the line (0-based). [JsonPropertyName("character")] public long Character { get; set; } /// Start line number (0-based). [JsonPropertyName("line")] public long Line { get; set; } } /// Position range of the selection within the file. [Experimental(Diagnostics.Experimental)] public sealed class PushAttachmentSelectionDetails { /// End position of the selection. [JsonPropertyName("end")] public PushAttachmentSelectionDetailsEnd End { get => field ??= new(); set; } /// Start position of the selection. [JsonPropertyName("start")] public PushAttachmentSelectionDetailsStart Start { get => field ??= new(); set; } } /// Code selection attachment from an editor. /// The selection variant of . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentSelection : PushAttachment { /// [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 PushAttachmentSelectionDetails 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 . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubReference : PushAttachment { /// [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 PushAttachmentGitHubReferenceType 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. [Experimental(Diagnostics.Experimental)] public sealed class PushGitHubRepoRef { /// Numeric GitHub repository id. [JsonPropertyName("id")] public long? Id { get; set; } /// Repository name (without owner). [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Repository owner login (user or organization). [JsonPropertyName("owner")] public string Owner { get; set; } = string.Empty; } /// Pointer to a GitHub commit. /// The github_commit variant of . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubCommit : PushAttachment { /// [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 PushGitHubRepoRef 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 . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubRelease : PushAttachment { /// [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 PushGitHubRepoRef 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 . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubActionsJob : PushAttachment { /// [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 PushGitHubRepoRef 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 . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubRepository : PushAttachment { /// [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 PushGitHubRepoRef 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). [Experimental(Diagnostics.Experimental)] public sealed class PushAttachmentGitHubFileDiffSide { /// Repository-relative path to the file. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Git ref (branch, tag, or commit SHA) the file is read at. [JsonPropertyName("ref")] public string Ref { get; set; } = string.Empty; /// Repository the file lives in. [JsonPropertyName("repo")] public PushGitHubRepoRef Repo { get => field ??= new(); set; } } /// Pointer to a single-file diff. At least one of `head` and `base` must be present. /// The github_file_diff variant of . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubFileDiff : PushAttachment { /// [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 PushAttachmentGitHubFileDiffSide? Base { get; set; } /// File location on the head side of the diff. Absent for deletions. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("head")] public PushAttachmentGitHubFileDiffSide? 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). [Experimental(Diagnostics.Experimental)] public sealed class PushAttachmentGitHubTreeComparisonSide { /// Repository the revision belongs to. [JsonPropertyName("repo")] public PushGitHubRepoRef Repo { get => field ??= new(); set; } /// Git revision (branch, tag, or commit SHA). [JsonPropertyName("revision")] public string Revision { get; set; } = string.Empty; } /// Pointer to a comparison between two git revisions. /// The github_tree_comparison variant of . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubTreeComparison : PushAttachment { /// [JsonIgnore] public override string Type => "github_tree_comparison"; /// Base side of the comparison. [JsonPropertyName("base")] public required PushAttachmentGitHubTreeComparisonSide Base { get; set; } /// Head side of the comparison. [JsonPropertyName("head")] public required PushAttachmentGitHubTreeComparisonSide 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 . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubUrl : PushAttachment { /// [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 . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubFile : PushAttachment { /// [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 PushGitHubRepoRef 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 . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentGitHubSnippet : PushAttachment { /// [JsonIgnore] public override string Type => "github_snippet"; /// Line range the snippet covers. [JsonPropertyName("lineRange")] public required PushAttachmentFileLineRange 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 PushGitHubRepoRef 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 . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentBlob : PushAttachment { /// [JsonIgnore] public override string Type => "blob"; /// Base64-encoded content. [Base64String] [JsonPropertyName("data")] public required string Data { get; set; } /// User-facing display name for the attachment. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("displayName")] public string? DisplayName { get; set; } /// MIME type of the inline data. [JsonPropertyName("mimeType")] public required string MimeType { get; set; } } /// Slim input shape for extension_context attachments; identity fields are runtime-derived. /// The extension_context variant of . [Experimental(Diagnostics.Experimental)] public partial class PushAttachmentExtensionContext : PushAttachment { /// [JsonIgnore] public override string Type => "extension_context"; /// Caller-supplied JSON payload (required, may be null but not undefined). [JsonPropertyName("payload")] public required 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; } } /// Parameters for session.extensions.sendAttachmentsToMessage. [Experimental(Diagnostics.Experimental)] internal sealed class SendAttachmentsToMessageParams { /// Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape. [JsonPropertyName("attachments")] public IList Attachments { get => field ??= []; set; } /// Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment. [JsonPropertyName("instanceId")] public string? InstanceId { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the external tool call result was handled successfully. [Experimental(Diagnostics.Experimental)] public sealed class HandlePendingToolCallResult { /// Whether the tool call result was handled successfully. [JsonPropertyName("success")] public bool Success { get; set; } } /// Pending external tool call request ID, with the tool result or an error describing why it failed. [Experimental(Diagnostics.Experimental)] internal sealed class HandlePendingToolCallRequest { /// Error message if the tool call failed. [JsonPropertyName("error")] public string? Error { get; set; } /// Request ID of the pending tool call. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Tool call result (string or expanded result object). [JsonPropertyName("result")] public JsonElement? Result { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation. [Experimental(Diagnostics.Experimental)] public sealed class ToolsInitializeAndValidateResult { } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionToolsInitializeAndValidateRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Lightweight metadata for a currently initialized session tool. [Experimental(Diagnostics.Experimental)] public sealed class CurrentToolMetadata { /// Whether the tool is loaded on demand via tool search. [JsonPropertyName("deferLoading")] public bool? DeferLoading { get; set; } /// Tool description. [JsonPropertyName("description")] public string Description { get; set; } = string.Empty; /// JSON Schema for tool input. [JsonPropertyName("input_schema")] public IDictionary? InputSchema { get; set; } /// MCP server name for MCP-backed tools. [JsonPropertyName("mcpServerName")] public string? McpServerName { get; set; } /// Raw MCP tool name for MCP-backed tools. [JsonPropertyName("mcpToolName")] public string? McpToolName { get; set; } /// Model-facing tool name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Optional MCP/config namespaced tool name. [JsonPropertyName("namespacedName")] public string? NamespacedName { get; set; } } /// Current lightweight tool metadata snapshot for the session. [Experimental(Diagnostics.Experimental)] public sealed class ToolsGetCurrentMetadataResult { /// Current tool metadata, or null when tools have not been initialized yet. [JsonPropertyName("tools")] public IList? Tools { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionToolsGetCurrentMetadataRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Empty result after applying subagent settings. [Experimental(Diagnostics.Experimental)] public sealed class ToolsUpdateSubagentSettingsResult { } /// Subagent model, reasoning effort, and context tier settings. [Experimental(Diagnostics.Experimental)] public sealed class SubagentSettingsEntry { /// Context tier override for matching subagents. [JsonPropertyName("contextTier")] public SubagentSettingsEntryContextTier? ContextTier { get; set; } /// Reasoning effort override for matching subagents. [JsonPropertyName("effortLevel")] public string? EffortLevel { get; set; } /// Model override for matching subagents. [JsonPropertyName("model")] public string? Model { get; set; } } /// Configured per-agent subagent overrides. public sealed class UpdateSubagentSettingsRequestSubagents { /// Per-agent settings keyed by subagent agent_type. [JsonPropertyName("agents")] public IDictionary? Agents { get; set; } /// Names of subagents the user has turned off; they cannot be dispatched. [JsonPropertyName("disabledSubagents")] public IList? DisabledSubagents { get; set; } /// Maximum number of subagents that can run concurrently; applies to usage-based billing users only. [JsonPropertyName("maxConcurrency")] public int? MaxConcurrency { get; set; } /// Maximum subagent nesting depth; applies to usage-based billing users only. [JsonPropertyName("maxDepth")] public int? MaxDepth { get; set; } } /// Subagent settings to apply to the current session. [Experimental(Diagnostics.Experimental)] internal sealed class UpdateSubagentSettingsRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Subagent settings to apply, or null to clear the live session override. [JsonPropertyName("subagents")] public UpdateSubagentSettingsRequestSubagents? Subagents { get; set; } } /// Optional unstructured input hint. [Experimental(Diagnostics.Experimental)] public sealed class SlashCommandInput { /// Optional completion hint for the input (e.g. 'directory' for filesystem path completion). [JsonPropertyName("completion")] public SlashCommandInputCompletion? Completion { get; set; } /// Hint to display when command input has not been provided. [JsonPropertyName("hint")] public string Hint { get; set; } = string.Empty; /// When true, clients should pass the full text after the command name as a single argument rather than splitting on whitespace. [JsonPropertyName("preserveMultilineInput")] public bool? PreserveMultilineInput { get; set; } /// When true, the command requires non-empty input; clients should render the input hint as required. [JsonPropertyName("required")] public bool? Required { get; set; } } /// Schema for the `SlashCommandInfo` type. [Experimental(Diagnostics.Experimental)] public sealed class SlashCommandInfo { /// Canonical aliases without leading slashes. [JsonPropertyName("aliases")] public IList? Aliases { get; set; } /// Whether the command may run while an agent turn is active. [JsonPropertyName("allowDuringAgentExecution")] public bool AllowDuringAgentExecution { get; set; } /// Human-readable command description. [JsonPropertyName("description")] public string Description { get; set; } = string.Empty; /// Whether the command is experimental. [JsonPropertyName("experimental")] public bool? Experimental { get; set; } /// Optional unstructured input hint. [JsonPropertyName("input")] public SlashCommandInput? Input { get; set; } /// Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command. [JsonPropertyName("kind")] public SlashCommandKind Kind { get; set; } /// Canonical command name without a leading slash. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Whether the command may be the target of `/every` / `/after` schedules. Resolution happens at every tick, so only set this when the command is safe to re-invoke and produces an agent prompt. [JsonPropertyName("schedulable")] public bool? Schedulable { get; set; } } /// Slash commands available in the session, after applying any include/exclude filters. [Experimental(Diagnostics.Experimental)] public sealed class CommandList { /// Commands available in this session. [JsonPropertyName("commands")] public IList Commands { get => field ??= []; set; } } /// Optional filters controlling which command sources to include in the listing. [Experimental(Diagnostics.Experimental)] public sealed class CommandsListRequest { /// Include runtime built-in commands. [JsonPropertyName("includeBuiltins")] public bool? IncludeBuiltins { get; set; } /// Include commands registered by protocol clients, including SDK clients and extensions. [JsonPropertyName("includeClientCommands")] public bool? IncludeClientCommands { get; set; } /// Include enabled user-invocable skills and commands. [JsonPropertyName("includeSkills")] public bool? IncludeSkills { get; set; } } /// Optional filters controlling which command sources to include in the listing. [Experimental(Diagnostics.Experimental)] internal sealed class CommandsListRequestWithSession { /// Include runtime built-in commands. [JsonPropertyName("includeBuiltins")] public bool? IncludeBuiltins { get; set; } /// Include commands registered by protocol clients, including SDK clients and extensions. [JsonPropertyName("includeClientCommands")] public bool? IncludeClientCommands { get; set; } /// Include enabled user-invocable skills and commands. [JsonPropertyName("includeSkills")] public bool? IncludeSkills { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection). /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(SlashCommandInvocationResultText), "text")] [JsonDerivedType(typeof(SlashCommandInvocationResultAgentPrompt), "agent-prompt")] [JsonDerivedType(typeof(SlashCommandInvocationResultCompleted), "completed")] [JsonDerivedType(typeof(SlashCommandInvocationResultSelectSubcommand), "select-subcommand")] public partial class SlashCommandInvocationResult { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Schema for the `SlashCommandTextResult` type. /// The text variant of . [Experimental(Diagnostics.Experimental)] public partial class SlashCommandInvocationResultText : SlashCommandInvocationResult { /// [JsonIgnore] public override string Kind => "text"; /// Whether text contains Markdown. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("markdown")] public bool? Markdown { get; set; } /// Whether ANSI sequences should be preserved. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("preserveAnsi")] public bool? PreserveAnsi { get; set; } /// True when the invocation mutated user runtime settings; consumers caching settings should refresh. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("runtimeSettingsChanged")] public bool? RuntimeSettingsChanged { get; set; } /// Text output for the client to render. [JsonPropertyName("text")] public required string Text { get; set; } } /// Schema for the `SlashCommandAgentPromptResult` type. /// The agent-prompt variant of . [Experimental(Diagnostics.Experimental)] public partial class SlashCommandInvocationResultAgentPrompt : SlashCommandInvocationResult { /// [JsonIgnore] public override string Kind => "agent-prompt"; /// Prompt text to display to the user. [JsonPropertyName("displayPrompt")] public required string DisplayPrompt { get; set; } /// Optional target session mode for the agent prompt. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("mode")] public SessionMode? Mode { get; set; } /// Prompt to submit to the agent. [JsonPropertyName("prompt")] public required string Prompt { get; set; } /// True when the invocation mutated user runtime settings; consumers caching settings should refresh. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("runtimeSettingsChanged")] public bool? RuntimeSettingsChanged { get; set; } } /// Schema for the `SlashCommandCompletedResult` type. /// The completed variant of . [Experimental(Diagnostics.Experimental)] public partial class SlashCommandInvocationResultCompleted : SlashCommandInvocationResult { /// [JsonIgnore] public override string Kind => "completed"; /// Optional user-facing message describing the completed command. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("message")] public string? Message { get; set; } /// True when the invocation mutated user runtime settings; consumers caching settings should refresh. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("runtimeSettingsChanged")] public bool? RuntimeSettingsChanged { get; set; } } /// Schema for the `SlashCommandSelectSubcommandOption` type. [Experimental(Diagnostics.Experimental)] public sealed class SlashCommandSelectSubcommandOption { /// Human-readable description of the subcommand. [JsonPropertyName("description")] public string Description { get; set; } = string.Empty; /// Optional group label for organizing options. [JsonPropertyName("group")] public string? Group { get; set; } /// Subcommand name to invoke. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; } /// Schema for the `SlashCommandSelectSubcommandResult` type. /// The select-subcommand variant of . [Experimental(Diagnostics.Experimental)] public partial class SlashCommandInvocationResultSelectSubcommand : SlashCommandInvocationResult { /// [JsonIgnore] public override string Kind => "select-subcommand"; /// Parent command name that requires subcommand selection. [JsonPropertyName("command")] public required string Command { get; set; } /// Available subcommand options for the client to present. [JsonPropertyName("options")] public required IList Options { get; set; } /// True when the invocation mutated user runtime settings; consumers caching settings should refresh. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("runtimeSettingsChanged")] public bool? RuntimeSettingsChanged { get; set; } /// Human-readable title for the selection UI. [JsonPropertyName("title")] public required string Title { get; set; } } /// Slash command name and optional raw input string to invoke. [Experimental(Diagnostics.Experimental)] internal sealed class CommandsInvokeRequest { /// Raw input after the command name. [JsonPropertyName("input")] public string? Input { get; set; } /// Command name. Leading slashes are stripped and the name is matched case-insensitively. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the pending client-handled command was completed successfully. [Experimental(Diagnostics.Experimental)] public sealed class CommandsHandlePendingCommandResult { /// Whether the command was handled successfully. [JsonPropertyName("success")] public bool Success { get; set; } } /// Pending command request ID and an optional error if the client handler failed. [Experimental(Diagnostics.Experimental)] internal sealed class CommandsHandlePendingCommandRequest { /// Error message if the command handler failed. [JsonPropertyName("error")] public string? Error { get; set; } /// Request ID from the command invocation event. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Error message produced while executing the command, if any. [Experimental(Diagnostics.Experimental)] public sealed class ExecuteCommandResult { /// Error message produced while executing the command, if any. Omitted when the handler succeeded. [JsonPropertyName("error")] public string? Error { get; set; } } /// Slash command name and argument string to execute synchronously. [Experimental(Diagnostics.Experimental)] internal sealed class ExecuteCommandParams { /// Argument string to pass to the command (empty string if none). [JsonPropertyName("args")] public string Args { get; set; } = string.Empty; /// Name of the slash command to invoke (without the leading '/'). [JsonPropertyName("commandName")] public string CommandName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the command was accepted into the local execution queue. [Experimental(Diagnostics.Experimental)] public sealed class EnqueueCommandResult { /// True when the command was accepted into the local execution queue. False when the call targets a session that does not support local command queueing (e.g. remote sessions). [JsonPropertyName("queued")] public bool Queued { get; set; } } /// Slash-prefixed command string to enqueue for FIFO processing. [Experimental(Diagnostics.Experimental)] internal sealed class EnqueueCommandParams { /// Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately. [JsonPropertyName("command")] public string Command { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the queued-command response was matched to a pending request. [Experimental(Diagnostics.Experimental)] public sealed class CommandsRespondToQueuedCommandResult { /// Whether a pending queued command with the given request ID was found and resolved. False when the request was already resolved, cancelled, or unknown. [JsonPropertyName("success")] public bool Success { get; set; } } /// Result of the queued command execution. /// Data type discriminated by handled. [Experimental(Diagnostics.Experimental)] public partial class QueuedCommandResult { /// The boolean discriminator. [JsonPropertyName("handled")] public bool Handled { get; set; } /// When true, the runtime will not process subsequent queued commands until a new request comes in. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("stopProcessingQueue")] public bool? StopProcessingQueue { get; set; } } /// Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands). [Experimental(Diagnostics.Experimental)] internal sealed class CommandsRespondToQueuedCommandRequest { /// Request ID from the `command.queued` event the host is responding to. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Result of the queued command execution. [JsonPropertyName("result")] public QueuedCommandResult Result { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Telemetry engagement ID for the session, when available. [Experimental(Diagnostics.Experimental)] public sealed class SessionTelemetryEngagement { /// Current telemetry engagement ID, when available. [JsonPropertyName("engagementId")] public string? EngagementId { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionTelemetryGetEngagementIdRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Feature override key/value pairs to attach to subsequent telemetry events from this session. [Experimental(Diagnostics.Experimental)] internal sealed class TelemetrySetFeatureOverridesRequest { /// Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides. [JsonPropertyName("features")] public IDictionary Features { get => field ??= new Dictionary(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Transient answer generated from current conversation context. [Experimental(Diagnostics.Experimental)] public sealed class UIEphemeralQueryResult { /// Full assistant response text. [JsonPropertyName("answer")] public string Answer { get; set; } = string.Empty; } /// Transient question to answer without adding it to conversation history. [Experimental(Diagnostics.Experimental)] internal sealed class UIEphemeralQueryRequest { /// In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Marked internal: excluded from the public SDK surface. Replaced by an explicit cancellation token + cancel RPC in the SDK migration. [JsonInclude] [JsonPropertyName("abortSignal")] internal JsonElement? AbortSignal { get; set; } /// In-process streaming callback `(text) => void` invoked with each token as the model emits it. Marked internal: excluded from the public SDK surface. In a process-separated SDK this is replaced by a streaming RPC that yields chunks and a final answer. [JsonInclude] [JsonPropertyName("onChunk")] internal JsonElement? OnChunk { get; set; } /// Question to answer from the current conversation context. [JsonPropertyName("question")] public string Question { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The elicitation response (accept with form values, decline, or cancel). [Experimental(Diagnostics.Experimental)] public sealed class UIElicitationResponse { /// The user's response: accept (submitted), decline (rejected), or cancel (dismissed). [JsonPropertyName("action")] public UIElicitationResponseAction Action { get; set; } /// The form values submitted by the user (present when action is 'accept'). [JsonPropertyName("content")] public IDictionary? Content { get; set; } } /// JSON Schema describing the form fields to present to the user. [Experimental(Diagnostics.Experimental)] public sealed class UIElicitationSchema { /// Form field definitions, keyed by field name. [JsonPropertyName("properties")] public IDictionary Properties { get => field ??= new Dictionary(); set; } /// List of required field names. [JsonPropertyName("required")] public IList? Required { get; set; } /// Schema type indicator (always 'object'). [JsonPropertyName("type")] public string Type { get; set; } = string.Empty; } /// Prompt message and JSON schema describing the form fields to elicit from the user. [Experimental(Diagnostics.Experimental)] internal sealed class UIElicitationRequest { /// Message describing what information is needed from the user. [JsonPropertyName("message")] public string Message { get; set; } = string.Empty; /// JSON Schema describing the form fields to present to the user. [JsonPropertyName("requestedSchema")] public UIElicitationSchema RequestedSchema { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the elicitation response was accepted; false if it was already resolved by another client. [Experimental(Diagnostics.Experimental)] public sealed class UIElicitationResult { /// Whether the response was accepted. False if the request was already resolved by another client. [JsonPropertyName("success")] public bool Success { get; set; } } /// Pending elicitation request ID and the user's response (accept/decline/cancel + form values). [Experimental(Diagnostics.Experimental)] internal sealed class UIHandlePendingElicitationRequest { /// The unique request ID from the elicitation.requested event. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// The elicitation response (accept with form values, decline, or cancel). [JsonPropertyName("result")] public UIElicitationResponse Result { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the pending UI request was resolved by this call. [Experimental(Diagnostics.Experimental)] public sealed class UIHandlePendingResult { /// True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending. [JsonPropertyName("success")] public bool Success { get; set; } } /// Schema for the `UIUserInputResponse` type. [Experimental(Diagnostics.Experimental)] public sealed class UIUserInputResponse { /// The user's answer text. [JsonPropertyName("answer")] public string Answer { get; set; } = string.Empty; /// True if the user typed a freeform response, false if they selected a presented choice. Used by telemetry to differentiate between free text input and choice selection. [JsonPropertyName("wasFreeform")] public bool WasFreeform { get; set; } } /// Request ID of a pending `user_input.requested` event and the user's response. [Experimental(Diagnostics.Experimental)] internal sealed class UIHandlePendingUserInputRequest { /// The unique request ID from the user_input.requested event. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Schema for the `UIUserInputResponse` type. [JsonPropertyName("response")] public UIUserInputResponse Response { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result. [Experimental(Diagnostics.Experimental)] public sealed class UIHandlePendingSamplingResponse { } /// Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject). [Experimental(Diagnostics.Experimental)] internal sealed class UIHandlePendingSamplingRequest { /// The unique request ID from the sampling.requested event. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result. [JsonPropertyName("response")] public UIHandlePendingSamplingResponse? Response { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Request ID of a pending `auto_mode_switch.requested` event and the user's response. [Experimental(Diagnostics.Experimental)] internal sealed class UIHandlePendingAutoModeSwitchRequest { /// The unique request ID from the auto_mode_switch.requested event. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline). [JsonPropertyName("response")] public UIAutoModeSwitchResponse Response { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The user's selected action for an exhausted session limit. [Experimental(Diagnostics.Experimental)] public sealed class UISessionLimitsExhaustedResponse { /// Action selected by the user. [JsonPropertyName("action")] public UISessionLimitsExhaustedResponseAction Action { get; set; } /// AI Credits to add to the current max when action is 'add'. [JsonPropertyName("additionalAiCredits")] public double? AdditionalAiCredits { get; set; } /// New absolute max AI Credits when action is 'set'. [JsonPropertyName("maxAiCredits")] public double? MaxAiCredits { get; set; } } /// Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action. [Experimental(Diagnostics.Experimental)] internal sealed class UIHandlePendingSessionLimitsExhaustedRequest { /// The unique request ID from the session_limits_exhausted.requested event. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// The selected session-limit action. [JsonPropertyName("response")] public UISessionLimitsExhaustedResponse Response { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `UIExitPlanModeResponse` type. [Experimental(Diagnostics.Experimental)] public sealed class UIExitPlanModeResponse { /// Whether the plan was approved. [JsonPropertyName("approved")] public bool Approved { get; set; } /// Whether subsequent edits should be auto-approved without confirmation. [JsonPropertyName("autoApproveEdits")] public bool? AutoApproveEdits { get; set; } /// Feedback from the user when they declined the plan or requested changes. [JsonPropertyName("feedback")] public string? Feedback { get; set; } /// The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'. [JsonPropertyName("selectedAction")] public UIExitPlanModeAction? SelectedAction { get; set; } } /// Request ID of a pending `exit_plan_mode.requested` event and the user's response. [Experimental(Diagnostics.Experimental)] internal sealed class UIHandlePendingExitPlanModeRequest { /// The unique request ID from the exit_plan_mode.requested event. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Schema for the `UIExitPlanModeResponse` type. [JsonPropertyName("response")] public UIExitPlanModeResponse Response { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId). [Experimental(Diagnostics.Experimental)] public sealed class UIRegisterDirectAutoModeSwitchHandlerResult { /// Opaque handle representing the registration. Pass this same handle to `unregisterDirectAutoModeSwitchHandler` when the in-process handler is no longer active. Multiple registrations are reference-counted; the server bridge will only dispatch auto-mode-switch requests when no handles are active. [JsonPropertyName("handle")] public string Handle { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionUiRegisterDirectAutoModeSwitchHandlerRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the handle was active and the registration count was decremented. [Experimental(Diagnostics.Experimental)] public sealed class UIUnregisterDirectAutoModeSwitchHandlerResult { /// True if the handle was active and decremented the counter; false if the handle was unknown. [JsonPropertyName("unregistered")] public bool Unregistered { get; set; } } /// Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release. [Experimental(Diagnostics.Experimental)] internal sealed class UIUnregisterDirectAutoModeSwitchHandlerRequest { /// Handle previously returned by `registerDirectAutoModeSwitchHandler`. [JsonPropertyName("handle")] public string Handle { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsConfigureResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRuleSource` type. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsConfigureAdditionalContentExclusionPolicyRuleSource { /// Gets or sets the name value. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Gets or sets the type value. [JsonPropertyName("type")] public string Type { get; set; } = string.Empty; } /// Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRule` type. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsConfigureAdditionalContentExclusionPolicyRule { /// Gets or sets the ifAnyMatch value. [JsonPropertyName("ifAnyMatch")] public IList? IfAnyMatch { get; set; } /// Gets or sets the ifNoneMatch value. [JsonPropertyName("ifNoneMatch")] public IList? IfNoneMatch { get; set; } /// Gets or sets the paths value. [JsonPropertyName("paths")] public IList Paths { get => field ??= []; set; } /// Schema for the `PermissionsConfigureAdditionalContentExclusionPolicyRuleSource` type. [JsonPropertyName("source")] public PermissionsConfigureAdditionalContentExclusionPolicyRuleSource Source { get => field ??= new(); set; } } /// Schema for the `PermissionsConfigureAdditionalContentExclusionPolicy` type. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsConfigureAdditionalContentExclusionPolicy { /// Gets or sets the last_updated_at value. [JsonPropertyName("last_updated_at")] public JsonElement LastUpdatedAt { get; set; } /// Gets or sets the rules value. [JsonPropertyName("rules")] public IList Rules { get => field ??= []; set; } /// Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration. [JsonPropertyName("scope")] public PermissionsConfigureAdditionalContentExclusionPolicyScope Scope { get; set; } } /// If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged. [Experimental(Diagnostics.Experimental)] public sealed class PermissionPathsConfig { /// Additional directories to allow tool access to (in addition to the session's working directory). When `unrestricted` is true, these are still pre-populated on the UnrestrictedPathManager so they remain visible via getDirectories() (e.g. for @-mention completion). [JsonPropertyName("additionalDirectories")] public IList? AdditionalDirectories { get; set; } /// Whether to include the system temp directory in the allowed list (defaults to true). Ignored when `unrestricted` is true. [JsonPropertyName("includeTempDirectory")] public bool? IncludeTempDirectory { get; set; } /// If true, the runtime allows access to all paths without prompting. Equivalent to constructing an UnrestrictedPathManager. [JsonPropertyName("unrestricted")] public bool? Unrestricted { get; set; } /// Workspace root path (special-cased to be allowed even before the directory exists). Ignored when `unrestricted` is true. [JsonPropertyName("workspacePath")] public string? WorkspacePath { get; set; } } /// If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged. [Experimental(Diagnostics.Experimental)] public sealed class PermissionRulesSet { /// Rules that auto-approve matching requests. [JsonPropertyName("approved")] public IList Approved { get => field ??= []; set; } /// Rules that auto-deny matching requests. [JsonPropertyName("denied")] public IList Denied { get => field ??= []; set; } } /// If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged. [Experimental(Diagnostics.Experimental)] public sealed class PermissionUrlsConfig { /// Initial list of allowed URL/domain patterns. Patterns may include path components. Ignored when `unrestricted` is true. [JsonPropertyName("initialAllowed")] public IList? InitialAllowed { get; set; } /// If true, the runtime allows access to all URLs without prompting. Initial allow-list is ignored when this is true. [JsonPropertyName("unrestricted")] public bool? Unrestricted { get; set; } } /// Patch of permission policy fields to apply (omit a field to leave it unchanged). [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsConfigureParams { /// If specified, replaces the host-supplied GitHub Content Exclusion policies on the session (combined with natively-discovered policies when evaluating tool/file access). Omit to leave the current policies unchanged. [JsonPropertyName("additionalContentExclusionPolicies")] public IList? AdditionalContentExclusionPolicies { get; set; } /// If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged. [JsonPropertyName("approveAllReadPermissionRequests")] public bool? ApproveAllReadPermissionRequests { get; set; } /// If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged. [JsonPropertyName("approveAllToolPermissionRequests")] public bool? ApproveAllToolPermissionRequests { get; set; } /// If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged. [JsonPropertyName("paths")] public PermissionPathsConfig? Paths { get; set; } /// If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged. [JsonPropertyName("rules")] public PermissionRulesSet? Rules { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged. [JsonPropertyName("urls")] public PermissionUrlsConfig? Urls { get; set; } } /// Indicates whether the permission decision was applied; false when the request was already resolved. [Experimental(Diagnostics.Experimental)] public sealed class PermissionRequestResult { /// Whether the permission request was handled successfully. [JsonPropertyName("success")] public bool Success { get; set; } } /// The client's response to the pending permission prompt. /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(PermissionDecisionApproveOnce), "approve-once")] [JsonDerivedType(typeof(PermissionDecisionApproveForSession), "approve-for-session")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocation), "approve-for-location")] [JsonDerivedType(typeof(PermissionDecisionApprovePermanently), "approve-permanently")] [JsonDerivedType(typeof(PermissionDecisionReject), "reject")] [JsonDerivedType(typeof(PermissionDecisionUserNotAvailable), "user-not-available")] [JsonDerivedType(typeof(PermissionDecisionApproved), "approved")] [JsonDerivedType(typeof(PermissionDecisionApprovedForSession), "approved-for-session")] [JsonDerivedType(typeof(PermissionDecisionApprovedForLocation), "approved-for-location")] [JsonDerivedType(typeof(PermissionDecisionCancelled), "cancelled")] [JsonDerivedType(typeof(PermissionDecisionDeniedByRules), "denied-by-rules")] [JsonDerivedType(typeof(PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser), "denied-no-approval-rule-and-could-not-request-from-user")] [JsonDerivedType(typeof(PermissionDecisionDeniedInteractivelyByUser), "denied-interactively-by-user")] [JsonDerivedType(typeof(PermissionDecisionDeniedByContentExclusionPolicy), "denied-by-content-exclusion-policy")] [JsonDerivedType(typeof(PermissionDecisionDeniedByPermissionRequestHook), "denied-by-permission-request-hook")] public partial class PermissionDecision { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Schema for the `PermissionDecisionApproveOnce` type. /// The approve-once variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveOnce : PermissionDecision { /// [JsonIgnore] public override string Kind => "approve-once"; } /// Session-scoped approval to remember (tool prompts only; omitted for path/url prompts). /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCommands), "commands")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalRead), "read")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalWrite), "write")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMcp), "mcp")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMcpSampling), "mcp-sampling")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalMemory), "memory")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionManagement), "extension-management")] [JsonDerivedType(typeof(PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionDecisionApproveForSessionApproval { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Schema for the `PermissionDecisionApproveForSessionApprovalCommands` type. /// The commands variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalCommands : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "commands"; /// Command identifiers covered by this approval. [JsonPropertyName("commandIdentifiers")] public required IList CommandIdentifiers { get; set; } } /// Schema for the `PermissionDecisionApproveForSessionApprovalRead` type. /// The read variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalRead : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "read"; } /// Schema for the `PermissionDecisionApproveForSessionApprovalWrite` type. /// The write variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalWrite : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "write"; } /// Schema for the `PermissionDecisionApproveForSessionApprovalMcp` type. /// The mcp variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalMcp : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "mcp"; /// MCP server name. [JsonPropertyName("serverName")] public required string ServerName { get; set; } /// MCP tool name, or null to cover every tool on the server. [JsonPropertyName("toolName")] public string? ToolName { get; set; } } /// Schema for the `PermissionDecisionApproveForSessionApprovalMcpSampling` type. /// The mcp-sampling variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalMcpSampling : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "mcp-sampling"; /// MCP server name. [JsonPropertyName("serverName")] public required string ServerName { get; set; } } /// Schema for the `PermissionDecisionApproveForSessionApprovalMemory` type. /// The memory variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalMemory : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "memory"; } /// Schema for the `PermissionDecisionApproveForSessionApprovalCustomTool` type. /// The custom-tool variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalCustomTool : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "custom-tool"; /// Custom tool name. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Schema for the `PermissionDecisionApproveForSessionApprovalExtensionManagement` type. /// The extension-management variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalExtensionManagement : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "extension-management"; /// Optional operation identifier; when omitted, the approval covers all extension management operations. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("operation")] public string? Operation { get; set; } } /// Schema for the `PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess` type. /// The extension-permission-access variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess : PermissionDecisionApproveForSessionApproval { /// [JsonIgnore] public override string Kind => "extension-permission-access"; /// Extension name. [JsonPropertyName("extensionName")] public required string ExtensionName { get; set; } } /// Schema for the `PermissionDecisionApproveForSession` type. /// The approve-for-session variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForSession : PermissionDecision { /// [JsonIgnore] public override string Kind => "approve-for-session"; /// Session-scoped approval to remember (tool prompts only; omitted for path/url prompts). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("approval")] public PermissionDecisionApproveForSessionApproval? Approval { get; set; } /// URL domain to approve for the rest of the session (URL prompts only). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("domain")] public string? Domain { get; set; } } /// Approval to persist for this location. /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCommands), "commands")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalRead), "read")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalWrite), "write")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMcp), "mcp")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMcpSampling), "mcp-sampling")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalMemory), "memory")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionManagement), "extension-management")] [JsonDerivedType(typeof(PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionDecisionApproveForLocationApproval { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Schema for the `PermissionDecisionApproveForLocationApprovalCommands` type. /// The commands variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalCommands : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "commands"; /// Command identifiers covered by this approval. [JsonPropertyName("commandIdentifiers")] public required IList CommandIdentifiers { get; set; } } /// Schema for the `PermissionDecisionApproveForLocationApprovalRead` type. /// The read variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalRead : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "read"; } /// Schema for the `PermissionDecisionApproveForLocationApprovalWrite` type. /// The write variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalWrite : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "write"; } /// Schema for the `PermissionDecisionApproveForLocationApprovalMcp` type. /// The mcp variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalMcp : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "mcp"; /// MCP server name. [JsonPropertyName("serverName")] public required string ServerName { get; set; } /// MCP tool name, or null to cover every tool on the server. [JsonPropertyName("toolName")] public string? ToolName { get; set; } } /// Schema for the `PermissionDecisionApproveForLocationApprovalMcpSampling` type. /// The mcp-sampling variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalMcpSampling : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "mcp-sampling"; /// MCP server name. [JsonPropertyName("serverName")] public required string ServerName { get; set; } } /// Schema for the `PermissionDecisionApproveForLocationApprovalMemory` type. /// The memory variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalMemory : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "memory"; } /// Schema for the `PermissionDecisionApproveForLocationApprovalCustomTool` type. /// The custom-tool variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalCustomTool : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "custom-tool"; /// Custom tool name. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Schema for the `PermissionDecisionApproveForLocationApprovalExtensionManagement` type. /// The extension-management variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalExtensionManagement : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "extension-management"; /// Optional operation identifier; when omitted, the approval covers all extension management operations. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("operation")] public string? Operation { get; set; } } /// Schema for the `PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess` type. /// The extension-permission-access variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess : PermissionDecisionApproveForLocationApproval { /// [JsonIgnore] public override string Kind => "extension-permission-access"; /// Extension name. [JsonPropertyName("extensionName")] public required string ExtensionName { get; set; } } /// Schema for the `PermissionDecisionApproveForLocation` type. /// The approve-for-location variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproveForLocation : PermissionDecision { /// [JsonIgnore] public override string Kind => "approve-for-location"; /// Approval to persist for this location. [JsonPropertyName("approval")] public required PermissionDecisionApproveForLocationApproval Approval { get; set; } /// Location key (git root or cwd) to persist the approval to. [JsonPropertyName("locationKey")] public required string LocationKey { get; set; } } /// Schema for the `PermissionDecisionApprovePermanently` type. /// The approve-permanently variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApprovePermanently : PermissionDecision { /// [JsonIgnore] public override string Kind => "approve-permanently"; /// URL domain to approve permanently. [JsonPropertyName("domain")] public required string Domain { get; set; } } /// Schema for the `PermissionDecisionReject` type. /// The reject variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionReject : PermissionDecision { /// [JsonIgnore] public override string Kind => "reject"; /// Optional feedback explaining the rejection. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("feedback")] public string? Feedback { get; set; } } /// Schema for the `PermissionDecisionUserNotAvailable` type. /// The user-not-available variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionUserNotAvailable : PermissionDecision { /// [JsonIgnore] public override string Kind => "user-not-available"; } /// Schema for the `PermissionDecisionApproved` type. /// The approved variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApproved : PermissionDecision { /// [JsonIgnore] public override string Kind => "approved"; } /// Schema for the `PermissionDecisionApprovedForSession` type. /// The approved-for-session variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApprovedForSession : PermissionDecision { /// [JsonIgnore] public override string Kind => "approved-for-session"; /// The approval to add as a session-scoped rule. [JsonPropertyName("approval")] public required UserToolSessionApproval Approval { get; set; } } /// Schema for the `PermissionDecisionApprovedForLocation` type. /// The approved-for-location variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionApprovedForLocation : PermissionDecision { /// [JsonIgnore] public override string Kind => "approved-for-location"; /// The approval to persist for this location. [JsonPropertyName("approval")] public required UserToolSessionApproval Approval { get; set; } /// The location key (git root or cwd) to persist the approval to. [JsonPropertyName("locationKey")] public required string LocationKey { get; set; } } /// Schema for the `PermissionDecisionCancelled` type. /// The cancelled variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionCancelled : PermissionDecision { /// [JsonIgnore] public override string Kind => "cancelled"; /// Optional explanation of why the request was cancelled. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("reason")] public string? Reason { get; set; } } /// Schema for the `PermissionDecisionDeniedByRules` type. /// The denied-by-rules variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionDeniedByRules : PermissionDecision { /// [JsonIgnore] public override string Kind => "denied-by-rules"; /// Rules that denied the request. [JsonPropertyName("rules")] public required IList Rules { get; set; } } /// Schema for the `PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type. /// The denied-no-approval-rule-and-could-not-request-from-user variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser : PermissionDecision { /// [JsonIgnore] public override string Kind => "denied-no-approval-rule-and-could-not-request-from-user"; } /// Schema for the `PermissionDecisionDeniedInteractivelyByUser` type. /// The denied-interactively-by-user variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionDeniedInteractivelyByUser : PermissionDecision { /// [JsonIgnore] public override string Kind => "denied-interactively-by-user"; /// Optional feedback from the user explaining the denial. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("feedback")] public string? Feedback { get; set; } /// Whether to force-reject the current agent turn. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("forceReject")] public bool? ForceReject { get; set; } } /// Schema for the `PermissionDecisionDeniedByContentExclusionPolicy` type. /// The denied-by-content-exclusion-policy variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionDeniedByContentExclusionPolicy : PermissionDecision { /// [JsonIgnore] public override string Kind => "denied-by-content-exclusion-policy"; /// Human-readable explanation of why the path was excluded. [JsonPropertyName("message")] public required string Message { get; set; } /// File path that triggered the exclusion. [JsonPropertyName("path")] public required string Path { get; set; } } /// Schema for the `PermissionDecisionDeniedByPermissionRequestHook` type. /// The denied-by-permission-request-hook variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionDecisionDeniedByPermissionRequestHook : PermissionDecision { /// [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; } } /// Pending permission request ID and the decision to apply (approve/reject and scope). [Experimental(Diagnostics.Experimental)] internal sealed class PermissionDecisionRequest { /// Request ID of the pending permission request. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// The client's response to the pending permission prompt. [JsonPropertyName("result")] public PermissionDecision Result { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `PendingPermissionRequest` type. [Experimental(Diagnostics.Experimental)] public sealed class PendingPermissionRequest { /// The user-facing permission prompt details (commands, write, read, mcp, url, memory, custom-tool, path, hook). [JsonPropertyName("request")] public PermissionPromptRequest Request { get; set; } = null!; /// Unique identifier for the pending permission request. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; } /// List of pending permission requests reconstructed from event history. [Experimental(Diagnostics.Experimental)] public sealed class PendingPermissionRequestList { /// Pending permission prompts reconstructed from the session's event history. Equivalent to the set of `permission.requested` events that have not yet been followed by a matching `permission.completed` event. Used by clients (e.g. the CLI) to hydrate UI for prompts that were emitted before the client attached to the session. [JsonPropertyName("items")] public IList Items { get => field ??= []; set; } } /// No parameters; returns currently-pending permission requests for the session. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsPendingRequestsRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsSetApproveAllResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Allow-all toggle for tool permission requests, with an optional telemetry source. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsSetApproveAllRequest { /// Whether to auto-approve all tool permission requests. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. [JsonPropertyName("source")] public PermissionsSetApproveAllSource? Source { get; set; } } /// Indicates whether the operation succeeded and reports the post-mutation state. [Experimental(Diagnostics.Experimental)] public sealed class AllowAllPermissionSetResult { /// Authoritative allow-all state after the mutation. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Whether to enable full allow-all permissions for the session. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsSetAllowAllRequest { /// Whether to enable full allow-all permissions. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. [JsonPropertyName("source")] public PermissionsSetAllowAllSource? Source { get; set; } } /// Current full allow-all permission state. [Experimental(Diagnostics.Experimental)] public sealed class AllowAllPermissionState { /// Whether full allow-all permissions are currently active. [JsonPropertyName("enabled")] public bool Enabled { get; set; } } /// No parameters. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsGetAllowAllRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsModifyRulesResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Scope and add/remove instructions for modifying session- or location-scoped permission rules. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsModifyRulesParams { /// Rules to add to the scope. Applied before `remove`/`removeAll`. [JsonPropertyName("add")] public IList? Add { get; set; } /// Specific rules to remove from the scope. Ignored when `removeAll` is true. [JsonPropertyName("remove")] public IList? Remove { get; set; } /// When true, removes every rule currently in the scope (after any `add` is applied). Useful for clearing the location scope wholesale. [JsonPropertyName("removeAll")] public bool? RemoveAll { get; set; } /// Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file. [JsonPropertyName("scope")] public PermissionsModifyRulesScope Scope { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsSetRequiredResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Toggles whether permission prompts should be bridged into session events for this client. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsSetRequiredRequest { /// Whether the client wants `permission.requested` events bridged from the session-owned permission service. CLI clients that render prompt UI set this to `true` for as long as their listener is mounted; headless callers leave it unset (the default is `false`). [JsonPropertyName("required")] public bool Required { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsResetSessionApprovalsResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// No parameters; clears all session-scoped tool permission approvals. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsResetSessionApprovalsRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsNotifyPromptShownResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Notification payload describing the permission prompt that the client just rendered. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionPromptShownNotification { /// Human-readable description of the prompt the user is being asked to approve. Used by the runtime to fire the registered `permission_prompt` notification hook (e.g. terminal bell, desktop notification). [JsonPropertyName("message")] public string Message { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Snapshot of the session's allow-listed directories and primary working directory. [Experimental(Diagnostics.Experimental)] public sealed class PermissionPathsList { /// All directories currently allowed for tool access on this session. [JsonPropertyName("directories")] public IList Directories { get => field ??= []; set; } /// The primary working directory for this session. [JsonPropertyName("primary")] public string Primary { get; set; } = string.Empty; } /// No parameters; returns the session's allow-listed directories. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionsPathsListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsPathsAddResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Directory path to add to the session's allowed directories. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionPathsAddParams { /// Directory to add to the allow-list. The runtime resolves and validates the path before adding. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsPathsUpdatePrimaryResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Directory path to set as the session's new primary working directory. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionPathsUpdatePrimaryParams { /// Directory to set as the new primary working directory for the session's permission policy. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the supplied path is within the session's allowed directories. [Experimental(Diagnostics.Experimental)] public sealed class PermissionPathsAllowedCheckResult { /// Whether the path is within the session's allowed directories. [JsonPropertyName("allowed")] public bool Allowed { get; set; } } /// Path to evaluate against the session's allowed directories. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionPathsAllowedCheckParams { /// Path to check against the session's allowed directories. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the supplied path is within the session's workspace directory. [Experimental(Diagnostics.Experimental)] public sealed class PermissionPathsWorkspaceCheckResult { /// Whether the path is within the session workspace directory. [JsonPropertyName("allowed")] public bool Allowed { get; set; } } /// Path to evaluate against the session's workspace (primary) directory. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionPathsWorkspaceCheckParams { /// Path to check against the session workspace directory. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Resolved location-permissions key and type. [Experimental(Diagnostics.Experimental)] public sealed class PermissionLocationResolveResult { /// Location key used in the location-permissions store. [JsonPropertyName("locationKey")] public string LocationKey { get; set; } = string.Empty; /// Whether the location is a git repo or directory. [JsonPropertyName("locationType")] public PermissionLocationType LocationType { get; set; } } /// Working directory to resolve into a location-permissions key. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionLocationResolveParams { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Working directory whose permission location should be resolved. [JsonPropertyName("workingDirectory")] public string WorkingDirectory { get; set; } = string.Empty; } /// Summary of persisted location permissions applied to the session. [Experimental(Diagnostics.Experimental)] public sealed class PermissionLocationApplyResult { /// Number of persisted allowed directories added to the live path manager. [JsonPropertyName("appliedDirectoryCount")] public long AppliedDirectoryCount { get; set; } /// Number of location-scoped rules added to the live permission service. [JsonPropertyName("appliedRuleCount")] public long AppliedRuleCount { get; set; } /// Location-scoped rules applied to the live permission service. [JsonPropertyName("appliedRules")] public IList AppliedRules { get => field ??= []; set; } /// Whether a different location was applied since the previous apply call. [JsonPropertyName("changed")] public bool Changed { get; set; } /// Location key used in the location-permissions store. [JsonPropertyName("locationKey")] public string LocationKey { get; set; } = string.Empty; /// Whether the location is a git repo or directory. [JsonPropertyName("locationType")] public PermissionLocationType LocationType { get; set; } } /// Working directory to load persisted location permissions for. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionLocationApplyParams { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Working directory whose persisted location permissions should be applied. [JsonPropertyName("workingDirectory")] public string WorkingDirectory { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsLocationsAddToolApprovalResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Tool approval to persist and apply. /// Polymorphic base type discriminated by kind. [Experimental(Diagnostics.Experimental)] [JsonPolymorphic( TypeDiscriminatorPropertyName = "kind", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FallBackToBaseType)] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsCommands), "commands")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsRead), "read")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsWrite), "write")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsMcp), "mcp")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsMcpSampling), "mcp-sampling")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsMemory), "memory")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsCustomTool), "custom-tool")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsExtensionManagement), "extension-management")] [JsonDerivedType(typeof(PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess), "extension-permission-access")] public partial class PermissionsLocationsAddToolApprovalDetails { /// The type discriminator. [JsonPropertyName("kind")] public virtual string Kind { get; set; } = string.Empty; } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsCommands` type. /// The commands variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsCommands : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "commands"; /// Command identifiers covered by this approval. [JsonPropertyName("commandIdentifiers")] public required IList CommandIdentifiers { get; set; } } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsRead` type. /// The read variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsRead : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "read"; } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsWrite` type. /// The write variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsWrite : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "write"; } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsMcp` type. /// The mcp variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsMcp : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "mcp"; /// MCP server name. [JsonPropertyName("serverName")] public required string ServerName { get; set; } /// MCP tool name, or null to cover every tool on the server. [JsonPropertyName("toolName")] public string? ToolName { get; set; } } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsMcpSampling` type. /// The mcp-sampling variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsMcpSampling : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "mcp-sampling"; /// MCP server name. [JsonPropertyName("serverName")] public required string ServerName { get; set; } } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsMemory` type. /// The memory variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsMemory : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "memory"; } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsCustomTool` type. /// The custom-tool variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsCustomTool : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "custom-tool"; /// Custom tool name. [JsonPropertyName("toolName")] public required string ToolName { get; set; } } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsExtensionManagement` type. /// The extension-management variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsExtensionManagement : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "extension-management"; /// Optional operation identifier; when omitted, the approval covers all extension management operations. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("operation")] public string? Operation { get; set; } } /// Schema for the `PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess` type. /// The extension-permission-access variant of . [Experimental(Diagnostics.Experimental)] public partial class PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess : PermissionsLocationsAddToolApprovalDetails { /// [JsonIgnore] public override string Kind => "extension-permission-access"; /// Extension name. [JsonPropertyName("extensionName")] public required string ExtensionName { get; set; } } /// Location-scoped tool approval to persist. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionLocationAddToolApprovalParams { /// Tool approval to persist and apply. [JsonPropertyName("approval")] public PermissionsLocationsAddToolApprovalDetails Approval { get => field ??= new(); set; } /// Location key (git root or cwd) to persist the approval to. [JsonPropertyName("locationKey")] public string LocationKey { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Folder trust check result. [Experimental(Diagnostics.Experimental)] public sealed class FolderTrustCheckResult { /// Whether the folder is trusted. [JsonPropertyName("trusted")] public bool Trusted { get; set; } } /// Folder path to check for trust. [Experimental(Diagnostics.Experimental)] internal sealed class FolderTrustCheckParams { /// Folder path to check. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsFolderTrustAddTrustedResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Folder path to add to trusted folders. [Experimental(Diagnostics.Experimental)] internal sealed class FolderTrustAddParams { /// Folder path to mark as trusted. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsUrlsSetUnrestrictedModeResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Whether the URL-permission policy should run in unrestricted mode. [Experimental(Diagnostics.Experimental)] internal sealed class PermissionUrlsSetUnrestrictedModeParams { /// Whether to allow access to all URLs without prompting. Toggles the runtime's URL-permission policy in place. [JsonPropertyName("enabled")] public bool Enabled { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// The repository the remote session targets. [Experimental(Diagnostics.Experimental)] public sealed class MetadataSnapshotRemoteMetadataRepository { /// The branch the remote session is operating on. [JsonPropertyName("branch")] public string Branch { get; set; } = string.Empty; /// The GitHub repository name (without owner). [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// The GitHub owner (user or organization) of the target repository. [JsonPropertyName("owner")] public string Owner { get; set; } = string.Empty; } /// Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. [Experimental(Diagnostics.Experimental)] public sealed class MetadataSnapshotRemoteMetadata { /// The pull request number the remote session is associated with, if any. [JsonPropertyName("pullRequestNumber")] public long? PullRequestNumber { get; set; } /// The repository the remote session targets. [JsonPropertyName("repository")] public MetadataSnapshotRemoteMetadataRepository Repository { get => field ??= new(); set; } /// The original resource identifier (task ID or PR node ID), preserved across event-replay reconstructions. Falls back to `sessionId` when absent. [JsonPropertyName("resourceId")] public string? ResourceId { get; set; } /// Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation. [JsonPropertyName("taskType")] public MetadataSnapshotRemoteMetadataTaskType? TaskType { get; set; } } /// Public-facing projection of workspace metadata for SDK / TUI consumers. public sealed class SessionMetadataSnapshotWorkspace { /// Branch checked out at session start, if any. [JsonPropertyName("branch")] public string? Branch { get; set; } /// ISO 8601 timestamp when the workspace was created. [JsonPropertyName("created_at")] public DateTimeOffset? CreatedAt { get; set; } /// Current working directory at session start. [JsonPropertyName("cwd")] public string? Cwd { get; set; } /// Resolved git root for cwd, if any. [JsonPropertyName("git_root")] public string? GitRoot { get; set; } /// Repository host type, if known. [JsonPropertyName("host_type")] public WorkspaceSummaryHostType? HostType { get; set; } /// Workspace identifier (1:1 with sessionId). [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("id")] public string Id { get; set; } = string.Empty; /// Display name for the session, if set. [JsonPropertyName("name")] public string? Name { get; set; } /// Repository identifier in 'owner/repo' or 'org/project/repo' format, if any. [JsonPropertyName("repository")] public string? Repository { get; set; } /// ISO 8601 timestamp when the workspace was last updated. [JsonPropertyName("updated_at")] public DateTimeOffset? UpdatedAt { get; set; } /// Whether the display name was explicitly set by the user. [JsonPropertyName("user_named")] public bool? UserNamed { get; set; } } /// Point-in-time snapshot of slow-changing session identifier and state fields. [Experimental(Diagnostics.Experimental)] public sealed class SessionMetadataSnapshot { /// True when the session was detected to be in use by another process at construction time. Local consumers may surface a confirmation prompt before fully attaching. Always false for new sessions. [JsonPropertyName("alreadyInUse")] public bool AlreadyInUse { get; set; } /// Runtime client name associated with the session (telemetry identifier). [JsonPropertyName("clientName")] public string? ClientName { get; set; } /// The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot'). [JsonPropertyName("currentMode")] public MetadataSnapshotCurrentMode CurrentMode { get; set; } /// User-provided name supplied at session construction (via `--name`), if any. Immutable after construction. [JsonPropertyName("initialName")] public string? InitialName { get; set; } /// Whether this is a remote session (i.e., one whose runtime executes elsewhere and is steered through this process). [JsonPropertyName("isRemote")] public bool IsRemote { get; set; } /// ISO 8601 timestamp of when the session's persisted state was last modified on disk. For new sessions, equals startTime. For resumed sessions, reflects the previous modification time at construction. [JsonPropertyName("modifiedTime")] public DateTimeOffset ModifiedTime { get; set; } /// Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session. [JsonPropertyName("remoteMetadata")] public MetadataSnapshotRemoteMetadata? RemoteMetadata { get; set; } /// Currently selected model identifier, if any. [JsonPropertyName("selectedModel")] public string? SelectedModel { get; set; } /// The unique identifier of the session. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Current session limits, or null when no limits are active. [JsonPropertyName("sessionLimits")] public SessionLimitsConfig? SessionLimits { get; set; } /// ISO 8601 timestamp of when the session started. [JsonPropertyName("startTime")] public DateTimeOffset StartTime { get; set; } /// Short human-readable summary of the session, if known. Omitted when no summary has been generated. [JsonPropertyName("summary")] public string? Summary { get; set; } /// Absolute path to the session's current working directory. [JsonPropertyName("workingDirectory")] public string WorkingDirectory { get; set; } = string.Empty; /// Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags). [JsonPropertyName("workspace")] public SessionMetadataSnapshotWorkspace? Workspace { get; set; } /// Absolute path to the session's workspace directory on disk, or null if the session has no associated workspace. [JsonPropertyName("workspacePath")] public string? WorkspacePath { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionMetadataSnapshotRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the local session is currently processing a turn or background continuation. [Experimental(Diagnostics.Experimental)] public sealed class MetadataIsProcessingResult { /// Whether the session is currently processing user/agent messages. False for non-local sessions (which don't run a local agentic loop). Reflects an in-flight turn or background continuation. [JsonPropertyName("processing")] public bool Processing { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionMetadataIsProcessingRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Current activity flags for the session. [Experimental(Diagnostics.Experimental)] public sealed class SessionActivity { /// Whether an in-flight operation can currently be aborted. [JsonPropertyName("abortable")] public bool Abortable { get; set; } /// Whether the session currently has active work, including running turns or tasks. [JsonPropertyName("hasActiveWork")] public bool HasActiveWork { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionMetadataActivityRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Token-usage breakdown for the session's current context window. public sealed class MetadataContextInfoResultContextInfo { /// Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%). [JsonPropertyName("bufferTokens")] public long BufferTokens { get; set; } /// Token count at which background compaction starts (configurable percentage of promptTokenLimit). [JsonPropertyName("compactionThreshold")] public long CompactionThreshold { get; set; } /// Tokens consumed by user/assistant/tool messages. [JsonPropertyName("conversationTokens")] public long ConversationTokens { get; set; } /// Prompt token limit plus the model's full output token limit. [JsonPropertyName("limit")] public long Limit { get; set; } /// Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools). [JsonPropertyName("mcpToolsTokens")] public long McpToolsTokens { get; set; } /// The model used for token counting. [JsonPropertyName("modelName")] public string ModelName { get; set; } = string.Empty; /// Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified). [JsonPropertyName("promptTokenLimit")] public long PromptTokenLimit { get; set; } /// Tokens consumed by the system prompt. [JsonPropertyName("systemTokens")] public long SystemTokens { get; set; } /// Tokens consumed by tool definitions sent to the model (excludes deferred tools). [JsonPropertyName("toolDefinitionsTokens")] public long ToolDefinitionsTokens { get; set; } /// Sum of system, conversation and tool-definition tokens. [JsonPropertyName("totalTokens")] public long TotalTokens { get; set; } } /// Token breakdown for the session's current context window, or null if uninitialized. [Experimental(Diagnostics.Experimental)] public sealed class MetadataContextInfoResult { /// Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached). [JsonPropertyName("contextInfo")] public MetadataContextInfoResultContextInfo? ContextInfo { get; set; } } /// Model identifier and token limits used to compute the context-info breakdown. [Experimental(Diagnostics.Experimental)] internal sealed class MetadataContextInfoRequest { /// Maximum output tokens allowed by the target model. Pass 0 if unknown. [JsonPropertyName("outputTokenLimit")] public long OutputTokenLimit { get; set; } /// Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default. [JsonPropertyName("promptTokenLimit")] public long PromptTokenLimit { get; set; } /// Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values. [JsonPropertyName("selectedModel")] public string? SelectedModel { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). [Experimental(Diagnostics.Experimental)] public sealed class MetadataRecordContextChangeResult { } /// Updated working directory and git context. Emitted as the new payload of `session.context_changed`. [Experimental(Diagnostics.Experimental)] public sealed class SessionWorkingDirectoryContext { /// Merge-base commit SHA (fork point from the remote default branch). [JsonPropertyName("baseCommit")] public string? BaseCommit { get; set; } /// Current git branch name. [JsonPropertyName("branch")] public string? Branch { get; set; } /// Current working directory path. [JsonPropertyName("cwd")] public string Cwd { get; set; } = string.Empty; /// Root directory of the git repository, resolved via git rev-parse. [JsonPropertyName("gitRoot")] public string? GitRoot { get; set; } /// Head commit of the current git branch. [JsonPropertyName("headCommit")] public string? HeadCommit { get; set; } /// Hosting platform type of the repository. [JsonPropertyName("hostType")] public SessionWorkingDirectoryContextHostType? HostType { get; set; } /// Repository identifier derived from the git remote URL ("owner/name" for GitHub, "org/project/repo" for Azure DevOps). [JsonPropertyName("repository")] public string? Repository { get; set; } /// Raw host string from the git remote URL (e.g. "github.com", "dev.azure.com"). [JsonPropertyName("repositoryHost")] public string? RepositoryHost { get; set; } } /// Updated working-directory/git context to record on the session. [Experimental(Diagnostics.Experimental)] internal sealed class MetadataRecordContextChangeRequest { /// Updated working directory and git context. Emitted as the new payload of `session.context_changed`. [JsonPropertyName("context")] public SessionWorkingDirectoryContext Context { get => field ??= new(); set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for `process.chdir` and any related side-effects (file index, etc.); this method only updates the session's own recorded path. [Experimental(Diagnostics.Experimental)] public sealed class MetadataSetWorkingDirectoryResult { /// Working directory after the update. [JsonPropertyName("workingDirectory")] public string WorkingDirectory { get; set; } = string.Empty; } /// Absolute path to set as the session's new working directory. [Experimental(Diagnostics.Experimental)] internal sealed class MetadataSetWorkingDirectoryRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Absolute path to set as the session's working directory. The runtime updates the session's recorded cwd so subsequent operations (shell tools, file lookups, telemetry) anchor to it. [JsonPropertyName("workingDirectory")] public string WorkingDirectory { get; set; } = string.Empty; } /// Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session. [Experimental(Diagnostics.Experimental)] public sealed class MetadataRecomputeContextTokensResult { /// Tokens contributed by user/assistant/tool messages (excludes system/developer prompts). [JsonPropertyName("messagesTokenCount")] public long MessagesTokenCount { get; set; } /// Tokens contributed by system/developer prompt snapshots. [JsonPropertyName("systemTokenCount")] public long SystemTokenCount { get; set; } /// Sum of tokens across chat-context and system-context messages currently held by the session. [JsonPropertyName("totalTokens")] public long TotalTokens { get; set; } } /// Model identifier to use when re-tokenizing the session's existing messages. [Experimental(Diagnostics.Experimental)] internal sealed class MetadataRecomputeContextTokensRequest { /// Model identifier used for tokenization. The runtime token-counts both chat-context and system-context messages against this model. [JsonPropertyName("modelId")] public string ModelId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifier of the spawned process, used to correlate streamed output and exit notifications. [Experimental(Diagnostics.Experimental)] public sealed class ShellExecResult { /// Unique identifier for tracking streamed output. [JsonPropertyName("processId")] public string ProcessId { get; set; } = string.Empty; } /// Shell command to run, with optional working directory and timeout in milliseconds. [Experimental(Diagnostics.Experimental)] internal sealed class ShellExecRequest { /// Shell command to execute. [JsonPropertyName("command")] public string Command { get; set; } = string.Empty; /// Working directory (defaults to session working directory). [JsonPropertyName("cwd")] public string? Cwd { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Timeout in milliseconds (default: 30000). [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonPropertyName("timeout")] public TimeSpan? Timeout { get; set; } } /// Indicates whether the signal was delivered; false if the process was unknown or already exited. [Experimental(Diagnostics.Experimental)] public sealed class ShellKillResult { /// Whether the signal was sent successfully. [JsonPropertyName("killed")] public bool Killed { get; set; } } /// Identifier of a process previously returned by "shell.exec" and the signal to send. [Experimental(Diagnostics.Experimental)] internal sealed class ShellKillRequest { /// Process identifier returned by shell.exec. [JsonPropertyName("processId")] public string ProcessId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Signal to send (default: SIGTERM). [JsonPropertyName("signal")] public ShellKillSignal? Signal { get; set; } } /// Result of a user-requested shell command. [Experimental(Diagnostics.Experimental)] public sealed class UserRequestedShellCommandResult { /// Error output when the execution failed. [JsonPropertyName("error")] public string? Error { get; set; } /// Process exit code, when available. [JsonPropertyName("exitCode")] public long? ExitCode { get; set; } /// Captured command output. [JsonPropertyName("output")] public string Output { get; set; } = string.Empty; /// Whether the command completed successfully. [JsonPropertyName("success")] public bool Success { get; set; } /// Tool call id emitted for the shell execution. [JsonPropertyName("toolCallId")] public string ToolCallId { get; set; } = string.Empty; } /// User-requested shell command and cancellation handle. [Experimental(Diagnostics.Experimental)] internal sealed class ShellExecuteUserRequestedRequest { /// Shell command to execute. [JsonPropertyName("command")] public string Command { get; set; } = string.Empty; /// Caller-provided cancellation handle for this execution. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Cancellation result for a user-requested shell command. [Experimental(Diagnostics.Experimental)] public sealed class CancelUserRequestedShellCommandResult { /// Whether an in-flight execution was found and signalled to cancel. [JsonPropertyName("cancelled")] public bool Cancelled { get; set; } } /// User-requested shell execution cancellation handle. [Experimental(Diagnostics.Experimental)] internal sealed class ShellCancelUserRequestedRequest { /// Request ID previously passed to executeUserRequested. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Post-compaction context window usage breakdown. [Experimental(Diagnostics.Experimental)] public sealed class HistoryCompactContextWindow { /// Token count from non-system messages (user, assistant, tool). [JsonPropertyName("conversationTokens")] public long? ConversationTokens { get; set; } /// Current total tokens in the context window (system + conversation + tool definitions). [JsonPropertyName("currentTokens")] public long CurrentTokens { get; set; } /// Current number of messages in the conversation. [JsonPropertyName("messagesLength")] public long MessagesLength { get; set; } /// Token count from system message(s). [JsonPropertyName("systemTokens")] public long? SystemTokens { get; set; } /// Maximum token count for the model's context window. [JsonPropertyName("tokenLimit")] public long TokenLimit { get; set; } /// Token count from tool definitions. [JsonPropertyName("toolDefinitionsTokens")] public long? ToolDefinitionsTokens { get; set; } } /// Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown. [Experimental(Diagnostics.Experimental)] public sealed class HistoryCompactResult { /// Post-compaction context window usage breakdown. [JsonPropertyName("contextWindow")] public HistoryCompactContextWindow? ContextWindow { get; set; } /// Number of messages removed during compaction. [JsonPropertyName("messagesRemoved")] public long MessagesRemoved { get; set; } /// Whether compaction completed successfully. [JsonPropertyName("success")] public bool Success { get; set; } /// Summary text produced by compaction. Omitted when compaction did not produce a summary (e.g. failure path). [JsonPropertyName("summaryContent")] public string? SummaryContent { get; set; } /// Number of tokens freed by compaction. [JsonPropertyName("tokensRemoved")] public long TokensRemoved { get; set; } } /// Optional compaction parameters. [Experimental(Diagnostics.Experimental)] public sealed class HistoryCompactRequest { /// Optional user-provided instructions to focus the compaction summary. [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(4000)] [JsonPropertyName("customInstructions")] public string? CustomInstructions { get; set; } } /// Optional compaction parameters. [Experimental(Diagnostics.Experimental)] internal sealed class HistoryCompactRequestWithSession { /// Optional user-provided instructions to focus the compaction summary. [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(4000)] [JsonPropertyName("customInstructions")] public string? CustomInstructions { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Number of events that were removed by the truncation. [Experimental(Diagnostics.Experimental)] public sealed class HistoryTruncateResult { /// Number of events that were removed. [JsonPropertyName("eventsRemoved")] public long EventsRemoved { get; set; } } /// Identifier of the event to truncate to; this event and all later events are removed. [Experimental(Diagnostics.Experimental)] internal sealed class HistoryTruncateRequest { /// Event ID to truncate to. This event and all events after it are removed from the session. [JsonPropertyName("eventId")] public string EventId { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether an in-progress background compaction was cancelled. [Experimental(Diagnostics.Experimental)] public sealed class HistoryCancelBackgroundCompactionResult { /// Whether an in-progress background compaction was cancelled. False when no compaction was running, when the session is remote, or when the underlying processor was unavailable. [JsonPropertyName("cancelled")] public bool Cancelled { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionHistoryCancelBackgroundCompactionRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether an in-progress manual compaction was aborted. [Experimental(Diagnostics.Experimental)] public sealed class HistoryAbortManualCompactionResult { /// Whether an in-progress manual compaction was aborted. False when no manual compaction was running, when its abort controller was already aborted, or when the session is remote. [JsonPropertyName("aborted")] public bool Aborted { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionHistoryAbortManualCompactionRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Markdown summary of the conversation context (empty when not available). [Experimental(Diagnostics.Experimental)] public sealed class HistorySummarizeForHandoffResult { /// Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization. [JsonPropertyName("summary")] public string Summary { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionHistorySummarizeForHandoffRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `QueuePendingItems` type. [Experimental(Diagnostics.Experimental)] public sealed class QueuePendingItems { /// Human-readable text to display for this queue entry in the UI. [JsonPropertyName("displayText")] public string DisplayText { get; set; } = string.Empty; /// Whether this item is a queued user message or a queued slash command / model change. [JsonPropertyName("kind")] public QueuePendingItemsKind Kind { get; set; } } /// Snapshot of the session's pending queued items and immediate-steering messages. [Experimental(Diagnostics.Experimental)] public sealed class QueuePendingItemsResult { /// Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items. [JsonPropertyName("items")] public IList Items { get => field ??= []; set; } /// Display text for messages currently in the immediate steering queue (interjections sent during a running turn). [JsonPropertyName("steeringMessages")] public IList SteeringMessages { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionQueuePendingItemsRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether a user-facing pending item was removed. [Experimental(Diagnostics.Experimental)] public sealed class QueueRemoveMostRecentResult { /// True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained. [JsonPropertyName("removed")] public bool Removed { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionQueueRemoveMostRecentRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionQueueClearRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Batch of session events returned by a read, with cursor and continuation metadata. [Experimental(Diagnostics.Experimental)] public sealed class EventsReadResult { /// Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. [JsonPropertyName("cursor")] public string Cursor { get; set; } = string.Empty; /// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. [JsonPropertyName("cursorStatus")] public EventsCursorStatus CursorStatus { get; set; } /// Events are delivered in two batches per read: persisted events first (in append order), then ephemeral events (in seq order). When `waitMs > 0` and the catch-up batches were empty, post-wait events follow the same two-batch ordering. Persisted and ephemeral events do not interleave within a single read. [JsonPropertyName("events")] public IList Events { get => field ??= []; set; } /// True when the read returned `max` events and more events are available immediately. When false, the next read with a non-zero `waitMs` will block until a new event arrives or the wait expires. [JsonPropertyName("hasMore")] public bool HasMore { get; set; } } /// Cursor, batch size, and optional long-poll/filter parameters for reading session events. [Experimental(Diagnostics.Experimental)] internal sealed class EventLogReadRequest { /// Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. [JsonPropertyName("agentScope")] public EventsAgentScope? AgentScope { get; set; } /// Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history. [JsonPropertyName("cursor")] public string? Cursor { get; set; } /// Maximum number of events to return in this batch (1–1000, default 200). [JsonPropertyName("max")] public long? Max { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Either '*' to receive all event types, or a non-empty list of event types to receive. [JsonPropertyName("types")] public JsonElement? Types { get; set; } /// Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonPropertyName("waitMs")] public TimeSpan? Wait { get; set; } } /// Snapshot of the current tail cursor without returning any events. Use this when a consumer wants to subscribe to live events going forward without first paginating through the entire persisted history (which would happen if `read` were called without a cursor on a long-lived session). [Experimental(Diagnostics.Experimental)] public sealed class EventLogTailResult { /// Opaque cursor pointing at the current tail of the session's persisted-events history. Pass back to `read` to receive only events that arrive AFTER this snapshot. When the session has no events, this returns the same sentinel as an unset cursor (i.e. equivalent to omitting the cursor on a first read). [JsonPropertyName("cursor")] public string Cursor { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionEventLogTailRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Opaque handle representing an event-type interest registration. [Experimental(Diagnostics.Experimental)] public sealed class RegisterEventInterestResult { /// Opaque handle for this registration. Pass to releaseInterest to release. Each call to registerInterest produces a fresh handle, even when the same eventType is registered multiple times. [JsonPropertyName("handle")] public string Handle { get; set; } = string.Empty; } /// Event type to register consumer interest for, used by runtime gating logic. [Experimental(Diagnostics.Experimental)] internal sealed class RegisterEventInterestParams { /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. [JsonPropertyName("eventType")] public string EventType { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the operation succeeded. [Experimental(Diagnostics.Experimental)] public sealed class EventLogReleaseInterestResult { /// Whether the operation succeeded. [JsonPropertyName("success")] public bool Success { get; set; } } /// Opaque handle previously returned by `registerInterest` to release. [Experimental(Diagnostics.Experimental)] internal sealed class ReleaseEventInterestParams { /// Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type. [JsonPropertyName("handle")] public string Handle { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Aggregated code change metrics. [Experimental(Diagnostics.Experimental)] public sealed class UsageMetricsCodeChanges { /// Distinct file paths modified during the session. [JsonPropertyName("filesModified")] public IList FilesModified { get => field ??= []; set; } /// Number of distinct files modified. [JsonPropertyName("filesModifiedCount")] public long FilesModifiedCount { get; set; } /// Total lines of code added. [JsonPropertyName("linesAdded")] public long LinesAdded { get; set; } /// Total lines of code removed. [JsonPropertyName("linesRemoved")] public long LinesRemoved { get; set; } } /// Request count and cost metrics for this model. [Experimental(Diagnostics.Experimental)] public sealed class UsageMetricsModelMetricRequests { /// User-initiated premium request cost (with multiplier applied). [JsonPropertyName("cost")] public double Cost { get; set; } /// Number of API requests made with this model. [JsonPropertyName("count")] public long Count { get; set; } } /// Schema for the `UsageMetricsModelMetricTokenDetail` type. [Experimental(Diagnostics.Experimental)] public sealed class UsageMetricsModelMetricTokenDetail { /// Accumulated token count for this token type. [JsonPropertyName("tokenCount")] public long TokenCount { get; set; } } /// Token usage metrics for this model. [Experimental(Diagnostics.Experimental)] public sealed class UsageMetricsModelMetricUsage { /// Total tokens read from prompt cache. [JsonPropertyName("cacheReadTokens")] public long CacheReadTokens { get; set; } /// Total tokens written to prompt cache. [JsonPropertyName("cacheWriteTokens")] public long CacheWriteTokens { get; set; } /// Total input tokens consumed. [JsonPropertyName("inputTokens")] public long InputTokens { get; set; } /// Total output tokens produced. [JsonPropertyName("outputTokens")] public long OutputTokens { get; set; } /// Total output tokens used for reasoning. [JsonPropertyName("reasoningTokens")] public long? ReasoningTokens { get; set; } } /// Schema for the `UsageMetricsModelMetric` type. [Experimental(Diagnostics.Experimental)] public sealed class UsageMetricsModelMetric { /// Request count and cost metrics for this model. [JsonPropertyName("requests")] public UsageMetricsModelMetricRequests Requests { get => field ??= new(); set; } /// Token count details per type. [JsonPropertyName("tokenDetails")] public IDictionary? TokenDetails { get; set; } /// Accumulated nano-AI units cost for this model. [JsonPropertyName("totalNanoAiu")] public double? TotalNanoAiu { get; set; } /// Token usage metrics for this model. [JsonPropertyName("usage")] public UsageMetricsModelMetricUsage Usage { get => field ??= new(); set; } } /// Schema for the `UsageMetricsTokenDetail` type. [Experimental(Diagnostics.Experimental)] public sealed class UsageMetricsTokenDetail { /// Accumulated token count for this token type. [JsonPropertyName("tokenCount")] public long TokenCount { get; set; } } /// Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals. [Experimental(Diagnostics.Experimental)] public sealed class UsageGetMetricsResult { /// Aggregated code change metrics. [JsonPropertyName("codeChanges")] public UsageMetricsCodeChanges CodeChanges { get => field ??= new(); set; } /// Currently active model identifier. [JsonPropertyName("currentModel")] public string? CurrentModel { get; set; } /// Input tokens from the most recent main-agent API call. [JsonPropertyName("lastCallInputTokens")] public long LastCallInputTokens { get; set; } /// Output tokens from the most recent main-agent API call. [JsonPropertyName("lastCallOutputTokens")] public long LastCallOutputTokens { get; set; } /// Per-model token and request metrics, keyed by model identifier. [JsonPropertyName("modelMetrics")] public IDictionary ModelMetrics { get => field ??= new Dictionary(); set; } /// ISO 8601 timestamp when the session started. [JsonPropertyName("sessionStartTime")] public DateTimeOffset SessionStartTime { get; set; } /// Session-wide per-token-type accumulated token counts. [JsonPropertyName("tokenDetails")] public IDictionary? TokenDetails { get; set; } /// Total time spent in model API calls (milliseconds). [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonPropertyName("totalApiDurationMs")] public TimeSpan TotalApiDuration { get; set; } /// Session-wide accumulated nano-AI units cost. [JsonPropertyName("totalNanoAiu")] public double? TotalNanoAiu { get; set; } /// Total user-initiated premium request cost across all models (may be fractional due to multipliers). [JsonPropertyName("totalPremiumRequestCost")] public double TotalPremiumRequestCost { get; set; } /// Raw count of user-initiated API requests. [JsonPropertyName("totalUserRequests")] public long TotalUserRequests { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionUsageGetMetricsRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// GitHub URL for the session and a flag indicating whether remote steering is enabled. [Experimental(Diagnostics.Experimental)] public sealed class RemoteEnableResult { /// Whether remote steering is enabled. [JsonPropertyName("remoteSteerable")] public bool RemoteSteerable { get; set; } /// GitHub frontend URL for this session. [Url] [StringSyntax(StringSyntaxAttribute.Uri)] [JsonPropertyName("url")] public string? Url { get; set; } } /// Optional remote session mode ("off", "export", or "on"); defaults to enabling both export and remote steering. [Experimental(Diagnostics.Experimental)] internal sealed class RemoteEnableRequest { /// Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering. [JsonPropertyName("mode")] public RemoteSessionMode? Mode { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionRemoteDisableRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. [Experimental(Diagnostics.Experimental)] public sealed class RemoteNotifySteerableChangedResult { } /// New remote-steerability state to persist as a `session.remote_steerable_changed` event. [Experimental(Diagnostics.Experimental)] internal sealed class RemoteNotifySteerableChangedRequest { /// Whether the session now supports remote steering via GitHub. The runtime persists this as a `session.remote_steerable_changed` event so resume/replay sees the up-to-date capability. [JsonPropertyName("remoteSteerable")] public bool RemoteSteerable { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Current sharing status and shareable GitHub URL for a session. [Experimental(Diagnostics.Experimental)] public sealed class VisibilityGetResult { /// Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. [Url] [StringSyntax(StringSyntaxAttribute.Uri)] [JsonPropertyName("shareUrl")] public string? ShareUrl { get; set; } /// Current sharing status. Absent when the session is not synced or the status could not be retrieved (e.g. the user is not authenticated). [JsonPropertyName("status")] public SessionVisibilityStatus? Status { get; set; } /// Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the session cannot be shared and `status`/`shareUrl` are absent. [JsonPropertyName("synced")] public bool Synced { get; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionVisibilityGetRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Effective sharing status and shareable GitHub URL after updating session visibility. [Experimental(Diagnostics.Experimental)] public sealed class VisibilitySetResult { /// Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved. [Url] [StringSyntax(StringSyntaxAttribute.Uri)] [JsonPropertyName("shareUrl")] public string? ShareUrl { get; set; } /// Effective sharing status after the update. May differ from the requested status for task types that are already visible to repository readers by default. Absent when the update could not be applied (e.g. the session is not synced or the user is not authenticated). [JsonPropertyName("status")] public SessionVisibilityStatus? Status { get; set; } /// Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the visibility change could not be applied and `status`/`shareUrl` are absent. [JsonPropertyName("synced")] public bool Synced { get; set; } } /// Desired sharing status for the session. [Experimental(Diagnostics.Experimental)] internal sealed class VisibilitySetRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Sharing status to apply. "repo" makes the session visible to repository readers; "unshared" restricts it to the creator and collaborators. [JsonPropertyName("status")] public SessionVisibilityStatus Status { get; set; } } /// Schema for the `ScheduleEntry` type. [Experimental(Diagnostics.Experimental)] public sealed class ScheduleEntry { /// Absolute fire time (epoch milliseconds) for a one-shot calendar schedule. [JsonPropertyName("at")] public long? At { get; set; } /// 5-field cron expression for a recurring calendar schedule, evaluated in `tz`. [JsonPropertyName("cron")] public string? Cron { get; set; } /// Display-only label for the prompt as shown in the UI (e.g. `/skill-name` for a skill-invocation schedule). The actual enqueued prompt is `prompt`. [JsonPropertyName("displayPrompt")] public string? DisplayPrompt { get; set; } /// Sequential id assigned by the runtime within the session. Stable across resumes (rebuilt from the event log). [JsonPropertyName("id")] public long Id { get; set; } /// Interval between scheduled ticks, in milliseconds (relative-interval schedules). [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonPropertyName("intervalMs")] public TimeSpan? Interval { get; set; } /// ISO 8601 timestamp when the next tick is scheduled to fire. [JsonPropertyName("nextRunAt")] public DateTimeOffset NextRunAt { get; set; } /// Prompt text that gets enqueued on every tick. [JsonPropertyName("prompt")] public string Prompt { get; set; } = string.Empty; /// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). [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. [JsonPropertyName("selfPaced")] public bool? SelfPaced { get; set; } /// IANA timezone the `cron` expression is evaluated in. [JsonPropertyName("tz")] public string? Tz { get; set; } } /// Snapshot of the currently active recurring prompts for this session. [Experimental(Diagnostics.Experimental)] public sealed class ScheduleList { /// Active scheduled prompts, ordered by id. [JsonPropertyName("entries")] public IList Entries { get => field ??= []; set; } } /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionScheduleListRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Remove a scheduled prompt by id. The result entry is omitted if the id was unknown. [Experimental(Diagnostics.Experimental)] public sealed class ScheduleStopResult { /// The removed entry, or omitted if no entry matched. [JsonPropertyName("entry")] public ScheduleEntry? Entry { get; set; } } /// Identifier of the scheduled prompt to remove. [Experimental(Diagnostics.Experimental)] internal sealed class ScheduleStopRequest { /// Id of the scheduled prompt to remove. [JsonPropertyName("id")] public long Id { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer <token>` on the outbound request and does no caching; the SDK consumer owns token caching and refresh. [Experimental(Diagnostics.Experimental)] public sealed class ProviderTokenAcquireResult { /// The bearer token value (without the `Bearer ` prefix). [JsonPropertyName("token")] public string Token { get; set; } = string.Empty; } /// Asks the SDK client to acquire a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Issued by the runtime before each outbound model request; the runtime does no caching, so this is sent once per request. [Experimental(Diagnostics.Experimental)] public sealed class ProviderTokenAcquireRequest { /// Name of the BYOK provider needing a token. For the legacy whole-session `provider` this is the implicit provider name; for named providers it is `NamedProviderConfig.name`. [JsonPropertyName("providerName")] public string ProviderName { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Describes a filesystem error. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsError { /// Error classification. [JsonPropertyName("code")] public SessionFsErrorCode Code { get; set; } /// Free-form detail about the error, for logging/diagnostics. [JsonPropertyName("message")] public string? Message { get; set; } } /// File content as a UTF-8 string, or a filesystem error if the read failed. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsReadFileResult { /// File content as UTF-8 string. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; /// Describes a filesystem error. [JsonPropertyName("error")] public SessionFsError? Error { get; set; } } /// Path of the file to read from the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsReadFileRequest { /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// File path, content to write, and optional mode for the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsWriteFileRequest { /// Content to write. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; /// Optional POSIX-style mode for newly created files. [JsonPropertyName("mode")] public long? Mode { get; set; } /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// File path, content to append, and optional mode for the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsAppendFileRequest { /// Content to append. [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; /// Optional POSIX-style mode for newly created files. [JsonPropertyName("mode")] public long? Mode { get; set; } /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the requested path exists in the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsExistsResult { /// Whether the path exists. [JsonPropertyName("exists")] public bool Exists { get; set; } } /// Path to test for existence in the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsExistsRequest { /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Filesystem metadata for the requested path, or a filesystem error if the stat failed. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsStatResult { /// ISO 8601 timestamp of creation. [JsonPropertyName("birthtime")] public DateTimeOffset Birthtime { get; set; } /// Describes a filesystem error. [JsonPropertyName("error")] public SessionFsError? Error { get; set; } /// Whether the path is a directory. [JsonPropertyName("isDirectory")] public bool IsDirectory { get; set; } /// Whether the path is a file. [JsonPropertyName("isFile")] public bool IsFile { get; set; } /// ISO 8601 timestamp of last modification. [JsonPropertyName("mtime")] public DateTimeOffset Mtime { get; set; } /// File size in bytes. [JsonPropertyName("size")] public long Size { get; set; } } /// Path whose metadata should be returned from the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsStatRequest { /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Directory path to create in the client-provided session filesystem, with options for recursive creation and POSIX mode. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsMkdirRequest { /// Optional POSIX-style mode for newly created directories. [JsonPropertyName("mode")] public long? Mode { get; set; } /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Create parent directories as needed. [JsonPropertyName("recursive")] public bool? Recursive { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Names of entries in the requested directory, or a filesystem error if the read failed. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsReaddirResult { /// Entry names in the directory. [JsonPropertyName("entries")] public IList Entries { get => field ??= []; set; } /// Describes a filesystem error. [JsonPropertyName("error")] public SessionFsError? Error { get; set; } } /// Directory path whose entries should be listed from the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsReaddirRequest { /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Schema for the `SessionFsReaddirWithTypesEntry` type. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsReaddirWithTypesEntry { /// Entry name. [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; /// Entry type. [JsonPropertyName("type")] public SessionFsReaddirWithTypesEntryType Type { get; set; } } /// Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsReaddirWithTypesResult { /// Directory entries with type information. [JsonPropertyName("entries")] public IList Entries { get => field ??= []; set; } /// Describes a filesystem error. [JsonPropertyName("error")] public SessionFsError? Error { get; set; } } /// Directory path whose entries (with type information) should be listed from the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsReaddirWithTypesRequest { /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Path to remove from the client-provided session filesystem, with options for recursive removal and force. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsRmRequest { /// Ignore errors if the path does not exist. [JsonPropertyName("force")] public bool? Force { get; set; } /// Path using SessionFs conventions. [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; /// Remove directories and their contents recursively. [JsonPropertyName("recursive")] public bool? Recursive { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Source and destination paths for renaming or moving an entry in the client-provided session filesystem. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsRenameRequest { /// Destination path using SessionFs conventions. [JsonPropertyName("dest")] public string Dest { get; set; } = string.Empty; /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; /// Source path using SessionFs conventions. [JsonPropertyName("src")] public string Src { get; set; } = string.Empty; } /// Query results including rows, columns, and rows affected, or a filesystem error if execution failed. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsSqliteQueryResult { /// Column names from the result set. [JsonPropertyName("columns")] public IList Columns { get => field ??= []; set; } /// Describes a filesystem error. [JsonPropertyName("error")] public SessionFsError? Error { get; set; } /// SQLite last_insert_rowid() value for INSERT. [JsonPropertyName("lastInsertRowid")] public long? LastInsertRowid { get; set; } /// For SELECT: array of row objects. For others: empty array. [JsonPropertyName("rows")] public IList> Rows { get => field ??= []; set; } /// Number of rows affected (for INSERT/UPDATE/DELETE). [JsonPropertyName("rowsAffected")] public long RowsAffected { get; set; } } /// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsSqliteQueryRequest { /// Optional named bind parameters. [JsonPropertyName("params")] public IDictionary? Params { get; set; } /// SQL query to execute. [JsonPropertyName("query")] public string Query { get; set; } = string.Empty; /// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected). [JsonPropertyName("queryType")] public SessionFsSqliteQueryType QueryType { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Indicates whether the per-session SQLite database already exists. [Experimental(Diagnostics.Experimental)] public sealed class SessionFsSqliteExistsResult { /// Whether the session database already exists. [JsonPropertyName("exists")] public bool Exists { get; set; } } /// Identifies the target session. public sealed class SessionFsSqliteExistsRequest { /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Canvas open result returned by the provider. [Experimental(Diagnostics.Experimental)] public sealed class CanvasProviderOpenResult { /// Provider-supplied status text. [JsonPropertyName("status")] public string? Status { get; set; } /// Provider-supplied title. [JsonPropertyName("title")] public string? Title { get; set; } /// URL for web-rendered canvases. [JsonPropertyName("url")] public string? Url { get; set; } } /// Host capabilities. [Experimental(Diagnostics.Experimental)] public sealed class CanvasHostContextCapabilities { /// Whether canvas rendering is supported. [JsonPropertyName("canvases")] public bool? Canvases { get; set; } } /// Host context supplied by the runtime. [Experimental(Diagnostics.Experimental)] public sealed class CanvasHostContext { /// Host capabilities. [JsonPropertyName("capabilities")] public CanvasHostContextCapabilities? Capabilities { get; set; } } /// Session context supplied by the runtime. [Experimental(Diagnostics.Experimental)] public sealed class CanvasSessionContext { /// Active session working directory, when known. [JsonPropertyName("workingDirectory")] public string? WorkingDirectory { get; set; } } /// Canvas open parameters sent to the provider. [Experimental(Diagnostics.Experimental)] public sealed class CanvasProviderOpenRequest { /// Provider-local canvas identifier. [JsonPropertyName("canvasId")] public string CanvasId { get; set; } = string.Empty; /// Owning provider identifier. [JsonPropertyName("extensionId")] public string ExtensionId { get; set; } = string.Empty; /// Host context supplied by the runtime. [JsonPropertyName("host")] public CanvasHostContext? Host { get; set; } /// Canvas open input. [JsonPropertyName("input")] public JsonElement? Input { get; set; } /// Stable caller-supplied canvas instance identifier. [JsonPropertyName("instanceId")] public string InstanceId { get; set; } = string.Empty; /// Session context supplied by the runtime. [JsonPropertyName("session")] public CanvasSessionContext? Session { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Canvas close parameters sent to the provider. [Experimental(Diagnostics.Experimental)] public sealed class CanvasProviderCloseRequest { /// Provider-local canvas identifier. [JsonPropertyName("canvasId")] public string CanvasId { get; set; } = string.Empty; /// Owning provider identifier. [JsonPropertyName("extensionId")] public string ExtensionId { get; set; } = string.Empty; /// Host context supplied by the runtime. [JsonPropertyName("host")] public CanvasHostContext? Host { get; set; } /// Canvas instance identifier. [JsonPropertyName("instanceId")] public string InstanceId { get; set; } = string.Empty; /// Session context supplied by the runtime. [JsonPropertyName("session")] public CanvasSessionContext? Session { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Canvas action invocation parameters sent to the provider. [Experimental(Diagnostics.Experimental)] public sealed class CanvasProviderInvokeActionRequest { /// Action name to invoke. [JsonPropertyName("actionName")] public string ActionName { get; set; } = string.Empty; /// Provider-local canvas identifier. [JsonPropertyName("canvasId")] public string CanvasId { get; set; } = string.Empty; /// Owning provider identifier. [JsonPropertyName("extensionId")] public string ExtensionId { get; set; } = string.Empty; /// Host context supplied by the runtime. [JsonPropertyName("host")] public CanvasHostContext? Host { get; set; } /// Action input. [JsonPropertyName("input")] public JsonElement? Input { get; set; } /// Canvas instance identifier. [JsonPropertyName("instanceId")] public string InstanceId { get; set; } = string.Empty; /// Session context supplied by the runtime. [JsonPropertyName("session")] public CanvasSessionContext? Session { get; set; } /// Target session identifier. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed. [Experimental(Diagnostics.Experimental)] public sealed class LlmInferenceHttpRequestStartResult { } /// The head of an outbound model-layer HTTP request. [Experimental(Diagnostics.Experimental)] public sealed class LlmInferenceHttpRequestStartRequest { /// Gets or sets the headers value. [JsonPropertyName("headers")] public IDictionary> Headers { get => field ??= new Dictionary>(); set; } /// HTTP method, e.g. GET, POST. [JsonPropertyName("method")] public string Method { get; set; } = string.Empty; /// Opaque runtime-minted id, unique per in-flight request. The SDK uses this to correlate httpRequestChunk frames and to address its httpResponseStart / httpResponseChunk replies back to the runtime. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; /// Id of the runtime session that triggered this request, when one is in scope. Absent for requests issued outside any session (e.g. startup model-catalog or capability resolution). This is a payload field — not a dispatch key — because the client-global API is registered process-wide rather than per session. [JsonPropertyName("sessionId")] public string? SessionId { get; set; } /// Transport the runtime would otherwise use for this request. `http` (the default when absent) covers plain HTTP and SSE responses; `websocket` indicates a full-duplex message channel where each body chunk maps to one WebSocket message and the `binary` flag distinguishes text from binary frames. The SDK consumer uses this to decide whether to service the request with an HTTP client or a WebSocket client. It is the one piece of request metadata the consumer cannot reliably infer from the URL or headers alone. [JsonPropertyName("transport")] public LlmInferenceHttpRequestStartTransport? Transport { get; set; } /// Absolute request URL. [JsonPropertyName("url")] public string Url { get; set; } = string.Empty; } /// Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget. [Experimental(Diagnostics.Experimental)] public sealed class LlmInferenceHttpRequestChunkResult { } /// A request body chunk or cancellation signal. [Experimental(Diagnostics.Experimental)] public sealed class LlmInferenceHttpRequestChunkRequest { /// When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text. [JsonPropertyName("binary")] public bool? Binary { get; set; } /// When true, the runtime is cancelling the in-flight request (e.g. upstream consumer aborted). `data` is ignored. Implies end-of-request. [JsonPropertyName("cancel")] public bool? Cancel { get; set; } /// Optional human-readable reason for the cancellation, propagated for logging. [JsonPropertyName("cancelReason")] public string? CancelReason { get; set; } /// Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty. [JsonPropertyName("data")] public string Data { get; set; } = string.Empty; /// When true, this is the final body chunk for the request. The SDK may rely on having received an end-marked chunk before treating the request body as complete. [JsonPropertyName("end")] public bool? End { get; set; } /// Matches the requestId from the originating httpRequestStart frame. [JsonPropertyName("requestId")] public string RequestId { get; set; } = string.Empty; } /// Client environment metadata describing the process that produced a telemetry event. [Experimental(Diagnostics.Experimental)] public sealed class GitHubTelemetryClientInfo { /// Copilot CLI version string. [JsonPropertyName("cli_version")] public string CliVersion { get; set; } = string.Empty; /// Name of the client application. [JsonPropertyName("client_name")] public string? ClientName { get; set; } /// Type of client. [JsonPropertyName("client_type")] public string? ClientType { get; set; } /// Copilot subscription plan, when known. [JsonPropertyName("copilot_plan")] public string? CopilotPlan { get; set; } /// Stable machine identifier for the device. [JsonPropertyName("dev_device_id")] public string? DevDeviceId { get; set; } /// Whether the user is a GitHub/Microsoft staff member. [JsonPropertyName("is_staff")] public bool? IsStaff { get; set; } /// Node.js runtime version string. [JsonPropertyName("node_version")] public string NodeVersion { get; set; } = string.Empty; /// Operating system architecture (e.g. arm64, x64). [JsonPropertyName("os_arch")] public string OsArch { get; set; } = string.Empty; /// Operating system platform (e.g. darwin, linux, win32). [JsonPropertyName("os_platform")] public string OsPlatform { get; set; } = string.Empty; /// Operating system version string. [JsonPropertyName("os_version")] public string OsVersion { get; set; } = string.Empty; } /// A single telemetry event in the runtime's native GitHub-shaped telemetry format, forwarded verbatim to opted-in hosts. The `restricted` flag on the enclosing GitHubTelemetryNotification distinguishes standard from restricted events; the payload shape is identical for both. [Experimental(Diagnostics.Experimental)] public sealed class GitHubTelemetryEvent { /// Client environment metadata. [JsonPropertyName("client")] public GitHubTelemetryClientInfo? Client { get; set; } /// Copilot tracking ID for user-level attribution. [JsonPropertyName("copilot_tracking_id")] public string? CopilotTrackingId { get; set; } /// Timestamp when the event was created (ISO 8601 format). [JsonPropertyName("created_at")] public string? CreatedAt { get; set; } /// Experiment assignment context. [JsonPropertyName("exp_assignment_context")] public string? ExpAssignmentContext { get; set; } /// Feature flags enabled for this session, as a map from flag to value. [JsonPropertyName("features")] public IDictionary? Features { get; set; } /// Event type/kind (e.g. get_completion_with_tools_turn, tool_call_executed). [JsonPropertyName("kind")] public string Kind { get; set; } = string.Empty; /// Numeric metrics as a map from key to value. [JsonPropertyName("metrics")] public IDictionary Metrics { get => field ??= new Dictionary(); set; } /// Reference to the model call that produced this event. [JsonPropertyName("model_call_id")] public string? ModelCallId { get; set; } /// String-valued properties as a map from key to value. [JsonPropertyName("properties")] public IDictionary Properties { get => field ??= new Dictionary(); set; } /// Session identifier the event belongs to. [JsonPropertyName("session_id")] public string? SessionId { get; set; } } /// Payload for a `gitHubTelemetry.event` notification: a single GitHub telemetry event the runtime forwards to a host connection that opted into telemetry forwarding for the session. [Experimental(Diagnostics.Experimental)] public sealed class GitHubTelemetryNotification { /// The telemetry event, in the runtime's native GitHub-shaped telemetry format. [JsonPropertyName("event")] public GitHubTelemetryEvent Event { get => field ??= new(); set; } /// Whether this is a restricted telemetry event (cli.restricted_telemetry). Hosts must route restricted events to first-party Microsoft stores only. [JsonPropertyName("restricted")] public bool Restricted { get; set; } /// Session the telemetry event belongs to. [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; } /// Resolved Anthropic adaptive-thinking capability for a model. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AdaptiveThinkingSupport : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AdaptiveThinkingSupport(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The model does not accept thinking.type='adaptive'. public static AdaptiveThinkingSupport Unsupported { get; } = new("unsupported"); /// The model accepts adaptive thinking but also accepts thinking.type='enabled'. public static AdaptiveThinkingSupport Optional { get; } = new("optional"); /// The model only accepts adaptive thinking and rejects thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8). public static AdaptiveThinkingSupport Required { get; } = new("required"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AdaptiveThinkingSupport left, AdaptiveThinkingSupport right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AdaptiveThinkingSupport left, AdaptiveThinkingSupport right) => !(left == right); /// public override bool Equals(object? obj) => obj is AdaptiveThinkingSupport other && Equals(other); /// public bool Equals(AdaptiveThinkingSupport 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 AdaptiveThinkingSupport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AdaptiveThinkingSupport value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AdaptiveThinkingSupport)); } } } /// Model capability category for grouping in the model picker. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ModelPickerCategory : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ModelPickerCategory(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Lightweight model category optimized for faster, lower-cost interactions. public static ModelPickerCategory Lightweight { get; } = new("lightweight"); /// Versatile model category suitable for a broad range of tasks. public static ModelPickerCategory Versatile { get; } = new("versatile"); /// Powerful model category optimized for complex tasks. public static ModelPickerCategory Powerful { get; } = new("powerful"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ModelPickerCategory left, ModelPickerCategory right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ModelPickerCategory left, ModelPickerCategory right) => !(left == right); /// public override bool Equals(object? obj) => obj is ModelPickerCategory other && Equals(other); /// public bool Equals(ModelPickerCategory 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 ModelPickerCategory Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ModelPickerCategory value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelPickerCategory)); } } } /// Relative cost tier for token-based billing users. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ModelPickerPriceCategory : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ModelPickerPriceCategory(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Lowest relative token cost tier. public static ModelPickerPriceCategory Low { get; } = new("low"); /// Medium relative token cost tier. public static ModelPickerPriceCategory Medium { get; } = new("medium"); /// High relative token cost tier. public static ModelPickerPriceCategory High { get; } = new("high"); /// Highest relative token cost tier. public static ModelPickerPriceCategory VeryHigh { get; } = new("very_high"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ModelPickerPriceCategory left, ModelPickerPriceCategory right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ModelPickerPriceCategory left, ModelPickerPriceCategory right) => !(left == right); /// public override bool Equals(object? obj) => obj is ModelPickerPriceCategory other && Equals(other); /// public bool Equals(ModelPickerPriceCategory 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 ModelPickerPriceCategory Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ModelPickerPriceCategory value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelPickerPriceCategory)); } } } /// Current policy state for this model. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ModelPolicyState : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ModelPolicyState(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The model is enabled by policy. public static ModelPolicyState Enabled { get; } = new("enabled"); /// The model is disabled by policy. public static ModelPolicyState Disabled { get; } = new("disabled"); /// No explicit policy is configured for the model. public static ModelPolicyState Unconfigured { get; } = new("unconfigured"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ModelPolicyState left, ModelPolicyState right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ModelPolicyState left, ModelPolicyState right) => !(left == right); /// public override bool Equals(object? obj) => obj is ModelPolicyState other && Equals(other); /// public bool Equals(ModelPolicyState 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 ModelPolicyState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ModelPolicyState value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelPolicyState)); } } } /// Server transport type: stdio, http, sse (deprecated), or memory. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct DiscoveredMcpServerType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public DiscoveredMcpServerType(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 DiscoveredMcpServerType Stdio { get; } = new("stdio"); /// Server communicates over streamable HTTP. public static DiscoveredMcpServerType Http { get; } = new("http"); /// Server communicates over Server-Sent Events (deprecated). public static DiscoveredMcpServerType Sse { get; } = new("sse"); /// Server is backed by an in-memory runtime implementation. public static DiscoveredMcpServerType Memory { get; } = new("memory"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(DiscoveredMcpServerType left, DiscoveredMcpServerType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(DiscoveredMcpServerType left, DiscoveredMcpServerType right) => !(left == right); /// public override bool Equals(object? obj) => obj is DiscoveredMcpServerType other && Equals(other); /// public bool Equals(DiscoveredMcpServerType 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 DiscoveredMcpServerType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, DiscoveredMcpServerType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(DiscoveredMcpServerType)); } } } /// Which tier this directory belongs to. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SkillDiscoveryScope : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SkillDiscoveryScope(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// A project's repository skill directory. public static SkillDiscoveryScope Project { get; } = new("project"); /// The user's personal Copilot skill directory. public static SkillDiscoveryScope PersonalCopilot { get; } = new("personal-copilot"); /// The user's personal agents skill directory. public static SkillDiscoveryScope PersonalAgents { get; } = new("personal-agents"); /// A configured custom skill directory. public static SkillDiscoveryScope Custom { get; } = new("custom"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SkillDiscoveryScope left, SkillDiscoveryScope right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SkillDiscoveryScope left, SkillDiscoveryScope right) => !(left == right); /// public override bool Equals(object? obj) => obj is SkillDiscoveryScope other && Equals(other); /// public bool Equals(SkillDiscoveryScope 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 SkillDiscoveryScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SkillDiscoveryScope value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SkillDiscoveryScope)); } } } /// Where the agent definition was loaded from. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentInfoSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentInfoSource(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Agent loaded from the user's personal agent configuration. public static AgentInfoSource User { get; } = new("user"); /// Agent loaded from the current project's repository configuration. public static AgentInfoSource Project { get; } = new("project"); /// Agent inherited from a parent project or workspace. public static AgentInfoSource Inherited { get; } = new("inherited"); /// Agent provided by a remote runtime or service. public static AgentInfoSource Remote { get; } = new("remote"); /// Agent contributed by an installed plugin. public static AgentInfoSource Plugin { get; } = new("plugin"); /// Agent built into the Copilot runtime. public static AgentInfoSource Builtin { get; } = new("builtin"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentInfoSource left, AgentInfoSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentInfoSource left, AgentInfoSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentInfoSource other && Equals(other); /// public bool Equals(AgentInfoSource 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 AgentInfoSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentInfoSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentInfoSource)); } } } /// Which tier this directory belongs to. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentDiscoveryPathScope : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentDiscoveryPathScope(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The user's personal agent configuration directory. public static AgentDiscoveryPathScope User { get; } = new("user"); /// A project's repository agent directory. public static AgentDiscoveryPathScope Project { get; } = new("project"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentDiscoveryPathScope left, AgentDiscoveryPathScope right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentDiscoveryPathScope left, AgentDiscoveryPathScope right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentDiscoveryPathScope other && Equals(other); /// public bool Equals(AgentDiscoveryPathScope 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 AgentDiscoveryPathScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentDiscoveryPathScope value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentDiscoveryPathScope)); } } } /// Where this source lives — used for UI grouping. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct InstructionSourceLocation : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public InstructionSourceLocation(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Instructions live in user-level configuration. public static InstructionSourceLocation User { get; } = new("user"); /// Instructions live in repository-level configuration. public static InstructionSourceLocation Repository { get; } = new("repository"); /// Instructions live under the current working directory. public static InstructionSourceLocation WorkingDirectory { get; } = new("working-directory"); /// Instructions live in plugin-provided configuration. public static InstructionSourceLocation Plugin { get; } = new("plugin"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(InstructionSourceLocation left, InstructionSourceLocation right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(InstructionSourceLocation left, InstructionSourceLocation right) => !(left == right); /// public override bool Equals(object? obj) => obj is InstructionSourceLocation other && Equals(other); /// public bool Equals(InstructionSourceLocation 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 InstructionSourceLocation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, InstructionSourceLocation value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(InstructionSourceLocation)); } } } /// Category of instruction source — used for merge logic. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct InstructionSourceType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public InstructionSourceType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Instructions loaded from the user's home configuration. public static InstructionSourceType Home { get; } = new("home"); /// Instructions loaded from repository-scoped files. public static InstructionSourceType Repo { get; } = new("repo"); /// Instructions loaded from model-specific files. public static InstructionSourceType Model { get; } = new("model"); /// Instructions loaded from VS Code instruction files. public static InstructionSourceType Vscode { get; } = new("vscode"); /// Instructions discovered from nested agent files. public static InstructionSourceType NestedAgents { get; } = new("nested-agents"); /// Instructions inherited from child instruction files. public static InstructionSourceType ChildInstructions { get; } = new("child-instructions"); /// Instructions supplied by an installed plugin. public static InstructionSourceType Plugin { get; } = new("plugin"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(InstructionSourceType left, InstructionSourceType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(InstructionSourceType left, InstructionSourceType right) => !(left == right); /// public override bool Equals(object? obj) => obj is InstructionSourceType other && Equals(other); /// public bool Equals(InstructionSourceType 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 InstructionSourceType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, InstructionSourceType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(InstructionSourceType)); } } } /// Whether the target is a single file or a directory of instruction files. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct InstructionDiscoveryPathKind : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public InstructionDiscoveryPathKind(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The target is a single instruction file. public static InstructionDiscoveryPathKind File { get; } = new("file"); /// The target is a directory that holds instruction files. public static InstructionDiscoveryPathKind Directory { get; } = new("directory"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(InstructionDiscoveryPathKind left, InstructionDiscoveryPathKind right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(InstructionDiscoveryPathKind left, InstructionDiscoveryPathKind right) => !(left == right); /// public override bool Equals(object? obj) => obj is InstructionDiscoveryPathKind other && Equals(other); /// public bool Equals(InstructionDiscoveryPathKind 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 InstructionDiscoveryPathKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, InstructionDiscoveryPathKind value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(InstructionDiscoveryPathKind)); } } } /// Which tier this target belongs to. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct InstructionDiscoveryPathLocation : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public InstructionDiscoveryPathLocation(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Instructions live in user-level configuration. public static InstructionDiscoveryPathLocation User { get; } = new("user"); /// Instructions live in repository-level configuration. public static InstructionDiscoveryPathLocation Repository { get; } = new("repository"); /// Instructions live under the current working directory. public static InstructionDiscoveryPathLocation WorkingDirectory { get; } = new("working-directory"); /// Instructions live in plugin-provided configuration. public static InstructionDiscoveryPathLocation Plugin { get; } = new("plugin"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(InstructionDiscoveryPathLocation left, InstructionDiscoveryPathLocation right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(InstructionDiscoveryPathLocation left, InstructionDiscoveryPathLocation right) => !(left == right); /// public override bool Equals(object? obj) => obj is InstructionDiscoveryPathLocation other && Equals(other); /// public bool Equals(InstructionDiscoveryPathLocation 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 InstructionDiscoveryPathLocation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, InstructionDiscoveryPathLocation value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(InstructionDiscoveryPathLocation)); } } } /// Path conventions used by this filesystem. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionFsSetProviderConventions : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionFsSetProviderConventions(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Paths use Windows path conventions. public static SessionFsSetProviderConventions Windows { get; } = new("windows"); /// Paths use POSIX path conventions. public static SessionFsSetProviderConventions Posix { get; } = new("posix"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionFsSetProviderConventions left, SessionFsSetProviderConventions right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionFsSetProviderConventions left, SessionFsSetProviderConventions right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionFsSetProviderConventions other && Equals(other); /// public bool Equals(SessionFsSetProviderConventions 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 SessionFsSetProviderConventions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionFsSetProviderConventions value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsSetProviderConventions)); } } } /// Repository host type. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionContextHostType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionContextHostType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Session repository is hosted on GitHub. public static SessionContextHostType GitHub { get; } = new("github"); /// Session repository is hosted on Azure DevOps. public static SessionContextHostType Ado { get; } = new("ado"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionContextHostType left, SessionContextHostType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionContextHostType left, SessionContextHostType right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionContextHostType other && Equals(other); /// public bool Equals(SessionContextHostType 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 SessionContextHostType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionContextHostType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionContextHostType)); } } } /// Whether the remote task originated from CCA or CLI `--remote`. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct RemoteSessionMetadataTaskType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public RemoteSessionMetadataTaskType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// GitHub Copilot coding agent task. public static RemoteSessionMetadataTaskType Cca { get; } = new("cca"); /// CLI remote task. public static RemoteSessionMetadataTaskType Cli { get; } = new("cli"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(RemoteSessionMetadataTaskType left, RemoteSessionMetadataTaskType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(RemoteSessionMetadataTaskType left, RemoteSessionMetadataTaskType right) => !(left == right); /// public override bool Equals(object? obj) => obj is RemoteSessionMetadataTaskType other && Equals(other); /// public bool Equals(RemoteSessionMetadataTaskType 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 RemoteSessionMetadataTaskType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, RemoteSessionMetadataTaskType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(RemoteSessionMetadataTaskType)); } } } /// Step status. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionsOpenProgressStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionsOpenProgressStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The step has started and has not yet finished. public static SessionsOpenProgressStatus InProgress { get; } = new("in-progress"); /// The step has completed successfully. public static SessionsOpenProgressStatus Complete { get; } = new("complete"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionsOpenProgressStatus left, SessionsOpenProgressStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionsOpenProgressStatus left, SessionsOpenProgressStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionsOpenProgressStatus other && Equals(other); /// public bool Equals(SessionsOpenProgressStatus 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 SessionsOpenProgressStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionsOpenProgressStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionsOpenProgressStatus)); } } } /// Handoff step. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionsOpenProgressStep : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionsOpenProgressStep(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Loading the source session's events from the remote service. public static SessionsOpenProgressStep LoadSession { get; } = new("load-session"); /// Validating that the local repository matches the remote session's repository. public static SessionsOpenProgressStep ValidateRepo { get; } = new("validate-repo"); /// Checking the local working tree for uncommitted changes that would block the handoff. public static SessionsOpenProgressStep CheckChanges { get; } = new("check-changes"); /// Checking out the branch associated with the remote session in the local working tree. public static SessionsOpenProgressStep CheckoutBranch { get; } = new("checkout-branch"); /// Creating the new local session and seeding it with the source session's events. public static SessionsOpenProgressStep CreateSession { get; } = new("create-session"); /// Persisting the newly-created local session to disk. public static SessionsOpenProgressStep SaveSession { get; } = new("save-session"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionsOpenProgressStep left, SessionsOpenProgressStep right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionsOpenProgressStep left, SessionsOpenProgressStep right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionsOpenProgressStep other && Equals(other); /// public bool Equals(SessionsOpenProgressStep 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 SessionsOpenProgressStep Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionsOpenProgressStep value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionsOpenProgressStep)); } } } /// Outcome of the open request. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionsOpenStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionsOpenStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// A new session was created. public static SessionsOpenStatus Created { get; } = new("created"); /// An existing session was loaded or reattached. public static SessionsOpenStatus Resumed { get; } = new("resumed"); /// No matching persisted session was found. public static SessionsOpenStatus NotFound { get; } = new("not_found"); /// Connected to an existing remote session. public static SessionsOpenStatus Connected { get; } = new("connected"); /// Remote session was handed off to a new local session. public static SessionsOpenStatus HandedOff { get; } = new("handed_off"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionsOpenStatus left, SessionsOpenStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionsOpenStatus left, SessionsOpenStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionsOpenStatus other && Equals(other); /// public bool Equals(SessionsOpenStatus 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 SessionsOpenStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionsOpenStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionsOpenStatus)); } } } /// Neutral SDK discriminator for the connected remote session kind. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ConnectedRemoteSessionMetadataKind : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ConnectedRemoteSessionMetadataKind(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Remote CLI session. public static ConnectedRemoteSessionMetadataKind RemoteSession { get; } = new("remote-session"); /// GitHub Copilot coding agent session. public static ConnectedRemoteSessionMetadataKind CodingAgent { get; } = new("coding-agent"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ConnectedRemoteSessionMetadataKind left, ConnectedRemoteSessionMetadataKind right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ConnectedRemoteSessionMetadataKind left, ConnectedRemoteSessionMetadataKind right) => !(left == right); /// public override bool Equals(object? obj) => obj is ConnectedRemoteSessionMetadataKind other && Equals(other); /// public bool Equals(ConnectedRemoteSessionMetadataKind 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 ConnectedRemoteSessionMetadataKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ConnectedRemoteSessionMetadataKind value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ConnectedRemoteSessionMetadataKind)); } } } /// Which session sources to include. Defaults to `local` for backward compatibility. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionSource(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Return only local sessions. public static SessionSource Local { get; } = new("local"); /// Return only remote sessions. public static SessionSource Remote { get; } = new("remote"); /// Return both local and remote sessions. public static SessionSource All { get; } = new("all"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionSource left, SessionSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionSource left, SessionSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionSource other && Equals(other); /// public bool Equals(SessionSource 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 SessionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionSource)); } } } /// Kind of attention required when status === "attention". Meaningful only when status === "attention". [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentRegistryLiveTargetEntryAttentionKind : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentRegistryLiveTargetEntryAttentionKind(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Session is blocked on an unrecoverable error. public static AgentRegistryLiveTargetEntryAttentionKind Error { get; } = new("error"); /// Session is waiting for a tool-permission decision. public static AgentRegistryLiveTargetEntryAttentionKind Permission { get; } = new("permission"); /// Session is waiting for the user to approve or reject a plan. public static AgentRegistryLiveTargetEntryAttentionKind ExitPlan { get; } = new("exit_plan"); /// Session is waiting on an elicitation prompt. public static AgentRegistryLiveTargetEntryAttentionKind Elicitation { get; } = new("elicitation"); /// Session is waiting for free-form user input. public static AgentRegistryLiveTargetEntryAttentionKind UserInput { get; } = new("user_input"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentRegistryLiveTargetEntryAttentionKind left, AgentRegistryLiveTargetEntryAttentionKind right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentRegistryLiveTargetEntryAttentionKind left, AgentRegistryLiveTargetEntryAttentionKind right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentRegistryLiveTargetEntryAttentionKind other && Equals(other); /// public bool Equals(AgentRegistryLiveTargetEntryAttentionKind 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 AgentRegistryLiveTargetEntryAttentionKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentRegistryLiveTargetEntryAttentionKind value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentRegistryLiveTargetEntryAttentionKind)); } } } /// Process kind tag for the registry entry. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentRegistryLiveTargetEntryKind : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentRegistryLiveTargetEntryKind(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Interactive Copilot CLI exposing a UI server (legacy/normal CLI process). public static AgentRegistryLiveTargetEntryKind UiServer { get; } = new("ui-server"); /// Headless `--server --managed-server` child spawned by a controller. public static AgentRegistryLiveTargetEntryKind ManagedServer { get; } = new("managed-server"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentRegistryLiveTargetEntryKind left, AgentRegistryLiveTargetEntryKind right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentRegistryLiveTargetEntryKind left, AgentRegistryLiveTargetEntryKind right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentRegistryLiveTargetEntryKind other && Equals(other); /// public bool Equals(AgentRegistryLiveTargetEntryKind 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 AgentRegistryLiveTargetEntryKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentRegistryLiveTargetEntryKind value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentRegistryLiveTargetEntryKind)); } } } /// How the most recent turn ended (clean vs aborted). Lets the renderer distinguish done from done_cancelled. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentRegistryLiveTargetEntryLastTerminalEvent : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentRegistryLiveTargetEntryLastTerminalEvent(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Last turn ended cleanly (model returned a final assistant message). public static AgentRegistryLiveTargetEntryLastTerminalEvent TurnEnd { get; } = new("turn_end"); /// Last turn was aborted (e.g. user interrupted). public static AgentRegistryLiveTargetEntryLastTerminalEvent Abort { get; } = new("abort"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentRegistryLiveTargetEntryLastTerminalEvent left, AgentRegistryLiveTargetEntryLastTerminalEvent right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentRegistryLiveTargetEntryLastTerminalEvent left, AgentRegistryLiveTargetEntryLastTerminalEvent right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentRegistryLiveTargetEntryLastTerminalEvent other && Equals(other); /// public bool Equals(AgentRegistryLiveTargetEntryLastTerminalEvent 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 AgentRegistryLiveTargetEntryLastTerminalEvent Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentRegistryLiveTargetEntryLastTerminalEvent value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentRegistryLiveTargetEntryLastTerminalEvent)); } } } /// Coarse lifecycle status of the foreground session. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentRegistryLiveTargetEntryStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentRegistryLiveTargetEntryStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Session is actively processing a turn. public static AgentRegistryLiveTargetEntryStatus Working { get; } = new("working"); /// Session is idle, waiting for input. public static AgentRegistryLiveTargetEntryStatus Waiting { get; } = new("waiting"); /// Last turn completed successfully. public static AgentRegistryLiveTargetEntryStatus Done { get; } = new("done"); /// Session needs user attention (see attentionKind for the specific reason). public static AgentRegistryLiveTargetEntryStatus Attention { get; } = new("attention"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentRegistryLiveTargetEntryStatus left, AgentRegistryLiveTargetEntryStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentRegistryLiveTargetEntryStatus left, AgentRegistryLiveTargetEntryStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentRegistryLiveTargetEntryStatus other && Equals(other); /// public bool Equals(AgentRegistryLiveTargetEntryStatus 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 AgentRegistryLiveTargetEntryStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentRegistryLiveTargetEntryStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentRegistryLiveTargetEntryStatus)); } } } /// Categorized reason for log-open failure. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentRegistryLogCaptureOpenErrorReason : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentRegistryLogCaptureOpenErrorReason(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Filesystem permission denied opening the log file. public static AgentRegistryLogCaptureOpenErrorReason Permission { get; } = new("permission"); /// No space left on device. public static AgentRegistryLogCaptureOpenErrorReason DiskFull { get; } = new("disk_full"); /// Other / uncategorized open failure. public static AgentRegistryLogCaptureOpenErrorReason Other { get; } = new("other"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentRegistryLogCaptureOpenErrorReason left, AgentRegistryLogCaptureOpenErrorReason right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentRegistryLogCaptureOpenErrorReason left, AgentRegistryLogCaptureOpenErrorReason right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentRegistryLogCaptureOpenErrorReason other && Equals(other); /// public bool Equals(AgentRegistryLogCaptureOpenErrorReason 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 AgentRegistryLogCaptureOpenErrorReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentRegistryLogCaptureOpenErrorReason value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentRegistryLogCaptureOpenErrorReason)); } } } /// Which parameter field was invalid. Omitted when the rejection is not field-specific. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentRegistrySpawnValidationErrorField : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentRegistrySpawnValidationErrorField(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The cwd parameter. public static AgentRegistrySpawnValidationErrorField Cwd { get; } = new("cwd"); /// The session name parameter. public static AgentRegistrySpawnValidationErrorField Name { get; } = new("name"); /// The agentName parameter. public static AgentRegistrySpawnValidationErrorField AgentName { get; } = new("agentName"); /// The model parameter. public static AgentRegistrySpawnValidationErrorField Model { get; } = new("model"); /// The permissionMode parameter. public static AgentRegistrySpawnValidationErrorField PermissionMode { get; } = new("permissionMode"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentRegistrySpawnValidationErrorField left, AgentRegistrySpawnValidationErrorField right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentRegistrySpawnValidationErrorField left, AgentRegistrySpawnValidationErrorField right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentRegistrySpawnValidationErrorField other && Equals(other); /// public bool Equals(AgentRegistrySpawnValidationErrorField 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 AgentRegistrySpawnValidationErrorField Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentRegistrySpawnValidationErrorField value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentRegistrySpawnValidationErrorField)); } } } /// Categorized reason for the rejection. Low-cardinality enum so telemetry can aggregate by reason without leaking raw paths or agent/model names. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentRegistrySpawnValidationErrorReason : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentRegistrySpawnValidationErrorReason(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Provided cwd does not exist on disk. public static AgentRegistrySpawnValidationErrorReason CwdNotFound { get; } = new("cwd-not-found"); /// Provided cwd exists but is not a directory. public static AgentRegistrySpawnValidationErrorReason CwdNotDirectory { get; } = new("cwd-not-directory"); /// Session name failed validateSessionName. public static AgentRegistrySpawnValidationErrorReason InvalidName { get; } = new("invalid-name"); /// Requested agent name was not found in builtin or custom agents. public static AgentRegistrySpawnValidationErrorReason UnknownAgent { get; } = new("unknown-agent"); /// Requested model is not available to this session. public static AgentRegistrySpawnValidationErrorReason UnknownModel { get; } = new("unknown-model"); /// Caller asked for permissionMode='yolo' but the controller is not currently in allow-all mode. public static AgentRegistrySpawnValidationErrorReason YoloNotAllowed { get; } = new("yolo-not-allowed"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentRegistrySpawnValidationErrorReason left, AgentRegistrySpawnValidationErrorReason right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentRegistrySpawnValidationErrorReason left, AgentRegistrySpawnValidationErrorReason right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentRegistrySpawnValidationErrorReason other && Equals(other); /// public bool Equals(AgentRegistrySpawnValidationErrorReason 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 AgentRegistrySpawnValidationErrorReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentRegistrySpawnValidationErrorReason value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentRegistrySpawnValidationErrorReason)); } } } /// Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AgentRegistrySpawnPermissionMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AgentRegistrySpawnPermissionMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Standard permission posture (prompts for each request). public static AgentRegistrySpawnPermissionMode Default { get; } = new("default"); /// Full allow-all (requires the controller-local session to currently be in allow-all mode). public static AgentRegistrySpawnPermissionMode Yolo { get; } = new("yolo"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AgentRegistrySpawnPermissionMode left, AgentRegistrySpawnPermissionMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AgentRegistrySpawnPermissionMode left, AgentRegistrySpawnPermissionMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is AgentRegistrySpawnPermissionMode other && Equals(other); /// public bool Equals(AgentRegistrySpawnPermissionMode 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 AgentRegistrySpawnPermissionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AgentRegistrySpawnPermissionMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AgentRegistrySpawnPermissionMode)); } } } /// The UI mode the agent was in when this message was sent. Defaults to the session's current mode. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SendAgentMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SendAgentMode(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 SendAgentMode Interactive { get; } = new("interactive"); /// The agent is preparing a plan before making changes. public static SendAgentMode Plan { get; } = new("plan"); /// The agent is working autonomously toward task completion. public static SendAgentMode Autopilot { get; } = new("autopilot"); /// The agent is in shell-focused UI mode. public static SendAgentMode Shell { get; } = new("shell"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SendAgentMode left, SendAgentMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SendAgentMode left, SendAgentMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is SendAgentMode other && Equals(other); /// public bool Equals(SendAgentMode 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 SendAgentMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SendAgentMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SendAgentMode)); } } } /// How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SendMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SendMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Append the message to the normal session queue. public static SendMode Enqueue { get; } = new("enqueue"); /// Interject the message during the in-progress turn. public static SendMode Immediate { get; } = new("immediate"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SendMode left, SendMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SendMode left, SendMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is SendMode other && Equals(other); /// public bool Equals(SendMode 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 SendMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SendMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SendMode)); } } } /// Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionLogLevel : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionLogLevel(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Informational message. public static SessionLogLevel Info { get; } = new("info"); /// Warning message that may require attention. public static SessionLogLevel Warning { get; } = new("warning"); /// Error message describing a failure. public static SessionLogLevel Error { get; } = new("error"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionLogLevel left, SessionLogLevel right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionLogLevel left, SessionLogLevel right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionLogLevel other && Equals(other); /// public bool Equals(SessionLogLevel 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 SessionLogLevel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionLogLevel value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionLogLevel)); } } } /// Authentication type. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct AuthInfoType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public AuthInfoType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Authentication provided by a GitHub App HMAC credential. public static AuthInfoType Hmac { get; } = new("hmac"); /// Authentication resolved from environment-provided credentials. public static AuthInfoType Env { get; } = new("env"); /// Authentication from an interactive user sign-in. public static AuthInfoType User { get; } = new("user"); /// Authentication delegated to the GitHub CLI. public static AuthInfoType GhCli { get; } = new("gh-cli"); /// Authentication from an API key credential. public static AuthInfoType ApiKey { get; } = new("api-key"); /// Authentication from a GitHub token. public static AuthInfoType Token { get; } = new("token"); /// Authentication from a Copilot API token. public static AuthInfoType CopilotApiToken { get; } = new("copilot-api-token"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(AuthInfoType left, AuthInfoType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(AuthInfoType left, AuthInfoType right) => !(left == right); /// public override bool Equals(object? obj) => obj is AuthInfoType other && Equals(other); /// public bool Equals(AuthInfoType 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 AuthInfoType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, AuthInfoType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(AuthInfoType)); } } } /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct WorkspacesWorkspaceDetailsHostType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public WorkspacesWorkspaceDetailsHostType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Workspace repository is hosted on GitHub. public static WorkspacesWorkspaceDetailsHostType GitHub { get; } = new("github"); /// Workspace repository is hosted on Azure DevOps. public static WorkspacesWorkspaceDetailsHostType Ado { get; } = new("ado"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(WorkspacesWorkspaceDetailsHostType left, WorkspacesWorkspaceDetailsHostType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(WorkspacesWorkspaceDetailsHostType left, WorkspacesWorkspaceDetailsHostType right) => !(left == right); /// public override bool Equals(object? obj) => obj is WorkspacesWorkspaceDetailsHostType other && Equals(other); /// public bool Equals(WorkspacesWorkspaceDetailsHostType 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 WorkspacesWorkspaceDetailsHostType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, WorkspacesWorkspaceDetailsHostType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(WorkspacesWorkspaceDetailsHostType)); } } } /// Type of change represented by this file diff. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct WorkspaceDiffFileChangeType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public WorkspaceDiffFileChangeType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The file was added. public static WorkspaceDiffFileChangeType Added { get; } = new("added"); /// The file was modified. public static WorkspaceDiffFileChangeType Modified { get; } = new("modified"); /// The file was deleted. public static WorkspaceDiffFileChangeType Deleted { get; } = new("deleted"); /// The file was renamed. public static WorkspaceDiffFileChangeType Renamed { get; } = new("renamed"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(WorkspaceDiffFileChangeType left, WorkspaceDiffFileChangeType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(WorkspaceDiffFileChangeType left, WorkspaceDiffFileChangeType right) => !(left == right); /// public override bool Equals(object? obj) => obj is WorkspaceDiffFileChangeType other && Equals(other); /// public bool Equals(WorkspaceDiffFileChangeType 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 WorkspaceDiffFileChangeType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, WorkspaceDiffFileChangeType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(WorkspaceDiffFileChangeType)); } } } /// Diff mode requested by the client. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct WorkspaceDiffMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public WorkspaceDiffMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Return staged, unstaged, and untracked working tree changes. public static WorkspaceDiffMode Unstaged { get; } = new("unstaged"); /// Return changes compared with the default branch. public static WorkspaceDiffMode Branch { get; } = new("branch"); /// Return the cumulative diff of files Copilot changed this session (used in non-git workspaces). public static WorkspaceDiffMode Session { get; } = new("session"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(WorkspaceDiffMode left, WorkspaceDiffMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(WorkspaceDiffMode left, WorkspaceDiffMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is WorkspaceDiffMode other && Equals(other); /// public bool Equals(WorkspaceDiffMode 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 WorkspaceDiffMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, WorkspaceDiffMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(WorkspaceDiffMode)); } } } /// Whether task execution is synchronously awaited or managed in the background. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct TaskExecutionMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public TaskExecutionMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The task was started with synchronous waiting. public static TaskExecutionMode Sync { get; } = new("sync"); /// The task is managed in the background. public static TaskExecutionMode Background { get; } = new("background"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(TaskExecutionMode left, TaskExecutionMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(TaskExecutionMode left, TaskExecutionMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is TaskExecutionMode other && Equals(other); /// public bool Equals(TaskExecutionMode 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 TaskExecutionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, TaskExecutionMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskExecutionMode)); } } } /// Current lifecycle status of the task. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct TaskStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public TaskStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The task is actively executing. public static TaskStatus Running { get; } = new("running"); /// The task is waiting for additional input. public static TaskStatus Idle { get; } = new("idle"); /// The task finished successfully. public static TaskStatus Completed { get; } = new("completed"); /// The task finished with an error. public static TaskStatus Failed { get; } = new("failed"); /// The task was cancelled before completion. public static TaskStatus Cancelled { get; } = new("cancelled"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(TaskStatus left, TaskStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(TaskStatus left, TaskStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is TaskStatus other && Equals(other); /// public bool Equals(TaskStatus 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 TaskStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, TaskStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskStatus)); } } } /// Whether the shell runs inside a managed PTY session or as an independent background process. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct TaskShellInfoAttachmentMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public TaskShellInfoAttachmentMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The shell runs in a managed PTY session. public static TaskShellInfoAttachmentMode Attached { get; } = new("attached"); /// The shell runs as an independent background process. public static TaskShellInfoAttachmentMode Detached { get; } = new("detached"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(TaskShellInfoAttachmentMode left, TaskShellInfoAttachmentMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(TaskShellInfoAttachmentMode left, TaskShellInfoAttachmentMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is TaskShellInfoAttachmentMode other && Equals(other); /// public bool Equals(TaskShellInfoAttachmentMode 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 TaskShellInfoAttachmentMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, TaskShellInfoAttachmentMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(TaskShellInfoAttachmentMode)); } } } /// Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpSamplingExecutionAction : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpSamplingExecutionAction(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The sampling inference completed and produced a result. public static McpSamplingExecutionAction Success { get; } = new("success"); /// The sampling inference failed or was rejected. public static McpSamplingExecutionAction Failure { get; } = new("failure"); /// The sampling inference was cancelled before completion. public static McpSamplingExecutionAction Cancelled { get; } = new("cancelled"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpSamplingExecutionAction left, McpSamplingExecutionAction right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpSamplingExecutionAction left, McpSamplingExecutionAction right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpSamplingExecutionAction other && Equals(other); /// public bool Equals(McpSamplingExecutionAction 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 McpSamplingExecutionAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpSamplingExecutionAction value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpSamplingExecutionAction)); } } } /// How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct". [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpSetEnvValueModeDetails : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpSetEnvValueModeDetails(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Treat MCP server environment values as literal strings. public static McpSetEnvValueModeDetails Direct { get; } = new("direct"); /// Treat MCP server environment values as host-side references to resolve before launch. public static McpSetEnvValueModeDetails Indirect { get; } = new("indirect"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpSetEnvValueModeDetails left, McpSetEnvValueModeDetails right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpSetEnvValueModeDetails left, McpSetEnvValueModeDetails right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpSetEnvValueModeDetails other && Equals(other); /// public bool Equals(McpSetEnvValueModeDetails 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 McpSetEnvValueModeDetails Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpSetEnvValueModeDetails value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpSetEnvValueModeDetails)); } } } /// OAuth grant type override for this login. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpOauthLoginGrantType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpOauthLoginGrantType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Interactive browser-based OAuth flow using an authorization code, typically with PKCE. public static McpOauthLoginGrantType AuthorizationCode { get; } = new("authorization_code"); /// Headless OAuth flow where a confidential client authenticates directly with a client secret. public static McpOauthLoginGrantType ClientCredentials { get; } = new("client_credentials"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpOauthLoginGrantType left, McpOauthLoginGrantType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpOauthLoginGrantType left, McpOauthLoginGrantType right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpOauthLoginGrantType other && Equals(other); /// public bool Equals(McpOauthLoginGrantType 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 McpOauthLoginGrantType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpOauthLoginGrantType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpOauthLoginGrantType)); } } } /// Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpAppsSetHostContextDetailsAvailableDisplayMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpAppsSetHostContextDetailsAvailableDisplayMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Rendered inline within the host conversation surface. public static McpAppsSetHostContextDetailsAvailableDisplayMode Inline { get; } = new("inline"); /// Rendered as a fullscreen overlay. public static McpAppsSetHostContextDetailsAvailableDisplayMode Fullscreen { get; } = new("fullscreen"); /// Rendered as a picture-in-picture floating panel. public static McpAppsSetHostContextDetailsAvailableDisplayMode Pip { get; } = new("pip"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpAppsSetHostContextDetailsAvailableDisplayMode left, McpAppsSetHostContextDetailsAvailableDisplayMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpAppsSetHostContextDetailsAvailableDisplayMode left, McpAppsSetHostContextDetailsAvailableDisplayMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpAppsSetHostContextDetailsAvailableDisplayMode other && Equals(other); /// public bool Equals(McpAppsSetHostContextDetailsAvailableDisplayMode 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 McpAppsSetHostContextDetailsAvailableDisplayMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpAppsSetHostContextDetailsAvailableDisplayMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsSetHostContextDetailsAvailableDisplayMode)); } } } /// Current display mode (SEP-1865). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpAppsSetHostContextDetailsDisplayMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpAppsSetHostContextDetailsDisplayMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Rendered inline within the host conversation surface. public static McpAppsSetHostContextDetailsDisplayMode Inline { get; } = new("inline"); /// Rendered as a fullscreen overlay. public static McpAppsSetHostContextDetailsDisplayMode Fullscreen { get; } = new("fullscreen"); /// Rendered as a picture-in-picture floating panel. public static McpAppsSetHostContextDetailsDisplayMode Pip { get; } = new("pip"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpAppsSetHostContextDetailsDisplayMode left, McpAppsSetHostContextDetailsDisplayMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpAppsSetHostContextDetailsDisplayMode left, McpAppsSetHostContextDetailsDisplayMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpAppsSetHostContextDetailsDisplayMode other && Equals(other); /// public bool Equals(McpAppsSetHostContextDetailsDisplayMode 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 McpAppsSetHostContextDetailsDisplayMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpAppsSetHostContextDetailsDisplayMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsSetHostContextDetailsDisplayMode)); } } } /// Platform type for responsive design. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpAppsSetHostContextDetailsPlatform : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpAppsSetHostContextDetailsPlatform(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Host runs in a web browser. public static McpAppsSetHostContextDetailsPlatform Web { get; } = new("web"); /// Host runs as a desktop application. public static McpAppsSetHostContextDetailsPlatform Desktop { get; } = new("desktop"); /// Host runs on a mobile device. public static McpAppsSetHostContextDetailsPlatform Mobile { get; } = new("mobile"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpAppsSetHostContextDetailsPlatform left, McpAppsSetHostContextDetailsPlatform right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpAppsSetHostContextDetailsPlatform left, McpAppsSetHostContextDetailsPlatform right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpAppsSetHostContextDetailsPlatform other && Equals(other); /// public bool Equals(McpAppsSetHostContextDetailsPlatform 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 McpAppsSetHostContextDetailsPlatform Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpAppsSetHostContextDetailsPlatform value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsSetHostContextDetailsPlatform)); } } } /// UI theme preference per SEP-1865. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpAppsSetHostContextDetailsTheme : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpAppsSetHostContextDetailsTheme(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Light UI theme. public static McpAppsSetHostContextDetailsTheme Light { get; } = new("light"); /// Dark UI theme. public static McpAppsSetHostContextDetailsTheme Dark { get; } = new("dark"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpAppsSetHostContextDetailsTheme left, McpAppsSetHostContextDetailsTheme right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpAppsSetHostContextDetailsTheme left, McpAppsSetHostContextDetailsTheme right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpAppsSetHostContextDetailsTheme other && Equals(other); /// public bool Equals(McpAppsSetHostContextDetailsTheme 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 McpAppsSetHostContextDetailsTheme Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpAppsSetHostContextDetailsTheme value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsSetHostContextDetailsTheme)); } } } /// Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpAppsHostContextDetailsAvailableDisplayMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpAppsHostContextDetailsAvailableDisplayMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Rendered inline within the host conversation surface. public static McpAppsHostContextDetailsAvailableDisplayMode Inline { get; } = new("inline"); /// Rendered as a fullscreen overlay. public static McpAppsHostContextDetailsAvailableDisplayMode Fullscreen { get; } = new("fullscreen"); /// Rendered as a picture-in-picture floating panel. public static McpAppsHostContextDetailsAvailableDisplayMode Pip { get; } = new("pip"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpAppsHostContextDetailsAvailableDisplayMode left, McpAppsHostContextDetailsAvailableDisplayMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpAppsHostContextDetailsAvailableDisplayMode left, McpAppsHostContextDetailsAvailableDisplayMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpAppsHostContextDetailsAvailableDisplayMode other && Equals(other); /// public bool Equals(McpAppsHostContextDetailsAvailableDisplayMode 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 McpAppsHostContextDetailsAvailableDisplayMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpAppsHostContextDetailsAvailableDisplayMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsHostContextDetailsAvailableDisplayMode)); } } } /// Current display mode (SEP-1865). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpAppsHostContextDetailsDisplayMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpAppsHostContextDetailsDisplayMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Rendered inline within the host conversation surface. public static McpAppsHostContextDetailsDisplayMode Inline { get; } = new("inline"); /// Rendered as a fullscreen overlay. public static McpAppsHostContextDetailsDisplayMode Fullscreen { get; } = new("fullscreen"); /// Rendered as a picture-in-picture floating panel. public static McpAppsHostContextDetailsDisplayMode Pip { get; } = new("pip"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpAppsHostContextDetailsDisplayMode left, McpAppsHostContextDetailsDisplayMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpAppsHostContextDetailsDisplayMode left, McpAppsHostContextDetailsDisplayMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpAppsHostContextDetailsDisplayMode other && Equals(other); /// public bool Equals(McpAppsHostContextDetailsDisplayMode 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 McpAppsHostContextDetailsDisplayMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpAppsHostContextDetailsDisplayMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsHostContextDetailsDisplayMode)); } } } /// Platform type for responsive design. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpAppsHostContextDetailsPlatform : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpAppsHostContextDetailsPlatform(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Host runs in a web browser. public static McpAppsHostContextDetailsPlatform Web { get; } = new("web"); /// Host runs as a desktop application. public static McpAppsHostContextDetailsPlatform Desktop { get; } = new("desktop"); /// Host runs on a mobile device. public static McpAppsHostContextDetailsPlatform Mobile { get; } = new("mobile"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpAppsHostContextDetailsPlatform left, McpAppsHostContextDetailsPlatform right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpAppsHostContextDetailsPlatform left, McpAppsHostContextDetailsPlatform right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpAppsHostContextDetailsPlatform other && Equals(other); /// public bool Equals(McpAppsHostContextDetailsPlatform 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 McpAppsHostContextDetailsPlatform Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpAppsHostContextDetailsPlatform value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsHostContextDetailsPlatform)); } } } /// UI theme preference per SEP-1865. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct McpAppsHostContextDetailsTheme : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public McpAppsHostContextDetailsTheme(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Light UI theme. public static McpAppsHostContextDetailsTheme Light { get; } = new("light"); /// Dark UI theme. public static McpAppsHostContextDetailsTheme Dark { get; } = new("dark"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(McpAppsHostContextDetailsTheme left, McpAppsHostContextDetailsTheme right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(McpAppsHostContextDetailsTheme left, McpAppsHostContextDetailsTheme right) => !(left == right); /// public override bool Equals(object? obj) => obj is McpAppsHostContextDetailsTheme other && Equals(other); /// public bool Equals(McpAppsHostContextDetailsTheme 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 McpAppsHostContextDetailsTheme Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, McpAppsHostContextDetailsTheme value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsHostContextDetailsTheme)); } } } /// Transport to be used for provider requests. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ProviderEndpointTransport : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ProviderEndpointTransport(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// HTTP request/streaming transport. public static ProviderEndpointTransport Http { get; } = new("http"); /// WebSocket transport. public static ProviderEndpointTransport Websockets { get; } = new("websockets"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ProviderEndpointTransport left, ProviderEndpointTransport right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ProviderEndpointTransport left, ProviderEndpointTransport right) => !(left == right); /// public override bool Equals(object? obj) => obj is ProviderEndpointTransport other && Equals(other); /// public bool Equals(ProviderEndpointTransport 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 ProviderEndpointTransport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ProviderEndpointTransport value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ProviderEndpointTransport)); } } } /// Provider family. Matches the `type` field of a BYOK provider config. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ProviderEndpointType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ProviderEndpointType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// OpenAI-compatible endpoint (use the OpenAI client library). public static ProviderEndpointType Openai { get; } = new("openai"); /// Azure OpenAI endpoint (use the OpenAI client library with the Azure base URL). public static ProviderEndpointType Azure { get; } = new("azure"); /// Anthropic endpoint (use the Anthropic client library). public static ProviderEndpointType Anthropic { get; } = new("anthropic"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ProviderEndpointType left, ProviderEndpointType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ProviderEndpointType left, ProviderEndpointType right) => !(left == right); /// public override bool Equals(object? obj) => obj is ProviderEndpointType other && Equals(other); /// public bool Equals(ProviderEndpointType 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 ProviderEndpointType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ProviderEndpointType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ProviderEndpointType)); } } } /// Wire API to be used, when required for the provider type. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ProviderEndpointWireApi : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ProviderEndpointWireApi(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Classic chat-completions request shape. public static ProviderEndpointWireApi Completions { get; } = new("completions"); /// Newer responses request shape. public static ProviderEndpointWireApi Responses { get; } = new("responses"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ProviderEndpointWireApi left, ProviderEndpointWireApi right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ProviderEndpointWireApi left, ProviderEndpointWireApi right) => !(left == right); /// public override bool Equals(object? obj) => obj is ProviderEndpointWireApi other && Equals(other); /// public bool Equals(ProviderEndpointWireApi 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 ProviderEndpointWireApi Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ProviderEndpointWireApi value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ProviderEndpointWireApi)); } } } /// Provider transport. Defaults to "http". [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ProviderConfigTransport : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ProviderConfigTransport(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// HTTP request/streaming transport. public static ProviderConfigTransport Http { get; } = new("http"); /// WebSocket transport. public static ProviderConfigTransport Websockets { get; } = new("websockets"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ProviderConfigTransport left, ProviderConfigTransport right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ProviderConfigTransport left, ProviderConfigTransport right) => !(left == right); /// public override bool Equals(object? obj) => obj is ProviderConfigTransport other && Equals(other); /// public bool Equals(ProviderConfigTransport 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 ProviderConfigTransport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ProviderConfigTransport value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ProviderConfigTransport)); } } } /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ProviderConfigType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ProviderConfigType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Generic OpenAI-compatible API. public static ProviderConfigType Openai { get; } = new("openai"); /// Azure OpenAI Service endpoint. public static ProviderConfigType Azure { get; } = new("azure"); /// Anthropic API endpoint. public static ProviderConfigType Anthropic { get; } = new("anthropic"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ProviderConfigType left, ProviderConfigType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ProviderConfigType left, ProviderConfigType right) => !(left == right); /// public override bool Equals(object? obj) => obj is ProviderConfigType other && Equals(other); /// public bool Equals(ProviderConfigType 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 ProviderConfigType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ProviderConfigType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ProviderConfigType)); } } } /// Wire API format (openai/azure only). Defaults to "completions". [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ProviderConfigWireApi : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ProviderConfigWireApi(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// OpenAI Chat Completions wire format. public static ProviderConfigWireApi Completions { get; } = new("completions"); /// OpenAI Responses API wire format. public static ProviderConfigWireApi Responses { get; } = new("responses"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ProviderConfigWireApi left, ProviderConfigWireApi right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ProviderConfigWireApi left, ProviderConfigWireApi right) => !(left == right); /// public override bool Equals(object? obj) => obj is ProviderConfigWireApi other && Equals(other); /// public bool Equals(ProviderConfigWireApi 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 ProviderConfigWireApi Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ProviderConfigWireApi value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ProviderConfigWireApi)); } } } /// Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct OptionsUpdateAdditionalContentExclusionPolicyScope : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public OptionsUpdateAdditionalContentExclusionPolicyScope(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The content exclusion policy applies to the current repository. public static OptionsUpdateAdditionalContentExclusionPolicyScope Repo { get; } = new("repo"); /// The content exclusion policy applies across all repositories. public static OptionsUpdateAdditionalContentExclusionPolicyScope All { get; } = new("all"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(OptionsUpdateAdditionalContentExclusionPolicyScope left, OptionsUpdateAdditionalContentExclusionPolicyScope right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(OptionsUpdateAdditionalContentExclusionPolicyScope left, OptionsUpdateAdditionalContentExclusionPolicyScope right) => !(left == right); /// public override bool Equals(object? obj) => obj is OptionsUpdateAdditionalContentExclusionPolicyScope other && Equals(other); /// public bool Equals(OptionsUpdateAdditionalContentExclusionPolicyScope 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 OptionsUpdateAdditionalContentExclusionPolicyScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, OptionsUpdateAdditionalContentExclusionPolicyScope value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OptionsUpdateAdditionalContentExclusionPolicyScope)); } } } /// Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct OptionsUpdateContextTier : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public OptionsUpdateContextTier(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Use the model's default context tier and its standard token limits / pricing. public static OptionsUpdateContextTier Default { get; } = new("default"); /// Use the model's long-context tier (when available) so larger inputs are accepted and tier-specific pricing applies. public static OptionsUpdateContextTier LongContext { get; } = new("long_context"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(OptionsUpdateContextTier left, OptionsUpdateContextTier right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(OptionsUpdateContextTier left, OptionsUpdateContextTier right) => !(left == right); /// public override bool Equals(object? obj) => obj is OptionsUpdateContextTier other && Equals(other); /// public bool Equals(OptionsUpdateContextTier 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 OptionsUpdateContextTier Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, OptionsUpdateContextTier value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OptionsUpdateContextTier)); } } } /// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct OptionsUpdateEnvValueMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public OptionsUpdateEnvValueMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Pass MCP server environment values as literal strings. public static OptionsUpdateEnvValueMode Direct { get; } = new("direct"); /// Resolve MCP server environment values from host-side references. public static OptionsUpdateEnvValueMode Indirect { get; } = new("indirect"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(OptionsUpdateEnvValueMode left, OptionsUpdateEnvValueMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(OptionsUpdateEnvValueMode left, OptionsUpdateEnvValueMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is OptionsUpdateEnvValueMode other && Equals(other); /// public bool Equals(OptionsUpdateEnvValueMode 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 OptionsUpdateEnvValueMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, OptionsUpdateEnvValueMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OptionsUpdateEnvValueMode)); } } } /// Reasoning summary mode for supported model clients. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct OptionsUpdateReasoningSummary : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public OptionsUpdateReasoningSummary(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 OptionsUpdateReasoningSummary None { get; } = new("none"); /// Request a concise summary of model reasoning. public static OptionsUpdateReasoningSummary Concise { get; } = new("concise"); /// Request a detailed summary of model reasoning. public static OptionsUpdateReasoningSummary Detailed { get; } = new("detailed"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(OptionsUpdateReasoningSummary left, OptionsUpdateReasoningSummary right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(OptionsUpdateReasoningSummary left, OptionsUpdateReasoningSummary right) => !(left == right); /// public override bool Equals(object? obj) => obj is OptionsUpdateReasoningSummary other && Equals(other); /// public bool Equals(OptionsUpdateReasoningSummary 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 OptionsUpdateReasoningSummary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, OptionsUpdateReasoningSummary value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OptionsUpdateReasoningSummary)); } } } /// Session capability enabled for this session. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionCapability : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionCapability(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// TUI-specific prompt hints such as keyboard shortcuts. public static SessionCapability TuiHints { get; } = new("tui-hints"); /// Plan-mode handling and instructions. public static SessionCapability PlanMode { get; } = new("plan-mode"); /// Memory tool and memories prompt section. public static SessionCapability Memory { get; } = new("memory"); /// Copilot CLI documentation tool and prompt section. public static SessionCapability CliDocumentation { get; } = new("cli-documentation"); /// Interactive ask_user tool support. public static SessionCapability AskUser { get; } = new("ask-user"); /// Interactive CLI identity and behavior. public static SessionCapability InteractiveMode { get; } = new("interactive-mode"); /// Automatic hidden system notifications. public static SessionCapability SystemNotifications { get; } = new("system-notifications"); /// SDK elicitation support. public static SessionCapability Elicitation { get; } = new("elicitation"); /// Cross-session history tools and session-store SQL prompt/tool metadata. public static SessionCapability SessionStore { get; } = new("session-store"); /// MCP Apps UI passthrough. public static SessionCapability McpApps { get; } = new("mcp-apps"); /// Host-provided canvas rendering support. public static SessionCapability CanvasRenderer { get; } = new("canvas-renderer"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionCapability left, SessionCapability right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionCapability left, SessionCapability right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionCapability other && Equals(other); /// public bool Equals(SessionCapability 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 SessionCapability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionCapability value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionCapability)); } } } /// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct OptionsUpdateToolFilterPrecedence : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public OptionsUpdateToolFilterPrecedence(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// If availableTools is set, it is the only constraint that applies (excludedTools is ignored). Preserves CLI / pre-existing client behavior. Default. public static OptionsUpdateToolFilterPrecedence Available { get; } = new("available"); /// A tool is enabled if and only if it matches the allowlist (or the allowlist is unset) AND it does not match the denylist. Makes 'all except X' expressible by combining the two lists. public static OptionsUpdateToolFilterPrecedence Excluded { get; } = new("excluded"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(OptionsUpdateToolFilterPrecedence left, OptionsUpdateToolFilterPrecedence right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(OptionsUpdateToolFilterPrecedence left, OptionsUpdateToolFilterPrecedence right) => !(left == right); /// public override bool Equals(object? obj) => obj is OptionsUpdateToolFilterPrecedence other && Equals(other); /// public bool Equals(OptionsUpdateToolFilterPrecedence 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 OptionsUpdateToolFilterPrecedence Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, OptionsUpdateToolFilterPrecedence value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OptionsUpdateToolFilterPrecedence)); } } } /// Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state/<id>/extensions/). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ExtensionSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ExtensionSource(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's .github/extensions directory. public static ExtensionSource Project { get; } = new("project"); /// Extension discovered from the user's ~/.copilot/extensions directory. public static ExtensionSource User { get; } = new("user"); /// Extension contributed by an installed plugin. public static ExtensionSource Plugin { get; } = new("plugin"); /// Extension discovered from the current session's state directory (loaded only for this session). public static ExtensionSource Session { get; } = new("session"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ExtensionSource left, ExtensionSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ExtensionSource left, ExtensionSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is ExtensionSource other && Equals(other); /// public bool Equals(ExtensionSource 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 ExtensionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ExtensionSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExtensionSource)); } } } /// Current status: running, disabled, failed, or starting. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ExtensionStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ExtensionStatus(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 ExtensionStatus Running { get; } = new("running"); /// The extension is installed but disabled. public static ExtensionStatus Disabled { get; } = new("disabled"); /// The extension failed to start or crashed. public static ExtensionStatus Failed { get; } = new("failed"); /// The extension process is starting. public static ExtensionStatus Starting { get; } = new("starting"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ExtensionStatus left, ExtensionStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ExtensionStatus left, ExtensionStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is ExtensionStatus other && Equals(other); /// public bool Equals(ExtensionStatus 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 ExtensionStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ExtensionStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExtensionStatus)); } } } /// Type of GitHub reference. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PushAttachmentGitHubReferenceType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PushAttachmentGitHubReferenceType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// GitHub issue reference. public static PushAttachmentGitHubReferenceType Issue { get; } = new("issue"); /// GitHub pull request reference. public static PushAttachmentGitHubReferenceType Pr { get; } = new("pr"); /// GitHub discussion reference. public static PushAttachmentGitHubReferenceType Discussion { get; } = new("discussion"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PushAttachmentGitHubReferenceType left, PushAttachmentGitHubReferenceType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PushAttachmentGitHubReferenceType left, PushAttachmentGitHubReferenceType right) => !(left == right); /// public override bool Equals(object? obj) => obj is PushAttachmentGitHubReferenceType other && Equals(other); /// public bool Equals(PushAttachmentGitHubReferenceType 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 PushAttachmentGitHubReferenceType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PushAttachmentGitHubReferenceType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PushAttachmentGitHubReferenceType)); } } } /// Context tier override for matching subagents. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SubagentSettingsEntryContextTier : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SubagentSettingsEntryContextTier(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Inherit the parent session's effective context tier at dispatch time. public static SubagentSettingsEntryContextTier Inherit { get; } = new("inherit"); /// Use the model's default context window. public static SubagentSettingsEntryContextTier Default { get; } = new("default"); /// Pin the subagent to the long-context tier when supported. public static SubagentSettingsEntryContextTier LongContext { get; } = new("long_context"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SubagentSettingsEntryContextTier left, SubagentSettingsEntryContextTier right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SubagentSettingsEntryContextTier left, SubagentSettingsEntryContextTier right) => !(left == right); /// public override bool Equals(object? obj) => obj is SubagentSettingsEntryContextTier other && Equals(other); /// public bool Equals(SubagentSettingsEntryContextTier 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 SubagentSettingsEntryContextTier Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SubagentSettingsEntryContextTier value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SubagentSettingsEntryContextTier)); } } } /// Optional completion hint for the input (e.g. 'directory' for filesystem path completion). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SlashCommandInputCompletion : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SlashCommandInputCompletion(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Input should complete filesystem directories. public static SlashCommandInputCompletion Directory { get; } = new("directory"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SlashCommandInputCompletion left, SlashCommandInputCompletion right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SlashCommandInputCompletion left, SlashCommandInputCompletion right) => !(left == right); /// public override bool Equals(object? obj) => obj is SlashCommandInputCompletion other && Equals(other); /// public bool Equals(SlashCommandInputCompletion 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 SlashCommandInputCompletion Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SlashCommandInputCompletion value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SlashCommandInputCompletion)); } } } /// Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SlashCommandKind : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SlashCommandKind(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Command implemented by the runtime. public static SlashCommandKind Builtin { get; } = new("builtin"); /// Command backed by a skill. public static SlashCommandKind Skill { get; } = new("skill"); /// Command registered by an SDK client or extension. public static SlashCommandKind Client { get; } = new("client"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SlashCommandKind left, SlashCommandKind right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SlashCommandKind left, SlashCommandKind right) => !(left == right); /// public override bool Equals(object? obj) => obj is SlashCommandKind other && Equals(other); /// public bool Equals(SlashCommandKind 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 SlashCommandKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SlashCommandKind value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SlashCommandKind)); } } } /// The user's response: accept (submitted), decline (rejected), or cancel (dismissed). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct UIElicitationResponseAction : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public UIElicitationResponseAction(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 values. public static UIElicitationResponseAction Accept { get; } = new("accept"); /// The user explicitly declined to provide the requested input. public static UIElicitationResponseAction Decline { get; } = new("decline"); /// The user dismissed the elicitation request. public static UIElicitationResponseAction Cancel { get; } = new("cancel"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(UIElicitationResponseAction left, UIElicitationResponseAction right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(UIElicitationResponseAction left, UIElicitationResponseAction right) => !(left == right); /// public override bool Equals(object? obj) => obj is UIElicitationResponseAction other && Equals(other); /// public bool Equals(UIElicitationResponseAction 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 UIElicitationResponseAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, UIElicitationResponseAction value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UIElicitationResponseAction)); } } } /// User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct UIAutoModeSwitchResponse : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public UIAutoModeSwitchResponse(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Allow the automatic mode switch for this turn. public static UIAutoModeSwitchResponse Yes { get; } = new("yes"); /// Allow this mode switch and persist the preference. public static UIAutoModeSwitchResponse YesAlways { get; } = new("yes_always"); /// Decline the automatic mode switch. public static UIAutoModeSwitchResponse No { get; } = new("no"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(UIAutoModeSwitchResponse left, UIAutoModeSwitchResponse right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(UIAutoModeSwitchResponse left, UIAutoModeSwitchResponse right) => !(left == right); /// public override bool Equals(object? obj) => obj is UIAutoModeSwitchResponse other && Equals(other); /// public bool Equals(UIAutoModeSwitchResponse 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 UIAutoModeSwitchResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, UIAutoModeSwitchResponse value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UIAutoModeSwitchResponse)); } } } /// User action selected for an exhausted session limit. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct UISessionLimitsExhaustedResponseAction : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public UISessionLimitsExhaustedResponseAction(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 UISessionLimitsExhaustedResponseAction Add { get; } = new("add"); /// Set a new absolute max AI Credits value. public static UISessionLimitsExhaustedResponseAction Set { get; } = new("set"); /// Remove the current session limit. public static UISessionLimitsExhaustedResponseAction Unset { get; } = new("unset"); /// Leave the limit unchanged and cancel the blocked model request. public static UISessionLimitsExhaustedResponseAction Cancel { get; } = new("cancel"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(UISessionLimitsExhaustedResponseAction left, UISessionLimitsExhaustedResponseAction right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(UISessionLimitsExhaustedResponseAction left, UISessionLimitsExhaustedResponseAction right) => !(left == right); /// public override bool Equals(object? obj) => obj is UISessionLimitsExhaustedResponseAction other && Equals(other); /// public bool Equals(UISessionLimitsExhaustedResponseAction 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 UISessionLimitsExhaustedResponseAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, UISessionLimitsExhaustedResponseAction value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UISessionLimitsExhaustedResponseAction)); } } } /// The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct UIExitPlanModeAction : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public UIExitPlanModeAction(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 UIExitPlanModeAction ExitOnly { get; } = new("exit_only"); /// Exit plan mode and continue interactively. public static UIExitPlanModeAction Interactive { get; } = new("interactive"); /// Exit plan mode and continue in autopilot mode. public static UIExitPlanModeAction Autopilot { get; } = new("autopilot"); /// Exit plan mode and continue in autopilot mode with parallel subagent execution. public static UIExitPlanModeAction AutopilotFleet { get; } = new("autopilot_fleet"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(UIExitPlanModeAction left, UIExitPlanModeAction right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(UIExitPlanModeAction left, UIExitPlanModeAction right) => !(left == right); /// public override bool Equals(object? obj) => obj is UIExitPlanModeAction other && Equals(other); /// public bool Equals(UIExitPlanModeAction 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 UIExitPlanModeAction Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, UIExitPlanModeAction value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(UIExitPlanModeAction)); } } } /// Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PermissionsConfigureAdditionalContentExclusionPolicyScope : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PermissionsConfigureAdditionalContentExclusionPolicyScope(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The content exclusion policy applies to the current repository. public static PermissionsConfigureAdditionalContentExclusionPolicyScope Repo { get; } = new("repo"); /// The content exclusion policy applies across all repositories. public static PermissionsConfigureAdditionalContentExclusionPolicyScope All { get; } = new("all"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PermissionsConfigureAdditionalContentExclusionPolicyScope left, PermissionsConfigureAdditionalContentExclusionPolicyScope right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PermissionsConfigureAdditionalContentExclusionPolicyScope left, PermissionsConfigureAdditionalContentExclusionPolicyScope right) => !(left == right); /// public override bool Equals(object? obj) => obj is PermissionsConfigureAdditionalContentExclusionPolicyScope other && Equals(other); /// public bool Equals(PermissionsConfigureAdditionalContentExclusionPolicyScope 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 PermissionsConfigureAdditionalContentExclusionPolicyScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PermissionsConfigureAdditionalContentExclusionPolicyScope value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionsConfigureAdditionalContentExclusionPolicyScope)); } } } /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PermissionsSetApproveAllSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PermissionsSetApproveAllSource(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Allow-all was enabled from a CLI command-line flag. public static PermissionsSetApproveAllSource CliFlag { get; } = new("cli_flag"); /// Allow-all was enabled by a slash command. public static PermissionsSetApproveAllSource SlashCommand { get; } = new("slash_command"); /// Allow-all was enabled by confirming autopilot behavior. public static PermissionsSetApproveAllSource AutopilotConfirmation { get; } = new("autopilot_confirmation"); /// Allow-all was enabled through an RPC caller. public static PermissionsSetApproveAllSource Rpc { get; } = new("rpc"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PermissionsSetApproveAllSource left, PermissionsSetApproveAllSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PermissionsSetApproveAllSource left, PermissionsSetApproveAllSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is PermissionsSetApproveAllSource other && Equals(other); /// public bool Equals(PermissionsSetApproveAllSource 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 PermissionsSetApproveAllSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PermissionsSetApproveAllSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionsSetApproveAllSource)); } } } /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PermissionsSetAllowAllSource : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PermissionsSetAllowAllSource(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Allow-all was enabled from a CLI command-line flag. public static PermissionsSetAllowAllSource CliFlag { get; } = new("cli_flag"); /// Allow-all was enabled by a slash command. public static PermissionsSetAllowAllSource SlashCommand { get; } = new("slash_command"); /// Allow-all was enabled by confirming autopilot behavior. public static PermissionsSetAllowAllSource AutopilotConfirmation { get; } = new("autopilot_confirmation"); /// Allow-all was enabled through an RPC caller. public static PermissionsSetAllowAllSource Rpc { get; } = new("rpc"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PermissionsSetAllowAllSource left, PermissionsSetAllowAllSource right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PermissionsSetAllowAllSource left, PermissionsSetAllowAllSource right) => !(left == right); /// public override bool Equals(object? obj) => obj is PermissionsSetAllowAllSource other && Equals(other); /// public bool Equals(PermissionsSetAllowAllSource 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 PermissionsSetAllowAllSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PermissionsSetAllowAllSource value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionsSetAllowAllSource)); } } } /// Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PermissionsModifyRulesScope : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PermissionsModifyRulesScope(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Apply the rule change only to this session. public static PermissionsModifyRulesScope Session { get; } = new("session"); /// Persist the rule change for this project location. public static PermissionsModifyRulesScope Location { get; } = new("location"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PermissionsModifyRulesScope left, PermissionsModifyRulesScope right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PermissionsModifyRulesScope left, PermissionsModifyRulesScope right) => !(left == right); /// public override bool Equals(object? obj) => obj is PermissionsModifyRulesScope other && Equals(other); /// public bool Equals(PermissionsModifyRulesScope 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 PermissionsModifyRulesScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PermissionsModifyRulesScope value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionsModifyRulesScope)); } } } /// Whether the location is a git repo or directory. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct PermissionLocationType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public PermissionLocationType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The permission location is persisted at the git repository root. public static PermissionLocationType Repo { get; } = new("repo"); /// The permission location is persisted at the working directory. public static PermissionLocationType Dir { get; } = new("dir"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(PermissionLocationType left, PermissionLocationType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(PermissionLocationType left, PermissionLocationType right) => !(left == right); /// public override bool Equals(object? obj) => obj is PermissionLocationType other && Equals(other); /// public bool Equals(PermissionLocationType 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 PermissionLocationType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, PermissionLocationType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(PermissionLocationType)); } } } /// The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot'). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct MetadataSnapshotCurrentMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public MetadataSnapshotCurrentMode(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 MetadataSnapshotCurrentMode Interactive { get; } = new("interactive"); /// The agent is preparing a plan before making changes. public static MetadataSnapshotCurrentMode Plan { get; } = new("plan"); /// The agent is working autonomously toward task completion. public static MetadataSnapshotCurrentMode Autopilot { get; } = new("autopilot"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(MetadataSnapshotCurrentMode left, MetadataSnapshotCurrentMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(MetadataSnapshotCurrentMode left, MetadataSnapshotCurrentMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is MetadataSnapshotCurrentMode other && Equals(other); /// public bool Equals(MetadataSnapshotCurrentMode 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 MetadataSnapshotCurrentMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, MetadataSnapshotCurrentMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(MetadataSnapshotCurrentMode)); } } } /// Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct MetadataSnapshotRemoteMetadataTaskType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public MetadataSnapshotRemoteMetadataTaskType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Remote task originated from Copilot Coding Agent. public static MetadataSnapshotRemoteMetadataTaskType Cca { get; } = new("cca"); /// Remote task originated from a CLI remote-session invocation. public static MetadataSnapshotRemoteMetadataTaskType Cli { get; } = new("cli"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(MetadataSnapshotRemoteMetadataTaskType left, MetadataSnapshotRemoteMetadataTaskType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(MetadataSnapshotRemoteMetadataTaskType left, MetadataSnapshotRemoteMetadataTaskType right) => !(left == right); /// public override bool Equals(object? obj) => obj is MetadataSnapshotRemoteMetadataTaskType other && Equals(other); /// public bool Equals(MetadataSnapshotRemoteMetadataTaskType 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 MetadataSnapshotRemoteMetadataTaskType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, MetadataSnapshotRemoteMetadataTaskType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(MetadataSnapshotRemoteMetadataTaskType)); } } } /// Repository host type, if known. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct WorkspaceSummaryHostType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public WorkspaceSummaryHostType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Workspace summary repository is hosted on GitHub. public static WorkspaceSummaryHostType GitHub { get; } = new("github"); /// Workspace summary repository is hosted on Azure DevOps. public static WorkspaceSummaryHostType Ado { get; } = new("ado"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(WorkspaceSummaryHostType left, WorkspaceSummaryHostType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(WorkspaceSummaryHostType left, WorkspaceSummaryHostType right) => !(left == right); /// public override bool Equals(object? obj) => obj is WorkspaceSummaryHostType other && Equals(other); /// public bool Equals(WorkspaceSummaryHostType 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 WorkspaceSummaryHostType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, WorkspaceSummaryHostType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(WorkspaceSummaryHostType)); } } } /// Hosting platform type of the repository. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionWorkingDirectoryContextHostType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionWorkingDirectoryContextHostType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The working directory repository is hosted on GitHub. public static SessionWorkingDirectoryContextHostType GitHub { get; } = new("github"); /// The working directory repository is hosted on Azure DevOps. public static SessionWorkingDirectoryContextHostType Ado { get; } = new("ado"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionWorkingDirectoryContextHostType left, SessionWorkingDirectoryContextHostType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionWorkingDirectoryContextHostType left, SessionWorkingDirectoryContextHostType right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionWorkingDirectoryContextHostType other && Equals(other); /// public bool Equals(SessionWorkingDirectoryContextHostType 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 SessionWorkingDirectoryContextHostType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionWorkingDirectoryContextHostType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionWorkingDirectoryContextHostType)); } } } /// Signal to send (default: SIGTERM). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct ShellKillSignal : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public ShellKillSignal(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Request graceful process termination. public static ShellKillSignal SIGTERM { get; } = new("SIGTERM"); /// Forcefully terminate the process. public static ShellKillSignal SIGKILL { get; } = new("SIGKILL"); /// Send an interrupt signal to the process. public static ShellKillSignal SIGINT { get; } = new("SIGINT"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(ShellKillSignal left, ShellKillSignal right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(ShellKillSignal left, ShellKillSignal right) => !(left == right); /// public override bool Equals(object? obj) => obj is ShellKillSignal other && Equals(other); /// public bool Equals(ShellKillSignal 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 ShellKillSignal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, ShellKillSignal value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ShellKillSignal)); } } } /// Whether this item is a queued user message or a queued slash command / model change. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct QueuePendingItemsKind : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public QueuePendingItemsKind(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// A queued user message. public static QueuePendingItemsKind Message { get; } = new("message"); /// A queued slash command or model-change command. public static QueuePendingItemsKind Command { get; } = new("command"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(QueuePendingItemsKind left, QueuePendingItemsKind right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(QueuePendingItemsKind left, QueuePendingItemsKind right) => !(left == right); /// public override bool Equals(object? obj) => obj is QueuePendingItemsKind other && Equals(other); /// public bool Equals(QueuePendingItemsKind 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 QueuePendingItemsKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, QueuePendingItemsKind value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(QueuePendingItemsKind)); } } } /// Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read started from the beginning of the remaining history. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct EventsCursorStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public EventsCursorStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The cursor was applied successfully. public static EventsCursorStatus Ok { get; } = new("ok"); /// The cursor referred to history that is no longer available. public static EventsCursorStatus Expired { get; } = new("expired"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(EventsCursorStatus left, EventsCursorStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(EventsCursorStatus left, EventsCursorStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is EventsCursorStatus other && Equals(other); /// public bool Equals(EventsCursorStatus 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 EventsCursorStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, EventsCursorStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(EventsCursorStatus)); } } } /// Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct EventsAgentScope : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public EventsAgentScope(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Return main-agent events and typed subagent lifecycle events. public static EventsAgentScope Primary { get; } = new("primary"); /// Return events from all agents. public static EventsAgentScope All { get; } = new("all"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(EventsAgentScope left, EventsAgentScope right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(EventsAgentScope left, EventsAgentScope right) => !(left == right); /// public override bool Equals(object? obj) => obj is EventsAgentScope other && Equals(other); /// public bool Equals(EventsAgentScope 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 EventsAgentScope Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, EventsAgentScope value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(EventsAgentScope)); } } } /// Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct RemoteSessionMode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public RemoteSessionMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Disable remote session export and steering. public static RemoteSessionMode Off { get; } = new("off"); /// Export session events to GitHub without enabling remote steering. public static RemoteSessionMode Export { get; } = new("export"); /// Enable both remote session export and remote steering. public static RemoteSessionMode On { get; } = new("on"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(RemoteSessionMode left, RemoteSessionMode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(RemoteSessionMode left, RemoteSessionMode right) => !(left == right); /// public override bool Equals(object? obj) => obj is RemoteSessionMode other && Equals(other); /// public bool Equals(RemoteSessionMode 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 RemoteSessionMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, RemoteSessionMode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(RemoteSessionMode)); } } } /// Sharing status for a synced session. "repo" makes the session visible to anyone with read access to the repository; "unshared" restricts it to the creator and collaborators. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionVisibilityStatus : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionVisibilityStatus(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The session is visible to repository readers. public static SessionVisibilityStatus Repo { get; } = new("repo"); /// The session is restricted to its creator and collaborators. public static SessionVisibilityStatus Unshared { get; } = new("unshared"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionVisibilityStatus left, SessionVisibilityStatus right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionVisibilityStatus left, SessionVisibilityStatus right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionVisibilityStatus other && Equals(other); /// public bool Equals(SessionVisibilityStatus 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 SessionVisibilityStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionVisibilityStatus value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionVisibilityStatus)); } } } /// Error classification. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionFsErrorCode : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionFsErrorCode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The requested path does not exist. public static SessionFsErrorCode ENOENT { get; } = new("ENOENT"); /// The filesystem operation failed for an unspecified reason. public static SessionFsErrorCode UNKNOWN { get; } = new("UNKNOWN"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionFsErrorCode left, SessionFsErrorCode right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionFsErrorCode left, SessionFsErrorCode right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionFsErrorCode other && Equals(other); /// public bool Equals(SessionFsErrorCode 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 SessionFsErrorCode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionFsErrorCode value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsErrorCode)); } } } /// Entry type. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionFsReaddirWithTypesEntryType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionFsReaddirWithTypesEntryType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// The entry is a file. public static SessionFsReaddirWithTypesEntryType File { get; } = new("file"); /// The entry is a directory. public static SessionFsReaddirWithTypesEntryType Directory { get; } = new("directory"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionFsReaddirWithTypesEntryType left, SessionFsReaddirWithTypesEntryType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionFsReaddirWithTypesEntryType left, SessionFsReaddirWithTypesEntryType right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionFsReaddirWithTypesEntryType other && Equals(other); /// public bool Equals(SessionFsReaddirWithTypesEntryType 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 SessionFsReaddirWithTypesEntryType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionFsReaddirWithTypesEntryType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsReaddirWithTypesEntryType)); } } } /// How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct SessionFsSqliteQueryType : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public SessionFsSqliteQueryType(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Execute DDL or multi-statement SQL without returning rows. public static SessionFsSqliteQueryType Exec { get; } = new("exec"); /// Execute a SELECT-style query and return rows. public static SessionFsSqliteQueryType Query { get; } = new("query"); /// Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata. public static SessionFsSqliteQueryType Run { get; } = new("run"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SessionFsSqliteQueryType left, SessionFsSqliteQueryType right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(SessionFsSqliteQueryType left, SessionFsSqliteQueryType right) => !(left == right); /// public override bool Equals(object? obj) => obj is SessionFsSqliteQueryType other && Equals(other); /// public bool Equals(SessionFsSqliteQueryType 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 SessionFsSqliteQueryType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, SessionFsSqliteQueryType value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionFsSqliteQueryType)); } } } /// Transport the runtime would otherwise use for this request. `http` (the default when absent) covers plain HTTP and SSE responses; `websocket` indicates a full-duplex message channel where each body chunk maps to one WebSocket message and the `binary` flag distinguishes text from binary frames. The SDK consumer uses this to decide whether to service the request with an HTTP client or a WebSocket client. It is the one piece of request metadata the consumer cannot reliably infer from the URL or headers alone. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct LlmInferenceHttpRequestStartTransport : IEquatable { private readonly string? _value; /// Initializes a new instance of the struct. /// The value to associate with this . [JsonConstructor] public LlmInferenceHttpRequestStartTransport(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } /// Gets the value associated with this . public string Value => _value ?? string.Empty; /// Plain HTTP or SSE response. Each body chunk is an opaque byte range; the response is a status line, headers, and a (possibly streamed) body. public static LlmInferenceHttpRequestStartTransport Http { get; } = new("http"); /// Full-duplex WebSocket channel. Each body chunk maps to exactly one WebSocket message and the `binary` flag distinguishes text from binary frames; request and response chunks flow concurrently. public static LlmInferenceHttpRequestStartTransport Websocket { get; } = new("websocket"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(LlmInferenceHttpRequestStartTransport left, LlmInferenceHttpRequestStartTransport right) => left.Equals(right); /// Returns a value indicating whether two instances are not equivalent. public static bool operator !=(LlmInferenceHttpRequestStartTransport left, LlmInferenceHttpRequestStartTransport right) => !(left == right); /// public override bool Equals(object? obj) => obj is LlmInferenceHttpRequestStartTransport other && Equals(other); /// public bool Equals(LlmInferenceHttpRequestStartTransport 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 LlmInferenceHttpRequestStartTransport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// public override void Write(Utf8JsonWriter writer, LlmInferenceHttpRequestStartTransport value, JsonSerializerOptions options) { GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(LlmInferenceHttpRequestStartTransport)); } } } /// Provides server-scoped RPC methods (no session required). public sealed class ServerRpc { private readonly JsonRpc _rpc; internal ServerRpc(JsonRpc rpc) { _rpc = rpc; } /// Checks server responsiveness and returns protocol information. /// Optional message to echo back. /// The to monitor for cancellation requests. The default is . /// Server liveness response, including the echoed message, current server timestamp, and protocol version. [Experimental(Diagnostics.Experimental)] public async Task PingAsync(string? message = null, CancellationToken cancellationToken = default) { var request = new PingRequest { Message = message }; return await CopilotClient.InvokeRpcAsync(_rpc, "ping", [request], cancellationToken); } /// Performs the SDK server connection handshake and validates the optional connection token. Marked internal because this is JSON-RPC transport plumbing invoked automatically by an SDK client's own `connect()` wrapper, not a user-facing method. Stays internal as long as the SDK client owns the handshake; would only become public if the SDK ever exposed the raw schema surface to consumers without a connection wrapper. /// Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN. /// The to monitor for cancellation requests. The default is . /// Handshake result reporting the server's protocol version and package version on success. [Experimental(Diagnostics.Experimental)] internal async Task ConnectAsync(string? token = null, CancellationToken cancellationToken = default) { var request = new ConnectRequest { Token = token }; return await CopilotClient.InvokeRpcAsync(_rpc, "connect", [request], cancellationToken); } /// Models APIs. public ServerModelsApi Models => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Tools APIs. public ServerToolsApi Tools => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Account APIs. public ServerAccountApi Account => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Secrets APIs. public ServerSecretsApi Secrets => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Mcp APIs. public ServerMcpApi Mcp => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Plugins APIs. public ServerPluginsApi Plugins => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Skills APIs. public ServerSkillsApi Skills => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Agents APIs. public ServerAgentsApi Agents => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Instructions APIs. public ServerInstructionsApi Instructions => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// User APIs. public ServerUserApi User => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Runtime APIs. public ServerRuntimeApi Runtime => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// SessionFs APIs. public ServerSessionFsApi SessionFs => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// LlmInference APIs. public ServerLlmInferenceApi LlmInference => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// Sessions APIs. public ServerSessionsApi Sessions => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; /// AgentRegistry APIs. public ServerAgentRegistryApi AgentRegistry => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; } /// Provides server-scoped Models APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerModelsApi { private readonly JsonRpc _rpc; internal ServerModelsApi(JsonRpc rpc) { _rpc = rpc; } /// Lists Copilot models available to the authenticated user. /// GitHub token for per-user model listing. When provided, resolves this token to determine the user's Copilot plan and available models instead of using the global auth. /// The to monitor for cancellation requests. The default is . /// List of Copilot models available to the resolved user, including capabilities and billing metadata. public async Task ListAsync(string? gitHubToken = null, CancellationToken cancellationToken = default) { var request = new ModelsListRequest { GitHubToken = gitHubToken }; return await CopilotClient.InvokeRpcAsync(_rpc, "models.list", [request], cancellationToken); } } /// Provides server-scoped Tools APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerToolsApi { private readonly JsonRpc _rpc; internal ServerToolsApi(JsonRpc rpc) { _rpc = rpc; } /// Lists built-in tools available for a model. /// Optional model ID — when provided, the returned tool list reflects model-specific overrides. /// The to monitor for cancellation requests. The default is . /// Built-in tools available for the requested model, with their parameters and instructions. public async Task ListAsync(string? model = null, CancellationToken cancellationToken = default) { var request = new ToolsListRequest { Model = model }; return await CopilotClient.InvokeRpcAsync(_rpc, "tools.list", [request], cancellationToken); } } /// Provides server-scoped Account APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerAccountApi { private readonly JsonRpc _rpc; internal ServerAccountApi(JsonRpc rpc) { _rpc = rpc; } /// Gets Copilot quota usage for the authenticated user or supplied GitHub token. /// GitHub token for per-user quota lookup. When provided, resolves this token to determine the user's quota instead of using the global auth. /// The to monitor for cancellation requests. The default is . /// Quota usage snapshots for the resolved user, keyed by quota type. public async Task GetQuotaAsync(string? gitHubToken = null, CancellationToken cancellationToken = default) { var request = new AccountGetQuotaRequest { GitHubToken = gitHubToken }; return await CopilotClient.InvokeRpcAsync(_rpc, "account.getQuota", [request], cancellationToken); } /// Gets the currently active authentication credentials from the global auth manager. /// The to monitor for cancellation requests. The default is . /// Current authentication state. public async Task GetCurrentAuthAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "account.getCurrentAuth", [], cancellationToken); } /// Gets all authenticated users available for account switching. /// The to monitor for cancellation requests. The default is . /// List of all authenticated users. public async Task> GetAllUsersAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync>(_rpc, "account.getAllUsers", [], cancellationToken); } /// Stores authentication credentials after successful login (e.g., device code flow). /// GitHub host URL. /// User login/username. /// GitHub authentication token. /// The to monitor for cancellation requests. The default is . /// Result of a successful login; throws on failure. public async Task LoginAsync(string host, string login, string token, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(host); ArgumentNullException.ThrowIfNull(login); ArgumentNullException.ThrowIfNull(token); var request = new AccountLoginRequest { Host = host, Login = login, Token = token }; return await CopilotClient.InvokeRpcAsync(_rpc, "account.login", [request], cancellationToken); } /// Removes user authentication from keychain and persisted state. /// Authentication information for the user to log out. /// The to monitor for cancellation requests. The default is . /// Logout result indicating if more users remain. public async Task LogoutAsync(AuthInfo authInfo, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(authInfo); var request = new AccountLogoutRequest { AuthInfo = authInfo }; return await CopilotClient.InvokeRpcAsync(_rpc, "account.logout", [request], cancellationToken); } } /// Provides server-scoped Secrets APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerSecretsApi { private readonly JsonRpc _rpc; internal ServerSecretsApi(JsonRpc rpc) { _rpc = rpc; } /// Registers secret values for redaction in session logs and exports. The SDK calls this to inject dynamically generated secret values (e.g., OIDC tokens). /// Raw secret values to register for redaction. /// The to monitor for cancellation requests. The default is . /// Confirmation that the secret values were registered. public async Task AddFilterValuesAsync(IList values, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(values); var request = new SecretsAddFilterValuesRequest { Values = values }; return await CopilotClient.InvokeRpcAsync(_rpc, "secrets.addFilterValues", [request], cancellationToken); } } /// Provides server-scoped Mcp APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerMcpApi { private readonly JsonRpc _rpc; internal ServerMcpApi(JsonRpc rpc) { _rpc = rpc; } /// Discovers MCP servers from user, workspace, plugin, and builtin sources. /// Working directory used as context for discovery (e.g., plugin resolution). /// The to monitor for cancellation requests. The default is . /// MCP servers discovered from user, workspace, plugin, and built-in sources. public async Task DiscoverAsync(string? workingDirectory = null, CancellationToken cancellationToken = default) { var request = new McpDiscoverRequest { WorkingDirectory = workingDirectory }; return await CopilotClient.InvokeRpcAsync(_rpc, "mcp.discover", [request], cancellationToken); } /// Config APIs. public ServerMcpConfigApi Config => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; } /// Provides server-scoped McpConfig APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerMcpConfigApi { private readonly JsonRpc _rpc; internal ServerMcpConfigApi(JsonRpc rpc) { _rpc = rpc; } /// Lists MCP servers from user configuration. /// The to monitor for cancellation requests. The default is . /// User-configured MCP servers, keyed by server name. public async Task ListAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.list", [], cancellationToken); } /// Adds an MCP server to user configuration. /// Unique name for the MCP server. /// MCP server configuration (stdio process or remote HTTP/SSE). /// The to monitor for cancellation requests. The default is . public async Task AddAsync(string name, object config, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); ArgumentNullException.ThrowIfNull(config); var request = new McpConfigAddRequest { Name = name, Config = CopilotClient.ToJsonElementForWire(config)!.Value }; await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.add", [request], cancellationToken); } /// Updates an MCP server in user configuration. /// Name of the MCP server to update. /// MCP server configuration (stdio process or remote HTTP/SSE). /// The to monitor for cancellation requests. The default is . public async Task UpdateAsync(string name, object config, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); ArgumentNullException.ThrowIfNull(config); var request = new McpConfigUpdateRequest { Name = name, Config = CopilotClient.ToJsonElementForWire(config)!.Value }; await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.update", [request], cancellationToken); } /// Removes an MCP server from user configuration. /// Name of the MCP server to remove. /// The to monitor for cancellation requests. The default is . public async Task RemoveAsync(string name, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); var request = new McpConfigRemoveRequest { Name = name }; await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.remove", [request], cancellationToken); } /// Enables MCP servers in user configuration for new sessions. /// Names of MCP servers to enable. Each server is removed from the persisted disabled list so new sessions spawn it. Unknown or already-enabled names are ignored. /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(IList names, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(names); var request = new McpConfigEnableRequest { Names = names }; await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.enable", [request], cancellationToken); } /// Disables MCP servers in user configuration for new sessions. /// Names of MCP servers to disable. Each server is added to the persisted disabled list so new sessions skip it. Already-disabled names are ignored. Active sessions keep their current connections until they end. /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(IList names, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(names); var request = new McpConfigDisableRequest { Names = names }; await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.disable", [request], cancellationToken); } /// Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk. /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(CancellationToken cancellationToken = default) { await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.reload", [], cancellationToken); } } /// Provides server-scoped Plugins APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerPluginsApi { private readonly JsonRpc _rpc; internal ServerPluginsApi(JsonRpc rpc) { _rpc = rpc; } /// Lists plugins installed in user/global state. /// The to monitor for cancellation requests. The default is . /// Plugins installed in user/global state. public async Task ListAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.list", [], cancellationToken); } /// Installs a plugin from a marketplace, GitHub repo, URL, or local path. /// Plugin install spec. Accepts the same forms as the CLI: "plugin@marketplace" (marketplace install), "owner/repo" or "owner/repo:subpath" (GitHub direct), an http/https/ssh URL, or a local path. Direct (non-marketplace) installs are deprecated and will produce a deprecationWarning in the result. /// Working directory used to resolve relative local paths in `source`. Defaults to the server's current working directory. /// The to monitor for cancellation requests. The default is . /// Result of installing a plugin. public async Task InstallAsync(string source, string? workingDirectory = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(source); var request = new PluginsInstallRequest { Source = source, WorkingDirectory = workingDirectory }; return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.install", [request], cancellationToken); } /// Uninstalls an installed plugin. /// Plugin name or "plugin@marketplace" spec to uninstall. When ambiguous, prefer the fully-qualified spec. /// Stable source identity for a direct (non-marketplace) install. Disambiguates uninstall when multiple installed plugins share the same name. /// The to monitor for cancellation requests. The default is . public async Task UninstallAsync(string name, string? directSourceId = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); var request = new PluginsUninstallRequest { Name = name, DirectSourceId = directSourceId }; await CopilotClient.InvokeRpcAsync(_rpc, "plugins.uninstall", [request], cancellationToken); } /// Updates an installed plugin to its latest published version. /// Plugin name or "plugin@marketplace" spec to update. /// The to monitor for cancellation requests. The default is . /// Result of updating a single plugin. public async Task UpdateAsync(string name, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); var request = new PluginsUpdateRequest { Name = name }; return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.update", [request], cancellationToken); } /// Updates every installed plugin to its latest published version. /// The to monitor for cancellation requests. The default is . /// Result of updating all installed plugins. public async Task UpdateAllAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.updateAll", [], cancellationToken); } /// Enables installed plugins for new sessions. /// Plugin names or "plugin@marketplace" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API. /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(IList names, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(names); var request = new PluginsEnableRequest { Names = names }; await CopilotClient.InvokeRpcAsync(_rpc, "plugins.enable", [request], cancellationToken); } /// Disables installed plugins for new sessions. /// Plugin names or "plugin@marketplace" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins. /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(IList names, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(names); var request = new PluginsDisableRequest { Names = names }; await CopilotClient.InvokeRpcAsync(_rpc, "plugins.disable", [request], cancellationToken); } /// Marketplaces APIs. public ServerPluginsMarketplacesApi Marketplaces => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; } /// Provides server-scoped PluginsMarketplaces APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerPluginsMarketplacesApi { private readonly JsonRpc _rpc; internal ServerPluginsMarketplacesApi(JsonRpc rpc) { _rpc = rpc; } /// Lists all registered marketplaces (defaults + user-added). /// The to monitor for cancellation requests. The default is . /// All registered marketplaces, including built-in defaults. public async Task ListAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.marketplaces.list", [], cancellationToken); } /// Registers a new marketplace from a source (owner/repo, URL, or local path). /// Marketplace source. Accepts the same forms as the CLI: "owner/repo" or "owner/repo#ref" (GitHub), an http/https/ssh URL (optionally with #ref), a git scp-style URL (user@host:path), or a local path. The marketplace's own name (from its manifest) is used as the registration key. /// The to monitor for cancellation requests. The default is . /// Result of registering a new marketplace. public async Task AddAsync(string source, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(source); var request = new PluginsMarketplacesAddRequest { Source = source }; return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.marketplaces.add", [request], cancellationToken); } /// Removes a previously-registered marketplace. When the marketplace has dependent plugins and `force` is not set, the marketplace is left intact and the result lists the dependents so the caller can decide whether to retry with `force=true`. /// Marketplace name to remove. /// When true, also uninstall every plugin sourced from this marketplace. When false (default), removal is a no-op if any plugin from this marketplace is installed and the dependent plugin names are returned in the result. /// The to monitor for cancellation requests. The default is . /// Outcome of the remove attempt, including dependent-plugin info when applicable. public async Task RemoveAsync(string name, bool? force = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); var request = new PluginsMarketplacesRemoveRequest { Name = name, Force = force }; return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.marketplaces.remove", [request], cancellationToken); } /// Lists plugins advertised by a registered marketplace. /// Marketplace name to browse. /// The to monitor for cancellation requests. The default is . /// Plugins advertised by the marketplace. public async Task BrowseAsync(string name, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); var request = new PluginsMarketplacesBrowseRequest { Name = name }; return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.marketplaces.browse", [request], cancellationToken); } /// Re-fetches one or all registered marketplace catalogs. /// Marketplace name to refresh. When omitted, every registered marketplace is refreshed. /// The to monitor for cancellation requests. The default is . /// Result of refreshing one or more marketplace catalogs. public async Task RefreshAsync(string? name = null, CancellationToken cancellationToken = default) { var request = new PluginsMarketplacesRefreshRequest { Name = name }; return await CopilotClient.InvokeRpcAsync(_rpc, "plugins.marketplaces.refresh", [request], cancellationToken); } } /// Provides server-scoped Skills APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerSkillsApi { private readonly JsonRpc _rpc; internal ServerSkillsApi(JsonRpc rpc) { _rpc = rpc; } /// Discovers skills across global and project sources. /// Optional list of project directory paths to scan for project-scoped skills. /// Optional list of additional skill directory paths to include. /// When true, omit skills from the host's global sources (personal, custom, plugin, and built-in), returning only project-scoped skills. For multitenant deployments. /// The to monitor for cancellation requests. The default is . /// Skills discovered across global and project sources. public async Task DiscoverAsync(IList? projectPaths = null, IList? skillDirectories = null, bool? excludeHostSkills = null, CancellationToken cancellationToken = default) { var request = new SkillsDiscoverRequest { ProjectPaths = projectPaths, SkillDirectories = skillDirectories, ExcludeHostSkills = excludeHostSkills }; return await CopilotClient.InvokeRpcAsync(_rpc, "skills.discover", [request], cancellationToken); } /// Returns the canonical directories where a client may create skills that the runtime will recognize, including ones that do not exist yet. Project directories become active once created. /// Optional list of project directory paths. When omitted or empty, only personal and custom directories are returned. /// When true, omit the host's personal and custom skill directories, leaving only project directories. For multitenant deployments. /// The to monitor for cancellation requests. The default is . /// Canonical locations where skills can be created so the runtime will recognize them. public async Task GetDiscoveryPathsAsync(IList? projectPaths = null, bool? excludeHostSkills = null, CancellationToken cancellationToken = default) { var request = new SkillsGetDiscoveryPathsRequest { ProjectPaths = projectPaths, ExcludeHostSkills = excludeHostSkills }; return await CopilotClient.InvokeRpcAsync(_rpc, "skills.getDiscoveryPaths", [request], cancellationToken); } /// Config APIs. public ServerSkillsConfigApi Config => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; } /// Provides server-scoped SkillsConfig APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerSkillsConfigApi { private readonly JsonRpc _rpc; internal ServerSkillsConfigApi(JsonRpc rpc) { _rpc = rpc; } /// Replaces the global list of disabled skills. /// List of skill names to disable. /// The to monitor for cancellation requests. The default is . public async Task SetDisabledSkillsAsync(IList disabledSkills, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(disabledSkills); var request = new SkillsConfigSetDisabledSkillsRequest { DisabledSkills = disabledSkills }; await CopilotClient.InvokeRpcAsync(_rpc, "skills.config.setDisabledSkills", [request], cancellationToken); } } /// Provides server-scoped Agents APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerAgentsApi { private readonly JsonRpc _rpc; internal ServerAgentsApi(JsonRpc rpc) { _rpc = rpc; } /// Discovers custom agents across user, project, plugin, and remote sources. /// Optional list of project directory paths to scan for project-scoped agents. When omitted or empty, only user/plugin/remote-independent agents are returned (no project scan). /// When true, omit the host's agents (the user-level agent directory and all plugin agents), leaving only project and remote agents. For multitenant deployments. /// The to monitor for cancellation requests. The default is . /// Agents discovered across user, project, plugin, and remote sources. public async Task DiscoverAsync(IList? projectPaths = null, bool? excludeHostAgents = null, CancellationToken cancellationToken = default) { var request = new AgentsDiscoverRequest { ProjectPaths = projectPaths, ExcludeHostAgents = excludeHostAgents }; return await CopilotClient.InvokeRpcAsync(_rpc, "agents.discover", [request], cancellationToken); } /// Returns the canonical directories where a client may create custom agents that the runtime will recognize, including ones that do not exist yet. Project directories become active once created. /// Optional list of project directory paths. When omitted or empty, only the user-level directory is returned. /// When true, omit the host's user-level agent directory, leaving only project directories. For multitenant deployments (mirrors `discover`'s `excludeHostAgents`). /// The to monitor for cancellation requests. The default is . /// Canonical locations where custom agents can be created so the runtime will recognize them. public async Task GetDiscoveryPathsAsync(IList? projectPaths = null, bool? excludeHostAgents = null, CancellationToken cancellationToken = default) { var request = new AgentsGetDiscoveryPathsRequest { ProjectPaths = projectPaths, ExcludeHostAgents = excludeHostAgents }; return await CopilotClient.InvokeRpcAsync(_rpc, "agents.getDiscoveryPaths", [request], cancellationToken); } } /// Provides server-scoped Instructions APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerInstructionsApi { private readonly JsonRpc _rpc; internal ServerInstructionsApi(JsonRpc rpc) { _rpc = rpc; } /// Discovers instruction sources across user, repository, and plugin sources. /// Optional list of project directory paths to scan for repository/working-directory instruction sources. When omitted or empty, only user-level and plugin instruction sources are returned (no project scan). /// When true, omit the host's instruction sources (user/home-level files and plugin rules), leaving only repository and working-directory sources. For multitenant deployments. /// The to monitor for cancellation requests. The default is . /// Instruction sources discovered across user, repository, and plugin sources. public async Task DiscoverAsync(IList? projectPaths = null, bool? excludeHostInstructions = null, CancellationToken cancellationToken = default) { var request = new InstructionsDiscoverRequest { ProjectPaths = projectPaths, ExcludeHostInstructions = excludeHostInstructions }; return await CopilotClient.InvokeRpcAsync(_rpc, "instructions.discover", [request], cancellationToken); } /// Returns the canonical files and directories where a client may create custom instructions that the runtime will recognize, including ones that do not exist yet. Repository targets become active once created. /// Optional list of project directory paths. When omitted or empty, only the user-level targets are returned. /// When true, omit the host's user-level instruction targets, leaving only repository targets. For multitenant deployments (mirrors `discover`'s `excludeHostInstructions`). /// The to monitor for cancellation requests. The default is . /// Canonical files and directories where custom instructions can be created so the runtime will recognize them. public async Task GetDiscoveryPathsAsync(IList? projectPaths = null, bool? excludeHostInstructions = null, CancellationToken cancellationToken = default) { var request = new InstructionsGetDiscoveryPathsRequest { ProjectPaths = projectPaths, ExcludeHostInstructions = excludeHostInstructions }; return await CopilotClient.InvokeRpcAsync(_rpc, "instructions.getDiscoveryPaths", [request], cancellationToken); } } /// Provides server-scoped User APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerUserApi { private readonly JsonRpc _rpc; internal ServerUserApi(JsonRpc rpc) { _rpc = rpc; } /// Settings APIs. public ServerUserSettingsApi Settings => field ?? Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; } /// Provides server-scoped UserSettings APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerUserSettingsApi { private readonly JsonRpc _rpc; internal ServerUserSettingsApi(JsonRpc rpc) { _rpc = rpc; } /// Drops this runtime process's in-memory user settings cache so the next settings read observes disk. /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(CancellationToken cancellationToken = default) { await CopilotClient.InvokeRpcAsync(_rpc, "user.settings.reload", [], cancellationToken); } /// Lists every known user setting (settings.json overlaid with the legacy config.json, config.json wins), each with its effective value, its default, and whether it is at the default — so settings the user has never set still appear with their default value. Does not include repository- or enterprise-managed overrides that the runtime layers on top at session time. /// The to monitor for cancellation requests. The default is . /// Per-key metadata for every known user setting (settings.json overlaid with the legacy config.json, config.json wins), including settings left at their default. Excludes repository- and enterprise-managed overrides. public async Task GetAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "user.settings.get", [], cancellationToken); } /// Writes one or more user settings to settings.json, replacing each provided top-level key. A key whose value is null is removed. Returns the keys whose new value is shadowed by a legacy config.json entry (config.json wins on read), which the runtime leaves in place — such writes do not take effect until the legacy value is removed. /// Partial user settings to write, as a free-form object keyed by setting name. /// The to monitor for cancellation requests. The default is . /// Outcome of writing user settings. public async Task SetAsync(object settings, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(settings); var request = new UserSettingsSetRequest { Settings = CopilotClient.ToJsonElementForWire(settings)!.Value }; return await CopilotClient.InvokeRpcAsync(_rpc, "user.settings.set", [request], cancellationToken); } } /// Provides server-scoped Runtime APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerRuntimeApi { private readonly JsonRpc _rpc; internal ServerRuntimeApi(JsonRpc rpc) { _rpc = rpc; } /// Gracefully shuts down an SDK-owned runtime. The response is sent only after cleanup completes; callers may then terminate the owned runtime process. /// The to monitor for cancellation requests. The default is . public async Task ShutdownAsync(CancellationToken cancellationToken = default) { await CopilotClient.InvokeRpcAsync(_rpc, "runtime.shutdown", [], cancellationToken); } } /// Provides server-scoped SessionFs APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerSessionFsApi { private readonly JsonRpc _rpc; internal ServerSessionFsApi(JsonRpc rpc) { _rpc = rpc; } /// Registers an SDK client as the session filesystem provider. /// Initial working directory for sessions. /// Path within each session's SessionFs where the runtime stores files for that session. /// Path conventions used by this filesystem. /// Optional capabilities declared by the provider. /// The to monitor for cancellation requests. The default is . /// Indicates whether the calling client was registered as the session filesystem provider. public async Task SetProviderAsync(string initialCwd, string sessionStatePath, SessionFsSetProviderConventions conventions, SessionFsSetProviderCapabilities? capabilities = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(initialCwd); ArgumentNullException.ThrowIfNull(sessionStatePath); var request = new SessionFsSetProviderRequest { InitialCwd = initialCwd, SessionStatePath = sessionStatePath, Conventions = conventions, Capabilities = capabilities }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessionFs.setProvider", [request], cancellationToken); } } /// Provides server-scoped LlmInference APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerLlmInferenceApi { private readonly JsonRpc _rpc; internal ServerLlmInferenceApi(JsonRpc rpc) { _rpc = rpc; } /// Registers an SDK client as the LLM inference callback provider. /// The to monitor for cancellation requests. The default is . /// Indicates whether the calling client was registered as the LLM inference provider. public async Task SetProviderAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "llmInference.setProvider", [], cancellationToken); } /// Delivers the response head (status + headers) for an in-flight request, correlated by the requestId the runtime supplied in httpRequestStart. Must be called exactly once per request before any httpResponseChunk frames. /// Matches the requestId from the originating httpRequestStart frame. /// HTTP status code. /// The headers parameter. /// Optional HTTP status reason phrase. /// The to monitor for cancellation requests. The default is . /// Whether the start frame was accepted. public async Task HttpResponseStartAsync(string requestId, long status, IDictionary> headers, string? statusText = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(headers); var request = new LlmInferenceHttpResponseStartRequest { RequestId = requestId, Status = status, Headers = headers, StatusText = statusText }; return await CopilotClient.InvokeRpcAsync(_rpc, "llmInference.httpResponseStart", [request], cancellationToken); } /// Delivers a body byte range (or a terminal transport error) for an in-flight response, correlated by requestId. Set `end` true on the last chunk. When `error` is set the response terminates with a transport-level failure and the runtime raises an APIConnectionError. /// Matches the requestId from the originating httpRequestStart frame. /// Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty (e.g. when the response body is empty: send a single chunk with empty data and end=true). /// When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text. /// When true, this is the final body chunk for the response. The runtime treats the response body as complete after receiving an end-marked chunk. /// Set to terminate the response with a transport-level failure. Implies end-of-stream; any further chunks for this requestId are ignored. /// The to monitor for cancellation requests. The default is . /// Whether the chunk was accepted. public async Task HttpResponseChunkAsync(string requestId, string data, bool? binary = null, bool? end = null, LlmInferenceHttpResponseChunkError? error = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(data); var request = new LlmInferenceHttpResponseChunkRequest { RequestId = requestId, Data = data, Binary = binary, End = end, Error = error }; return await CopilotClient.InvokeRpcAsync(_rpc, "llmInference.httpResponseChunk", [request], cancellationToken); } } /// Provides server-scoped Sessions APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerSessionsApi { private readonly JsonRpc _rpc; internal ServerSessionsApi(JsonRpc rpc) { _rpc = rpc; } /// Creates or resumes a local session and returns the opened session ID. /// The to monitor for cancellation requests. The default is . /// Result of opening a session. public async Task OpenAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.open", [], cancellationToken); } /// Creates a new session by forking persisted history from an existing session. /// Source session ID to fork from. /// Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included. /// Optional friendly name to assign to the forked session. /// The to monitor for cancellation requests. The default is . /// Identifier and optional friendly name assigned to the newly forked session. public async Task ForkAsync(string sessionId, string? toEventId = null, string? name = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsForkRequest { SessionId = sessionId, ToEventId = toEventId, Name = name }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.fork", [request], cancellationToken); } /// Connects to an existing remote session and exposes it as an SDK session. /// Session ID to connect to. /// The to monitor for cancellation requests. The default is . /// Remote session connection result. public async Task ConnectAsync(string sessionId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new ConnectRemoteSessionParams { SessionId = sessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.connect", [request], cancellationToken); } /// Lists sessions, optionally filtered by source and working-directory context. Returned entries are discriminated by `isRemote`: local entries carry only the lightweight `LocalSessionMetadataValue` shape; remote entries carry the full `RemoteSessionMetadataValue` shape (repository, PR number, taskType, etc.). /// Which session sources to include. Defaults to `local` for backward compatibility. /// When provided, only the first N local sessions (sorted by modification time, newest first) load full metadata; remaining sessions return basic info only. Use 0 to return only basic info for every local session. Has no effect on remote entries (which always carry their full shape). /// Optional filter applied to the returned sessions. /// When true, include detached maintenance sessions. Defaults to false for user-facing session lists. /// Only meaningful when `source` includes remote. When true, propagates errors from the remote service instead of silently returning an empty remote list. Defaults to false. /// The to monitor for cancellation requests. The default is . /// Sessions matching the filter, ordered most-recently-modified first. public async Task ListAsync(SessionSource? source = null, long? metadataLimit = null, SessionListFilter? filter = null, bool? includeDetached = null, bool? throwOnError = null, CancellationToken cancellationToken = default) { var request = new SessionsListRequest { Source = source, MetadataLimit = metadataLimit, Filter = filter, IncludeDetached = includeDetached, ThrowOnError = throwOnError }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.list", [request], cancellationToken); } /// Finds the local session bound to a GitHub task ID, if any. /// GitHub task ID to look up. /// The to monitor for cancellation requests. The default is . /// ID of the local session bound to the given GitHub task, or omitted when none. public async Task FindByTaskIdAsync(string taskId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(taskId); var request = new SessionsFindByTaskIDRequest { TaskId = taskId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.findByTaskId", [request], cancellationToken); } /// Resolves a UUID prefix to a unique session ID, if exactly one session matches. /// UUID prefix (>=7 hex chars, <36 chars). Returns the unique session ID, or undefined when there is no match or the prefix matches multiple sessions. /// The to monitor for cancellation requests. The default is . /// Session ID matching the prefix, omitted when no unique match exists. public async Task FindByPrefixAsync(string prefix, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(prefix); var request = new SessionsFindByPrefixRequest { Prefix = prefix }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.findByPrefix", [request], cancellationToken); } /// Returns the most-relevant prior session for a given working-directory context. /// Optional working-directory context used to score session relevance. When omitted the most-recently-modified session wins. /// The to monitor for cancellation requests. The default is . /// Most-relevant session ID for the supplied context, or omitted when no sessions exist. public async Task GetLastForContextAsync(SessionContext? context = null, CancellationToken cancellationToken = default) { var request = new SessionsGetLastForContextRequest { Context = context }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getLastForContext", [request], cancellationToken); } /// Computes the absolute path to a session's persisted events.jsonl file. Internal: filesystem paths are only meaningful in-process (CLI and runtime share a filesystem). Currently used by the CLI's contribution-graph feature to read historical events directly. Remote SDK consumers must not depend on this; a proper event-query API would replace it if the contribution graph ever needed to work over the wire. /// Session ID whose event-log file path to compute. /// The to monitor for cancellation requests. The default is . /// Absolute path to the session's events.jsonl file on disk. internal async Task GetEventFilePathAsync(string sessionId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsGetEventFilePathRequest { SessionId = sessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getEventFilePath", [request], cancellationToken); } /// Returns the on-disk byte size of each session's workspace directory. /// The to monitor for cancellation requests. The default is . /// Map of sessionId -> on-disk size in bytes for each session's workspace directory. public async Task GetSizesAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getSizes", [], cancellationToken); } /// Returns the subset of the supplied session IDs that are currently held by another running process. /// Session IDs to test for live in-use locks. /// The to monitor for cancellation requests. The default is . /// Session IDs from the input set that are currently in use by another process. public async Task CheckInUseAsync(IList sessionIds, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionIds); var request = new SessionsCheckInUseRequest { SessionIds = sessionIds }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.checkInUse", [request], cancellationToken); } /// Returns a session's persisted remote-steerable flag, if any has been recorded. Internal: this is CLI-specific book-keeping used by `--continue` / `--resume` to inherit the prior session's remote-steerable preference. SDK consumers that want similar behavior should manage their own persistence around start/stop calls rather than relying on this runtime-side flag. /// Session ID to look up the persisted remote-steerable flag for. /// The to monitor for cancellation requests. The default is . /// The session's persisted remote-steerable flag, or omitted when no value has been persisted. internal async Task GetPersistedRemoteSteerableAsync(string sessionId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsGetPersistedRemoteSteerableRequest { SessionId = sessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getPersistedRemoteSteerable", [request], cancellationToken); } /// Closes a session: emits shutdown, flushes pending events, releases the in-use lock, and disposes the active session. /// Session ID to close. /// The to monitor for cancellation requests. The default is . /// Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active. public async Task CloseAsync(string sessionId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsCloseRequest { SessionId = sessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.close", [request], cancellationToken); } /// Closes, deactivates, and deletes a set of sessions, returning the bytes freed per session. /// Session IDs to close, deactivate, and delete from disk. /// The to monitor for cancellation requests. The default is . /// Map of sessionId -> bytes freed by removing the session's workspace directory. public async Task BulkDeleteAsync(IList sessionIds, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionIds); var request = new SessionsBulkDeleteRequest { SessionIds = sessionIds }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.bulkDelete", [request], cancellationToken); } /// Deletes sessions older than the given threshold, with optional dry-run and exclusion list. /// Delete sessions whose modifiedTime is at least this many days old. /// When true, only report what would be deleted without performing any deletion. /// When true, named sessions (set via /rename) are also eligible for pruning. /// Session IDs that should never be considered for pruning. /// The to monitor for cancellation requests. The default is . /// Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag. public async Task PruneOldAsync(long olderThanDays, bool? dryRun = null, bool? includeNamed = null, IList? excludeSessionIds = null, CancellationToken cancellationToken = default) { var request = new SessionsPruneOldRequest { OlderThanDays = olderThanDays, DryRun = dryRun, IncludeNamed = includeNamed, ExcludeSessionIds = excludeSessionIds }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.pruneOld", [request], cancellationToken); } /// Flushes a session's pending events to disk. /// Session ID whose pending events should be flushed to disk. /// The to monitor for cancellation requests. The default is . /// Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed). public async Task SaveAsync(string sessionId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsSaveRequest { SessionId = sessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.save", [request], cancellationToken); } /// Releases the in-use lock held by this process for a session. /// Session ID whose in-use lock should be released. /// The to monitor for cancellation requests. The default is . /// Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session. public async Task ReleaseLockAsync(string sessionId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsReleaseLockRequest { SessionId = sessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.releaseLock", [request], cancellationToken); } /// Backfills missing summary and context fields on the supplied session metadata records. /// Session metadata records to enrich. Records that already have summary and context are returned unchanged. /// The to monitor for cancellation requests. The default is . /// The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted. public async Task EnrichMetadataAsync(IList sessions, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessions); var request = new SessionsEnrichMetadataRequest { Sessions = sessions }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.enrichMetadata", [request], cancellationToken); } /// Reloads user, plugin, and (optionally) repo hooks on the active session. /// Active session ID to reload hooks for. /// When true, skip repo-level hooks. Use before folder trust is confirmed; loadDeferredRepoHooks loads them post-trust. /// The to monitor for cancellation requests. The default is . /// Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId. public async Task ReloadPluginHooksAsync(string sessionId, bool? deferRepoHooks = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsReloadPluginHooksRequest { SessionId = sessionId, DeferRepoHooks = deferRepoHooks }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.reloadPluginHooks", [request], cancellationToken); } /// Loads previously-deferred repo-level hooks on the active session, returning queued startup prompts. /// Active session ID whose deferred repo-level hooks should be loaded. /// The to monitor for cancellation requests. The default is . /// Queued repo-level startup prompts and the total hook command count after loading. public async Task LoadDeferredRepoHooksAsync(string sessionId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsLoadDeferredRepoHooksRequest { SessionId = sessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.loadDeferredRepoHooks", [request], cancellationToken); } /// Replaces the manager-wide additional plugins registered with the session manager. /// Manager-wide additional plugins to register. Replaces any previously-configured set. Pass an empty array to clear. /// The to monitor for cancellation requests. The default is . /// Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload. public async Task SetAdditionalPluginsAsync(IList plugins, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(plugins); var request = new SessionsSetAdditionalPluginsRequest { Plugins = plugins }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.setAdditionalPlugins", [request], cancellationToken); } /// Gets the dynamic-context board entry count associated with a session, when available. Internal: this exists solely so CLI telemetry events (`rem_spawn_gate`, `rem_consolidation_complete`) can pair START / END board counts around the detached rem-agent spawn. "Dynamic context board" is a runtime-internal concept that is not part of the public SDK contract; the long-term plan is to relocate the telemetry emission into the runtime so this method can be deleted entirely. /// Session ID whose board entry count should be returned. /// The to monitor for cancellation requests. The default is . /// Dynamic-context board entry count, when available. internal async Task GetBoardEntryCountAsync(string sessionId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new SessionsGetBoardEntryCountRequest { SessionId = sessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getBoardEntryCount", [request], cancellationToken); } /// Attaches the runtime-managed remote-control singleton to a session, awaiting initial setup. If remote control is already attached to a different session, the singleton is transferred (preserving the underlying Mission Control connection). Returns the final status. /// Local session id to attach remote control to. /// Configuration for the runtime-managed remote-control singleton. /// The to monitor for cancellation requests. The default is . /// Wrapper for the singleton's current status. public async Task StartRemoteControlAsync(string sessionId, RemoteControlConfig config, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); ArgumentNullException.ThrowIfNull(config); var request = new SessionsStartRemoteControlRequest { SessionId = sessionId, Config = config }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.startRemoteControl", [request], cancellationToken); } /// Atomically rebinds the remote-control singleton to a different session, preserving the underlying Mission Control connection. When `expectedFromSessionId` is provided and does not match the singleton's current `attachedSessionId`, the transfer is rejected with `transferred: false` and the current status is returned unchanged. /// Local session id to point remote control at. /// When provided, the transfer is rejected unless the singleton currently points at this session id (compare-and-swap semantics to avoid clobbering newer state). /// The to monitor for cancellation requests. The default is . /// Outcome of a transferRemoteControl call. public async Task TransferRemoteControlAsync(string toSessionId, string? expectedFromSessionId = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(toSessionId); var request = new SessionsTransferRemoteControlRequest { ToSessionId = toSessionId, ExpectedFromSessionId = expectedFromSessionId }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.transferRemoteControl", [request], cancellationToken); } /// Patches the steering state of the active remote-control singleton. When remote control is off, this is a no-op and the off status is returned. Today only `enabled: true` is actionable on the underlying exporter; passing `false` is reserved for future use. /// Target steering state. Today only `true` is actionable on the underlying exporter; `false` is reserved for future use. /// The to monitor for cancellation requests. The default is . /// Wrapper for the singleton's current status. public async Task SetRemoteControlSteeringAsync(bool enabled, CancellationToken cancellationToken = default) { var request = new SessionsSetRemoteControlSteeringRequest { Enabled = enabled }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.setRemoteControlSteering", [request], cancellationToken); } /// Stops the remote-control singleton. When `expectedSessionId` is provided and does not match the singleton's current `attachedSessionId`, the stop is rejected with `stopped: false` and the current status is returned unchanged (unless `force` is set, in which case the singleton is unconditionally torn down). /// When provided, the stop is rejected unless the singleton currently points at this session id (compare-and-swap semantics). /// When true, the singleton is unconditionally torn down regardless of `expectedSessionId`. Use during shutdown or explicit `/remote off`. /// The to monitor for cancellation requests. The default is . /// Outcome of a stopRemoteControl call. public async Task StopRemoteControlAsync(string? expectedSessionId = null, bool? force = null, CancellationToken cancellationToken = default) { var request = new SessionsStopRemoteControlRequest { ExpectedSessionId = expectedSessionId, Force = force }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.stopRemoteControl", [request], cancellationToken); } /// Returns the current state of the remote-control singleton, including the attached session id and frontend URL when active. /// The to monitor for cancellation requests. The default is . /// Wrapper for the singleton's current status. public async Task GetRemoteControlStatusAsync(CancellationToken cancellationToken = default) { return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.getRemoteControlStatus", [], cancellationToken); } /// Cursor-based long-poll for sessions spawned by the runtime (e.g. in response to a Mission Control `start_session` command). The cursor is an opaque token; pass it back to receive only spawn events that occurred AFTER the cursor was issued. Omit the cursor on the first call to receive any events buffered since the runtime started. Internal: this is a CLI background-daemon plumbing primitive. SDK consumers that need to react to runtime-spawned sessions should subscribe to a higher-level event stream rather than driving a long-poll loop. /// Opaque cursor returned by a previous poll. Omit on the first call to receive any spawn events buffered since the runtime started. /// Milliseconds to wait for new spawn events when the cursor is at the tail. 0 (default) returns immediately even if no events are buffered. Capped at 60000ms. /// The to monitor for cancellation requests. The default is . /// Batch of spawn events plus a cursor for follow-up polls. internal async Task PollSpawnedSessionsAsync(string? cursor = null, TimeSpan? waitMs = null, CancellationToken cancellationToken = default) { var request = new SessionsPollSpawnedSessionsRequest { Cursor = cursor, Wait = waitMs }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.pollSpawnedSessions", [request], cancellationToken); } /// Registers extension-provided tools on the given session, gated by an optional `enabled` callback. Returns an opaque unsubscribe function the caller must invoke to deregister the tools when the extension is torn down. Marked internal because `loader`, `enabled`, and the returned `unsubscribe` are in-process handles that cannot cross the JSON-RPC boundary. Disappears once extension discovery / launch / tool registration are owned by the runtime: SDK consumers will pass pure config (search paths, disabled ids) via `SessionOptions` and the runtime will resolve, launch, register, and tear down extensions itself. /// Session to register extension tools on. /// In-process ExtensionLoader handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. When the CLI migrates to a process-separated SDK, extension discovery/launch moves entirely into the runtime — the CLI passes pure config (search paths, disabled ids) via SessionOptions instead. /// Optional registration options. /// The to monitor for cancellation requests. The default is . /// Handle for releasing the extension tool registration. internal async Task RegisterExtensionToolsOnSessionAsync(string sessionId, object loader, SessionsRegisterExtensionToolsOnSessionOptions? options = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); ArgumentNullException.ThrowIfNull(loader); var request = new RegisterExtensionToolsParams { SessionId = sessionId, Loader = CopilotClient.ToJsonElementForWire(loader)!.Value, Options = options }; return await CopilotClient.InvokeRpcAsync(_rpc, "sessions.registerExtensionToolsOnSession", [request], cancellationToken); } /// Attaches (or detaches) an in-process ExtensionController delegate for the given session, used by shared-API surfaces that need to query or modify the session's extension state. Pass `controller: undefined` to detach. Marked internal because the controller is an in-process object that cannot cross the JSON-RPC boundary. Disappears alongside `registerExtensionToolsOnSession`: once the runtime owns extension management, the public surface exposes list/enable/disable/reload as dedicated RPCs served by the runtime. /// Session to attach the extension controller delegate to. /// In-process ExtensionController delegate (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. The post-SDK extension surface exposes list/enable/disable/reload via dedicated RPCs served by the runtime. /// The to monitor for cancellation requests. The default is . internal async Task ConfigureSessionExtensionsAsync(string sessionId, object? controller = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(sessionId); var request = new ConfigureSessionExtensionsParams { SessionId = sessionId, Controller = CopilotClient.ToJsonElementForWire(controller) }; await CopilotClient.InvokeRpcAsync(_rpc, "sessions.configureSessionExtensions", [request], cancellationToken); } } /// Provides server-scoped AgentRegistry APIs. [Experimental(Diagnostics.Experimental)] public sealed class ServerAgentRegistryApi { private readonly JsonRpc _rpc; internal ServerAgentRegistryApi(JsonRpc rpc) { _rpc = rpc; } /// Spawns a managed-server child with the supplied configuration and returns a discriminated-union result. The caller (typically the CLI controller) is responsible for attaching to the spawned child and sending any follow-up prompt. When the controller-local spawn gate is closed the server returns JSON-RPC MethodNotFound. /// Working directory for the spawned child (must be an existing directory). /// Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own default. /// Model identifier to apply to the new session. /// Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing whitespace, <=100 chars, no control chars, no double quotes. /// Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode. /// Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it post-attach via the standard LocalRpcSession.send path). /// The to monitor for cancellation requests. The default is . /// Outcome of an agentRegistry.spawn call. public async Task SpawnAsync(string cwd, string? agentName = null, string? model = null, string? name = null, AgentRegistrySpawnPermissionMode? permissionMode = null, string? initialPrompt = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(cwd); var request = new AgentRegistrySpawnRequest { Cwd = cwd, AgentName = agentName, Model = model, Name = name, PermissionMode = permissionMode, InitialPrompt = initialPrompt }; return await CopilotClient.InvokeRpcAsync(_rpc, "agentRegistry.spawn", [request], cancellationToken); } } /// Provides typed session-scoped RPC methods. public sealed class SessionRpc { private readonly CopilotSession _session; internal SessionRpc(CopilotSession session) { _session = session; } internal CopilotSession Session => _session; /// GitHubAuth APIs. public GitHubAuthApi GitHubAuth => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Canvas APIs. public CanvasApi Canvas => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Model APIs. public ModelApi Model => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Mode APIs. public ModeApi Mode => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Name APIs. public NameApi Name => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Plan APIs. public PlanApi Plan => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Workspaces APIs. public WorkspacesApi Workspaces => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Completions APIs. public CompletionsApi Completions => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Instructions APIs. public InstructionsApi Instructions => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Fleet APIs. public FleetApi Fleet => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Agent APIs. public AgentApi Agent => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Tasks APIs. public TasksApi Tasks => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Skills APIs. public SkillsApi Skills => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Mcp APIs. public McpApi Mcp => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Plugins APIs. public PluginsApi Plugins => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Provider APIs. public ProviderApi Provider => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Options APIs. public OptionsApi Options => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Lsp APIs. public LspApi Lsp => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Extensions APIs. public ExtensionsApi Extensions => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Tools APIs. public ToolsApi Tools => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Commands APIs. public CommandsApi Commands => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Telemetry APIs. public TelemetryApi Telemetry => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Ui APIs. public UiApi Ui => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Permissions APIs. public PermissionsApi Permissions => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Metadata APIs. public MetadataApi Metadata => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Shell APIs. public ShellApi Shell => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// History APIs. public HistoryApi History => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Queue APIs. public QueueApi Queue => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// EventLog APIs. public EventLogApi EventLog => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Usage APIs. public UsageApi Usage => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Remote APIs. public RemoteApi Remote => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Visibility APIs. public VisibilityApi Visibility => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Schedule APIs. public ScheduleApi Schedule => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Suspends the session while preserving persisted state for later resume. /// The to monitor for cancellation requests. The default is . [Experimental(Diagnostics.Experimental)] public async Task SuspendAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionSuspendRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.suspend", [request], cancellationToken); } /// Sends a user message to the session and returns its message ID. /// The user message text. /// If provided, this is shown in the timeline instead of `prompt`. /// Optional attachments (files, directories, selections, blobs, GitHub references) to include with the message. /// How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn. /// If true, adds the message to the front of the queue instead of the end. /// If false, this message will not trigger a Premium Request Unit charge. User messages default to billable. /// If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange. /// Optional provenance tag copied to the resulting user.message event. Must match one of three forms: the literal `system`, `command-<command-id>` for messages originating from a command (e.g. slash command, Mission Control command), or `schedule-<numeric-id>` for messages originating from a scheduled job. /// The UI mode the agent was in when this message was sent. Defaults to the session's current mode. /// Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key. /// W3C Trace Context traceparent header for distributed tracing of this agent turn. /// W3C Trace Context tracestate header for distributed tracing. /// If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. /// The to monitor for cancellation requests. The default is . /// Result of sending a user message. [Experimental(Diagnostics.Experimental)] public async Task SendAsync(string prompt, string? displayPrompt = null, IList? attachments = null, SendMode? mode = null, bool? prepend = null, bool? billable = null, string? requiredTool = null, string? source = null, SendAgentMode? agentMode = null, IDictionary? requestHeaders = null, string? traceparent = null, string? tracestate = null, bool? wait = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(prompt); _session.ThrowIfDisposed(); var request = new SendRequest { SessionId = _session.SessionId, Prompt = prompt, DisplayPrompt = displayPrompt, Attachments = attachments, Mode = mode, Prepend = prepend, Billable = billable, RequiredTool = requiredTool, Source = source, AgentMode = agentMode, RequestHeaders = requestHeaders, Traceparent = traceparent, Tracestate = tracestate, Wait = wait }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.send", [request], cancellationToken); } /// Aborts the current agent turn. /// Finite reason code describing why the current turn was aborted. /// The to monitor for cancellation requests. The default is . /// Result of aborting the current turn. [Experimental(Diagnostics.Experimental)] public async Task AbortAsync(AbortReason? reason = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new AbortRequest { SessionId = _session.SessionId, Reason = reason }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.abort", [request], cancellationToken); } /// Shuts down the session and persists its final state. Awaits any deferred sessionEnd hooks before resolving so user-supplied hook scripts complete before the runtime tears down. /// Why the session is being shut down. Defaults to "routine" when omitted. /// Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'. /// The to monitor for cancellation requests. The default is . [Experimental(Diagnostics.Experimental)] public async Task ShutdownAsync(ShutdownType? type = null, string? reason = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new ShutdownRequest { SessionId = _session.SessionId, Type = type, Reason = reason }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.shutdown", [request], cancellationToken); } /// Emits a user-visible session log event. /// Human-readable message. /// Log severity level. Determines how the message is displayed in the timeline. Defaults to "info". /// Domain category for this log entry (e.g., "mcp", "subscription", "policy", "model"). Maps to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to "notification". /// When true, the message is transient and not persisted to the session event log on disk. /// Optional URL the user can open in their browser for more details. /// Optional actionable tip displayed alongside the message. Only honored on `level: "info"`. /// The to monitor for cancellation requests. The default is . /// Identifier of the session event that was emitted for the log message. [Experimental(Diagnostics.Experimental)] public async Task LogAsync(string message, SessionLogLevel? level = null, string? type = null, bool? ephemeral = null, string? url = null, string? tip = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(message); _session.ThrowIfDisposed(); var request = new LogRequest { SessionId = _session.SessionId, Message = message, Level = level, Type = type, Ephemeral = ephemeral, Url = url, Tip = tip }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.log", [request], cancellationToken); } } /// Provides session-scoped GitHubAuth APIs. [Experimental(Diagnostics.Experimental)] public sealed class GitHubAuthApi { private readonly CopilotSession _session; internal GitHubAuthApi(CopilotSession session) { _session = session; } /// Gets authentication status and account metadata for the session. /// The to monitor for cancellation requests. The default is . /// Authentication status and account metadata for the session. public async Task GetStatusAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionGitHubAuthGetStatusRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.gitHubAuth.getStatus", [request], cancellationToken); } /// Updates the session's auth credentials used for outbound model and API requests. /// The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime installs the supplied value immediately for outbound model/API requests. When the credential carries a raw token (`token`, `env`, or `gh-cli`) but no `copilotUser`, the runtime additionally re-resolves `copilotUser` server-side (best-effort, asynchronously, after the synchronous install) so plan/quota/billing metadata regains fidelity; on resolution failure the verbatim credential remains installed. It does NOT otherwise validate the credential. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit. /// The to monitor for cancellation requests. The default is . /// Indicates whether the credential update succeeded. public async Task SetCredentialsAsync(AuthInfo? credentials = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionSetCredentialsParams { SessionId = _session.SessionId, Credentials = credentials }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.gitHubAuth.setCredentials", [request], cancellationToken); } } /// Provides session-scoped Canvas APIs. [Experimental(Diagnostics.Experimental)] public sealed class CanvasApi { private readonly CopilotSession _session; internal CanvasApi(CopilotSession session) { _session = session; } /// Lists canvases declared for the session. /// The to monitor for cancellation requests. The default is . /// Declared canvases available in this session. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionCanvasListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.canvas.list", [request], cancellationToken); } /// Lists currently open canvas instances for the live session. /// The to monitor for cancellation requests. The default is . /// Live open-canvas snapshot. public async Task ListOpenAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionCanvasListOpenRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.canvas.listOpen", [request], cancellationToken); } /// Opens or focuses a canvas instance. /// Provider-local canvas identifier. /// Caller-supplied stable instance identifier. /// Owning provider identifier. Optional when the canvasId is unique across providers; required to disambiguate when multiple providers register the same canvasId. /// Canvas open input. /// The to monitor for cancellation requests. The default is . /// Open canvas instance snapshot. public async Task OpenAsync(string canvasId, string instanceId, string? extensionId = null, object? input = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(canvasId); ArgumentNullException.ThrowIfNull(instanceId); _session.ThrowIfDisposed(); var request = new CanvasOpenRequest { SessionId = _session.SessionId, CanvasId = canvasId, InstanceId = instanceId, ExtensionId = extensionId, Input = CopilotClient.ToJsonElementForWire(input) }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.canvas.open", [request], cancellationToken); } /// Closes an open canvas instance. /// Open canvas instance identifier. /// The to monitor for cancellation requests. The default is . public async Task CloseAsync(string instanceId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(instanceId); _session.ThrowIfDisposed(); var request = new CanvasCloseRequest { SessionId = _session.SessionId, InstanceId = instanceId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.canvas.close", [request], cancellationToken); } /// Action APIs. public CanvasActionApi Action => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; } /// Provides session-scoped CanvasAction APIs. [Experimental(Diagnostics.Experimental)] public sealed class CanvasActionApi { private readonly CopilotSession _session; internal CanvasActionApi(CopilotSession session) { _session = session; } /// Invokes an action on an open canvas instance. /// Open canvas instance identifier. /// Action name to invoke. /// Action input. /// The to monitor for cancellation requests. The default is . /// Canvas action invocation result. public async Task InvokeAsync(string instanceId, string actionName, object? input = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(instanceId); ArgumentNullException.ThrowIfNull(actionName); _session.ThrowIfDisposed(); var request = new CanvasActionInvokeRequest { SessionId = _session.SessionId, InstanceId = instanceId, ActionName = actionName, Input = CopilotClient.ToJsonElementForWire(input) }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.canvas.action.invoke", [request], cancellationToken); } } /// Provides session-scoped Model APIs. [Experimental(Diagnostics.Experimental)] public sealed class ModelApi { private readonly CopilotSession _session; internal ModelApi(CopilotSession session) { _session = session; } /// Gets the currently selected model for the session. /// The to monitor for cancellation requests. The default is . /// The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume. public async Task GetCurrentAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionModelGetCurrentRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.getCurrent", [request], cancellationToken); } /// Switches the session to a model and optional reasoning configuration. /// Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model. /// Reasoning effort level to use for the model. "none" disables reasoning. /// Reasoning summary mode to request for supported model clients. /// Override individual model capabilities resolved by the runtime. /// Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier. /// The to monitor for cancellation requests. The default is . /// The model identifier active on the session after the switch. public async Task SwitchToAsync(string modelId, string? reasoningEffort = null, ReasoningSummary? reasoningSummary = null, ModelCapabilitiesOverride? modelCapabilities = null, ContextTier? contextTier = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(modelId); _session.ThrowIfDisposed(); var request = new ModelSwitchToRequest { SessionId = _session.SessionId, ModelId = modelId, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, ModelCapabilities = modelCapabilities, ContextTier = contextTier }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.switchTo", [request], cancellationToken); } /// Updates the session's reasoning effort without changing the selected model. /// Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling. /// The to monitor for cancellation requests. The default is . /// Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns. public async Task SetReasoningEffortAsync(string reasoningEffort, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reasoningEffort); _session.ThrowIfDisposed(); var request = new ModelSetReasoningEffortRequest { SessionId = _session.SessionId, ReasoningEffort = reasoningEffort }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.setReasoningEffort", [request], cancellationToken); } /// Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's. /// Optional listing options. /// The to monitor for cancellation requests. The default is . /// The list of models available to this session. public async Task ListAsync(ModelListRequest? request = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var rpcRequest = new ModelListRequestWithSession { SessionId = _session.SessionId, SkipCache = request?.SkipCache }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.list", [rpcRequest], cancellationToken); } } /// Provides session-scoped Mode APIs. [Experimental(Diagnostics.Experimental)] public sealed class ModeApi { private readonly CopilotSession _session; internal ModeApi(CopilotSession session) { _session = session; } /// Gets the current agent interaction mode. /// The to monitor for cancellation requests. The default is . /// The session mode the agent is operating in. public async Task GetAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionModeGetRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mode.get", [request], cancellationToken); } /// Sets the current agent interaction mode. /// The session mode the agent is operating in. /// The to monitor for cancellation requests. The default is . public async Task SetAsync(SessionMode mode, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new ModeSetRequest { SessionId = _session.SessionId, Mode = mode }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mode.set", [request], cancellationToken); } } /// Provides session-scoped Name APIs. [Experimental(Diagnostics.Experimental)] public sealed class NameApi { private readonly CopilotSession _session; internal NameApi(CopilotSession session) { _session = session; } /// Gets the session's friendly name. /// The to monitor for cancellation requests. The default is . /// The session's friendly name, or null when not yet set. public async Task GetAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionNameGetRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.name.get", [request], cancellationToken); } /// Sets the session's friendly name. /// New session name (1–100 characters, trimmed of leading/trailing whitespace). /// The to monitor for cancellation requests. The default is . public async Task SetAsync(string name, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); _session.ThrowIfDisposed(); var request = new NameSetRequest { SessionId = _session.SessionId, Name = name }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.name.set", [request], cancellationToken); } /// Persists an auto-generated session summary as the session's name when no user-set name exists. /// Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting. /// The to monitor for cancellation requests. The default is . /// Indicates whether the auto-generated summary was applied as the session's name. public async Task SetAutoAsync(string summary, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(summary); _session.ThrowIfDisposed(); var request = new NameSetAutoRequest { SessionId = _session.SessionId, Summary = summary }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.name.setAuto", [request], cancellationToken); } } /// Provides session-scoped Plan APIs. [Experimental(Diagnostics.Experimental)] public sealed class PlanApi { private readonly CopilotSession _session; internal PlanApi(CopilotSession session) { _session = session; } /// Reads the session plan file from the workspace. /// The to monitor for cancellation requests. The default is . /// Existence, contents, and resolved path of the session plan file. public async Task ReadAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionPlanReadRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.plan.read", [request], cancellationToken); } /// Writes new content to the session plan file. /// The new content for the plan file. /// The to monitor for cancellation requests. The default is . public async Task UpdateAsync(string content, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(content); _session.ThrowIfDisposed(); var request = new PlanUpdateRequest { SessionId = _session.SessionId, Content = content }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.plan.update", [request], cancellationToken); } /// Deletes the session plan file from the workspace. /// The to monitor for cancellation requests. The default is . public async Task DeleteAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionPlanDeleteRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.plan.delete", [request], cancellationToken); } /// Reads todo rows from the session SQL database for plan rendering. /// The to monitor for cancellation requests. The default is . /// Todo rows read from the session SQL database. Empty when no session database is available. public async Task ReadSqlTodosAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionPlanReadSqlTodosRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.plan.readSqlTodos", [request], cancellationToken); } /// Reads todo rows AND dependency edges from the session SQL database for structured progress UI. Same defensive behavior as readSqlTodos — returns empty arrays when the database, tables, or columns aren't available. Clients should call this on session start and after every `session.todos_changed` event to refresh structured-UI rendering. /// The to monitor for cancellation requests. The default is . /// Todo rows + dependency edges read from the session SQL database. public async Task ReadSqlTodosWithDependenciesAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionPlanReadSqlTodosWithDependenciesRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.plan.readSqlTodosWithDependencies", [request], cancellationToken); } } /// Provides session-scoped Workspaces APIs. [Experimental(Diagnostics.Experimental)] public sealed class WorkspacesApi { private readonly CopilotSession _session; internal WorkspacesApi(CopilotSession session) { _session = session; } /// Gets current workspace metadata for the session. /// The to monitor for cancellation requests. The default is . /// Current workspace metadata for the session, including its absolute filesystem path when available. public async Task GetWorkspaceAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionWorkspacesGetWorkspaceRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.getWorkspace", [request], cancellationToken); } /// Lists files stored in the session workspace files directory. /// The to monitor for cancellation requests. The default is . /// Relative paths of files stored in the session workspace files directory. public async Task ListFilesAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionWorkspacesListFilesRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.listFiles", [request], cancellationToken); } /// Reads a file from the session workspace files directory. /// Relative path within the workspace files directory. /// The to monitor for cancellation requests. The default is . /// Contents of the requested workspace file as a UTF-8 string. public async Task ReadFileAsync(string path, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(path); _session.ThrowIfDisposed(); var request = new WorkspacesReadFileRequest { SessionId = _session.SessionId, Path = path }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.readFile", [request], cancellationToken); } /// Creates or overwrites a file in the session workspace files directory. /// Relative path within the workspace files directory. /// File content to write as a UTF-8 string. /// The to monitor for cancellation requests. The default is . public async Task CreateFileAsync(string path, string content, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(path); ArgumentNullException.ThrowIfNull(content); _session.ThrowIfDisposed(); var request = new WorkspacesCreateFileRequest { SessionId = _session.SessionId, Path = path, Content = content }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.createFile", [request], cancellationToken); } /// Lists workspace checkpoints in chronological order. /// The to monitor for cancellation requests. The default is . /// Workspace checkpoints in chronological order; empty when the workspace is not enabled. public async Task ListCheckpointsAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionWorkspacesListCheckpointsRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.listCheckpoints", [request], cancellationToken); } /// Reads the content of a workspace checkpoint by number. /// Checkpoint number to read. /// The to monitor for cancellation requests. The default is . /// Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing. public async Task ReadCheckpointAsync(long number, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new WorkspacesReadCheckpointRequest { SessionId = _session.SessionId, Number = number }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.readCheckpoint", [request], cancellationToken); } /// Saves pasted content as a UTF-8 file in the session workspace. /// Pasted content to save as a UTF-8 file. /// The to monitor for cancellation requests. The default is . /// Descriptor for the saved paste file, or null when the workspace is unavailable. public async Task SaveLargePasteAsync(string content, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(content); _session.ThrowIfDisposed(); var request = new WorkspacesSaveLargePasteRequest { SessionId = _session.SessionId, Content = content }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.saveLargePaste", [request], cancellationToken); } /// Computes a diff for the session workspace. /// Diff mode requested by the client. /// When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false. /// The to monitor for cancellation requests. The default is . /// Workspace diff result for the requested mode. public async Task DiffAsync(WorkspaceDiffMode mode, bool? ignoreWhitespace = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new WorkspacesDiffRequest { SessionId = _session.SessionId, Mode = mode, IgnoreWhitespace = ignoreWhitespace }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.workspaces.diff", [request], cancellationToken); } } /// Provides session-scoped Completions APIs. [Experimental(Diagnostics.Experimental)] public sealed class CompletionsApi { private readonly CopilotSession _session; internal CompletionsApi(CopilotSession session) { _session = session; } /// Gets the characters that should trigger host-driven completions for the session. Empty disables host-driven completions (e.g. local sessions, or a relay host that does not advertise them). /// The to monitor for cancellation requests. The default is . /// Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`). public async Task GetTriggerCharactersAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionCompletionsGetTriggerCharactersRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.completions.getTriggerCharacters", [request], cancellationToken); } /// Requests host-driven completion items for the current composer input. Returns an empty list when the host has no items or does not support completions. /// The full composed composer input. /// Cursor offset within `text`, in UTF-16 code units. /// The to monitor for cancellation requests. The default is . /// Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions. public async Task RequestAsync(string text, long offset, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(text); _session.ThrowIfDisposed(); var request = new CompletionsRequestRequest { SessionId = _session.SessionId, Text = text, Offset = offset }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.completions.request", [request], cancellationToken); } } /// Provides session-scoped Instructions APIs. [Experimental(Diagnostics.Experimental)] public sealed class InstructionsApi { private readonly CopilotSession _session; internal InstructionsApi(CopilotSession session) { _session = session; } /// Gets instruction sources loaded for the session. /// The to monitor for cancellation requests. The default is . /// Instruction sources loaded for the session, in merge order. public async Task GetSourcesAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionInstructionsGetSourcesRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.instructions.getSources", [request], cancellationToken); } } /// Provides session-scoped Fleet APIs. [Experimental(Diagnostics.Experimental)] public sealed class FleetApi { private readonly CopilotSession _session; internal FleetApi(CopilotSession session) { _session = session; } /// Starts fleet mode by submitting the fleet orchestration prompt to the session. /// Optional user prompt to combine with fleet instructions. /// The to monitor for cancellation requests. The default is . /// Indicates whether fleet mode was successfully activated. public async Task StartAsync(string? prompt = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new FleetStartRequest { SessionId = _session.SessionId, Prompt = prompt }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.fleet.start", [request], cancellationToken); } } /// Provides session-scoped Agent APIs. [Experimental(Diagnostics.Experimental)] public sealed class AgentApi { private readonly CopilotSession _session; internal AgentApi(CopilotSession session) { _session = session; } /// Lists custom agents available to the session. /// The to monitor for cancellation requests. The default is . /// Custom agents available to the session. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionAgentListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.agent.list", [request], cancellationToken); } /// Gets the currently selected custom agent for the session. /// The to monitor for cancellation requests. The default is . /// The currently selected custom agent, or null when using the default agent. public async Task GetCurrentAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionAgentGetCurrentRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.agent.getCurrent", [request], cancellationToken); } /// Selects a custom agent for subsequent turns in the session. /// Name of the custom agent to select. /// The to monitor for cancellation requests. The default is . /// The newly selected custom agent. public async Task SelectAsync(string name, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); _session.ThrowIfDisposed(); var request = new AgentSelectRequest { SessionId = _session.SessionId, Name = name }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.agent.select", [request], cancellationToken); } /// Clears the selected custom agent and returns the session to the default agent. /// The to monitor for cancellation requests. The default is . public async Task DeselectAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionAgentDeselectRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.agent.deselect", [request], cancellationToken); } /// Reloads custom agent definitions and returns the refreshed list. /// The to monitor for cancellation requests. The default is . /// Custom agents available to the session after reloading definitions from disk. public async Task ReloadAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionAgentReloadRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.agent.reload", [request], cancellationToken); } } /// Provides session-scoped Tasks APIs. [Experimental(Diagnostics.Experimental)] public sealed class TasksApi { private readonly CopilotSession _session; internal TasksApi(CopilotSession session) { _session = session; } /// Starts a background agent task in the session. /// Type of agent to start (e.g., 'explore', 'task', 'general-purpose'). /// Task prompt for the agent. /// Short name for the agent, used to generate a human-readable ID. /// Short description of the task. /// Optional model override. /// The to monitor for cancellation requests. The default is . /// Identifier assigned to the newly started background agent task. public async Task StartAgentAsync(string agentType, string prompt, string name, string? description = null, string? model = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(agentType); ArgumentNullException.ThrowIfNull(prompt); ArgumentNullException.ThrowIfNull(name); _session.ThrowIfDisposed(); var request = new TasksStartAgentRequest { SessionId = _session.SessionId, AgentType = agentType, Prompt = prompt, Name = name, Description = description, Model = model }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.startAgent", [request], cancellationToken); } /// Lists background tasks tracked by the session. /// The to monitor for cancellation requests. The default is . /// Background tasks currently tracked by the session. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionTasksListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.list", [request], cancellationToken); } /// Refreshes metadata for any detached background shells the runtime knows about. /// The to monitor for cancellation requests. The default is . /// Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop. public async Task RefreshAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionTasksRefreshRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.refresh", [request], cancellationToken); } /// Waits for all in-flight background tasks and any follow-up turns to settle. /// The to monitor for cancellation requests. The default is . /// Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS). public async Task WaitForPendingAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionTasksWaitForPendingRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.waitForPending", [request], cancellationToken); } /// Returns progress information for a background task by ID. /// Task identifier (agent ID or shell ID). /// The to monitor for cancellation requests. The default is . /// Progress information for the task, or null when no task with that ID is tracked. public async Task GetProgressAsync(string id, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(id); _session.ThrowIfDisposed(); var request = new TasksGetProgressRequest { SessionId = _session.SessionId, Id = id }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.getProgress", [request], cancellationToken); } /// Returns the first sync-waiting task that can currently be promoted to background mode. /// The to monitor for cancellation requests. The default is . /// The first sync-waiting task that can currently be promoted to background mode. public async Task GetCurrentPromotableAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionTasksGetCurrentPromotableRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.getCurrentPromotable", [request], cancellationToken); } /// Promotes an eligible synchronously-waited task so it continues running in the background. /// Task identifier. /// The to monitor for cancellation requests. The default is . /// Indicates whether the task was successfully promoted to background mode. public async Task PromoteToBackgroundAsync(string id, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(id); _session.ThrowIfDisposed(); var request = new TasksPromoteToBackgroundRequest { SessionId = _session.SessionId, Id = id }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.promoteToBackground", [request], cancellationToken); } /// Atomically promotes the first promotable sync-waiting task to background mode and returns it. /// The to monitor for cancellation requests. The default is . /// The promoted task as it now exists in background mode, omitted if no promotable task was waiting. public async Task PromoteCurrentToBackgroundAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionTasksPromoteCurrentToBackgroundRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.promoteCurrentToBackground", [request], cancellationToken); } /// Cancels a background task. /// Task identifier. /// The to monitor for cancellation requests. The default is . /// Indicates whether the background task was successfully cancelled. public async Task CancelAsync(string id, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(id); _session.ThrowIfDisposed(); var request = new TasksCancelRequest { SessionId = _session.SessionId, Id = id }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.cancel", [request], cancellationToken); } /// Removes a completed or cancelled background task from tracking. /// Task identifier. /// The to monitor for cancellation requests. The default is . /// Indicates whether the task was removed. False when the task does not exist or is still running/idle. public async Task RemoveAsync(string id, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(id); _session.ThrowIfDisposed(); var request = new TasksRemoveRequest { SessionId = _session.SessionId, Id = id }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.remove", [request], cancellationToken); } /// Sends a message to a background agent task. /// Agent task identifier. /// Message content to send to the agent. /// Agent ID of the sender, if sent on behalf of another agent. /// The to monitor for cancellation requests. The default is . /// Indicates whether the message was delivered, with an error message when delivery failed. public async Task SendMessageAsync(string id, string message, string? fromAgentId = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(id); ArgumentNullException.ThrowIfNull(message); _session.ThrowIfDisposed(); var request = new TasksSendMessageRequest { SessionId = _session.SessionId, Id = id, Message = message, FromAgentId = fromAgentId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tasks.sendMessage", [request], cancellationToken); } } /// Provides session-scoped Skills APIs. [Experimental(Diagnostics.Experimental)] public sealed class SkillsApi { private readonly CopilotSession _session; internal SkillsApi(CopilotSession session) { _session = session; } /// Lists skills available to the session. /// The to monitor for cancellation requests. The default is . /// Skills available to the session, with their enabled state. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionSkillsListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.skills.list", [request], cancellationToken); } /// Returns the skills that have been invoked during this session. /// The to monitor for cancellation requests. The default is . /// Skills invoked during this session, ordered by invocation time (most recent last). public async Task GetInvokedAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionSkillsGetInvokedRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.skills.getInvoked", [request], cancellationToken); } /// Enables a skill for the session. /// Name of the skill to enable. /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(string name, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); _session.ThrowIfDisposed(); var request = new SkillsEnableRequest { SessionId = _session.SessionId, Name = name }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.skills.enable", [request], cancellationToken); } /// Disables a skill for the session. /// Name of the skill to disable. /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(string name, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); _session.ThrowIfDisposed(); var request = new SkillsDisableRequest { SessionId = _session.SessionId, Name = name }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.skills.disable", [request], cancellationToken); } /// Reloads skill definitions for the session. /// The to monitor for cancellation requests. The default is . /// Diagnostics from reloading skill definitions, with warnings and errors as separate lists. public async Task ReloadAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionSkillsReloadRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.skills.reload", [request], cancellationToken); } /// Ensures the session's skill definitions have been loaded from disk. /// The to monitor for cancellation requests. The default is . public async Task EnsureLoadedAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionSkillsEnsureLoadedRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.skills.ensureLoaded", [request], cancellationToken); } } /// Provides session-scoped Mcp APIs. [Experimental(Diagnostics.Experimental)] public sealed class McpApi { private readonly CopilotSession _session; internal McpApi(CopilotSession session) { _session = session; } /// Lists MCP servers configured for the session, their connection status, and host-level state. The host-level state (disabled/filtered servers, failed/needs-auth/pending connections, mcp3p policy, full config) is empty/zero when no MCP host has been initialized for the session. /// The to monitor for cancellation requests. The default is . /// MCP servers configured for the session, with their connection status and host-level state. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionMcpListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.list", [request], cancellationToken); } /// Lists the tools exposed by a connected MCP server on this session's host. /// Name of the connected MCP server whose tools to list. /// The to monitor for cancellation requests. The default is . /// Tools exposed by the connected MCP server. Throws when the server is not connected. public async Task ListToolsAsync(string serverName, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); _session.ThrowIfDisposed(); var request = new McpListToolsRequest { SessionId = _session.SessionId, ServerName = serverName }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.listTools", [request], cancellationToken); } /// Enables an MCP server for the session. /// Name of the MCP server to enable. /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(string serverName, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); _session.ThrowIfDisposed(); var request = new McpEnableRequest { SessionId = _session.SessionId, ServerName = serverName }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.enable", [request], cancellationToken); } /// Disables an MCP server for the session. /// Name of the MCP server to disable. /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(string serverName, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); _session.ThrowIfDisposed(); var request = new McpDisableRequest { SessionId = _session.SessionId, ServerName = serverName }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.disable", [request], cancellationToken); } /// Reloads MCP server connections for the session. /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionMcpReloadRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.reload", [request], cancellationToken); } /// Reloads MCP server connections for the session with an explicit host-provided configuration. /// Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire). /// The to monitor for cancellation requests. The default is . /// MCP server startup filtering result. internal async Task ReloadWithConfigAsync(object config, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(config); _session.ThrowIfDisposed(); var request = new McpReloadWithConfigRequest { SessionId = _session.SessionId, Config = CopilotClient.ToJsonElementForWire(config)!.Value }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.reloadWithConfig", [request], cancellationToken); } /// Runs an MCP sampling inference on behalf of an MCP server. /// Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call. /// Name of the MCP server that initiated the sampling request. /// The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle). /// Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally. /// The to monitor for cancellation requests. The default is . /// Outcome of an MCP sampling execution: success result, failure error, or cancellation. public async Task ExecuteSamplingAsync(string requestId, string serverName, object mcpRequestId, McpExecuteSamplingRequest request, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(serverName); ArgumentNullException.ThrowIfNull(mcpRequestId); ArgumentNullException.ThrowIfNull(request); _session.ThrowIfDisposed(); var rpcRequest = new McpExecuteSamplingParams { SessionId = _session.SessionId, RequestId = requestId, ServerName = serverName, McpRequestId = CopilotClient.ToJsonElementForWire(mcpRequestId)!.Value, Request = request }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.executeSampling", [rpcRequest], cancellationToken); } /// Cancels an in-flight MCP sampling execution by request ID. /// The requestId previously passed to executeSampling that should be cancelled. /// The to monitor for cancellation requests. The default is . /// Indicates whether an in-flight sampling execution with the given requestId was found and cancelled. public async Task CancelSamplingExecutionAsync(string requestId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); _session.ThrowIfDisposed(); var request = new McpCancelSamplingExecutionParams { SessionId = _session.SessionId, RequestId = requestId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.cancelSamplingExecution", [request], cancellationToken); } /// Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect). /// How environment-variable values supplied to MCP servers are resolved. "direct" passes literal string values; "indirect" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to "direct". /// The to monitor for cancellation requests. The default is . /// Env-value mode recorded on the session after the update. public async Task SetEnvValueModeAsync(McpSetEnvValueModeDetails mode, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new McpSetEnvValueModeParams { SessionId = _session.SessionId, Mode = mode }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.setEnvValueMode", [request], cancellationToken); } /// Removes the auto-managed `github` MCP server when present. /// The to monitor for cancellation requests. The default is . /// Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove). public async Task RemoveGitHubAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionMcpRemoveGitHubRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.removeGitHub", [request], cancellationToken); } /// Configures the built-in GitHub MCP server for the session's current auth context. /// Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire). /// The to monitor for cancellation requests. The default is . /// Result of configuring GitHub MCP. internal async Task ConfigureGitHubAsync(object authInfo, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(authInfo); _session.ThrowIfDisposed(); var request = new McpConfigureGitHubRequest { SessionId = _session.SessionId, AuthInfo = CopilotClient.ToJsonElementForWire(authInfo)!.Value }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.configureGitHub", [request], cancellationToken); } /// Starts an individual MCP server on the session's host. /// Name of the MCP server to start. /// Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime shape supplied only by in-process CLI callers. /// The to monitor for cancellation requests. The default is . internal async Task StartServerAsync(string serverName, object config, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); ArgumentNullException.ThrowIfNull(config); _session.ThrowIfDisposed(); var request = new McpStartServerRequest { SessionId = _session.SessionId, ServerName = serverName, Config = CopilotClient.ToJsonElementForWire(config)!.Value }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.startServer", [request], cancellationToken); } /// Restarts an individual MCP server on the session's host (stops then starts). /// Name of the MCP server to restart. /// Opaque server configuration (MCPServerConfig). Marked internal: an in-process runtime shape supplied only by in-process CLI callers. /// The to monitor for cancellation requests. The default is . internal async Task RestartServerAsync(string serverName, object config, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); ArgumentNullException.ThrowIfNull(config); _session.ThrowIfDisposed(); var request = new McpRestartServerRequest { SessionId = _session.SessionId, ServerName = serverName, Config = CopilotClient.ToJsonElementForWire(config)!.Value }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.restartServer", [request], cancellationToken); } /// Stops an individual MCP server on the session's host. /// Name of the MCP server to stop. /// The to monitor for cancellation requests. The default is . public async Task StopServerAsync(string serverName, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); _session.ThrowIfDisposed(); var request = new McpStopServerRequest { SessionId = _session.SessionId, ServerName = serverName }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.stopServer", [request], cancellationToken); } /// Registers a pre-connected external MCP client (e.g. IDE) on the session's host. The caller retains lifecycle ownership of the client and transport. Marked internal because the `client` and `transport` arguments are in-process MCP SDK instances that cannot be serialized across the JSON-RPC boundary; once the CLI moves on top of the SDK, external clients will be expressed as transport configs the runtime can construct itself. /// Logical server name for the external client. /// In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary. /// In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary. /// In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions. /// The to monitor for cancellation requests. The default is . internal async Task RegisterExternalClientAsync(string serverName, object client, object transport, object config, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); ArgumentNullException.ThrowIfNull(client); ArgumentNullException.ThrowIfNull(transport); ArgumentNullException.ThrowIfNull(config); _session.ThrowIfDisposed(); var request = new McpRegisterExternalClientRequest { SessionId = _session.SessionId, ServerName = serverName, Client = CopilotClient.ToJsonElementForWire(client)!.Value, Transport = CopilotClient.ToJsonElementForWire(transport)!.Value, Config = CopilotClient.ToJsonElementForWire(config)!.Value }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.registerExternalClient", [request], cancellationToken); } /// Unregisters a previously registered external MCP client by server name. Marked internal as the paired companion of `registerExternalClient`: only in-process callers that registered a client this way can meaningfully unregister it. Disappears alongside `registerExternalClient`: once external clients are described to the runtime as config rather than handed in as instances, lifecycle (including deregistration) is owned entirely by the runtime. /// Server name of the external client to unregister. /// The to monitor for cancellation requests. The default is . internal async Task UnregisterExternalClientAsync(string serverName, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); _session.ThrowIfDisposed(); var request = new McpUnregisterExternalClientRequest { SessionId = _session.SessionId, ServerName = serverName }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.unregisterExternalClient", [request], cancellationToken); } /// Checks whether a named MCP server is currently running on the session's host. /// Name of the MCP server to check. /// The to monitor for cancellation requests. The default is . /// Whether the named MCP server is running. public async Task IsServerRunningAsync(string serverName, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); _session.ThrowIfDisposed(); var request = new McpIsServerRunningRequest { SessionId = _session.SessionId, ServerName = serverName }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.isServerRunning", [request], cancellationToken); } /// Oauth APIs. public McpOauthApi Oauth => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Headers APIs. public McpHeadersApi Headers => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Apps APIs. public McpAppsApi Apps => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; } /// Provides session-scoped McpOauth APIs. [Experimental(Diagnostics.Experimental)] public sealed class McpOauthApi { private readonly CopilotSession _session; internal McpOauthApi(CopilotSession session) { _session = session; } /// Responds to a pending MCP OAuth request with an in-process provider. This internal CLI-only API accepts a live OAuthClientProvider instance and cannot be used over the SDK JSON-RPC boundary. Use session.mcp.oauth.handlePendingRequest instead for the public SDK-safe response path. /// OAuth request identifier from mcp.oauth_required. /// In-process OAuthClientProvider instance, or omitted to deny. Marked internal: cannot be serialized across the JSON-RPC boundary. /// The to monitor for cancellation requests. The default is . /// Empty result after recording the MCP OAuth response. internal async Task RespondAsync(string requestId, object? provider = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); _session.ThrowIfDisposed(); var request = new McpOauthRespondRequest { SessionId = _session.SessionId, RequestId = requestId, Provider = CopilotClient.ToJsonElementForWire(provider) }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.respond", [request], cancellationToken); } /// Resolves a pending MCP OAuth request with a host-provided token or cancellation. The pending request is emitted as mcp.oauth_required with the data necessary to authorize the request. /// OAuth request identifier from the mcp.oauth_required event. /// Host response to the pending OAuth request. /// The to monitor for cancellation requests. The default is . /// Indicates whether the pending MCP OAuth response was accepted. public async Task HandlePendingRequestAsync(string requestId, McpOauthPendingRequestResponse result, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(result); _session.ThrowIfDisposed(); var request = new McpOauthHandlePendingRequest { SessionId = _session.SessionId, RequestId = requestId, Result = result }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.handlePendingRequest", [request], cancellationToken); } /// Starts OAuth authentication for a remote MCP server. /// Name of the remote MCP server to authenticate. /// When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck. /// Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees. /// Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return. /// Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration. /// Optional OAuth client secret override for this login. The runtime treats this as an ephemeral host-owned secret, uses it for this authentication attempt and does not persist it. /// Optional override indicating whether the static OAuth client is public. When false, the runtime treats it as confidential and uses the per-login clientSecret if provided, otherwise retrieving the client secret from the MCP OAuth secret store. /// Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified. /// The to monitor for cancellation requests. The default is . /// OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. public async Task LoginAsync(string serverName, bool? forceReauth = null, string? clientName = null, string? callbackSuccessMessage = null, string? clientId = null, string? clientSecret = null, bool? publicClient = null, McpOauthLoginGrantType? grantType = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); _session.ThrowIfDisposed(); var request = new McpOauthLoginRequest { SessionId = _session.SessionId, ServerName = serverName, ForceReauth = forceReauth, ClientName = clientName, CallbackSuccessMessage = callbackSuccessMessage, ClientId = clientId, ClientSecret = clientSecret, PublicClient = publicClient, GrantType = grantType }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.oauth.login", [request], cancellationToken); } } /// Provides session-scoped McpHeaders APIs. [Experimental(Diagnostics.Experimental)] public sealed class McpHeadersApi { private readonly CopilotSession _session; internal McpHeadersApi(CopilotSession session) { _session = session; } /// Responds to a pending MCP dynamic headers refresh request. Hosts that subscribe to `mcp.headers_refresh_required` use this to provide short-lived per-server headers or to indicate that no dynamic headers are available for this refresh. /// Headers refresh request identifier from mcp.headers_refresh_required. /// Host response: supply dynamic headers or decline this refresh. /// The to monitor for cancellation requests. The default is . /// Indicates whether the pending MCP headers refresh response was accepted. public async Task HandlePendingHeadersRefreshRequestAsync(string requestId, McpHeadersHandlePendingHeadersRefreshRequest result, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(result); _session.ThrowIfDisposed(); var request = new McpHeadersHandlePendingHeadersRefreshRequestRequest { SessionId = _session.SessionId, RequestId = requestId, Result = result }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.headers.handlePendingHeadersRefreshRequest", [request], cancellationToken); } } /// Provides session-scoped McpApps APIs. [Experimental(Diagnostics.Experimental)] public sealed class McpAppsApi { private readonly CopilotSession _session; internal McpAppsApi(CopilotSession session) { _session = session; } /// Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability. /// Name of the MCP server hosting the resource. /// Resource URI (typically ui://...). /// The to monitor for cancellation requests. The default is . /// Resource contents returned by the MCP server. public async Task ReadResourceAsync(string serverName, string uri, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); ArgumentNullException.ThrowIfNull(uri); _session.ThrowIfDisposed(); var request = new McpAppsReadResourceRequest { SessionId = _session.SessionId, ServerName = serverName, Uri = uri }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.readResource", [request], cancellationToken); } /// List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`. /// MCP server hosting the app. /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. /// The to monitor for cancellation requests. The default is . /// App-callable tools from the named MCP server. public async Task ListToolsAsync(string serverName, string originServerName, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); ArgumentNullException.ThrowIfNull(originServerName); _session.ThrowIfDisposed(); var request = new McpAppsListToolsRequest { SessionId = _session.SessionId, ServerName = serverName, OriginServerName = originServerName }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.listTools", [request], cancellationToken); } /// Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`. /// MCP server hosting the tool. /// MCP tool name. /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. /// Tool arguments. /// The to monitor for cancellation requests. The default is . /// Standard MCP CallToolResult. public async Task> CallToolAsync(string serverName, string toolName, string originServerName, IDictionary? arguments = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); ArgumentNullException.ThrowIfNull(toolName); ArgumentNullException.ThrowIfNull(originServerName); _session.ThrowIfDisposed(); var request = new McpAppsCallToolRequest { SessionId = _session.SessionId, ServerName = serverName, ToolName = toolName, OriginServerName = originServerName, Arguments = arguments }; return await CopilotClient.InvokeRpcAsync>(_session.Rpc, "session.mcp.apps.callTool", [request], cancellationToken); } /// Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI. /// Host context advertised to MCP App guests. /// The to monitor for cancellation requests. The default is . public async Task SetHostContextAsync(McpAppsSetHostContextDetails context, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(context); _session.ThrowIfDisposed(); var request = new McpAppsSetHostContextRequest { SessionId = _session.SessionId, Context = context }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.setHostContext", [request], cancellationToken); } /// Read the current host context advertised to MCP App guests. /// The to monitor for cancellation requests. The default is . /// Current host context advertised to MCP App guests. public async Task GetHostContextAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionMcpAppsGetHostContextRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.getHostContext", [request], cancellationToken); } /// Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, feature-flag state, advertised extension, and how many tools have `_meta.ui` populated. /// MCP server to probe. /// The to monitor for cancellation requests. The default is . /// Diagnostic snapshot of MCP Apps wiring for the named server. public async Task DiagnoseAsync(string serverName, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); _session.ThrowIfDisposed(); var request = new McpAppsDiagnoseRequest { SessionId = _session.SessionId, ServerName = serverName }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.diagnose", [request], cancellationToken); } } /// Provides session-scoped Plugins APIs. [Experimental(Diagnostics.Experimental)] public sealed class PluginsApi { private readonly CopilotSession _session; internal PluginsApi(CopilotSession session) { _session = session; } /// Lists plugins installed for the session. /// The to monitor for cancellation requests. The default is . /// Plugins installed for the session, with their enabled state and version metadata. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionPluginsListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.plugins.list", [request], cancellationToken); } /// Reloads the session's plugin set, refreshing MCP servers, custom agents, hooks, and skills cache so SDK-driven changes via `server.plugins.*` take effect immediately. /// Optional flags controlling which side effects the reload performs. /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(PluginsReloadRequest? request = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var rpcRequest = new PluginsReloadRequestWithSession { SessionId = _session.SessionId, ReloadMcp = request?.ReloadMcp, ReloadCustomAgents = request?.ReloadCustomAgents, ReloadHooks = request?.ReloadHooks, DeferRepoHooks = request?.DeferRepoHooks }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.plugins.reload", [rpcRequest], cancellationToken); } } /// Provides session-scoped Provider APIs. [Experimental(Diagnostics.Experimental)] public sealed class ProviderApi { private readonly CopilotSession _session; internal ProviderApi(CopilotSession session) { _session = session; } /// Returns the provider endpoint and credentials the session is currently configured to talk to, so the caller can make inference calls directly against the same backend the session uses. /// Optional model identifier to scope the endpoint snapshot to. /// The to monitor for cancellation requests. The default is . /// A snapshot of the provider endpoint the session is currently configured to talk to. public async Task GetEndpointAsync(ProviderGetEndpointRequest? request = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var rpcRequest = new ProviderGetEndpointRequestWithSession { SessionId = _session.SessionId, ModelId = request?.ModelId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.provider.getEndpoint", [rpcRequest], cancellationToken); } /// Adds BYOK providers and/or models to the session's registry at runtime, extending the additive registry built from the session's `providers`/`models` options. Both fields are optional, so a call may add providers only, models only, or both. Within a single call providers are registered before models, so a model may reference a provider added in the same call; across calls a model may reference any provider already registered (from session creation or a prior add). A model whose referenced provider is not registered by the end of the call is rejected. Newly added models become selectable via `model.list` / `model.switchTo` and are inherited by sub-agents spawned afterwards. /// Named BYOK provider connections to register, additive to any providers already in the registry. Each name must be unique across the registry and must not contain '/'. /// BYOK model definitions to register. Each must reference a provider that is already registered or included in this same call. Selection ids (`provider/id`) must be unique across the registry. /// The to monitor for cancellation requests. The default is . /// The selectable model entries synthesized for the models added by this call. public async Task AddAsync(IList? providers = null, IList? models = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new ProviderAddRequest { SessionId = _session.SessionId, Providers = providers, Models = models }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.provider.add", [request], cancellationToken); } } /// Provides session-scoped Options APIs. [Experimental(Diagnostics.Experimental)] public sealed class OptionsApi { private readonly CopilotSession _session; internal OptionsApi(CopilotSession session) { _session = session; } /// Patches the genuinely-mutable subset of session options. /// The model ID to use for assistant turns. /// Per-property model capability overrides for the selected model. /// Reasoning effort for the selected model (model-defined enum). /// Reasoning summary mode for supported model clients. /// Identifier of the client driving the session. /// Identifier sent to LSP-style integrations. /// Stable integration identifier used for analytics and rate-limit attribution. /// Map of feature-flag IDs to their boolean enabled state. /// Whether experimental capabilities are enabled. /// Custom model-provider configuration (BYOK). /// Options scoped to the built-in CAPI (Copilot API) provider. /// Absolute working-directory path for shell tools. /// Allowlist of tool names available to this session. /// Denylist of tool names for this session. /// Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available. /// Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set. /// Whether shell-script safety heuristics are enabled. /// Shell init profile (`None` or `NonInteractive`). /// Per-shell process flags (e.g., `pwsh` arguments). /// Resolved sandbox configuration. /// Whether interactive shell sessions are logged. /// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). /// Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers. /// Additional directories to search for skills. /// Skill IDs that should be excluded from this session. /// Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions` and the runtime-side `ON_DEMAND_INSTRUCTIONS` feature flag. /// Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB. /// Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes. /// Whether to default custom agents to local-only execution. /// When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement. /// Whether to skip loading custom instruction sources. /// Instruction source IDs to exclude from the system prompt. /// Whether to include the `Co-authored-by` trailer in commit messages. /// Optional path for trajectory output. /// Whether to stream model responses. /// Override URL for the Copilot API endpoint. /// Whether to disable the `ask_user` tool (encourages autonomous behavior). /// Whether to allow auto-mode continuation across turns. /// Whether the session is running in an interactive UI. /// Whether to surface reasoning-summary events from the model. /// Runtime context discriminator (e.g., `cli`, `actions`). /// Override directory for the session-events log. When unset, the runtime's default events log directory is used. /// Additional content-exclusion policies to merge into the session's policy set. /// Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users). /// Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged. /// Whether to skip embedding retrieval pipeline initialization and execution. /// Organization-level custom instructions to inject into the system prompt. /// Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism. /// Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt). /// Whether to enable cross-session store writes and reads. /// Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset. /// Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier. /// Optional session limits. Pass null to clear the session limits. /// The to monitor for cancellation requests. The default is . /// Indicates whether the session options patch was applied successfully. public async Task UpdateAsync(string? model = null, ModelCapabilitiesOverride? modelCapabilitiesOverrides = null, string? reasoningEffort = null, OptionsUpdateReasoningSummary? reasoningSummary = null, string? clientName = null, string? lspClientName = null, string? integrationId = null, IDictionary? featureFlags = null, bool? isExperimentalMode = null, ProviderConfig? provider = null, CapiSessionOptions? capi = null, string? workingDirectory = null, IList? availableTools = null, IList? excludedTools = null, IList? excludedBuiltinAgents = null, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = null, bool? allowAllMcpServerInstructions = null, IList? skillDirectories = null, IList? disabledSkills = null, bool? enableOnDemandInstructionDiscovery = null, long? maxInlineBinaryBytes = null, IList? installedPlugins = null, bool? customAgentsLocalOnly = null, bool? suppressCustomAgentPrompt = null, bool? skipCustomInstructions = null, IList? disabledInstructionSources = null, bool? coauthorEnabled = null, string? trajectoryFile = null, bool? enableStreaming = null, string? copilotUrl = null, bool? askUserDisabled = null, bool? continueOnAutoMode = null, bool? runningInInteractiveMode = null, bool? enableReasoningSummaries = null, string? agentContext = null, string? eventsLogDirectory = null, IList? additionalContentExclusionPolicies = null, bool? manageScheduleEnabled = null, IList? sessionCapabilities = null, bool? skipEmbeddingRetrieval = null, string? organizationCustomInstructions = null, bool? enableFileHooks = null, bool? enableHostGitOperations = null, bool? enableSessionStore = null, bool? enableSkills = null, OptionsUpdateContextTier? contextTier = null, SessionLimitsConfig? sessionLimits = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionUpdateOptionsParams { SessionId = _session.SessionId, Model = model, ModelCapabilitiesOverrides = modelCapabilitiesOverrides, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, ClientName = clientName, LspClientName = lspClientName, IntegrationId = integrationId, FeatureFlags = featureFlags, IsExperimentalMode = isExperimentalMode, Provider = provider, Capi = capi, WorkingDirectory = workingDirectory, AvailableTools = availableTools, ExcludedTools = excludedTools, ExcludedBuiltinAgents = excludedBuiltinAgents, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, AllowAllMcpServerInstructions = allowAllMcpServerInstructions, SkillDirectories = skillDirectories, DisabledSkills = disabledSkills, EnableOnDemandInstructionDiscovery = enableOnDemandInstructionDiscovery, MaxInlineBinaryBytes = maxInlineBinaryBytes, InstalledPlugins = installedPlugins, CustomAgentsLocalOnly = customAgentsLocalOnly, SuppressCustomAgentPrompt = suppressCustomAgentPrompt, SkipCustomInstructions = skipCustomInstructions, DisabledInstructionSources = disabledInstructionSources, CoauthorEnabled = coauthorEnabled, TrajectoryFile = trajectoryFile, EnableStreaming = enableStreaming, CopilotUrl = copilotUrl, AskUserDisabled = askUserDisabled, ContinueOnAutoMode = continueOnAutoMode, RunningInInteractiveMode = runningInInteractiveMode, EnableReasoningSummaries = enableReasoningSummaries, AgentContext = agentContext, EventsLogDirectory = eventsLogDirectory, AdditionalContentExclusionPolicies = additionalContentExclusionPolicies, ManageScheduleEnabled = manageScheduleEnabled, SessionCapabilities = sessionCapabilities, SkipEmbeddingRetrieval = skipEmbeddingRetrieval, OrganizationCustomInstructions = organizationCustomInstructions, EnableFileHooks = enableFileHooks, EnableHostGitOperations = enableHostGitOperations, EnableSessionStore = enableSessionStore, EnableSkills = enableSkills, ContextTier = contextTier, SessionLimits = sessionLimits }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.options.update", [request], cancellationToken); } } /// Provides session-scoped Lsp APIs. [Experimental(Diagnostics.Experimental)] public sealed class LspApi { private readonly CopilotSession _session; internal LspApi(CopilotSession session) { _session = session; } /// Loads the merged LSP configuration set for the session's working directory. /// Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted. /// Git root used as the boundary when traversing for project-level LSP configs (supports monorepos). /// Force re-initialization even when LSP configs were already loaded for the working directory. /// The to monitor for cancellation requests. The default is . public async Task InitializeAsync(string? workingDirectory = null, string? gitRoot = null, bool? force = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new LspInitializeRequest { SessionId = _session.SessionId, WorkingDirectory = workingDirectory, GitRoot = gitRoot, Force = force }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.lsp.initialize", [request], cancellationToken); } } /// Provides session-scoped Extensions APIs. [Experimental(Diagnostics.Experimental)] public sealed class ExtensionsApi { private readonly CopilotSession _session; internal ExtensionsApi(CopilotSession session) { _session = session; } /// Lists extensions discovered for the session and their current status. /// The to monitor for cancellation requests. The default is . /// Extensions discovered for the session, with their current status. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionExtensionsListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.extensions.list", [request], cancellationToken); } /// Enables an extension for the session. /// Source-qualified extension ID to enable. /// The to monitor for cancellation requests. The default is . public async Task EnableAsync(string id, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(id); _session.ThrowIfDisposed(); var request = new ExtensionsEnableRequest { SessionId = _session.SessionId, Id = id }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.extensions.enable", [request], cancellationToken); } /// Disables an extension for the session. /// Source-qualified extension ID to disable. /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(string id, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(id); _session.ThrowIfDisposed(); var request = new ExtensionsDisableRequest { SessionId = _session.SessionId, Id = id }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.extensions.disable", [request], cancellationToken); } /// Reloads extension definitions and processes for the session. /// The to monitor for cancellation requests. The default is . public async Task ReloadAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionExtensionsReloadRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.extensions.reload", [request], cancellationToken); } /// Push attachments into the next user-message turn from an extension. The host should surface them as composer pills and forward them via the next session.send call. Callable only by extension-owned connections. /// Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape. /// Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment. /// The to monitor for cancellation requests. The default is . public async Task SendAttachmentsToMessageAsync(IList attachments, string? instanceId = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(attachments); _session.ThrowIfDisposed(); var request = new SendAttachmentsToMessageParams { SessionId = _session.SessionId, Attachments = attachments, InstanceId = instanceId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.extensions.sendAttachmentsToMessage", [request], cancellationToken); } } /// Provides session-scoped Tools APIs. [Experimental(Diagnostics.Experimental)] public sealed class ToolsApi { private readonly CopilotSession _session; internal ToolsApi(CopilotSession session) { _session = session; } /// Provides the result for a pending external tool call. /// Request ID of the pending tool call. /// Tool call result (string or expanded result object). /// Error message if the tool call failed. /// The to monitor for cancellation requests. The default is . /// Indicates whether the external tool call result was handled successfully. public async Task HandlePendingToolCallAsync(string requestId, object? result = null, string? error = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); _session.ThrowIfDisposed(); var request = new HandlePendingToolCallRequest { SessionId = _session.SessionId, RequestId = requestId, Result = CopilotClient.ToJsonElementForWire(result), Error = error }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tools.handlePendingToolCall", [request], cancellationToken); } /// Resolves, builds, and validates the runtime tool list for the session. /// The to monitor for cancellation requests. The default is . /// Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation. public async Task InitializeAndValidateAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionToolsInitializeAndValidateRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tools.initializeAndValidate", [request], cancellationToken); } /// Returns lightweight metadata for the session's currently initialized tools. /// The to monitor for cancellation requests. The default is . /// Current lightweight tool metadata snapshot for the session. public async Task GetCurrentMetadataAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionToolsGetCurrentMetadataRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tools.getCurrentMetadata", [request], cancellationToken); } /// Updates the current session's live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions. /// Subagent settings to apply, or null to clear the live session override. /// The to monitor for cancellation requests. The default is . /// Empty result after applying subagent settings. public async Task UpdateSubagentSettingsAsync(UpdateSubagentSettingsRequestSubagents? subagents = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new UpdateSubagentSettingsRequest { SessionId = _session.SessionId, Subagents = subagents }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tools.updateSubagentSettings", [request], cancellationToken); } } /// Provides session-scoped Commands APIs. [Experimental(Diagnostics.Experimental)] public sealed class CommandsApi { private readonly CopilotSession _session; internal CommandsApi(CopilotSession session) { _session = session; } /// Lists slash commands available in the session. /// Optional filters controlling which command sources to include in the listing. /// The to monitor for cancellation requests. The default is . /// Slash commands available in the session, after applying any include/exclude filters. public async Task ListAsync(CommandsListRequest? request = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var rpcRequest = new CommandsListRequestWithSession { SessionId = _session.SessionId, IncludeBuiltins = request?.IncludeBuiltins, IncludeSkills = request?.IncludeSkills, IncludeClientCommands = request?.IncludeClientCommands }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.commands.list", [rpcRequest], cancellationToken); } /// Invokes a slash command in the session. /// Command name. Leading slashes are stripped and the name is matched case-insensitively. /// Raw input after the command name. /// The to monitor for cancellation requests. The default is . /// Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection). public async Task InvokeAsync(string name, string? input = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(name); _session.ThrowIfDisposed(); var request = new CommandsInvokeRequest { SessionId = _session.SessionId, Name = name, Input = input }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.commands.invoke", [request], cancellationToken); } /// Reports completion of a pending client-handled slash command. /// Request ID from the command invocation event. /// Error message if the command handler failed. /// The to monitor for cancellation requests. The default is . /// Indicates whether the pending client-handled command was completed successfully. public async Task HandlePendingCommandAsync(string requestId, string? error = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); _session.ThrowIfDisposed(); var request = new CommandsHandlePendingCommandRequest { SessionId = _session.SessionId, RequestId = requestId, Error = error }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.commands.handlePendingCommand", [request], cancellationToken); } /// Executes a slash command synchronously and returns any error. /// Name of the slash command to invoke (without the leading '/'). /// Argument string to pass to the command (empty string if none). /// The to monitor for cancellation requests. The default is . /// Error message produced while executing the command, if any. public async Task ExecuteAsync(string commandName, string args, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(commandName); ArgumentNullException.ThrowIfNull(args); _session.ThrowIfDisposed(); var request = new ExecuteCommandParams { SessionId = _session.SessionId, CommandName = commandName, Args = args }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.commands.execute", [request], cancellationToken); } /// Enqueues a slash command for FIFO processing on the local session. /// Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately. /// The to monitor for cancellation requests. The default is . /// Indicates whether the command was accepted into the local execution queue. public async Task EnqueueAsync(string command, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(command); _session.ThrowIfDisposed(); var request = new EnqueueCommandParams { SessionId = _session.SessionId, Command = command }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.commands.enqueue", [request], cancellationToken); } /// Reports whether the host actually executed a queued command and whether to continue processing. /// Request ID from the `command.queued` event the host is responding to. /// Result of the queued command execution. /// The to monitor for cancellation requests. The default is . /// Indicates whether the queued-command response was matched to a pending request. public async Task RespondToQueuedCommandAsync(string requestId, QueuedCommandResult result, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(result); _session.ThrowIfDisposed(); var request = new CommandsRespondToQueuedCommandRequest { SessionId = _session.SessionId, RequestId = requestId, Result = result }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.commands.respondToQueuedCommand", [request], cancellationToken); } } /// Provides session-scoped Telemetry APIs. [Experimental(Diagnostics.Experimental)] public sealed class TelemetryApi { private readonly CopilotSession _session; internal TelemetryApi(CopilotSession session) { _session = session; } /// Gets the telemetry engagement ID currently associated with the session, when available. /// The to monitor for cancellation requests. The default is . /// Telemetry engagement ID for the session, when available. public async Task GetEngagementIdAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionTelemetryGetEngagementIdRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.telemetry.getEngagementId", [request], cancellationToken); } /// Sets feature override key/value pairs to attach to subsequent telemetry events for the session. /// Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides. /// The to monitor for cancellation requests. The default is . public async Task SetFeatureOverridesAsync(IDictionary features, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(features); _session.ThrowIfDisposed(); var request = new TelemetrySetFeatureOverridesRequest { SessionId = _session.SessionId, Features = features }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.telemetry.setFeatureOverrides", [request], cancellationToken); } } /// Provides session-scoped Ui APIs. [Experimental(Diagnostics.Experimental)] public sealed class UiApi { private readonly CopilotSession _session; internal UiApi(CopilotSession session) { _session = session; } /// Runs a transient no-tools model query against the current conversation context. /// Question to answer from the current conversation context. /// In-process streaming callback `(text) => void` invoked with each token as the model emits it. Marked internal: excluded from the public SDK surface. In a process-separated SDK this is replaced by a streaming RPC that yields chunks and a final answer. /// In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Marked internal: excluded from the public SDK surface. Replaced by an explicit cancellation token + cancel RPC in the SDK migration. /// The to monitor for cancellation requests. The default is . /// Transient answer generated from current conversation context. public async Task EphemeralQueryAsync(string question, object? onChunk = null, object? abortSignal = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(question); _session.ThrowIfDisposed(); var request = new UIEphemeralQueryRequest { SessionId = _session.SessionId, Question = question, OnChunk = CopilotClient.ToJsonElementForWire(onChunk), AbortSignal = CopilotClient.ToJsonElementForWire(abortSignal) }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.ephemeralQuery", [request], cancellationToken); } /// Requests structured input from a UI-capable client. /// Message describing what information is needed from the user. /// JSON Schema describing the form fields to present to the user. /// The to monitor for cancellation requests. The default is . /// The elicitation response (accept with form values, decline, or cancel). public async Task ElicitationAsync(string message, UIElicitationSchema requestedSchema, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(message); ArgumentNullException.ThrowIfNull(requestedSchema); _session.ThrowIfDisposed(); var request = new UIElicitationRequest { SessionId = _session.SessionId, Message = message, RequestedSchema = requestedSchema }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.elicitation", [request], cancellationToken); } /// Provides the user response for a pending elicitation request. /// The unique request ID from the elicitation.requested event. /// The elicitation response (accept with form values, decline, or cancel). /// The to monitor for cancellation requests. The default is . /// Indicates whether the elicitation response was accepted; false if it was already resolved by another client. public async Task HandlePendingElicitationAsync(string requestId, UIElicitationResponse result, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(result); _session.ThrowIfDisposed(); var request = new UIHandlePendingElicitationRequest { SessionId = _session.SessionId, RequestId = requestId, Result = result }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.handlePendingElicitation", [request], cancellationToken); } /// Resolves a pending `user_input.requested` event with the user's response. /// The unique request ID from the user_input.requested event. /// Schema for the `UIUserInputResponse` type. /// The to monitor for cancellation requests. The default is . /// Indicates whether the pending UI request was resolved by this call. public async Task HandlePendingUserInputAsync(string requestId, UIUserInputResponse response, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(response); _session.ThrowIfDisposed(); var request = new UIHandlePendingUserInputRequest { SessionId = _session.SessionId, RequestId = requestId, Response = response }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.handlePendingUserInput", [request], cancellationToken); } /// Resolves a pending `sampling.requested` event with a sampling result, or rejects it. /// The unique request ID from the sampling.requested event. /// Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result. /// The to monitor for cancellation requests. The default is . /// Indicates whether the pending UI request was resolved by this call. public async Task HandlePendingSamplingAsync(string requestId, UIHandlePendingSamplingResponse? response = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); _session.ThrowIfDisposed(); var request = new UIHandlePendingSamplingRequest { SessionId = _session.SessionId, RequestId = requestId, Response = response }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.handlePendingSampling", [request], cancellationToken); } /// Resolves a pending `auto_mode_switch.requested` event with the user's accept/decline decision. /// The unique request ID from the auto_mode_switch.requested event. /// User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline). /// The to monitor for cancellation requests. The default is . /// Indicates whether the pending UI request was resolved by this call. public async Task HandlePendingAutoModeSwitchAsync(string requestId, UIAutoModeSwitchResponse response, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); _session.ThrowIfDisposed(); var request = new UIHandlePendingAutoModeSwitchRequest { SessionId = _session.SessionId, RequestId = requestId, Response = response }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.handlePendingAutoModeSwitch", [request], cancellationToken); } /// Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action. /// The unique request ID from the session_limits_exhausted.requested event. /// The selected session-limit action. /// The to monitor for cancellation requests. The default is . /// Indicates whether the pending UI request was resolved by this call. public async Task HandlePendingSessionLimitsExhaustedAsync(string requestId, UISessionLimitsExhaustedResponse response, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(response); _session.ThrowIfDisposed(); var request = new UIHandlePendingSessionLimitsExhaustedRequest { SessionId = _session.SessionId, RequestId = requestId, Response = response }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.handlePendingSessionLimitsExhausted", [request], cancellationToken); } /// Resolves a pending `exit_plan_mode.requested` event with the user's response. /// The unique request ID from the exit_plan_mode.requested event. /// Schema for the `UIExitPlanModeResponse` type. /// The to monitor for cancellation requests. The default is . /// Indicates whether the pending UI request was resolved by this call. public async Task HandlePendingExitPlanModeAsync(string requestId, UIExitPlanModeResponse response, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(response); _session.ThrowIfDisposed(); var request = new UIHandlePendingExitPlanModeRequest { SessionId = _session.SessionId, RequestId = requestId, Response = response }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.handlePendingExitPlanMode", [request], cancellationToken); } /// Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch. /// The to monitor for cancellation requests. The default is . /// Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId). public async Task RegisterDirectAutoModeSwitchHandlerAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionUiRegisterDirectAutoModeSwitchHandlerRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.registerDirectAutoModeSwitchHandler", [request], cancellationToken); } /// Unregisters a previously-registered in-process auto-mode-switch handler by its opaque handle. /// Handle previously returned by `registerDirectAutoModeSwitchHandler`. /// The to monitor for cancellation requests. The default is . /// Indicates whether the handle was active and the registration count was decremented. public async Task UnregisterDirectAutoModeSwitchHandlerAsync(string handle, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(handle); _session.ThrowIfDisposed(); var request = new UIUnregisterDirectAutoModeSwitchHandlerRequest { SessionId = _session.SessionId, Handle = handle }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.ui.unregisterDirectAutoModeSwitchHandler", [request], cancellationToken); } } /// Provides session-scoped Permissions APIs. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsApi { private readonly CopilotSession _session; internal PermissionsApi(CopilotSession session) { _session = session; } /// Replaces selected permission policy fields (rules, paths, URLs, exclusions, allow-all flags) on the session. /// If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged. /// If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged. /// If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged. /// If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged. /// If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged. /// If specified, replaces the host-supplied GitHub Content Exclusion policies on the session (combined with natively-discovered policies when evaluating tool/file access). Omit to leave the current policies unchanged. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task ConfigureAsync(bool? approveAllToolPermissionRequests = null, bool? approveAllReadPermissionRequests = null, PermissionRulesSet? rules = null, PermissionPathsConfig? paths = null, PermissionUrlsConfig? urls = null, IList? additionalContentExclusionPolicies = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsConfigureParams { SessionId = _session.SessionId, ApproveAllToolPermissionRequests = approveAllToolPermissionRequests, ApproveAllReadPermissionRequests = approveAllReadPermissionRequests, Rules = rules, Paths = paths, Urls = urls, AdditionalContentExclusionPolicies = additionalContentExclusionPolicies }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.configure", [request], cancellationToken); } /// Provides a decision for a pending tool permission request. /// Request ID of the pending permission request. /// The client's response to the pending permission prompt. /// The to monitor for cancellation requests. The default is . /// Indicates whether the permission decision was applied; false when the request was already resolved. public async Task HandlePendingPermissionRequestAsync(string requestId, PermissionDecision result, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(result); _session.ThrowIfDisposed(); var request = new PermissionDecisionRequest { SessionId = _session.SessionId, RequestId = requestId, Result = result }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.handlePendingPermissionRequest", [request], cancellationToken); } /// Reconstructs the set of pending tool permission requests from the session's event history. /// The to monitor for cancellation requests. The default is . /// List of pending permission requests reconstructed from event history. public async Task PendingRequestsAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsPendingRequestsRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.pendingRequests", [request], cancellationToken); } /// Enables or disables automatic approval of tool permission requests for the session. /// Whether to auto-approve all tool permission requests. /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task SetApproveAllAsync(bool enabled, PermissionsSetApproveAllSource? source = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsSetApproveAllRequest { SessionId = _session.SessionId, Enabled = enabled, Source = source }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.setApproveAll", [request], cancellationToken); } /// Enables or disables full allow-all permissions (tools, paths, and URLs) for the session. Used by attach-mode clients (e.g. LocalRpcSession's `/allow-all` forwarder) to flip the target session's permission state. Unlike `setApproveAll`, this swaps in the unrestricted path and URL managers and emits `session.permissions_changed` on transition. The result returns the authoritative post-mutation state so callers can update their local mirrors without racing the `session.permissions_changed` notification on the same wire. /// Whether to enable full allow-all permissions. /// Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded and reports the post-mutation state. public async Task SetAllowAllAsync(bool enabled, PermissionsSetAllowAllSource? source = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsSetAllowAllRequest { SessionId = _session.SessionId, Enabled = enabled, Source = source }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.setAllowAll", [request], cancellationToken); } /// Returns whether full allow-all permissions are currently active for the session. /// The to monitor for cancellation requests. The default is . /// Current full allow-all permission state. public async Task GetAllowAllAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsGetAllowAllRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.getAllowAll", [request], cancellationToken); } /// Adds or removes session-scoped or location-scoped permission rules. /// Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file. /// Rules to add to the scope. Applied before `remove`/`removeAll`. /// Specific rules to remove from the scope. Ignored when `removeAll` is true. /// When true, removes every rule currently in the scope (after any `add` is applied). Useful for clearing the location scope wholesale. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task ModifyRulesAsync(PermissionsModifyRulesScope scope, IList? add = null, IList? remove = null, bool? removeAll = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsModifyRulesParams { SessionId = _session.SessionId, Scope = scope, Add = add, Remove = remove, RemoveAll = removeAll }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.modifyRules", [request], cancellationToken); } /// Sets whether the client wants permission prompts bridged into session events. /// Whether the client wants `permission.requested` events bridged from the session-owned permission service. CLI clients that render prompt UI set this to `true` for as long as their listener is mounted; headless callers leave it unset (the default is `false`). /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task SetRequiredAsync(bool required, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsSetRequiredRequest { SessionId = _session.SessionId, Required = required }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.setRequired", [request], cancellationToken); } /// Clears session-scoped tool permission approvals. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task ResetSessionApprovalsAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsResetSessionApprovalsRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.resetSessionApprovals", [request], cancellationToken); } /// Notifies the runtime that a permission prompt UI has been shown to the user. /// Human-readable description of the prompt the user is being asked to approve. Used by the runtime to fire the registered `permission_prompt` notification hook (e.g. terminal bell, desktop notification). /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task NotifyPromptShownAsync(string message, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(message); _session.ThrowIfDisposed(); var request = new PermissionPromptShownNotification { SessionId = _session.SessionId, Message = message }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.notifyPromptShown", [request], cancellationToken); } /// Paths APIs. public PermissionsPathsApi Paths => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Locations APIs. public PermissionsLocationsApi Locations => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// FolderTrust APIs. public PermissionsFolderTrustApi FolderTrust => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; /// Urls APIs. public PermissionsUrlsApi Urls => field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; } /// Provides session-scoped PermissionsPaths APIs. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsPathsApi { private readonly CopilotSession _session; internal PermissionsPathsApi(CopilotSession session) { _session = session; } /// Returns the session's allowed directories and primary working directory. /// The to monitor for cancellation requests. The default is . /// Snapshot of the session's allow-listed directories and primary working directory. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionsPathsListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.paths.list", [request], cancellationToken); } /// Adds a directory to the session's allow-list. /// Directory to add to the allow-list. The runtime resolves and validates the path before adding. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task AddAsync(string path, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(path); _session.ThrowIfDisposed(); var request = new PermissionPathsAddParams { SessionId = _session.SessionId, Path = path }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.paths.add", [request], cancellationToken); } /// Updates the session's primary working directory used by the permission policy. /// Directory to set as the new primary working directory for the session's permission policy. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task UpdatePrimaryAsync(string path, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(path); _session.ThrowIfDisposed(); var request = new PermissionPathsUpdatePrimaryParams { SessionId = _session.SessionId, Path = path }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.paths.updatePrimary", [request], cancellationToken); } /// Reports whether a path falls within any of the session's allowed directories. /// Path to check against the session's allowed directories. /// The to monitor for cancellation requests. The default is . /// Indicates whether the supplied path is within the session's allowed directories. public async Task IsPathWithinAllowedDirectoriesAsync(string path, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(path); _session.ThrowIfDisposed(); var request = new PermissionPathsAllowedCheckParams { SessionId = _session.SessionId, Path = path }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.paths.isPathWithinAllowedDirectories", [request], cancellationToken); } /// Reports whether a path falls within the session's workspace (primary) directory. /// Path to check against the session workspace directory. /// The to monitor for cancellation requests. The default is . /// Indicates whether the supplied path is within the session's workspace directory. public async Task IsPathWithinWorkspaceAsync(string path, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(path); _session.ThrowIfDisposed(); var request = new PermissionPathsWorkspaceCheckParams { SessionId = _session.SessionId, Path = path }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.paths.isPathWithinWorkspace", [request], cancellationToken); } } /// Provides session-scoped PermissionsLocations APIs. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsLocationsApi { private readonly CopilotSession _session; internal PermissionsLocationsApi(CopilotSession session) { _session = session; } /// Resolves the permission location key and type for a working directory. /// Working directory whose permission location should be resolved. /// The to monitor for cancellation requests. The default is . /// Resolved location-permissions key and type. public async Task ResolveAsync(string workingDirectory, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(workingDirectory); _session.ThrowIfDisposed(); var request = new PermissionLocationResolveParams { SessionId = _session.SessionId, WorkingDirectory = workingDirectory }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.locations.resolve", [request], cancellationToken); } /// Applies persisted location-scoped tool approvals and allowed directories for a working directory to this session's permission service. /// Working directory whose persisted location permissions should be applied. /// The to monitor for cancellation requests. The default is . /// Summary of persisted location permissions applied to the session. public async Task ApplyAsync(string workingDirectory, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(workingDirectory); _session.ThrowIfDisposed(); var request = new PermissionLocationApplyParams { SessionId = _session.SessionId, WorkingDirectory = workingDirectory }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.locations.apply", [request], cancellationToken); } /// Persists a tool approval for a permission location and applies its rules to this session's live permission service. /// Location key (git root or cwd) to persist the approval to. /// Tool approval to persist and apply. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task AddToolApprovalAsync(string locationKey, PermissionsLocationsAddToolApprovalDetails approval, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(locationKey); ArgumentNullException.ThrowIfNull(approval); _session.ThrowIfDisposed(); var request = new PermissionLocationAddToolApprovalParams { SessionId = _session.SessionId, LocationKey = locationKey, Approval = approval }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.locations.addToolApproval", [request], cancellationToken); } } /// Provides session-scoped PermissionsFolderTrust APIs. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsFolderTrustApi { private readonly CopilotSession _session; internal PermissionsFolderTrustApi(CopilotSession session) { _session = session; } /// Reports whether a folder is trusted according to the user's folder trust state. /// Folder path to check. /// The to monitor for cancellation requests. The default is . /// Folder trust check result. public async Task IsTrustedAsync(string path, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(path); _session.ThrowIfDisposed(); var request = new FolderTrustCheckParams { SessionId = _session.SessionId, Path = path }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.folderTrust.isTrusted", [request], cancellationToken); } /// Adds a folder to the user's trusted folders list. /// Folder path to mark as trusted. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task AddTrustedAsync(string path, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(path); _session.ThrowIfDisposed(); var request = new FolderTrustAddParams { SessionId = _session.SessionId, Path = path }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.folderTrust.addTrusted", [request], cancellationToken); } } /// Provides session-scoped PermissionsUrls APIs. [Experimental(Diagnostics.Experimental)] public sealed class PermissionsUrlsApi { private readonly CopilotSession _session; internal PermissionsUrlsApi(CopilotSession session) { _session = session; } /// Toggles the runtime's URL-permission policy between unrestricted and restricted modes. /// Whether to allow access to all URLs without prompting. Toggles the runtime's URL-permission policy in place. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task SetUnrestrictedModeAsync(bool enabled, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new PermissionUrlsSetUnrestrictedModeParams { SessionId = _session.SessionId, Enabled = enabled }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.permissions.urls.setUnrestrictedMode", [request], cancellationToken); } } /// Provides session-scoped Metadata APIs. [Experimental(Diagnostics.Experimental)] public sealed class MetadataApi { private readonly CopilotSession _session; internal MetadataApi(CopilotSession session) { _session = session; } /// Returns a snapshot of the session's identifying metadata, mode, agent, and remote info. /// The to monitor for cancellation requests. The default is . /// Point-in-time snapshot of slow-changing session identifier and state fields. public async Task SnapshotAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionMetadataSnapshotRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.metadata.snapshot", [request], cancellationToken); } /// Reports whether the local session is currently processing user/agent messages. /// The to monitor for cancellation requests. The default is . /// Indicates whether the local session is currently processing a turn or background continuation. public async Task IsProcessingAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionMetadataIsProcessingRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.metadata.isProcessing", [request], cancellationToken); } /// Returns a snapshot of activity flags for the session. /// The to monitor for cancellation requests. The default is . /// Current activity flags for the session. public async Task ActivityAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionMetadataActivityRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.metadata.activity", [request], cancellationToken); } /// Returns the token breakdown for the session's current context window for a given model. /// Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default. /// Maximum output tokens allowed by the target model. Pass 0 if unknown. /// Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values. /// The to monitor for cancellation requests. The default is . /// Token breakdown for the session's current context window, or null if uninitialized. public async Task ContextInfoAsync(long promptTokenLimit, long outputTokenLimit, string? selectedModel = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new MetadataContextInfoRequest { SessionId = _session.SessionId, PromptTokenLimit = promptTokenLimit, OutputTokenLimit = outputTokenLimit, SelectedModel = selectedModel }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.metadata.contextInfo", [request], cancellationToken); } /// Records a working-directory/git context change and emits a `session.context_changed` event. /// Updated working directory and git context. Emitted as the new payload of `session.context_changed`. /// The to monitor for cancellation requests. The default is . /// Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). public async Task RecordContextChangeAsync(SessionWorkingDirectoryContext context, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(context); _session.ThrowIfDisposed(); var request = new MetadataRecordContextChangeRequest { SessionId = _session.SessionId, Context = context }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.metadata.recordContextChange", [request], cancellationToken); } /// Updates the session's recorded working directory. /// Absolute path to set as the session's working directory. The runtime updates the session's recorded cwd so subsequent operations (shell tools, file lookups, telemetry) anchor to it. /// The to monitor for cancellation requests. The default is . /// Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for `process.chdir` and any related side-effects (file index, etc.); this method only updates the session's own recorded path. public async Task SetWorkingDirectoryAsync(string workingDirectory, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(workingDirectory); _session.ThrowIfDisposed(); var request = new MetadataSetWorkingDirectoryRequest { SessionId = _session.SessionId, WorkingDirectory = workingDirectory }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.metadata.setWorkingDirectory", [request], cancellationToken); } /// Re-tokenizes the session's existing messages against a model and returns aggregate token totals. /// Model identifier used for tokenization. The runtime token-counts both chat-context and system-context messages against this model. /// The to monitor for cancellation requests. The default is . /// Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session. public async Task RecomputeContextTokensAsync(string modelId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(modelId); _session.ThrowIfDisposed(); var request = new MetadataRecomputeContextTokensRequest { SessionId = _session.SessionId, ModelId = modelId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.metadata.recomputeContextTokens", [request], cancellationToken); } } /// Provides session-scoped Shell APIs. [Experimental(Diagnostics.Experimental)] public sealed class ShellApi { private readonly CopilotSession _session; internal ShellApi(CopilotSession session) { _session = session; } /// Starts a shell command and streams output through session notifications. /// Shell command to execute. /// Working directory (defaults to session working directory). /// Timeout in milliseconds (default: 30000). /// The to monitor for cancellation requests. The default is . /// Identifier of the spawned process, used to correlate streamed output and exit notifications. public async Task ExecAsync(string command, string? cwd = null, TimeSpan? timeout = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(command); _session.ThrowIfDisposed(); var request = new ShellExecRequest { SessionId = _session.SessionId, Command = command, Cwd = cwd, Timeout = timeout }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.shell.exec", [request], cancellationToken); } /// Sends a signal to a shell process previously started via "shell.exec". /// Process identifier returned by shell.exec. /// Signal to send (default: SIGTERM). /// The to monitor for cancellation requests. The default is . /// Indicates whether the signal was delivered; false if the process was unknown or already exited. public async Task KillAsync(string processId, ShellKillSignal? signal = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(processId); _session.ThrowIfDisposed(); var request = new ShellKillRequest { SessionId = _session.SessionId, ProcessId = processId, Signal = signal }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.shell.kill", [request], cancellationToken); } /// Executes a user-requested shell command through the session runtime. /// Caller-provided cancellation handle for this execution. /// Shell command to execute. /// The to monitor for cancellation requests. The default is . /// Result of a user-requested shell command. public async Task ExecuteUserRequestedAsync(string requestId, string command, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); ArgumentNullException.ThrowIfNull(command); _session.ThrowIfDisposed(); var request = new ShellExecuteUserRequestedRequest { SessionId = _session.SessionId, RequestId = requestId, Command = command }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.shell.executeUserRequested", [request], cancellationToken); } /// Cancels a user-requested shell command by request ID. /// Request ID previously passed to executeUserRequested. /// The to monitor for cancellation requests. The default is . /// Cancellation result for a user-requested shell command. public async Task CancelUserRequestedAsync(string requestId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(requestId); _session.ThrowIfDisposed(); var request = new ShellCancelUserRequestedRequest { SessionId = _session.SessionId, RequestId = requestId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.shell.cancelUserRequested", [request], cancellationToken); } } /// Provides session-scoped History APIs. [Experimental(Diagnostics.Experimental)] public sealed class HistoryApi { private readonly CopilotSession _session; internal HistoryApi(CopilotSession session) { _session = session; } /// Compacts the session history to reduce context usage. /// Optional compaction parameters. /// The to monitor for cancellation requests. The default is . /// Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown. public async Task CompactAsync(HistoryCompactRequest? request = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var rpcRequest = new HistoryCompactRequestWithSession { SessionId = _session.SessionId, CustomInstructions = request?.CustomInstructions }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.compact", [rpcRequest], cancellationToken); } /// Truncates persisted session history to a specific event. /// Event ID to truncate to. This event and all events after it are removed from the session. /// The to monitor for cancellation requests. The default is . /// Number of events that were removed by the truncation. public async Task TruncateAsync(string eventId, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(eventId); _session.ThrowIfDisposed(); var request = new HistoryTruncateRequest { SessionId = _session.SessionId, EventId = eventId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.truncate", [request], cancellationToken); } /// Cancels any in-progress background compaction on a local session. /// The to monitor for cancellation requests. The default is . /// Indicates whether an in-progress background compaction was cancelled. public async Task CancelBackgroundCompactionAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionHistoryCancelBackgroundCompactionRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.cancelBackgroundCompaction", [request], cancellationToken); } /// Aborts any in-progress manual compaction on a local session. /// The to monitor for cancellation requests. The default is . /// Indicates whether an in-progress manual compaction was aborted. public async Task AbortManualCompactionAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionHistoryAbortManualCompactionRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.abortManualCompaction", [request], cancellationToken); } /// Produces a markdown summary of the session's conversation context for hand-off scenarios. /// The to monitor for cancellation requests. The default is . /// Markdown summary of the conversation context (empty when not available). public async Task SummarizeForHandoffAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionHistorySummarizeForHandoffRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.history.summarizeForHandoff", [request], cancellationToken); } } /// Provides session-scoped Queue APIs. [Experimental(Diagnostics.Experimental)] public sealed class QueueApi { private readonly CopilotSession _session; internal QueueApi(CopilotSession session) { _session = session; } /// Returns the local session's pending user-facing queued items and steering messages. /// The to monitor for cancellation requests. The default is . /// Snapshot of the session's pending queued items and immediate-steering messages. public async Task PendingItemsAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionQueuePendingItemsRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.pendingItems", [request], cancellationToken); } /// Removes the most recently queued user-facing item (LIFO). /// The to monitor for cancellation requests. The default is . /// Indicates whether a user-facing pending item was removed. public async Task RemoveMostRecentAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionQueueRemoveMostRecentRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.removeMostRecent", [request], cancellationToken); } /// Clears all pending queued items on the local session. /// The to monitor for cancellation requests. The default is . public async Task ClearAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionQueueClearRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.queue.clear", [request], cancellationToken); } } /// Provides session-scoped EventLog APIs. [Experimental(Diagnostics.Experimental)] public sealed class EventLogApi { private readonly CopilotSession _session; internal EventLogApi(CopilotSession session) { _session = session; } /// Reads a batch of session events from a cursor, optionally waiting for new events. /// Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history. /// Maximum number of events to return in this batch (1–1000, default 200). /// Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). /// Either '*' to receive all event types, or a non-empty list of event types to receive. /// Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers. /// The to monitor for cancellation requests. The default is . /// Batch of session events returned by a read, with cursor and continuation metadata. public async Task ReadAsync(string? cursor = null, long? max = null, TimeSpan? waitMs = null, object? types = null, EventsAgentScope? agentScope = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new EventLogReadRequest { SessionId = _session.SessionId, Cursor = cursor, Max = max, Wait = waitMs, Types = CopilotClient.ToJsonElementForWire(types), AgentScope = agentScope }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.eventLog.read", [request], cancellationToken); } /// Returns a snapshot of the current tail cursor without consuming events. /// The to monitor for cancellation requests. The default is . /// Snapshot of the current tail cursor without returning any events. Use this when a consumer wants to subscribe to live events going forward without first paginating through the entire persisted history (which would happen if `read` were called without a cursor on a long-lived session). public async Task TailAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionEventLogTailRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.eventLog.tail", [request], cancellationToken); } /// Registers consumer interest in an event type for runtime gating purposes. /// The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates the full interactive OAuth flow to the consumer; when no interest is registered the runtime installs a browserless fallback that silently reuses cached tokens). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`. /// The to monitor for cancellation requests. The default is . /// Opaque handle representing an event-type interest registration. public async Task RegisterInterestAsync(string eventType, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(eventType); _session.ThrowIfDisposed(); var request = new RegisterEventInterestParams { SessionId = _session.SessionId, EventType = eventType }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.eventLog.registerInterest", [request], cancellationToken); } /// Releases a consumer's previously-registered interest in an event type. /// Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type. /// The to monitor for cancellation requests. The default is . /// Indicates whether the operation succeeded. public async Task ReleaseInterestAsync(string handle, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(handle); _session.ThrowIfDisposed(); var request = new ReleaseEventInterestParams { SessionId = _session.SessionId, Handle = handle }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.eventLog.releaseInterest", [request], cancellationToken); } } /// Provides session-scoped Usage APIs. [Experimental(Diagnostics.Experimental)] public sealed class UsageApi { private readonly CopilotSession _session; internal UsageApi(CopilotSession session) { _session = session; } /// Gets accumulated usage metrics for the session. /// The to monitor for cancellation requests. The default is . /// Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals. public async Task GetMetricsAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionUsageGetMetricsRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.usage.getMetrics", [request], cancellationToken); } } /// Provides session-scoped Remote APIs. [Experimental(Diagnostics.Experimental)] public sealed class RemoteApi { private readonly CopilotSession _session; internal RemoteApi(CopilotSession session) { _session = session; } /// Enables remote session export or steering. /// Per-session remote mode. "off" disables remote, "export" exports session events to GitHub without enabling remote steering, "on" enables both export and remote steering. /// The to monitor for cancellation requests. The default is . /// GitHub URL for the session and a flag indicating whether remote steering is enabled. public async Task EnableAsync(RemoteSessionMode? mode = null, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new RemoteEnableRequest { SessionId = _session.SessionId, Mode = mode }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.remote.enable", [request], cancellationToken); } /// Disables remote session export and steering. /// The to monitor for cancellation requests. The default is . public async Task DisableAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionRemoteDisableRequest { SessionId = _session.SessionId }; await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.remote.disable", [request], cancellationToken); } /// Persists a remote-steerability change emitted by the host as a session event. /// Whether the session now supports remote steering via GitHub. The runtime persists this as a `session.remote_steerable_changed` event so resume/replay sees the up-to-date capability. /// The to monitor for cancellation requests. The default is . /// Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own. public async Task NotifySteerableChangedAsync(bool remoteSteerable, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new RemoteNotifySteerableChangedRequest { SessionId = _session.SessionId, RemoteSteerable = remoteSteerable }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.remote.notifySteerableChanged", [request], cancellationToken); } } /// Provides session-scoped Visibility APIs. [Experimental(Diagnostics.Experimental)] public sealed class VisibilityApi { private readonly CopilotSession _session; internal VisibilityApi(CopilotSession session) { _session = session; } /// Returns the session's current Mission Control sharing status and shareable GitHub URL. Reflects whether the synced session is visible to repository readers ("repo") or restricted to its creator and collaborators ("unshared"). /// The to monitor for cancellation requests. The default is . /// Current sharing status and shareable GitHub URL for a session. public async Task GetAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionVisibilityGetRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.visibility.get", [request], cancellationToken); } /// Sets the session's Mission Control sharing status, controlling whether the synced session is visible to repository readers. Returns the effective status and shareable GitHub URL after the change. /// Sharing status to apply. "repo" makes the session visible to repository readers; "unshared" restricts it to the creator and collaborators. /// The to monitor for cancellation requests. The default is . /// Effective sharing status and shareable GitHub URL after updating session visibility. public async Task SetAsync(SessionVisibilityStatus status, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new VisibilitySetRequest { SessionId = _session.SessionId, Status = status }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.visibility.set", [request], cancellationToken); } } /// Provides session-scoped Schedule APIs. [Experimental(Diagnostics.Experimental)] public sealed class ScheduleApi { private readonly CopilotSession _session; internal ScheduleApi(CopilotSession session) { _session = session; } /// Lists the session's currently active scheduled prompts. /// The to monitor for cancellation requests. The default is . /// Snapshot of the currently active recurring prompts for this session. public async Task ListAsync(CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new SessionScheduleListRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.list", [request], cancellationToken); } /// Removes a scheduled prompt by id. /// Id of the scheduled prompt to remove. /// The to monitor for cancellation requests. The default is . /// Remove a scheduled prompt by id. The result entry is omitted if the id was unknown. public async Task StopAsync(long id, CancellationToken cancellationToken = default) { _session.ThrowIfDisposed(); var request = new ScheduleStopRequest { SessionId = _session.SessionId, Id = id }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.schedule.stop", [request], cancellationToken); } } /// Handles `providerToken` client session API methods. [Experimental(Diagnostics.Experimental)] public interface IProviderTokenHandler { /// Asks the SDK client to get a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Session-scoped: the runtime calls it back on the connection that most recently supplied that provider's config for the session (the creating connection, or a resuming connection if the session was resumed — distinct providers may be owned by different connections), passing the provider name, and uses the returned token as the Authorization header for the outbound model request. The runtime does no caching — it calls this once per outbound request; the SDK consumer owns token acquisition, caching, and refresh. /// Asks the SDK client to acquire a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Issued by the runtime before each outbound model request; the runtime does no caching, so this is sent once per request. /// The to monitor for cancellation requests. The default is . /// A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer <token>` on the outbound request and does no caching; the SDK consumer owns token caching and refresh. Task GetTokenAsync(ProviderTokenAcquireRequest request, CancellationToken cancellationToken = default); } /// Handles `sessionFs` client session API methods. [Experimental(Diagnostics.Experimental)] public interface ISessionFsHandler { /// Reads a file from the client-provided session filesystem. /// Path of the file to read from the client-provided session filesystem. /// The to monitor for cancellation requests. The default is . /// File content as a UTF-8 string, or a filesystem error if the read failed. Task ReadFileAsync(SessionFsReadFileRequest request, CancellationToken cancellationToken = default); /// Writes a file in the client-provided session filesystem. /// File path, content to write, and optional mode for the client-provided session filesystem. /// The to monitor for cancellation requests. The default is . /// Describes a filesystem error. Task WriteFileAsync(SessionFsWriteFileRequest request, CancellationToken cancellationToken = default); /// Appends content to a file in the client-provided session filesystem. /// File path, content to append, and optional mode for the client-provided session filesystem. /// The to monitor for cancellation requests. The default is . /// Describes a filesystem error. Task AppendFileAsync(SessionFsAppendFileRequest request, CancellationToken cancellationToken = default); /// Checks whether a path exists in the client-provided session filesystem. /// Path to test for existence in the client-provided session filesystem. /// The to monitor for cancellation requests. The default is . /// Indicates whether the requested path exists in the client-provided session filesystem. Task ExistsAsync(SessionFsExistsRequest request, CancellationToken cancellationToken = default); /// Gets metadata for a path in the client-provided session filesystem. /// Path whose metadata should be returned from the client-provided session filesystem. /// The to monitor for cancellation requests. The default is . /// Filesystem metadata for the requested path, or a filesystem error if the stat failed. Task StatAsync(SessionFsStatRequest request, CancellationToken cancellationToken = default); /// Creates a directory in the client-provided session filesystem. /// Directory path to create in the client-provided session filesystem, with options for recursive creation and POSIX mode. /// The to monitor for cancellation requests. The default is . /// Describes a filesystem error. Task MkdirAsync(SessionFsMkdirRequest request, CancellationToken cancellationToken = default); /// Lists entry names in a directory from the client-provided session filesystem. /// Directory path whose entries should be listed from the client-provided session filesystem. /// The to monitor for cancellation requests. The default is . /// Names of entries in the requested directory, or a filesystem error if the read failed. Task ReaddirAsync(SessionFsReaddirRequest request, CancellationToken cancellationToken = default); /// Lists directory entries with type information from the client-provided session filesystem. /// Directory path whose entries (with type information) should be listed from the client-provided session filesystem. /// The to monitor for cancellation requests. The default is . /// Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed. Task ReaddirWithTypesAsync(SessionFsReaddirWithTypesRequest request, CancellationToken cancellationToken = default); /// Removes a file or directory from the client-provided session filesystem. /// Path to remove from the client-provided session filesystem, with options for recursive removal and force. /// The to monitor for cancellation requests. The default is . /// Describes a filesystem error. Task RmAsync(SessionFsRmRequest request, CancellationToken cancellationToken = default); /// Renames or moves a path in the client-provided session filesystem. /// Source and destination paths for renaming or moving an entry in the client-provided session filesystem. /// The to monitor for cancellation requests. The default is . /// Describes a filesystem error. Task RenameAsync(SessionFsRenameRequest request, CancellationToken cancellationToken = default); /// Executes a SQLite query against the per-session database. /// SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. /// The to monitor for cancellation requests. The default is . /// Query results including rows, columns, and rows affected, or a filesystem error if execution failed. Task SqliteQueryAsync(SessionFsSqliteQueryRequest request, CancellationToken cancellationToken = default); /// Checks whether the per-session SQLite database already exists, without creating it. /// Identifies the target session. /// The to monitor for cancellation requests. The default is . /// Indicates whether the per-session SQLite database already exists. Task SqliteExistsAsync(SessionFsSqliteExistsRequest request, CancellationToken cancellationToken = default); } /// Handles `canvas` client session API methods. [Experimental(Diagnostics.Experimental)] public interface ICanvasHandler { /// Opens a canvas instance on the provider. /// Canvas open parameters sent to the provider. /// The to monitor for cancellation requests. The default is . /// Canvas open result returned by the provider. Task OpenAsync(CanvasProviderOpenRequest request, CancellationToken cancellationToken = default); /// Closes a canvas instance on the provider. /// Canvas close parameters sent to the provider. /// The to monitor for cancellation requests. The default is . Task CloseAsync(CanvasProviderCloseRequest request, CancellationToken cancellationToken = default); /// Invokes an action on an open canvas instance via the provider. /// Canvas action invocation parameters sent to the provider. /// The to monitor for cancellation requests. The default is . /// Provider-supplied action result. Task InvokeAsync(CanvasProviderInvokeActionRequest request, CancellationToken cancellationToken = default); } /// Provides all client session API handler groups for a session. public sealed class ClientSessionApiHandlers { /// Optional handler for ProviderToken client session API methods. public IProviderTokenHandler? ProviderToken { get; set; } /// Optional handler for SessionFs client session API methods. public ISessionFsHandler? SessionFs { get; set; } /// Optional handler for Canvas client session API methods. public ICanvasHandler? Canvas { get; set; } } /// Registers client session API handlers on a JSON-RPC connection. internal static class ClientSessionApiRegistration { /// /// Registers handlers for server-to-client session API calls. /// Each incoming call includes a sessionId in its params object, /// which is used to resolve the session's handler group. /// public static void RegisterClientSessionApiHandlers(JsonRpc rpc, Func getHandlers) { rpc.SetLocalRpcMethod("providerToken.getToken", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).ProviderToken; if (handler is null) throw new InvalidOperationException($"No providerToken handler registered for session: {request.SessionId}"); return await handler.GetTokenAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.readFile", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.ReadFileAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.writeFile", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.WriteFileAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.appendFile", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.AppendFileAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.exists", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.ExistsAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.stat", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.StatAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.mkdir", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.MkdirAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.readdir", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.ReaddirAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.readdirWithTypes", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.ReaddirWithTypesAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.rm", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.RmAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.rename", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.RenameAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.sqliteQuery", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.SqliteQueryAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("sessionFs.sqliteExists", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).SessionFs; if (handler is null) throw new InvalidOperationException($"No sessionFs handler registered for session: {request.SessionId}"); return await handler.SqliteExistsAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("canvas.open", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).Canvas; if (handler is null) throw new InvalidOperationException($"No canvas handler registered for session: {request.SessionId}"); return await handler.OpenAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("canvas.close", (Func)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).Canvas; if (handler is null) throw new InvalidOperationException($"No canvas handler registered for session: {request.SessionId}"); await handler.CloseAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("canvas.action.invoke", (Func>)(async (request, cancellationToken) => { var handler = getHandlers(request.SessionId).Canvas; if (handler is null) throw new InvalidOperationException($"No canvas handler registered for session: {request.SessionId}"); return await handler.InvokeAsync(request, cancellationToken); }), singleObjectParam: true); } } /// Handles `llmInference` client global API methods. [Experimental(Diagnostics.Experimental)] public interface ILlmInferenceHandler { /// Announces an outbound model-layer HTTP request the runtime wants the SDK client to service. Carries the request head only; the body always follows as one or more httpRequestChunk frames keyed by the same requestId, even when the body is empty (a single chunk with end=true). /// The head of an outbound model-layer HTTP request. /// The to monitor for cancellation requests. The default is . /// Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed. Task HttpRequestStartAsync(LlmInferenceHttpRequestStartRequest request, CancellationToken cancellationToken = default); /// Delivers a body byte range (or a cancellation signal) for a request previously announced via httpRequestStart, correlated by requestId. The runtime fires at least one chunk per request — when there is no body, a single chunk with empty data and end=true. Mid-stream the runtime may send a chunk with cancel=true to abort the request; the SDK then stops issuing httpResponseChunk frames and may emit a terminal httpResponseChunk with error set. /// A request body chunk or cancellation signal. /// The to monitor for cancellation requests. The default is . /// Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget. Task HttpRequestChunkAsync(LlmInferenceHttpRequestChunkRequest request, CancellationToken cancellationToken = default); } /// Handles `gitHubTelemetry` client global API methods. [Experimental(Diagnostics.Experimental)] public interface IGitHubTelemetryHandler { /// Forwards a single GitHub telemetry event to a host connection that opted into telemetry forwarding for the session. /// Payload for a `gitHubTelemetry.event` notification: a single GitHub telemetry event the runtime forwards to a host connection that opted into telemetry forwarding for the session. /// The to monitor for cancellation requests. The default is . Task EventAsync(GitHubTelemetryNotification request, CancellationToken cancellationToken = default); } /// Provides all client global API handler groups for a connection. public sealed class ClientGlobalApiHandlers { /// Optional handler for LlmInference client global API methods. public ILlmInferenceHandler? LlmInference { get; set; } /// Optional handler for GitHubTelemetry client global API methods. public IGitHubTelemetryHandler? GitHubTelemetry { get; set; } } /// Registers client global API handlers on a JSON-RPC connection. internal static class ClientGlobalApiRegistration { /// /// Registers handlers for server-to-client global API calls. /// Unlike client session APIs, these methods carry no implicit /// sessionId dispatch key — a single set of handlers serves the /// entire connection. /// public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiHandlers handlers) { rpc.SetLocalRpcMethod("llmInference.httpRequestStart", (Func>)(async (request, cancellationToken) => { var handler = handlers.LlmInference ?? throw new InvalidOperationException("No llmInference client-global handler registered"); return await handler.HttpRequestStartAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("llmInference.httpRequestChunk", (Func>)(async (request, cancellationToken) => { var handler = handlers.LlmInference ?? throw new InvalidOperationException("No llmInference client-global handler registered"); return await handler.HttpRequestChunkAsync(request, cancellationToken); }), singleObjectParam: true); rpc.SetLocalRpcMethod("gitHubTelemetry.event", (Func)(async (request, cancellationToken) => { var handler = handlers.GitHubTelemetry ?? throw new InvalidOperationException("No gitHubTelemetry client-global handler registered"); await handler.EventAsync(request, cancellationToken); }), singleObjectParam: true); } } [JsonSourceGenerationOptions( JsonSerializerDefaults.Web, AllowOutOfOrderMetadataProperties = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)] [JsonSerializable(typeof(bool))] [JsonSerializable(typeof(double))] [JsonSerializable(typeof(int))] [JsonSerializable(typeof(long))] [JsonSerializable(typeof(string))] [JsonSerializable(typeof(GitHub.Copilot.AbortData), TypeInfoPropertyName = "SessionEventsAbortData")] [JsonSerializable(typeof(GitHub.Copilot.AbortEvent), TypeInfoPropertyName = "SessionEventsAbortEvent")] [JsonSerializable(typeof(GitHub.Copilot.AbortReason), TypeInfoPropertyName = "SessionEventsAbortReason")] [JsonSerializable(typeof(GitHub.Copilot.AssistantIdleData), TypeInfoPropertyName = "SessionEventsAssistantIdleData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantIdleEvent), TypeInfoPropertyName = "SessionEventsAssistantIdleEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantIntentData), TypeInfoPropertyName = "SessionEventsAssistantIntentData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantIntentEvent), TypeInfoPropertyName = "SessionEventsAssistantIntentEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageData), TypeInfoPropertyName = "SessionEventsAssistantMessageData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageDeltaData), TypeInfoPropertyName = "SessionEventsAssistantMessageDeltaData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageDeltaEvent), TypeInfoPropertyName = "SessionEventsAssistantMessageDeltaEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageEvent), TypeInfoPropertyName = "SessionEventsAssistantMessageEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageServerTools), TypeInfoPropertyName = "SessionEventsAssistantMessageServerTools")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageStartData), TypeInfoPropertyName = "SessionEventsAssistantMessageStartData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageStartEvent), TypeInfoPropertyName = "SessionEventsAssistantMessageStartEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageToolRequest), TypeInfoPropertyName = "SessionEventsAssistantMessageToolRequest")] [JsonSerializable(typeof(GitHub.Copilot.AssistantMessageToolRequestType), TypeInfoPropertyName = "SessionEventsAssistantMessageToolRequestType")] [JsonSerializable(typeof(GitHub.Copilot.AssistantReasoningData), TypeInfoPropertyName = "SessionEventsAssistantReasoningData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantReasoningDeltaData), TypeInfoPropertyName = "SessionEventsAssistantReasoningDeltaData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantReasoningDeltaEvent), TypeInfoPropertyName = "SessionEventsAssistantReasoningDeltaEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantReasoningEvent), TypeInfoPropertyName = "SessionEventsAssistantReasoningEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantStreamingDeltaData), TypeInfoPropertyName = "SessionEventsAssistantStreamingDeltaData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantStreamingDeltaEvent), TypeInfoPropertyName = "SessionEventsAssistantStreamingDeltaEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantTurnEndData), TypeInfoPropertyName = "SessionEventsAssistantTurnEndData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantTurnEndEvent), TypeInfoPropertyName = "SessionEventsAssistantTurnEndEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantTurnStartData), TypeInfoPropertyName = "SessionEventsAssistantTurnStartData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantTurnStartEvent), TypeInfoPropertyName = "SessionEventsAssistantTurnStartEvent")] [JsonSerializable(typeof(GitHub.Copilot.AssistantUsageApiEndpoint), TypeInfoPropertyName = "SessionEventsAssistantUsageApiEndpoint")] [JsonSerializable(typeof(GitHub.Copilot.AssistantUsageCopilotUsage), TypeInfoPropertyName = "SessionEventsAssistantUsageCopilotUsage")] [JsonSerializable(typeof(GitHub.Copilot.AssistantUsageCopilotUsageTokenDetail), TypeInfoPropertyName = "SessionEventsAssistantUsageCopilotUsageTokenDetail")] [JsonSerializable(typeof(GitHub.Copilot.AssistantUsageData), TypeInfoPropertyName = "SessionEventsAssistantUsageData")] [JsonSerializable(typeof(GitHub.Copilot.AssistantUsageEvent), TypeInfoPropertyName = "SessionEventsAssistantUsageEvent")] [JsonSerializable(typeof(GitHub.Copilot.Attachment), TypeInfoPropertyName = "SessionEventsAttachment")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentBlob), TypeInfoPropertyName = "SessionEventsAttachmentBlob")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentDirectory), TypeInfoPropertyName = "SessionEventsAttachmentDirectory")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentExtensionContext), TypeInfoPropertyName = "SessionEventsAttachmentExtensionContext")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentFile), TypeInfoPropertyName = "SessionEventsAttachmentFile")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentFileLineRange), TypeInfoPropertyName = "SessionEventsAttachmentFileLineRange")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubActionsJob), TypeInfoPropertyName = "SessionEventsAttachmentGitHubActionsJob")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubCommit), TypeInfoPropertyName = "SessionEventsAttachmentGitHubCommit")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubFile), TypeInfoPropertyName = "SessionEventsAttachmentGitHubFile")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubFileDiff), TypeInfoPropertyName = "SessionEventsAttachmentGitHubFileDiff")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubFileDiffSide), TypeInfoPropertyName = "SessionEventsAttachmentGitHubFileDiffSide")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubReference), TypeInfoPropertyName = "SessionEventsAttachmentGitHubReference")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubReferenceType), TypeInfoPropertyName = "SessionEventsAttachmentGitHubReferenceType")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubRelease), TypeInfoPropertyName = "SessionEventsAttachmentGitHubRelease")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubRepository), TypeInfoPropertyName = "SessionEventsAttachmentGitHubRepository")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubSnippet), TypeInfoPropertyName = "SessionEventsAttachmentGitHubSnippet")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubTreeComparison), TypeInfoPropertyName = "SessionEventsAttachmentGitHubTreeComparison")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubTreeComparisonSide), TypeInfoPropertyName = "SessionEventsAttachmentGitHubTreeComparisonSide")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentGitHubUrl), TypeInfoPropertyName = "SessionEventsAttachmentGitHubUrl")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentSelection), TypeInfoPropertyName = "SessionEventsAttachmentSelection")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetails), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetails")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetailsEnd), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetailsEnd")] [JsonSerializable(typeof(GitHub.Copilot.AttachmentSelectionDetailsStart), TypeInfoPropertyName = "SessionEventsAttachmentSelectionDetailsStart")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchCompletedData), TypeInfoPropertyName = "SessionEventsAutoModeSwitchCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchCompletedEvent), TypeInfoPropertyName = "SessionEventsAutoModeSwitchCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchRequestedData), TypeInfoPropertyName = "SessionEventsAutoModeSwitchRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchRequestedEvent), TypeInfoPropertyName = "SessionEventsAutoModeSwitchRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.AutoModeSwitchResponse), TypeInfoPropertyName = "SessionEventsAutoModeSwitchResponse")] [JsonSerializable(typeof(GitHub.Copilot.AutopilotObjectiveChangedOperation), TypeInfoPropertyName = "SessionEventsAutopilotObjectiveChangedOperation")] [JsonSerializable(typeof(GitHub.Copilot.AutopilotObjectiveChangedStatus), TypeInfoPropertyName = "SessionEventsAutopilotObjectiveChangedStatus")] [JsonSerializable(typeof(GitHub.Copilot.BinaryAssetReference), TypeInfoPropertyName = "SessionEventsBinaryAssetReference")] [JsonSerializable(typeof(GitHub.Copilot.BinaryAssetReferenceType), TypeInfoPropertyName = "SessionEventsBinaryAssetReferenceType")] [JsonSerializable(typeof(GitHub.Copilot.BinaryAssetType), TypeInfoPropertyName = "SessionEventsBinaryAssetType")] [JsonSerializable(typeof(GitHub.Copilot.CanvasRegistryChangedCanvas), TypeInfoPropertyName = "SessionEventsCanvasRegistryChangedCanvas")] [JsonSerializable(typeof(GitHub.Copilot.CanvasRegistryChangedCanvasAction), TypeInfoPropertyName = "SessionEventsCanvasRegistryChangedCanvasAction")] [JsonSerializable(typeof(GitHub.Copilot.CapabilitiesChangedData), TypeInfoPropertyName = "SessionEventsCapabilitiesChangedData")] [JsonSerializable(typeof(GitHub.Copilot.CapabilitiesChangedEvent), TypeInfoPropertyName = "SessionEventsCapabilitiesChangedEvent")] [JsonSerializable(typeof(GitHub.Copilot.CapabilitiesChangedUI), TypeInfoPropertyName = "SessionEventsCapabilitiesChangedUI")] [JsonSerializable(typeof(GitHub.Copilot.CitableSource), TypeInfoPropertyName = "SessionEventsCitableSource")] [JsonSerializable(typeof(GitHub.Copilot.CitationLocation), TypeInfoPropertyName = "SessionEventsCitationLocation")] [JsonSerializable(typeof(GitHub.Copilot.CitationLocationBlock), TypeInfoPropertyName = "SessionEventsCitationLocationBlock")] [JsonSerializable(typeof(GitHub.Copilot.CitationLocationChar), TypeInfoPropertyName = "SessionEventsCitationLocationChar")] [JsonSerializable(typeof(GitHub.Copilot.CitationLocationPage), TypeInfoPropertyName = "SessionEventsCitationLocationPage")] [JsonSerializable(typeof(GitHub.Copilot.CitationProvider), TypeInfoPropertyName = "SessionEventsCitationProvider")] [JsonSerializable(typeof(GitHub.Copilot.CitationReference), TypeInfoPropertyName = "SessionEventsCitationReference")] [JsonSerializable(typeof(GitHub.Copilot.CitationSource), TypeInfoPropertyName = "SessionEventsCitationSource")] [JsonSerializable(typeof(GitHub.Copilot.CitationSpan), TypeInfoPropertyName = "SessionEventsCitationSpan")] [JsonSerializable(typeof(GitHub.Copilot.Citations), TypeInfoPropertyName = "SessionEventsCitations")] [JsonSerializable(typeof(GitHub.Copilot.CommandCompletedData), TypeInfoPropertyName = "SessionEventsCommandCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.CommandCompletedEvent), TypeInfoPropertyName = "SessionEventsCommandCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.CommandExecuteData), TypeInfoPropertyName = "SessionEventsCommandExecuteData")] [JsonSerializable(typeof(GitHub.Copilot.CommandExecuteEvent), TypeInfoPropertyName = "SessionEventsCommandExecuteEvent")] [JsonSerializable(typeof(GitHub.Copilot.CommandQueuedData), TypeInfoPropertyName = "SessionEventsCommandQueuedData")] [JsonSerializable(typeof(GitHub.Copilot.CommandQueuedEvent), TypeInfoPropertyName = "SessionEventsCommandQueuedEvent")] [JsonSerializable(typeof(GitHub.Copilot.CommandsChangedCommand), TypeInfoPropertyName = "SessionEventsCommandsChangedCommand")] [JsonSerializable(typeof(GitHub.Copilot.CommandsChangedData), TypeInfoPropertyName = "SessionEventsCommandsChangedData")] [JsonSerializable(typeof(GitHub.Copilot.CommandsChangedEvent), TypeInfoPropertyName = "SessionEventsCommandsChangedEvent")] [JsonSerializable(typeof(GitHub.Copilot.CompactionCompleteCompactionTokensUsed), TypeInfoPropertyName = "SessionEventsCompactionCompleteCompactionTokensUsed")] [JsonSerializable(typeof(GitHub.Copilot.CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail), TypeInfoPropertyName = "SessionEventsCompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail")] [JsonSerializable(typeof(GitHub.Copilot.ContextTier), TypeInfoPropertyName = "SessionEventsContextTier")] [JsonSerializable(typeof(GitHub.Copilot.CustomAgentsUpdatedAgent), TypeInfoPropertyName = "SessionEventsCustomAgentsUpdatedAgent")] [JsonSerializable(typeof(GitHub.Copilot.ElicitationCompletedAction), TypeInfoPropertyName = "SessionEventsElicitationCompletedAction")] [JsonSerializable(typeof(GitHub.Copilot.ElicitationCompletedData), TypeInfoPropertyName = "SessionEventsElicitationCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.ElicitationCompletedEvent), TypeInfoPropertyName = "SessionEventsElicitationCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.ElicitationRequestedData), TypeInfoPropertyName = "SessionEventsElicitationRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.ElicitationRequestedEvent), TypeInfoPropertyName = "SessionEventsElicitationRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.ElicitationRequestedMode), TypeInfoPropertyName = "SessionEventsElicitationRequestedMode")] [JsonSerializable(typeof(GitHub.Copilot.ElicitationRequestedSchema), TypeInfoPropertyName = "SessionEventsElicitationRequestedSchema")] [JsonSerializable(typeof(GitHub.Copilot.EmbeddedBlobResourceContents), TypeInfoPropertyName = "SessionEventsEmbeddedBlobResourceContents")] [JsonSerializable(typeof(GitHub.Copilot.EmbeddedTextResourceContents), TypeInfoPropertyName = "SessionEventsEmbeddedTextResourceContents")] [JsonSerializable(typeof(GitHub.Copilot.ExitPlanModeAction), TypeInfoPropertyName = "SessionEventsExitPlanModeAction")] [JsonSerializable(typeof(GitHub.Copilot.ExitPlanModeCompletedData), TypeInfoPropertyName = "SessionEventsExitPlanModeCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.ExitPlanModeCompletedEvent), TypeInfoPropertyName = "SessionEventsExitPlanModeCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.ExitPlanModeRequestedData), TypeInfoPropertyName = "SessionEventsExitPlanModeRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.ExitPlanModeRequestedEvent), TypeInfoPropertyName = "SessionEventsExitPlanModeRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.ExtensionsLoadedExtension), TypeInfoPropertyName = "SessionEventsExtensionsLoadedExtension")] [JsonSerializable(typeof(GitHub.Copilot.ExtensionsLoadedExtensionSource), TypeInfoPropertyName = "SessionEventsExtensionsLoadedExtensionSource")] [JsonSerializable(typeof(GitHub.Copilot.ExtensionsLoadedExtensionStatus), TypeInfoPropertyName = "SessionEventsExtensionsLoadedExtensionStatus")] [JsonSerializable(typeof(GitHub.Copilot.ExternalToolCompletedData), TypeInfoPropertyName = "SessionEventsExternalToolCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.ExternalToolCompletedEvent), TypeInfoPropertyName = "SessionEventsExternalToolCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.ExternalToolRequestedData), TypeInfoPropertyName = "SessionEventsExternalToolRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.ExternalToolRequestedEvent), TypeInfoPropertyName = "SessionEventsExternalToolRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.GitHubRepoRef), TypeInfoPropertyName = "SessionEventsGitHubRepoRef")] [JsonSerializable(typeof(GitHub.Copilot.HandoffRepository), TypeInfoPropertyName = "SessionEventsHandoffRepository")] [JsonSerializable(typeof(GitHub.Copilot.HandoffSourceType), TypeInfoPropertyName = "SessionEventsHandoffSourceType")] [JsonSerializable(typeof(GitHub.Copilot.HookEndData), TypeInfoPropertyName = "SessionEventsHookEndData")] [JsonSerializable(typeof(GitHub.Copilot.HookEndError), TypeInfoPropertyName = "SessionEventsHookEndError")] [JsonSerializable(typeof(GitHub.Copilot.HookEndEvent), TypeInfoPropertyName = "SessionEventsHookEndEvent")] [JsonSerializable(typeof(GitHub.Copilot.HookProgressData), TypeInfoPropertyName = "SessionEventsHookProgressData")] [JsonSerializable(typeof(GitHub.Copilot.HookProgressEvent), TypeInfoPropertyName = "SessionEventsHookProgressEvent")] [JsonSerializable(typeof(GitHub.Copilot.HookStartData), TypeInfoPropertyName = "SessionEventsHookStartData")] [JsonSerializable(typeof(GitHub.Copilot.HookStartEvent), TypeInfoPropertyName = "SessionEventsHookStartEvent")] [JsonSerializable(typeof(GitHub.Copilot.McpAppToolCallCompleteData), TypeInfoPropertyName = "SessionEventsMcpAppToolCallCompleteData")] [JsonSerializable(typeof(GitHub.Copilot.McpAppToolCallCompleteError), TypeInfoPropertyName = "SessionEventsMcpAppToolCallCompleteError")] [JsonSerializable(typeof(GitHub.Copilot.McpAppToolCallCompleteEvent), TypeInfoPropertyName = "SessionEventsMcpAppToolCallCompleteEvent")] [JsonSerializable(typeof(GitHub.Copilot.McpAppToolCallCompleteToolMeta), TypeInfoPropertyName = "SessionEventsMcpAppToolCallCompleteToolMeta")] [JsonSerializable(typeof(GitHub.Copilot.McpAppToolCallCompleteToolMetaUI), TypeInfoPropertyName = "SessionEventsMcpAppToolCallCompleteToolMetaUI")] [JsonSerializable(typeof(GitHub.Copilot.McpHeadersRefreshCompletedData), TypeInfoPropertyName = "SessionEventsMcpHeadersRefreshCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.McpHeadersRefreshCompletedEvent), TypeInfoPropertyName = "SessionEventsMcpHeadersRefreshCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.McpHeadersRefreshCompletedOutcome), TypeInfoPropertyName = "SessionEventsMcpHeadersRefreshCompletedOutcome")] [JsonSerializable(typeof(GitHub.Copilot.McpHeadersRefreshRequiredData), TypeInfoPropertyName = "SessionEventsMcpHeadersRefreshRequiredData")] [JsonSerializable(typeof(GitHub.Copilot.McpHeadersRefreshRequiredEvent), TypeInfoPropertyName = "SessionEventsMcpHeadersRefreshRequiredEvent")] [JsonSerializable(typeof(GitHub.Copilot.McpHeadersRefreshRequiredReason), TypeInfoPropertyName = "SessionEventsMcpHeadersRefreshRequiredReason")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthCompletedData), TypeInfoPropertyName = "SessionEventsMcpOauthCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthCompletedEvent), TypeInfoPropertyName = "SessionEventsMcpOauthCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthCompletionOutcome), TypeInfoPropertyName = "SessionEventsMcpOauthCompletionOutcome")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthRequestReason), TypeInfoPropertyName = "SessionEventsMcpOauthRequestReason")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthRequiredData), TypeInfoPropertyName = "SessionEventsMcpOauthRequiredData")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthRequiredEvent), TypeInfoPropertyName = "SessionEventsMcpOauthRequiredEvent")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthRequiredStaticClientConfig), TypeInfoPropertyName = "SessionEventsMcpOauthRequiredStaticClientConfig")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthWWWAuthenticateParams), TypeInfoPropertyName = "SessionEventsMcpOauthWWWAuthenticateParams")] [JsonSerializable(typeof(GitHub.Copilot.McpServerSource), TypeInfoPropertyName = "SessionEventsMcpServerSource")] [JsonSerializable(typeof(GitHub.Copilot.McpServerStatus), TypeInfoPropertyName = "SessionEventsMcpServerStatus")] [JsonSerializable(typeof(GitHub.Copilot.McpServerTransport), TypeInfoPropertyName = "SessionEventsMcpServerTransport")] [JsonSerializable(typeof(GitHub.Copilot.McpServersLoadedServer), TypeInfoPropertyName = "SessionEventsMcpServersLoadedServer")] [JsonSerializable(typeof(GitHub.Copilot.ModelCallFailureBadRequestKind), TypeInfoPropertyName = "SessionEventsModelCallFailureBadRequestKind")] [JsonSerializable(typeof(GitHub.Copilot.ModelCallFailureData), TypeInfoPropertyName = "SessionEventsModelCallFailureData")] [JsonSerializable(typeof(GitHub.Copilot.ModelCallFailureEvent), TypeInfoPropertyName = "SessionEventsModelCallFailureEvent")] [JsonSerializable(typeof(GitHub.Copilot.ModelCallFailureRequestFingerprint), TypeInfoPropertyName = "SessionEventsModelCallFailureRequestFingerprint")] [JsonSerializable(typeof(GitHub.Copilot.ModelCallFailureSource), TypeInfoPropertyName = "SessionEventsModelCallFailureSource")] [JsonSerializable(typeof(GitHub.Copilot.OmittedBinaryOmittedReason), TypeInfoPropertyName = "SessionEventsOmittedBinaryOmittedReason")] [JsonSerializable(typeof(GitHub.Copilot.OmittedBinaryResult), TypeInfoPropertyName = "SessionEventsOmittedBinaryResult")] [JsonSerializable(typeof(GitHub.Copilot.OmittedBinaryType), TypeInfoPropertyName = "SessionEventsOmittedBinaryType")] [JsonSerializable(typeof(GitHub.Copilot.PendingMessagesModifiedData), TypeInfoPropertyName = "SessionEventsPendingMessagesModifiedData")] [JsonSerializable(typeof(GitHub.Copilot.PendingMessagesModifiedEvent), TypeInfoPropertyName = "SessionEventsPendingMessagesModifiedEvent")] [JsonSerializable(typeof(GitHub.Copilot.PermissionCompletedData), TypeInfoPropertyName = "SessionEventsPermissionCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.PermissionCompletedEvent), TypeInfoPropertyName = "SessionEventsPermissionCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequest), TypeInfoPropertyName = "SessionEventsPermissionPromptRequest")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestCommands), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestCommands")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestCustomTool), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestCustomTool")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestExtensionManagement), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestExtensionManagement")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestExtensionPermissionAccess), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestExtensionPermissionAccess")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestHook), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestHook")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestMcp), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestMcp")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestMemory), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestMemory")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestPath), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestPath")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestPathAccessKind), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestPathAccessKind")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestRead), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestRead")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestUrl), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestUrl")] [JsonSerializable(typeof(GitHub.Copilot.PermissionPromptRequestWrite), TypeInfoPropertyName = "SessionEventsPermissionPromptRequestWrite")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequest), TypeInfoPropertyName = "SessionEventsPermissionRequest")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestCustomTool), TypeInfoPropertyName = "SessionEventsPermissionRequestCustomTool")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestExtensionManagement), TypeInfoPropertyName = "SessionEventsPermissionRequestExtensionManagement")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestExtensionPermissionAccess), TypeInfoPropertyName = "SessionEventsPermissionRequestExtensionPermissionAccess")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestHook), TypeInfoPropertyName = "SessionEventsPermissionRequestHook")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestMcp), TypeInfoPropertyName = "SessionEventsPermissionRequestMcp")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestMemory), TypeInfoPropertyName = "SessionEventsPermissionRequestMemory")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestMemoryAction), TypeInfoPropertyName = "SessionEventsPermissionRequestMemoryAction")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestMemoryDirection), TypeInfoPropertyName = "SessionEventsPermissionRequestMemoryDirection")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestRead), TypeInfoPropertyName = "SessionEventsPermissionRequestRead")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestShell), TypeInfoPropertyName = "SessionEventsPermissionRequestShell")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestShellCommand), TypeInfoPropertyName = "SessionEventsPermissionRequestShellCommand")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestShellPossibleUrl), TypeInfoPropertyName = "SessionEventsPermissionRequestShellPossibleUrl")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestUrl), TypeInfoPropertyName = "SessionEventsPermissionRequestUrl")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestWrite), TypeInfoPropertyName = "SessionEventsPermissionRequestWrite")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestedData), TypeInfoPropertyName = "SessionEventsPermissionRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRequestedEvent), TypeInfoPropertyName = "SessionEventsPermissionRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.PermissionResult), TypeInfoPropertyName = "SessionEventsPermissionResult")] [JsonSerializable(typeof(GitHub.Copilot.PermissionRule), TypeInfoPropertyName = "SessionEventsPermissionRule")] [JsonSerializable(typeof(GitHub.Copilot.PersistedBinaryImage), TypeInfoPropertyName = "SessionEventsPersistedBinaryImage")] [JsonSerializable(typeof(GitHub.Copilot.PersistedBinaryImageType), TypeInfoPropertyName = "SessionEventsPersistedBinaryImageType")] [JsonSerializable(typeof(GitHub.Copilot.PersistedBinaryResult), TypeInfoPropertyName = "SessionEventsPersistedBinaryResult")] [JsonSerializable(typeof(GitHub.Copilot.PlanChangedOperation), TypeInfoPropertyName = "SessionEventsPlanChangedOperation")] [JsonSerializable(typeof(GitHub.Copilot.ReasoningSummary), TypeInfoPropertyName = "SessionEventsReasoningSummary")] [JsonSerializable(typeof(GitHub.Copilot.SamplingCompletedData), TypeInfoPropertyName = "SessionEventsSamplingCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.SamplingCompletedEvent), TypeInfoPropertyName = "SessionEventsSamplingCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SamplingRequestedData), TypeInfoPropertyName = "SessionEventsSamplingRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.SamplingRequestedEvent), TypeInfoPropertyName = "SessionEventsSamplingRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SessionEvent), TypeInfoPropertyName = "SessionEventsSessionEvent")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsConfig), TypeInfoPropertyName = "SessionEventsSessionLimitsConfig")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedCompletedData), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedCompletedEvent), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedRequestedData), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedRequestedEvent), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedResponse), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedResponse")] [JsonSerializable(typeof(GitHub.Copilot.SessionLimitsExhaustedResponseAction), TypeInfoPropertyName = "SessionEventsSessionLimitsExhaustedResponseAction")] [JsonSerializable(typeof(GitHub.Copilot.SessionMode), TypeInfoPropertyName = "SessionEventsSessionMode")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownCodeChanges), TypeInfoPropertyName = "SessionEventsShutdownCodeChanges")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownModelMetric), TypeInfoPropertyName = "SessionEventsShutdownModelMetric")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownModelMetricRequests), TypeInfoPropertyName = "SessionEventsShutdownModelMetricRequests")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownModelMetricTokenDetail), TypeInfoPropertyName = "SessionEventsShutdownModelMetricTokenDetail")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownModelMetricUsage), TypeInfoPropertyName = "SessionEventsShutdownModelMetricUsage")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownTokenDetail), TypeInfoPropertyName = "SessionEventsShutdownTokenDetail")] [JsonSerializable(typeof(GitHub.Copilot.ShutdownType), TypeInfoPropertyName = "SessionEventsShutdownType")] [JsonSerializable(typeof(GitHub.Copilot.SkillInvokedData), TypeInfoPropertyName = "SessionEventsSkillInvokedData")] [JsonSerializable(typeof(GitHub.Copilot.SkillInvokedEvent), TypeInfoPropertyName = "SessionEventsSkillInvokedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SkillInvokedTrigger), TypeInfoPropertyName = "SessionEventsSkillInvokedTrigger")] [JsonSerializable(typeof(GitHub.Copilot.SkillSource), TypeInfoPropertyName = "SessionEventsSkillSource")] [JsonSerializable(typeof(GitHub.Copilot.SkillsLoadedSkill), TypeInfoPropertyName = "SessionEventsSkillsLoadedSkill")] [JsonSerializable(typeof(GitHub.Copilot.SubagentCompletedData), TypeInfoPropertyName = "SessionEventsSubagentCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.SubagentCompletedEvent), TypeInfoPropertyName = "SessionEventsSubagentCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SubagentDeselectedData), TypeInfoPropertyName = "SessionEventsSubagentDeselectedData")] [JsonSerializable(typeof(GitHub.Copilot.SubagentDeselectedEvent), TypeInfoPropertyName = "SessionEventsSubagentDeselectedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SubagentFailedData), TypeInfoPropertyName = "SessionEventsSubagentFailedData")] [JsonSerializable(typeof(GitHub.Copilot.SubagentFailedEvent), TypeInfoPropertyName = "SessionEventsSubagentFailedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SubagentSelectedData), TypeInfoPropertyName = "SessionEventsSubagentSelectedData")] [JsonSerializable(typeof(GitHub.Copilot.SubagentSelectedEvent), TypeInfoPropertyName = "SessionEventsSubagentSelectedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SubagentStartedData), TypeInfoPropertyName = "SessionEventsSubagentStartedData")] [JsonSerializable(typeof(GitHub.Copilot.SubagentStartedEvent), TypeInfoPropertyName = "SessionEventsSubagentStartedEvent")] [JsonSerializable(typeof(GitHub.Copilot.SystemMessageData), TypeInfoPropertyName = "SessionEventsSystemMessageData")] [JsonSerializable(typeof(GitHub.Copilot.SystemMessageEvent), TypeInfoPropertyName = "SessionEventsSystemMessageEvent")] [JsonSerializable(typeof(GitHub.Copilot.SystemMessageMetadata), TypeInfoPropertyName = "SessionEventsSystemMessageMetadata")] [JsonSerializable(typeof(GitHub.Copilot.SystemMessageRole), TypeInfoPropertyName = "SessionEventsSystemMessageRole")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotification), TypeInfoPropertyName = "SessionEventsSystemNotification")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationAgentCompleted), TypeInfoPropertyName = "SessionEventsSystemNotificationAgentCompleted")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationAgentCompletedStatus), TypeInfoPropertyName = "SessionEventsSystemNotificationAgentCompletedStatus")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationAgentIdle), TypeInfoPropertyName = "SessionEventsSystemNotificationAgentIdle")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationData), TypeInfoPropertyName = "SessionEventsSystemNotificationData")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationEvent), TypeInfoPropertyName = "SessionEventsSystemNotificationEvent")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationInstructionDiscovered), TypeInfoPropertyName = "SessionEventsSystemNotificationInstructionDiscovered")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationNewInboxMessage), TypeInfoPropertyName = "SessionEventsSystemNotificationNewInboxMessage")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationShellCompleted), TypeInfoPropertyName = "SessionEventsSystemNotificationShellCompleted")] [JsonSerializable(typeof(GitHub.Copilot.SystemNotificationShellDetachedCompleted), TypeInfoPropertyName = "SessionEventsSystemNotificationShellDetachedCompleted")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContent), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContent")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentAudio), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentAudio")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentImage), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentImage")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentResource), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentResource")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentResourceDetails), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentResourceDetails")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentResourceLink), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentResourceLink")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentResourceLinkIcon), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentResourceLinkIcon")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentResourceLinkIconTheme), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentResourceLinkIconTheme")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentShellExit), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentShellExit")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentTerminal), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentTerminal")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteContentText), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteContentText")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteData), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteData")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteError), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteError")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteEvent), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteEvent")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteResult), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteResult")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteToolDescription), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteToolDescription")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteToolDescriptionMeta), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteToolDescriptionMeta")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteToolDescriptionMetaUI), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteToolDescriptionMetaUI")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteToolDescriptionMetaUIVisibility), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteToolDescriptionMetaUIVisibility")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResource), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResource")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResourceMeta), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResourceMeta")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResourceMetaUI), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResourceMetaUI")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResourceMetaUICsp), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResourceMetaUICsp")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResourceMetaUIPermissions), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResourceMetaUIPermissions")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResourceMetaUIPermissionsCamera), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResourceMetaUIPermissionsCamera")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone), TypeInfoPropertyName = "SessionEventsToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionPartialResultEvent), TypeInfoPropertyName = "SessionEventsToolExecutionPartialResultEvent")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionProgressData), TypeInfoPropertyName = "SessionEventsToolExecutionProgressData")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionProgressEvent), TypeInfoPropertyName = "SessionEventsToolExecutionProgressEvent")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionStartData), TypeInfoPropertyName = "SessionEventsToolExecutionStartData")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionStartEvent), TypeInfoPropertyName = "SessionEventsToolExecutionStartEvent")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionStartShellToolInfo), TypeInfoPropertyName = "SessionEventsToolExecutionStartShellToolInfo")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionStartToolDescription), TypeInfoPropertyName = "SessionEventsToolExecutionStartToolDescription")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionStartToolDescriptionMeta), TypeInfoPropertyName = "SessionEventsToolExecutionStartToolDescriptionMeta")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionStartToolDescriptionMetaUI), TypeInfoPropertyName = "SessionEventsToolExecutionStartToolDescriptionMetaUI")] [JsonSerializable(typeof(GitHub.Copilot.ToolExecutionStartToolDescriptionMetaUIVisibility), TypeInfoPropertyName = "SessionEventsToolExecutionStartToolDescriptionMetaUIVisibility")] [JsonSerializable(typeof(GitHub.Copilot.ToolUserRequestedData), TypeInfoPropertyName = "SessionEventsToolUserRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.ToolUserRequestedEvent), TypeInfoPropertyName = "SessionEventsToolUserRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.UserInputCompletedData), TypeInfoPropertyName = "SessionEventsUserInputCompletedData")] [JsonSerializable(typeof(GitHub.Copilot.UserInputCompletedEvent), TypeInfoPropertyName = "SessionEventsUserInputCompletedEvent")] [JsonSerializable(typeof(GitHub.Copilot.UserInputRequestedData), TypeInfoPropertyName = "SessionEventsUserInputRequestedData")] [JsonSerializable(typeof(GitHub.Copilot.UserInputRequestedEvent), TypeInfoPropertyName = "SessionEventsUserInputRequestedEvent")] [JsonSerializable(typeof(GitHub.Copilot.UserMessageAgentMode), TypeInfoPropertyName = "SessionEventsUserMessageAgentMode")] [JsonSerializable(typeof(GitHub.Copilot.UserMessageData), TypeInfoPropertyName = "SessionEventsUserMessageData")] [JsonSerializable(typeof(GitHub.Copilot.UserMessageDelivery), TypeInfoPropertyName = "SessionEventsUserMessageDelivery")] [JsonSerializable(typeof(GitHub.Copilot.UserMessageEvent), TypeInfoPropertyName = "SessionEventsUserMessageEvent")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApproval), TypeInfoPropertyName = "SessionEventsUserToolSessionApproval")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalCommands), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalCommands")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalCustomTool), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalCustomTool")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalExtensionManagement), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalExtensionManagement")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalExtensionPermissionAccess), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalExtensionPermissionAccess")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalMcp), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalMcp")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalMemory), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalMemory")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalRead), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalRead")] [JsonSerializable(typeof(GitHub.Copilot.UserToolSessionApprovalWrite), TypeInfoPropertyName = "SessionEventsUserToolSessionApprovalWrite")] [JsonSerializable(typeof(GitHub.Copilot.WorkingDirectoryContext), TypeInfoPropertyName = "SessionEventsWorkingDirectoryContext")] [JsonSerializable(typeof(GitHub.Copilot.WorkingDirectoryContextHostType), TypeInfoPropertyName = "SessionEventsWorkingDirectoryContextHostType")] [JsonSerializable(typeof(GitHub.Copilot.WorkspaceFileChangedOperation), TypeInfoPropertyName = "SessionEventsWorkspaceFileChangedOperation")] [JsonSerializable(typeof(AbortRequest))] [JsonSerializable(typeof(AbortResult))] [JsonSerializable(typeof(AccountAllUsers))] [JsonSerializable(typeof(AccountGetCurrentAuthResult))] [JsonSerializable(typeof(AccountGetQuotaRequest))] [JsonSerializable(typeof(AccountGetQuotaResult))] [JsonSerializable(typeof(AccountLoginRequest))] [JsonSerializable(typeof(AccountLoginResult))] [JsonSerializable(typeof(AccountLogoutRequest))] [JsonSerializable(typeof(AccountLogoutResult))] [JsonSerializable(typeof(AccountQuotaSnapshot))] [JsonSerializable(typeof(AgentDiscoveryPath))] [JsonSerializable(typeof(AgentDiscoveryPathList))] [JsonSerializable(typeof(AgentGetCurrentResult))] [JsonSerializable(typeof(AgentInfo))] [JsonSerializable(typeof(AgentList))] [JsonSerializable(typeof(AgentRegistryLiveTargetEntry))] [JsonSerializable(typeof(AgentRegistryLogCapture))] [JsonSerializable(typeof(AgentRegistrySpawnRequest))] [JsonSerializable(typeof(AgentRegistrySpawnResult))] [JsonSerializable(typeof(AgentReloadResult))] [JsonSerializable(typeof(AgentSelectRequest))] [JsonSerializable(typeof(AgentSelectResult))] [JsonSerializable(typeof(AgentsDiscoverRequest))] [JsonSerializable(typeof(AgentsGetDiscoveryPathsRequest))] [JsonSerializable(typeof(AllowAllPermissionSetResult))] [JsonSerializable(typeof(AllowAllPermissionState))] [JsonSerializable(typeof(AuthInfo))] [JsonSerializable(typeof(CancelUserRequestedShellCommandResult))] [JsonSerializable(typeof(CanvasAction))] [JsonSerializable(typeof(CanvasActionInvokeRequest))] [JsonSerializable(typeof(CanvasActionInvokeResult))] [JsonSerializable(typeof(CanvasCloseRequest))] [JsonSerializable(typeof(CanvasHostContext))] [JsonSerializable(typeof(CanvasHostContextCapabilities))] [JsonSerializable(typeof(CanvasList))] [JsonSerializable(typeof(CanvasListOpenResult))] [JsonSerializable(typeof(CanvasOpenRequest))] [JsonSerializable(typeof(CanvasProviderCloseRequest))] [JsonSerializable(typeof(CanvasProviderInvokeActionRequest))] [JsonSerializable(typeof(CanvasProviderOpenRequest))] [JsonSerializable(typeof(CanvasProviderOpenResult))] [JsonSerializable(typeof(CanvasSessionContext))] [JsonSerializable(typeof(CapiSessionOptions))] [JsonSerializable(typeof(CommandList))] [JsonSerializable(typeof(CommandsHandlePendingCommandRequest))] [JsonSerializable(typeof(CommandsHandlePendingCommandResult))] [JsonSerializable(typeof(CommandsInvokeRequest))] [JsonSerializable(typeof(CommandsListRequest))] [JsonSerializable(typeof(CommandsListRequestWithSession))] [JsonSerializable(typeof(CommandsRespondToQueuedCommandRequest))] [JsonSerializable(typeof(CommandsRespondToQueuedCommandResult))] [JsonSerializable(typeof(CompletionsGetTriggerCharactersResult))] [JsonSerializable(typeof(CompletionsRequestRequest))] [JsonSerializable(typeof(CompletionsRequestResult))] [JsonSerializable(typeof(ConfigureSessionExtensionsParams))] [JsonSerializable(typeof(ConnectRemoteSessionParams))] [JsonSerializable(typeof(ConnectRequest))] [JsonSerializable(typeof(ConnectResult))] [JsonSerializable(typeof(ConnectedRemoteSessionMetadata))] [JsonSerializable(typeof(ConnectedRemoteSessionMetadataRepository))] [JsonSerializable(typeof(CopilotUserResponse))] [JsonSerializable(typeof(CopilotUserResponseEndpoints))] [JsonSerializable(typeof(CopilotUserResponseOrganizationListItem))] [JsonSerializable(typeof(CopilotUserResponseQuotaSnapshots))] [JsonSerializable(typeof(CopilotUserResponseQuotaSnapshotsChat))] [JsonSerializable(typeof(CopilotUserResponseQuotaSnapshotsCompletions))] [JsonSerializable(typeof(CopilotUserResponseQuotaSnapshotsPremiumInteractions))] [JsonSerializable(typeof(CurrentModel))] [JsonSerializable(typeof(CurrentToolMetadata))] [JsonSerializable(typeof(DiscoveredCanvas))] [JsonSerializable(typeof(DiscoveredMcpServer))] [JsonSerializable(typeof(EnqueueCommandParams))] [JsonSerializable(typeof(EnqueueCommandResult))] [JsonSerializable(typeof(EventLogReadRequest))] [JsonSerializable(typeof(EventLogReleaseInterestResult))] [JsonSerializable(typeof(EventLogTailResult))] [JsonSerializable(typeof(EventsReadResult))] [JsonSerializable(typeof(ExecuteCommandParams))] [JsonSerializable(typeof(ExecuteCommandResult))] [JsonSerializable(typeof(Extension))] [JsonSerializable(typeof(ExtensionList))] [JsonSerializable(typeof(ExtensionsDisableRequest))] [JsonSerializable(typeof(ExtensionsEnableRequest))] [JsonSerializable(typeof(FleetStartRequest))] [JsonSerializable(typeof(FleetStartResult))] [JsonSerializable(typeof(FolderTrustAddParams))] [JsonSerializable(typeof(FolderTrustCheckParams))] [JsonSerializable(typeof(FolderTrustCheckResult))] [JsonSerializable(typeof(GitHubTelemetryClientInfo))] [JsonSerializable(typeof(GitHubTelemetryEvent))] [JsonSerializable(typeof(GitHubTelemetryNotification))] [JsonSerializable(typeof(HandlePendingToolCallRequest))] [JsonSerializable(typeof(HandlePendingToolCallResult))] [JsonSerializable(typeof(HistoryAbortManualCompactionResult))] [JsonSerializable(typeof(HistoryCancelBackgroundCompactionResult))] [JsonSerializable(typeof(HistoryCompactContextWindow))] [JsonSerializable(typeof(HistoryCompactRequest))] [JsonSerializable(typeof(HistoryCompactRequestWithSession))] [JsonSerializable(typeof(HistoryCompactResult))] [JsonSerializable(typeof(HistorySummarizeForHandoffResult))] [JsonSerializable(typeof(HistoryTruncateRequest))] [JsonSerializable(typeof(HistoryTruncateResult))] [JsonSerializable(typeof(InstalledPlugin))] [JsonSerializable(typeof(InstalledPluginInfo))] [JsonSerializable(typeof(InstructionDiscoveryPath))] [JsonSerializable(typeof(InstructionDiscoveryPathList))] [JsonSerializable(typeof(InstructionSource))] [JsonSerializable(typeof(InstructionsDiscoverRequest))] [JsonSerializable(typeof(InstructionsGetDiscoveryPathsRequest))] [JsonSerializable(typeof(InstructionsGetSourcesResult))] [JsonSerializable(typeof(LlmInferenceHttpRequestChunkRequest))] [JsonSerializable(typeof(LlmInferenceHttpRequestChunkResult))] [JsonSerializable(typeof(LlmInferenceHttpRequestStartRequest))] [JsonSerializable(typeof(LlmInferenceHttpRequestStartResult))] [JsonSerializable(typeof(LlmInferenceHttpResponseChunkError))] [JsonSerializable(typeof(LlmInferenceHttpResponseChunkRequest))] [JsonSerializable(typeof(LlmInferenceHttpResponseChunkResult))] [JsonSerializable(typeof(LlmInferenceHttpResponseStartRequest))] [JsonSerializable(typeof(LlmInferenceHttpResponseStartResult))] [JsonSerializable(typeof(LlmInferenceSetProviderResult))] [JsonSerializable(typeof(LocalSessionMetadataValue))] [JsonSerializable(typeof(LogRequest))] [JsonSerializable(typeof(LogResult))] [JsonSerializable(typeof(LspInitializeRequest))] [JsonSerializable(typeof(MarketplaceAddResult))] [JsonSerializable(typeof(MarketplaceBrowseResult))] [JsonSerializable(typeof(MarketplaceInfo))] [JsonSerializable(typeof(MarketplaceListResult))] [JsonSerializable(typeof(MarketplacePluginInfo))] [JsonSerializable(typeof(MarketplaceRefreshEntry))] [JsonSerializable(typeof(MarketplaceRefreshResult))] [JsonSerializable(typeof(MarketplaceRemoveResult))] [JsonSerializable(typeof(McpAllowedServer))] [JsonSerializable(typeof(McpAppsCallToolRequest))] [JsonSerializable(typeof(McpAppsDiagnoseCapability))] [JsonSerializable(typeof(McpAppsDiagnoseRequest))] [JsonSerializable(typeof(McpAppsDiagnoseResult))] [JsonSerializable(typeof(McpAppsDiagnoseServer))] [JsonSerializable(typeof(McpAppsHostContext))] [JsonSerializable(typeof(McpAppsHostContextDetails))] [JsonSerializable(typeof(McpAppsListToolsRequest))] [JsonSerializable(typeof(McpAppsListToolsResult))] [JsonSerializable(typeof(McpAppsReadResourceRequest))] [JsonSerializable(typeof(McpAppsReadResourceResult))] [JsonSerializable(typeof(McpAppsResourceContent))] [JsonSerializable(typeof(McpAppsSetHostContextDetails))] [JsonSerializable(typeof(McpAppsSetHostContextRequest))] [JsonSerializable(typeof(McpCancelSamplingExecutionParams))] [JsonSerializable(typeof(McpCancelSamplingExecutionResult))] [JsonSerializable(typeof(McpConfigAddRequest))] [JsonSerializable(typeof(McpConfigDisableRequest))] [JsonSerializable(typeof(McpConfigEnableRequest))] [JsonSerializable(typeof(McpConfigList))] [JsonSerializable(typeof(McpConfigRemoveRequest))] [JsonSerializable(typeof(McpConfigUpdateRequest))] [JsonSerializable(typeof(McpConfigureGitHubRequest))] [JsonSerializable(typeof(McpConfigureGitHubResult))] [JsonSerializable(typeof(McpDisableRequest))] [JsonSerializable(typeof(McpDiscoverRequest))] [JsonSerializable(typeof(McpDiscoverResult))] [JsonSerializable(typeof(McpEnableRequest))] [JsonSerializable(typeof(McpExecuteSamplingParams))] [JsonSerializable(typeof(McpExecuteSamplingRequest))] [JsonSerializable(typeof(McpExecuteSamplingResult))] [JsonSerializable(typeof(McpFilteredServer))] [JsonSerializable(typeof(McpHeadersHandlePendingHeadersRefreshRequest))] [JsonSerializable(typeof(McpHeadersHandlePendingHeadersRefreshRequestRequest))] [JsonSerializable(typeof(McpHeadersHandlePendingHeadersRefreshRequestResult))] [JsonSerializable(typeof(McpHostState))] [JsonSerializable(typeof(McpIsServerRunningRequest))] [JsonSerializable(typeof(McpIsServerRunningResult))] [JsonSerializable(typeof(McpListToolsRequest))] [JsonSerializable(typeof(McpListToolsResult))] [JsonSerializable(typeof(McpOauthHandlePendingRequest))] [JsonSerializable(typeof(McpOauthHandlePendingResult))] [JsonSerializable(typeof(McpOauthLoginRequest))] [JsonSerializable(typeof(McpOauthLoginResult))] [JsonSerializable(typeof(McpOauthPendingRequestResponse))] [JsonSerializable(typeof(McpOauthRespondRequest))] [JsonSerializable(typeof(McpOauthRespondResult))] [JsonSerializable(typeof(McpRegisterExternalClientRequest))] [JsonSerializable(typeof(McpReloadWithConfigRequest))] [JsonSerializable(typeof(McpRemoveGitHubResult))] [JsonSerializable(typeof(McpRestartServerRequest))] [JsonSerializable(typeof(McpSamplingExecutionResult))] [JsonSerializable(typeof(McpServer))] [JsonSerializable(typeof(McpServerFailureInfo))] [JsonSerializable(typeof(McpServerList))] [JsonSerializable(typeof(McpServerNeedsAuthInfo))] [JsonSerializable(typeof(McpSetEnvValueModeParams))] [JsonSerializable(typeof(McpSetEnvValueModeResult))] [JsonSerializable(typeof(McpStartServerRequest))] [JsonSerializable(typeof(McpStartServersResult))] [JsonSerializable(typeof(McpStopServerRequest))] [JsonSerializable(typeof(McpTools))] [JsonSerializable(typeof(McpUnregisterExternalClientRequest))] [JsonSerializable(typeof(MetadataContextInfoRequest))] [JsonSerializable(typeof(MetadataContextInfoResult))] [JsonSerializable(typeof(MetadataContextInfoResultContextInfo))] [JsonSerializable(typeof(MetadataIsProcessingResult))] [JsonSerializable(typeof(MetadataRecomputeContextTokensRequest))] [JsonSerializable(typeof(MetadataRecomputeContextTokensResult))] [JsonSerializable(typeof(MetadataRecordContextChangeRequest))] [JsonSerializable(typeof(MetadataRecordContextChangeResult))] [JsonSerializable(typeof(MetadataSetWorkingDirectoryRequest))] [JsonSerializable(typeof(MetadataSetWorkingDirectoryResult))] [JsonSerializable(typeof(MetadataSnapshotRemoteMetadata))] [JsonSerializable(typeof(MetadataSnapshotRemoteMetadataRepository))] [JsonSerializable(typeof(ModeSetRequest))] [JsonSerializable(typeof(Model))] [JsonSerializable(typeof(ModelBilling))] [JsonSerializable(typeof(ModelBillingTokenPrices))] [JsonSerializable(typeof(ModelBillingTokenPricesLongContext))] [JsonSerializable(typeof(ModelCapabilities))] [JsonSerializable(typeof(ModelCapabilitiesLimits))] [JsonSerializable(typeof(ModelCapabilitiesLimitsVision))] [JsonSerializable(typeof(ModelCapabilitiesOverride))] [JsonSerializable(typeof(ModelCapabilitiesOverrideLimits))] [JsonSerializable(typeof(ModelCapabilitiesOverrideLimitsVision))] [JsonSerializable(typeof(ModelCapabilitiesOverrideSupports))] [JsonSerializable(typeof(ModelCapabilitiesSupports))] [JsonSerializable(typeof(ModelList))] [JsonSerializable(typeof(ModelListRequest))] [JsonSerializable(typeof(ModelListRequestWithSession))] [JsonSerializable(typeof(ModelPolicy))] [JsonSerializable(typeof(ModelSetReasoningEffortRequest))] [JsonSerializable(typeof(ModelSetReasoningEffortResult))] [JsonSerializable(typeof(ModelSwitchToRequest))] [JsonSerializable(typeof(ModelSwitchToResult))] [JsonSerializable(typeof(ModelsListRequest))] [JsonSerializable(typeof(NameGetResult))] [JsonSerializable(typeof(NameSetAutoRequest))] [JsonSerializable(typeof(NameSetAutoResult))] [JsonSerializable(typeof(NameSetRequest))] [JsonSerializable(typeof(NamedProviderConfig))] [JsonSerializable(typeof(OpenCanvasInstance))] [JsonSerializable(typeof(OptionsUpdateAdditionalContentExclusionPolicy))] [JsonSerializable(typeof(OptionsUpdateAdditionalContentExclusionPolicyRule))] [JsonSerializable(typeof(OptionsUpdateAdditionalContentExclusionPolicyRuleSource))] [JsonSerializable(typeof(PendingPermissionRequest))] [JsonSerializable(typeof(PendingPermissionRequestList))] [JsonSerializable(typeof(PermissionDecision))] [JsonSerializable(typeof(PermissionDecisionApproveForLocationApproval))] [JsonSerializable(typeof(PermissionDecisionApproveForSessionApproval))] [JsonSerializable(typeof(PermissionDecisionRequest))] [JsonSerializable(typeof(PermissionLocationAddToolApprovalParams))] [JsonSerializable(typeof(PermissionLocationApplyParams))] [JsonSerializable(typeof(PermissionLocationApplyResult))] [JsonSerializable(typeof(PermissionLocationResolveParams))] [JsonSerializable(typeof(PermissionLocationResolveResult))] [JsonSerializable(typeof(PermissionPathsAddParams))] [JsonSerializable(typeof(PermissionPathsAllowedCheckParams))] [JsonSerializable(typeof(PermissionPathsAllowedCheckResult))] [JsonSerializable(typeof(PermissionPathsConfig))] [JsonSerializable(typeof(PermissionPathsList))] [JsonSerializable(typeof(PermissionPathsUpdatePrimaryParams))] [JsonSerializable(typeof(PermissionPathsWorkspaceCheckParams))] [JsonSerializable(typeof(PermissionPathsWorkspaceCheckResult))] [JsonSerializable(typeof(PermissionPromptShownNotification))] [JsonSerializable(typeof(PermissionRequestResult))] [JsonSerializable(typeof(PermissionRulesSet))] [JsonSerializable(typeof(PermissionUrlsConfig))] [JsonSerializable(typeof(PermissionUrlsSetUnrestrictedModeParams))] [JsonSerializable(typeof(PermissionsConfigureAdditionalContentExclusionPolicy))] [JsonSerializable(typeof(PermissionsConfigureAdditionalContentExclusionPolicyRule))] [JsonSerializable(typeof(PermissionsConfigureAdditionalContentExclusionPolicyRuleSource))] [JsonSerializable(typeof(PermissionsConfigureParams))] [JsonSerializable(typeof(PermissionsConfigureResult))] [JsonSerializable(typeof(PermissionsFolderTrustAddTrustedResult))] [JsonSerializable(typeof(PermissionsGetAllowAllRequest))] [JsonSerializable(typeof(PermissionsLocationsAddToolApprovalDetails))] [JsonSerializable(typeof(PermissionsLocationsAddToolApprovalResult))] [JsonSerializable(typeof(PermissionsModifyRulesParams))] [JsonSerializable(typeof(PermissionsModifyRulesResult))] [JsonSerializable(typeof(PermissionsNotifyPromptShownResult))] [JsonSerializable(typeof(PermissionsPathsAddResult))] [JsonSerializable(typeof(PermissionsPathsListRequest))] [JsonSerializable(typeof(PermissionsPathsUpdatePrimaryResult))] [JsonSerializable(typeof(PermissionsPendingRequestsRequest))] [JsonSerializable(typeof(PermissionsResetSessionApprovalsRequest))] [JsonSerializable(typeof(PermissionsResetSessionApprovalsResult))] [JsonSerializable(typeof(PermissionsSetAllowAllRequest))] [JsonSerializable(typeof(PermissionsSetApproveAllRequest))] [JsonSerializable(typeof(PermissionsSetApproveAllResult))] [JsonSerializable(typeof(PermissionsSetRequiredRequest))] [JsonSerializable(typeof(PermissionsSetRequiredResult))] [JsonSerializable(typeof(PermissionsUrlsSetUnrestrictedModeResult))] [JsonSerializable(typeof(PingRequest))] [JsonSerializable(typeof(PingResult))] [JsonSerializable(typeof(PlanReadResult))] [JsonSerializable(typeof(PlanReadSqlTodosResult))] [JsonSerializable(typeof(PlanReadSqlTodosWithDependenciesResult))] [JsonSerializable(typeof(PlanSqlTodoDependency))] [JsonSerializable(typeof(PlanSqlTodosRow))] [JsonSerializable(typeof(PlanUpdateRequest))] [JsonSerializable(typeof(Plugin))] [JsonSerializable(typeof(PluginInstallResult))] [JsonSerializable(typeof(PluginList))] [JsonSerializable(typeof(PluginListResult))] [JsonSerializable(typeof(PluginUpdateAllEntry))] [JsonSerializable(typeof(PluginUpdateAllResult))] [JsonSerializable(typeof(PluginUpdateResult))] [JsonSerializable(typeof(PluginsDisableRequest))] [JsonSerializable(typeof(PluginsEnableRequest))] [JsonSerializable(typeof(PluginsInstallRequest))] [JsonSerializable(typeof(PluginsMarketplacesAddRequest))] [JsonSerializable(typeof(PluginsMarketplacesBrowseRequest))] [JsonSerializable(typeof(PluginsMarketplacesRefreshRequest))] [JsonSerializable(typeof(PluginsMarketplacesRemoveRequest))] [JsonSerializable(typeof(PluginsReloadRequest))] [JsonSerializable(typeof(PluginsReloadRequestWithSession))] [JsonSerializable(typeof(PluginsUninstallRequest))] [JsonSerializable(typeof(PluginsUpdateRequest))] [JsonSerializable(typeof(PollSpawnedSessionsResult))] [JsonSerializable(typeof(ProviderAddRequest))] [JsonSerializable(typeof(ProviderAddResult))] [JsonSerializable(typeof(ProviderConfig))] [JsonSerializable(typeof(ProviderConfigAzure))] [JsonSerializable(typeof(ProviderEndpoint))] [JsonSerializable(typeof(ProviderGetEndpointRequest))] [JsonSerializable(typeof(ProviderGetEndpointRequestWithSession))] [JsonSerializable(typeof(ProviderModelConfig))] [JsonSerializable(typeof(ProviderSessionToken))] [JsonSerializable(typeof(ProviderTokenAcquireRequest))] [JsonSerializable(typeof(ProviderTokenAcquireResult))] [JsonSerializable(typeof(PushAttachment))] [JsonSerializable(typeof(PushAttachmentFileLineRange))] [JsonSerializable(typeof(PushAttachmentGitHubFileDiffSide))] [JsonSerializable(typeof(PushAttachmentGitHubTreeComparisonSide))] [JsonSerializable(typeof(PushAttachmentSelectionDetails))] [JsonSerializable(typeof(PushAttachmentSelectionDetailsEnd))] [JsonSerializable(typeof(PushAttachmentSelectionDetailsStart))] [JsonSerializable(typeof(PushGitHubRepoRef))] [JsonSerializable(typeof(QueuePendingItems))] [JsonSerializable(typeof(QueuePendingItemsResult))] [JsonSerializable(typeof(QueueRemoveMostRecentResult))] [JsonSerializable(typeof(QueuedCommandResult))] [JsonSerializable(typeof(RegisterEventInterestParams))] [JsonSerializable(typeof(RegisterEventInterestResult))] [JsonSerializable(typeof(RegisterExtensionToolsParams))] [JsonSerializable(typeof(RegisterExtensionToolsResult))] [JsonSerializable(typeof(ReleaseEventInterestParams))] [JsonSerializable(typeof(RemoteControlConfig))] [JsonSerializable(typeof(RemoteControlConfigExistingMcSession))] [JsonSerializable(typeof(RemoteControlStatus))] [JsonSerializable(typeof(RemoteControlStatusResult))] [JsonSerializable(typeof(RemoteControlStopResult))] [JsonSerializable(typeof(RemoteControlTransferResult))] [JsonSerializable(typeof(RemoteEnableRequest))] [JsonSerializable(typeof(RemoteEnableResult))] [JsonSerializable(typeof(RemoteNotifySteerableChangedRequest))] [JsonSerializable(typeof(RemoteNotifySteerableChangedResult))] [JsonSerializable(typeof(RemoteSessionConnectionResult))] [JsonSerializable(typeof(RemoteSessionMetadataRepository))] [JsonSerializable(typeof(RemoteSessionMetadataValue))] [JsonSerializable(typeof(SandboxConfig))] [JsonSerializable(typeof(SandboxConfigUserPolicy))] [JsonSerializable(typeof(SandboxConfigUserPolicyExperimental))] [JsonSerializable(typeof(SandboxConfigUserPolicyExperimentalSeatbelt))] [JsonSerializable(typeof(SandboxConfigUserPolicyFilesystem))] [JsonSerializable(typeof(SandboxConfigUserPolicyNetwork))] [JsonSerializable(typeof(SandboxConfigUserPolicySeatbelt))] [JsonSerializable(typeof(ScheduleEntry))] [JsonSerializable(typeof(ScheduleList))] [JsonSerializable(typeof(ScheduleStopRequest))] [JsonSerializable(typeof(ScheduleStopResult))] [JsonSerializable(typeof(SecretsAddFilterValuesRequest))] [JsonSerializable(typeof(SecretsAddFilterValuesResult))] [JsonSerializable(typeof(SendAttachmentsToMessageParams))] [JsonSerializable(typeof(SendRequest))] [JsonSerializable(typeof(SendResult))] [JsonSerializable(typeof(ServerAgentList))] [JsonSerializable(typeof(ServerInstructionSourceList))] [JsonSerializable(typeof(ServerSkill))] [JsonSerializable(typeof(ServerSkillList))] [JsonSerializable(typeof(SessionActivity))] [JsonSerializable(typeof(SessionAgentDeselectRequest))] [JsonSerializable(typeof(SessionAgentGetCurrentRequest))] [JsonSerializable(typeof(SessionAgentListRequest))] [JsonSerializable(typeof(SessionAgentReloadRequest))] [JsonSerializable(typeof(SessionAuthStatus))] [JsonSerializable(typeof(SessionBulkDeleteResult))] [JsonSerializable(typeof(SessionCanvasListOpenRequest))] [JsonSerializable(typeof(SessionCanvasListRequest))] [JsonSerializable(typeof(SessionCompletionItem))] [JsonSerializable(typeof(SessionCompletionsGetTriggerCharactersRequest))] [JsonSerializable(typeof(SessionContext))] [JsonSerializable(typeof(SessionEnrichMetadataResult))] [JsonSerializable(typeof(SessionEventLogTailRequest))] [JsonSerializable(typeof(SessionExtensionsListRequest))] [JsonSerializable(typeof(SessionExtensionsReloadRequest))] [JsonSerializable(typeof(SessionFsAppendFileRequest))] [JsonSerializable(typeof(SessionFsError))] [JsonSerializable(typeof(SessionFsExistsRequest))] [JsonSerializable(typeof(SessionFsExistsResult))] [JsonSerializable(typeof(SessionFsMkdirRequest))] [JsonSerializable(typeof(SessionFsReadFileRequest))] [JsonSerializable(typeof(SessionFsReadFileResult))] [JsonSerializable(typeof(SessionFsReaddirRequest))] [JsonSerializable(typeof(SessionFsReaddirResult))] [JsonSerializable(typeof(SessionFsReaddirWithTypesEntry))] [JsonSerializable(typeof(SessionFsReaddirWithTypesRequest))] [JsonSerializable(typeof(SessionFsReaddirWithTypesResult))] [JsonSerializable(typeof(SessionFsRenameRequest))] [JsonSerializable(typeof(SessionFsRmRequest))] [JsonSerializable(typeof(SessionFsSetProviderCapabilities))] [JsonSerializable(typeof(SessionFsSetProviderRequest))] [JsonSerializable(typeof(SessionFsSetProviderResult))] [JsonSerializable(typeof(SessionFsSqliteExistsRequest))] [JsonSerializable(typeof(SessionFsSqliteExistsResult))] [JsonSerializable(typeof(SessionFsSqliteQueryRequest))] [JsonSerializable(typeof(SessionFsSqliteQueryResult))] [JsonSerializable(typeof(SessionFsStatRequest))] [JsonSerializable(typeof(SessionFsStatResult))] [JsonSerializable(typeof(SessionFsWriteFileRequest))] [JsonSerializable(typeof(SessionGitHubAuthGetStatusRequest))] [JsonSerializable(typeof(SessionHistoryAbortManualCompactionRequest))] [JsonSerializable(typeof(SessionHistoryCancelBackgroundCompactionRequest))] [JsonSerializable(typeof(SessionHistorySummarizeForHandoffRequest))] [JsonSerializable(typeof(SessionInstalledPlugin))] [JsonSerializable(typeof(SessionInstructionsGetSourcesRequest))] [JsonSerializable(typeof(SessionList))] [JsonSerializable(typeof(SessionListEntry))] [JsonSerializable(typeof(SessionListFilter))] [JsonSerializable(typeof(SessionLoadDeferredRepoHooksResult))] [JsonSerializable(typeof(SessionMcpAppsGetHostContextRequest))] [JsonSerializable(typeof(SessionMcpListRequest))] [JsonSerializable(typeof(SessionMcpReloadRequest))] [JsonSerializable(typeof(SessionMcpRemoveGitHubRequest))] [JsonSerializable(typeof(SessionMetadataActivityRequest))] [JsonSerializable(typeof(SessionMetadataIsProcessingRequest))] [JsonSerializable(typeof(SessionMetadataSnapshot))] [JsonSerializable(typeof(SessionMetadataSnapshotRequest))] [JsonSerializable(typeof(SessionMetadataSnapshotWorkspace))] [JsonSerializable(typeof(SessionModeGetRequest))] [JsonSerializable(typeof(SessionModelGetCurrentRequest))] [JsonSerializable(typeof(SessionModelList))] [JsonSerializable(typeof(SessionNameGetRequest))] [JsonSerializable(typeof(SessionOpenResult))] [JsonSerializable(typeof(SessionPlanDeleteRequest))] [JsonSerializable(typeof(SessionPlanReadRequest))] [JsonSerializable(typeof(SessionPlanReadSqlTodosRequest))] [JsonSerializable(typeof(SessionPlanReadSqlTodosWithDependenciesRequest))] [JsonSerializable(typeof(SessionPluginsListRequest))] [JsonSerializable(typeof(SessionPruneResult))] [JsonSerializable(typeof(SessionQueueClearRequest))] [JsonSerializable(typeof(SessionQueuePendingItemsRequest))] [JsonSerializable(typeof(SessionQueueRemoveMostRecentRequest))] [JsonSerializable(typeof(SessionRemoteDisableRequest))] [JsonSerializable(typeof(SessionScheduleListRequest))] [JsonSerializable(typeof(SessionSetCredentialsParams))] [JsonSerializable(typeof(SessionSetCredentialsResult))] [JsonSerializable(typeof(SessionSizes))] [JsonSerializable(typeof(SessionSkillsEnsureLoadedRequest))] [JsonSerializable(typeof(SessionSkillsGetInvokedRequest))] [JsonSerializable(typeof(SessionSkillsListRequest))] [JsonSerializable(typeof(SessionSkillsReloadRequest))] [JsonSerializable(typeof(SessionSuspendRequest))] [JsonSerializable(typeof(SessionTasksGetCurrentPromotableRequest))] [JsonSerializable(typeof(SessionTasksListRequest))] [JsonSerializable(typeof(SessionTasksPromoteCurrentToBackgroundRequest))] [JsonSerializable(typeof(SessionTasksRefreshRequest))] [JsonSerializable(typeof(SessionTasksWaitForPendingRequest))] [JsonSerializable(typeof(SessionTelemetryEngagement))] [JsonSerializable(typeof(SessionTelemetryGetEngagementIdRequest))] [JsonSerializable(typeof(SessionToolsGetCurrentMetadataRequest))] [JsonSerializable(typeof(SessionToolsInitializeAndValidateRequest))] [JsonSerializable(typeof(SessionUiRegisterDirectAutoModeSwitchHandlerRequest))] [JsonSerializable(typeof(SessionUpdateOptionsParams))] [JsonSerializable(typeof(SessionUpdateOptionsResult))] [JsonSerializable(typeof(SessionUsageGetMetricsRequest))] [JsonSerializable(typeof(SessionVisibilityGetRequest))] [JsonSerializable(typeof(SessionWorkingDirectoryContext))] [JsonSerializable(typeof(SessionWorkspacesGetWorkspaceRequest))] [JsonSerializable(typeof(SessionWorkspacesListCheckpointsRequest))] [JsonSerializable(typeof(SessionWorkspacesListFilesRequest))] [JsonSerializable(typeof(SessionsBulkDeleteRequest))] [JsonSerializable(typeof(SessionsCheckInUseRequest))] [JsonSerializable(typeof(SessionsCheckInUseResult))] [JsonSerializable(typeof(SessionsCloseRequest))] [JsonSerializable(typeof(SessionsCloseResult))] [JsonSerializable(typeof(SessionsEnrichMetadataRequest))] [JsonSerializable(typeof(SessionsFindByPrefixRequest))] [JsonSerializable(typeof(SessionsFindByPrefixResult))] [JsonSerializable(typeof(SessionsFindByTaskIDRequest))] [JsonSerializable(typeof(SessionsFindByTaskIDResult))] [JsonSerializable(typeof(SessionsForkRequest))] [JsonSerializable(typeof(SessionsForkResult))] [JsonSerializable(typeof(SessionsGetBoardEntryCountRequest))] [JsonSerializable(typeof(SessionsGetBoardEntryCountResult))] [JsonSerializable(typeof(SessionsGetEventFilePathRequest))] [JsonSerializable(typeof(SessionsGetEventFilePathResult))] [JsonSerializable(typeof(SessionsGetLastForContextRequest))] [JsonSerializable(typeof(SessionsGetLastForContextResult))] [JsonSerializable(typeof(SessionsGetPersistedRemoteSteerableRequest))] [JsonSerializable(typeof(SessionsGetPersistedRemoteSteerableResult))] [JsonSerializable(typeof(SessionsListRequest))] [JsonSerializable(typeof(SessionsLoadDeferredRepoHooksRequest))] [JsonSerializable(typeof(SessionsOpenProgress))] [JsonSerializable(typeof(SessionsPollSpawnedSessionsEvent))] [JsonSerializable(typeof(SessionsPollSpawnedSessionsRequest))] [JsonSerializable(typeof(SessionsPruneOldRequest))] [JsonSerializable(typeof(SessionsRegisterExtensionToolsOnSessionOptions))] [JsonSerializable(typeof(SessionsReleaseLockRequest))] [JsonSerializable(typeof(SessionsReleaseLockResult))] [JsonSerializable(typeof(SessionsReloadPluginHooksRequest))] [JsonSerializable(typeof(SessionsReloadPluginHooksResult))] [JsonSerializable(typeof(SessionsSaveRequest))] [JsonSerializable(typeof(SessionsSaveResult))] [JsonSerializable(typeof(SessionsSetAdditionalPluginsRequest))] [JsonSerializable(typeof(SessionsSetAdditionalPluginsResult))] [JsonSerializable(typeof(SessionsSetRemoteControlSteeringRequest))] [JsonSerializable(typeof(SessionsStartRemoteControlRequest))] [JsonSerializable(typeof(SessionsStopRemoteControlRequest))] [JsonSerializable(typeof(SessionsTransferRemoteControlRequest))] [JsonSerializable(typeof(ShellCancelUserRequestedRequest))] [JsonSerializable(typeof(ShellExecRequest))] [JsonSerializable(typeof(ShellExecResult))] [JsonSerializable(typeof(ShellExecuteUserRequestedRequest))] [JsonSerializable(typeof(ShellKillRequest))] [JsonSerializable(typeof(ShellKillResult))] [JsonSerializable(typeof(ShutdownRequest))] [JsonSerializable(typeof(Skill))] [JsonSerializable(typeof(SkillDiscoveryPath))] [JsonSerializable(typeof(SkillDiscoveryPathList))] [JsonSerializable(typeof(SkillList))] [JsonSerializable(typeof(SkillsConfigSetDisabledSkillsRequest))] [JsonSerializable(typeof(SkillsDisableRequest))] [JsonSerializable(typeof(SkillsDiscoverRequest))] [JsonSerializable(typeof(SkillsEnableRequest))] [JsonSerializable(typeof(SkillsGetDiscoveryPathsRequest))] [JsonSerializable(typeof(SkillsGetInvokedResult))] [JsonSerializable(typeof(SkillsInvokedSkill))] [JsonSerializable(typeof(SkillsLoadDiagnostics))] [JsonSerializable(typeof(SlashCommandInfo))] [JsonSerializable(typeof(SlashCommandInput))] [JsonSerializable(typeof(SlashCommandInvocationResult))] [JsonSerializable(typeof(SlashCommandSelectSubcommandOption))] [JsonSerializable(typeof(SubagentSettingsEntry))] [JsonSerializable(typeof(TaskInfo))] [JsonSerializable(typeof(TaskList))] [JsonSerializable(typeof(TaskProgressLine))] [JsonSerializable(typeof(TasksCancelRequest))] [JsonSerializable(typeof(TasksCancelResult))] [JsonSerializable(typeof(TasksGetCurrentPromotableResult))] [JsonSerializable(typeof(TasksGetProgressRequest))] [JsonSerializable(typeof(TasksGetProgressResult))] [JsonSerializable(typeof(TasksGetProgressResultProgress))] [JsonSerializable(typeof(TasksPromoteCurrentToBackgroundResult))] [JsonSerializable(typeof(TasksPromoteToBackgroundRequest))] [JsonSerializable(typeof(TasksPromoteToBackgroundResult))] [JsonSerializable(typeof(TasksRefreshResult))] [JsonSerializable(typeof(TasksRemoveRequest))] [JsonSerializable(typeof(TasksRemoveResult))] [JsonSerializable(typeof(TasksSendMessageRequest))] [JsonSerializable(typeof(TasksSendMessageResult))] [JsonSerializable(typeof(TasksStartAgentRequest))] [JsonSerializable(typeof(TasksStartAgentResult))] [JsonSerializable(typeof(TasksWaitForPendingResult))] [JsonSerializable(typeof(TelemetrySetFeatureOverridesRequest))] [JsonSerializable(typeof(Tool))] [JsonSerializable(typeof(ToolList))] [JsonSerializable(typeof(ToolsGetCurrentMetadataResult))] [JsonSerializable(typeof(ToolsInitializeAndValidateResult))] [JsonSerializable(typeof(ToolsListRequest))] [JsonSerializable(typeof(ToolsUpdateSubagentSettingsResult))] [JsonSerializable(typeof(UIElicitationRequest))] [JsonSerializable(typeof(UIElicitationResponse))] [JsonSerializable(typeof(UIElicitationResult))] [JsonSerializable(typeof(UIElicitationSchema))] [JsonSerializable(typeof(UIEphemeralQueryRequest))] [JsonSerializable(typeof(UIEphemeralQueryResult))] [JsonSerializable(typeof(UIExitPlanModeResponse))] [JsonSerializable(typeof(UIHandlePendingAutoModeSwitchRequest))] [JsonSerializable(typeof(UIHandlePendingElicitationRequest))] [JsonSerializable(typeof(UIHandlePendingExitPlanModeRequest))] [JsonSerializable(typeof(UIHandlePendingResult))] [JsonSerializable(typeof(UIHandlePendingSamplingRequest))] [JsonSerializable(typeof(UIHandlePendingSamplingResponse))] [JsonSerializable(typeof(UIHandlePendingSessionLimitsExhaustedRequest))] [JsonSerializable(typeof(UIHandlePendingUserInputRequest))] [JsonSerializable(typeof(UIRegisterDirectAutoModeSwitchHandlerResult))] [JsonSerializable(typeof(UISessionLimitsExhaustedResponse))] [JsonSerializable(typeof(UIUnregisterDirectAutoModeSwitchHandlerRequest))] [JsonSerializable(typeof(UIUnregisterDirectAutoModeSwitchHandlerResult))] [JsonSerializable(typeof(UIUserInputResponse))] [JsonSerializable(typeof(UpdateSubagentSettingsRequest))] [JsonSerializable(typeof(UpdateSubagentSettingsRequestSubagents))] [JsonSerializable(typeof(UsageGetMetricsResult))] [JsonSerializable(typeof(UsageMetricsCodeChanges))] [JsonSerializable(typeof(UsageMetricsModelMetric))] [JsonSerializable(typeof(UsageMetricsModelMetricRequests))] [JsonSerializable(typeof(UsageMetricsModelMetricTokenDetail))] [JsonSerializable(typeof(UsageMetricsModelMetricUsage))] [JsonSerializable(typeof(UsageMetricsTokenDetail))] [JsonSerializable(typeof(UserRequestedShellCommandResult))] [JsonSerializable(typeof(UserSettingMetadata))] [JsonSerializable(typeof(UserSettingsGetResult))] [JsonSerializable(typeof(UserSettingsSetRequest))] [JsonSerializable(typeof(UserSettingsSetResult))] [JsonSerializable(typeof(VisibilityGetResult))] [JsonSerializable(typeof(VisibilitySetRequest))] [JsonSerializable(typeof(VisibilitySetResult))] [JsonSerializable(typeof(WorkspaceDiffFileChange))] [JsonSerializable(typeof(WorkspaceDiffResult))] [JsonSerializable(typeof(WorkspacesCheckpoints))] [JsonSerializable(typeof(WorkspacesCreateFileRequest))] [JsonSerializable(typeof(WorkspacesDiffRequest))] [JsonSerializable(typeof(WorkspacesGetWorkspaceResult))] [JsonSerializable(typeof(WorkspacesGetWorkspaceResultWorkspace))] [JsonSerializable(typeof(WorkspacesListCheckpointsResult))] [JsonSerializable(typeof(WorkspacesListFilesResult))] [JsonSerializable(typeof(WorkspacesReadCheckpointRequest))] [JsonSerializable(typeof(WorkspacesReadCheckpointResult))] [JsonSerializable(typeof(WorkspacesReadFileRequest))] [JsonSerializable(typeof(WorkspacesReadFileResult))] [JsonSerializable(typeof(WorkspacesSaveLargePasteRequest))] [JsonSerializable(typeof(WorkspacesSaveLargePasteResult))] [JsonSerializable(typeof(WorkspacesSaveLargePasteResultSaved))] internal partial class RpcJsonContext : JsonSerializerContext;