diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 0b4202024..3a9fcf9cd 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -3471,10 +3471,6 @@ internal sealed class SessionCanvasListRequest [Experimental(Diagnostics.Experimental)] public sealed class OpenCanvasInstance { - /// Runtime-controlled routing state for an open canvas instance. - [JsonPropertyName("availability")] - public CanvasInstanceAvailability Availability { get; set; } - /// Provider-local canvas identifier. [JsonPropertyName("canvasId")] public string CanvasId { get; set; } = string.Empty; @@ -3495,10 +3491,6 @@ public sealed class OpenCanvasInstance [JsonPropertyName("instanceId")] public string InstanceId { get; set; } = string.Empty; - /// Whether this snapshot came from an idempotent reopen. - [JsonPropertyName("reopen")] - public bool Reopen { get; set; } - /// Provider-supplied status text. [JsonPropertyName("status")] public string? Status { get; set; } @@ -5668,7 +5660,7 @@ public sealed class McpOauthLoginResult public string? AuthorizationUrl { get; set; } } -/// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. +/// 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 { @@ -5676,14 +5668,30 @@ internal sealed class McpOauthLoginRequest [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")] @@ -6105,6 +6113,10 @@ public sealed class ProviderEndpoint [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; } @@ -6215,6 +6227,10 @@ public sealed class NamedProviderConfig [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; } @@ -6223,6 +6239,10 @@ public sealed class NamedProviderConfig [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; } @@ -6309,6 +6329,15 @@ public sealed class OptionsUpdateAdditionalContentExclusionPolicy 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 @@ -6362,6 +6391,10 @@ public sealed class ProviderConfig [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; } @@ -6382,6 +6415,10 @@ public sealed class ProviderConfig [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; } @@ -6455,11 +6492,20 @@ public sealed class SandboxConfigUserPolicyNetwork 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 { - /// Platform-specific experimental policy fields. + /// Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent. [JsonPropertyName("experimental")] public SandboxConfigUserPolicyExperimental? Experimental { get; set; } @@ -6470,6 +6516,10 @@ public sealed class SandboxConfigUserPolicy /// 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. @@ -6480,10 +6530,6 @@ public sealed class SandboxConfig [JsonPropertyName("addCurrentWorkingDirectory")] public bool? AddCurrentWorkingDirectory { get; set; } - /// Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to `spawnSandboxFromConfig`, bypassing policy merging. - [JsonPropertyName("config")] - public JsonElement? Config { get; set; } - /// Whether sandboxing is enabled for the session. [JsonPropertyName("enabled")] public bool Enabled { get; set; } @@ -6514,6 +6560,10 @@ internal sealed class SessionUpdateOptionsParams [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; } @@ -10237,6 +10287,10 @@ public sealed class ScheduleEntry [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; } @@ -10282,6 +10336,27 @@ internal sealed class ScheduleStopRequest 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. +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 @@ -10648,6 +10723,7 @@ public sealed class CanvasSessionContext } /// Canvas open parameters sent to the provider. +[Experimental(Diagnostics.Experimental)] public sealed class CanvasProviderOpenRequest { /// Provider-local canvas identifier. @@ -10680,6 +10756,7 @@ public sealed class CanvasProviderOpenRequest } /// Canvas close parameters sent to the provider. +[Experimental(Diagnostics.Experimental)] public sealed class CanvasProviderCloseRequest { /// Provider-local canvas identifier. @@ -10708,6 +10785,7 @@ public sealed class CanvasProviderCloseRequest } /// Canvas action invocation parameters sent to the provider. +[Experimental(Diagnostics.Experimental)] public sealed class CanvasProviderInvokeActionRequest { /// Action name to invoke. @@ -12911,69 +12989,6 @@ public override void Write(Utf8JsonWriter writer, AuthInfoType value, JsonSerial } -/// Runtime-controlled routing state for an open canvas instance. -[Experimental(Diagnostics.Experimental)] -[JsonConverter(typeof(Converter))] -[DebuggerDisplay("{Value,nq}")] -public readonly struct CanvasInstanceAvailability : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public CanvasInstanceAvailability(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// The owning provider is currently connected and routing calls will be dispatched normally. - public static CanvasInstanceAvailability Ready { get; } = new("ready"); - - /// The owning provider is not currently connected. Routing calls fail with canvas_provider_unavailable until the agent re-issues open_canvas (which rehydrates via a fresh canvas.open) or the provider reconnects. - public static CanvasInstanceAvailability Stale { get; } = new("stale"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(CanvasInstanceAvailability left, CanvasInstanceAvailability right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(CanvasInstanceAvailability left, CanvasInstanceAvailability right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is CanvasInstanceAvailability other && Equals(other); - - /// - public bool Equals(CanvasInstanceAvailability 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 CanvasInstanceAvailability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, CanvasInstanceAvailability value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(CanvasInstanceAvailability)); - } - } -} - - /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -13132,6 +13147,9 @@ public WorkspaceDiffMode(string value) /// 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); @@ -13496,6 +13514,69 @@ public override void Write(Utf8JsonWriter writer, McpSetEnvValueModeDetails valu } +/// 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))] @@ -14018,6 +14099,69 @@ public override void Write(Utf8JsonWriter writer, 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))] @@ -14147,6 +14291,69 @@ public override void Write(Utf8JsonWriter writer, ProviderEndpointWireApi value, } +/// 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))] @@ -18984,14 +19191,18 @@ public async Task HandlePendingRequestAsync(string /// 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, CancellationToken cancellationToken = default) + 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 }; + 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); } } @@ -19185,6 +19396,7 @@ internal OptionsApi(CopilotSession session) /// 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. @@ -19226,11 +19438,11 @@ internal OptionsApi(CopilotSession session) /// 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. /// 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, string? workingDirectory = null, IList? availableTools = null, IList? excludedTools = null, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = 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, CancellationToken cancellationToken = default) + 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, OptionsUpdateToolFilterPrecedence? toolFilterPrecedence = null, bool? enableScriptSafety = null, string? shellInitProfile = null, IList? shellProcessFlags = null, SandboxConfig? sandboxConfig = null, bool? logInteractiveShells = null, OptionsUpdateEnvValueMode? envValueMode = 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, 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, WorkingDirectory = workingDirectory, AvailableTools = availableTools, ExcludedTools = excludedTools, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, 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 }; + 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, ToolFilterPrecedence = toolFilterPrecedence, EnableScriptSafety = enableScriptSafety, ShellInitProfile = shellInitProfile, ShellProcessFlags = shellProcessFlags, SandboxConfig = sandboxConfig, LogInteractiveShells = logInteractiveShells, EnvValueMode = envValueMode, 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 }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.options.update", [request], cancellationToken); } } @@ -20467,6 +20679,17 @@ public async Task StopAsync(long id, CancellationToken cance } } +/// 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 @@ -20556,6 +20779,9 @@ public interface ICanvasHandler /// 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; } @@ -20573,6 +20799,12 @@ internal static class ClientSessionApiRegistration /// 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; @@ -20773,7 +21005,6 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [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.CanvasOpenedAvailability), TypeInfoPropertyName = "SessionEventsCanvasOpenedAvailability")] [JsonSerializable(typeof(GitHub.Copilot.CanvasRegistryChangedCanvas), TypeInfoPropertyName = "SessionEventsCanvasRegistryChangedCanvas")] [JsonSerializable(typeof(GitHub.Copilot.CanvasRegistryChangedCanvasAction), TypeInfoPropertyName = "SessionEventsCanvasRegistryChangedCanvasAction")] [JsonSerializable(typeof(GitHub.Copilot.CapabilitiesChangedData), TypeInfoPropertyName = "SessionEventsCapabilitiesChangedData")] @@ -21039,6 +21270,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(CanvasProviderOpenRequest))] [JsonSerializable(typeof(CanvasProviderOpenResult))] [JsonSerializable(typeof(CanvasSessionContext))] +[JsonSerializable(typeof(CapiSessionOptions))] [JsonSerializable(typeof(CommandList))] [JsonSerializable(typeof(CommandsHandlePendingCommandRequest))] [JsonSerializable(typeof(CommandsHandlePendingCommandResult))] @@ -21310,6 +21542,8 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(ProviderGetEndpointRequestWithSession))] [JsonSerializable(typeof(ProviderModelConfig))] [JsonSerializable(typeof(ProviderSessionToken))] +[JsonSerializable(typeof(ProviderTokenAcquireRequest))] +[JsonSerializable(typeof(ProviderTokenAcquireResult))] [JsonSerializable(typeof(PushAttachment))] [JsonSerializable(typeof(PushAttachmentFileLineRange))] [JsonSerializable(typeof(PushAttachmentSelectionDetails))] @@ -21343,6 +21577,7 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(SandboxConfigUserPolicyExperimentalSeatbelt))] [JsonSerializable(typeof(SandboxConfigUserPolicyFilesystem))] [JsonSerializable(typeof(SandboxConfigUserPolicyNetwork))] +[JsonSerializable(typeof(SandboxConfigUserPolicySeatbelt))] [JsonSerializable(typeof(ScheduleEntry))] [JsonSerializable(typeof(ScheduleList))] [JsonSerializable(typeof(ScheduleStopRequest))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index acd075455..f1765e5c4 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -65,7 +65,10 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionBinaryAssetEvent), "session.binary_asset")] [JsonDerivedType(typeof(SessionCanvasClosedEvent), "session.canvas.closed")] [JsonDerivedType(typeof(SessionCanvasOpenedEvent), "session.canvas.opened")] +[JsonDerivedType(typeof(SessionCanvasRecordedEvent), "session.canvas.recorded")] [JsonDerivedType(typeof(SessionCanvasRegistryChangedEvent), "session.canvas.registry_changed")] +[JsonDerivedType(typeof(SessionCanvasRemovedEvent), "session.canvas.removed")] +[JsonDerivedType(typeof(SessionCanvasUnavailableEvent), "session.canvas.unavailable")] [JsonDerivedType(typeof(SessionCompactionCompleteEvent), "session.compaction_complete")] [JsonDerivedType(typeof(SessionCompactionStartEvent), "session.compaction_start")] [JsonDerivedType(typeof(SessionContextChangedEvent), "session.context_changed")] @@ -87,6 +90,7 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(SessionResumeEvent), "session.resume")] [JsonDerivedType(typeof(SessionScheduleCancelledEvent), "session.schedule_cancelled")] [JsonDerivedType(typeof(SessionScheduleCreatedEvent), "session.schedule_created")] +[JsonDerivedType(typeof(SessionScheduleRearmedEvent), "session.schedule_rearmed")] [JsonDerivedType(typeof(SessionShutdownEvent), "session.shutdown")] [JsonDerivedType(typeof(SessionSkillsLoadedEvent), "session.skills_loaded")] [JsonDerivedType(typeof(SessionSnapshotRewindEvent), "session.snapshot_rewind")] @@ -261,6 +265,19 @@ public sealed partial class SessionScheduleCancelledEvent : SessionEvent public required SessionScheduleCancelledData Data { get; set; } } +/// Self-paced schedule re-armed for its next run. +/// Represents the session.schedule_rearmed event. +public sealed partial class SessionScheduleRearmedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.schedule_rearmed"; + + /// The session.schedule_rearmed event payload. + [JsonPropertyName("data")] + public required SessionScheduleRearmedData Data { get; set; } +} + /// Autopilot objective state file operation details indicating what changed. /// Represents the session.autopilot_objective_changed event. public sealed partial class SessionAutopilotObjectiveChangedEvent : SessionEvent @@ -1278,6 +1295,7 @@ public sealed partial class SessionExtensionsLoadedEvent : SessionEvent /// Schema for the `CanvasOpenedData` type. /// Represents the session.canvas.opened event. +[Experimental(Diagnostics.Experimental)] public sealed partial class SessionCanvasOpenedEvent : SessionEvent { /// @@ -1291,6 +1309,7 @@ public sealed partial class SessionCanvasOpenedEvent : SessionEvent /// Schema for the `CanvasRegistryChangedData` type. /// Represents the session.canvas.registry_changed event. +[Experimental(Diagnostics.Experimental)] public sealed partial class SessionCanvasRegistryChangedEvent : SessionEvent { /// @@ -1304,6 +1323,7 @@ public sealed partial class SessionCanvasRegistryChangedEvent : SessionEvent /// Schema for the `CanvasClosedData` type. /// Represents the session.canvas.closed event. +[Experimental(Diagnostics.Experimental)] public sealed partial class SessionCanvasClosedEvent : SessionEvent { /// @@ -1315,6 +1335,48 @@ public sealed partial class SessionCanvasClosedEvent : SessionEvent public required SessionCanvasClosedData Data { get; set; } } +/// Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume. +/// Represents the session.canvas.unavailable event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionCanvasUnavailableEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.canvas.unavailable"; + + /// The session.canvas.unavailable event payload. + [JsonPropertyName("data")] + public required SessionCanvasUnavailableData Data { get; set; } +} + +/// Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability. +/// Represents the session.canvas.recorded event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionCanvasRecordedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.canvas.recorded"; + + /// The session.canvas.recorded event payload. + [JsonPropertyName("data")] + public required SessionCanvasRecordedData Data { get; set; } +} + +/// Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. +/// Represents the session.canvas.removed event. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionCanvasRemovedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "session.canvas.removed"; + + /// The session.canvas.removed event payload. + [JsonPropertyName("data")] + public required SessionCanvasRemovedData Data { get; set; } +} + /// Schema for the `ExtensionsAttachmentsPushedData` type. /// Represents the session.extensions.attachments_pushed event. public sealed partial class SessionExtensionsAttachmentsPushedEvent : SessionEvent @@ -1576,6 +1638,11 @@ public sealed partial class SessionScheduleCreatedData [JsonPropertyName("recurring")] public bool? Recurring { get; set; } + /// True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("selfPaced")] + public bool? SelfPaced { get; set; } + /// IANA timezone the `cron` expression is evaluated in. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("tz")] @@ -1590,6 +1657,18 @@ public sealed partial class SessionScheduleCancelledData public required long Id { get; set; } } +/// Self-paced schedule re-armed for its next run. +public sealed partial class SessionScheduleRearmedData +{ + /// Id of the self-paced schedule that was re-armed. + [JsonPropertyName("id")] + public required long Id { get; set; } + + /// Absolute time (epoch milliseconds) the model armed the next run to fire. + [JsonPropertyName("nextRunAt")] + public required long NextRunAt { get; set; } +} + /// Autopilot objective state file operation details indicating what changed. public sealed partial class SessionAutopilotObjectiveChangedData { @@ -2062,6 +2141,11 @@ public sealed partial class SessionCompactionCompleteData [JsonPropertyName("serviceRequestId")] public string? ServiceRequestId { get; set; } + /// For failed compaction only: the HTTP status code of the compaction LLM call failure, when it carried one. Absent for successful compaction and for failures without an HTTP status (e.g. an empty model response or a transport error). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("statusCode")] + public long? StatusCode { get; set; } + /// Whether compaction completed successfully. [JsonPropertyName("success")] public required bool Success { get; set; } @@ -2506,6 +2590,12 @@ public sealed partial class ModelCallFailureData [JsonPropertyName("providerCallId")] public string? ProviderCallId { get; set; } + /// Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("quotaSnapshots")] + internal IDictionary? QuotaSnapshots { get; set; } + /// Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("requestFingerprint")] @@ -3482,12 +3572,9 @@ public sealed partial class SessionExtensionsLoadedData } /// Schema for the `CanvasOpenedData` type. +[Experimental(Diagnostics.Experimental)] public sealed partial class SessionCanvasOpenedData { - /// Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. - [JsonPropertyName("availability")] - public required CanvasOpenedAvailability Availability { get; set; } - /// Provider-local canvas identifier. [JsonPropertyName("canvasId")] public required string CanvasId { get; set; } @@ -3510,10 +3597,6 @@ public sealed partial class SessionCanvasOpenedData [JsonPropertyName("instanceId")] public required string InstanceId { get; set; } - /// Whether this notification represents an idempotent reopen. - [JsonPropertyName("reopen")] - public required bool Reopen { get; set; } - /// Provider-supplied status text. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("status")] @@ -3531,6 +3614,7 @@ public sealed partial class SessionCanvasOpenedData } /// Schema for the `CanvasRegistryChangedData` type. +[Experimental(Diagnostics.Experimental)] public sealed partial class SessionCanvasRegistryChangedData { /// Canvas declarations currently available. @@ -3539,6 +3623,7 @@ public sealed partial class SessionCanvasRegistryChangedData } /// Schema for the `CanvasClosedData` type. +[Experimental(Diagnostics.Experimental)] public sealed partial class SessionCanvasClosedData { /// Provider-local canvas identifier. @@ -3556,6 +3641,73 @@ public sealed partial class SessionCanvasClosedData public required string InstanceId { get; set; } } +/// Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionCanvasUnavailableData +{ + /// Provider-local canvas identifier. + [JsonPropertyName("canvasId")] + public required string CanvasId { get; set; } + + /// Owning provider identifier. + [JsonPropertyName("extensionId")] + public required string ExtensionId { get; set; } + + /// Stable caller-supplied identifier of the canvas instance whose provider became unavailable. + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("instanceId")] + public required string InstanceId { get; set; } +} + +/// Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionCanvasRecordedData +{ + /// Provider-local canvas identifier. + [JsonPropertyName("canvasId")] + public required string CanvasId { get; set; } + + /// Owning provider identifier. + [JsonPropertyName("extensionId")] + public required string ExtensionId { get; set; } + + /// Input supplied when the instance was opened. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("input")] + public JsonElement? Input { get; set; } + + /// Stable caller-supplied canvas instance identifier. + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("instanceId")] + public required string InstanceId { get; set; } + + /// Rendered title. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("title")] + public string? Title { get; set; } +} + +/// Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. +[Experimental(Diagnostics.Experimental)] +public sealed partial class SessionCanvasRemovedData +{ + /// Provider-local canvas identifier. + [JsonPropertyName("canvasId")] + public required string CanvasId { get; set; } + + /// Owning provider identifier. + [JsonPropertyName("extensionId")] + public required string ExtensionId { get; set; } + + /// Stable caller-supplied identifier of the canvas instance that was closed. + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("instanceId")] + public required string InstanceId { get; set; } +} + /// Schema for the `ExtensionsAttachmentsPushedData` type. public sealed partial class SessionExtensionsAttachmentsPushedData { @@ -3899,6 +4051,11 @@ public sealed partial class AttachmentFile : Attachment /// Absolute file path. [JsonPropertyName("path")] public required string Path { get; set; } + + /// Frozen rendered line this attachment contributed to the <tagged_files> prompt block (e.g. "* /path (123 lines)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. Present only for attachments routed to <tagged_files> (mutually exclusive with assetId, which marks bytes sent natively). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("taggedFilesEntry")] + public string? TaggedFilesEntry { get; set; } } /// Directory attachment. @@ -3916,6 +4073,11 @@ public sealed partial class AttachmentDirectory : Attachment /// Absolute directory path. [JsonPropertyName("path")] public required string Path { get; set; } + + /// Frozen rendered line this attachment contributed to the <tagged_files> prompt block (e.g. "* /path (12 items)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("taggedFilesEntry")] + public string? TaggedFilesEntry { get; set; } } /// End position of the selection. @@ -4382,6 +4544,12 @@ internal sealed partial class AssistantUsageQuotaSnapshot [JsonPropertyName("entitlementRequests")] internal required long EntitlementRequests { get; set; } + /// Whether the user currently has quota available for use. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("hasQuota")] + internal bool? HasQuota { get; set; } + /// Whether the user has an unlimited usage entitlement. [JsonInclude] [JsonPropertyName("isUnlimitedEntitlement")] @@ -4397,6 +4565,12 @@ internal sealed partial class AssistantUsageQuotaSnapshot [JsonPropertyName("overageAllowedWithExhaustedQuota")] internal required bool OverageAllowedWithExhaustedQuota { get; set; } + /// Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("overageEntitlement")] + internal double? OverageEntitlement { get; set; } + /// Percentage of quota remaining (0 to 100). [JsonInclude] [JsonPropertyName("remainingPercentage")] @@ -4408,6 +4582,12 @@ internal sealed partial class AssistantUsageQuotaSnapshot [JsonPropertyName("resetDate")] internal DateTimeOffset? ResetDate { get; set; } + /// Whether this snapshot uses token-based billing (AI-credits allocation). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonInclude] + [JsonPropertyName("tokenBasedBilling")] + internal bool? TokenBasedBilling { get; set; } + /// Whether usage is still permitted after quota exhaustion. [JsonInclude] [JsonPropertyName("usageAllowedWithExhaustedQuota")] @@ -5496,6 +5676,16 @@ public sealed partial class PermissionRequestShell : PermissionRequest [JsonPropertyName("possibleUrls")] public required PermissionRequestShellPossibleUrl[] PossibleUrls { get; set; } + /// True when the model has requested to run this command outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("requestSandboxBypass")] + public bool? RequestSandboxBypass { get; set; } + + /// Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("requestSandboxBypassReason")] + public string? RequestSandboxBypassReason { get; set; } + /// Tool call ID that triggered this permission request. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolCallId")] @@ -6628,6 +6818,7 @@ public sealed partial class ExtensionsLoadedExtension /// Schema for the `CanvasRegistryChangedCanvasAction` type. /// Nested data type for CanvasRegistryChangedCanvasAction. +[Experimental(Diagnostics.Experimental)] public sealed partial class CanvasRegistryChangedCanvasAction { /// Action description. @@ -6647,6 +6838,7 @@ public sealed partial class CanvasRegistryChangedCanvasAction /// Schema for the `CanvasRegistryChangedCanvas` type. /// Nested data type for CanvasRegistryChangedCanvas. +[Experimental(Diagnostics.Experimental)] public sealed partial class CanvasRegistryChangedCanvas { /// Actions the agent or host may invoke. @@ -9452,67 +9644,6 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu } } -/// Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. -[JsonConverter(typeof(Converter))] -[DebuggerDisplay("{Value,nq}")] -public readonly struct CanvasOpenedAvailability : IEquatable -{ - private readonly string? _value; - - /// Initializes a new instance of the struct. - /// The value to associate with this . - [JsonConstructor] - public CanvasOpenedAvailability(string value) - { - ArgumentException.ThrowIfNullOrWhiteSpace(value); - _value = value; - } - - /// Gets the value associated with this . - public string Value => _value ?? string.Empty; - - /// Provider connection is live; actions can be invoked. - public static CanvasOpenedAvailability Ready { get; } = new("ready"); - - /// Provider has gone away; the instance is awaiting rebinding. - public static CanvasOpenedAvailability Stale { get; } = new("stale"); - - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(CanvasOpenedAvailability left, CanvasOpenedAvailability right) => left.Equals(right); - - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(CanvasOpenedAvailability left, CanvasOpenedAvailability right) => !(left == right); - - /// - public override bool Equals(object? obj) => obj is CanvasOpenedAvailability other && Equals(other); - - /// - public bool Equals(CanvasOpenedAvailability 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 CanvasOpenedAvailability Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); - } - - /// - public override void Write(Utf8JsonWriter writer, CanvasOpenedAvailability value, JsonSerializerOptions options) - { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(CanvasOpenedAvailability)); - } - } -} - [JsonSourceGenerationOptions( JsonSerializerDefaults.Web, AllowOutOfOrderMetadataProperties = true, @@ -9686,8 +9817,14 @@ public override void Write(Utf8JsonWriter writer, CanvasOpenedAvailability value [JsonSerializable(typeof(SessionCanvasClosedEvent))] [JsonSerializable(typeof(SessionCanvasOpenedData))] [JsonSerializable(typeof(SessionCanvasOpenedEvent))] +[JsonSerializable(typeof(SessionCanvasRecordedData))] +[JsonSerializable(typeof(SessionCanvasRecordedEvent))] [JsonSerializable(typeof(SessionCanvasRegistryChangedData))] [JsonSerializable(typeof(SessionCanvasRegistryChangedEvent))] +[JsonSerializable(typeof(SessionCanvasRemovedData))] +[JsonSerializable(typeof(SessionCanvasRemovedEvent))] +[JsonSerializable(typeof(SessionCanvasUnavailableData))] +[JsonSerializable(typeof(SessionCanvasUnavailableEvent))] [JsonSerializable(typeof(SessionCompactionCompleteData))] [JsonSerializable(typeof(SessionCompactionCompleteEvent))] [JsonSerializable(typeof(SessionCompactionStartData))] @@ -9731,6 +9868,8 @@ public override void Write(Utf8JsonWriter writer, CanvasOpenedAvailability value [JsonSerializable(typeof(SessionScheduleCancelledEvent))] [JsonSerializable(typeof(SessionScheduleCreatedData))] [JsonSerializable(typeof(SessionScheduleCreatedEvent))] +[JsonSerializable(typeof(SessionScheduleRearmedData))] +[JsonSerializable(typeof(SessionScheduleRearmedEvent))] [JsonSerializable(typeof(SessionShutdownData))] [JsonSerializable(typeof(SessionShutdownEvent))] [JsonSerializable(typeof(SessionSkillsLoadedData))] diff --git a/dotnet/src/Session.cs b/dotnet/src/Session.cs index 095c1abf7..e63b7fa59 100644 --- a/dotnet/src/Session.cs +++ b/dotnet/src/Session.cs @@ -911,8 +911,7 @@ private void UpdateOpenCanvasesFromEvent(SessionEvent sessionEvent) var data = canvasEvent.Data; if (string.IsNullOrEmpty(data.InstanceId) || string.IsNullOrEmpty(data.CanvasId) - || string.IsNullOrEmpty(data.ExtensionId) - || string.IsNullOrEmpty(data.Availability.Value)) + || string.IsNullOrEmpty(data.ExtensionId)) { _logger.LogWarning("failed to deserialize session.canvas.opened payload"); return; @@ -920,13 +919,11 @@ private void UpdateOpenCanvasesFromEvent(SessionEvent sessionEvent) UpsertOpenCanvas(new OpenCanvasInstance { - Availability = new CanvasInstanceAvailability(data.Availability.Value), CanvasId = data.CanvasId, ExtensionId = data.ExtensionId, ExtensionName = data.ExtensionName, Input = data.Input, InstanceId = data.InstanceId, - Reopen = data.Reopen, Status = data.Status, Title = data.Title, Url = data.Url, diff --git a/dotnet/test/Unit/CanvasTests.cs b/dotnet/test/Unit/CanvasTests.cs index c0cfaee92..612814d1f 100644 --- a/dotnet/test/Unit/CanvasTests.cs +++ b/dotnet/test/Unit/CanvasTests.cs @@ -150,11 +150,9 @@ public void SessionCanvasOpenedEvent_UpdatesOpenCanvasSnapshots() Timestamp = DateTimeOffset.UtcNow, Data = new SessionCanvasOpenedData { - Availability = CanvasOpenedAvailability.Ready, CanvasId = "", ExtensionId = "project:counter", InstanceId = "missing-canvas-id", - Reopen = false, } }); DispatchEvent(session, new SessionCanvasOpenedEvent @@ -163,7 +161,6 @@ public void SessionCanvasOpenedEvent_UpdatesOpenCanvasSnapshots() Timestamp = DateTimeOffset.UtcNow, Data = new SessionCanvasOpenedData { - Availability = CanvasOpenedAvailability.Ready, CanvasId = "counter", ExtensionId = "project:counter", ExtensionName = "Counter Provider", @@ -172,7 +169,6 @@ public void SessionCanvasOpenedEvent_UpdatesOpenCanvasSnapshots() Status = "ready", Url = "https://example.test/counter", Input = JsonDocument.Parse("""{"seed":1}""").RootElement.Clone(), - Reopen = false, } }); DispatchEvent(session, new SessionCanvasOpenedEvent @@ -181,12 +177,10 @@ public void SessionCanvasOpenedEvent_UpdatesOpenCanvasSnapshots() Timestamp = DateTimeOffset.UtcNow, Data = new SessionCanvasOpenedData { - Availability = CanvasOpenedAvailability.Stale, CanvasId = "logs", ExtensionId = "project:logs", InstanceId = "logs-1", Title = "Logs", - Reopen = false, } }); @@ -201,7 +195,6 @@ public void SessionCanvasOpenedEvent_UpdatesOpenCanvasSnapshots() Timestamp = DateTimeOffset.UtcNow, Data = new SessionCanvasOpenedData { - Availability = CanvasOpenedAvailability.Stale, CanvasId = "counter", ExtensionId = "project:counter", ExtensionName = "Counter Provider", @@ -210,7 +203,6 @@ public void SessionCanvasOpenedEvent_UpdatesOpenCanvasSnapshots() Status = "reconnected", Url = "https://example.test/counter-updated", Input = JsonDocument.Parse("""{"seed":2}""").RootElement.Clone(), - Reopen = true, } }); @@ -222,8 +214,6 @@ public void SessionCanvasOpenedEvent_UpdatesOpenCanvasSnapshots() Assert.Equal("Counter Updated", canvas.Title); Assert.Equal("reconnected", canvas.Status); Assert.Equal("https://example.test/counter-updated", canvas.Url); - Assert.True(canvas.Reopen); - Assert.Equal(CanvasInstanceAvailability.Stale, canvas.Availability); Assert.Equal(2, canvas.Input!.Value.GetProperty("seed").GetInt32()); }, canvas => Assert.Equal("logs-1", canvas.InstanceId)); @@ -240,12 +230,10 @@ public void SessionCanvasClosedEvent_RemovesOpenCanvasSnapshots() Timestamp = DateTimeOffset.UtcNow, Data = new SessionCanvasOpenedData { - Availability = CanvasOpenedAvailability.Ready, CanvasId = "counter", ExtensionId = "project:counter", InstanceId = "counter-1", Title = "Counter", - Reopen = false, } }); DispatchEvent(session, new SessionCanvasOpenedEvent @@ -254,12 +242,10 @@ public void SessionCanvasClosedEvent_RemovesOpenCanvasSnapshots() Timestamp = DateTimeOffset.UtcNow, Data = new SessionCanvasOpenedData { - Availability = CanvasOpenedAvailability.Ready, CanvasId = "logs", ExtensionId = "project:logs", InstanceId = "logs-1", Title = "Logs", - Reopen = false, } }); diff --git a/dotnet/test/Unit/SerializationTests.cs b/dotnet/test/Unit/SerializationTests.cs index 1fa311df4..48ef2e553 100644 --- a/dotnet/test/Unit/SerializationTests.cs +++ b/dotnet/test/Unit/SerializationTests.cs @@ -635,7 +635,6 @@ public void ResumeSessionRequest_CanSerializeOpenCanvases_WithSdkOptions() CanvasId = "canvas-id", ExtensionId = "ext-id", InstanceId = "instance-1", - Availability = CanvasInstanceAvailability.Ready, }, }; var request = CreateInternalRequest( diff --git a/go/canvas_test.go b/go/canvas_test.go index c65b94054..3fdd2facc 100644 --- a/go/canvas_test.go +++ b/go/canvas_test.go @@ -310,11 +310,9 @@ func TestCanvasResumeSessionResponse_OpenCanvasesParse(t *testing.T) { "workspacePath": "/tmp/ws", "openCanvases": [ { - "availability": "ready", "canvasId": "echo", "extensionId": "project:echo", - "instanceId": "echo-1", - "reopen": false + "instanceId": "echo-1" } ] }`) @@ -343,11 +341,9 @@ func TestCanvasResumeSessionRequest_OpenCanvasesWireShape(t *testing.T) { SessionID: "s1", OpenCanvases: []rpc.OpenCanvasInstance{ { - Availability: "ready", - CanvasID: "echo", - ExtensionID: "project:echo", - InstanceID: "echo-1", - Reopen: false, + CanvasID: "echo", + ExtensionID: "project:echo", + InstanceID: "echo-1", }, }, } diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index a105a712c..03ec16cea 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -475,6 +475,10 @@ type AttachmentDirectory struct { DisplayName string `json:"displayName"` // Absolute directory path Path string `json:"path"` + // Frozen rendered line this attachment contributed to the prompt block (e.g. + // "* /path (12 items)"). Captured at send time so resumed history reproduces the exact text + // the model saw, independent of later filesystem changes. + TaggedFilesEntry *string `json:"taggedFilesEntry,omitempty"` } func (AttachmentDirectory) attachment() {} @@ -528,6 +532,12 @@ type AttachmentFile struct { OmittedReason *OmittedBinaryOmittedReason `json:"omittedReason,omitempty"` // Absolute file path Path string `json:"path"` + // Frozen rendered line this attachment contributed to the prompt block (e.g. + // "* /path (123 lines)"). Captured at send time so resumed history reproduces the exact + // text the model saw, independent of later filesystem changes. Present only for attachments + // routed to (mutually exclusive with assetId, which marks bytes sent + // natively). + TaggedFilesEntry *string `json:"taggedFilesEntry,omitempty"` } func (AttachmentFile) attachment() {} @@ -939,6 +949,18 @@ type CanvasSessionContext struct { WorkingDirectory *string `json:"workingDirectory,omitempty"` } +// Options scoped to the built-in CAPI (Copilot API) provider. +// Experimental: CapiSessionOptions is part of an experimental API and may change or be +// removed. +type CapiSessionOptions struct { + // 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. + EnableWebSocketResponses *bool `json:"enableWebSocketResponses,omitempty"` +} + // Slash commands available in the session, after applying any include/exclude filters. // Experimental: CommandList is part of an experimental API and may change or be removed. type CommandList struct { @@ -2666,7 +2688,7 @@ type MCPOauthHandlePendingResult struct { } // Remote MCP server name and optional overrides controlling reauthentication, OAuth client -// display name, and the callback success-page copy. +// display name, callback success-page copy, and static OAuth client selection. // Experimental: MCPOauthLoginRequest is part of an experimental API and may change or be // removed. type MCPOauthLoginRequest struct { @@ -2674,16 +2696,30 @@ type MCPOauthLoginRequest struct { // When omitted, the runtime applies a neutral fallback; callers driving interactive auth // should pass surface-specific copy telling the user where to return. CallbackSuccessMessage *string `json:"callbackSuccessMessage,omitempty"` + // Optional OAuth client ID override for this login. When set, the runtime uses this + // pre-registered static client instead of dynamic client registration. + ClientID *string `json:"clientId,omitempty"` // 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. ClientName *string `json:"clientName,omitempty"` + // 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. + ClientSecret *string `json:"clientSecret,omitempty"` // 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. ForceReauth *bool `json:"forceReauth,omitempty"` + // Optional OAuth grant type override for this login. Defaults to the server configuration, + // or authorization_code when no grant type is specified. + GrantType *MCPOauthLoginGrantType `json:"grantType,omitempty"` + // 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. + PublicClient *bool `json:"publicClient,omitempty"` // Name of the remote MCP server to authenticate ServerName string `json:"serverName"` } @@ -3434,10 +3470,23 @@ type NamedProviderConfig struct { // Bearer token for authentication. Sets the Authorization header directly. Takes precedence // over apiKey when both are set. BearerToken *string `json:"bearerToken,omitempty"` + // 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 ` 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. + HasBearerTokenProvider *bool `json:"hasBearerTokenProvider,omitempty"` // Custom HTTP headers to include in all outbound requests to the provider. Headers map[string]string `json:"headers,omitzero"` // Stable identifier referenced by BYOK model definitions. Must not contain '/'. Name string `json:"name"` + // Provider transport. Defaults to "http". + Transport *ProviderConfigTransport `json:"transport,omitempty"` // Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. Type *ProviderConfigType `json:"type,omitempty"` // Wire API format (openai/azure only). Defaults to "completions". @@ -3481,8 +3530,6 @@ type NameSetRequest struct { // Experimental: OpenCanvasInstance is part of an experimental API and may change or be // removed. type OpenCanvasInstance struct { - // Runtime-controlled routing state for an open canvas instance. - Availability CanvasInstanceAvailability `json:"availability"` // Provider-local canvas identifier CanvasID string `json:"canvasId"` // Owning provider identifier @@ -3493,8 +3540,6 @@ type OpenCanvasInstance struct { Input any `json:"input,omitempty"` // Stable caller-supplied canvas instance identifier InstanceID string `json:"instanceId"` - // Whether this snapshot came from an idempotent reopen - Reopen bool `json:"reopen"` // Provider-supplied status text Status *string `json:"status,omitempty"` // Rendered title @@ -4949,6 +4994,17 @@ type ProviderConfig struct { // Bearer token for authentication. Sets the Authorization header directly. Takes precedence // over apiKey when both are set. BearerToken *string `json:"bearerToken,omitempty"` + // 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 ` 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. + HasBearerTokenProvider *bool `json:"hasBearerTokenProvider,omitempty"` // Custom HTTP headers to include in all outbound requests to the provider. Headers map[string]string `json:"headers,omitzero"` // Maximum context window tokens for the model. @@ -4960,6 +5016,8 @@ type ProviderConfig struct { // Well-known model ID used for capability lookup. When set, agent behavior config and token // limits are inferred from this model. ModelID *string `json:"modelId,omitempty"` + // Provider transport. Defaults to "http". + Transport *ProviderConfigTransport `json:"transport,omitempty"` // Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. Type *ProviderConfigType `json:"type,omitempty"` // Wire API format (openai/azure only). Defaults to "completions". @@ -4992,6 +5050,8 @@ type ProviderEndpoint struct { // 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. SessionToken *ProviderSessionToken `json:"sessionToken,omitempty"` + // Transport to be used for provider requests. + Transport *ProviderEndpointTransport `json:"transport,omitempty"` // Provider family. Matches the `type` field of a BYOK provider config. Type ProviderEndpointType `json:"type"` // Wire API to be used, when required for the provider type. @@ -5050,6 +5110,29 @@ type ProviderSessionToken struct { Token string `json:"token"` } +// 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: ProviderTokenAcquireRequest is part of an experimental API and may change +// or be removed. +type ProviderTokenAcquireRequest struct { + // 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`. + ProviderName string `json:"providerName"` + // Target session identifier + SessionID string `json:"sessionId"` +} + +// A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as +// `Authorization: Bearer ` on the outbound request and does no caching; the SDK +// consumer owns token caching and refresh. +// Experimental: ProviderTokenAcquireResult is part of an experimental API and may change or +// be removed. +type ProviderTokenAcquireResult struct { + // The bearer token value (without the `Bearer ` prefix). + Token string `json:"token"` +} + // Schema for the `PushAttachment` type. // Experimental: PushAttachment is part of an experimental API and may change or be removed. type PushAttachment interface { @@ -5566,9 +5649,6 @@ type RuntimeShutdownResult struct { type SandboxConfig struct { // Whether to auto-add the current working directory to readwritePaths. Default: true. AddCurrentWorkingDirectory *bool `json:"addCurrentWorkingDirectory,omitempty"` - // Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to - // `spawnSandboxFromConfig`, bypassing policy merging. - Config any `json:"config,omitempty"` // Whether sandboxing is enabled for the session. Enabled bool `json:"enabled"` // User-managed sandbox policy fragment merged into the auto-discovered base policy. @@ -5579,12 +5659,15 @@ type SandboxConfig struct { // Experimental: SandboxConfigUserPolicy is part of an experimental API and may change or be // removed. type SandboxConfigUserPolicy struct { - // Platform-specific experimental policy fields. + // Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is + // absent. Experimental *SandboxConfigUserPolicyExperimental `json:"experimental,omitempty"` // Filesystem rules to merge into the base policy. Filesystem *SandboxConfigUserPolicyFilesystem `json:"filesystem,omitempty"` // Network rules to merge into the base policy. Network *SandboxConfigUserPolicyNetwork `json:"network,omitempty"` + // macOS seatbelt options to merge into the base policy. + Seatbelt *SandboxConfigUserPolicySeatbelt `json:"seatbelt,omitempty"` } // Platform-specific experimental policy fields. @@ -5631,6 +5714,14 @@ type SandboxConfigUserPolicyNetwork struct { BlockedHosts []string `json:"blockedHosts,omitzero"` } +// macOS seatbelt-specific options. +// Experimental: SandboxConfigUserPolicySeatbelt is part of an experimental API and may +// change or be removed. +type SandboxConfigUserPolicySeatbelt struct { + // Whether the macOS seatbelt profile may access the keychain. + KeychainAccess *bool `json:"keychainAccess,omitempty"` +} + // Schema for the `ScheduleEntry` type. // Experimental: ScheduleEntry is part of an experimental API and may change or be removed. type ScheduleEntry struct { @@ -5652,6 +5743,9 @@ type ScheduleEntry struct { Prompt string `json:"prompt"` // Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). Recurring bool `json:"recurring"` + // 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. + SelfPaced *bool `json:"selfPaced,omitempty"` // IANA timezone the `cron` expression is evaluated in. Tz *string `json:"tz,omitempty"` } @@ -6477,6 +6571,8 @@ type SessionOpenOptions struct { AuthInfo AuthInfo `json:"authInfo,omitempty"` // Allowlist of available tool names. AvailableTools []string `json:"availableTools,omitzero"` + // Options scoped to the built-in CAPI (Copilot API) provider. + Capi *CapiSessionOptions `json:"capi,omitempty"` // Structured client kind used for runtime behavior gates. ClientKind *string `json:"clientKind,omitempty"` // Identifier of the client driving the session. @@ -7292,6 +7388,8 @@ type SessionUpdateOptionsParams struct { AskUserDisabled *bool `json:"askUserDisabled,omitempty"` // Allowlist of tool names available to this session. AvailableTools []string `json:"availableTools,omitzero"` + // Options scoped to the built-in CAPI (Copilot API) provider. + Capi *CapiSessionOptions `json:"capi,omitempty"` // Identifier of the client driving the session. ClientName *string `json:"clientName,omitempty"` // Whether to include the `Co-authored-by` trailer in commit messages. @@ -9280,20 +9378,6 @@ const ( AuthInfoTypeUser AuthInfoType = "user" ) -// Runtime-controlled routing state for an open canvas instance. -// Experimental: CanvasInstanceAvailability is part of an experimental API and may change or -// be removed. -type CanvasInstanceAvailability string - -const ( - // The owning provider is currently connected and routing calls will be dispatched normally. - CanvasInstanceAvailabilityReady CanvasInstanceAvailability = "ready" - // The owning provider is not currently connected. Routing calls fail with - // canvas_provider_unavailable until the agent re-issues open_canvas (which rehydrates via a - // fresh canvas.open) or the provider reconnects. - CanvasInstanceAvailabilityStale CanvasInstanceAvailability = "stale" -) - // Neutral SDK discriminator for the connected remote session kind. // Experimental: ConnectedRemoteSessionMetadataKind is part of an experimental API and may // change or be removed. @@ -9676,6 +9760,19 @@ const ( MCPAppsSetHostContextDetailsThemeLight MCPAppsSetHostContextDetailsTheme = "light" ) +// OAuth grant type override for this login. +// Experimental: MCPOauthLoginGrantType is part of an experimental API and may change or be +// removed. +type MCPOauthLoginGrantType string + +const ( + // Interactive browser-based OAuth flow using an authorization code, typically with PKCE. + MCPOauthLoginGrantTypeAuthorizationCode MCPOauthLoginGrantType = "authorization_code" + // Headless OAuth flow where a confidential client authenticates directly with a client + // secret. + MCPOauthLoginGrantTypeClientCredentials MCPOauthLoginGrantType = "client_credentials" +) + // Kind discriminator for MCPOauthPendingRequestResponse. type MCPOauthPendingRequestResponseKind string @@ -10064,6 +10161,18 @@ const ( PermissionsSetApproveAllSourceSlashCommand PermissionsSetApproveAllSource = "slash_command" ) +// Provider transport. Defaults to "http". +// Experimental: ProviderConfigTransport is part of an experimental API and may change or be +// removed. +type ProviderConfigTransport string + +const ( + // HTTP request/streaming transport. + ProviderConfigTransportHTTP ProviderConfigTransport = "http" + // WebSocket transport. + ProviderConfigTransportWebsockets ProviderConfigTransport = "websockets" +) + // Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. // Experimental: ProviderConfigType is part of an experimental API and may change or be // removed. @@ -10090,6 +10199,18 @@ const ( ProviderConfigWireAPIResponses ProviderConfigWireAPI = "responses" ) +// Transport to be used for provider requests. +// Experimental: ProviderEndpointTransport is part of an experimental API and may change or +// be removed. +type ProviderEndpointTransport string + +const ( + // HTTP request/streaming transport. + ProviderEndpointTransportHTTP ProviderEndpointTransport = "http" + // WebSocket transport. + ProviderEndpointTransportWebsockets ProviderEndpointTransport = "websockets" +) + // Provider family. Matches the `type` field of a BYOK provider config. // Experimental: ProviderEndpointType is part of an experimental API and may change or be // removed. @@ -10816,6 +10937,9 @@ type WorkspaceDiffMode string const ( // Return changes compared with the default branch. WorkspaceDiffModeBranch WorkspaceDiffMode = "branch" + // Return the cumulative diff of files Copilot changed this session (used in non-git + // workspaces). + WorkspaceDiffModeSession WorkspaceDiffMode = "session" // Return staged, unstaged, and untracked working tree changes. WorkspaceDiffModeUnstaged WorkspaceDiffMode = "unstaged" ) @@ -13734,7 +13858,7 @@ func (a *MCPOauthAPI) HandlePendingRequest(ctx context.Context, params *MCPOauth // RPC method: session.mcp.oauth.login. // // Parameters: Remote MCP server name and optional overrides controlling reauthentication, -// OAuth client display name, and the callback success-page copy. +// OAuth client display name, callback success-page copy, and static OAuth client selection. // // Returns: OAuth authorization URL the caller should open, or empty when cached tokens // already authenticated the server. @@ -13744,12 +13868,24 @@ func (a *MCPOauthAPI) Login(ctx context.Context, params *MCPOauthLoginRequest) ( if params.CallbackSuccessMessage != nil { req["callbackSuccessMessage"] = *params.CallbackSuccessMessage } + if params.ClientID != nil { + req["clientId"] = *params.ClientID + } if params.ClientName != nil { req["clientName"] = *params.ClientName } + if params.ClientSecret != nil { + req["clientSecret"] = *params.ClientSecret + } if params.ForceReauth != nil { req["forceReauth"] = *params.ForceReauth } + if params.GrantType != nil { + req["grantType"] = *params.GrantType + } + if params.PublicClient != nil { + req["publicClient"] = *params.PublicClient + } req["serverName"] = params.ServerName } raw, err := a.client.Request(ctx, "session.mcp.oauth.login", req) @@ -14187,6 +14323,9 @@ func (a *OptionsAPI) Update(ctx context.Context, params *SessionUpdateOptionsPar if params.AvailableTools != nil { req["availableTools"] = params.AvailableTools } + if params.Capi != nil { + req["capi"] = *params.Capi + } if params.ClientName != nil { req["clientName"] = *params.ClientName } @@ -16857,6 +16996,30 @@ type CanvasHandler interface { Open(request *CanvasProviderOpenRequest) (*CanvasProviderOpenResult, error) } +// Experimental: ProviderTokenHandler contains experimental APIs that may change or be +// removed. +type ProviderTokenHandler interface { + // GetToken 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. + // + // RPC method: providerToken.getToken. + // + // Parameters: 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. + // + // Returns: A bearer token supplied by the SDK client for a BYOK provider. The runtime sets + // it as `Authorization: Bearer ` on the outbound request and does no caching; the + // SDK consumer owns token caching and refresh. + GetToken(request *ProviderTokenAcquireRequest) (*ProviderTokenAcquireResult, error) +} + // Experimental: SessionFSHandler contains experimental APIs that may change or be removed. type SessionFSHandler interface { // AppendFile appends content to a file in the client-provided session filesystem. @@ -16975,8 +17138,9 @@ type SessionFSHandler interface { // ClientSessionAPIHandlers provides all client session API handler groups for a session. type ClientSessionAPIHandlers struct { - Canvas CanvasHandler - SessionFS SessionFSHandler + Canvas CanvasHandler + ProviderToken ProviderTokenHandler + SessionFS SessionFSHandler } func clientSessionHandlerError(err error) *jsonrpc2.Error { @@ -17050,6 +17214,25 @@ func RegisterClientSessionAPIHandlers(client *jsonrpc2.Client, getHandlers func( } return raw, nil }) + client.SetRequestHandler("providerToken.getToken", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { + var request ProviderTokenAcquireRequest + if err := json.Unmarshal(params, &request); err != nil { + return nil, &jsonrpc2.Error{Code: -32602, Message: fmt.Sprintf("Invalid params: %v", err)} + } + handlers := getHandlers(request.SessionID) + if handlers == nil || handlers.ProviderToken == nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("No providerToken handler registered for session: %s", request.SessionID)} + } + result, err := handlers.ProviderToken.GetToken(&request) + if err != nil { + return nil, clientSessionHandlerError(err) + } + raw, err := json.Marshal(result) + if err != nil { + return nil, &jsonrpc2.Error{Code: -32603, Message: fmt.Sprintf("Failed to marshal response: %v", err)} + } + return raw, nil + }) client.SetRequestHandler("sessionFs.appendFile", func(params json.RawMessage) (json.RawMessage, *jsonrpc2.Error) { var request SessionFSAppendFileRequest if err := json.Unmarshal(params, &request); err != nil { diff --git a/go/rpc/zrpc_encoding.go b/go/rpc/zrpc_encoding.go index 84e0fb43e..b4942942b 100644 --- a/go/rpc/zrpc_encoding.go +++ b/go/rpc/zrpc_encoding.go @@ -2822,6 +2822,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { AskUserDisabled *bool `json:"askUserDisabled,omitempty"` AuthInfo json.RawMessage `json:"authInfo,omitempty"` AvailableTools []string `json:"availableTools,omitzero"` + Capi *CapiSessionOptions `json:"capi,omitempty"` ClientKind *string `json:"clientKind,omitempty"` ClientName *string `json:"clientName,omitempty"` CoauthorEnabled *bool `json:"coauthorEnabled,omitempty"` @@ -2887,6 +2888,7 @@ func (r *SessionOpenOptions) UnmarshalJSON(data []byte) error { r.AuthInfo = value } r.AvailableTools = raw.AvailableTools + r.Capi = raw.Capi r.ClientKind = raw.ClientKind r.ClientName = raw.ClientName r.CoauthorEnabled = raw.CoauthorEnabled diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index 3d9741f18..89e9cc26d 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -281,12 +281,30 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionCanvasRecorded: + var d SessionCanvasRecordedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionCanvasRegistryChanged: var d SessionCanvasRegistryChangedData if err := json.Unmarshal(raw.Data, &d); err != nil { return err } e.Data = &d + case SessionEventTypeSessionCanvasRemoved: + var d SessionCanvasRemovedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeSessionCanvasUnavailable: + var d SessionCanvasUnavailableData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionCompactionComplete: var d SessionCompactionCompleteData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -413,6 +431,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeSessionScheduleRearmed: + var d SessionScheduleRearmedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeSessionShutdown: var d SessionShutdownData if err := json.Unmarshal(raw.Data, &d); err != nil { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 760752911..7964da76b 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -93,10 +93,25 @@ const ( SessionEventTypeSessionBackgroundTasksChanged SessionEventType = "session.background_tasks_changed" // Experimental: SessionEventTypeSessionBinaryAsset identifies an experimental event that // may change or be removed. - SessionEventTypeSessionBinaryAsset SessionEventType = "session.binary_asset" - SessionEventTypeSessionCanvasClosed SessionEventType = "session.canvas.closed" - SessionEventTypeSessionCanvasOpened SessionEventType = "session.canvas.opened" - SessionEventTypeSessionCanvasRegistryChanged SessionEventType = "session.canvas.registry_changed" + SessionEventTypeSessionBinaryAsset SessionEventType = "session.binary_asset" + // Experimental: SessionEventTypeSessionCanvasClosed identifies an experimental event that + // may change or be removed. + SessionEventTypeSessionCanvasClosed SessionEventType = "session.canvas.closed" + // Experimental: SessionEventTypeSessionCanvasOpened identifies an experimental event that + // may change or be removed. + SessionEventTypeSessionCanvasOpened SessionEventType = "session.canvas.opened" + // Experimental: SessionEventTypeSessionCanvasRecorded identifies an experimental event that + // may change or be removed. + SessionEventTypeSessionCanvasRecorded SessionEventType = "session.canvas.recorded" + // Experimental: SessionEventTypeSessionCanvasRegistryChanged identifies an experimental + // event that may change or be removed. + SessionEventTypeSessionCanvasRegistryChanged SessionEventType = "session.canvas.registry_changed" + // Experimental: SessionEventTypeSessionCanvasRemoved identifies an experimental event that + // may change or be removed. + SessionEventTypeSessionCanvasRemoved SessionEventType = "session.canvas.removed" + // Experimental: SessionEventTypeSessionCanvasUnavailable identifies an experimental event + // that may change or be removed. + SessionEventTypeSessionCanvasUnavailable SessionEventType = "session.canvas.unavailable" SessionEventTypeSessionCompactionComplete SessionEventType = "session.compaction_complete" SessionEventTypeSessionCompactionStart SessionEventType = "session.compaction_start" SessionEventTypeSessionContextChanged SessionEventType = "session.context_changed" @@ -118,6 +133,7 @@ const ( SessionEventTypeSessionResume SessionEventType = "session.resume" SessionEventTypeSessionScheduleCancelled SessionEventType = "session.schedule_cancelled" SessionEventTypeSessionScheduleCreated SessionEventType = "session.schedule_created" + SessionEventTypeSessionScheduleRearmed SessionEventType = "session.schedule_rearmed" SessionEventTypeSessionShutdown SessionEventType = "session.shutdown" SessionEventTypeSessionSkillsLoaded SessionEventType = "session.skills_loaded" SessionEventTypeSessionSnapshotRewind SessionEventType = "session.snapshot_rewind" @@ -327,6 +343,8 @@ type SessionCompactionCompleteData struct { RequestID *string `json:"requestId,omitempty"` // Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call ServiceRequestID *string `json:"serviceRequestId,omitempty"` + // For failed compaction only: the HTTP status code of the compaction LLM call failure, when it carried one. Absent for successful compaction and for failures without an HTTP status (e.g. an empty model response or a transport error). + StatusCode *int64 `json:"statusCode,omitempty"` // Whether compaction completed successfully Success bool `json:"success"` // LLM-generated summary of the compacted conversation history @@ -401,6 +419,40 @@ type SubagentSelectedData struct { func (*SubagentSelectedData) sessionEventData() {} func (*SubagentSelectedData) Type() SessionEventType { return SessionEventTypeSubagentSelected } +// Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability. +// Experimental: SessionCanvasRecordedData is part of an experimental API and may change or be removed. +type SessionCanvasRecordedData struct { + // Provider-local canvas identifier + CanvasID string `json:"canvasId"` + // Owning provider identifier + ExtensionID string `json:"extensionId"` + // Input supplied when the instance was opened + Input any `json:"input,omitempty"` + // Stable caller-supplied canvas instance identifier + InstanceID string `json:"instanceId"` + // Rendered title + Title *string `json:"title,omitempty"` +} + +func (*SessionCanvasRecordedData) sessionEventData() {} +func (*SessionCanvasRecordedData) Type() SessionEventType { + return SessionEventTypeSessionCanvasRecorded +} + +// Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. +// Experimental: SessionCanvasRemovedData is part of an experimental API and may change or be removed. +type SessionCanvasRemovedData struct { + // Provider-local canvas identifier + CanvasID string `json:"canvasId"` + // Owning provider identifier + ExtensionID string `json:"extensionId"` + // Stable caller-supplied identifier of the canvas instance that was closed + InstanceID string `json:"instanceId"` +} + +func (*SessionCanvasRemovedData) sessionEventData() {} +func (*SessionCanvasRemovedData) Type() SessionEventType { return SessionEventTypeSessionCanvasRemoved } + // Elicitation request completion with the user's response type ElicitationCompletedData struct { // The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed) @@ -543,6 +595,9 @@ type ModelCallFailureData struct { Model *string `json:"model,omitempty"` // GitHub request tracing ID (x-github-request-id header) for server-side log correlation ProviderCallID *string `json:"providerCallId,omitempty"` + // Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure. + // Internal: QuotaSnapshots is part of the SDK's internal API surface and is not intended for external use. + QuotaSnapshots map[string]AssistantUsageQuotaSnapshot `json:"quotaSnapshots,omitzero"` // Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures. RequestFingerprint *ModelCallFailureRequestFingerprint `json:"requestFingerprint,omitempty"` // Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation @@ -951,6 +1006,8 @@ type SessionScheduleCreatedData struct { Prompt string `json:"prompt"` // Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) Recurring *bool `json:"recurring,omitempty"` + // True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed. + SelfPaced *bool `json:"selfPaced,omitempty"` // IANA timezone the `cron` expression is evaluated in Tz *string `json:"tz,omitempty"` } @@ -970,6 +1027,7 @@ func (*SessionBackgroundTasksChangedData) Type() SessionEventType { } // Schema for the `CanvasClosedData` type. +// Experimental: SessionCanvasClosedData is part of an experimental API and may change or be removed. type SessionCanvasClosedData struct { // Provider-local canvas identifier CanvasID string `json:"canvasId"` @@ -983,9 +1041,8 @@ func (*SessionCanvasClosedData) sessionEventData() {} func (*SessionCanvasClosedData) Type() SessionEventType { return SessionEventTypeSessionCanvasClosed } // Schema for the `CanvasOpenedData` type. +// Experimental: SessionCanvasOpenedData is part of an experimental API and may change or be removed. type SessionCanvasOpenedData struct { - // Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. - Availability CanvasOpenedAvailability `json:"availability"` // Provider-local canvas identifier CanvasID string `json:"canvasId"` // Owning provider identifier @@ -996,8 +1053,6 @@ type SessionCanvasOpenedData struct { Input any `json:"input,omitempty"` // Stable caller-supplied canvas instance identifier InstanceID string `json:"instanceId"` - // Whether this notification represents an idempotent reopen - Reopen bool `json:"reopen"` // Provider-supplied status text Status *string `json:"status,omitempty"` // Rendered title @@ -1010,6 +1065,7 @@ func (*SessionCanvasOpenedData) sessionEventData() {} func (*SessionCanvasOpenedData) Type() SessionEventType { return SessionEventTypeSessionCanvasOpened } // Schema for the `CanvasRegistryChangedData` type. +// Experimental: SessionCanvasRegistryChangedData is part of an experimental API and may change or be removed. type SessionCanvasRegistryChangedData struct { // Canvas declarations currently available Canvases []CanvasRegistryChangedCanvas `json:"canvases"` @@ -1128,6 +1184,19 @@ type UserMessageData struct { func (*UserMessageData) sessionEventData() {} func (*UserMessageData) Type() SessionEventType { return SessionEventTypeUserMessage } +// Self-paced schedule re-armed for its next run +type SessionScheduleRearmedData struct { + // Id of the self-paced schedule that was re-armed + ID int64 `json:"id"` + // Absolute time (epoch milliseconds) the model armed the next run to fire + NextRunAt int64 `json:"nextRunAt"` +} + +func (*SessionScheduleRearmedData) sessionEventData() {} +func (*SessionScheduleRearmedData) Type() SessionEventType { + return SessionEventTypeSessionScheduleRearmed +} + // Session capability change notification type CapabilitiesChangedData struct { // UI capability changes @@ -1554,6 +1623,22 @@ type ToolExecutionStartData struct { func (*ToolExecutionStartData) sessionEventData() {} func (*ToolExecutionStartData) Type() SessionEventType { return SessionEventTypeToolExecutionStart } +// Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume. +// Experimental: SessionCanvasUnavailableData is part of an experimental API and may change or be removed. +type SessionCanvasUnavailableData struct { + // Provider-local canvas identifier + CanvasID string `json:"canvasId"` + // Owning provider identifier + ExtensionID string `json:"extensionId"` + // Stable caller-supplied identifier of the canvas instance whose provider became unavailable + InstanceID string `json:"instanceId"` +} + +func (*SessionCanvasUnavailableData) sessionEventData() {} +func (*SessionCanvasUnavailableData) Type() SessionEventType { + return SessionEventTypeSessionCanvasUnavailable +} + // Turn abort information including the reason for termination type AbortData struct { // Finite reason code describing why the current turn was aborted @@ -1734,6 +1819,9 @@ type AssistantUsageQuotaSnapshot struct { // Total requests allowed by the entitlement // Internal: EntitlementRequests is part of the SDK's internal API surface and is not intended for external use. EntitlementRequests int64 `json:"entitlementRequests"` + // Whether the user currently has quota available for use + // Internal: HasQuota is part of the SDK's internal API surface and is not intended for external use. + HasQuota *bool `json:"hasQuota,omitempty"` // Whether the user has an unlimited usage entitlement // Internal: IsUnlimitedEntitlement is part of the SDK's internal API surface and is not intended for external use. IsUnlimitedEntitlement bool `json:"isUnlimitedEntitlement"` @@ -1743,12 +1831,18 @@ type AssistantUsageQuotaSnapshot struct { // Whether additional usage is allowed when quota is exhausted // Internal: OverageAllowedWithExhaustedQuota is part of the SDK's internal API surface and is not intended for external use. OverageAllowedWithExhaustedQuota bool `json:"overageAllowedWithExhaustedQuota"` + // Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value + // Internal: OverageEntitlement is part of the SDK's internal API surface and is not intended for external use. + OverageEntitlement *float64 `json:"overageEntitlement,omitempty"` // Percentage of quota remaining (0 to 100) // Internal: RemainingPercentage is part of the SDK's internal API surface and is not intended for external use. RemainingPercentage float64 `json:"remainingPercentage"` // Date when the quota resets // Internal: ResetDate is part of the SDK's internal API surface and is not intended for external use. ResetDate *time.Time `json:"resetDate,omitempty"` + // Whether this snapshot uses token-based billing (AI-credits allocation) + // Internal: TokenBasedBilling is part of the SDK's internal API surface and is not intended for external use. + TokenBasedBilling *bool `json:"tokenBasedBilling,omitempty"` // Whether usage is still permitted after quota exhaustion // Internal: UsageAllowedWithExhaustedQuota is part of the SDK's internal API surface and is not intended for external use. UsageAllowedWithExhaustedQuota bool `json:"usageAllowedWithExhaustedQuota"` @@ -1758,6 +1852,7 @@ type AssistantUsageQuotaSnapshot struct { } // Schema for the `CanvasRegistryChangedCanvas` type. +// Experimental: CanvasRegistryChangedCanvas is part of an experimental API and may change or be removed. type CanvasRegistryChangedCanvas struct { // Actions the agent or host may invoke Actions []CanvasRegistryChangedCanvasAction `json:"actions,omitzero"` @@ -1776,6 +1871,7 @@ type CanvasRegistryChangedCanvas struct { } // Schema for the `CanvasRegistryChangedCanvasAction` type. +// Experimental: CanvasRegistryChangedCanvasAction is part of an experimental API and may change or be removed. type CanvasRegistryChangedCanvasAction struct { // Action description Description *string `json:"description,omitempty"` @@ -2465,6 +2561,10 @@ type PermissionRequestShell struct { PossiblePaths []string `json:"possiblePaths"` // URLs that may be accessed by the command PossibleURLs []PermissionRequestShellPossibleURL `json:"possibleUrls"` + // True when the model has requested to run this command outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + RequestSandboxBypass *bool `json:"requestSandboxBypass,omitempty"` + // Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + RequestSandboxBypassReason *string `json:"requestSandboxBypassReason,omitempty"` // Tool call ID that triggered this permission request ToolCallID *string `json:"toolCallId,omitempty"` // Optional warning message about risks of running this command @@ -3290,16 +3390,6 @@ const ( BinaryAssetTypeResource BinaryAssetType = "resource" ) -// Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. -type CanvasOpenedAvailability string - -const ( - // Provider connection is live; actions can be invoked. - CanvasOpenedAvailabilityReady CanvasOpenedAvailability = "ready" - // Provider has gone away; the instance is awaiting rebinding. - CanvasOpenedAvailabilityStale CanvasOpenedAvailability = "stale" -) - // Type discriminator for CitationLocation. // Experimental: CitationLocationType is part of an experimental API and may change or be removed. type CitationLocationType string diff --git a/go/session.go b/go/session.go index acd698677..1aeb70c24 100644 --- a/go/session.go +++ b/go/session.go @@ -146,18 +146,16 @@ func (s *Session) removeOpenCanvas(instanceID string) { func (s *Session) updateOpenCanvasesFromEvent(event SessionEvent) { switch data := event.Data.(type) { case *SessionCanvasOpenedData: - if data.InstanceID == "" || data.CanvasID == "" || data.ExtensionID == "" || data.Availability == "" { + if data.InstanceID == "" || data.CanvasID == "" || data.ExtensionID == "" { fmt.Printf("failed to deserialize session.canvas.opened payload\n") return } s.upsertOpenCanvas(rpc.OpenCanvasInstance{ - Availability: rpc.CanvasInstanceAvailability(data.Availability), CanvasID: data.CanvasID, ExtensionID: data.ExtensionID, ExtensionName: data.ExtensionName, Input: data.Input, InstanceID: data.InstanceID, - Reopen: data.Reopen, Status: data.Status, Title: data.Title, URL: data.URL, diff --git a/go/session_test.go b/go/session_test.go index 15cfbcf57..654be6ce4 100644 --- a/go/session_test.go +++ b/go/session_test.go @@ -583,9 +583,8 @@ func TestSession_Capabilities(t *testing.T) { session.dispatchEvent(SessionEvent{ Data: &SessionCanvasOpenedData{ - InstanceID: "missing-canvas-id", - ExtensionID: "project:counter", - Availability: CanvasOpenedAvailabilityReady, + InstanceID: "missing-canvas-id", + ExtensionID: "project:counter", }, }) session.dispatchEvent(SessionEvent{ @@ -598,18 +597,14 @@ func TestSession_Capabilities(t *testing.T) { Status: ptr("ready"), URL: ptr("https://example.test/counter"), Input: map[string]any{"seed": float64(1)}, - Reopen: false, - Availability: CanvasOpenedAvailabilityReady, }, }) session.dispatchEvent(SessionEvent{ Data: &SessionCanvasOpenedData{ - ExtensionID: "project:logs", - CanvasID: "logs", - InstanceID: "logs-1", - Title: ptr("Logs"), - Reopen: false, - Availability: CanvasOpenedAvailabilityStale, + ExtensionID: "project:logs", + CanvasID: "logs", + InstanceID: "logs-1", + Title: ptr("Logs"), }, }) @@ -631,8 +626,6 @@ func TestSession_Capabilities(t *testing.T) { Status: ptr("reconnected"), URL: ptr("https://example.test/counter-updated"), Input: map[string]any{"seed": float64(2)}, - Reopen: true, - Availability: CanvasOpenedAvailabilityStale, }, }) @@ -652,12 +645,6 @@ func TestSession_Capabilities(t *testing.T) { if open[0].URL == nil || *open[0].URL != "https://example.test/counter-updated" { t.Fatalf("expected updated URL, got %+v", open[0].URL) } - if !open[0].Reopen { - t.Fatal("expected reopen to be true") - } - if string(open[0].Availability) != string(CanvasOpenedAvailabilityStale) { - t.Fatalf("expected stale availability, got %q", open[0].Availability) - } }) t.Run("session.canvas.closed event removes open canvas snapshots", func(t *testing.T) { @@ -666,20 +653,18 @@ func TestSession_Capabilities(t *testing.T) { session.dispatchEvent(SessionEvent{ Data: &SessionCanvasOpenedData{ - ExtensionID: "project:counter", - CanvasID: "counter", - InstanceID: "counter-1", - Title: ptr("Counter"), - Availability: CanvasOpenedAvailabilityReady, + ExtensionID: "project:counter", + CanvasID: "counter", + InstanceID: "counter-1", + Title: ptr("Counter"), }, }) session.dispatchEvent(SessionEvent{ Data: &SessionCanvasOpenedData{ - ExtensionID: "project:logs", - CanvasID: "logs", - InstanceID: "logs-1", - Title: ptr("Logs"), - Availability: CanvasOpenedAvailabilityReady, + ExtensionID: "project:logs", + CanvasID: "logs", + InstanceID: "logs-1", + Title: ptr("Logs"), }, }) diff --git a/go/zsession_events.go b/go/zsession_events.go index 0f2d4a792..75a22cc99 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -46,7 +46,6 @@ type ( BinaryAssetReference = rpc.BinaryAssetReference BinaryAssetReferenceType = rpc.BinaryAssetReferenceType BinaryAssetType = rpc.BinaryAssetType - CanvasOpenedAvailability = rpc.CanvasOpenedAvailability CanvasRegistryChangedCanvas = rpc.CanvasRegistryChangedCanvas CanvasRegistryChangedCanvasAction = rpc.CanvasRegistryChangedCanvasAction CapabilitiesChangedData = rpc.CapabilitiesChangedData @@ -182,7 +181,10 @@ type ( SessionBinaryAssetData = rpc.SessionBinaryAssetData SessionCanvasClosedData = rpc.SessionCanvasClosedData SessionCanvasOpenedData = rpc.SessionCanvasOpenedData + SessionCanvasRecordedData = rpc.SessionCanvasRecordedData SessionCanvasRegistryChangedData = rpc.SessionCanvasRegistryChangedData + SessionCanvasRemovedData = rpc.SessionCanvasRemovedData + SessionCanvasUnavailableData = rpc.SessionCanvasUnavailableData SessionCompactionCompleteData = rpc.SessionCompactionCompleteData SessionCompactionStartData = rpc.SessionCompactionStartData SessionContextChangedData = rpc.SessionContextChangedData @@ -208,6 +210,7 @@ type ( SessionResumeData = rpc.SessionResumeData SessionScheduleCancelledData = rpc.SessionScheduleCancelledData SessionScheduleCreatedData = rpc.SessionScheduleCreatedData + SessionScheduleRearmedData = rpc.SessionScheduleRearmedData SessionShutdownData = rpc.SessionShutdownData SessionSkillsLoadedData = rpc.SessionSkillsLoadedData SessionSnapshotRewindData = rpc.SessionSnapshotRewindData @@ -337,8 +340,6 @@ const ( BinaryAssetReferenceTypeResource = rpc.BinaryAssetReferenceTypeResource BinaryAssetTypeImage = rpc.BinaryAssetTypeImage BinaryAssetTypeResource = rpc.BinaryAssetTypeResource - CanvasOpenedAvailabilityReady = rpc.CanvasOpenedAvailabilityReady - CanvasOpenedAvailabilityStale = rpc.CanvasOpenedAvailabilityStale CitationLocationTypeBlock = rpc.CitationLocationTypeBlock CitationLocationTypeChar = rpc.CitationLocationTypeChar CitationLocationTypePage = rpc.CitationLocationTypePage @@ -481,7 +482,10 @@ const ( SessionEventTypeSessionBinaryAsset = rpc.SessionEventTypeSessionBinaryAsset SessionEventTypeSessionCanvasClosed = rpc.SessionEventTypeSessionCanvasClosed SessionEventTypeSessionCanvasOpened = rpc.SessionEventTypeSessionCanvasOpened + SessionEventTypeSessionCanvasRecorded = rpc.SessionEventTypeSessionCanvasRecorded SessionEventTypeSessionCanvasRegistryChanged = rpc.SessionEventTypeSessionCanvasRegistryChanged + SessionEventTypeSessionCanvasRemoved = rpc.SessionEventTypeSessionCanvasRemoved + SessionEventTypeSessionCanvasUnavailable = rpc.SessionEventTypeSessionCanvasUnavailable SessionEventTypeSessionCompactionComplete = rpc.SessionEventTypeSessionCompactionComplete SessionEventTypeSessionCompactionStart = rpc.SessionEventTypeSessionCompactionStart SessionEventTypeSessionContextChanged = rpc.SessionEventTypeSessionContextChanged @@ -503,6 +507,7 @@ const ( SessionEventTypeSessionResume = rpc.SessionEventTypeSessionResume SessionEventTypeSessionScheduleCancelled = rpc.SessionEventTypeSessionScheduleCancelled SessionEventTypeSessionScheduleCreated = rpc.SessionEventTypeSessionScheduleCreated + SessionEventTypeSessionScheduleRearmed = rpc.SessionEventTypeSessionScheduleRearmed SessionEventTypeSessionShutdown = rpc.SessionEventTypeSessionShutdown SessionEventTypeSessionSkillsLoaded = rpc.SessionEventTypeSessionSkillsLoaded SessionEventTypeSessionSnapshotRewind = rpc.SessionEventTypeSessionSnapshotRewind diff --git a/java/pom.xml b/java/pom.xml index 5224132d8..62d26e15a 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -86,7 +86,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.64-3 + ^1.0.65 diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index 9a7b832c7..510d09497 100644 --- a/java/scripts/codegen/package-lock.json +++ b/java/scripts/codegen/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "copilot-sdk-java-codegen", "dependencies": { - "@github/copilot": "^1.0.64-3", + "@github/copilot": "^1.0.65", "json-schema": "^0.4.0", "tsx": "^4.22.4" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.64-3.tgz", - "integrity": "sha512-Q9nBMYEHX1bJLXzzJocQx2nZvORJ0E9gvK6ly/FCtmtA7ad96BWZvf4EHzkCNDsn56aI3zNaUSfKHUKcmIAzSg==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.65.tgz", + "integrity": "sha512-J1XvLuOiVpiAi/E1MBICBymszCgdGLnZxokosXzGcmcjEVZd+QSDoW/kPRHq6oEyBT9SDASPcjCEZ9Q0rLJllg==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -439,20 +439,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.64-3", - "@github/copilot-darwin-x64": "1.0.64-3", - "@github/copilot-linux-arm64": "1.0.64-3", - "@github/copilot-linux-x64": "1.0.64-3", - "@github/copilot-linuxmusl-arm64": "1.0.64-3", - "@github/copilot-linuxmusl-x64": "1.0.64-3", - "@github/copilot-win32-arm64": "1.0.64-3", - "@github/copilot-win32-x64": "1.0.64-3" + "@github/copilot-darwin-arm64": "1.0.65", + "@github/copilot-darwin-x64": "1.0.65", + "@github/copilot-linux-arm64": "1.0.65", + "@github/copilot-linux-x64": "1.0.65", + "@github/copilot-linuxmusl-arm64": "1.0.65", + "@github/copilot-linuxmusl-x64": "1.0.65", + "@github/copilot-win32-arm64": "1.0.65", + "@github/copilot-win32-x64": "1.0.65" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.64-3.tgz", - "integrity": "sha512-wlV6mRoAd/wG2V08TG+BOJ0nyOjroya24FSyA5A49z7PnUUuQXYRpa/GljvI5j3PM8aUl0DyBkXuB/DcFU818g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.65.tgz", + "integrity": "sha512-NFc4xIstZNiIuAYkurQT5DVtbZjBoZ/z6yt/Ffcom7Y5QGjfpN4BFuekv9k+OADRioxxR99NgmhjbuNPWtQhNQ==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.64-3.tgz", - "integrity": "sha512-mk48PIESL2keeemX7tLRmWRDxKwl0q3cFI1ORD2QcrieNK7pSqI3eVbfoB7MqoUUI27yzIkl67xqgl8Qq28IUQ==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.65.tgz", + "integrity": "sha512-0wtV22KmTa12VbqWRRkgvJcBz/oIbszfcIpyDWGc4MzbCVksajQ3TWVQ6c7Sdzj5RifCaYdkHAX2zuIYXYlLoQ==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.64-3.tgz", - "integrity": "sha512-rCgtK3/rofQW5StSbeU0TwDUlOl2bvS2HGKyapVxow1Nvz3Q/TDB+eFRQc5ocBdv5tNSor+Caw2JGkRx5v508w==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.65.tgz", + "integrity": "sha512-dOwdy/YbTXQN/+x2v4ZgiDycdRtWElyHxPuA6ail3yJDt0nagwn8OYAA/diBLPMAJuuBXiOZGvvb9fGRuh7Xgg==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.64-3.tgz", - "integrity": "sha512-FAiBMw1h07mURSBLi3ztj5yzbP+uTbo9mhxOym1Xysut5LDpO2kYUzTYk2DlIyLGZhmH/HDOZE+b6U7lOUQy0g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.65.tgz", + "integrity": "sha512-al/1a/l/GrpHtygTxt7PZspmv0eHBPdAZ5B31J7Hv/GRdVZM4STCC9dCIOSUFsOX2fhaKD8yLfz4HureSYs23g==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.64-3.tgz", - "integrity": "sha512-vn8P6grPf0y2mNskkdVbAz0i46b1sP9uSXv7z6kgycjprl0CdIYPDf3WEkG60vpyopfQna+iCqCLMWRnNyCk3g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.65.tgz", + "integrity": "sha512-xccQeJSR45xyoaL7J5mZjtU++dmte+ZCDQkIlrpTn2yuMl2LWriBvorQ1P2MwVnXmIiW/GHi93B+lNtsybA9yw==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.64-3.tgz", - "integrity": "sha512-atdHimNd6nzRRwHybXUY6/84bYzXeKbDOeYN/N/DsX23+AQOPSu5BD8MD8166I/5kNHui0XOmeTSydVNBUwcJw==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.65.tgz", + "integrity": "sha512-RHPVUaqjSrhKHQ2EpfGKWErnV+R5elGIZaHXPKO10zpSaQD9b/C9u6nLigZnBuT/8sCaJpVrazPMwOYvYA62aw==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.64-3.tgz", - "integrity": "sha512-jUTS9meoHEXQR8nMDOjwC0baqV273lYtLxY46W7TiOFszhsqhbhWxQMkNQBfT3GEfPp+40igzMPq3reaUTuvag==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.65.tgz", + "integrity": "sha512-/vSE/t9Wm3eFSWpxlKyn/oL8OAVOB0yFO7ECxhgbtiqNrBd1tgpYh1k7IXBIWa/saxlV1+de6DEmPuQfx3Z0bg==", "cpu": [ "arm64" ], @@ -562,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.64-3.tgz", - "integrity": "sha512-gHUhS500Q91hjtH9fqKDblaIs0mO09G4ifpZ1woDPXbkdKe/W29uwB7g2fn0+KczNRyPxFSWlqjnOon4Fe8svA==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.65.tgz", + "integrity": "sha512-wjVWXepET+SpFg8z8V43ZiTy6X1OerCb7yu3QZKNNJ3zY9z20goihPXQCDWkiJpGzszNSgfrsiqUzpUsC9qS0A==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index 5a6e0b777..53d5b3eba 100644 --- a/java/scripts/codegen/package.json +++ b/java/scripts/codegen/package.json @@ -7,7 +7,7 @@ "generate:java": "tsx java.ts" }, "dependencies": { - "@github/copilot": "^1.0.64-3", + "@github/copilot": "^1.0.65", "json-schema": "^0.4.0", "tsx": "^4.22.4" } diff --git a/java/src/generated/java/com/github/copilot/generated/AssistantUsageQuotaSnapshot.java b/java/src/generated/java/com/github/copilot/generated/AssistantUsageQuotaSnapshot.java index 167f42040..974a7f272 100644 --- a/java/src/generated/java/com/github/copilot/generated/AssistantUsageQuotaSnapshot.java +++ b/java/src/generated/java/com/github/copilot/generated/AssistantUsageQuotaSnapshot.java @@ -37,6 +37,12 @@ public record AssistantUsageQuotaSnapshot( /** Percentage of quota remaining (0 to 100) */ @JsonProperty("remainingPercentage") Double remainingPercentage, /** Date when the quota resets */ - @JsonProperty("resetDate") OffsetDateTime resetDate + @JsonProperty("resetDate") OffsetDateTime resetDate, + /** Whether the user currently has quota available for use */ + @JsonProperty("hasQuota") Boolean hasQuota, + /** Whether this snapshot uses token-based billing (AI-credits allocation) */ + @JsonProperty("tokenBasedBilling") Boolean tokenBasedBilling, + /** Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value */ + @JsonProperty("overageEntitlement") Double overageEntitlement ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/CanvasOpenedAvailability.java b/java/src/generated/java/com/github/copilot/generated/CanvasOpenedAvailability.java deleted file mode 100644 index 1e65c1a2d..000000000 --- a/java/src/generated/java/com/github/copilot/generated/CanvasOpenedAvailability.java +++ /dev/null @@ -1,35 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------------------------------------------*/ - -// AUTO-GENERATED FILE - DO NOT EDIT -// Generated from: session-events.schema.json - -package com.github.copilot.generated; - -import javax.annotation.processing.Generated; - -/** - * Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. - * - * @since 1.0.0 - */ -@javax.annotation.processing.Generated("copilot-sdk-codegen") -public enum CanvasOpenedAvailability { - /** The {@code ready} variant. */ - READY("ready"), - /** The {@code stale} variant. */ - STALE("stale"); - - private final String value; - CanvasOpenedAvailability(String value) { this.value = value; } - @com.fasterxml.jackson.annotation.JsonValue - public String getValue() { return value; } - @com.fasterxml.jackson.annotation.JsonCreator - public static CanvasOpenedAvailability fromValue(String value) { - for (CanvasOpenedAvailability v : values()) { - if (v.value.equals(value)) return v; - } - throw new IllegalArgumentException("Unknown CanvasOpenedAvailability value: " + value); - } -} diff --git a/java/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java b/java/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java index 067203ac3..8797477d5 100644 --- a/java/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/ModelCallFailureEvent.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; import javax.annotation.processing.Generated; /** @@ -58,6 +59,8 @@ public record ModelCallFailureEventData( @JsonProperty("errorCode") String errorCode, /** For HTTP 400 failures only: the `type` from the CAPI error envelope (e.g. 'websocket_error'), a coarser companion to errorCode for envelopes that carry no code. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures. */ @JsonProperty("errorType") String errorType, + /** Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure. */ + @JsonProperty("quotaSnapshots") Map quotaSnapshots, /** Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures. */ @JsonProperty("requestFingerprint") ModelCallFailureRequestFingerprint requestFingerprint ) { diff --git a/java/src/generated/java/com/github/copilot/generated/SessionCanvasOpenedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionCanvasOpenedEvent.java index 03f7de9d1..84f87ffbc 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionCanvasOpenedEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionCanvasOpenedEvent.java @@ -49,11 +49,7 @@ public record SessionCanvasOpenedEventData( /** URL for web-rendered canvases */ @JsonProperty("url") String url, /** Input supplied when the instance was opened */ - @JsonProperty("input") Object input, - /** Whether this notification represents an idempotent reopen */ - @JsonProperty("reopen") Boolean reopen, - /** Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. */ - @JsonProperty("availability") CanvasOpenedAvailability availability + @JsonProperty("input") Object input ) { } } diff --git a/java/src/generated/java/com/github/copilot/generated/SessionCanvasRecordedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionCanvasRecordedEvent.java new file mode 100644 index 000000000..6f2fb4259 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionCanvasRecordedEvent.java @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.canvas.recorded". Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCanvasRecordedEvent extends SessionEvent { + + @Override + public String getType() { return "session.canvas.recorded"; } + + @JsonProperty("data") + private SessionCanvasRecordedEventData data; + + public SessionCanvasRecordedEventData getData() { return data; } + public void setData(SessionCanvasRecordedEventData data) { this.data = data; } + + /** Data payload for {@link SessionCanvasRecordedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCanvasRecordedEventData( + /** Stable caller-supplied canvas instance identifier */ + @JsonProperty("instanceId") String instanceId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId, + /** Rendered title */ + @JsonProperty("title") String title, + /** Input supplied when the instance was opened */ + @JsonProperty("input") Object input + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionCanvasRemovedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionCanvasRemovedEvent.java new file mode 100644 index 000000000..cea7ab09a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionCanvasRemovedEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.canvas.removed". Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCanvasRemovedEvent extends SessionEvent { + + @Override + public String getType() { return "session.canvas.removed"; } + + @JsonProperty("data") + private SessionCanvasRemovedEventData data; + + public SessionCanvasRemovedEventData getData() { return data; } + public void setData(SessionCanvasRemovedEventData data) { this.data = data; } + + /** Data payload for {@link SessionCanvasRemovedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCanvasRemovedEventData( + /** Stable caller-supplied identifier of the canvas instance that was closed */ + @JsonProperty("instanceId") String instanceId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionCanvasUnavailableEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionCanvasUnavailableEvent.java new file mode 100644 index 000000000..4e4397ecb --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionCanvasUnavailableEvent.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.canvas.unavailable". Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionCanvasUnavailableEvent extends SessionEvent { + + @Override + public String getType() { return "session.canvas.unavailable"; } + + @JsonProperty("data") + private SessionCanvasUnavailableEventData data; + + public SessionCanvasUnavailableEventData getData() { return data; } + public void setData(SessionCanvasUnavailableEventData data) { this.data = data; } + + /** Data payload for {@link SessionCanvasUnavailableEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionCanvasUnavailableEventData( + /** Stable caller-supplied identifier of the canvas instance whose provider became unavailable */ + @JsonProperty("instanceId") String instanceId, + /** Owning provider identifier */ + @JsonProperty("extensionId") String extensionId, + /** Provider-local canvas identifier */ + @JsonProperty("canvasId") String canvasId + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java index 42cc9a402..8771d3114 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionCompactionCompleteEvent.java @@ -67,7 +67,9 @@ public record SessionCompactionCompleteEventData( /** Token count from non-system messages (user, assistant, tool) after compaction */ @JsonProperty("conversationTokens") Long conversationTokens, /** Token count from tool definitions after compaction */ - @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens + @JsonProperty("toolDefinitionsTokens") Long toolDefinitionsTokens, + /** For failed compaction only: the HTTP status code of the compaction LLM call failure, when it carried one. Absent for successful compaction and for failures without an HTTP status (e.g. an empty model response or a transport error). */ + @JsonProperty("statusCode") Long statusCode ) { } } diff --git a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java index b25a27353..f92dbf2fa 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -33,6 +33,7 @@ @JsonSubTypes.Type(value = SessionTitleChangedEvent.class, name = "session.title_changed"), @JsonSubTypes.Type(value = SessionScheduleCreatedEvent.class, name = "session.schedule_created"), @JsonSubTypes.Type(value = SessionScheduleCancelledEvent.class, name = "session.schedule_cancelled"), + @JsonSubTypes.Type(value = SessionScheduleRearmedEvent.class, name = "session.schedule_rearmed"), @JsonSubTypes.Type(value = SessionAutopilotObjectiveChangedEvent.class, name = "session.autopilot_objective_changed"), @JsonSubTypes.Type(value = SessionInfoEvent.class, name = "session.info"), @JsonSubTypes.Type(value = SessionWarningEvent.class, name = "session.warning"), @@ -114,6 +115,9 @@ @JsonSubTypes.Type(value = SessionCanvasOpenedEvent.class, name = "session.canvas.opened"), @JsonSubTypes.Type(value = SessionCanvasRegistryChangedEvent.class, name = "session.canvas.registry_changed"), @JsonSubTypes.Type(value = SessionCanvasClosedEvent.class, name = "session.canvas.closed"), + @JsonSubTypes.Type(value = SessionCanvasUnavailableEvent.class, name = "session.canvas.unavailable"), + @JsonSubTypes.Type(value = SessionCanvasRecordedEvent.class, name = "session.canvas.recorded"), + @JsonSubTypes.Type(value = SessionCanvasRemovedEvent.class, name = "session.canvas.removed"), @JsonSubTypes.Type(value = SessionExtensionsAttachmentsPushedEvent.class, name = "session.extensions.attachments_pushed"), @JsonSubTypes.Type(value = McpAppToolCallCompleteEvent.class, name = "mcp_app.tool_call_complete") }) @@ -127,6 +131,7 @@ public abstract sealed class SessionEvent permits SessionTitleChangedEvent, SessionScheduleCreatedEvent, SessionScheduleCancelledEvent, + SessionScheduleRearmedEvent, SessionAutopilotObjectiveChangedEvent, SessionInfoEvent, SessionWarningEvent, @@ -208,6 +213,9 @@ public abstract sealed class SessionEvent permits SessionCanvasOpenedEvent, SessionCanvasRegistryChangedEvent, SessionCanvasClosedEvent, + SessionCanvasUnavailableEvent, + SessionCanvasRecordedEvent, + SessionCanvasRemovedEvent, SessionExtensionsAttachmentsPushedEvent, McpAppToolCallCompleteEvent, UnknownSessionEvent { diff --git a/java/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java index a7a934949..435a8501e 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionScheduleCreatedEvent.java @@ -48,6 +48,8 @@ public record SessionScheduleCreatedEventData( @JsonProperty("prompt") String prompt, /** Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) */ @JsonProperty("recurring") Boolean recurring, + /** True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed. */ + @JsonProperty("selfPaced") Boolean selfPaced, /** Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion) */ @JsonProperty("displayPrompt") String displayPrompt ) { diff --git a/java/src/generated/java/com/github/copilot/generated/SessionScheduleRearmedEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionScheduleRearmedEvent.java new file mode 100644 index 000000000..271edd7ae --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/SessionScheduleRearmedEvent.java @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "session.schedule_rearmed". Self-paced schedule re-armed for its next run + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionScheduleRearmedEvent extends SessionEvent { + + @Override + public String getType() { return "session.schedule_rearmed"; } + + @JsonProperty("data") + private SessionScheduleRearmedEventData data; + + public SessionScheduleRearmedEventData getData() { return data; } + public void setData(SessionScheduleRearmedEventData data) { this.data = data; } + + /** Data payload for {@link SessionScheduleRearmedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record SessionScheduleRearmedEventData( + /** Id of the self-paced schedule that was re-armed */ + @JsonProperty("id") Long id, + /** Absolute time (epoch milliseconds) the model armed the next run to fire */ + @JsonProperty("nextRunAt") Long nextRunAt + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java b/java/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java new file mode 100644 index 000000000..27fd29128 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/CapiSessionOptions.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Options scoped to the built-in CAPI (Copilot API) provider. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record 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. */ + @JsonProperty("enableWebSocketResponses") Boolean enableWebSocketResponses +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/McpOauthLoginGrantType.java b/java/src/generated/java/com/github/copilot/generated/rpc/McpOauthLoginGrantType.java new file mode 100644 index 000000000..4c835d293 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/McpOauthLoginGrantType.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * OAuth grant type override for this login. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum McpOauthLoginGrantType { + /** The {@code authorization_code} variant. */ + AUTHORIZATION_CODE("authorization_code"), + /** The {@code client_credentials} variant. */ + CLIENT_CREDENTIALS("client_credentials"); + + private final String value; + McpOauthLoginGrantType(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static McpOauthLoginGrantType fromValue(String value) { + for (McpOauthLoginGrantType v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown McpOauthLoginGrantType value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/NamedProviderConfig.java b/java/src/generated/java/com/github/copilot/generated/rpc/NamedProviderConfig.java index 2d5bddaf8..9ee1c5a95 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/NamedProviderConfig.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/NamedProviderConfig.java @@ -28,6 +28,8 @@ public record NamedProviderConfig( @JsonProperty("type") ProviderConfigType type, /** Wire API format (openai/azure only). Defaults to "completions". */ @JsonProperty("wireApi") ProviderConfigWireApi wireApi, + /** Provider transport. Defaults to "http". */ + @JsonProperty("transport") ProviderConfigTransport transport, /** API endpoint URL. */ @JsonProperty("baseUrl") String baseUrl, /** API key. Optional for local providers like Ollama. */ @@ -37,6 +39,8 @@ public record NamedProviderConfig( /** Azure-specific provider options. */ @JsonProperty("azure") ProviderConfigAzure azure, /** Custom HTTP headers to include in all outbound requests to the provider. */ - @JsonProperty("headers") Map headers + @JsonProperty("headers") Map headers, + /** 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 ` 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. */ + @JsonProperty("hasBearerTokenProvider") Boolean hasBearerTokenProvider ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/OpenCanvasInstance.java b/java/src/generated/java/com/github/copilot/generated/rpc/OpenCanvasInstance.java index 5b373ee23..9495d2161 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/OpenCanvasInstance.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/OpenCanvasInstance.java @@ -36,10 +36,6 @@ public record OpenCanvasInstance( /** URL for web-rendered canvases */ @JsonProperty("url") String url, /** Input supplied when the instance was opened */ - @JsonProperty("input") Object input, - /** Whether this snapshot came from an idempotent reopen */ - @JsonProperty("reopen") Boolean reopen, - /** Runtime-controlled routing state for an open canvas instance. */ - @JsonProperty("availability") CanvasInstanceAvailability availability + @JsonProperty("input") Object input ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ProviderConfig.java b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderConfig.java index f9edc9983..ee21c07d1 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ProviderConfig.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderConfig.java @@ -26,6 +26,8 @@ public record ProviderConfig( @JsonProperty("type") ProviderConfigType type, /** Wire API format (openai/azure only). Defaults to "completions". */ @JsonProperty("wireApi") ProviderConfigWireApi wireApi, + /** Provider transport. Defaults to "http". */ + @JsonProperty("transport") ProviderConfigTransport transport, /** API endpoint URL. */ @JsonProperty("baseUrl") String baseUrl, /** API key. Optional for local providers like Ollama. */ @@ -45,6 +47,8 @@ public record ProviderConfig( /** Maximum output tokens for the model. */ @JsonProperty("maxOutputTokens") Double maxOutputTokens, /** Custom HTTP headers to include in all outbound requests to the provider. */ - @JsonProperty("headers") Map headers + @JsonProperty("headers") Map headers, + /** 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 ` 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. */ + @JsonProperty("hasBearerTokenProvider") Boolean hasBearerTokenProvider ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/CanvasInstanceAvailability.java b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderConfigTransport.java similarity index 59% rename from java/src/generated/java/com/github/copilot/generated/rpc/CanvasInstanceAvailability.java rename to java/src/generated/java/com/github/copilot/generated/rpc/ProviderConfigTransport.java index aef2d8126..f0f32c078 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/CanvasInstanceAvailability.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderConfigTransport.java @@ -10,26 +10,26 @@ import javax.annotation.processing.Generated; /** - * Runtime-controlled routing state for an open canvas instance. + * Provider transport. Defaults to "http". * * @since 1.0.0 */ @javax.annotation.processing.Generated("copilot-sdk-codegen") -public enum CanvasInstanceAvailability { - /** The {@code ready} variant. */ - READY("ready"), - /** The {@code stale} variant. */ - STALE("stale"); +public enum ProviderConfigTransport { + /** The {@code http} variant. */ + HTTP("http"), + /** The {@code websockets} variant. */ + WEBSOCKETS("websockets"); private final String value; - CanvasInstanceAvailability(String value) { this.value = value; } + ProviderConfigTransport(String value) { this.value = value; } @com.fasterxml.jackson.annotation.JsonValue public String getValue() { return value; } @com.fasterxml.jackson.annotation.JsonCreator - public static CanvasInstanceAvailability fromValue(String value) { - for (CanvasInstanceAvailability v : values()) { + public static ProviderConfigTransport fromValue(String value) { + for (ProviderConfigTransport v : values()) { if (v.value.equals(value)) return v; } - throw new IllegalArgumentException("Unknown CanvasInstanceAvailability value: " + value); + throw new IllegalArgumentException("Unknown ProviderConfigTransport value: " + value); } } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ProviderEndpointTransport.java b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderEndpointTransport.java new file mode 100644 index 000000000..ef0e20348 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderEndpointTransport.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import javax.annotation.processing.Generated; + +/** + * Transport to be used for provider requests. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public enum ProviderEndpointTransport { + /** The {@code http} variant. */ + HTTP("http"), + /** The {@code websockets} variant. */ + WEBSOCKETS("websockets"); + + private final String value; + ProviderEndpointTransport(String value) { this.value = value; } + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { return value; } + @com.fasterxml.jackson.annotation.JsonCreator + public static ProviderEndpointTransport fromValue(String value) { + for (ProviderEndpointTransport v : values()) { + if (v.value.equals(value)) return v; + } + throw new IllegalArgumentException("Unknown ProviderEndpointTransport value: " + value); + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ProviderTokenGetTokenParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderTokenGetTokenParams.java new file mode 100644 index 000000000..a3e3cad7e --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderTokenGetTokenParams.java @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * 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. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ProviderTokenGetTokenParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** 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`. */ + @JsonProperty("providerName") String providerName +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ProviderTokenGetTokenResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderTokenGetTokenResult.java new file mode 100644 index 000000000..a2a0acd6a --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ProviderTokenGetTokenResult.java @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer ` on the outbound request and does no caching; the SDK consumer owns token caching and refresh. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record ProviderTokenGetTokenResult( + /** The bearer token value (without the `Bearer ` prefix). */ + @JsonProperty("token") String token +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java b/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java index a3d3f4f9a..b2a4d74d1 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfig.java @@ -25,8 +25,6 @@ public record SandboxConfig( @JsonProperty("enabled") Boolean enabled, /** User-managed sandbox policy fragment merged into the auto-discovered base policy. */ @JsonProperty("userPolicy") SandboxConfigUserPolicy userPolicy, - /** Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to `spawnSandboxFromConfig`, bypassing policy merging. */ - @JsonProperty("config") Object config, /** Whether to auto-add the current working directory to readwritePaths. Default: true. */ @JsonProperty("addCurrentWorkingDirectory") Boolean addCurrentWorkingDirectory ) { diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicy.java b/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicy.java index 193e1c43e..2755261c2 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicy.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicy.java @@ -25,7 +25,9 @@ public record SandboxConfigUserPolicy( @JsonProperty("filesystem") SandboxConfigUserPolicyFilesystem filesystem, /** Network rules to merge into the base policy. */ @JsonProperty("network") SandboxConfigUserPolicyNetwork network, - /** Platform-specific experimental policy fields. */ + /** macOS seatbelt options to merge into the base policy. */ + @JsonProperty("seatbelt") SandboxConfigUserPolicySeatbelt seatbelt, + /** Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent. */ @JsonProperty("experimental") SandboxConfigUserPolicyExperimental experimental ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicySeatbelt.java b/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicySeatbelt.java new file mode 100644 index 000000000..480b2fb9b --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SandboxConfigUserPolicySeatbelt.java @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * macOS seatbelt-specific options. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SandboxConfigUserPolicySeatbelt( + /** Whether the macOS seatbelt profile may access the keychain. */ + @JsonProperty("keychainAccess") Boolean keychainAccess +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/ScheduleEntry.java b/java/src/generated/java/com/github/copilot/generated/rpc/ScheduleEntry.java index f8d58ad77..5ffd0a7cd 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/ScheduleEntry.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/ScheduleEntry.java @@ -36,6 +36,8 @@ public record ScheduleEntry( @JsonProperty("prompt") String prompt, /** Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). */ @JsonProperty("recurring") Boolean recurring, + /** 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. */ + @JsonProperty("selfPaced") Boolean selfPaced, /** 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`. */ @JsonProperty("displayPrompt") String displayPrompt, /** ISO 8601 timestamp when the next tick is scheduled to fire. */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenResult.java index b15d95533..1d4e0bdf5 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionCanvasOpenResult.java @@ -39,10 +39,6 @@ public record SessionCanvasOpenResult( /** URL for web-rendered canvases */ @JsonProperty("url") String url, /** Input supplied when the instance was opened */ - @JsonProperty("input") Object input, - /** Whether this snapshot came from an idempotent reopen */ - @JsonProperty("reopen") Boolean reopen, - /** Runtime-controlled routing state for an open canvas instance. */ - @JsonProperty("availability") CanvasInstanceAvailability availability + @JsonProperty("input") Object input ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java index 95a081206..7b5e93c41 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthApi.java @@ -63,7 +63,7 @@ public CompletableFuture handlePendin } /** - * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. + * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginParams.java index 5fc47505c..d9234d558 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpOauthLoginParams.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. + * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 @@ -33,6 +33,14 @@ public record SessionMcpOauthLoginParams( /** 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. */ @JsonProperty("clientName") String clientName, /** 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. */ - @JsonProperty("callbackSuccessMessage") String callbackSuccessMessage + @JsonProperty("callbackSuccessMessage") String callbackSuccessMessage, + /** Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration. */ + @JsonProperty("clientId") String clientId, + /** 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. */ + @JsonProperty("clientSecret") String clientSecret, + /** 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. */ + @JsonProperty("publicClient") Boolean publicClient, + /** Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified. */ + @JsonProperty("grantType") McpOauthLoginGrantType grantType ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java index bedee9081..4479a3175 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionOptionsUpdateParams.java @@ -48,6 +48,8 @@ public record SessionOptionsUpdateParams( @JsonProperty("isExperimentalMode") Boolean isExperimentalMode, /** Custom model-provider configuration (BYOK). */ @JsonProperty("provider") ProviderConfig provider, + /** Options scoped to the built-in CAPI (Copilot API) provider. */ + @JsonProperty("capi") CapiSessionOptions capi, /** Absolute working-directory path for shell tools. */ @JsonProperty("workingDirectory") String workingDirectory, /** Allowlist of tool names available to this session. */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionProviderGetEndpointResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionProviderGetEndpointResult.java index 344af3a82..59ca8bca8 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionProviderGetEndpointResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionProviderGetEndpointResult.java @@ -29,6 +29,8 @@ public record SessionProviderGetEndpointResult( @JsonProperty("type") ProviderEndpointType type, /** Wire API to be used, when required for the provider type. */ @JsonProperty("wireApi") ProviderEndpointWireApi wireApi, + /** Transport to be used for provider requests. */ + @JsonProperty("transport") ProviderEndpointTransport transport, /** Base URL to pass to the LLM client library. */ @JsonProperty("baseUrl") String baseUrl, /** A credential the caller should use with this endpoint. Omitted only when the endpoint accepts unauthenticated requests. */ diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.java b/java/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.java index a2762954b..7cc33e3c5 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/WorkspaceDiffMode.java @@ -19,7 +19,9 @@ public enum WorkspaceDiffMode { /** The {@code unstaged} variant. */ UNSTAGED("unstaged"), /** The {@code branch} variant. */ - BRANCH("branch"); + BRANCH("branch"), + /** The {@code session} variant. */ + SESSION("session"); private final String value; WorkspaceDiffMode(String value) { this.value = value; } diff --git a/java/src/main/java/com/github/copilot/CopilotClient.java b/java/src/main/java/com/github/copilot/CopilotClient.java index 63b70e2df..1a4994189 100644 --- a/java/src/main/java/com/github/copilot/CopilotClient.java +++ b/java/src/main/java/com/github/copilot/CopilotClient.java @@ -875,6 +875,7 @@ CompletableFuture updateSessionOptionsForMode(CopilotSession session, Bool null, // featureFlags null, // isExperimentalMode null, // provider + null, // capi null, // workingDirectory null, // availableTools null, // excludedTools diff --git a/java/src/main/java/com/github/copilot/CopilotSession.java b/java/src/main/java/com/github/copilot/CopilotSession.java index adfeac013..90a2662d0 100644 --- a/java/src/main/java/com/github/copilot/CopilotSession.java +++ b/java/src/main/java/com/github/copilot/CopilotSession.java @@ -55,7 +55,6 @@ import com.github.copilot.generated.SessionErrorEvent; import com.github.copilot.generated.SessionEvent; import com.github.copilot.generated.SessionIdleEvent; -import com.github.copilot.generated.rpc.CanvasInstanceAvailability; import com.github.copilot.generated.rpc.OpenCanvasInstance; import com.github.copilot.rpc.AgentInfo; import com.github.copilot.rpc.AutoModeSwitchHandler; @@ -1454,13 +1453,12 @@ private void updateOpenCanvasesFromEvent(SessionEvent event) { if (event instanceof SessionCanvasOpenedEvent openedEvent) { var data = openedEvent.getData(); if (data == null || isNullOrEmpty(data.instanceId()) || isNullOrEmpty(data.canvasId()) - || isNullOrEmpty(data.extensionId()) || data.availability() == null) { + || isNullOrEmpty(data.extensionId())) { LOG.warning("failed to deserialize session.canvas.opened payload"); return; } upsertOpenCanvas(new OpenCanvasInstance(data.instanceId(), data.extensionId(), data.extensionName(), - data.canvasId(), data.title(), data.status(), data.url(), data.input(), data.reopen(), - CanvasInstanceAvailability.fromValue(data.availability().getValue()))); + data.canvasId(), data.title(), data.status(), data.url(), data.input())); } } diff --git a/java/src/test/java/com/github/copilot/SessionCanvasSnapshotTest.java b/java/src/test/java/com/github/copilot/SessionCanvasSnapshotTest.java index c977ef330..00db1d01c 100644 --- a/java/src/test/java/com/github/copilot/SessionCanvasSnapshotTest.java +++ b/java/src/test/java/com/github/copilot/SessionCanvasSnapshotTest.java @@ -15,12 +15,10 @@ import org.junit.jupiter.api.Test; import com.fasterxml.jackson.databind.ObjectMapper; -import com.github.copilot.generated.CanvasOpenedAvailability; import com.github.copilot.generated.SessionCanvasClosedEvent; import com.github.copilot.generated.SessionCanvasClosedEvent.SessionCanvasClosedEventData; import com.github.copilot.generated.SessionCanvasOpenedEvent; import com.github.copilot.generated.SessionCanvasOpenedEvent.SessionCanvasOpenedEventData; -import com.github.copilot.generated.rpc.CanvasInstanceAvailability; import com.github.copilot.generated.rpc.OpenCanvasInstance; import com.github.copilot.rpc.CreateSessionResponse; import com.github.copilot.rpc.ResumeSessionResponse; @@ -51,19 +49,18 @@ void startsEmpty() { @Test void openedUpsertsCanvases() { - session.dispatchEvent(openedEvent("inst-1", "canvas-a", CanvasOpenedAvailability.READY)); - session.dispatchEvent(openedEvent("inst-2", "canvas-b", CanvasOpenedAvailability.READY)); + session.dispatchEvent(openedEvent("inst-1", "canvas-a")); + session.dispatchEvent(openedEvent("inst-2", "canvas-b")); var canvases = session.getOpenCanvases(); assertEquals(2, canvases.size()); assertEquals(List.of("inst-1", "inst-2"), canvases.stream().map(OpenCanvasInstance::instanceId).toList()); - assertEquals(CanvasInstanceAvailability.READY, canvases.get(0).availability()); } @Test void closedRemovesMatchingCanvas() { - session.dispatchEvent(openedEvent("inst-1", "canvas-a", CanvasOpenedAvailability.READY)); - session.dispatchEvent(openedEvent("inst-2", "canvas-b", CanvasOpenedAvailability.READY)); + session.dispatchEvent(openedEvent("inst-1", "canvas-a")); + session.dispatchEvent(openedEvent("inst-2", "canvas-b")); session.dispatchEvent(closedEvent("inst-1")); @@ -74,7 +71,7 @@ void closedRemovesMatchingCanvas() { @Test void closedForAbsentInstanceIsNoOp() { - session.dispatchEvent(openedEvent("inst-1", "canvas-a", CanvasOpenedAvailability.READY)); + session.dispatchEvent(openedEvent("inst-1", "canvas-a")); session.dispatchEvent(closedEvent("does-not-exist")); @@ -85,7 +82,7 @@ void closedForAbsentInstanceIsNoOp() { @Test void closedWithEmptyInstanceIdIsNoOp() { - session.dispatchEvent(openedEvent("inst-1", "canvas-a", CanvasOpenedAvailability.READY)); + session.dispatchEvent(openedEvent("inst-1", "canvas-a")); session.dispatchEvent(closedEvent("")); session.dispatchEvent(closedEvent(null)); @@ -97,36 +94,35 @@ void closedWithEmptyInstanceIdIsNoOp() { @Test void openedWithMissingRequiredFieldsIsIgnored() { - session.dispatchEvent(openedEvent("", "canvas-a", CanvasOpenedAvailability.READY)); - session.dispatchEvent(openedEvent("inst-1", "", CanvasOpenedAvailability.READY)); - session.dispatchEvent(openedEvent("inst-1", "canvas-a", null)); + session.dispatchEvent(openedEvent("", "canvas-a")); + session.dispatchEvent(openedEvent("inst-1", "")); assertTrue(session.getOpenCanvases().isEmpty()); } @Test - void staleReemitReplacesInsteadOfDuplicating() { - session.dispatchEvent(openedEvent("inst-1", "canvas-a", CanvasOpenedAvailability.READY)); + void reemitReplacesInsteadOfDuplicating() { + session.dispatchEvent(openedEvent("inst-1", "canvas-a")); - // Provider unregister re-emits the same instance as "stale". - session.dispatchEvent(openedEvent("inst-1", "canvas-a", CanvasOpenedAvailability.STALE)); + // Provider re-emits the same instance id; it should replace, not duplicate. + session.dispatchEvent(openedEvent("inst-1", "canvas-a")); var canvases = session.getOpenCanvases(); assertEquals(1, canvases.size()); - assertEquals(CanvasInstanceAvailability.STALE, canvases.get(0).availability()); + assertEquals("inst-1", canvases.get(0).instanceId()); } @Test void getOpenCanvasesReturnsImmutableCopy() { - session.dispatchEvent(openedEvent("inst-1", "canvas-a", CanvasOpenedAvailability.READY)); + session.dispatchEvent(openedEvent("inst-1", "canvas-a")); var canvases = session.getOpenCanvases(); - assertThrows(UnsupportedOperationException.class, () -> canvases.add(new OpenCanvasInstance("x", "ext", null, - "c", null, null, null, null, null, CanvasInstanceAvailability.READY))); + assertThrows(UnsupportedOperationException.class, + () -> canvases.add(new OpenCanvasInstance("x", "ext", null, "c", null, null, null, null))); // The returned list is a point-in-time snapshot, not a live view: a // subsequent event must not change the previously-returned list. - session.dispatchEvent(openedEvent("inst-2", "canvas-b", CanvasOpenedAvailability.READY)); + session.dispatchEvent(openedEvent("inst-2", "canvas-b")); assertEquals(1, canvases.size()); assertEquals("inst-1", canvases.get(0).instanceId()); @@ -137,11 +133,9 @@ void getOpenCanvasesReturnsImmutableCopy() { @Test void setOpenCanvasesSeedsAndFiltersNulls() { var seed = new java.util.ArrayList(); - seed.add(new OpenCanvasInstance("inst-1", "ext", null, "canvas-a", null, null, null, null, null, - CanvasInstanceAvailability.READY)); + seed.add(new OpenCanvasInstance("inst-1", "ext", null, "canvas-a", null, null, null, null)); seed.add(null); - seed.add(new OpenCanvasInstance("inst-2", "ext", null, "canvas-b", null, null, null, null, null, - CanvasInstanceAvailability.STALE)); + seed.add(new OpenCanvasInstance("inst-2", "ext", null, "canvas-b", null, null, null, null)); session.setOpenCanvases(seed); @@ -152,7 +146,7 @@ void setOpenCanvasesSeedsAndFiltersNulls() { @Test void setOpenCanvasesWithNullClears() { - session.dispatchEvent(openedEvent("inst-1", "canvas-a", CanvasOpenedAvailability.READY)); + session.dispatchEvent(openedEvent("inst-1", "canvas-a")); session.setOpenCanvases(null); @@ -168,7 +162,7 @@ void createSessionResponseDeserializesOpenCanvases() throws Exception { "workspacePath": "/tmp/ws", "capabilities": {}, "openCanvases": [ - { "instanceId": "inst-1", "extensionId": "ext", "canvasId": "canvas-a", "availability": "ready" } + { "instanceId": "inst-1", "extensionId": "ext", "canvasId": "canvas-a" } ] } """; @@ -178,7 +172,6 @@ void createSessionResponseDeserializesOpenCanvases() throws Exception { assertNotNull(response.openCanvases()); assertEquals(1, response.openCanvases().size()); assertEquals("inst-1", response.openCanvases().get(0).instanceId()); - assertEquals(CanvasInstanceAvailability.READY, response.openCanvases().get(0).availability()); } @Test @@ -188,7 +181,7 @@ void resumeSessionResponseDeserializesOpenCanvases() throws Exception { { "sessionId": "abc", "openCanvases": [ - { "instanceId": "inst-1", "extensionId": "ext", "canvasId": "canvas-a", "availability": "stale" } + { "instanceId": "inst-1", "extensionId": "ext", "canvasId": "canvas-a" } ] } """; @@ -197,14 +190,13 @@ void resumeSessionResponseDeserializesOpenCanvases() throws Exception { assertNotNull(response.openCanvases()); assertEquals(1, response.openCanvases().size()); - assertEquals(CanvasInstanceAvailability.STALE, response.openCanvases().get(0).availability()); + assertEquals("inst-1", response.openCanvases().get(0).instanceId()); } - private static SessionCanvasOpenedEvent openedEvent(String instanceId, String canvasId, - CanvasOpenedAvailability availability) { + private static SessionCanvasOpenedEvent openedEvent(String instanceId, String canvasId) { var event = new SessionCanvasOpenedEvent(); event.setData(new SessionCanvasOpenedEventData(instanceId, "ext-id", "Ext Name", canvasId, "Title", "ok", null, - null, null, availability)); + null)); return event; } diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 30025d5bc..6cf1463a3 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.64-3", + "@github/copilot": "^1.0.65", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, @@ -699,9 +699,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.64-3.tgz", - "integrity": "sha512-Q9nBMYEHX1bJLXzzJocQx2nZvORJ0E9gvK6ly/FCtmtA7ad96BWZvf4EHzkCNDsn56aI3zNaUSfKHUKcmIAzSg==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.65.tgz", + "integrity": "sha512-J1XvLuOiVpiAi/E1MBICBymszCgdGLnZxokosXzGcmcjEVZd+QSDoW/kPRHq6oEyBT9SDASPcjCEZ9Q0rLJllg==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -710,20 +710,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.64-3", - "@github/copilot-darwin-x64": "1.0.64-3", - "@github/copilot-linux-arm64": "1.0.64-3", - "@github/copilot-linux-x64": "1.0.64-3", - "@github/copilot-linuxmusl-arm64": "1.0.64-3", - "@github/copilot-linuxmusl-x64": "1.0.64-3", - "@github/copilot-win32-arm64": "1.0.64-3", - "@github/copilot-win32-x64": "1.0.64-3" + "@github/copilot-darwin-arm64": "1.0.65", + "@github/copilot-darwin-x64": "1.0.65", + "@github/copilot-linux-arm64": "1.0.65", + "@github/copilot-linux-x64": "1.0.65", + "@github/copilot-linuxmusl-arm64": "1.0.65", + "@github/copilot-linuxmusl-x64": "1.0.65", + "@github/copilot-win32-arm64": "1.0.65", + "@github/copilot-win32-x64": "1.0.65" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.64-3.tgz", - "integrity": "sha512-wlV6mRoAd/wG2V08TG+BOJ0nyOjroya24FSyA5A49z7PnUUuQXYRpa/GljvI5j3PM8aUl0DyBkXuB/DcFU818g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.65.tgz", + "integrity": "sha512-NFc4xIstZNiIuAYkurQT5DVtbZjBoZ/z6yt/Ffcom7Y5QGjfpN4BFuekv9k+OADRioxxR99NgmhjbuNPWtQhNQ==", "cpu": [ "arm64" ], @@ -737,9 +737,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.64-3.tgz", - "integrity": "sha512-mk48PIESL2keeemX7tLRmWRDxKwl0q3cFI1ORD2QcrieNK7pSqI3eVbfoB7MqoUUI27yzIkl67xqgl8Qq28IUQ==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.65.tgz", + "integrity": "sha512-0wtV22KmTa12VbqWRRkgvJcBz/oIbszfcIpyDWGc4MzbCVksajQ3TWVQ6c7Sdzj5RifCaYdkHAX2zuIYXYlLoQ==", "cpu": [ "x64" ], @@ -753,9 +753,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.64-3.tgz", - "integrity": "sha512-rCgtK3/rofQW5StSbeU0TwDUlOl2bvS2HGKyapVxow1Nvz3Q/TDB+eFRQc5ocBdv5tNSor+Caw2JGkRx5v508w==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.65.tgz", + "integrity": "sha512-dOwdy/YbTXQN/+x2v4ZgiDycdRtWElyHxPuA6ail3yJDt0nagwn8OYAA/diBLPMAJuuBXiOZGvvb9fGRuh7Xgg==", "cpu": [ "arm64" ], @@ -769,9 +769,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.64-3.tgz", - "integrity": "sha512-FAiBMw1h07mURSBLi3ztj5yzbP+uTbo9mhxOym1Xysut5LDpO2kYUzTYk2DlIyLGZhmH/HDOZE+b6U7lOUQy0g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.65.tgz", + "integrity": "sha512-al/1a/l/GrpHtygTxt7PZspmv0eHBPdAZ5B31J7Hv/GRdVZM4STCC9dCIOSUFsOX2fhaKD8yLfz4HureSYs23g==", "cpu": [ "x64" ], @@ -785,9 +785,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.64-3.tgz", - "integrity": "sha512-vn8P6grPf0y2mNskkdVbAz0i46b1sP9uSXv7z6kgycjprl0CdIYPDf3WEkG60vpyopfQna+iCqCLMWRnNyCk3g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.65.tgz", + "integrity": "sha512-xccQeJSR45xyoaL7J5mZjtU++dmte+ZCDQkIlrpTn2yuMl2LWriBvorQ1P2MwVnXmIiW/GHi93B+lNtsybA9yw==", "cpu": [ "arm64" ], @@ -801,9 +801,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.64-3.tgz", - "integrity": "sha512-atdHimNd6nzRRwHybXUY6/84bYzXeKbDOeYN/N/DsX23+AQOPSu5BD8MD8166I/5kNHui0XOmeTSydVNBUwcJw==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.65.tgz", + "integrity": "sha512-RHPVUaqjSrhKHQ2EpfGKWErnV+R5elGIZaHXPKO10zpSaQD9b/C9u6nLigZnBuT/8sCaJpVrazPMwOYvYA62aw==", "cpu": [ "x64" ], @@ -817,9 +817,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.64-3.tgz", - "integrity": "sha512-jUTS9meoHEXQR8nMDOjwC0baqV273lYtLxY46W7TiOFszhsqhbhWxQMkNQBfT3GEfPp+40igzMPq3reaUTuvag==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.65.tgz", + "integrity": "sha512-/vSE/t9Wm3eFSWpxlKyn/oL8OAVOB0yFO7ECxhgbtiqNrBd1tgpYh1k7IXBIWa/saxlV1+de6DEmPuQfx3Z0bg==", "cpu": [ "arm64" ], @@ -833,9 +833,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.64-3.tgz", - "integrity": "sha512-gHUhS500Q91hjtH9fqKDblaIs0mO09G4ifpZ1woDPXbkdKe/W29uwB7g2fn0+KczNRyPxFSWlqjnOon4Fe8svA==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.65.tgz", + "integrity": "sha512-wjVWXepET+SpFg8z8V43ZiTy6X1OerCb7yu3QZKNNJ3zY9z20goihPXQCDWkiJpGzszNSgfrsiqUzpUsC9qS0A==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index ec528cc6c..d037ceefa 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.64-3", + "@github/copilot": "^1.0.65", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index ddcf5a8e2..34152796f 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,13 +18,14 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.64-3", + "@github/copilot": "^1.0.65", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, "devDependencies": { "@platformatic/vfs": "^0.3.0", "@types/node": "^25.2.0", + "@types/ws": "^8.18.1", "@typescript-eslint/eslint-plugin": "^8.54.0", "@typescript-eslint/parser": "^8.54.0", "esbuild": "^0.28.1", @@ -38,7 +39,8 @@ "semver": "^7.7.3", "tsx": "^4.20.6", "typescript": "^5.0.0", - "vitest": "^4.0.18" + "vitest": "^4.0.18", + "ws": "^8.21.0" }, "engines": { "node": "^20.19.0 || >=22.12.0" diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index df44de84c..38f77412d 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -209,18 +209,6 @@ export type AuthInfoType = | "token" /** Authentication from a Copilot API token. */ | "copilot-api-token"; -/** - * Runtime-controlled routing state for an open canvas instance. - * - * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema - * via the `definition` "CanvasInstanceAvailability". - */ -/** @experimental */ -export type CanvasInstanceAvailability = - /** The owning provider is currently connected and routing calls will be dispatched normally. */ - | "ready" - /** The owning provider is not currently connected. Routing calls fail with canvas_provider_unavailable until the agent re-issues open_canvas (which rehydrates via a fresh canvas.open) or the provider reconnects. */ - | "stale"; /** * Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command * @@ -723,6 +711,18 @@ export type McpOauthPendingRequestResponse = | { kind: "cancelled"; }; +/** + * OAuth grant type override for this login. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpOauthLoginGrantType". + */ +/** @experimental */ +export type McpOauthLoginGrantType = + /** Interactive browser-based OAuth flow using an authorization code, typically with PKCE. */ + | "authorization_code" + /** Headless OAuth flow where a confidential client authenticates directly with a client secret. */ + | "client_credentials"; /** * 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. * @@ -903,6 +903,18 @@ export type ProviderConfigWireApi = | "completions" /** OpenAI Responses API wire format. */ | "responses"; +/** + * Provider transport. Defaults to "http". + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ProviderConfigTransport". + */ +/** @experimental */ +export type ProviderConfigTransport = + /** HTTP request/streaming transport. */ + | "http" + /** WebSocket transport. */ + | "websockets"; /** * Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration. * @@ -1133,6 +1145,18 @@ export type ProviderEndpointWireApi = | "completions" /** Newer responses request shape. */ | "responses"; +/** + * Transport to be used for provider requests. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ProviderEndpointTransport". + */ +/** @experimental */ +export type ProviderEndpointTransport = + /** HTTP request/streaming transport. */ + | "http" + /** WebSocket transport. */ + | "websockets"; /** * Schema for the `PushAttachment` type. * @@ -1783,7 +1807,9 @@ export type WorkspaceDiffMode = /** Return staged, unstaged, and untracked working tree changes. */ | "unstaged" /** Return changes compared with the default branch. */ - | "branch"; + | "branch" + /** Return the cumulative diff of files Copilot changed this session (used in non-git workspaces). */ + | "session"; /** * Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. * @@ -2931,11 +2957,6 @@ export interface OpenCanvasInstance { input?: { [k: string]: unknown | undefined; }; - /** - * Whether this snapshot came from an idempotent reopen - */ - reopen: boolean; - availability: CanvasInstanceAvailability; } /** * Canvas open parameters. @@ -3095,6 +3116,19 @@ export interface CanvasProviderOpenResult { */ status?: string; } +/** + * Options scoped to the built-in CAPI (Copilot API) provider. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "CapiSessionOptions". + */ +/** @experimental */ +export interface 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. + */ + enableWebSocketResponses?: boolean; +} /** * Slash commands available in the session, after applying any include/exclude filters. * @@ -5673,7 +5707,7 @@ export interface McpOauthHandlePendingResult { success: boolean; } /** - * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. + * Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "McpOauthLoginRequest". @@ -5696,6 +5730,19 @@ export interface 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. */ callbackSuccessMessage?: string; + /** + * Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration. + */ + clientId?: string; + /** + * 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. + */ + clientSecret?: string; + /** + * 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. + */ + publicClient?: boolean; + grantType?: McpOauthLoginGrantType; } /** * OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. @@ -6578,6 +6625,7 @@ export interface NamedProviderConfig { name: string; type?: ProviderConfigType; wireApi?: ProviderConfigWireApi; + transport?: ProviderConfigTransport; /** * API endpoint URL. */ @@ -6597,6 +6645,10 @@ export interface NamedProviderConfig { headers?: { [k: string]: string | undefined; }; + /** + * 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 ` 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. + */ + hasBearerTokenProvider?: boolean; } /** * Azure-specific provider options. @@ -8536,6 +8588,7 @@ export interface ProviderAddResult { export interface ProviderConfig { type?: ProviderConfigType; wireApi?: ProviderConfigWireApi; + transport?: ProviderConfigTransport; /** * API endpoint URL. */ @@ -8575,6 +8628,10 @@ export interface ProviderConfig { headers?: { [k: string]: string | undefined; }; + /** + * 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 ` 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. + */ + hasBearerTokenProvider?: boolean; } /** * A snapshot of the provider endpoint the session is currently configured to talk to. @@ -8586,6 +8643,7 @@ export interface ProviderConfig { export interface ProviderEndpoint { type: ProviderEndpointType; wireApi?: ProviderEndpointWireApi; + transport?: ProviderEndpointTransport; /** * Base URL to pass to the LLM client library. */ @@ -8640,6 +8698,36 @@ export interface ProviderGetEndpointRequest { */ modelId?: string; } +/** + * 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. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ProviderTokenAcquireRequest". + */ +/** @experimental */ +export interface ProviderTokenAcquireRequest { + /** + * Target session identifier + */ + sessionId: string; + /** + * 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`. + */ + providerName: string; +} +/** + * A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer ` on the outbound request and does no caching; the SDK consumer owns token caching and refresh. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ProviderTokenAcquireResult". + */ +/** @experimental */ +export interface ProviderTokenAcquireResult { + /** + * The bearer token value (without the `Bearer ` prefix). + */ + token: string; +} /** * File attachment * @@ -9313,12 +9401,6 @@ export interface SandboxConfig { */ enabled: boolean; userPolicy?: SandboxConfigUserPolicy; - /** - * Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to `spawnSandboxFromConfig`, bypassing policy merging. - */ - config?: { - [k: string]: unknown | undefined; - }; /** * Whether to auto-add the current working directory to readwritePaths. Default: true. */ @@ -9334,6 +9416,7 @@ export interface SandboxConfig { export interface SandboxConfigUserPolicy { filesystem?: SandboxConfigUserPolicyFilesystem; network?: SandboxConfigUserPolicyNetwork; + seatbelt?: SandboxConfigUserPolicySeatbelt; experimental?: SandboxConfigUserPolicyExperimental; } /** @@ -9386,6 +9469,19 @@ export interface SandboxConfigUserPolicyNetwork { */ blockedHosts?: string[]; } +/** + * macOS seatbelt-specific options. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SandboxConfigUserPolicySeatbelt". + */ +/** @experimental */ +export interface SandboxConfigUserPolicySeatbelt { + /** + * Whether the macOS seatbelt profile may access the keychain. + */ + keychainAccess?: boolean; +} /** * Platform-specific experimental policy fields. * @@ -9445,6 +9541,10 @@ export interface ScheduleEntry { * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). */ recurring: boolean; + /** + * 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. + */ + selfPaced?: boolean; /** * 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`. */ @@ -10453,6 +10553,7 @@ export interface SessionOpenOptions { isExperimentalMode?: boolean; authInfo?: AuthInfo; provider?: ProviderConfig; + capi?: CapiSessionOptions; /** * Named BYOK provider connections, additive to CAPI auth. Combining with `provider` is rejected. * @@ -11447,6 +11548,7 @@ export interface SessionUpdateOptionsParams { */ isExperimentalMode?: boolean; provider?: ProviderConfig; + capi?: CapiSessionOptions; /** * Absolute working-directory path for shell tools. */ @@ -14908,7 +15010,7 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** * Starts OAuth authentication for a remote MCP server. * - * @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. + * @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. * * @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server. */ @@ -15792,6 +15894,19 @@ export function createInternalSessionRpc(connection: MessageConnection, sessionI }; } +/** Handler for `providerToken` client session API methods. */ +/** @experimental */ +export interface ProviderTokenHandler { + /** + * 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. + * + * @param params 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. + * + * @returns A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer ` on the outbound request and does no caching; the SDK consumer owns token caching and refresh. + */ + getToken(params: ProviderTokenAcquireRequest): Promise; +} + /** Handler for `sessionFs` client session API methods. */ /** @experimental */ export interface SessionFsHandler { @@ -15922,6 +16037,7 @@ export interface CanvasHandler { /** All client session API handler groups. */ export interface ClientSessionApiHandlers { + providerToken?: ProviderTokenHandler; sessionFs?: SessionFsHandler; canvas?: CanvasHandler; } @@ -15936,6 +16052,11 @@ export function registerClientSessionApiHandlers( connection: MessageConnection, getHandlers: (sessionId: string) => ClientSessionApiHandlers, ): void { + connection.onRequest("providerToken.getToken", async (params: ProviderTokenAcquireRequest) => { + const handler = getHandlers(params.sessionId).providerToken; + if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`); + return handler.getToken(params); + }); connection.onRequest("sessionFs.readFile", async (params: SessionFsReadFileRequest) => { const handler = getHandlers(params.sessionId).sessionFs; if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`); diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index d4faf7d4b..96a3bddac 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -15,6 +15,7 @@ export type SessionEvent = | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent + | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent @@ -96,6 +97,9 @@ export type SessionEvent = | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent + | CanvasUnavailableEvent + | CanvasRecordedEvent + | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent; /** @@ -615,14 +619,6 @@ export type ExtensionsLoadedExtensionStatus = | "failed" /** The extension process is starting. */ | "starting"; -/** - * Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. - */ -export type CanvasOpenedAvailability = - /** Provider connection is live; actions can be invoked. */ - | "ready" - /** Provider has gone away; the instance is awaiting rebinding. */ - | "stale"; /** * Session event "session.start". Session initialization metadata including context and configuration @@ -1066,6 +1062,10 @@ export interface ScheduleCreatedData { * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) */ recurring?: boolean; + /** + * True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed. + */ + selfPaced?: boolean; /** * IANA timezone the `cron` expression is evaluated in */ @@ -1110,6 +1110,49 @@ export interface ScheduleCancelledData { */ id: number; } +/** + * Session event "session.schedule_rearmed". Self-paced schedule re-armed for its next run + */ +export interface ScheduleRearmedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: ScheduleRearmedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.schedule_rearmed". + */ + type: "session.schedule_rearmed"; +} +/** + * Self-paced schedule re-armed for its next run + */ +export interface ScheduleRearmedData { + /** + * Id of the self-paced schedule that was re-armed + */ + id: number; + /** + * Absolute time (epoch milliseconds) the model armed the next run to fire + */ + nextRunAt: number; +} /** * Session event "session.autopilot_objective_changed". Autopilot objective state file operation details indicating what changed */ @@ -2096,6 +2139,10 @@ export interface CompactionCompleteData { * Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call */ serviceRequestId?: string; + /** + * For failed compaction only: the HTTP status code of the compaction LLM call failure, when it carried one. Absent for successful compaction and for failures without an HTTP status (e.g. an empty model response or a transport error). + */ + statusCode?: number; /** * Whether compaction completed successfully */ @@ -2330,6 +2377,10 @@ export interface AttachmentFile { * Absolute file path */ path: string; + /** + * Frozen rendered line this attachment contributed to the prompt block (e.g. "* /path (123 lines)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. Present only for attachments routed to (mutually exclusive with assetId, which marks bytes sent natively). + */ + taggedFilesEntry?: string; /** * Attachment type discriminator */ @@ -2360,6 +2411,10 @@ export interface AttachmentDirectory { * Absolute directory path */ path: string; + /** + * Frozen rendered line this attachment contributed to the prompt block (e.g. "* /path (12 items)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. + */ + taggedFilesEntry?: string; /** * Attachment type discriminator */ @@ -3331,6 +3386,12 @@ export interface AssistantUsageQuotaSnapshot { * @internal */ entitlementRequests: number; + /** + * Whether the user currently has quota available for use + * + * @internal + */ + hasQuota?: boolean; /** * Whether the user has an unlimited usage entitlement * @@ -3349,6 +3410,12 @@ export interface AssistantUsageQuotaSnapshot { * @internal */ overageAllowedWithExhaustedQuota: boolean; + /** + * Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value + * + * @internal + */ + overageEntitlement?: number; /** * Percentage of quota remaining (0 to 100) * @@ -3361,6 +3428,12 @@ export interface AssistantUsageQuotaSnapshot { * @internal */ resetDate?: string; + /** + * Whether this snapshot uses token-based billing (AI-credits allocation) + * + * @internal + */ + tokenBasedBilling?: boolean; /** * Whether usage is still permitted after quota exhaustion * @@ -3441,6 +3514,14 @@ export interface ModelCallFailureData { * GitHub request tracing ID (x-github-request-id header) for server-side log correlation */ providerCallId?: string; + /** + * Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure. + * + * @internal + */ + quotaSnapshots?: { + [k: string]: AssistantUsageQuotaSnapshot | undefined; + }; requestFingerprint?: ModelCallFailureRequestFingerprint; /** * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation @@ -5142,6 +5223,14 @@ export interface PermissionRequestShell { * URLs that may be accessed by the command */ possibleUrls: PermissionRequestShellPossibleUrl[]; + /** + * True when the model has requested to run this command outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + */ + requestSandboxBypass?: boolean; + /** + * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + */ + requestSandboxBypassReason?: string; /** * Tool call ID that triggered this permission request */ @@ -7399,6 +7488,7 @@ export interface ExtensionsLoadedExtension { /** * Session event "session.canvas.opened". */ +/** @experimental */ export interface CanvasOpenedEvent { /** * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. @@ -7429,8 +7519,8 @@ export interface CanvasOpenedEvent { /** * Schema for the `CanvasOpenedData` type. */ +/** @experimental */ export interface CanvasOpenedData { - availability: CanvasOpenedAvailability; /** * Provider-local canvas identifier */ @@ -7453,10 +7543,6 @@ export interface CanvasOpenedData { * Stable caller-supplied canvas instance identifier */ instanceId: string; - /** - * Whether this notification represents an idempotent reopen - */ - reopen: boolean; /** * Provider-supplied status text */ @@ -7473,6 +7559,7 @@ export interface CanvasOpenedData { /** * Session event "session.canvas.registry_changed". */ +/** @experimental */ export interface CanvasRegistryChangedEvent { /** * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. @@ -7503,6 +7590,7 @@ export interface CanvasRegistryChangedEvent { /** * Schema for the `CanvasRegistryChangedData` type. */ +/** @experimental */ export interface CanvasRegistryChangedData { /** * Canvas declarations currently available @@ -7512,6 +7600,7 @@ export interface CanvasRegistryChangedData { /** * Schema for the `CanvasRegistryChangedCanvas` type. */ +/** @experimental */ export interface CanvasRegistryChangedCanvas { /** * Actions the agent or host may invoke @@ -7547,6 +7636,7 @@ export interface CanvasRegistryChangedCanvas { /** * Schema for the `CanvasRegistryChangedCanvasAction` type. */ +/** @experimental */ export interface CanvasRegistryChangedCanvasAction { /** * Action description @@ -7566,6 +7656,7 @@ export interface CanvasRegistryChangedCanvasAction { /** * Session event "session.canvas.closed". */ +/** @experimental */ export interface CanvasClosedEvent { /** * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. @@ -7596,6 +7687,7 @@ export interface CanvasClosedEvent { /** * Schema for the `CanvasClosedData` type. */ +/** @experimental */ export interface CanvasClosedData { /** * Provider-local canvas identifier @@ -7610,6 +7702,163 @@ export interface CanvasClosedData { */ instanceId: string; } +/** + * Session event "session.canvas.unavailable". Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume. + */ +/** @experimental */ +export interface CanvasUnavailableEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasUnavailableData; + /** + * Always true for events that are transient and not persisted to the session event log on disk. + */ + ephemeral: true; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.unavailable". + */ + type: "session.canvas.unavailable"; +} +/** + * Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume. + */ +/** @experimental */ +export interface CanvasUnavailableData { + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Stable caller-supplied identifier of the canvas instance whose provider became unavailable + */ + instanceId: string; +} +/** + * Session event "session.canvas.recorded". Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability. + */ +/** @experimental */ +export interface CanvasRecordedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasRecordedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.recorded". + */ + type: "session.canvas.recorded"; +} +/** + * Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability. + */ +/** @experimental */ +export interface CanvasRecordedData { + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Input supplied when the instance was opened + */ + input?: { + [k: string]: unknown | undefined; + }; + /** + * Stable caller-supplied canvas instance identifier + */ + instanceId: string; + /** + * Rendered title + */ + title?: string; +} +/** + * Session event "session.canvas.removed". Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. + */ +/** @experimental */ +export interface CanvasRemovedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: CanvasRemovedData; + /** + * When true, the event is transient and not persisted to the session event log on disk + */ + ephemeral?: boolean; + /** + * Unique event identifier (UUID v4), generated when the event is emitted + */ + id: string; + /** + * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event. + */ + parentId: string | null; + /** + * ISO 8601 timestamp when the event was created + */ + timestamp: string; + /** + * Type discriminator. Always "session.canvas.removed". + */ + type: "session.canvas.removed"; +} +/** + * Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. + */ +/** @experimental */ +export interface CanvasRemovedData { + /** + * Provider-local canvas identifier + */ + canvasId: string; + /** + * Owning provider identifier + */ + extensionId: string; + /** + * Stable caller-supplied identifier of the canvas instance that was closed + */ + instanceId: string; +} /** * Session event "session.extensions.attachments_pushed". */ diff --git a/nodejs/src/session.ts b/nodejs/src/session.ts index 0ba42ab76..83effdef7 100644 --- a/nodejs/src/session.ts +++ b/nodejs/src/session.ts @@ -82,9 +82,7 @@ function isOpenCanvasInstance(value: unknown): value is OpenCanvasInstance { typeof instance.extensionId === "string" && instance.extensionId.length > 0 && typeof instance.canvasId === "string" && - instance.canvasId.length > 0 && - typeof instance.reopen === "boolean" && - (instance.availability === "ready" || instance.availability === "stale") + instance.canvasId.length > 0 ); } diff --git a/nodejs/test/client.test.ts b/nodejs/test/client.test.ts index 8b24199ab..96d7da30c 100644 --- a/nodejs/test/client.test.ts +++ b/nodejs/test/client.test.ts @@ -378,8 +378,6 @@ describe("CopilotClient", () => { status: "ready", url: "https://example.test/counter", input: { seed: 1 }, - reopen: false, - availability: "ready", }, }); (session as any)._dispatchEvent({ @@ -389,8 +387,6 @@ describe("CopilotClient", () => { canvasId: "logs", instanceId: "logs-1", title: "Logs", - reopen: false, - availability: "stale", }, }); @@ -411,8 +407,6 @@ describe("CopilotClient", () => { status: "reconnected", url: "https://example.test/counter-updated", input: { seed: 2 }, - reopen: true, - availability: "stale", }, }); @@ -423,8 +417,6 @@ describe("CopilotClient", () => { status: "reconnected", url: "https://example.test/counter-updated", input: { seed: 2 }, - reopen: true, - availability: "stale", }); expect(session.openCanvases[1].instanceId).toBe("logs-1"); warn.mockRestore(); @@ -441,8 +433,6 @@ describe("CopilotClient", () => { canvasId: "counter", instanceId: "counter-1", title: "Counter", - reopen: false, - availability: "ready", }, }); (session as any)._dispatchEvent({ @@ -452,8 +442,6 @@ describe("CopilotClient", () => { canvasId: "logs", instanceId: "logs-1", title: "Logs", - reopen: false, - availability: "ready", }, }); expect(session.openCanvases.map((canvas) => canvas.instanceId)).toEqual([ diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 6b46e465f..b38c12ff3 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -704,11 +704,63 @@ def to_dict(self) -> dict: return result # Experimental: this type is part of an experimental API and may change or be removed. -class CanvasInstanceAvailability(Enum): - """Runtime-controlled routing state for an open canvas instance.""" +@dataclass +class OpenCanvasInstance: + """Open canvas instance snapshot.""" + + canvas_id: str + """Provider-local canvas identifier""" + + extension_id: str + """Owning provider identifier""" + + instance_id: str + """Stable caller-supplied canvas instance identifier""" + + extension_name: str | None = None + """Owning extension display name, when available""" + + input: Any = None + """Input supplied when the instance was opened""" + + status: str | None = None + """Provider-supplied status text""" + + title: str | None = None + """Rendered title""" + + url: str | None = None + """URL for web-rendered canvases""" + + @staticmethod + def from_dict(obj: Any) -> 'OpenCanvasInstance': + assert isinstance(obj, dict) + canvas_id = from_str(obj.get("canvasId")) + extension_id = from_str(obj.get("extensionId")) + instance_id = from_str(obj.get("instanceId")) + extension_name = from_union([from_str, from_none], obj.get("extensionName")) + input = obj.get("input") + status = from_union([from_str, from_none], obj.get("status")) + title = from_union([from_str, from_none], obj.get("title")) + url = from_union([from_str, from_none], obj.get("url")) + return OpenCanvasInstance(canvas_id, extension_id, instance_id, extension_name, input, status, title, url) - READY = "ready" - STALE = "stale" + def to_dict(self) -> dict: + result: dict = {} + result["canvasId"] = from_str(self.canvas_id) + result["extensionId"] = from_str(self.extension_id) + result["instanceId"] = from_str(self.instance_id) + if self.extension_name is not None: + result["extensionName"] = from_union([from_str, from_none], self.extension_name) + if self.input is not None: + result["input"] = self.input + if self.status is not None: + result["status"] = from_union([from_str, from_none], self.status) + if self.title is not None: + result["title"] = from_union([from_str, from_none], self.title) + if self.url is not None: + result["url"] = from_union([from_str, from_none], self.url) + return result # Experimental: this type is part of an experimental API and may change or be removed. @dataclass @@ -799,6 +851,31 @@ def to_dict(self) -> dict: result["url"] = from_union([from_str, from_none], self.url) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class CapiSessionOptions: + """Options scoped to the built-in CAPI (Copilot API) provider.""" + + enable_web_socket_responses: bool | None = None + """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. + """ + + @staticmethod + def from_dict(obj: Any) -> 'CapiSessionOptions': + assert isinstance(obj, dict) + enable_web_socket_responses = from_union([from_bool, from_none], obj.get("enableWebSocketResponses")) + return CapiSessionOptions(enable_web_socket_responses) + + def to_dict(self) -> dict: + result: dict = {} + if self.enable_web_socket_responses is not None: + result["enableWebSocketResponses"] = from_union([from_bool, from_none], self.enable_web_socket_responses) + return result + # Experimental: this type is part of an experimental API and may change or be removed. class SlashCommandInputCompletion(Enum): """Optional completion hint for the input (e.g. 'directory' for filesystem path completion)""" @@ -2694,9 +2771,15 @@ class MCPServerConfigDeferTools(Enum): AUTO = "auto" NEVER = "never" -class MCPServerConfigHTTPOauthGrantType(Enum): - """OAuth grant type to use when authenticating to the remote MCP server.""" +# Experimental: this type is part of an experimental API and may change or be removed. +class MCPGrantType(Enum): + """OAuth grant type to use when authenticating to the remote MCP server. + + OAuth grant type override for this login. + Optional OAuth grant type override for this login. Defaults to the server configuration, + or authorization_code when no grant type is specified. + """ AUTHORIZATION_CODE = "authorization_code" CLIENT_CREDENTIALS = "client_credentials" @@ -3024,53 +3107,6 @@ def to_dict(self) -> dict: result["success"] = from_bool(self.success) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class MCPOauthLoginRequest: - """Remote MCP server name and optional overrides controlling reauthentication, OAuth client - display name, and the callback success-page copy. - """ - server_name: str - """Name of the remote MCP server to authenticate""" - - callback_success_message: str | None = None - """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. - """ - client_name: str | None = None - """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. - """ - force_reauth: bool | None = None - """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. - """ - - @staticmethod - def from_dict(obj: Any) -> 'MCPOauthLoginRequest': - assert isinstance(obj, dict) - server_name = from_str(obj.get("serverName")) - callback_success_message = from_union([from_str, from_none], obj.get("callbackSuccessMessage")) - client_name = from_union([from_str, from_none], obj.get("clientName")) - force_reauth = from_union([from_bool, from_none], obj.get("forceReauth")) - return MCPOauthLoginRequest(server_name, callback_success_message, client_name, force_reauth) - - def to_dict(self) -> dict: - result: dict = {} - result["serverName"] = from_str(self.server_name) - if self.callback_success_message is not None: - result["callbackSuccessMessage"] = from_union([from_str, from_none], self.callback_success_message) - if self.client_name is not None: - result["clientName"] = from_union([from_str, from_none], self.client_name) - if self.force_reauth is not None: - result["forceReauth"] = from_union([from_bool, from_none], self.force_reauth) - return result - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPOauthLoginResult: @@ -3881,6 +3917,15 @@ def to_dict(self) -> dict: result["apiVersion"] = from_union([from_str, from_none], self.api_version) return result +# Experimental: this type is part of an experimental API and may change or be removed. +class ProviderTransport(Enum): + """Provider transport. Defaults to "http". + + Transport to be used for provider requests. + """ + HTTP = "http" + WEBSOCKETS = "websockets" + # Experimental: this type is part of an experimental API and may change or be removed. class ProviderType(Enum): """Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. @@ -5150,6 +5195,27 @@ def to_dict(self) -> dict: result["model"] = from_union([from_str, from_none], self.model) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ProviderTokenAcquireResult: + """A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as + `Authorization: Bearer ` on the outbound request and does no caching; the SDK + consumer owns token caching and refresh. + """ + token: str + """The bearer token value (without the `Bearer ` prefix).""" + + @staticmethod + def from_dict(obj: Any) -> 'ProviderTokenAcquireResult': + assert isinstance(obj, dict) + token = from_str(obj.get("token")) + return ProviderTokenAcquireResult(token) + + def to_dict(self) -> dict: + result: dict = {} + result["token"] = from_str(self.token) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class PushAttachmentFileLineRange: @@ -5762,6 +5828,28 @@ def to_dict(self) -> dict: result["blockedHosts"] = from_union([lambda x: from_list(from_str, x), from_none], self.blocked_hosts) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SandboxConfigUserPolicySeatbelt: + """macOS seatbelt options to merge into the base policy. + + macOS seatbelt-specific options. + """ + keychain_access: bool | None = None + """Whether the macOS seatbelt profile may access the keychain.""" + + @staticmethod + def from_dict(obj: Any) -> 'SandboxConfigUserPolicySeatbelt': + assert isinstance(obj, dict) + keychain_access = from_union([from_bool, from_none], obj.get("keychainAccess")) + return SandboxConfigUserPolicySeatbelt(keychain_access) + + def to_dict(self) -> dict: + result: dict = {} + if self.keychain_access is not None: + result["keychainAccess"] = from_union([from_bool, from_none], self.keychain_access) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ScheduleEntry: @@ -5795,6 +5883,10 @@ class ScheduleEntry: interval_ms: int | None = None """Interval between scheduled ticks, in milliseconds (relative-interval schedules).""" + self_paced: bool | None = None + """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. + """ tz: str | None = None """IANA timezone the `cron` expression is evaluated in.""" @@ -5809,8 +5901,9 @@ def from_dict(obj: Any) -> 'ScheduleEntry': cron = from_union([from_str, from_none], obj.get("cron")) display_prompt = from_union([from_str, from_none], obj.get("displayPrompt")) interval_ms = from_union([from_int, from_none], obj.get("intervalMs")) + self_paced = from_union([from_bool, from_none], obj.get("selfPaced")) tz = from_union([from_str, from_none], obj.get("tz")) - return ScheduleEntry(id, next_run_at, prompt, recurring, at, cron, display_prompt, interval_ms, tz) + return ScheduleEntry(id, next_run_at, prompt, recurring, at, cron, display_prompt, interval_ms, self_paced, tz) def to_dict(self) -> dict: result: dict = {} @@ -5826,6 +5919,8 @@ def to_dict(self) -> dict: result["displayPrompt"] = from_union([from_str, from_none], self.display_prompt) if self.interval_ms is not None: result["intervalMs"] = from_union([from_int, from_none], self.interval_ms) + if self.self_paced is not None: + result["selfPaced"] = from_union([from_bool, from_none], self.self_paced) if self.tz is not None: result["tz"] = from_union([from_str, from_none], self.tz) return result @@ -8890,6 +8985,7 @@ class WorkspaceDiffMode(Enum): Effective mode used for the returned changes. """ BRANCH = "branch" + SESSION = "session" UNSTAGED = "unstaged" # Experimental: this type is part of an experimental API and may change or be removed. @@ -9345,71 +9441,21 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass -class OpenCanvasInstance: - """Open canvas instance snapshot.""" - - availability: CanvasInstanceAvailability - """Runtime-controlled routing state for an open canvas instance.""" - - canvas_id: str - """Provider-local canvas identifier""" - - extension_id: str - """Owning provider identifier""" - - instance_id: str - """Stable caller-supplied canvas instance identifier""" - - reopen: bool - """Whether this snapshot came from an idempotent reopen""" - - extension_name: str | None = None - """Owning extension display name, when available""" - - input: Any = None - """Input supplied when the instance was opened""" - - status: str | None = None - """Provider-supplied status text""" - - title: str | None = None - """Rendered title""" +class CanvasListOpenResult: + """Live open-canvas snapshot.""" - url: str | None = None - """URL for web-rendered canvases""" + open_canvases: list[OpenCanvasInstance] + """Currently open canvas instances""" @staticmethod - def from_dict(obj: Any) -> 'OpenCanvasInstance': + def from_dict(obj: Any) -> 'CanvasListOpenResult': assert isinstance(obj, dict) - availability = CanvasInstanceAvailability(obj.get("availability")) - canvas_id = from_str(obj.get("canvasId")) - extension_id = from_str(obj.get("extensionId")) - instance_id = from_str(obj.get("instanceId")) - reopen = from_bool(obj.get("reopen")) - extension_name = from_union([from_str, from_none], obj.get("extensionName")) - input = obj.get("input") - status = from_union([from_str, from_none], obj.get("status")) - title = from_union([from_str, from_none], obj.get("title")) - url = from_union([from_str, from_none], obj.get("url")) - return OpenCanvasInstance(availability, canvas_id, extension_id, instance_id, reopen, extension_name, input, status, title, url) + open_canvases = from_list(OpenCanvasInstance.from_dict, obj.get("openCanvases")) + return CanvasListOpenResult(open_canvases) def to_dict(self) -> dict: result: dict = {} - result["availability"] = to_enum(CanvasInstanceAvailability, self.availability) - result["canvasId"] = from_str(self.canvas_id) - result["extensionId"] = from_str(self.extension_id) - result["instanceId"] = from_str(self.instance_id) - result["reopen"] = from_bool(self.reopen) - if self.extension_name is not None: - result["extensionName"] = from_union([from_str, from_none], self.extension_name) - if self.input is not None: - result["input"] = self.input - if self.status is not None: - result["status"] = from_union([from_str, from_none], self.status) - if self.title is not None: - result["title"] = from_union([from_str, from_none], self.title) - if self.url is not None: - result["url"] = from_union([from_str, from_none], self.url) + result["openCanvases"] = from_list(lambda x: to_class(OpenCanvasInstance, x), self.open_canvases) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -11039,6 +11085,83 @@ def to_dict(self) -> dict: result["tools"] = from_union([lambda x: from_list(from_str, x), from_none], self.tools) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPOauthLoginRequest: + """Remote MCP server name and optional overrides controlling reauthentication, OAuth client + display name, callback success-page copy, and static OAuth client selection. + """ + server_name: str + """Name of the remote MCP server to authenticate""" + + callback_success_message: str | None = None + """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. + """ + client_id: str | None = None + """Optional OAuth client ID override for this login. When set, the runtime uses this + pre-registered static client instead of dynamic client registration. + """ + client_name: str | None = None + """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. + """ + client_secret: str | None = None + """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. + """ + force_reauth: bool | None = None + """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. + """ + grant_type: MCPGrantType | None = None + """Optional OAuth grant type override for this login. Defaults to the server configuration, + or authorization_code when no grant type is specified. + """ + public_client: bool | None = None + """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. + """ + + @staticmethod + def from_dict(obj: Any) -> 'MCPOauthLoginRequest': + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + callback_success_message = from_union([from_str, from_none], obj.get("callbackSuccessMessage")) + client_id = from_union([from_str, from_none], obj.get("clientId")) + client_name = from_union([from_str, from_none], obj.get("clientName")) + client_secret = from_union([from_str, from_none], obj.get("clientSecret")) + force_reauth = from_union([from_bool, from_none], obj.get("forceReauth")) + grant_type = from_union([MCPGrantType, from_none], obj.get("grantType")) + public_client = from_union([from_bool, from_none], obj.get("publicClient")) + return MCPOauthLoginRequest(server_name, callback_success_message, client_id, client_name, client_secret, force_reauth, grant_type, public_client) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + if self.callback_success_message is not None: + result["callbackSuccessMessage"] = from_union([from_str, from_none], self.callback_success_message) + if self.client_id is not None: + result["clientId"] = from_union([from_str, from_none], self.client_id) + if self.client_name is not None: + result["clientName"] = from_union([from_str, from_none], self.client_name) + if self.client_secret is not None: + result["clientSecret"] = from_union([from_str, from_none], self.client_secret) + if self.force_reauth is not None: + result["forceReauth"] = from_union([from_bool, from_none], self.force_reauth) + if self.grant_type is not None: + result["grantType"] = from_union([lambda x: to_enum(MCPGrantType, x), from_none], self.grant_type) + if self.public_client is not None: + result["publicClient"] = from_union([from_bool, from_none], self.public_client) + return result + @dataclass class MCPServerConfig: """MCP server configuration (stdio process or remote HTTP/SSE) @@ -11089,7 +11212,7 @@ class MCPServerConfig: oauth_client_id: str | None = None """OAuth client ID for a pre-registered remote MCP OAuth client.""" - oauth_grant_type: MCPServerConfigHTTPOauthGrantType | None = None + oauth_grant_type: MCPGrantType | None = None """OAuth grant type to use when authenticating to the remote MCP server.""" oauth_public_client: bool | None = None @@ -11117,7 +11240,7 @@ def from_dict(obj: Any) -> 'MCPServerConfig': tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("tools")) headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("headers")) oauth_client_id = from_union([from_str, from_none], obj.get("oauthClientId")) - oauth_grant_type = from_union([MCPServerConfigHTTPOauthGrantType, from_none], obj.get("oauthGrantType")) + oauth_grant_type = from_union([MCPGrantType, from_none], obj.get("oauthGrantType")) oauth_public_client = from_union([from_bool, from_none], obj.get("oauthPublicClient")) type = from_union([MCPServerConfigHTTPType, from_none], obj.get("type")) url = from_union([from_str, from_none], obj.get("url")) @@ -11152,7 +11275,7 @@ def to_dict(self) -> dict: if self.oauth_client_id is not None: result["oauthClientId"] = from_union([from_str, from_none], self.oauth_client_id) if self.oauth_grant_type is not None: - result["oauthGrantType"] = from_union([lambda x: to_enum(MCPServerConfigHTTPOauthGrantType, x), from_none], self.oauth_grant_type) + result["oauthGrantType"] = from_union([lambda x: to_enum(MCPGrantType, x), from_none], self.oauth_grant_type) if self.oauth_public_client is not None: result["oauthPublicClient"] = from_union([from_bool, from_none], self.oauth_public_client) if self.type is not None: @@ -11189,7 +11312,7 @@ class MCPServerConfigHTTP: oauth_client_id: str | None = None """OAuth client ID for a pre-registered remote MCP OAuth client.""" - oauth_grant_type: MCPServerConfigHTTPOauthGrantType | None = None + oauth_grant_type: MCPGrantType | None = None """OAuth grant type to use when authenticating to the remote MCP server.""" oauth_public_client: bool | None = None @@ -11217,7 +11340,7 @@ def from_dict(obj: Any) -> 'MCPServerConfigHTTP': headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("headers")) is_default_server = from_union([from_bool, from_none], obj.get("isDefaultServer")) oauth_client_id = from_union([from_str, from_none], obj.get("oauthClientId")) - oauth_grant_type = from_union([MCPServerConfigHTTPOauthGrantType, from_none], obj.get("oauthGrantType")) + oauth_grant_type = from_union([MCPGrantType, from_none], obj.get("oauthGrantType")) oauth_public_client = from_union([from_bool, from_none], obj.get("oauthPublicClient")) oidc = from_union([from_bool, MCPServerAuthConfigRedirectPort.from_dict, from_none], obj.get("oidc")) timeout = from_union([from_int, from_none], obj.get("timeout")) @@ -11241,7 +11364,7 @@ def to_dict(self) -> dict: if self.oauth_client_id is not None: result["oauthClientId"] = from_union([from_str, from_none], self.oauth_client_id) if self.oauth_grant_type is not None: - result["oauthGrantType"] = from_union([lambda x: to_enum(MCPServerConfigHTTPOauthGrantType, x), from_none], self.oauth_grant_type) + result["oauthGrantType"] = from_union([lambda x: to_enum(MCPGrantType, x), from_none], self.oauth_grant_type) if self.oauth_public_client is not None: result["oauthPublicClient"] = from_union([from_bool, from_none], self.oauth_public_client) if self.oidc is not None: @@ -11700,9 +11823,24 @@ class NamedProviderConfig: """Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set. """ + has_bearer_token_provider: bool | None = None + """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 ` 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. + """ headers: dict[str, str] | None = None """Custom HTTP headers to include in all outbound requests to the provider.""" + transport: ProviderTransport | None = None + """Provider transport. Defaults to "http".""" + type: ProviderType | None = None """Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.""" @@ -11717,10 +11855,12 @@ def from_dict(obj: Any) -> 'NamedProviderConfig': api_key = from_union([from_str, from_none], obj.get("apiKey")) azure = from_union([ProviderConfigAzure.from_dict, from_none], obj.get("azure")) bearer_token = from_union([from_str, from_none], obj.get("bearerToken")) + has_bearer_token_provider = from_union([from_bool, from_none], obj.get("hasBearerTokenProvider")) headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("headers")) + transport = from_union([ProviderTransport, from_none], obj.get("transport")) type = from_union([ProviderType, from_none], obj.get("type")) wire_api = from_union([ProviderWireAPI, from_none], obj.get("wireApi")) - return NamedProviderConfig(base_url, name, api_key, azure, bearer_token, headers, type, wire_api) + return NamedProviderConfig(base_url, name, api_key, azure, bearer_token, has_bearer_token_provider, headers, transport, type, wire_api) def to_dict(self) -> dict: result: dict = {} @@ -11732,8 +11872,12 @@ def to_dict(self) -> dict: result["azure"] = from_union([lambda x: to_class(ProviderConfigAzure, x), from_none], self.azure) if self.bearer_token is not None: result["bearerToken"] = from_union([from_str, from_none], self.bearer_token) + if self.has_bearer_token_provider is not None: + result["hasBearerTokenProvider"] = from_union([from_bool, from_none], self.has_bearer_token_provider) if self.headers is not None: result["headers"] = from_union([lambda x: from_dict(from_str, x), from_none], self.headers) + if self.transport is not None: + result["transport"] = from_union([lambda x: to_enum(ProviderTransport, x), from_none], self.transport) if self.type is not None: result["type"] = from_union([lambda x: to_enum(ProviderType, x), from_none], self.type) if self.wire_api is not None: @@ -11758,6 +11902,18 @@ class ProviderConfig: """Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set. """ + has_bearer_token_provider: bool | None = None + """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 ` 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. + """ headers: dict[str, str] | None = None """Custom HTTP headers to include in all outbound requests to the provider.""" @@ -11774,6 +11930,9 @@ class ProviderConfig: """Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model. """ + transport: ProviderTransport | None = None + """Provider transport. Defaults to "http".""" + type: ProviderType | None = None """Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.""" @@ -11792,15 +11951,17 @@ def from_dict(obj: Any) -> 'ProviderConfig': api_key = from_union([from_str, from_none], obj.get("apiKey")) azure = from_union([ProviderConfigAzure.from_dict, from_none], obj.get("azure")) bearer_token = from_union([from_str, from_none], obj.get("bearerToken")) + has_bearer_token_provider = from_union([from_bool, from_none], obj.get("hasBearerTokenProvider")) headers = from_union([lambda x: from_dict(from_str, x), from_none], obj.get("headers")) max_context_window_tokens = from_union([from_float, from_none], obj.get("maxContextWindowTokens")) max_output_tokens = from_union([from_float, from_none], obj.get("maxOutputTokens")) max_prompt_tokens = from_union([from_float, from_none], obj.get("maxPromptTokens")) model_id = from_union([from_str, from_none], obj.get("modelId")) + transport = from_union([ProviderTransport, from_none], obj.get("transport")) type = from_union([ProviderType, from_none], obj.get("type")) wire_api = from_union([ProviderWireAPI, from_none], obj.get("wireApi")) wire_model = from_union([from_str, from_none], obj.get("wireModel")) - return ProviderConfig(base_url, api_key, azure, bearer_token, headers, max_context_window_tokens, max_output_tokens, max_prompt_tokens, model_id, type, wire_api, wire_model) + return ProviderConfig(base_url, api_key, azure, bearer_token, has_bearer_token_provider, headers, max_context_window_tokens, max_output_tokens, max_prompt_tokens, model_id, transport, type, wire_api, wire_model) def to_dict(self) -> dict: result: dict = {} @@ -11811,6 +11972,8 @@ def to_dict(self) -> dict: result["azure"] = from_union([lambda x: to_class(ProviderConfigAzure, x), from_none], self.azure) if self.bearer_token is not None: result["bearerToken"] = from_union([from_str, from_none], self.bearer_token) + if self.has_bearer_token_provider is not None: + result["hasBearerTokenProvider"] = from_union([from_bool, from_none], self.has_bearer_token_provider) if self.headers is not None: result["headers"] = from_union([lambda x: from_dict(from_str, x), from_none], self.headers) if self.max_context_window_tokens is not None: @@ -11821,6 +11984,8 @@ def to_dict(self) -> dict: result["maxPromptTokens"] = from_union([to_float, from_none], self.max_prompt_tokens) if self.model_id is not None: result["modelId"] = from_union([from_str, from_none], self.model_id) + if self.transport is not None: + result["transport"] = from_union([lambda x: to_enum(ProviderTransport, x), from_none], self.transport) if self.type is not None: result["type"] = from_union([lambda x: to_enum(ProviderType, x), from_none], self.type) if self.wire_api is not None: @@ -13353,6 +13518,9 @@ class ProviderEndpoint: """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. """ + transport: ProviderTransport | None = None + """Transport to be used for provider requests.""" + wire_api: ProviderWireAPI | None = None """Wire API to be used, when required for the provider type.""" @@ -13364,8 +13532,9 @@ def from_dict(obj: Any) -> 'ProviderEndpoint': type = ProviderType(obj.get("type")) api_key = from_union([from_str, from_none], obj.get("apiKey")) session_token = from_union([ProviderSessionToken.from_dict, from_none], obj.get("sessionToken")) + transport = from_union([ProviderTransport, from_none], obj.get("transport")) wire_api = from_union([ProviderWireAPI, from_none], obj.get("wireApi")) - return ProviderEndpoint(base_url, headers, type, api_key, session_token, wire_api) + return ProviderEndpoint(base_url, headers, type, api_key, session_token, transport, wire_api) def to_dict(self) -> dict: result: dict = {} @@ -13376,6 +13545,8 @@ def to_dict(self) -> dict: result["apiKey"] = from_union([from_str, from_none], self.api_key) if self.session_token is not None: result["sessionToken"] = from_union([lambda x: to_class(ProviderSessionToken, x), from_none], self.session_token) + if self.transport is not None: + result["transport"] = from_union([lambda x: to_enum(ProviderTransport, x), from_none], self.transport) if self.wire_api is not None: result["wireApi"] = from_union([lambda x: to_enum(ProviderWireAPI, x), from_none], self.wire_api) return result @@ -13761,8 +13932,11 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SandboxConfigUserPolicyExperimental: - """Platform-specific experimental policy fields.""" + """Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is + absent. + Platform-specific experimental policy fields. + """ seatbelt: SandboxConfigUserPolicyExperimentalSeatbelt | None = None """macOS seatbelt experimental options.""" @@ -15509,25 +15683,6 @@ def to_dict(self) -> dict: result["canvases"] = from_list(lambda x: to_class(DiscoveredCanvas, x), self.canvases) return result -# Experimental: this type is part of an experimental API and may change or be removed. -@dataclass -class CanvasListOpenResult: - """Live open-canvas snapshot.""" - - open_canvases: list[OpenCanvasInstance] - """Currently open canvas instances""" - - @staticmethod - def from_dict(obj: Any) -> 'CanvasListOpenResult': - assert isinstance(obj, dict) - open_canvases = from_list(OpenCanvasInstance.from_dict, obj.get("openCanvases")) - return CanvasListOpenResult(open_canvases) - - def to_dict(self) -> dict: - result: dict = {} - result["openCanvases"] = from_list(lambda x: to_class(OpenCanvasInstance, x), self.open_canvases) - return result - # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SlashCommandInfo: @@ -16717,6 +16872,33 @@ def to_dict(self) -> dict: result["supports"] = from_union([lambda x: to_class(ModelCapabilitiesOverrideSupports, x), from_none], self.supports) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ProviderTokenAcquireRequest: + """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. + """ + provider_name: str + """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`. + """ + session_id: str + """Target session identifier""" + + @staticmethod + def from_dict(obj: Any) -> 'ProviderTokenAcquireRequest': + assert isinstance(obj, dict) + provider_name = from_str(obj.get("providerName")) + session_id = from_str(obj.get("sessionId")) + return ProviderTokenAcquireRequest(provider_name, session_id) + + def to_dict(self) -> dict: + result: dict = {} + result["providerName"] = from_str(self.provider_name) + result["sessionId"] = from_str(self.session_id) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class OptionsUpdateAdditionalContentExclusionPolicy: @@ -17001,21 +17183,26 @@ class SandboxConfigUserPolicy: """User-managed sandbox policy fragment merged into the auto-discovered base policy.""" experimental: SandboxConfigUserPolicyExperimental | None = None - """Platform-specific experimental policy fields.""" - + """Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is + absent. + """ filesystem: SandboxConfigUserPolicyFilesystem | None = None """Filesystem rules to merge into the base policy.""" network: SandboxConfigUserPolicyNetwork | None = None """Network rules to merge into the base policy.""" + seatbelt: SandboxConfigUserPolicySeatbelt | None = None + """macOS seatbelt options to merge into the base policy.""" + @staticmethod def from_dict(obj: Any) -> 'SandboxConfigUserPolicy': assert isinstance(obj, dict) experimental = from_union([SandboxConfigUserPolicyExperimental.from_dict, from_none], obj.get("experimental")) filesystem = from_union([SandboxConfigUserPolicyFilesystem.from_dict, from_none], obj.get("filesystem")) network = from_union([SandboxConfigUserPolicyNetwork.from_dict, from_none], obj.get("network")) - return SandboxConfigUserPolicy(experimental, filesystem, network) + seatbelt = from_union([SandboxConfigUserPolicySeatbelt.from_dict, from_none], obj.get("seatbelt")) + return SandboxConfigUserPolicy(experimental, filesystem, network, seatbelt) def to_dict(self) -> dict: result: dict = {} @@ -17025,6 +17212,8 @@ def to_dict(self) -> dict: result["filesystem"] = from_union([lambda x: to_class(SandboxConfigUserPolicyFilesystem, x), from_none], self.filesystem) if self.network is not None: result["network"] = from_union([lambda x: to_class(SandboxConfigUserPolicyNetwork, x), from_none], self.network) + if self.seatbelt is not None: + result["seatbelt"] = from_union([lambda x: to_class(SandboxConfigUserPolicySeatbelt, x), from_none], self.seatbelt) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -18833,10 +19022,6 @@ class SandboxConfig: add_current_working_directory: bool | None = None """Whether to auto-add the current working directory to readwritePaths. Default: true.""" - config: Any = None - """Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to - `spawnSandboxFromConfig`, bypassing policy merging. - """ user_policy: SandboxConfigUserPolicy | None = None """User-managed sandbox policy fragment merged into the auto-discovered base policy.""" @@ -18845,17 +19030,14 @@ def from_dict(obj: Any) -> 'SandboxConfig': assert isinstance(obj, dict) enabled = from_bool(obj.get("enabled")) add_current_working_directory = from_union([from_bool, from_none], obj.get("addCurrentWorkingDirectory")) - config = obj.get("config") user_policy = from_union([SandboxConfigUserPolicy.from_dict, from_none], obj.get("userPolicy")) - return SandboxConfig(enabled, add_current_working_directory, config, user_policy) + return SandboxConfig(enabled, add_current_working_directory, user_policy) def to_dict(self) -> dict: result: dict = {} result["enabled"] = from_bool(self.enabled) if self.add_current_working_directory is not None: result["addCurrentWorkingDirectory"] = from_union([from_bool, from_none], self.add_current_working_directory) - if self.config is not None: - result["config"] = self.config if self.user_policy is not None: result["userPolicy"] = from_union([lambda x: to_class(SandboxConfigUserPolicy, x), from_none], self.user_policy) return result @@ -18992,6 +19174,9 @@ class SessionOpenOptions: available_tools: list[str] | None = None """Allowlist of available tool names.""" + capi: CapiSessionOptions | None = None + """Options scoped to the built-in CAPI (Copilot API) provider.""" + client_kind: str | None = None """Structured client kind used for runtime behavior gates.""" @@ -19156,6 +19341,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': ask_user_disabled = from_union([from_bool, from_none], obj.get("askUserDisabled")) auth_info = from_union([_load_AuthInfo, from_none], obj.get("authInfo")) available_tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("availableTools")) + capi = from_union([CapiSessionOptions.from_dict, from_none], obj.get("capi")) client_kind = from_union([from_str, from_none], obj.get("clientKind")) client_name = from_union([from_str, from_none], obj.get("clientName")) coauthor_enabled = from_union([from_bool, from_none], obj.get("coauthorEnabled")) @@ -19205,7 +19391,7 @@ def from_dict(obj: Any) -> 'SessionOpenOptions': trajectory_file = from_union([from_str, from_none], obj.get("trajectoryFile")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) working_directory_context = from_union([SessionContext.from_dict, from_none], obj.get("workingDirectoryContext")) - return SessionOpenOptions(additional_content_exclusion_policies, agent_context, ask_user_disabled, auth_info, available_tools, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_skills, enable_citations, enable_on_demand_instruction_discovery, enable_script_safety, enable_streaming, env_value_mode, events_log_directory, excluded_tools, exp_assignments, feature_flags, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, session_capabilities, session_id, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, working_directory, working_directory_context) + return SessionOpenOptions(additional_content_exclusion_policies, agent_context, ask_user_disabled, auth_info, available_tools, capi, client_kind, client_name, coauthor_enabled, config_dir, continue_on_auto_mode, copilot_url, custom_agents_local_only, detached_from_spawning_parent_engagement_id, detached_from_spawning_parent_session_id, disabled_instruction_sources, disabled_skills, enable_citations, enable_on_demand_instruction_discovery, enable_script_safety, enable_streaming, env_value_mode, events_log_directory, excluded_tools, exp_assignments, feature_flags, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, max_inline_binary_bytes, memory, model, model_capabilities_overrides, models, name, provider, providers, reasoning_effort, reasoning_summary, remote_defaulted_on, remote_exporting, remote_steerable, running_in_interactive_mode, sandbox_config, session_capabilities, session_id, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, trajectory_file, working_directory, working_directory_context) def to_dict(self) -> dict: result: dict = {} @@ -19219,6 +19405,8 @@ def to_dict(self) -> dict: result["authInfo"] = from_union([lambda x: (x).to_dict(), from_none], self.auth_info) if self.available_tools is not None: result["availableTools"] = from_union([lambda x: from_list(from_str, x), from_none], self.available_tools) + if self.capi is not None: + result["capi"] = from_union([lambda x: to_class(CapiSessionOptions, x), from_none], self.capi) if self.client_kind is not None: result["clientKind"] = from_union([from_str, from_none], self.client_kind) if self.client_name is not None: @@ -19336,6 +19524,9 @@ class SessionUpdateOptionsParams: available_tools: list[str] | None = None """Allowlist of tool names available to this session.""" + capi: CapiSessionOptions | None = None + """Options scoped to the built-in CAPI (Copilot API) provider.""" + client_name: str | None = None """Identifier of the client driving the session.""" @@ -19498,6 +19689,7 @@ def from_dict(obj: Any) -> 'SessionUpdateOptionsParams': agent_context = from_union([from_str, from_none], obj.get("agentContext")) ask_user_disabled = from_union([from_bool, from_none], obj.get("askUserDisabled")) available_tools = from_union([lambda x: from_list(from_str, x), from_none], obj.get("availableTools")) + capi = from_union([CapiSessionOptions.from_dict, from_none], obj.get("capi")) client_name = from_union([from_str, from_none], obj.get("clientName")) coauthor_enabled = from_union([from_bool, from_none], obj.get("coauthorEnabled")) context_tier = from_union([OptionsUpdateContextTier, from_none], obj.get("contextTier")) @@ -19543,7 +19735,7 @@ def from_dict(obj: Any) -> 'SessionUpdateOptionsParams': tool_filter_precedence = from_union([OptionsUpdateToolFilterPrecedence, from_none], obj.get("toolFilterPrecedence")) trajectory_file = from_union([from_str, from_none], obj.get("trajectoryFile")) working_directory = from_union([from_str, from_none], obj.get("workingDirectory")) - return SessionUpdateOptionsParams(additional_content_exclusion_policies, agent_context, ask_user_disabled, available_tools, client_name, coauthor_enabled, context_tier, continue_on_auto_mode, copilot_url, custom_agents_local_only, disabled_instruction_sources, disabled_skills, enable_file_hooks, enable_host_git_operations, enable_on_demand_instruction_discovery, enable_reasoning_summaries, enable_script_safety, enable_session_store, enable_skills, enable_streaming, env_value_mode, events_log_directory, excluded_tools, feature_flags, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, manage_schedule_enabled, max_inline_binary_bytes, model, model_capabilities_overrides, organization_custom_instructions, provider, reasoning_effort, reasoning_summary, running_in_interactive_mode, sandbox_config, session_capabilities, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, skip_embedding_retrieval, suppress_custom_agent_prompt, tool_filter_precedence, trajectory_file, working_directory) + return SessionUpdateOptionsParams(additional_content_exclusion_policies, agent_context, ask_user_disabled, available_tools, capi, client_name, coauthor_enabled, context_tier, continue_on_auto_mode, copilot_url, custom_agents_local_only, disabled_instruction_sources, disabled_skills, enable_file_hooks, enable_host_git_operations, enable_on_demand_instruction_discovery, enable_reasoning_summaries, enable_script_safety, enable_session_store, enable_skills, enable_streaming, env_value_mode, events_log_directory, excluded_tools, feature_flags, installed_plugins, integration_id, is_experimental_mode, log_interactive_shells, lsp_client_name, manage_schedule_enabled, max_inline_binary_bytes, model, model_capabilities_overrides, organization_custom_instructions, provider, reasoning_effort, reasoning_summary, running_in_interactive_mode, sandbox_config, session_capabilities, shell_init_profile, shell_process_flags, skill_directories, skip_custom_instructions, skip_embedding_retrieval, suppress_custom_agent_prompt, tool_filter_precedence, trajectory_file, working_directory) def to_dict(self) -> dict: result: dict = {} @@ -19555,6 +19747,8 @@ def to_dict(self) -> dict: result["askUserDisabled"] = from_union([from_bool, from_none], self.ask_user_disabled) if self.available_tools is not None: result["availableTools"] = from_union([lambda x: from_list(from_str, x), from_none], self.available_tools) + if self.capi is not None: + result["capi"] = from_union([lambda x: to_class(CapiSessionOptions, x), from_none], self.capi) if self.client_name is not None: result["clientName"] = from_union([from_str, from_none], self.client_name) if self.coauthor_enabled is not None: @@ -20799,7 +20993,6 @@ class RPC: canvas_close_request: CanvasCloseRequest canvas_host_context: CanvasHostContext canvas_host_context_capabilities: CanvasHostContextCapabilities - canvas_instance_availability: CanvasInstanceAvailability canvas_json_schema: Any canvas_list: CanvasList canvas_list_open_result: CanvasListOpenResult @@ -20809,6 +21002,7 @@ class RPC: canvas_provider_open_request: CanvasProviderOpenRequest canvas_provider_open_result: CanvasProviderOpenResult canvas_session_context: CanvasSessionContext + capi_session_options: CapiSessionOptions command_list: CommandList commands_handle_pending_command_request: CommandsHandlePendingCommandRequest commands_handle_pending_command_result: CommandsHandlePendingCommandResult @@ -20975,6 +21169,7 @@ class RPC: mcp_list_tools_result: MCPListToolsResult mcp_oauth_handle_pending_request: MCPOauthHandlePendingRequest mcp_oauth_handle_pending_result: MCPOauthHandlePendingResult + mcp_oauth_login_grant_type: MCPGrantType mcp_oauth_login_request: MCPOauthLoginRequest mcp_oauth_login_result: MCPOauthLoginResult mcp_oauth_pending_request_response: MCPOauthPendingRequestResponse @@ -20992,7 +21187,7 @@ class RPC: mcp_server_config: MCPServerConfig mcp_server_config_defer_tools: MCPServerConfigDeferTools mcp_server_config_http: MCPServerConfigHTTP - mcp_server_config_http_oauth_grant_type: MCPServerConfigHTTPOauthGrantType + mcp_server_config_http_oauth_grant_type: MCPGrantType mcp_server_config_http_type: MCPServerConfigHTTPType mcp_server_config_stdio: MCPServerConfigStdio mcp_server_failure_info: MCPServerFailureInfo @@ -21183,14 +21378,18 @@ class RPC: provider_add_result: ProviderAddResult provider_config: ProviderConfig provider_config_azure: ProviderConfigAzure + provider_config_transport: ProviderTransport provider_config_type: ProviderType provider_config_wire_api: ProviderWireAPI provider_endpoint: ProviderEndpoint + provider_endpoint_transport: ProviderTransport provider_endpoint_type: ProviderType provider_endpoint_wire_api: ProviderWireAPI provider_get_endpoint_request: ProviderGetEndpointRequest provider_model_config: ProviderModelConfig provider_session_token: ProviderSessionToken + provider_token_acquire_request: ProviderTokenAcquireRequest + provider_token_acquire_result: ProviderTokenAcquireResult push_attachment: PushAttachment push_attachment_blob: PushAttachmentBlob push_attachment_directory: PushAttachmentDirectory @@ -21240,6 +21439,7 @@ class RPC: sandbox_config_user_policy_experimental_seatbelt: SandboxConfigUserPolicyExperimentalSeatbelt sandbox_config_user_policy_filesystem: SandboxConfigUserPolicyFilesystem sandbox_config_user_policy_network: SandboxConfigUserPolicyNetwork + sandbox_config_user_policy_seatbelt: SandboxConfigUserPolicySeatbelt schedule_entry: ScheduleEntry schedule_list: ScheduleList schedule_stop_request: ScheduleStopRequest @@ -21565,7 +21765,6 @@ def from_dict(obj: Any) -> 'RPC': canvas_close_request = CanvasCloseRequest.from_dict(obj.get("CanvasCloseRequest")) canvas_host_context = CanvasHostContext.from_dict(obj.get("CanvasHostContext")) canvas_host_context_capabilities = CanvasHostContextCapabilities.from_dict(obj.get("CanvasHostContextCapabilities")) - canvas_instance_availability = CanvasInstanceAvailability(obj.get("CanvasInstanceAvailability")) canvas_json_schema = obj.get("CanvasJsonSchema") canvas_list = CanvasList.from_dict(obj.get("CanvasList")) canvas_list_open_result = CanvasListOpenResult.from_dict(obj.get("CanvasListOpenResult")) @@ -21575,6 +21774,7 @@ def from_dict(obj: Any) -> 'RPC': canvas_provider_open_request = CanvasProviderOpenRequest.from_dict(obj.get("CanvasProviderOpenRequest")) canvas_provider_open_result = CanvasProviderOpenResult.from_dict(obj.get("CanvasProviderOpenResult")) canvas_session_context = CanvasSessionContext.from_dict(obj.get("CanvasSessionContext")) + capi_session_options = CapiSessionOptions.from_dict(obj.get("CapiSessionOptions")) command_list = CommandList.from_dict(obj.get("CommandList")) commands_handle_pending_command_request = CommandsHandlePendingCommandRequest.from_dict(obj.get("CommandsHandlePendingCommandRequest")) commands_handle_pending_command_result = CommandsHandlePendingCommandResult.from_dict(obj.get("CommandsHandlePendingCommandResult")) @@ -21741,6 +21941,7 @@ def from_dict(obj: Any) -> 'RPC': mcp_list_tools_result = MCPListToolsResult.from_dict(obj.get("McpListToolsResult")) mcp_oauth_handle_pending_request = MCPOauthHandlePendingRequest.from_dict(obj.get("McpOauthHandlePendingRequest")) mcp_oauth_handle_pending_result = MCPOauthHandlePendingResult.from_dict(obj.get("McpOauthHandlePendingResult")) + mcp_oauth_login_grant_type = MCPGrantType(obj.get("McpOauthLoginGrantType")) mcp_oauth_login_request = MCPOauthLoginRequest.from_dict(obj.get("McpOauthLoginRequest")) mcp_oauth_login_result = MCPOauthLoginResult.from_dict(obj.get("McpOauthLoginResult")) mcp_oauth_pending_request_response = MCPOauthPendingRequestResponse.from_dict(obj.get("McpOauthPendingRequestResponse")) @@ -21758,7 +21959,7 @@ def from_dict(obj: Any) -> 'RPC': mcp_server_config = MCPServerConfig.from_dict(obj.get("McpServerConfig")) mcp_server_config_defer_tools = MCPServerConfigDeferTools(obj.get("McpServerConfigDeferTools")) mcp_server_config_http = MCPServerConfigHTTP.from_dict(obj.get("McpServerConfigHttp")) - mcp_server_config_http_oauth_grant_type = MCPServerConfigHTTPOauthGrantType(obj.get("McpServerConfigHttpOauthGrantType")) + mcp_server_config_http_oauth_grant_type = MCPGrantType(obj.get("McpServerConfigHttpOauthGrantType")) mcp_server_config_http_type = MCPServerConfigHTTPType(obj.get("McpServerConfigHttpType")) mcp_server_config_stdio = MCPServerConfigStdio.from_dict(obj.get("McpServerConfigStdio")) mcp_server_failure_info = MCPServerFailureInfo.from_dict(obj.get("McpServerFailureInfo")) @@ -21949,14 +22150,18 @@ def from_dict(obj: Any) -> 'RPC': provider_add_result = ProviderAddResult.from_dict(obj.get("ProviderAddResult")) provider_config = ProviderConfig.from_dict(obj.get("ProviderConfig")) provider_config_azure = ProviderConfigAzure.from_dict(obj.get("ProviderConfigAzure")) + provider_config_transport = ProviderTransport(obj.get("ProviderConfigTransport")) provider_config_type = ProviderType(obj.get("ProviderConfigType")) provider_config_wire_api = ProviderWireAPI(obj.get("ProviderConfigWireApi")) provider_endpoint = ProviderEndpoint.from_dict(obj.get("ProviderEndpoint")) + provider_endpoint_transport = ProviderTransport(obj.get("ProviderEndpointTransport")) provider_endpoint_type = ProviderType(obj.get("ProviderEndpointType")) provider_endpoint_wire_api = ProviderWireAPI(obj.get("ProviderEndpointWireApi")) provider_get_endpoint_request = ProviderGetEndpointRequest.from_dict(obj.get("ProviderGetEndpointRequest")) provider_model_config = ProviderModelConfig.from_dict(obj.get("ProviderModelConfig")) provider_session_token = ProviderSessionToken.from_dict(obj.get("ProviderSessionToken")) + provider_token_acquire_request = ProviderTokenAcquireRequest.from_dict(obj.get("ProviderTokenAcquireRequest")) + provider_token_acquire_result = ProviderTokenAcquireResult.from_dict(obj.get("ProviderTokenAcquireResult")) push_attachment = _load_PushAttachment(obj.get("PushAttachment")) push_attachment_blob = PushAttachmentBlob.from_dict(obj.get("PushAttachmentBlob")) push_attachment_directory = PushAttachmentDirectory.from_dict(obj.get("PushAttachmentDirectory")) @@ -22006,6 +22211,7 @@ def from_dict(obj: Any) -> 'RPC': sandbox_config_user_policy_experimental_seatbelt = SandboxConfigUserPolicyExperimentalSeatbelt.from_dict(obj.get("SandboxConfigUserPolicyExperimentalSeatbelt")) sandbox_config_user_policy_filesystem = SandboxConfigUserPolicyFilesystem.from_dict(obj.get("SandboxConfigUserPolicyFilesystem")) sandbox_config_user_policy_network = SandboxConfigUserPolicyNetwork.from_dict(obj.get("SandboxConfigUserPolicyNetwork")) + sandbox_config_user_policy_seatbelt = SandboxConfigUserPolicySeatbelt.from_dict(obj.get("SandboxConfigUserPolicySeatbelt")) schedule_entry = ScheduleEntry.from_dict(obj.get("ScheduleEntry")) schedule_list = ScheduleList.from_dict(obj.get("ScheduleList")) schedule_stop_request = ScheduleStopRequest.from_dict(obj.get("ScheduleStopRequest")) @@ -22275,7 +22481,7 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_instance_availability, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, configure_session_extensions_params, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_filtered_server, mcp_host_state, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_register_external_client_request, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_unregister_external_client_request, memory_configuration, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, poll_spawned_sessions_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, sandbox_config, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_mode, send_request, send_result, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_auth_status, session_bulk_delete_result, session_capability, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_poll_spawned_sessions_event, sessions_poll_spawned_sessions_request, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, capi_session_options, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, configure_session_extensions_params, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_filtered_server, mcp_host_state, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_oauth_respond_request, mcp_oauth_respond_result, mcp_register_external_client_request, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_unregister_external_client_request, memory_configuration, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, poll_spawned_sessions_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, sandbox_config, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_seatbelt, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_mode, send_request, send_result, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_auth_status, session_bulk_delete_result, session_capability, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_poll_spawned_sessions_event, sessions_poll_spawned_sessions_request, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -22331,7 +22537,6 @@ def to_dict(self) -> dict: result["CanvasCloseRequest"] = to_class(CanvasCloseRequest, self.canvas_close_request) result["CanvasHostContext"] = to_class(CanvasHostContext, self.canvas_host_context) result["CanvasHostContextCapabilities"] = to_class(CanvasHostContextCapabilities, self.canvas_host_context_capabilities) - result["CanvasInstanceAvailability"] = to_enum(CanvasInstanceAvailability, self.canvas_instance_availability) result["CanvasJsonSchema"] = self.canvas_json_schema result["CanvasList"] = to_class(CanvasList, self.canvas_list) result["CanvasListOpenResult"] = to_class(CanvasListOpenResult, self.canvas_list_open_result) @@ -22341,6 +22546,7 @@ def to_dict(self) -> dict: result["CanvasProviderOpenRequest"] = to_class(CanvasProviderOpenRequest, self.canvas_provider_open_request) result["CanvasProviderOpenResult"] = to_class(CanvasProviderOpenResult, self.canvas_provider_open_result) result["CanvasSessionContext"] = to_class(CanvasSessionContext, self.canvas_session_context) + result["CapiSessionOptions"] = to_class(CapiSessionOptions, self.capi_session_options) result["CommandList"] = to_class(CommandList, self.command_list) result["CommandsHandlePendingCommandRequest"] = to_class(CommandsHandlePendingCommandRequest, self.commands_handle_pending_command_request) result["CommandsHandlePendingCommandResult"] = to_class(CommandsHandlePendingCommandResult, self.commands_handle_pending_command_result) @@ -22507,6 +22713,7 @@ def to_dict(self) -> dict: result["McpListToolsResult"] = to_class(MCPListToolsResult, self.mcp_list_tools_result) result["McpOauthHandlePendingRequest"] = to_class(MCPOauthHandlePendingRequest, self.mcp_oauth_handle_pending_request) result["McpOauthHandlePendingResult"] = to_class(MCPOauthHandlePendingResult, self.mcp_oauth_handle_pending_result) + result["McpOauthLoginGrantType"] = to_enum(MCPGrantType, self.mcp_oauth_login_grant_type) result["McpOauthLoginRequest"] = to_class(MCPOauthLoginRequest, self.mcp_oauth_login_request) result["McpOauthLoginResult"] = to_class(MCPOauthLoginResult, self.mcp_oauth_login_result) result["McpOauthPendingRequestResponse"] = to_class(MCPOauthPendingRequestResponse, self.mcp_oauth_pending_request_response) @@ -22524,7 +22731,7 @@ def to_dict(self) -> dict: result["McpServerConfig"] = to_class(MCPServerConfig, self.mcp_server_config) result["McpServerConfigDeferTools"] = to_enum(MCPServerConfigDeferTools, self.mcp_server_config_defer_tools) result["McpServerConfigHttp"] = to_class(MCPServerConfigHTTP, self.mcp_server_config_http) - result["McpServerConfigHttpOauthGrantType"] = to_enum(MCPServerConfigHTTPOauthGrantType, self.mcp_server_config_http_oauth_grant_type) + result["McpServerConfigHttpOauthGrantType"] = to_enum(MCPGrantType, self.mcp_server_config_http_oauth_grant_type) result["McpServerConfigHttpType"] = to_enum(MCPServerConfigHTTPType, self.mcp_server_config_http_type) result["McpServerConfigStdio"] = to_class(MCPServerConfigStdio, self.mcp_server_config_stdio) result["McpServerFailureInfo"] = to_class(MCPServerFailureInfo, self.mcp_server_failure_info) @@ -22715,14 +22922,18 @@ def to_dict(self) -> dict: result["ProviderAddResult"] = to_class(ProviderAddResult, self.provider_add_result) result["ProviderConfig"] = to_class(ProviderConfig, self.provider_config) result["ProviderConfigAzure"] = to_class(ProviderConfigAzure, self.provider_config_azure) + result["ProviderConfigTransport"] = to_enum(ProviderTransport, self.provider_config_transport) result["ProviderConfigType"] = to_enum(ProviderType, self.provider_config_type) result["ProviderConfigWireApi"] = to_enum(ProviderWireAPI, self.provider_config_wire_api) result["ProviderEndpoint"] = to_class(ProviderEndpoint, self.provider_endpoint) + result["ProviderEndpointTransport"] = to_enum(ProviderTransport, self.provider_endpoint_transport) result["ProviderEndpointType"] = to_enum(ProviderType, self.provider_endpoint_type) result["ProviderEndpointWireApi"] = to_enum(ProviderWireAPI, self.provider_endpoint_wire_api) result["ProviderGetEndpointRequest"] = to_class(ProviderGetEndpointRequest, self.provider_get_endpoint_request) result["ProviderModelConfig"] = to_class(ProviderModelConfig, self.provider_model_config) result["ProviderSessionToken"] = to_class(ProviderSessionToken, self.provider_session_token) + result["ProviderTokenAcquireRequest"] = to_class(ProviderTokenAcquireRequest, self.provider_token_acquire_request) + result["ProviderTokenAcquireResult"] = to_class(ProviderTokenAcquireResult, self.provider_token_acquire_result) result["PushAttachment"] = (self.push_attachment).to_dict() result["PushAttachmentBlob"] = to_class(PushAttachmentBlob, self.push_attachment_blob) result["PushAttachmentDirectory"] = to_class(PushAttachmentDirectory, self.push_attachment_directory) @@ -22772,6 +22983,7 @@ def to_dict(self) -> dict: result["SandboxConfigUserPolicyExperimentalSeatbelt"] = to_class(SandboxConfigUserPolicyExperimentalSeatbelt, self.sandbox_config_user_policy_experimental_seatbelt) result["SandboxConfigUserPolicyFilesystem"] = to_class(SandboxConfigUserPolicyFilesystem, self.sandbox_config_user_policy_filesystem) result["SandboxConfigUserPolicyNetwork"] = to_class(SandboxConfigUserPolicyNetwork, self.sandbox_config_user_policy_network) + result["SandboxConfigUserPolicySeatbelt"] = to_class(SandboxConfigUserPolicySeatbelt, self.sandbox_config_user_policy_seatbelt) result["ScheduleEntry"] = to_class(ScheduleEntry, self.schedule_entry) result["ScheduleList"] = to_class(ScheduleList, self.schedule_list) result["ScheduleStopRequest"] = to_class(ScheduleStopRequest, self.schedule_stop_request) @@ -23280,7 +23492,9 @@ def _load_TaskInfo(obj: Any) -> "TaskInfo": McpAppsSetHostContextDetailsTheme = Theme McpExecuteSamplingRequest = dict McpExecuteSamplingResult = dict +McpOauthLoginGrantType = MCPGrantType McpServerAuthConfig = bool +McpServerConfigHttpOauthGrantType = MCPGrantType MetadataSnapshotRemoteMetadataTaskType = TaskType OptionsUpdateAdditionalContentExclusionPolicyScope = AdditionalContentExclusionPolicyScope OptionsUpdateEnvValueMode = MCPSetEnvValueModeDetails @@ -23288,8 +23502,10 @@ def _load_TaskInfo(obj: Any) -> "TaskInfo": PermissionsConfigureAdditionalContentExclusionPolicyScope = AdditionalContentExclusionPolicyScope PermissionsSetAllowAllSource = PermissionsSetAAllSource PermissionsSetApproveAllSource = PermissionsSetAAllSource +ProviderConfigTransport = ProviderTransport ProviderConfigType = ProviderType ProviderConfigWireApi = ProviderWireAPI +ProviderEndpointTransport = ProviderTransport ProviderEndpointType = ProviderType ProviderEndpointWireApi = ProviderWireAPI RemoteSessionMetadataTaskType = TaskType @@ -24196,7 +24412,7 @@ async def handle_pending_request(self, params: MCPOauthHandlePendingRequest, *, return MCPOauthHandlePendingResult.from_dict(await self._client.request("session.mcp.oauth.handlePendingRequest", params_dict, **_timeout_kwargs(timeout))) async def login(self, params: MCPOauthLoginRequest, *, timeout: float | None = None) -> MCPOauthLoginResult: - "Starts OAuth authentication for a remote MCP server.\n\nArgs:\n params: Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy.\n\nReturns:\n OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server." + "Starts OAuth authentication for a remote MCP server.\n\nArgs:\n params: Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.\n\nReturns:\n OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server." params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} params_dict["sessionId"] = self._session_id return MCPOauthLoginResult.from_dict(await self._client.request("session.mcp.oauth.login", params_dict, **_timeout_kwargs(timeout))) @@ -25045,6 +25261,12 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self.mcp = _InternalMcpApi(client, session_id) +# Experimental: this API group is experimental and may change or be removed. +class ProviderTokenHandler(Protocol): + async def get_token(self, params: ProviderTokenAcquireRequest) -> ProviderTokenAcquireResult: + "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.\n\nArgs:\n params: 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.\n\nReturns:\n A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer ` on the outbound request and does no caching; the SDK consumer owns token caching and refresh." + pass + # Experimental: this API group is experimental and may change or be removed. class SessionFsHandler(Protocol): async def read_file(self, params: SessionFSReadFileRequest) -> SessionFSReadFileResult: @@ -25098,6 +25320,7 @@ async def invoke(self, params: CanvasProviderInvokeActionRequest) -> Any: @dataclass class ClientSessionApiHandlers: + provider_token: ProviderTokenHandler | None = None session_fs: SessionFsHandler | None = None canvas: CanvasHandler | None = None @@ -25106,6 +25329,13 @@ def register_client_session_api_handlers( get_handlers: Callable[[str], ClientSessionApiHandlers], ) -> None: """Register client-session request handlers on a JSON-RPC connection.""" + async def handle_provider_token_get_token(params: dict) -> dict | None: + request = ProviderTokenAcquireRequest.from_dict(params) + handler = get_handlers(request.session_id).provider_token + if handler is None: raise RuntimeError(f"No provider_token handler registered for session: {request.session_id}") + result = await handler.get_token(request) + return result.to_dict() + client.set_request_handler("providerToken.getToken", handle_provider_token_get_token) async def handle_session_fs_read_file(params: dict) -> dict | None: request = SessionFSReadFileRequest.from_dict(params) handler = get_handlers(request.session_id).session_fs @@ -25316,7 +25546,6 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "CanvasHandler", "CanvasHostContext", "CanvasHostContextCapabilities", - "CanvasInstanceAvailability", "CanvasJsonSchema", "CanvasList", "CanvasListOpenResult", @@ -25326,6 +25555,7 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "CanvasProviderOpenRequest", "CanvasProviderOpenResult", "CanvasSessionContext", + "CapiSessionOptions", "ClientGlobalApiHandlers", "ClientSessionApiHandlers", "CommandList", @@ -25492,6 +25722,7 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "MCPEnableRequest", "MCPExecuteSamplingParams", "MCPFilteredServer", + "MCPGrantType", "MCPHostState", "MCPIsServerRunningRequest", "MCPIsServerRunningResult", @@ -25516,7 +25747,6 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "MCPServerConfig", "MCPServerConfigDeferTools", "MCPServerConfigHTTP", - "MCPServerConfigHTTPOauthGrantType", "MCPServerConfigHTTPType", "MCPServerConfigStdio", "MCPServerFailureInfo", @@ -25550,7 +25780,9 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "McpExecuteSamplingRequest", "McpExecuteSamplingResult", "McpOauthApi", + "McpOauthLoginGrantType", "McpServerAuthConfig", + "McpServerConfigHttpOauthGrantType", "MemoryConfiguration", "MetadataApi", "MetadataContextInfoRequest", @@ -25768,14 +26000,20 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "ProviderApi", "ProviderConfig", "ProviderConfigAzure", + "ProviderConfigTransport", "ProviderConfigType", "ProviderConfigWireApi", "ProviderEndpoint", + "ProviderEndpointTransport", "ProviderEndpointType", "ProviderEndpointWireApi", "ProviderGetEndpointRequest", "ProviderModelConfig", "ProviderSessionToken", + "ProviderTokenAcquireRequest", + "ProviderTokenAcquireResult", + "ProviderTokenHandler", + "ProviderTransport", "ProviderType", "ProviderWireAPI", "PurpleSource", @@ -25839,6 +26077,7 @@ async def handle_llm_inference_http_request_chunk(params: dict) -> dict | None: "SandboxConfigUserPolicyExperimentalSeatbelt", "SandboxConfigUserPolicyFilesystem", "SandboxConfigUserPolicyNetwork", + "SandboxConfigUserPolicySeatbelt", "Saved", "ScheduleApi", "ScheduleEntry", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index cb4851ec3..0a3666c09 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -130,6 +130,7 @@ class SessionEventType(Enum): SESSION_TITLE_CHANGED = "session.title_changed" SESSION_SCHEDULE_CREATED = "session.schedule_created" SESSION_SCHEDULE_CANCELLED = "session.schedule_cancelled" + SESSION_SCHEDULE_REARMED = "session.schedule_rearmed" SESSION_AUTOPILOT_OBJECTIVE_CHANGED = "session.autopilot_objective_changed" SESSION_INFO = "session.info" SESSION_WARNING = "session.warning" @@ -209,9 +210,18 @@ class SessionEventType(Enum): SESSION_MCP_SERVERS_LOADED = "session.mcp_servers_loaded" SESSION_MCP_SERVER_STATUS_CHANGED = "session.mcp_server_status_changed" SESSION_EXTENSIONS_LOADED = "session.extensions_loaded" + # Experimental: this event is part of an experimental API and may change or be removed. SESSION_CANVAS_OPENED = "session.canvas.opened" + # Experimental: this event is part of an experimental API and may change or be removed. SESSION_CANVAS_REGISTRY_CHANGED = "session.canvas.registry_changed" + # Experimental: this event is part of an experimental API and may change or be removed. SESSION_CANVAS_CLOSED = "session.canvas.closed" + # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_CANVAS_UNAVAILABLE = "session.canvas.unavailable" + # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_CANVAS_RECORDED = "session.canvas.recorded" + # Experimental: this event is part of an experimental API and may change or be removed. + SESSION_CANVAS_REMOVED = "session.canvas.removed" SESSION_EXTENSIONS_ATTACHMENTS_PUSHED = "session.extensions.attachments_pushed" MCP_APP_TOOL_CALL_COMPLETE = "mcp_app.tool_call_complete" UNKNOWN = "unknown" @@ -371,6 +381,83 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class CanvasRegistryChangedCanvas: + "Schema for the `CanvasRegistryChangedCanvas` type." + canvas_id: str + description: str + display_name: str + extension_id: str + actions: list[CanvasRegistryChangedCanvasAction] | None = None + extension_name: str | None = None + input_schema: Any = None + + @staticmethod + def from_dict(obj: Any) -> "CanvasRegistryChangedCanvas": + assert isinstance(obj, dict) + canvas_id = from_str(obj.get("canvasId")) + description = from_str(obj.get("description")) + display_name = from_str(obj.get("displayName")) + extension_id = from_str(obj.get("extensionId")) + actions = from_union([from_none, lambda x: from_list(CanvasRegistryChangedCanvasAction.from_dict, x)], obj.get("actions")) + extension_name = from_union([from_none, from_str], obj.get("extensionName")) + input_schema = obj.get("inputSchema") + return CanvasRegistryChangedCanvas( + canvas_id=canvas_id, + description=description, + display_name=display_name, + extension_id=extension_id, + actions=actions, + extension_name=extension_name, + input_schema=input_schema, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["canvasId"] = from_str(self.canvas_id) + result["description"] = from_str(self.description) + result["displayName"] = from_str(self.display_name) + result["extensionId"] = from_str(self.extension_id) + if self.actions is not None: + result["actions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(CanvasRegistryChangedCanvasAction, x), x)], self.actions) + if self.extension_name is not None: + result["extensionName"] = from_union([from_none, from_str], self.extension_name) + if self.input_schema is not None: + result["inputSchema"] = self.input_schema + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class CanvasRegistryChangedCanvasAction: + "Schema for the `CanvasRegistryChangedCanvasAction` type." + name: str + description: str | None = None + input_schema: Any = None + + @staticmethod + def from_dict(obj: Any) -> "CanvasRegistryChangedCanvasAction": + assert isinstance(obj, dict) + name = from_str(obj.get("name")) + description = from_union([from_none, from_str], obj.get("description")) + input_schema = obj.get("inputSchema") + return CanvasRegistryChangedCanvasAction( + name=name, + description=description, + input_schema=input_schema, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["name"] = from_str(self.name) + if self.description is not None: + result["description"] = from_union([from_none, from_str], self.description) + if self.input_schema is not None: + result["inputSchema"] = self.input_schema + return result + + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class CitableSource: @@ -656,6 +743,201 @@ def to_dict(self) -> dict: return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionCanvasClosedData: + "Schema for the `CanvasClosedData` type." + canvas_id: str + extension_id: str + instance_id: str + + @staticmethod + def from_dict(obj: Any) -> "SessionCanvasClosedData": + assert isinstance(obj, dict) + canvas_id = from_str(obj.get("canvasId")) + extension_id = from_str(obj.get("extensionId")) + instance_id = from_str(obj.get("instanceId")) + return SessionCanvasClosedData( + canvas_id=canvas_id, + extension_id=extension_id, + instance_id=instance_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["canvasId"] = from_str(self.canvas_id) + result["extensionId"] = from_str(self.extension_id) + result["instanceId"] = from_str(self.instance_id) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionCanvasOpenedData: + "Schema for the `CanvasOpenedData` type." + canvas_id: str + extension_id: str + instance_id: str + extension_name: str | None = None + input: Any = None + status: str | None = None + title: str | None = None + url: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionCanvasOpenedData": + assert isinstance(obj, dict) + canvas_id = from_str(obj.get("canvasId")) + extension_id = from_str(obj.get("extensionId")) + instance_id = from_str(obj.get("instanceId")) + extension_name = from_union([from_none, from_str], obj.get("extensionName")) + input = obj.get("input") + status = from_union([from_none, from_str], obj.get("status")) + title = from_union([from_none, from_str], obj.get("title")) + url = from_union([from_none, from_str], obj.get("url")) + return SessionCanvasOpenedData( + canvas_id=canvas_id, + extension_id=extension_id, + instance_id=instance_id, + extension_name=extension_name, + input=input, + status=status, + title=title, + url=url, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["canvasId"] = from_str(self.canvas_id) + result["extensionId"] = from_str(self.extension_id) + result["instanceId"] = from_str(self.instance_id) + if self.extension_name is not None: + result["extensionName"] = from_union([from_none, from_str], self.extension_name) + if self.input is not None: + result["input"] = self.input + if self.status is not None: + result["status"] = from_union([from_none, from_str], self.status) + if self.title is not None: + result["title"] = from_union([from_none, from_str], self.title) + if self.url is not None: + result["url"] = from_union([from_none, from_str], self.url) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionCanvasRecordedData: + "Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability." + canvas_id: str + extension_id: str + instance_id: str + input: Any = None + title: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "SessionCanvasRecordedData": + assert isinstance(obj, dict) + canvas_id = from_str(obj.get("canvasId")) + extension_id = from_str(obj.get("extensionId")) + instance_id = from_str(obj.get("instanceId")) + input = obj.get("input") + title = from_union([from_none, from_str], obj.get("title")) + return SessionCanvasRecordedData( + canvas_id=canvas_id, + extension_id=extension_id, + instance_id=instance_id, + input=input, + title=title, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["canvasId"] = from_str(self.canvas_id) + result["extensionId"] = from_str(self.extension_id) + result["instanceId"] = from_str(self.instance_id) + if self.input is not None: + result["input"] = self.input + if self.title is not None: + result["title"] = from_union([from_none, from_str], self.title) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionCanvasRegistryChangedData: + "Schema for the `CanvasRegistryChangedData` type." + canvases: list[CanvasRegistryChangedCanvas] + + @staticmethod + def from_dict(obj: Any) -> "SessionCanvasRegistryChangedData": + assert isinstance(obj, dict) + canvases = from_list(CanvasRegistryChangedCanvas.from_dict, obj.get("canvases")) + return SessionCanvasRegistryChangedData( + canvases=canvases, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["canvases"] = from_list(lambda x: to_class(CanvasRegistryChangedCanvas, x), self.canvases) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionCanvasRemovedData: + "Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay." + canvas_id: str + extension_id: str + instance_id: str + + @staticmethod + def from_dict(obj: Any) -> "SessionCanvasRemovedData": + assert isinstance(obj, dict) + canvas_id = from_str(obj.get("canvasId")) + extension_id = from_str(obj.get("extensionId")) + instance_id = from_str(obj.get("instanceId")) + return SessionCanvasRemovedData( + canvas_id=canvas_id, + extension_id=extension_id, + instance_id=instance_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["canvasId"] = from_str(self.canvas_id) + result["extensionId"] = from_str(self.extension_id) + result["instanceId"] = from_str(self.instance_id) + return result + + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionCanvasUnavailableData: + "Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume." + canvas_id: str + extension_id: str + instance_id: str + + @staticmethod + def from_dict(obj: Any) -> "SessionCanvasUnavailableData": + assert isinstance(obj, dict) + canvas_id = from_str(obj.get("canvasId")) + extension_id = from_str(obj.get("extensionId")) + instance_id = from_str(obj.get("instanceId")) + return SessionCanvasUnavailableData( + canvas_id=canvas_id, + extension_id=extension_id, + instance_id=instance_id, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["canvasId"] = from_str(self.canvas_id) + result["extensionId"] = from_str(self.extension_id) + result["instanceId"] = from_str(self.instance_id) + return result + + @dataclass class AbortData: "Turn abort information including the reason for termination" @@ -1204,7 +1486,13 @@ class _AssistantUsageQuotaSnapshot: # Internal: this field is an internal SDK API and is not part of the public surface. _used_requests: int # Internal: this field is an internal SDK API and is not part of the public surface. + _has_quota: bool | None = None + # Internal: this field is an internal SDK API and is not part of the public surface. + _overage_entitlement: float | None = None + # Internal: this field is an internal SDK API and is not part of the public surface. _reset_date: datetime | None = None + # Internal: this field is an internal SDK API and is not part of the public surface. + _token_based_billing: bool | None = None @staticmethod def from_dict(obj: Any) -> "_AssistantUsageQuotaSnapshot": @@ -1216,7 +1504,10 @@ def from_dict(obj: Any) -> "_AssistantUsageQuotaSnapshot": _remaining_percentage = from_float(obj.get("remainingPercentage")) _usage_allowed_with_exhausted_quota = from_bool(obj.get("usageAllowedWithExhaustedQuota")) _used_requests = from_int(obj.get("usedRequests")) + _has_quota = from_union([from_none, from_bool], obj.get("hasQuota")) + _overage_entitlement = from_union([from_none, from_float], obj.get("overageEntitlement")) _reset_date = from_union([from_none, from_datetime], obj.get("resetDate")) + _token_based_billing = from_union([from_none, from_bool], obj.get("tokenBasedBilling")) return _AssistantUsageQuotaSnapshot( _entitlement_requests=_entitlement_requests, _is_unlimited_entitlement=_is_unlimited_entitlement, @@ -1225,7 +1516,10 @@ def from_dict(obj: Any) -> "_AssistantUsageQuotaSnapshot": _remaining_percentage=_remaining_percentage, _usage_allowed_with_exhausted_quota=_usage_allowed_with_exhausted_quota, _used_requests=_used_requests, + _has_quota=_has_quota, + _overage_entitlement=_overage_entitlement, _reset_date=_reset_date, + _token_based_billing=_token_based_billing, ) def to_dict(self) -> dict: @@ -1237,8 +1531,14 @@ def to_dict(self) -> dict: result["remainingPercentage"] = to_float(self._remaining_percentage) result["usageAllowedWithExhaustedQuota"] = from_bool(self._usage_allowed_with_exhausted_quota) result["usedRequests"] = to_int(self._used_requests) + if self._has_quota is not None: + result["hasQuota"] = from_union([from_none, from_bool], self._has_quota) + if self._overage_entitlement is not None: + result["overageEntitlement"] = from_union([from_none, to_float], self._overage_entitlement) if self._reset_date is not None: result["resetDate"] = from_union([from_none, to_datetime], self._reset_date) + if self._token_based_billing is not None: + result["tokenBasedBilling"] = from_union([from_none, from_bool], self._token_based_billing) return result @@ -1294,15 +1594,18 @@ class AttachmentDirectory: display_name: str path: str type: ClassVar[str] = "directory" + tagged_files_entry: str | None = None @staticmethod def from_dict(obj: Any) -> "AttachmentDirectory": assert isinstance(obj, dict) display_name = from_str(obj.get("displayName")) path = from_str(obj.get("path")) + tagged_files_entry = from_union([from_none, from_str], obj.get("taggedFilesEntry")) return AttachmentDirectory( display_name=display_name, path=path, + tagged_files_entry=tagged_files_entry, ) def to_dict(self) -> dict: @@ -1310,6 +1613,8 @@ def to_dict(self) -> dict: result["displayName"] = from_str(self.display_name) result["path"] = from_str(self.path) result["type"] = self.type + if self.tagged_files_entry is not None: + result["taggedFilesEntry"] = from_union([from_none, from_str], self.tagged_files_entry) return result @@ -1368,6 +1673,7 @@ class AttachmentFile: line_range: AttachmentFileLineRange | None = None mime_type: str | None = None omitted_reason: OmittedBinaryOmittedReason | None = None + tagged_files_entry: str | None = None @staticmethod def from_dict(obj: Any) -> "AttachmentFile": @@ -1379,6 +1685,7 @@ def from_dict(obj: Any) -> "AttachmentFile": line_range = from_union([from_none, AttachmentFileLineRange.from_dict], obj.get("lineRange")) mime_type = from_union([from_none, from_str], obj.get("mimeType")) omitted_reason = from_union([from_none, lambda x: parse_enum(OmittedBinaryOmittedReason, x)], obj.get("omittedReason")) + tagged_files_entry = from_union([from_none, from_str], obj.get("taggedFilesEntry")) return AttachmentFile( display_name=display_name, path=path, @@ -1387,6 +1694,7 @@ def from_dict(obj: Any) -> "AttachmentFile": line_range=line_range, mime_type=mime_type, omitted_reason=omitted_reason, + tagged_files_entry=tagged_files_entry, ) def to_dict(self) -> dict: @@ -1404,6 +1712,8 @@ def to_dict(self) -> dict: result["mimeType"] = from_union([from_none, from_str], self.mime_type) if self.omitted_reason is not None: result["omittedReason"] = from_union([from_none, lambda x: to_enum(OmittedBinaryOmittedReason, x)], self.omitted_reason) + if self.tagged_files_entry is not None: + result["taggedFilesEntry"] = from_union([from_none, from_str], self.tagged_files_entry) return result @@ -1621,81 +1931,6 @@ def to_dict(self) -> dict: return result -@dataclass -class CanvasRegistryChangedCanvas: - "Schema for the `CanvasRegistryChangedCanvas` type." - canvas_id: str - description: str - display_name: str - extension_id: str - actions: list[CanvasRegistryChangedCanvasAction] | None = None - extension_name: str | None = None - input_schema: Any = None - - @staticmethod - def from_dict(obj: Any) -> "CanvasRegistryChangedCanvas": - assert isinstance(obj, dict) - canvas_id = from_str(obj.get("canvasId")) - description = from_str(obj.get("description")) - display_name = from_str(obj.get("displayName")) - extension_id = from_str(obj.get("extensionId")) - actions = from_union([from_none, lambda x: from_list(CanvasRegistryChangedCanvasAction.from_dict, x)], obj.get("actions")) - extension_name = from_union([from_none, from_str], obj.get("extensionName")) - input_schema = obj.get("inputSchema") - return CanvasRegistryChangedCanvas( - canvas_id=canvas_id, - description=description, - display_name=display_name, - extension_id=extension_id, - actions=actions, - extension_name=extension_name, - input_schema=input_schema, - ) - - def to_dict(self) -> dict: - result: dict = {} - result["canvasId"] = from_str(self.canvas_id) - result["description"] = from_str(self.description) - result["displayName"] = from_str(self.display_name) - result["extensionId"] = from_str(self.extension_id) - if self.actions is not None: - result["actions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(CanvasRegistryChangedCanvasAction, x), x)], self.actions) - if self.extension_name is not None: - result["extensionName"] = from_union([from_none, from_str], self.extension_name) - if self.input_schema is not None: - result["inputSchema"] = self.input_schema - return result - - -@dataclass -class CanvasRegistryChangedCanvasAction: - "Schema for the `CanvasRegistryChangedCanvasAction` type." - name: str - description: str | None = None - input_schema: Any = None - - @staticmethod - def from_dict(obj: Any) -> "CanvasRegistryChangedCanvasAction": - assert isinstance(obj, dict) - name = from_str(obj.get("name")) - description = from_union([from_none, from_str], obj.get("description")) - input_schema = obj.get("inputSchema") - return CanvasRegistryChangedCanvasAction( - name=name, - description=description, - input_schema=input_schema, - ) - - def to_dict(self) -> dict: - result: dict = {} - result["name"] = from_str(self.name) - if self.description is not None: - result["description"] = from_union([from_none, from_str], self.description) - if self.input_schema is not None: - result["inputSchema"] = self.input_schema - return result - - @dataclass class CapabilitiesChangedData: "Session capability change notification" @@ -2798,6 +3033,8 @@ class ModelCallFailureData: initiator: str | None = None model: str | None = None provider_call_id: str | None = None + # Internal: this field is an internal SDK API and is not part of the public surface. + _quota_snapshots: dict[str, _AssistantUsageQuotaSnapshot] | None = None request_fingerprint: ModelCallFailureRequestFingerprint | None = None service_request_id: str | None = None status_code: int | None = None @@ -2815,6 +3052,7 @@ def from_dict(obj: Any) -> "ModelCallFailureData": initiator = from_union([from_none, from_str], obj.get("initiator")) model = from_union([from_none, from_str], obj.get("model")) provider_call_id = from_union([from_none, from_str], obj.get("providerCallId")) + _quota_snapshots = from_union([from_none, lambda x: from_dict(_AssistantUsageQuotaSnapshot.from_dict, x)], obj.get("quotaSnapshots")) request_fingerprint = from_union([from_none, ModelCallFailureRequestFingerprint.from_dict], obj.get("requestFingerprint")) service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) status_code = from_union([from_none, from_int], obj.get("statusCode")) @@ -2829,6 +3067,7 @@ def from_dict(obj: Any) -> "ModelCallFailureData": initiator=initiator, model=model, provider_call_id=provider_call_id, + _quota_snapshots=_quota_snapshots, request_fingerprint=request_fingerprint, service_request_id=service_request_id, status_code=status_code, @@ -2855,6 +3094,8 @@ def to_dict(self) -> dict: result["model"] = from_union([from_none, from_str], self.model) if self.provider_call_id is not None: result["providerCallId"] = from_union([from_none, from_str], self.provider_call_id) + if self._quota_snapshots is not None: + result["quotaSnapshots"] = from_union([from_none, lambda x: from_dict(lambda x: to_class(_AssistantUsageQuotaSnapshot, x), x)], self._quota_snapshots) if self.request_fingerprint is not None: result["requestFingerprint"] = from_union([from_none, lambda x: to_class(ModelCallFailureRequestFingerprint, x)], self.request_fingerprint) if self.service_request_id is not None: @@ -3815,6 +4056,8 @@ class PermissionRequestShell: kind: ClassVar[str] = "shell" possible_paths: list[str] possible_urls: list[PermissionRequestShellPossibleUrl] + request_sandbox_bypass: bool | None = None + request_sandbox_bypass_reason: str | None = None tool_call_id: str | None = None warning: str | None = None @@ -3828,6 +4071,8 @@ def from_dict(obj: Any) -> "PermissionRequestShell": intention = from_str(obj.get("intention")) possible_paths = from_list(from_str, obj.get("possiblePaths")) possible_urls = from_list(PermissionRequestShellPossibleUrl.from_dict, obj.get("possibleUrls")) + request_sandbox_bypass = from_union([from_none, from_bool], obj.get("requestSandboxBypass")) + request_sandbox_bypass_reason = from_union([from_none, from_str], obj.get("requestSandboxBypassReason")) tool_call_id = from_union([from_none, from_str], obj.get("toolCallId")) warning = from_union([from_none, from_str], obj.get("warning")) return PermissionRequestShell( @@ -3838,6 +4083,8 @@ def from_dict(obj: Any) -> "PermissionRequestShell": intention=intention, possible_paths=possible_paths, possible_urls=possible_urls, + request_sandbox_bypass=request_sandbox_bypass, + request_sandbox_bypass_reason=request_sandbox_bypass_reason, tool_call_id=tool_call_id, warning=warning, ) @@ -3852,6 +4099,10 @@ def to_dict(self) -> dict: result["kind"] = self.kind result["possiblePaths"] = from_list(from_str, self.possible_paths) result["possibleUrls"] = from_list(lambda x: to_class(PermissionRequestShellPossibleUrl, x), self.possible_urls) + if self.request_sandbox_bypass is not None: + result["requestSandboxBypass"] = from_union([from_none, from_bool], self.request_sandbox_bypass) + if self.request_sandbox_bypass_reason is not None: + result["requestSandboxBypassReason"] = from_union([from_none, from_str], self.request_sandbox_bypass_reason) if self.tool_call_id is not None: result["toolCallId"] = from_union([from_none, from_str], self.tool_call_id) if self.warning is not None: @@ -4199,112 +4450,6 @@ def to_dict(self) -> dict: return result -@dataclass -class SessionCanvasClosedData: - "Schema for the `CanvasClosedData` type." - canvas_id: str - extension_id: str - instance_id: str - - @staticmethod - def from_dict(obj: Any) -> "SessionCanvasClosedData": - assert isinstance(obj, dict) - canvas_id = from_str(obj.get("canvasId")) - extension_id = from_str(obj.get("extensionId")) - instance_id = from_str(obj.get("instanceId")) - return SessionCanvasClosedData( - canvas_id=canvas_id, - extension_id=extension_id, - instance_id=instance_id, - ) - - def to_dict(self) -> dict: - result: dict = {} - result["canvasId"] = from_str(self.canvas_id) - result["extensionId"] = from_str(self.extension_id) - result["instanceId"] = from_str(self.instance_id) - return result - - -@dataclass -class SessionCanvasOpenedData: - "Schema for the `CanvasOpenedData` type." - availability: CanvasOpenedAvailability - canvas_id: str - extension_id: str - instance_id: str - reopen: bool - extension_name: str | None = None - input: Any = None - status: str | None = None - title: str | None = None - url: str | None = None - - @staticmethod - def from_dict(obj: Any) -> "SessionCanvasOpenedData": - assert isinstance(obj, dict) - availability = parse_enum(CanvasOpenedAvailability, obj.get("availability")) - canvas_id = from_str(obj.get("canvasId")) - extension_id = from_str(obj.get("extensionId")) - instance_id = from_str(obj.get("instanceId")) - reopen = from_bool(obj.get("reopen")) - extension_name = from_union([from_none, from_str], obj.get("extensionName")) - input = obj.get("input") - status = from_union([from_none, from_str], obj.get("status")) - title = from_union([from_none, from_str], obj.get("title")) - url = from_union([from_none, from_str], obj.get("url")) - return SessionCanvasOpenedData( - availability=availability, - canvas_id=canvas_id, - extension_id=extension_id, - instance_id=instance_id, - reopen=reopen, - extension_name=extension_name, - input=input, - status=status, - title=title, - url=url, - ) - - def to_dict(self) -> dict: - result: dict = {} - result["availability"] = to_enum(CanvasOpenedAvailability, self.availability) - result["canvasId"] = from_str(self.canvas_id) - result["extensionId"] = from_str(self.extension_id) - result["instanceId"] = from_str(self.instance_id) - result["reopen"] = from_bool(self.reopen) - if self.extension_name is not None: - result["extensionName"] = from_union([from_none, from_str], self.extension_name) - if self.input is not None: - result["input"] = self.input - if self.status is not None: - result["status"] = from_union([from_none, from_str], self.status) - if self.title is not None: - result["title"] = from_union([from_none, from_str], self.title) - if self.url is not None: - result["url"] = from_union([from_none, from_str], self.url) - return result - - -@dataclass -class SessionCanvasRegistryChangedData: - "Schema for the `CanvasRegistryChangedData` type." - canvases: list[CanvasRegistryChangedCanvas] - - @staticmethod - def from_dict(obj: Any) -> "SessionCanvasRegistryChangedData": - assert isinstance(obj, dict) - canvases = from_list(CanvasRegistryChangedCanvas.from_dict, obj.get("canvases")) - return SessionCanvasRegistryChangedData( - canvases=canvases, - ) - - def to_dict(self) -> dict: - result: dict = {} - result["canvases"] = from_list(lambda x: to_class(CanvasRegistryChangedCanvas, x), self.canvases) - return result - - @dataclass class SessionCompactionCompleteData: "Conversation compaction results including success status, metrics, and optional error details" @@ -4321,6 +4466,7 @@ class SessionCompactionCompleteData: pre_compaction_tokens: int | None = None request_id: str | None = None service_request_id: str | None = None + status_code: int | None = None summary_content: str | None = None system_tokens: int | None = None tokens_removed: int | None = None @@ -4342,6 +4488,7 @@ def from_dict(obj: Any) -> "SessionCompactionCompleteData": pre_compaction_tokens = from_union([from_none, from_int], obj.get("preCompactionTokens")) request_id = from_union([from_none, from_str], obj.get("requestId")) service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) + status_code = from_union([from_none, from_int], obj.get("statusCode")) summary_content = from_union([from_none, from_str], obj.get("summaryContent")) system_tokens = from_union([from_none, from_int], obj.get("systemTokens")) tokens_removed = from_union([from_none, from_int], obj.get("tokensRemoved")) @@ -4360,6 +4507,7 @@ def from_dict(obj: Any) -> "SessionCompactionCompleteData": pre_compaction_tokens=pre_compaction_tokens, request_id=request_id, service_request_id=service_request_id, + status_code=status_code, summary_content=summary_content, system_tokens=system_tokens, tokens_removed=tokens_removed, @@ -4393,6 +4541,8 @@ def to_dict(self) -> dict: result["requestId"] = from_union([from_none, from_str], self.request_id) if self.service_request_id is not None: result["serviceRequestId"] = from_union([from_none, from_str], self.service_request_id) + if self.status_code is not None: + result["statusCode"] = from_union([from_none, to_int], self.status_code) if self.summary_content is not None: result["summaryContent"] = from_union([from_none, from_str], self.summary_content) if self.system_tokens is not None: @@ -5036,6 +5186,7 @@ class SessionScheduleCreatedData: display_prompt: str | None = None interval: timedelta | None = None recurring: bool | None = None + self_paced: bool | None = None tz: str | None = None @staticmethod @@ -5048,6 +5199,7 @@ def from_dict(obj: Any) -> "SessionScheduleCreatedData": display_prompt = from_union([from_none, from_str], obj.get("displayPrompt")) interval = from_union([from_none, from_timedelta], obj.get("intervalMs")) recurring = from_union([from_none, from_bool], obj.get("recurring")) + self_paced = from_union([from_none, from_bool], obj.get("selfPaced")) tz = from_union([from_none, from_str], obj.get("tz")) return SessionScheduleCreatedData( id=id, @@ -5057,6 +5209,7 @@ def from_dict(obj: Any) -> "SessionScheduleCreatedData": display_prompt=display_prompt, interval=interval, recurring=recurring, + self_paced=self_paced, tz=tz, ) @@ -5074,11 +5227,36 @@ def to_dict(self) -> dict: result["intervalMs"] = from_union([from_none, to_timedelta_int], self.interval) if self.recurring is not None: result["recurring"] = from_union([from_none, from_bool], self.recurring) + if self.self_paced is not None: + result["selfPaced"] = from_union([from_none, from_bool], self.self_paced) if self.tz is not None: result["tz"] = from_union([from_none, from_str], self.tz) return result +@dataclass +class SessionScheduleRearmedData: + "Self-paced schedule re-armed for its next run" + id: int + next_run_at: int + + @staticmethod + def from_dict(obj: Any) -> "SessionScheduleRearmedData": + assert isinstance(obj, dict) + id = from_int(obj.get("id")) + next_run_at = from_int(obj.get("nextRunAt")) + return SessionScheduleRearmedData( + id=id, + next_run_at=next_run_at, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["id"] = to_int(self.id) + result["nextRunAt"] = to_int(self.next_run_at) + return result + + @dataclass class SessionShutdownData: "Session termination metrics including usage statistics, code changes, and shutdown reason" @@ -7667,14 +7845,6 @@ class BinaryAssetType(Enum): RESOURCE = "resource" -class CanvasOpenedAvailability(Enum): - "Runtime-controlled routing state for the instance. \"ready\" when the provider connection is live; \"stale\" when the provider has gone away and the instance is awaiting rebinding." - # Provider connection is live; actions can be invoked. - READY = "ready" - # Provider has gone away; the instance is awaiting rebinding. - STALE = "stale" - - class ContextTier(Enum): "Allowed values for the `ContextTier` enumeration." # Default context tier with standard context window size. @@ -7995,7 +8165,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionContextChangedData | SessionUsageInfoData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantIntentData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantUsageData | ModelCallFailureData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | SkillInvokedData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | SessionCustomNotificationData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionContextChangedData | SessionUsageInfoData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantIntentData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantUsageData | ModelCallFailureData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | SkillInvokedData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | SessionCustomNotificationData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -8029,6 +8199,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_TITLE_CHANGED: data = SessionTitleChangedData.from_dict(data_obj) case SessionEventType.SESSION_SCHEDULE_CREATED: data = SessionScheduleCreatedData.from_dict(data_obj) case SessionEventType.SESSION_SCHEDULE_CANCELLED: data = SessionScheduleCancelledData.from_dict(data_obj) + case SessionEventType.SESSION_SCHEDULE_REARMED: data = SessionScheduleRearmedData.from_dict(data_obj) case SessionEventType.SESSION_AUTOPILOT_OBJECTIVE_CHANGED: data = SessionAutopilotObjectiveChangedData.from_dict(data_obj) case SessionEventType.SESSION_INFO: data = SessionInfoData.from_dict(data_obj) case SessionEventType.SESSION_WARNING: data = SessionWarningData.from_dict(data_obj) @@ -8110,6 +8281,9 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_CANVAS_OPENED: data = SessionCanvasOpenedData.from_dict(data_obj) case SessionEventType.SESSION_CANVAS_REGISTRY_CHANGED: data = SessionCanvasRegistryChangedData.from_dict(data_obj) case SessionEventType.SESSION_CANVAS_CLOSED: data = SessionCanvasClosedData.from_dict(data_obj) + case SessionEventType.SESSION_CANVAS_UNAVAILABLE: data = SessionCanvasUnavailableData.from_dict(data_obj) + case SessionEventType.SESSION_CANVAS_RECORDED: data = SessionCanvasRecordedData.from_dict(data_obj) + case SessionEventType.SESSION_CANVAS_REMOVED: data = SessionCanvasRemovedData.from_dict(data_obj) case SessionEventType.SESSION_EXTENSIONS_ATTACHMENTS_PUSHED: data = SessionExtensionsAttachmentsPushedData.from_dict(data_obj) case SessionEventType.MCP_APP_TOOL_CALL_COMPLETE: data = McpAppToolCallCompleteData.from_dict(data_obj) case _: data = RawSessionEventData.from_dict(data_obj) @@ -8184,7 +8358,6 @@ def session_event_to_dict(x: SessionEvent) -> Any: "BinaryAssetReference", "BinaryAssetReferenceType", "BinaryAssetType", - "CanvasOpenedAvailability", "CanvasRegistryChangedCanvas", "CanvasRegistryChangedCanvasAction", "CapabilitiesChangedData", @@ -8305,7 +8478,10 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionBinaryAssetData", "SessionCanvasClosedData", "SessionCanvasOpenedData", + "SessionCanvasRecordedData", "SessionCanvasRegistryChangedData", + "SessionCanvasRemovedData", + "SessionCanvasUnavailableData", "SessionCompactionCompleteData", "SessionCompactionStartData", "SessionContextChangedData", @@ -8331,6 +8507,7 @@ def session_event_to_dict(x: SessionEvent) -> Any: "SessionResumeData", "SessionScheduleCancelledData", "SessionScheduleCreatedData", + "SessionScheduleRearmedData", "SessionShutdownData", "SessionSkillsLoadedData", "SessionSnapshotRewindData", diff --git a/python/copilot/session.py b/python/copilot/session.py index 678db8f69..b4c01b885 100644 --- a/python/copilot/session.py +++ b/python/copilot/session.py @@ -1696,12 +1696,7 @@ def _handle_broadcast_event(self, event: SessionEvent) -> None: case SessionCanvasOpenedData() as data: try: - if ( - not data.instance_id - or not data.canvas_id - or not data.extension_id - or data.availability is None - ): + if not data.instance_id or not data.canvas_id or not data.extension_id: raise ValueError("missing required open canvas fields") self._upsert_open_canvas(OpenCanvasInstance.from_dict(data.to_dict())) except Exception as exc: diff --git a/python/e2e/test_rpc_mcp_config_e2e.py b/python/e2e/test_rpc_mcp_config_e2e.py index bb8599860..efa41cda2 100644 --- a/python/e2e/test_rpc_mcp_config_e2e.py +++ b/python/e2e/test_rpc_mcp_config_e2e.py @@ -17,8 +17,8 @@ MCPConfigEnableRequest, MCPConfigRemoveRequest, MCPConfigUpdateRequest, + MCPGrantType, MCPServerConfig, - MCPServerConfigHTTPOauthGrantType, MCPServerConfigHTTPType, ) @@ -76,7 +76,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon headers={"Authorization": "Bearer token"}, oauth_client_id="client-id", oauth_public_client=False, - oauth_grant_type=MCPServerConfigHTTPOauthGrantType.CLIENT_CREDENTIALS, + oauth_grant_type=MCPGrantType.CLIENT_CREDENTIALS, tools=["*"], timeout=3000, ) @@ -85,7 +85,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon url="https://example.com/updated-mcp", oauth_client_id="updated-client-id", oauth_public_client=True, - oauth_grant_type=MCPServerConfigHTTPOauthGrantType.AUTHORIZATION_CODE, + oauth_grant_type=MCPGrantType.AUTHORIZATION_CODE, tools=["updated-tool"], timeout=4000, ) @@ -102,7 +102,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon assert added.headers["Authorization"] == "Bearer token" assert added.oauth_client_id == "client-id" assert added.oauth_public_client is False - assert added.oauth_grant_type == MCPServerConfigHTTPOauthGrantType.CLIENT_CREDENTIALS + assert added.oauth_grant_type == MCPGrantType.CLIENT_CREDENTIALS await ctx.client.rpc.mcp.config.update( MCPConfigUpdateRequest(name=server_name, config=updated_config) @@ -112,7 +112,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon assert updated.url == "https://example.com/updated-mcp" assert updated.oauth_client_id == "updated-client-id" assert updated.oauth_public_client is True - assert updated.oauth_grant_type == MCPServerConfigHTTPOauthGrantType.AUTHORIZATION_CODE + assert updated.oauth_grant_type == MCPGrantType.AUTHORIZATION_CODE assert updated.tools is not None and updated.tools[0] == "updated-tool" assert updated.timeout == 4000 finally: diff --git a/python/test_canvas.py b/python/test_canvas.py index 440df5ceb..8bcb79a23 100644 --- a/python/test_canvas.py +++ b/python/test_canvas.py @@ -18,7 +18,6 @@ OpenCanvasInstance, ) from copilot.rpc import ( - CanvasInstanceAvailability, CanvasProviderCloseRequest, CanvasProviderInvokeActionRequest, CanvasProviderOpenRequest, @@ -26,7 +25,6 @@ ) from copilot.session import CopilotSession from copilot.session_events import ( - CanvasOpenedAvailability, SessionCanvasClosedData, SessionCanvasOpenedData, SessionEvent, @@ -205,11 +203,9 @@ def test_register_canvas_handler_can_clear_generated_handler(): def test_set_open_canvases_round_trip(): inst = OpenCanvasInstance( - availability=CanvasInstanceAvailability.READY, canvas_id="c", extension_id="e", instance_id="i", - reopen=False, ) session = CopilotSession("sess-1", client=None) session._set_open_canvases([inst]) @@ -222,11 +218,9 @@ def test_session_canvas_opened_updates_open_canvases(caplog: pytest.LogCaptureFi session._dispatch_event( SessionEvent( data=SessionCanvasOpenedData( - availability=CanvasOpenedAvailability.READY, canvas_id="", extension_id="project:counter", instance_id="missing-canvas-id", - reopen=False, ), id=uuid4(), timestamp=datetime.now(UTC), @@ -236,12 +230,10 @@ def test_session_canvas_opened_updates_open_canvases(caplog: pytest.LogCaptureFi session._dispatch_event( SessionEvent( data=SessionCanvasOpenedData( - availability=CanvasOpenedAvailability.READY, canvas_id="counter", extension_id="project:counter", extension_name="Counter Provider", instance_id="counter-1", - reopen=False, input={"seed": 1}, status="ready", title="Counter", @@ -255,11 +247,9 @@ def test_session_canvas_opened_updates_open_canvases(caplog: pytest.LogCaptureFi session._dispatch_event( SessionEvent( data=SessionCanvasOpenedData( - availability=CanvasOpenedAvailability.STALE, canvas_id="logs", extension_id="project:logs", instance_id="logs-1", - reopen=False, title="Logs", ), id=uuid4(), @@ -277,12 +267,10 @@ def test_session_canvas_opened_updates_open_canvases(caplog: pytest.LogCaptureFi session._dispatch_event( SessionEvent( data=SessionCanvasOpenedData( - availability=CanvasOpenedAvailability.STALE, canvas_id="counter", extension_id="project:counter", extension_name="Counter Provider", instance_id="counter-1", - reopen=True, input={"seed": 2}, status="reconnected", title="Counter Updated", @@ -301,8 +289,6 @@ def test_session_canvas_opened_updates_open_canvases(caplog: pytest.LogCaptureFi assert open_canvases[0].status == "reconnected" assert open_canvases[0].url == "https://example.test/counter-updated" assert open_canvases[0].input == {"seed": 2} - assert open_canvases[0].reopen is True - assert open_canvases[0].availability == CanvasInstanceAvailability.STALE assert open_canvases[1].instance_id == "logs-1" @@ -313,11 +299,9 @@ def test_session_canvas_closed_removes_open_canvases(caplog: pytest.LogCaptureFi session._dispatch_event( SessionEvent( data=SessionCanvasOpenedData( - availability=CanvasOpenedAvailability.READY, canvas_id=canvas_id, extension_id=f"project:{canvas_id}", instance_id=instance_id, - reopen=False, ), id=uuid4(), timestamp=datetime.now(UTC), diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 522222b32..b1d85c0a5 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -515,6 +515,8 @@ pub mod rpc_methods { pub const SESSION_SCHEDULE_LIST: &str = "session.schedule.list"; /// `session.schedule.stop` pub const SESSION_SCHEDULE_STOP: &str = "session.schedule.stop"; + /// `providerToken.getToken` + pub const PROVIDERTOKEN_GETTOKEN: &str = "providerToken.getToken"; /// `sessionFs.readFile` pub const SESSIONFS_READFILE: &str = "sessionFs.readFile"; /// `sessionFs.writeFile` @@ -1400,6 +1402,9 @@ pub struct AttachmentDirectory { pub display_name: String, /// Absolute directory path pub path: String, + /// Frozen rendered line this attachment contributed to the prompt block (e.g. "* /path (12 items)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. + #[serde(skip_serializing_if = "Option::is_none")] + pub tagged_files_entry: Option, /// Attachment type discriminator pub r#type: AttachmentDirectoryType, } @@ -1481,6 +1486,9 @@ pub struct AttachmentFile { pub omitted_reason: Option, /// Absolute file path pub path: String, + /// Frozen rendered line this attachment contributed to the prompt block (e.g. "* /path (123 lines)"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. Present only for attachments routed to (mutually exclusive with assetId, which marks bytes sent natively). + #[serde(skip_serializing_if = "Option::is_none")] + pub tagged_files_entry: Option, /// Attachment type discriminator pub r#type: AttachmentFileType, } @@ -1759,8 +1767,6 @@ pub struct CanvasList { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct OpenCanvasInstance { - /// Runtime-controlled routing state for an open canvas instance. - pub availability: CanvasInstanceAvailability, /// Provider-local canvas identifier pub canvas_id: String, /// Owning provider identifier @@ -1773,8 +1779,6 @@ pub struct OpenCanvasInstance { pub input: Option, /// Stable caller-supplied canvas instance identifier pub instance_id: String, - /// Whether this snapshot came from an idempotent reopen - pub reopen: bool, /// Provider-supplied status text #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, @@ -1951,6 +1955,22 @@ pub struct CanvasProviderOpenResult { pub url: Option, } +/// Options scoped to the built-in CAPI (Copilot API) provider. +/// +///

+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub enable_web_socket_responses: Option, +} + /// Optional unstructured input hint /// ///
@@ -4457,7 +4477,7 @@ pub struct McpOauthHandlePendingResult { pub success: bool, } -/// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. +/// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. /// ///
/// @@ -4471,12 +4491,24 @@ pub struct 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. #[serde(skip_serializing_if = "Option::is_none")] pub callback_success_message: Option, + /// Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_id: Option, /// 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. #[serde(skip_serializing_if = "Option::is_none")] pub client_name: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_secret: Option, /// 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. #[serde(skip_serializing_if = "Option::is_none")] pub force_reauth: Option, + /// Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub grant_type: Option, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub public_client: Option, /// Name of the remote MCP server to authenticate pub server_name: String, } @@ -5551,11 +5583,17 @@ pub struct NamedProviderConfig { /// Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set. #[serde(skip_serializing_if = "Option::is_none")] pub bearer_token: Option, + /// 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 ` 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub has_bearer_token_provider: Option, /// Custom HTTP headers to include in all outbound requests to the provider. #[serde(skip_serializing_if = "Option::is_none")] pub headers: Option>, /// Stable identifier referenced by BYOK model definitions. Must not contain '/'. pub name: String, + /// Provider transport. Defaults to "http". + #[serde(skip_serializing_if = "Option::is_none")] + pub transport: Option, /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. #[serde(skip_serializing_if = "Option::is_none")] pub r#type: Option, @@ -7682,6 +7720,9 @@ pub struct ProviderConfig { /// Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set. #[serde(skip_serializing_if = "Option::is_none")] pub bearer_token: Option, + /// 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 ` 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub has_bearer_token_provider: Option, /// Custom HTTP headers to include in all outbound requests to the provider. #[serde(skip_serializing_if = "Option::is_none")] pub headers: Option>, @@ -7697,6 +7738,9 @@ pub struct ProviderConfig { /// Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model. #[serde(skip_serializing_if = "Option::is_none")] pub model_id: Option, + /// Provider transport. Defaults to "http". + #[serde(skip_serializing_if = "Option::is_none")] + pub transport: Option, /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. #[serde(skip_serializing_if = "Option::is_none")] pub r#type: Option, @@ -7752,6 +7796,9 @@ pub struct ProviderEndpoint { /// 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. #[serde(skip_serializing_if = "Option::is_none")] pub session_token: Option, + /// Transport to be used for provider requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub transport: Option, /// Provider family. Matches the `type` field of a BYOK provider config. pub r#type: ProviderEndpointType, /// Wire API to be used, when required for the provider type. @@ -7775,6 +7822,38 @@ pub struct ProviderGetEndpointRequest { pub model_id: Option, } +/// 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.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ProviderTokenAcquireRequest { + /// Target session identifier + pub session_id: SessionId, + /// 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`. + pub provider_name: String, +} + +/// A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer ` on the outbound request and does no caching; the SDK consumer owns token caching and refresh. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ProviderTokenAcquireResult { + /// The bearer token value (without the `Bearer ` prefix). + pub token: String, +} + /// Blob attachment with inline base64-encoded data /// ///
@@ -8554,6 +8633,22 @@ pub struct SandboxConfigUserPolicyNetwork { pub blocked_hosts: Option>, } +/// macOS seatbelt-specific options. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SandboxConfigUserPolicySeatbelt { + /// Whether the macOS seatbelt profile may access the keychain. + #[serde(skip_serializing_if = "Option::is_none")] + pub keychain_access: Option, +} + /// User-managed sandbox policy fragment merged into the auto-discovered base policy. /// ///
@@ -8565,7 +8660,7 @@ pub struct SandboxConfigUserPolicyNetwork { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SandboxConfigUserPolicy { - /// Platform-specific experimental policy fields. + /// Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent. #[serde(skip_serializing_if = "Option::is_none")] pub experimental: Option, /// Filesystem rules to merge into the base policy. @@ -8574,6 +8669,9 @@ pub struct SandboxConfigUserPolicy { /// Network rules to merge into the base policy. #[serde(skip_serializing_if = "Option::is_none")] pub network: Option, + /// macOS seatbelt options to merge into the base policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub seatbelt: Option, } /// Resolved sandbox configuration. @@ -8590,9 +8688,6 @@ pub struct SandboxConfig { /// Whether to auto-add the current working directory to readwritePaths. Default: true. #[serde(skip_serializing_if = "Option::is_none")] pub add_current_working_directory: Option, - /// Raw `ContainerConfig` (per `@microsoft/mxc-sdk`) passed directly to `spawnSandboxFromConfig`, bypassing policy merging. - #[serde(skip_serializing_if = "Option::is_none")] - pub config: Option, /// Whether sandboxing is enabled for the session. pub enabled: bool, /// User-managed sandbox policy fragment merged into the auto-discovered base policy. @@ -8631,6 +8726,9 @@ pub struct ScheduleEntry { pub prompt: String, /// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`). pub recurring: bool, + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub self_paced: Option, /// IANA timezone the `cron` expression is evaluated in. #[serde(skip_serializing_if = "Option::is_none")] pub tz: Option, @@ -9704,6 +9802,9 @@ pub struct SessionOpenOptions { /// Allowlist of available tool names. #[serde(skip_serializing_if = "Option::is_none")] pub available_tools: Option>, + /// Options scoped to the built-in CAPI (Copilot API) provider. + #[serde(skip_serializing_if = "Option::is_none")] + pub capi: Option, /// Structured client kind used for runtime behavior gates. #[serde(skip_serializing_if = "Option::is_none")] pub client_kind: Option, @@ -10789,6 +10890,9 @@ pub struct SessionUpdateOptionsParams { /// Allowlist of tool names available to this session. #[serde(skip_serializing_if = "Option::is_none")] pub available_tools: Option>, + /// Options scoped to the built-in CAPI (Copilot API) provider. + #[serde(skip_serializing_if = "Option::is_none")] + pub capi: Option, /// Identifier of the client driving the session. #[serde(skip_serializing_if = "Option::is_none")] pub client_name: Option, @@ -13817,8 +13921,6 @@ pub struct SessionCanvasListOpenResult { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionCanvasOpenResult { - /// Runtime-controlled routing state for an open canvas instance. - pub availability: CanvasInstanceAvailability, /// Provider-local canvas identifier pub canvas_id: String, /// Owning provider identifier @@ -13831,8 +13933,6 @@ pub struct SessionCanvasOpenResult { pub input: Option, /// Stable caller-supplied canvas instance identifier pub instance_id: String, - /// Whether this snapshot came from an idempotent reopen - pub reopen: bool, /// Provider-supplied status text #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, @@ -15206,6 +15306,9 @@ pub struct SessionProviderGetEndpointResult { /// 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. #[serde(skip_serializing_if = "Option::is_none")] pub session_token: Option, + /// Transport to be used for provider requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub transport: Option, /// Provider family. Matches the `type` field of a BYOK provider config. pub r#type: ProviderEndpointType, /// Wire API to be used, when required for the provider type. @@ -16725,6 +16828,21 @@ pub struct SessionScheduleStopResult { pub entry: Option, } +/// A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer ` on the outbound request and does no caching; the SDK consumer owns token caching and refresh. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ProviderTokenGetTokenResult { + /// The bearer token value (without the `Bearer ` prefix). + pub token: String, +} + /// Identifies the target session. /// ///
@@ -17257,28 +17375,6 @@ pub enum AuthInfoType { Unknown, } -/// Runtime-controlled routing state for an open canvas instance. -/// -///
-/// -/// **Experimental.** This type is part of an experimental wire-protocol surface -/// and may change or be removed in future SDK or CLI releases. -/// -///
-#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] -pub enum CanvasInstanceAvailability { - /// The owning provider is currently connected and routing calls will be dispatched normally. - #[serde(rename = "ready")] - Ready, - /// The owning provider is not currently connected. Routing calls fail with canvas_provider_unavailable until the agent re-issues open_canvas (which rehydrates via a fresh canvas.open) or the provider reconnects. - #[serde(rename = "stale")] - Stale, - /// Unknown variant for forward compatibility. - #[default] - #[serde(other)] - Unknown, -} - /// Optional completion hint for the input (e.g. 'directory' for filesystem path completion) /// ///
@@ -18056,6 +18152,28 @@ pub enum McpOauthPendingRequestResponse { Cancelled(McpOauthPendingRequestResponseCancelled), } +/// OAuth grant type override for this login. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum McpOauthLoginGrantType { + /// Interactive browser-based OAuth flow using an authorization code, typically with PKCE. + #[serde(rename = "authorization_code")] + AuthorizationCode, + /// Headless OAuth flow where a confidential client authenticates directly with a client secret. + #[serde(rename = "client_credentials")] + ClientCredentials, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// 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. /// ///
@@ -18274,6 +18392,28 @@ pub enum ModelPolicyState { Unknown, } +/// Provider transport. Defaults to "http". +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ProviderConfigTransport { + /// HTTP request/streaming transport. + #[serde(rename = "http")] + Http, + /// WebSocket transport. + #[serde(rename = "websockets")] + Websockets, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. /// ///
@@ -18990,6 +19130,28 @@ pub enum PermissionsSetApproveAllSource { Unknown, } +/// Transport to be used for provider requests. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ProviderEndpointTransport { + /// HTTP request/streaming transport. + #[serde(rename = "http")] + Http, + /// WebSocket transport. + #[serde(rename = "websockets")] + Websockets, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Provider family. Matches the `type` field of a BYOK provider config. /// ///
@@ -20184,6 +20346,9 @@ pub enum WorkspaceDiffMode { /// Return changes compared with the default branch. #[serde(rename = "branch")] Branch, + /// Return the cumulative diff of files Copilot changed this session (used in non-git workspaces). + #[serde(rename = "session")] + Session, /// Unknown variant for forward compatibility. #[default] #[serde(other)] diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 608dfa939..57a5192dc 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -4682,7 +4682,7 @@ impl<'a> SessionRpcMcpOauth<'a> { /// /// # Parameters /// - /// * `params` - Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. + /// * `params` - Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection. /// /// # Returns /// diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 78269cb6c..e094ec365 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -25,6 +25,8 @@ pub enum SessionEventType { SessionScheduleCreated, #[serde(rename = "session.schedule_cancelled")] SessionScheduleCancelled, + #[serde(rename = "session.schedule_rearmed")] + SessionScheduleRearmed, #[serde(rename = "session.autopilot_objective_changed")] SessionAutopilotObjectiveChanged, #[serde(rename = "session.info")] @@ -188,12 +190,60 @@ pub enum SessionEventType { SessionMcpServerStatusChanged, #[serde(rename = "session.extensions_loaded")] SessionExtensionsLoaded, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "session.canvas.opened")] SessionCanvasOpened, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "session.canvas.registry_changed")] SessionCanvasRegistryChanged, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "session.canvas.closed")] SessionCanvasClosed, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.canvas.unavailable")] + SessionCanvasUnavailable, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.canvas.recorded")] + SessionCanvasRecorded, + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.canvas.removed")] + SessionCanvasRemoved, #[serde(rename = "session.extensions.attachments_pushed")] SessionExtensionsAttachmentsPushed, #[serde(rename = "mcp_app.tool_call_complete")] @@ -226,6 +276,8 @@ pub enum SessionEventData { SessionScheduleCreated(SessionScheduleCreatedData), #[serde(rename = "session.schedule_cancelled")] SessionScheduleCancelled(SessionScheduleCancelledData), + #[serde(rename = "session.schedule_rearmed")] + SessionScheduleRearmed(SessionScheduleRearmedData), #[serde(rename = "session.autopilot_objective_changed")] SessionAutopilotObjectiveChanged(SessionAutopilotObjectiveChangedData), #[serde(rename = "session.info")] @@ -382,12 +434,60 @@ pub enum SessionEventData { SessionMcpServerStatusChanged(SessionMcpServerStatusChangedData), #[serde(rename = "session.extensions_loaded")] SessionExtensionsLoaded(SessionExtensionsLoadedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "session.canvas.opened")] SessionCanvasOpened(SessionCanvasOpenedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "session.canvas.registry_changed")] SessionCanvasRegistryChanged(SessionCanvasRegistryChangedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
#[serde(rename = "session.canvas.closed")] SessionCanvasClosed(SessionCanvasClosedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.canvas.unavailable")] + SessionCanvasUnavailable(SessionCanvasUnavailableData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.canvas.recorded")] + SessionCanvasRecorded(SessionCanvasRecordedData), + /// + ///
+ /// + /// **Experimental.** This type is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. + /// + ///
+ #[serde(rename = "session.canvas.removed")] + SessionCanvasRemoved(SessionCanvasRemovedData), #[serde(rename = "session.extensions.attachments_pushed")] SessionExtensionsAttachmentsPushed(SessionExtensionsAttachmentsPushedData), #[serde(rename = "mcp_app.tool_call_complete")] @@ -609,6 +709,9 @@ pub struct SessionScheduleCreatedData { /// Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`) #[serde(skip_serializing_if = "Option::is_none")] pub recurring: Option, + /// True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled rather than auto-computed. + #[serde(skip_serializing_if = "Option::is_none")] + pub self_paced: Option, /// IANA timezone the `cron` expression is evaluated in #[serde(skip_serializing_if = "Option::is_none")] pub tz: Option, @@ -622,6 +725,16 @@ pub struct SessionScheduleCancelledData { pub id: i64, } +/// Session event "session.schedule_rearmed". Self-paced schedule re-armed for its next run +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionScheduleRearmedData { + /// Id of the self-paced schedule that was re-armed + pub id: i64, + /// Absolute time (epoch milliseconds) the model armed the next run to fire + pub next_run_at: i64, +} + /// Session event "session.autopilot_objective_changed". Autopilot objective state file operation details indicating what changed #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -1118,6 +1231,9 @@ pub struct SessionCompactionCompleteData { /// Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call #[serde(skip_serializing_if = "Option::is_none")] pub service_request_id: Option, + /// For failed compaction only: the HTTP status code of the compaction LLM call failure, when it carried one. Absent for successful compaction and for failures without an HTTP status (e.g. an empty model response or a transport error). + #[serde(skip_serializing_if = "Option::is_none")] + pub status_code: Option, /// Whether compaction completed successfully pub success: bool, /// LLM-generated summary of the compacted conversation history @@ -1500,6 +1616,10 @@ pub(crate) struct AssistantUsageQuotaSnapshot { /// Total requests allowed by the entitlement #[doc(hidden)] pub(crate) entitlement_requests: i64, + /// Whether the user currently has quota available for use + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) has_quota: Option, /// Whether the user has an unlimited usage entitlement #[doc(hidden)] pub(crate) is_unlimited_entitlement: bool, @@ -1509,6 +1629,10 @@ pub(crate) struct AssistantUsageQuotaSnapshot { /// Whether additional usage is allowed when quota is exhausted #[doc(hidden)] pub(crate) overage_allowed_with_exhausted_quota: bool, + /// Pay-as-you-go additional-usage budget cap in AI credits (1 credit = $0.01); present only when CAPI emits a finite value + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) overage_entitlement: Option, /// Percentage of quota remaining (0 to 100) #[doc(hidden)] pub(crate) remaining_percentage: f64, @@ -1516,6 +1640,10 @@ pub(crate) struct AssistantUsageQuotaSnapshot { #[doc(hidden)] #[serde(skip_serializing_if = "Option::is_none")] pub(crate) reset_date: Option, + /// Whether this snapshot uses token-based billing (AI-credits allocation) + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) token_based_billing: Option, /// Whether usage is still permitted after quota exhaustion #[doc(hidden)] pub(crate) usage_allowed_with_exhausted_quota: bool, @@ -1654,6 +1782,10 @@ pub struct ModelCallFailureData { /// GitHub request tracing ID (x-github-request-id header) for server-side log correlation #[serde(skip_serializing_if = "Option::is_none")] pub provider_call_id: Option, + /// Per-quota usage snapshots parsed from the failed response's quota headers, keyed by quota identifier. Present when the error response carried quota headers (e.g. a 402 once the additional spend limit is reached) so the UI can refresh the quota display on failure. + #[doc(hidden)] + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) quota_snapshots: Option>, /// Content-free structural summary of the failing request. Contains only counts and shape flags (no prompt content), so it is safe for unrestricted telemetry. Populated only for client-error (4xx) failures. #[serde(skip_serializing_if = "Option::is_none")] pub request_fingerprint: Option, @@ -2427,6 +2559,12 @@ pub struct PermissionRequestShell { pub possible_paths: Vec, /// URLs that may be accessed by the command pub possible_urls: Vec, + /// True when the model has requested to run this command outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_sandbox_bypass: Option, + /// Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_sandbox_bypass_reason: Option, /// Tool call ID that triggered this permission request #[serde(skip_serializing_if = "Option::is_none")] pub tool_call_id: Option, @@ -3523,11 +3661,16 @@ pub struct SessionExtensionsLoadedData { } /// Session event "session.canvas.opened". +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionCanvasOpenedData { - /// Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. - pub availability: CanvasOpenedAvailability, /// Provider-local canvas identifier pub canvas_id: String, /// Owning provider identifier @@ -3540,8 +3683,6 @@ pub struct SessionCanvasOpenedData { pub input: Option, /// Stable caller-supplied canvas instance identifier pub instance_id: String, - /// Whether this notification represents an idempotent reopen - pub reopen: bool, /// Provider-supplied status text #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, @@ -3554,6 +3695,13 @@ pub struct SessionCanvasOpenedData { } /// Schema for the `CanvasRegistryChangedCanvasAction` type. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CanvasRegistryChangedCanvasAction { @@ -3568,6 +3716,13 @@ pub struct CanvasRegistryChangedCanvasAction { } /// Schema for the `CanvasRegistryChangedCanvas` type. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CanvasRegistryChangedCanvas { @@ -3591,6 +3746,13 @@ pub struct CanvasRegistryChangedCanvas { } /// Session event "session.canvas.registry_changed". +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionCanvasRegistryChangedData { @@ -3599,6 +3761,13 @@ pub struct SessionCanvasRegistryChangedData { } /// Session event "session.canvas.closed". +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionCanvasClosedData { @@ -3610,6 +3779,69 @@ pub struct SessionCanvasClosedData { pub instance_id: String, } +/// Session event "session.canvas.unavailable". Transient signal that an open canvas instance's provider has dropped (for example the extension is reloading mid-session). The host should keep the panel mounted and surface a reconnecting affordance rather than tearing it down; a subsequent `session.canvas.opened` for the same instanceId clears the affordance once the provider reconnects with a fresh url. Ephemeral and never persisted, so it is never replayed on cold resume. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionCanvasUnavailableData { + /// Provider-local canvas identifier + pub canvas_id: String, + /// Owning provider identifier + pub extension_id: String, + /// Stable caller-supplied identifier of the canvas instance whose provider became unavailable + pub instance_id: String, +} + +/// Session event "session.canvas.recorded". Durable record that a canvas instance is open, used to restore open canvases on cold session resume. Intentionally omits the transient url and availability. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionCanvasRecordedData { + /// Provider-local canvas identifier + pub canvas_id: String, + /// Owning provider identifier + pub extension_id: String, + /// Input supplied when the instance was opened + #[serde(skip_serializing_if = "Option::is_none")] + pub input: Option, + /// Stable caller-supplied canvas instance identifier + pub instance_id: String, + /// Rendered title + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +/// Session event "session.canvas.removed". Durable record that a canvas instance was closed, superseding a prior instance_recorded during resume replay. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionCanvasRemovedData { + /// Provider-local canvas identifier + pub canvas_id: String, + /// Owning provider identifier + pub extension_id: String, + /// Stable caller-supplied identifier of the canvas instance that was closed + pub instance_id: String, +} + /// Session event "session.extensions.attachments_pushed". #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -4794,18 +5026,3 @@ pub enum ExtensionsLoadedExtensionStatus { #[serde(other)] Unknown, } - -/// Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding. -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] -pub enum CanvasOpenedAvailability { - /// Provider connection is live; actions can be invoked. - #[serde(rename = "ready")] - Ready, - /// Provider has gone away; the instance is awaiting rebinding. - #[serde(rename = "stale")] - Stale, - /// Unknown variant for forward compatibility. - #[default] - #[serde(other)] - Unknown, -} diff --git a/rust/tests/e2e/rpc_mcp_and_skills.rs b/rust/tests/e2e/rpc_mcp_and_skills.rs index 1ad551569..3f6cc0502 100644 --- a/rust/tests/e2e/rpc_mcp_and_skills.rs +++ b/rust/tests/e2e/rpc_mcp_and_skills.rs @@ -573,6 +573,10 @@ async fn should_report_error_when_mcp_host_is_not_initialized() { callback_success_message: None, client_name: None, force_reauth: None, + client_id: None, + client_secret: None, + grant_type: None, + public_client: None, }), "MCP host is not available", ) @@ -608,6 +612,10 @@ async fn should_report_error_when_mcp_oauth_server_is_not_configured() { callback_success_message: None, client_name: None, force_reauth: None, + client_id: None, + client_secret: None, + grant_type: None, + public_client: None, }), "is not configured", ) @@ -645,6 +653,10 @@ async fn should_report_error_when_mcp_oauth_server_is_not_remote() { callback_success_message: Some("Done".to_string()), client_name: Some("SDK E2E".to_string()), force_reauth: Some(true), + client_id: None, + client_secret: None, + grant_type: None, + public_client: None, }), "not a remote server", ) diff --git a/rust/tests/session_test.rs b/rust/tests/session_test.rs index 99d8c1391..98c624823 100644 --- a/rust/tests/session_test.rs +++ b/rust/tests/session_test.rs @@ -12,8 +12,8 @@ use github_copilot_sdk::handler::{ ExitPlanModeHandler, ExitPlanModeResult, UserInputHandler, UserInputResponse, }; use github_copilot_sdk::rpc::{ - CanvasInstanceAvailability, CanvasProviderInvokeActionRequest, CanvasProviderOpenRequest, - CanvasProviderOpenResult, OpenCanvasInstance, + CanvasProviderInvokeActionRequest, CanvasProviderOpenRequest, CanvasProviderOpenResult, + OpenCanvasInstance, }; use github_copilot_sdk::session_events::ReasoningSummary; use github_copilot_sdk::types::{ @@ -2623,8 +2623,6 @@ async fn resume_session_sends_canvas_fields_and_captures_open_canvases() { status: Some("ready".to_string()), url: Some("https://example.test/counter".to_string()), input: Some(serde_json::json!({ "seed": 1 })), - reopen: false, - availability: CanvasInstanceAvailability::Stale, }]); client.resume_session(cfg).await.unwrap() } @@ -2641,8 +2639,8 @@ async fn resume_session_sends_canvas_fields_and_captures_open_canvases() { "counter-provider" ); assert_eq!( - request["params"]["openCanvases"][0]["availability"], - "stale" + request["params"]["openCanvases"][0]["instanceId"], + "counter-1" ); let id = request["id"].as_u64().unwrap(); @@ -2655,9 +2653,7 @@ async fn resume_session_sends_canvas_fields_and_captures_open_canvases() { "extensionId": "project:counter", "canvasId": "counter", "instanceId": "counter-1", - "url": "https://example.test/counter", - "reopen": false, - "availability": "ready" + "url": "https://example.test/counter" }], "capabilities": { "ui": { "canvases": true } @@ -2676,7 +2672,6 @@ async fn resume_session_sends_canvas_fields_and_captures_open_canvases() { let open = session.open_canvases(); assert_eq!(open.len(), 1); assert_eq!(open[0].instance_id, "counter-1"); - assert_eq!(open[0].availability, CanvasInstanceAvailability::Ready); let caps = session.capabilities(); assert_eq!(caps.ui.unwrap().canvases, Some(true)); } @@ -2705,9 +2700,7 @@ async fn session_canvas_opened_updates_open_canvas_snapshots() { "title": "Counter", "status": "ready", "url": "https://example.test/counter", - "input": { "seed": 1 }, - "reopen": false, - "availability": "ready" + "input": { "seed": 1 } }), ) .await; @@ -2718,9 +2711,7 @@ async fn session_canvas_opened_updates_open_canvas_snapshots() { "extensionId": "project:logs", "canvasId": "logs", "instanceId": "logs-1", - "title": "Logs", - "reopen": false, - "availability": "stale" + "title": "Logs" }), ) .await; @@ -2736,7 +2727,6 @@ async fn session_canvas_opened_updates_open_canvas_snapshots() { assert_eq!(open.len(), 2); assert_eq!(open[0].instance_id, "counter-1"); assert_eq!(open[0].title.as_deref(), Some("Counter")); - assert_eq!(open[0].availability, CanvasInstanceAvailability::Ready); assert_eq!(open[1].instance_id, "logs-1"); server @@ -2750,9 +2740,7 @@ async fn session_canvas_opened_updates_open_canvas_snapshots() { "title": "Counter Updated", "status": "reconnected", "url": "https://example.test/counter-updated", - "input": { "seed": 2 }, - "reopen": true, - "availability": "stale" + "input": { "seed": 2 } }), ) .await; @@ -2773,8 +2761,6 @@ async fn session_canvas_opened_updates_open_canvas_snapshots() { Some("https://example.test/counter-updated") ); assert_eq!(open[0].input, Some(serde_json::json!({ "seed": 2 }))); - assert!(open[0].reopen); - assert_eq!(open[0].availability, CanvasInstanceAvailability::Stale); assert_eq!(open[1].instance_id, "logs-1"); } @@ -2790,9 +2776,7 @@ async fn session_canvas_closed_removes_open_canvas_snapshot() { "extensionId": "project:counter", "canvasId": "counter", "instanceId": "counter-1", - "title": "Counter", - "reopen": false, - "availability": "ready" + "title": "Counter" }), ) .await; @@ -2803,9 +2787,7 @@ async fn session_canvas_closed_removes_open_canvas_snapshot() { "extensionId": "project:logs", "canvasId": "logs", "instanceId": "logs-1", - "title": "Logs", - "reopen": false, - "availability": "ready" + "title": "Logs" }), ) .await; diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 865c67bc9..80a2d239f 100644 --- a/test/harness/package-lock.json +++ b/test/harness/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@github/copilot": "^1.0.64-3", + "@github/copilot": "^1.0.65", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", @@ -501,9 +501,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.64-3.tgz", - "integrity": "sha512-Q9nBMYEHX1bJLXzzJocQx2nZvORJ0E9gvK6ly/FCtmtA7ad96BWZvf4EHzkCNDsn56aI3zNaUSfKHUKcmIAzSg==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.65.tgz", + "integrity": "sha512-J1XvLuOiVpiAi/E1MBICBymszCgdGLnZxokosXzGcmcjEVZd+QSDoW/kPRHq6oEyBT9SDASPcjCEZ9Q0rLJllg==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -513,20 +513,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.64-3", - "@github/copilot-darwin-x64": "1.0.64-3", - "@github/copilot-linux-arm64": "1.0.64-3", - "@github/copilot-linux-x64": "1.0.64-3", - "@github/copilot-linuxmusl-arm64": "1.0.64-3", - "@github/copilot-linuxmusl-x64": "1.0.64-3", - "@github/copilot-win32-arm64": "1.0.64-3", - "@github/copilot-win32-x64": "1.0.64-3" + "@github/copilot-darwin-arm64": "1.0.65", + "@github/copilot-darwin-x64": "1.0.65", + "@github/copilot-linux-arm64": "1.0.65", + "@github/copilot-linux-x64": "1.0.65", + "@github/copilot-linuxmusl-arm64": "1.0.65", + "@github/copilot-linuxmusl-x64": "1.0.65", + "@github/copilot-win32-arm64": "1.0.65", + "@github/copilot-win32-x64": "1.0.65" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.64-3.tgz", - "integrity": "sha512-wlV6mRoAd/wG2V08TG+BOJ0nyOjroya24FSyA5A49z7PnUUuQXYRpa/GljvI5j3PM8aUl0DyBkXuB/DcFU818g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.65.tgz", + "integrity": "sha512-NFc4xIstZNiIuAYkurQT5DVtbZjBoZ/z6yt/Ffcom7Y5QGjfpN4BFuekv9k+OADRioxxR99NgmhjbuNPWtQhNQ==", "cpu": [ "arm64" ], @@ -541,9 +541,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.64-3.tgz", - "integrity": "sha512-mk48PIESL2keeemX7tLRmWRDxKwl0q3cFI1ORD2QcrieNK7pSqI3eVbfoB7MqoUUI27yzIkl67xqgl8Qq28IUQ==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.65.tgz", + "integrity": "sha512-0wtV22KmTa12VbqWRRkgvJcBz/oIbszfcIpyDWGc4MzbCVksajQ3TWVQ6c7Sdzj5RifCaYdkHAX2zuIYXYlLoQ==", "cpu": [ "x64" ], @@ -558,9 +558,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.64-3.tgz", - "integrity": "sha512-rCgtK3/rofQW5StSbeU0TwDUlOl2bvS2HGKyapVxow1Nvz3Q/TDB+eFRQc5ocBdv5tNSor+Caw2JGkRx5v508w==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.65.tgz", + "integrity": "sha512-dOwdy/YbTXQN/+x2v4ZgiDycdRtWElyHxPuA6ail3yJDt0nagwn8OYAA/diBLPMAJuuBXiOZGvvb9fGRuh7Xgg==", "cpu": [ "arm64" ], @@ -575,9 +575,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.64-3.tgz", - "integrity": "sha512-FAiBMw1h07mURSBLi3ztj5yzbP+uTbo9mhxOym1Xysut5LDpO2kYUzTYk2DlIyLGZhmH/HDOZE+b6U7lOUQy0g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.65.tgz", + "integrity": "sha512-al/1a/l/GrpHtygTxt7PZspmv0eHBPdAZ5B31J7Hv/GRdVZM4STCC9dCIOSUFsOX2fhaKD8yLfz4HureSYs23g==", "cpu": [ "x64" ], @@ -592,9 +592,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.64-3.tgz", - "integrity": "sha512-vn8P6grPf0y2mNskkdVbAz0i46b1sP9uSXv7z6kgycjprl0CdIYPDf3WEkG60vpyopfQna+iCqCLMWRnNyCk3g==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.65.tgz", + "integrity": "sha512-xccQeJSR45xyoaL7J5mZjtU++dmte+ZCDQkIlrpTn2yuMl2LWriBvorQ1P2MwVnXmIiW/GHi93B+lNtsybA9yw==", "cpu": [ "arm64" ], @@ -609,9 +609,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.64-3.tgz", - "integrity": "sha512-atdHimNd6nzRRwHybXUY6/84bYzXeKbDOeYN/N/DsX23+AQOPSu5BD8MD8166I/5kNHui0XOmeTSydVNBUwcJw==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.65.tgz", + "integrity": "sha512-RHPVUaqjSrhKHQ2EpfGKWErnV+R5elGIZaHXPKO10zpSaQD9b/C9u6nLigZnBuT/8sCaJpVrazPMwOYvYA62aw==", "cpu": [ "x64" ], @@ -626,9 +626,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.64-3.tgz", - "integrity": "sha512-jUTS9meoHEXQR8nMDOjwC0baqV273lYtLxY46W7TiOFszhsqhbhWxQMkNQBfT3GEfPp+40igzMPq3reaUTuvag==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.65.tgz", + "integrity": "sha512-/vSE/t9Wm3eFSWpxlKyn/oL8OAVOB0yFO7ECxhgbtiqNrBd1tgpYh1k7IXBIWa/saxlV1+de6DEmPuQfx3Z0bg==", "cpu": [ "arm64" ], @@ -643,9 +643,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.64-3", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.64-3.tgz", - "integrity": "sha512-gHUhS500Q91hjtH9fqKDblaIs0mO09G4ifpZ1woDPXbkdKe/W29uwB7g2fn0+KczNRyPxFSWlqjnOon4Fe8svA==", + "version": "1.0.65", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.65.tgz", + "integrity": "sha512-wjVWXepET+SpFg8z8V43ZiTy6X1OerCb7yu3QZKNNJ3zY9z20goihPXQCDWkiJpGzszNSgfrsiqUzpUsC9qS0A==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index f1506e95d..d13dbb99a 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -14,7 +14,7 @@ "node": "^20.19.0 || >=22.12.0" }, "devDependencies": { - "@github/copilot": "^1.0.64-3", + "@github/copilot": "^1.0.65", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14",