diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index cafc03f20..3fac45256 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -66,6 +66,26 @@ internal sealed class ConnectRequest public string? Token { get; set; } } +/// Long context tier pricing (available for models with extended context windows). +public sealed class ModelBillingTokenPricesLongContext +{ + /// AI Credits cost per billing batch of cached tokens. + [JsonPropertyName("cachePrice")] + public double? CachePrice { get; set; } + + /// Maximum context window tokens for the long context tier. + [JsonPropertyName("contextMax")] + public long? ContextMax { get; set; } + + /// AI Credits cost per billing batch of input tokens. + [JsonPropertyName("inputPrice")] + public double? InputPrice { get; set; } + + /// AI Credits cost per billing batch of output tokens. + [JsonPropertyName("outputPrice")] + public double? OutputPrice { get; set; } +} + /// Token-level pricing information for this model. public sealed class ModelBillingTokenPrices { @@ -73,17 +93,25 @@ public sealed class ModelBillingTokenPrices [JsonPropertyName("batchSize")] public long? BatchSize { get; set; } - /// Price per billing batch of cached tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD). + /// AI Credits cost per billing batch of cached tokens. [JsonPropertyName("cachePrice")] - public long? CachePrice { get; set; } + public double? CachePrice { get; set; } + + /// Maximum context window tokens for the default tier. + [JsonPropertyName("contextMax")] + public long? ContextMax { get; set; } - /// Price per billing batch of input tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD). + /// AI Credits cost per billing batch of input tokens. [JsonPropertyName("inputPrice")] - public long? InputPrice { get; set; } + public double? InputPrice { get; set; } - /// Price per billing batch of output tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD). + /// Long context tier pricing (available for models with extended context windows). + [JsonPropertyName("longContext")] + public ModelBillingTokenPricesLongContext? LongContext { get; set; } + + /// AI Credits cost per billing batch of output tokens. [JsonPropertyName("outputPrice")] - public long? OutputPrice { get; set; } + public double? OutputPrice { get; set; } } /// Billing information. @@ -352,7 +380,7 @@ public sealed class DiscoveredMcpServer [JsonPropertyName("source")] public McpServerSource Source { get; set; } - /// Server transport type: stdio, http, sse, or memory. + /// Server transport type: stdio, http, sse (deprecated), or memory. [JsonPropertyName("type")] public DiscoveredMcpServerType? Type { get; set; } } @@ -3596,6 +3624,287 @@ internal sealed class McpOauthLoginRequest public string SessionId { get; set; } = string.Empty; } +/// Schema for the `McpAppsResourceContent` type. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsResourceContent +{ + /// Resource-level metadata (CSP, permissions, etc.). + [JsonPropertyName("_meta")] + public IDictionary? _meta { get; set; } + + /// Base64-encoded binary content. + [JsonPropertyName("blob")] + public string? Blob { get; set; } + + /// MIME type of the content. + [JsonPropertyName("mimeType")] + public string? MimeType { get; set; } + + /// Text content (e.g. HTML). + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// The resource URI (typically ui://...). + [JsonPropertyName("uri")] + public string Uri { get; set; } = string.Empty; +} + +/// Resource contents returned by the MCP server. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsReadResourceResult +{ + /// Resource contents returned by the server. + [JsonPropertyName("contents")] + public IList Contents { get => field ??= []; set; } +} + +/// MCP server and resource URI to fetch. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpAppsReadResourceRequest +{ + /// Name of the MCP server hosting the resource. + [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("serverName")] + public string ServerName { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// Resource URI (typically ui://...). + [JsonPropertyName("uri")] + public string Uri { get; set; } = string.Empty; +} + +/// App-callable tools from the named MCP server. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsListToolsResult +{ + /// App-callable tools from the server. + [JsonPropertyName("tools")] + public IList> Tools { get => field ??= []; set; } +} + +/// MCP server to list app-callable tools for. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpAppsListToolsRequest +{ + /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("originServerName")] + public string OriginServerName { get; set; } = string.Empty; + + /// MCP server hosting the app. + [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("serverName")] + public string ServerName { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// MCP server, tool name, and arguments to invoke from an MCP App view. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpAppsCallToolRequest +{ + /// Tool arguments. + [JsonPropertyName("arguments")] + public IDictionary? Arguments { get; set; } + + /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("originServerName")] + public string OriginServerName { get; set; } = string.Empty; + + /// MCP server hosting the tool. + [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("serverName")] + public string ServerName { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// MCP tool name. + [JsonPropertyName("toolName")] + public string ToolName { get; set; } = string.Empty; +} + +/// Host context advertised to MCP App guests. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsSetHostContextDetails +{ + /// Display modes the host supports. + [JsonPropertyName("availableDisplayModes")] + public IList? AvailableDisplayModes { get; set; } + + /// Current display mode (SEP-1865). + [JsonPropertyName("displayMode")] + public McpAppsSetHostContextDetailsDisplayMode? DisplayMode { get; set; } + + /// BCP-47 locale, e.g. 'en-US'. + [JsonPropertyName("locale")] + public string? Locale { get; set; } + + /// Platform type for responsive design. + [JsonPropertyName("platform")] + public McpAppsSetHostContextDetailsPlatform? Platform { get; set; } + + /// UI theme preference per SEP-1865. + [JsonPropertyName("theme")] + public McpAppsSetHostContextDetailsTheme? Theme { get; set; } + + /// IANA timezone, e.g. 'America/New_York'. + [JsonPropertyName("timeZone")] + public string? TimeZone { get; set; } + + /// Host application identifier. + [JsonPropertyName("userAgent")] + public string? UserAgent { get; set; } +} + +/// Host context to advertise to MCP App guests. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpAppsSetHostContextRequest +{ + /// Host context advertised to MCP App guests. + [JsonPropertyName("context")] + public McpAppsSetHostContextDetails Context { get => field ??= new(); set; } + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Current host context. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsHostContextDetails +{ + /// Display modes the host supports. + [JsonPropertyName("availableDisplayModes")] + public IList? AvailableDisplayModes { get; set; } + + /// Current display mode (SEP-1865). + [JsonPropertyName("displayMode")] + public McpAppsHostContextDetailsDisplayMode? DisplayMode { get; set; } + + /// BCP-47 locale, e.g. 'en-US'. + [JsonPropertyName("locale")] + public string? Locale { get; set; } + + /// Platform type for responsive design. + [JsonPropertyName("platform")] + public McpAppsHostContextDetailsPlatform? Platform { get; set; } + + /// UI theme preference per SEP-1865. + [JsonPropertyName("theme")] + public McpAppsHostContextDetailsTheme? Theme { get; set; } + + /// IANA timezone, e.g. 'America/New_York'. + [JsonPropertyName("timeZone")] + public string? TimeZone { get; set; } + + /// Host application identifier. + [JsonPropertyName("userAgent")] + public string? UserAgent { get; set; } +} + +/// Current host context advertised to MCP App guests. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsHostContext +{ + /// Current host context. + [JsonPropertyName("context")] + public McpAppsHostContextDetails Context { get => field ??= new(); set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionMcpAppsGetHostContextRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + +/// Capability negotiation snapshot. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsDiagnoseCapability +{ + /// Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers. + [JsonPropertyName("advertised")] + public bool Advertised { get; set; } + + /// Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on. + [JsonPropertyName("featureFlagEnabled")] + public bool FeatureFlagEnabled { get; set; } + + /// Whether the session has the `mcp-apps` capability. + [JsonPropertyName("sessionHasMcpApps")] + public bool SessionHasMcpApps { get; set; } +} + +/// What the server returned for this session. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsDiagnoseServer +{ + /// Whether the named server is currently connected. + [JsonPropertyName("connected")] + public bool Connected { get; set; } + + /// Up to 5 tool names with `_meta.ui` for quick inspection. + [JsonPropertyName("sampleToolNames")] + public IList SampleToolNames { get => field ??= []; set; } + + /// Total tools returned by the server's tools/list. + [JsonPropertyName("toolCount")] + public double ToolCount { get; set; } + + /// Tools whose `_meta.ui` is populated (resourceUri and/or visibility set). + [JsonPropertyName("toolsWithUiMeta")] + public double ToolsWithUiMeta { get; set; } +} + +/// Diagnostic snapshot of MCP Apps wiring for the named server. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsDiagnoseResult +{ + /// Capability negotiation snapshot. + [JsonPropertyName("capability")] + public McpAppsDiagnoseCapability Capability { get => field ??= new(); set; } + + /// What the server returned for this session. + [JsonPropertyName("server")] + public McpAppsDiagnoseServer Server { get => field ??= new(); set; } +} + +/// MCP server to diagnose MCP Apps wiring for. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpAppsDiagnoseRequest +{ + /// MCP server to probe. + [RegularExpression("^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$")] + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Safe for generated string properties: JSON Schema minLength/maxLength map to string length validation, not reflection over trimmed Count members")] + [MinLength(1)] + [JsonPropertyName("serverName")] + public string ServerName { get; set; } = string.Empty; + + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Schema for the `Plugin` type. [Experimental(Diagnostics.Experimental)] public sealed class Plugin @@ -7385,7 +7694,7 @@ public override void Write(Utf8JsonWriter writer, ModelPolicyState value, JsonSe } -/// Server transport type: stdio, http, sse, or memory. +/// Server transport type: stdio, http, sse (deprecated), or memory. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] public readonly struct DiscoveredMcpServerType : IEquatable @@ -7410,7 +7719,7 @@ public DiscoveredMcpServerType(string value) /// Server communicates over streamable HTTP. public static DiscoveredMcpServerType Http { get; } = new("http"); - /// Server communicates over Server-Sent Events. + /// Server communicates over Server-Sent Events (deprecated). public static DiscoveredMcpServerType Sse { get; } = new("sse"); /// Server is backed by an in-memory runtime implementation. @@ -8595,43 +8904,46 @@ public override void Write(Utf8JsonWriter writer, McpSetEnvValueModeDetails valu } -/// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). +/// Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] -public readonly struct OptionsUpdateEnvValueMode : IEquatable +public readonly struct McpAppsSetHostContextDetailsAvailableDisplayMode : IEquatable { private readonly string? _value; - /// Initializes a new instance of the struct. - /// The value to associate with this . + /// Initializes a new instance of the struct. + /// The value to associate with this . [JsonConstructor] - public OptionsUpdateEnvValueMode(string value) + public McpAppsSetHostContextDetailsAvailableDisplayMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } - /// Gets the value associated with this . + /// Gets the value associated with this . public string Value => _value ?? string.Empty; - /// Pass MCP server environment values as literal strings. - public static OptionsUpdateEnvValueMode Direct { get; } = new("direct"); + /// Rendered inline within the host conversation surface. + public static McpAppsSetHostContextDetailsAvailableDisplayMode Inline { get; } = new("inline"); - /// Resolve MCP server environment values from host-side references. - public static OptionsUpdateEnvValueMode Indirect { get; } = new("indirect"); + /// Rendered as a fullscreen overlay. + public static McpAppsSetHostContextDetailsAvailableDisplayMode Fullscreen { get; } = new("fullscreen"); - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(OptionsUpdateEnvValueMode left, OptionsUpdateEnvValueMode right) => left.Equals(right); + /// Rendered as a picture-in-picture floating panel. + public static McpAppsSetHostContextDetailsAvailableDisplayMode Pip { get; } = new("pip"); - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(OptionsUpdateEnvValueMode left, OptionsUpdateEnvValueMode right) => !(left == right); + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpAppsSetHostContextDetailsAvailableDisplayMode left, McpAppsSetHostContextDetailsAvailableDisplayMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpAppsSetHostContextDetailsAvailableDisplayMode left, McpAppsSetHostContextDetailsAvailableDisplayMode right) => !(left == right); /// - public override bool Equals(object? obj) => obj is OptionsUpdateEnvValueMode other && Equals(other); + public override bool Equals(object? obj) => obj is McpAppsSetHostContextDetailsAvailableDisplayMode other && Equals(other); /// - public bool Equals(OptionsUpdateEnvValueMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + public bool Equals(McpAppsSetHostContextDetailsAvailableDisplayMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); @@ -8639,62 +8951,65 @@ public OptionsUpdateEnvValueMode(string value) /// public override string ToString() => Value; - /// Provides a for serializing instances. + /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class Converter : JsonConverter + public sealed class Converter : JsonConverter { /// - public override OptionsUpdateEnvValueMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override McpAppsSetHostContextDetailsAvailableDisplayMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// - public override void Write(Utf8JsonWriter writer, OptionsUpdateEnvValueMode value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, McpAppsSetHostContextDetailsAvailableDisplayMode value, JsonSerializerOptions options) { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OptionsUpdateEnvValueMode)); + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsSetHostContextDetailsAvailableDisplayMode)); } } } -/// Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/). +/// Current display mode (SEP-1865). [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] -public readonly struct ExtensionSource : IEquatable +public readonly struct McpAppsSetHostContextDetailsDisplayMode : IEquatable { private readonly string? _value; - /// Initializes a new instance of the struct. - /// The value to associate with this . + /// Initializes a new instance of the struct. + /// The value to associate with this . [JsonConstructor] - public ExtensionSource(string value) + public McpAppsSetHostContextDetailsDisplayMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } - /// Gets the value associated with this . + /// Gets the value associated with this . public string Value => _value ?? string.Empty; - /// Extension discovered from the current project's .github/extensions directory. - public static ExtensionSource Project { get; } = new("project"); + /// Rendered inline within the host conversation surface. + public static McpAppsSetHostContextDetailsDisplayMode Inline { get; } = new("inline"); - /// Extension discovered from the user's ~/.copilot/extensions directory. - public static ExtensionSource User { get; } = new("user"); + /// Rendered as a fullscreen overlay. + public static McpAppsSetHostContextDetailsDisplayMode Fullscreen { get; } = new("fullscreen"); - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(ExtensionSource left, ExtensionSource right) => left.Equals(right); + /// Rendered as a picture-in-picture floating panel. + public static McpAppsSetHostContextDetailsDisplayMode Pip { get; } = new("pip"); - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(ExtensionSource left, ExtensionSource right) => !(left == right); + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpAppsSetHostContextDetailsDisplayMode left, McpAppsSetHostContextDetailsDisplayMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpAppsSetHostContextDetailsDisplayMode left, McpAppsSetHostContextDetailsDisplayMode right) => !(left == right); /// - public override bool Equals(object? obj) => obj is ExtensionSource other && Equals(other); + public override bool Equals(object? obj) => obj is McpAppsSetHostContextDetailsDisplayMode other && Equals(other); /// - public bool Equals(ExtensionSource other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + public bool Equals(McpAppsSetHostContextDetailsDisplayMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); @@ -8702,68 +9017,65 @@ public ExtensionSource(string value) /// public override string ToString() => Value; - /// Provides a for serializing instances. + /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class Converter : JsonConverter + public sealed class Converter : JsonConverter { /// - public override ExtensionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override McpAppsSetHostContextDetailsDisplayMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// - public override void Write(Utf8JsonWriter writer, ExtensionSource value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, McpAppsSetHostContextDetailsDisplayMode value, JsonSerializerOptions options) { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExtensionSource)); + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsSetHostContextDetailsDisplayMode)); } } } -/// Current status: running, disabled, failed, or starting. +/// Platform type for responsive design. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] -public readonly struct ExtensionStatus : IEquatable +public readonly struct McpAppsSetHostContextDetailsPlatform : IEquatable { private readonly string? _value; - /// Initializes a new instance of the struct. - /// The value to associate with this . + /// Initializes a new instance of the struct. + /// The value to associate with this . [JsonConstructor] - public ExtensionStatus(string value) + public McpAppsSetHostContextDetailsPlatform(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } - /// Gets the value associated with this . + /// Gets the value associated with this . public string Value => _value ?? string.Empty; - /// The extension process is running. - public static ExtensionStatus Running { get; } = new("running"); - - /// The extension is installed but disabled. - public static ExtensionStatus Disabled { get; } = new("disabled"); + /// Host runs in a web browser. + public static McpAppsSetHostContextDetailsPlatform Web { get; } = new("web"); - /// The extension failed to start or crashed. - public static ExtensionStatus Failed { get; } = new("failed"); + /// Host runs as a desktop application. + public static McpAppsSetHostContextDetailsPlatform Desktop { get; } = new("desktop"); - /// The extension process is starting. - public static ExtensionStatus Starting { get; } = new("starting"); + /// Host runs on a mobile device. + public static McpAppsSetHostContextDetailsPlatform Mobile { get; } = new("mobile"); - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(ExtensionStatus left, ExtensionStatus right) => left.Equals(right); + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpAppsSetHostContextDetailsPlatform left, McpAppsSetHostContextDetailsPlatform right) => left.Equals(right); - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(ExtensionStatus left, ExtensionStatus right) => !(left == right); + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpAppsSetHostContextDetailsPlatform left, McpAppsSetHostContextDetailsPlatform right) => !(left == right); /// - public override bool Equals(object? obj) => obj is ExtensionStatus other && Equals(other); + public override bool Equals(object? obj) => obj is McpAppsSetHostContextDetailsPlatform other && Equals(other); /// - public bool Equals(ExtensionStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + public bool Equals(McpAppsSetHostContextDetailsPlatform other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); @@ -8771,59 +9083,62 @@ public ExtensionStatus(string value) /// public override string ToString() => Value; - /// Provides a for serializing instances. + /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class Converter : JsonConverter + public sealed class Converter : JsonConverter { /// - public override ExtensionStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override McpAppsSetHostContextDetailsPlatform Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// - public override void Write(Utf8JsonWriter writer, ExtensionStatus value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, McpAppsSetHostContextDetailsPlatform value, JsonSerializerOptions options) { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExtensionStatus)); + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsSetHostContextDetailsPlatform)); } } } -/// Optional completion hint for the input (e.g. 'directory' for filesystem path completion). +/// UI theme preference per SEP-1865. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] -public readonly struct SlashCommandInputCompletion : IEquatable +public readonly struct McpAppsSetHostContextDetailsTheme : IEquatable { private readonly string? _value; - /// Initializes a new instance of the struct. - /// The value to associate with this . + /// Initializes a new instance of the struct. + /// The value to associate with this . [JsonConstructor] - public SlashCommandInputCompletion(string value) + public McpAppsSetHostContextDetailsTheme(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } - /// Gets the value associated with this . + /// Gets the value associated with this . public string Value => _value ?? string.Empty; - /// Input should complete filesystem directories. - public static SlashCommandInputCompletion Directory { get; } = new("directory"); + /// Light UI theme. + public static McpAppsSetHostContextDetailsTheme Light { get; } = new("light"); - /// Returns a value indicating whether two instances are equivalent. - public static bool operator ==(SlashCommandInputCompletion left, SlashCommandInputCompletion right) => left.Equals(right); + /// Dark UI theme. + public static McpAppsSetHostContextDetailsTheme Dark { get; } = new("dark"); - /// Returns a value indicating whether two instances are not equivalent. - public static bool operator !=(SlashCommandInputCompletion left, SlashCommandInputCompletion right) => !(left == right); + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpAppsSetHostContextDetailsTheme left, McpAppsSetHostContextDetailsTheme right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpAppsSetHostContextDetailsTheme left, McpAppsSetHostContextDetailsTheme right) => !(left == right); /// - public override bool Equals(object? obj) => obj is SlashCommandInputCompletion other && Equals(other); + public override bool Equals(object? obj) => obj is McpAppsSetHostContextDetailsTheme other && Equals(other); /// - public bool Equals(SlashCommandInputCompletion other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + public bool Equals(McpAppsSetHostContextDetailsTheme other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); /// public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); @@ -8831,53 +9146,569 @@ public SlashCommandInputCompletion(string value) /// public override string ToString() => Value; - /// Provides a for serializing instances. + /// Provides a for serializing instances. [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class Converter : JsonConverter + public sealed class Converter : JsonConverter { /// - public override SlashCommandInputCompletion Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override McpAppsSetHostContextDetailsTheme Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); } /// - public override void Write(Utf8JsonWriter writer, SlashCommandInputCompletion value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, McpAppsSetHostContextDetailsTheme value, JsonSerializerOptions options) { - GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SlashCommandInputCompletion)); + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsSetHostContextDetailsTheme)); } } } -/// Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command. +/// Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] -public readonly struct SlashCommandKind : IEquatable +public readonly struct McpAppsHostContextDetailsAvailableDisplayMode : IEquatable { private readonly string? _value; - /// Initializes a new instance of the struct. - /// The value to associate with this . + /// Initializes a new instance of the struct. + /// The value to associate with this . [JsonConstructor] - public SlashCommandKind(string value) + public McpAppsHostContextDetailsAvailableDisplayMode(string value) { ArgumentException.ThrowIfNullOrWhiteSpace(value); _value = value; } - /// Gets the value associated with this . + /// Gets the value associated with this . public string Value => _value ?? string.Empty; - /// Command implemented by the runtime. - public static SlashCommandKind Builtin { get; } = new("builtin"); + /// Rendered inline within the host conversation surface. + public static McpAppsHostContextDetailsAvailableDisplayMode Inline { get; } = new("inline"); - /// Command backed by a skill. - public static SlashCommandKind Skill { get; } = new("skill"); + /// Rendered as a fullscreen overlay. + public static McpAppsHostContextDetailsAvailableDisplayMode Fullscreen { get; } = new("fullscreen"); - /// Command registered by an SDK client or extension. - public static SlashCommandKind Client { get; } = new("client"); + /// Rendered as a picture-in-picture floating panel. + public static McpAppsHostContextDetailsAvailableDisplayMode Pip { get; } = new("pip"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpAppsHostContextDetailsAvailableDisplayMode left, McpAppsHostContextDetailsAvailableDisplayMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpAppsHostContextDetailsAvailableDisplayMode left, McpAppsHostContextDetailsAvailableDisplayMode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is McpAppsHostContextDetailsAvailableDisplayMode other && Equals(other); + + /// + public bool Equals(McpAppsHostContextDetailsAvailableDisplayMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override McpAppsHostContextDetailsAvailableDisplayMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, McpAppsHostContextDetailsAvailableDisplayMode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsHostContextDetailsAvailableDisplayMode)); + } + } +} + + +/// Current display mode (SEP-1865). +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct McpAppsHostContextDetailsDisplayMode : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public McpAppsHostContextDetailsDisplayMode(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Rendered inline within the host conversation surface. + public static McpAppsHostContextDetailsDisplayMode Inline { get; } = new("inline"); + + /// Rendered as a fullscreen overlay. + public static McpAppsHostContextDetailsDisplayMode Fullscreen { get; } = new("fullscreen"); + + /// Rendered as a picture-in-picture floating panel. + public static McpAppsHostContextDetailsDisplayMode Pip { get; } = new("pip"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpAppsHostContextDetailsDisplayMode left, McpAppsHostContextDetailsDisplayMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpAppsHostContextDetailsDisplayMode left, McpAppsHostContextDetailsDisplayMode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is McpAppsHostContextDetailsDisplayMode other && Equals(other); + + /// + public bool Equals(McpAppsHostContextDetailsDisplayMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override McpAppsHostContextDetailsDisplayMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, McpAppsHostContextDetailsDisplayMode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsHostContextDetailsDisplayMode)); + } + } +} + + +/// Platform type for responsive design. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct McpAppsHostContextDetailsPlatform : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public McpAppsHostContextDetailsPlatform(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Host runs in a web browser. + public static McpAppsHostContextDetailsPlatform Web { get; } = new("web"); + + /// Host runs as a desktop application. + public static McpAppsHostContextDetailsPlatform Desktop { get; } = new("desktop"); + + /// Host runs on a mobile device. + public static McpAppsHostContextDetailsPlatform Mobile { get; } = new("mobile"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpAppsHostContextDetailsPlatform left, McpAppsHostContextDetailsPlatform right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpAppsHostContextDetailsPlatform left, McpAppsHostContextDetailsPlatform right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is McpAppsHostContextDetailsPlatform other && Equals(other); + + /// + public bool Equals(McpAppsHostContextDetailsPlatform other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override McpAppsHostContextDetailsPlatform Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, McpAppsHostContextDetailsPlatform value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsHostContextDetailsPlatform)); + } + } +} + + +/// UI theme preference per SEP-1865. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct McpAppsHostContextDetailsTheme : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public McpAppsHostContextDetailsTheme(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Light UI theme. + public static McpAppsHostContextDetailsTheme Light { get; } = new("light"); + + /// Dark UI theme. + public static McpAppsHostContextDetailsTheme Dark { get; } = new("dark"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpAppsHostContextDetailsTheme left, McpAppsHostContextDetailsTheme right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpAppsHostContextDetailsTheme left, McpAppsHostContextDetailsTheme right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is McpAppsHostContextDetailsTheme other && Equals(other); + + /// + public bool Equals(McpAppsHostContextDetailsTheme other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override McpAppsHostContextDetailsTheme Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, McpAppsHostContextDetailsTheme value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpAppsHostContextDetailsTheme)); + } + } +} + + +/// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct OptionsUpdateEnvValueMode : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public OptionsUpdateEnvValueMode(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Pass MCP server environment values as literal strings. + public static OptionsUpdateEnvValueMode Direct { get; } = new("direct"); + + /// Resolve MCP server environment values from host-side references. + public static OptionsUpdateEnvValueMode Indirect { get; } = new("indirect"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(OptionsUpdateEnvValueMode left, OptionsUpdateEnvValueMode right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(OptionsUpdateEnvValueMode left, OptionsUpdateEnvValueMode right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is OptionsUpdateEnvValueMode other && Equals(other); + + /// + public bool Equals(OptionsUpdateEnvValueMode other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override OptionsUpdateEnvValueMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, OptionsUpdateEnvValueMode value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(OptionsUpdateEnvValueMode)); + } + } +} + + +/// Discovery source: project (.github/extensions/) or user (~/.copilot/extensions/). +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ExtensionSource : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ExtensionSource(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Extension discovered from the current project's .github/extensions directory. + public static ExtensionSource Project { get; } = new("project"); + + /// Extension discovered from the user's ~/.copilot/extensions directory. + public static ExtensionSource User { get; } = new("user"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ExtensionSource left, ExtensionSource right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ExtensionSource left, ExtensionSource right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ExtensionSource other && Equals(other); + + /// + public bool Equals(ExtensionSource other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ExtensionSource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ExtensionSource value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExtensionSource)); + } + } +} + + +/// Current status: running, disabled, failed, or starting. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ExtensionStatus : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ExtensionStatus(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// The extension process is running. + public static ExtensionStatus Running { get; } = new("running"); + + /// The extension is installed but disabled. + public static ExtensionStatus Disabled { get; } = new("disabled"); + + /// The extension failed to start or crashed. + public static ExtensionStatus Failed { get; } = new("failed"); + + /// The extension process is starting. + public static ExtensionStatus Starting { get; } = new("starting"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ExtensionStatus left, ExtensionStatus right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ExtensionStatus left, ExtensionStatus right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ExtensionStatus other && Equals(other); + + /// + public bool Equals(ExtensionStatus other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ExtensionStatus Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ExtensionStatus value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ExtensionStatus)); + } + } +} + + +/// Optional completion hint for the input (e.g. 'directory' for filesystem path completion). +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SlashCommandInputCompletion : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SlashCommandInputCompletion(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Input should complete filesystem directories. + public static SlashCommandInputCompletion Directory { get; } = new("directory"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SlashCommandInputCompletion left, SlashCommandInputCompletion right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SlashCommandInputCompletion left, SlashCommandInputCompletion right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SlashCommandInputCompletion other && Equals(other); + + /// + public bool Equals(SlashCommandInputCompletion other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override SlashCommandInputCompletion Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SlashCommandInputCompletion value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SlashCommandInputCompletion)); + } + } +} + + +/// Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command. +[Experimental(Diagnostics.Experimental)] +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SlashCommandKind : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SlashCommandKind(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Command implemented by the runtime. + public static SlashCommandKind Builtin { get; } = new("builtin"); + + /// Command backed by a skill. + public static SlashCommandKind Skill { get; } = new("skill"); + + /// Command registered by an SDK client or extension. + public static SlashCommandKind Client { get; } = new("client"); /// Returns a value indicating whether two instances are equivalent. public static bool operator ==(SlashCommandKind left, SlashCommandKind right) => left.Equals(right); @@ -11768,6 +12599,12 @@ public async Task RemoveGitHubAsync(CancellationToken can field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; + + /// Apps APIs. + public McpAppsApi Apps => + field ?? + Interlocked.CompareExchange(ref field, new(_session), null) ?? + field; } /// Provides session-scoped McpOauth APIs. @@ -11798,6 +12635,102 @@ public async Task LoginAsync(string serverName, bool? force } } +/// Provides session-scoped McpApps APIs. +[Experimental(Diagnostics.Experimental)] +public sealed class McpAppsApi +{ + private readonly CopilotSession _session; + + internal McpAppsApi(CopilotSession session) + { + _session = session; + } + + /// Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability. + /// Name of the MCP server hosting the resource. + /// Resource URI (typically ui://...). + /// The to monitor for cancellation requests. The default is . + /// Resource contents returned by the MCP server. + public async Task ReadResourceAsync(string serverName, string uri, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(serverName); + ArgumentNullException.ThrowIfNull(uri); + _session.ThrowIfDisposed(); + + var request = new McpAppsReadResourceRequest { SessionId = _session.SessionId, ServerName = serverName, Uri = uri }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.readResource", [request], cancellationToken); + } + + /// List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`. + /// MCP server hosting the app. + /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + /// The to monitor for cancellation requests. The default is . + /// App-callable tools from the named MCP server. + public async Task ListToolsAsync(string serverName, string originServerName, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(serverName); + ArgumentNullException.ThrowIfNull(originServerName); + _session.ThrowIfDisposed(); + + var request = new McpAppsListToolsRequest { SessionId = _session.SessionId, ServerName = serverName, OriginServerName = originServerName }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.listTools", [request], cancellationToken); + } + + /// Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`. + /// MCP server hosting the tool. + /// MCP tool name. + /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + /// Tool arguments. + /// The to monitor for cancellation requests. The default is . + /// Standard MCP CallToolResult. + public async Task> CallToolAsync(string serverName, string toolName, string originServerName, IDictionary? arguments = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(serverName); + ArgumentNullException.ThrowIfNull(toolName); + ArgumentNullException.ThrowIfNull(originServerName); + _session.ThrowIfDisposed(); + + var request = new McpAppsCallToolRequest { SessionId = _session.SessionId, ServerName = serverName, ToolName = toolName, OriginServerName = originServerName, Arguments = arguments }; + return await CopilotClient.InvokeRpcAsync>(_session.Rpc, "session.mcp.apps.callTool", [request], cancellationToken); + } + + /// Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI. + /// Host context advertised to MCP App guests. + /// The to monitor for cancellation requests. The default is . + public async Task SetHostContextAsync(McpAppsSetHostContextDetails context, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(context); + _session.ThrowIfDisposed(); + + var request = new McpAppsSetHostContextRequest { SessionId = _session.SessionId, Context = context }; + await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.setHostContext", [request], cancellationToken); + } + + /// Read the current host context advertised to MCP App guests. + /// The to monitor for cancellation requests. The default is . + /// Current host context advertised to MCP App guests. + public async Task GetHostContextAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionMcpAppsGetHostContextRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.getHostContext", [request], cancellationToken); + } + + /// Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, feature-flag state, advertised extension, and how many tools have `_meta.ui` populated. + /// MCP server to probe. + /// The to monitor for cancellation requests. The default is . + /// Diagnostic snapshot of MCP Apps wiring for the named server. + public async Task DiagnoseAsync(string serverName, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(serverName); + _session.ThrowIfDisposed(); + + var request = new McpAppsDiagnoseRequest { SessionId = _session.SessionId, ServerName = serverName }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.apps.diagnose", [request], cancellationToken); + } +} + /// Provides session-scoped Plugins APIs. [Experimental(Diagnostics.Experimental)] public sealed class PluginsApi @@ -13228,6 +14161,11 @@ public static void RegisterClientSessionApiHandlers(JsonRpc rpc, FuncMCP App view called a tool on a connected MCP server (SEP-1865). +/// Represents the mcp_app.tool_call_complete event. +public sealed partial class McpAppToolCallCompleteEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "mcp_app.tool_call_complete"; + + /// The mcp_app.tool_call_complete event payload. + [JsonPropertyName("data")] + public required McpAppToolCallCompleteData Data { get; set; } +} + /// Session initialization metadata including context and configuration. public sealed partial class SessionStartData { @@ -1345,6 +1359,11 @@ public sealed partial class SessionErrorData [JsonPropertyName("providerCallId")] public string? ProviderCallId { get; set; } + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("serviceRequestId")] + public string? ServiceRequestId { get; set; } + /// Error stack trace, when available. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("stack")] @@ -1460,6 +1479,11 @@ public sealed partial class SessionModelChangeData [JsonPropertyName("cause")] public string? Cause { get; set; } + /// Context tier after the model change; null explicitly clears a previously selected tier. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("contextTier")] + public SessionModelChangeDataContextTier? ContextTier { get; set; } + /// Newly selected model identifier. [JsonPropertyName("newModel")] public required string NewModel { get; set; } @@ -1835,6 +1859,11 @@ public sealed partial class SessionCompactionCompleteData [JsonPropertyName("requestId")] public string? RequestId { get; set; } + /// Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("serviceRequestId")] + public string? ServiceRequestId { get; set; } + /// Whether compaction completed successfully. [JsonPropertyName("success")] public required bool Success { get; set; } @@ -2055,6 +2084,11 @@ public sealed partial class AssistantMessageData [JsonPropertyName("requestId")] public string? RequestId { get; set; } + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("serviceRequestId")] + public string? ServiceRequestId { get; set; } + /// Tool invocations requested by the assistant in this message. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolRequests")] @@ -2200,6 +2234,11 @@ public sealed partial class AssistantUsageData [JsonPropertyName("reasoningTokens")] public long? ReasoningTokens { get; set; } + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("serviceRequestId")] + public string? ServiceRequestId { get; set; } + /// Time to first token in milliseconds. Only available for streaming requests. [JsonConverter(typeof(MillisecondsTimeSpanConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -2241,6 +2280,11 @@ public sealed partial class ModelCallFailureData [JsonPropertyName("providerCallId")] public string? ProviderCallId { get; set; } + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("serviceRequestId")] + public string? ServiceRequestId { get; set; } + /// Where the failed model call originated. [JsonPropertyName("source")] public required ModelCallFailureSource Source { get; set; } @@ -2387,6 +2431,11 @@ public sealed partial class ToolExecutionCompleteData [JsonPropertyName("toolCallId")] public required string ToolCallId { get; set; } + /// Tool definition metadata, present for MCP tools with MCP Apps support. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("toolDescription")] + public ToolExecutionCompleteToolDescription? ToolDescription { get; set; } + /// Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("toolTelemetry")] @@ -2432,6 +2481,16 @@ public sealed partial class SkillInvokedData [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("pluginVersion")] public string? PluginVersion { get; set; } + + /// Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), personal-claude (~/.claude/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("source")] + public string? Source { get; set; } + + /// What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("trigger")] + public SkillInvokedTrigger? Trigger { get; set; } } /// Sub-agent startup details including parent tool call and agent information. @@ -3087,6 +3146,11 @@ public sealed partial class SessionMcpServersLoadedData /// Schema for the `McpServerStatusChangedData` type. public sealed partial class SessionMcpServerStatusChangedData { + /// Error message if the server entered a failed state. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("error")] + public string? Error { get; set; } + /// Name of the MCP server whose status changed. [JsonPropertyName("serverName")] public required string ServerName { get; set; } @@ -3104,6 +3168,46 @@ public sealed partial class SessionExtensionsLoadedData public required ExtensionsLoadedExtension[] Extensions { get; set; } } +/// MCP App view called a tool on a connected MCP server (SEP-1865). +public sealed partial class McpAppToolCallCompleteData +{ + /// Arguments passed to the tool by the app view, if any. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("arguments")] + public IDictionary? Arguments { get; set; } + + /// Wall-clock duration of the underlying tools/call in milliseconds. + [JsonPropertyName("durationMs")] + public required double DurationMs { get; set; } + + /// Set when the underlying tools/call threw an error before returning a CallToolResult. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("error")] + public McpAppToolCallCompleteError? Error { get; set; } + + /// Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("result")] + public IDictionary? Result { get; set; } + + /// Name of the MCP server hosting the tool. + [JsonPropertyName("serverName")] + public required string ServerName { get; set; } + + /// True when the call completed without throwing AND the MCP CallToolResult did not set isError. + [JsonPropertyName("success")] + public required bool Success { get; set; } + + /// The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("toolMeta")] + public McpAppToolCallCompleteToolMeta? ToolMeta { get; set; } + + /// MCP tool name that was invoked. + [JsonPropertyName("toolName")] + public required string ToolName { get; set; } +} + /// Working directory and git context at session start. /// Nested data type for WorkingDirectoryContext. public sealed partial class WorkingDirectoryContext @@ -3952,6 +4056,143 @@ public partial class ToolExecutionCompleteContent } +/// Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. +/// Nested data type for ToolExecutionCompleteUIResourceMetaUICsp. +public sealed partial class ToolExecutionCompleteUIResourceMetaUICsp +{ + /// Gets or sets the baseUriDomains value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("baseUriDomains")] + public string[]? BaseUriDomains { get; set; } + + /// Gets or sets the connectDomains value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("connectDomains")] + public string[]? ConnectDomains { get; set; } + + /// Gets or sets the frameDomains value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("frameDomains")] + public string[]? FrameDomains { get; set; } + + /// Gets or sets the resourceDomains value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resourceDomains")] + public string[]? ResourceDomains { get; set; } +} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. +/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsCamera. +public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsCamera +{ +} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. +/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite. +public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite +{ +} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. +/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation. +public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation +{ +} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. +/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone. +public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone +{ +} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. +/// Nested data type for ToolExecutionCompleteUIResourceMetaUIPermissions. +public sealed partial class ToolExecutionCompleteUIResourceMetaUIPermissions +{ + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("camera")] + public ToolExecutionCompleteUIResourceMetaUIPermissionsCamera? Camera { get; set; } + + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("clipboardWrite")] + public ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite? ClipboardWrite { get; set; } + + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("geolocation")] + public ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation? Geolocation { get; set; } + + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("microphone")] + public ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone? Microphone { get; set; } +} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. +/// Nested data type for ToolExecutionCompleteUIResourceMetaUI. +public sealed partial class ToolExecutionCompleteUIResourceMetaUI +{ + /// Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("csp")] + public ToolExecutionCompleteUIResourceMetaUICsp? Csp { get; set; } + + /// Gets or sets the domain value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("domain")] + public string? Domain { get; set; } + + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("permissions")] + public ToolExecutionCompleteUIResourceMetaUIPermissions? Permissions { get; set; } + + /// Gets or sets the prefersBorder value. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("prefersBorder")] + public bool? PrefersBorder { get; set; } +} + +/// Resource-level UI metadata (CSP, permissions, visual preferences). +/// Nested data type for ToolExecutionCompleteUIResourceMeta. +public sealed partial class ToolExecutionCompleteUIResourceMeta +{ + /// Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("ui")] + public ToolExecutionCompleteUIResourceMetaUI? Ui { get; set; } +} + +/// MCP Apps UI resource content for rendering in a sandboxed iframe. +/// Nested data type for ToolExecutionCompleteUIResource. +public sealed partial class ToolExecutionCompleteUIResource +{ + /// Resource-level UI metadata (CSP, permissions, visual preferences). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("_meta")] + public ToolExecutionCompleteUIResourceMeta? _meta { get; set; } + + /// Base64-encoded HTML content. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("blob")] + public string? Blob { get; set; } + + /// MIME type of the content. + [JsonPropertyName("mimeType")] + public required string MimeType { get; set; } + + /// HTML content as a string. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("text")] + public string? Text { get; set; } + + /// The ui:// URI of the resource. + [JsonPropertyName("uri")] + public required string Uri { get; set; } +} + /// Tool execution result on success. /// Nested data type for ToolExecutionCompleteResult. public sealed partial class ToolExecutionCompleteResult @@ -3969,6 +4210,55 @@ public sealed partial class ToolExecutionCompleteResult [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("detailedContent")] public string? DetailedContent { get; set; } + + /// MCP Apps UI resource content for rendering in a sandboxed iframe. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("uiResource")] + public ToolExecutionCompleteUIResource? UiResource { get; set; } +} + +/// Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. +/// Nested data type for ToolExecutionCompleteToolDescriptionMetaUI. +public sealed partial class ToolExecutionCompleteToolDescriptionMetaUI +{ + /// URI of the UI resource. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resourceUri")] + public string? ResourceUri { get; set; } + + /// Who can access this tool. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("visibility")] + public ToolExecutionCompleteToolDescriptionMetaUIVisibility[]? Visibility { get; set; } +} + +/// MCP Apps metadata for UI resource association. +/// Nested data type for ToolExecutionCompleteToolDescriptionMeta. +public sealed partial class ToolExecutionCompleteToolDescriptionMeta +{ + /// Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("ui")] + public ToolExecutionCompleteToolDescriptionMetaUI? Ui { get; set; } +} + +/// Tool definition metadata, present for MCP tools with MCP Apps support. +/// Nested data type for ToolExecutionCompleteToolDescription. +public sealed partial class ToolExecutionCompleteToolDescription +{ + /// MCP Apps metadata for UI resource association. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("_meta")] + public ToolExecutionCompleteToolDescriptionMeta? _meta { get; set; } + + /// Tool description. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// Tool name. + [JsonPropertyName("name")] + public required string Name { get; set; } } /// Error details when the hook failed. @@ -5189,6 +5479,11 @@ public sealed partial class CapabilitiesChangedUI [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("elicitation")] public bool? Elicitation { get; set; } + + /// Whether MCP Apps (SEP-1865) UI passthrough is now supported. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("mcpApps")] + public bool? McpApps { get; set; } } /// Schema for the `SkillsLoadedSkill` type. @@ -5272,6 +5567,16 @@ public sealed partial class McpServersLoadedServer [JsonPropertyName("name")] public required string Name { get; set; } + /// Name of the plugin that supplied the effective MCP server config, only when source is plugin. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("pluginName")] + public string? PluginName { get; set; } + + /// Version of the plugin that supplied the effective MCP server config, only when source is plugin. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("pluginVersion")] + public string? PluginVersion { get; set; } + /// Configuration source: user, workspace, plugin, or builtin. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("source")] @@ -5280,6 +5585,11 @@ public sealed partial class McpServersLoadedServer /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured. [JsonPropertyName("status")] public required McpServerStatus Status { get; set; } + + /// Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("transport")] + public McpServerTransport? Transport { get; set; } } /// Schema for the `ExtensionsLoadedExtension` type. @@ -5303,6 +5613,40 @@ public sealed partial class ExtensionsLoadedExtension public required ExtensionsLoadedExtensionStatus Status { get; set; } } +/// Set when the underlying tools/call threw an error before returning a CallToolResult. +/// Nested data type for McpAppToolCallCompleteError. +public sealed partial class McpAppToolCallCompleteError +{ + /// Human-readable error message. + [JsonPropertyName("message")] + public required string Message { get; set; } +} + +/// Schema for the `McpAppToolCallCompleteToolMetaUI` type. +/// Nested data type for McpAppToolCallCompleteToolMetaUI. +public sealed partial class McpAppToolCallCompleteToolMetaUI +{ + /// `ui://` URI declared by the tool's `_meta.ui.resourceUri`. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("resourceUri")] + public string? ResourceUri { get; set; } + + /// Tool visibility per SEP-1865 (typically a subset of `["model","app"]`). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("visibility")] + public string[]? Visibility { get; set; } +} + +/// The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. +/// Nested data type for McpAppToolCallCompleteToolMeta. +public sealed partial class McpAppToolCallCompleteToolMeta +{ + /// Schema for the `McpAppToolCallCompleteToolMetaUI` type. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("ui")] + public McpAppToolCallCompleteToolMetaUI? Ui { get; set; } +} + /// Hosting platform type of the repository (github or ado). [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -5428,6 +5772,67 @@ public override void Write(Utf8JsonWriter writer, ReasoningSummary value, JsonSe } } +/// Defines the allowed values. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SessionModelChangeDataContextTier : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SessionModelChangeDataContextTier(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Default context tier with standard context window size. + public static SessionModelChangeDataContextTier Default { get; } = new("default"); + + /// Extended context tier with a larger context window. + public static SessionModelChangeDataContextTier LongContext { get; } = new("long_context"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SessionModelChangeDataContextTier left, SessionModelChangeDataContextTier right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SessionModelChangeDataContextTier left, SessionModelChangeDataContextTier right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SessionModelChangeDataContextTier other && Equals(other); + + /// + public bool Equals(SessionModelChangeDataContextTier other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override SessionModelChangeDataContextTier Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SessionModelChangeDataContextTier value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SessionModelChangeDataContextTier)); + } + } +} + /// The session mode the agent is operating in. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -6187,6 +6592,131 @@ public override void Write(Utf8JsonWriter writer, ToolExecutionCompleteContentRe } } +/// Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ToolExecutionCompleteToolDescriptionMetaUIVisibility : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ToolExecutionCompleteToolDescriptionMetaUIVisibility(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Tool is callable by the model (LLM tool surface). + public static ToolExecutionCompleteToolDescriptionMetaUIVisibility Model { get; } = new("model"); + + /// Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool. + public static ToolExecutionCompleteToolDescriptionMetaUIVisibility App { get; } = new("app"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ToolExecutionCompleteToolDescriptionMetaUIVisibility left, ToolExecutionCompleteToolDescriptionMetaUIVisibility right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ToolExecutionCompleteToolDescriptionMetaUIVisibility left, ToolExecutionCompleteToolDescriptionMetaUIVisibility right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ToolExecutionCompleteToolDescriptionMetaUIVisibility other && Equals(other); + + /// + public bool Equals(ToolExecutionCompleteToolDescriptionMetaUIVisibility other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ToolExecutionCompleteToolDescriptionMetaUIVisibility Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ToolExecutionCompleteToolDescriptionMetaUIVisibility value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ToolExecutionCompleteToolDescriptionMetaUIVisibility)); + } + } +} + +/// What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent). +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct SkillInvokedTrigger : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public SkillInvokedTrigger(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. + public static SkillInvokedTrigger UserInvoked { get; } = new("user-invoked"); + + /// Skill invocation requested by the agent. + public static SkillInvokedTrigger AgentInvoked { get; } = new("agent-invoked"); + + /// Skill content loaded as part of another context, such as a configured custom agent or subagent. + public static SkillInvokedTrigger ContextLoad { get; } = new("context-load"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(SkillInvokedTrigger left, SkillInvokedTrigger right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(SkillInvokedTrigger left, SkillInvokedTrigger right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is SkillInvokedTrigger other && Equals(other); + + /// + public bool Equals(SkillInvokedTrigger other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override SkillInvokedTrigger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, SkillInvokedTrigger value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(SkillInvokedTrigger)); + } + } +} + /// Message role: "system" for system prompts, "developer" for developer-injected instructions. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -6967,6 +7497,73 @@ public override void Write(Utf8JsonWriter writer, McpServerStatus value, JsonSer } } +/// Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server). +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct McpServerTransport : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public McpServerTransport(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Server communicates over stdio with a local child process. + public static McpServerTransport Stdio { get; } = new("stdio"); + + /// Server communicates over streamable HTTP. + public static McpServerTransport Http { get; } = new("http"); + + /// Server communicates over Server-Sent Events (deprecated). + public static McpServerTransport Sse { get; } = new("sse"); + + /// Server is backed by an in-memory runtime implementation. + public static McpServerTransport Memory { get; } = new("memory"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(McpServerTransport left, McpServerTransport right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(McpServerTransport left, McpServerTransport right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is McpServerTransport other && Equals(other); + + /// + public bool Equals(McpServerTransport other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override McpServerTransport Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, McpServerTransport value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(McpServerTransport)); + } + } +} + /// Discovery source. [JsonConverter(typeof(Converter))] [DebuggerDisplay("{Value,nq}")] @@ -7168,6 +7765,11 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(HookEndEvent))] [JsonSerializable(typeof(HookStartData))] [JsonSerializable(typeof(HookStartEvent))] +[JsonSerializable(typeof(McpAppToolCallCompleteData))] +[JsonSerializable(typeof(McpAppToolCallCompleteError))] +[JsonSerializable(typeof(McpAppToolCallCompleteEvent))] +[JsonSerializable(typeof(McpAppToolCallCompleteToolMeta))] +[JsonSerializable(typeof(McpAppToolCallCompleteToolMetaUI))] [JsonSerializable(typeof(McpOauthCompletedData))] [JsonSerializable(typeof(McpOauthCompletedEvent))] [JsonSerializable(typeof(McpOauthRequiredData))] @@ -7329,6 +7931,18 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(ToolExecutionCompleteError))] [JsonSerializable(typeof(ToolExecutionCompleteEvent))] [JsonSerializable(typeof(ToolExecutionCompleteResult))] +[JsonSerializable(typeof(ToolExecutionCompleteToolDescription))] +[JsonSerializable(typeof(ToolExecutionCompleteToolDescriptionMeta))] +[JsonSerializable(typeof(ToolExecutionCompleteToolDescriptionMetaUI))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResource))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMeta))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUI))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUICsp))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissions))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissionsCamera))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation))] +[JsonSerializable(typeof(ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone))] [JsonSerializable(typeof(ToolExecutionPartialResultData))] [JsonSerializable(typeof(ToolExecutionPartialResultEvent))] [JsonSerializable(typeof(ToolExecutionProgressData))] diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index 36a5e1831..85d6e6364 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -551,7 +551,7 @@ type DiscoveredMcpServer struct { Name string `json:"name"` // Configuration source: user, workspace, plugin, or builtin Source McpServerSource `json:"source"` - // Server transport type: stdio, http, sse, or memory + // Server transport type: stdio, http, sse (deprecated), or memory Type *DiscoveredMcpServerType `json:"type,omitempty"` } @@ -747,6 +747,8 @@ type ExternalToolTextResultForLlmBinaryResultsForLlm struct { Data string `json:"data"` // Human-readable description of the binary data Description *string `json:"description,omitempty"` + // Optional metadata from the producing tool. + Metadata map[string]any `json:"metadata,omitempty"` // MIME type of the binary data MIMEType string `json:"mimeType"` // Binary result type discriminator. Use "image" for images and "resource" for other binary @@ -1222,6 +1224,176 @@ type LspInitializeRequest struct { WorkingDirectory *string `json:"workingDirectory,omitempty"` } +// MCP server, tool name, and arguments to invoke from an MCP App view. +// Experimental: McpAppsCallToolRequest is part of an experimental API and may change or be +// removed. +type McpAppsCallToolRequest struct { + // Tool arguments + Arguments map[string]any `json:"arguments,omitempty"` + // **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the + // app from this server only'), the call is rejected when this differs from `serverName`, + // and rejected outright when missing. + OriginServerName string `json:"originServerName"` + // MCP server hosting the tool + ServerName string `json:"serverName"` + // MCP tool name + ToolName string `json:"toolName"` +} + +// Capability negotiation snapshot +// Experimental: McpAppsDiagnoseCapability is part of an experimental API and may change or +// be removed. +type McpAppsDiagnoseCapability struct { + // Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers + Advertised bool `json:"advertised"` + // Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on + FeatureFlagEnabled bool `json:"featureFlagEnabled"` + // Whether the session has the `mcp-apps` capability + SessionHasMcpApps bool `json:"sessionHasMcpApps"` +} + +// MCP server to diagnose MCP Apps wiring for. +// Experimental: McpAppsDiagnoseRequest is part of an experimental API and may change or be +// removed. +type McpAppsDiagnoseRequest struct { + // MCP server to probe + ServerName string `json:"serverName"` +} + +// Diagnostic snapshot of MCP Apps wiring for the named server. +// Experimental: McpAppsDiagnoseResult is part of an experimental API and may change or be +// removed. +type McpAppsDiagnoseResult struct { + // Capability negotiation snapshot + Capability McpAppsDiagnoseCapability `json:"capability"` + // What the server returned for this session + Server McpAppsDiagnoseServer `json:"server"` +} + +// What the server returned for this session +// Experimental: McpAppsDiagnoseServer is part of an experimental API and may change or be +// removed. +type McpAppsDiagnoseServer struct { + // Whether the named server is currently connected + Connected bool `json:"connected"` + // Up to 5 tool names with `_meta.ui` for quick inspection + SampleToolNames []string `json:"sampleToolNames"` + // Total tools returned by the server's tools/list + ToolCount float64 `json:"toolCount"` + // Tools whose `_meta.ui` is populated (resourceUri and/or visibility set) + ToolsWithUIMeta float64 `json:"toolsWithUiMeta"` +} + +// Current host context advertised to MCP App guests. +// Experimental: McpAppsHostContext is part of an experimental API and may change or be +// removed. +type McpAppsHostContext struct { + // Current host context + Context McpAppsHostContextDetails `json:"context"` +} + +// Current host context +// Experimental: McpAppsHostContextDetails is part of an experimental API and may change or +// be removed. +type McpAppsHostContextDetails struct { + // Display modes the host supports + AvailableDisplayModes []McpAppsHostContextDetailsAvailableDisplayMode `json:"availableDisplayModes,omitempty"` + // Current display mode (SEP-1865) + DisplayMode *McpAppsHostContextDetailsDisplayMode `json:"displayMode,omitempty"` + // BCP-47 locale, e.g. 'en-US' + Locale *string `json:"locale,omitempty"` + // Platform type for responsive design + Platform *McpAppsHostContextDetailsPlatform `json:"platform,omitempty"` + // UI theme preference per SEP-1865 + Theme *McpAppsHostContextDetailsTheme `json:"theme,omitempty"` + // IANA timezone, e.g. 'America/New_York' + TimeZone *string `json:"timeZone,omitempty"` + // Host application identifier + UserAgent *string `json:"userAgent,omitempty"` +} + +// MCP server to list app-callable tools for. +// Experimental: McpAppsListToolsRequest is part of an experimental API and may change or be +// removed. +type McpAppsListToolsRequest struct { + // **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the + // app from this server only'), the call is rejected when this differs from `serverName`, + // and rejected outright when missing. + OriginServerName string `json:"originServerName"` + // MCP server hosting the app + ServerName string `json:"serverName"` +} + +// App-callable tools from the named MCP server. +// Experimental: McpAppsListToolsResult is part of an experimental API and may change or be +// removed. +type McpAppsListToolsResult struct { + // App-callable tools from the server + Tools []map[string]any `json:"tools"` +} + +// MCP server and resource URI to fetch. +// Experimental: McpAppsReadResourceRequest is part of an experimental API and may change or +// be removed. +type McpAppsReadResourceRequest struct { + // Name of the MCP server hosting the resource + ServerName string `json:"serverName"` + // Resource URI (typically ui://...) + URI string `json:"uri"` +} + +// Resource contents returned by the MCP server. +// Experimental: McpAppsReadResourceResult is part of an experimental API and may change or +// be removed. +type McpAppsReadResourceResult struct { + // Resource contents returned by the server + Contents []McpAppsResourceContent `json:"contents"` +} + +// Schema for the `McpAppsResourceContent` type. +// Experimental: McpAppsResourceContent is part of an experimental API and may change or be +// removed. +type McpAppsResourceContent struct { + // Base64-encoded binary content + Blob *string `json:"blob,omitempty"` + // Resource-level metadata (CSP, permissions, etc.) + Meta map[string]any `json:"_meta,omitempty"` + // MIME type of the content + MIMEType *string `json:"mimeType,omitempty"` + // Text content (e.g. HTML) + Text *string `json:"text,omitempty"` + // The resource URI (typically ui://...) + URI string `json:"uri"` +} + +// Host context advertised to MCP App guests +// Experimental: McpAppsSetHostContextDetails is part of an experimental API and may change +// or be removed. +type McpAppsSetHostContextDetails struct { + // Display modes the host supports + AvailableDisplayModes []McpAppsSetHostContextDetailsAvailableDisplayMode `json:"availableDisplayModes,omitempty"` + // Current display mode (SEP-1865) + DisplayMode *McpAppsSetHostContextDetailsDisplayMode `json:"displayMode,omitempty"` + // BCP-47 locale, e.g. 'en-US' + Locale *string `json:"locale,omitempty"` + // Platform type for responsive design + Platform *McpAppsSetHostContextDetailsPlatform `json:"platform,omitempty"` + // UI theme preference per SEP-1865 + Theme *McpAppsSetHostContextDetailsTheme `json:"theme,omitempty"` + // IANA timezone, e.g. 'America/New_York' + TimeZone *string `json:"timeZone,omitempty"` + // Host application identifier + UserAgent *string `json:"userAgent,omitempty"` +} + +// Host context to advertise to MCP App guests. +// Experimental: McpAppsSetHostContextRequest is part of an experimental API and may change +// or be removed. +type McpAppsSetHostContextRequest struct { + // Host context advertised to MCP App guests + Context McpAppsSetHostContextDetails `json:"context"` +} + // The requestId previously passed to executeSampling that should be cancelled. // Experimental: McpCancelSamplingExecutionParams is part of an experimental API and may // change or be removed. @@ -1697,15 +1869,28 @@ type ModelBilling struct { type ModelBillingTokenPrices struct { // Number of tokens per standard billing batch BatchSize *int64 `json:"batchSize,omitempty"` - // Price per billing batch of cached tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 - // AIU = $0.01 USD) - CachePrice *int64 `json:"cachePrice,omitempty"` - // Price per billing batch of input tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU - // = $0.01 USD) - InputPrice *int64 `json:"inputPrice,omitempty"` - // Price per billing batch of output tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 - // AIU = $0.01 USD) - OutputPrice *int64 `json:"outputPrice,omitempty"` + // AI Credits cost per billing batch of cached tokens + CachePrice *float64 `json:"cachePrice,omitempty"` + // Maximum context window tokens for the default tier + ContextMax *int64 `json:"contextMax,omitempty"` + // AI Credits cost per billing batch of input tokens + InputPrice *float64 `json:"inputPrice,omitempty"` + // Long context tier pricing (available for models with extended context windows) + LongContext *ModelBillingTokenPricesLongContext `json:"longContext,omitempty"` + // AI Credits cost per billing batch of output tokens + OutputPrice *float64 `json:"outputPrice,omitempty"` +} + +// Long context tier pricing (available for models with extended context windows) +type ModelBillingTokenPricesLongContext struct { + // AI Credits cost per billing batch of cached tokens + CachePrice *float64 `json:"cachePrice,omitempty"` + // Maximum context window tokens for the long context tier + ContextMax *int64 `json:"contextMax,omitempty"` + // AI Credits cost per billing batch of input tokens + InputPrice *float64 `json:"inputPrice,omitempty"` + // AI Credits cost per billing batch of output tokens + OutputPrice *float64 `json:"outputPrice,omitempty"` } // Model capabilities and limits @@ -3876,6 +4061,16 @@ type SessionLoadDeferredRepoHooksResult struct { type SessionLspInitializeResult struct { } +// Standard MCP CallToolResult +// Experimental: SessionMcpAppsCallToolResult is part of an experimental API and may change +// or be removed. +type SessionMcpAppsCallToolResult map[string]any + +// Experimental: SessionMcpAppsSetHostContextResult is part of an experimental API and may +// change or be removed. +type SessionMcpAppsSetHostContextResult struct { +} + // Experimental: SessionMcpDisableResult is part of an experimental API and may change or be // removed. type SessionMcpDisableResult struct { @@ -5941,7 +6136,7 @@ const ( CopilotAPITokenAuthInfoHostHTTPSGithubCom CopilotAPITokenAuthInfoHost = "https://github.com" ) -// Server transport type: stdio, http, sse, or memory +// Server transport type: stdio, http, sse (deprecated), or memory type DiscoveredMcpServerType string const ( @@ -5949,7 +6144,7 @@ const ( DiscoveredMcpServerTypeHTTP DiscoveredMcpServerType = "http" // Server is backed by an in-memory runtime implementation. DiscoveredMcpServerTypeMemory DiscoveredMcpServerType = "memory" - // Server communicates over Server-Sent Events. + // Server communicates over Server-Sent Events (deprecated). DiscoveredMcpServerTypeSse DiscoveredMcpServerType = "sse" // Server communicates over stdio with a local child process. DiscoveredMcpServerTypeStdio DiscoveredMcpServerType = "stdio" @@ -6119,6 +6314,114 @@ const ( InstructionsSourcesTypeVscode InstructionsSourcesType = "vscode" ) +// Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. +// Experimental: McpAppsHostContextDetailsAvailableDisplayMode is part of an experimental +// API and may change or be removed. +type McpAppsHostContextDetailsAvailableDisplayMode string + +const ( + // Rendered as a fullscreen overlay + McpAppsHostContextDetailsAvailableDisplayModeFullscreen McpAppsHostContextDetailsAvailableDisplayMode = "fullscreen" + // Rendered inline within the host conversation surface + McpAppsHostContextDetailsAvailableDisplayModeInline McpAppsHostContextDetailsAvailableDisplayMode = "inline" + // Rendered as a picture-in-picture floating panel + McpAppsHostContextDetailsAvailableDisplayModePip McpAppsHostContextDetailsAvailableDisplayMode = "pip" +) + +// Current display mode (SEP-1865) +// Experimental: McpAppsHostContextDetailsDisplayMode is part of an experimental API and may +// change or be removed. +type McpAppsHostContextDetailsDisplayMode string + +const ( + // Rendered as a fullscreen overlay + McpAppsHostContextDetailsDisplayModeFullscreen McpAppsHostContextDetailsDisplayMode = "fullscreen" + // Rendered inline within the host conversation surface + McpAppsHostContextDetailsDisplayModeInline McpAppsHostContextDetailsDisplayMode = "inline" + // Rendered as a picture-in-picture floating panel + McpAppsHostContextDetailsDisplayModePip McpAppsHostContextDetailsDisplayMode = "pip" +) + +// Platform type for responsive design +// Experimental: McpAppsHostContextDetailsPlatform is part of an experimental API and may +// change or be removed. +type McpAppsHostContextDetailsPlatform string + +const ( + // Host runs as a desktop application + McpAppsHostContextDetailsPlatformDesktop McpAppsHostContextDetailsPlatform = "desktop" + // Host runs on a mobile device + McpAppsHostContextDetailsPlatformMobile McpAppsHostContextDetailsPlatform = "mobile" + // Host runs in a web browser + McpAppsHostContextDetailsPlatformWeb McpAppsHostContextDetailsPlatform = "web" +) + +// UI theme preference per SEP-1865 +// Experimental: McpAppsHostContextDetailsTheme is part of an experimental API and may +// change or be removed. +type McpAppsHostContextDetailsTheme string + +const ( + // Dark UI theme + McpAppsHostContextDetailsThemeDark McpAppsHostContextDetailsTheme = "dark" + // Light UI theme + McpAppsHostContextDetailsThemeLight McpAppsHostContextDetailsTheme = "light" +) + +// Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. +// Experimental: McpAppsSetHostContextDetailsAvailableDisplayMode is part of an experimental +// API and may change or be removed. +type McpAppsSetHostContextDetailsAvailableDisplayMode string + +const ( + // Rendered as a fullscreen overlay + McpAppsSetHostContextDetailsAvailableDisplayModeFullscreen McpAppsSetHostContextDetailsAvailableDisplayMode = "fullscreen" + // Rendered inline within the host conversation surface + McpAppsSetHostContextDetailsAvailableDisplayModeInline McpAppsSetHostContextDetailsAvailableDisplayMode = "inline" + // Rendered as a picture-in-picture floating panel + McpAppsSetHostContextDetailsAvailableDisplayModePip McpAppsSetHostContextDetailsAvailableDisplayMode = "pip" +) + +// Current display mode (SEP-1865) +// Experimental: McpAppsSetHostContextDetailsDisplayMode is part of an experimental API and +// may change or be removed. +type McpAppsSetHostContextDetailsDisplayMode string + +const ( + // Rendered as a fullscreen overlay + McpAppsSetHostContextDetailsDisplayModeFullscreen McpAppsSetHostContextDetailsDisplayMode = "fullscreen" + // Rendered inline within the host conversation surface + McpAppsSetHostContextDetailsDisplayModeInline McpAppsSetHostContextDetailsDisplayMode = "inline" + // Rendered as a picture-in-picture floating panel + McpAppsSetHostContextDetailsDisplayModePip McpAppsSetHostContextDetailsDisplayMode = "pip" +) + +// Platform type for responsive design +// Experimental: McpAppsSetHostContextDetailsPlatform is part of an experimental API and may +// change or be removed. +type McpAppsSetHostContextDetailsPlatform string + +const ( + // Host runs as a desktop application + McpAppsSetHostContextDetailsPlatformDesktop McpAppsSetHostContextDetailsPlatform = "desktop" + // Host runs on a mobile device + McpAppsSetHostContextDetailsPlatformMobile McpAppsSetHostContextDetailsPlatform = "mobile" + // Host runs in a web browser + McpAppsSetHostContextDetailsPlatformWeb McpAppsSetHostContextDetailsPlatform = "web" +) + +// UI theme preference per SEP-1865 +// Experimental: McpAppsSetHostContextDetailsTheme is part of an experimental API and may +// change or be removed. +type McpAppsSetHostContextDetailsTheme string + +const ( + // Dark UI theme + McpAppsSetHostContextDetailsThemeDark McpAppsSetHostContextDetailsTheme = "dark" + // Light UI theme + McpAppsSetHostContextDetailsThemeLight McpAppsSetHostContextDetailsTheme = "light" +) + // 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. @@ -8526,6 +8829,159 @@ func (a *McpApi) SetEnvValueMode(ctx context.Context, params *McpSetEnvValueMode return &result, nil } +// Experimental: McpAppsApi contains experimental APIs that may change or be removed. +type McpAppsApi sessionApi + +// CallTool call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check +// that prevents an app iframe from invoking model-only tools. Returns the standard MCP +// `CallToolResult`. +// +// RPC method: session.mcp.apps.callTool. +// +// Parameters: MCP server, tool name, and arguments to invoke from an MCP App view. +// +// Returns: Standard MCP CallToolResult +func (a *McpAppsApi) CallTool(ctx context.Context, params *McpAppsCallToolRequest) (*SessionMcpAppsCallToolResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + if params.Arguments != nil { + req["arguments"] = params.Arguments + } + req["originServerName"] = params.OriginServerName + req["serverName"] = params.ServerName + req["toolName"] = params.ToolName + } + raw, err := a.client.Request("session.mcp.apps.callTool", req) + if err != nil { + return nil, err + } + var result SessionMcpAppsCallToolResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, +// feature-flag state, advertised extension, and how many tools have `_meta.ui` populated. +// +// RPC method: session.mcp.apps.diagnose. +// +// Parameters: MCP server to diagnose MCP Apps wiring for. +// +// Returns: Diagnostic snapshot of MCP Apps wiring for the named server. +func (a *McpAppsApi) Diagnose(ctx context.Context, params *McpAppsDiagnoseRequest) (*McpAppsDiagnoseResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["serverName"] = params.ServerName + } + raw, err := a.client.Request("session.mcp.apps.diagnose", req) + if err != nil { + return nil, err + } + var result McpAppsDiagnoseResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// GetHostContext read the current host context advertised to MCP App guests. +// +// RPC method: session.mcp.apps.getHostContext. +// +// Returns: Current host context advertised to MCP App guests. +func (a *McpAppsApi) GetHostContext(ctx context.Context) (*McpAppsHostContext, error) { + req := map[string]any{"sessionId": a.sessionID} + raw, err := a.client.Request("session.mcp.apps.getHostContext", req) + if err != nil { + return nil, err + } + var result McpAppsHostContext + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// ListTools list tools that an MCP App view is allowed to call (SEP-1865 visibility +// filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) +// or includes `"app"`. +// +// RPC method: session.mcp.apps.listTools. +// +// Parameters: MCP server to list app-callable tools for. +// +// Returns: App-callable tools from the named MCP server. +func (a *McpAppsApi) ListTools(ctx context.Context, params *McpAppsListToolsRequest) (*McpAppsListToolsResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["originServerName"] = params.OriginServerName + req["serverName"] = params.ServerName + } + raw, err := a.client.Request("session.mcp.apps.listTools", req) + if err != nil { + return nil, err + } + var result McpAppsListToolsResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// ReadResource fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) +// from a connected server. Requires the `mcp-apps` session capability. +// +// RPC method: session.mcp.apps.readResource. +// +// Parameters: MCP server and resource URI to fetch. +// +// Returns: Resource contents returned by the MCP server. +func (a *McpAppsApi) ReadResource(ctx context.Context, params *McpAppsReadResourceRequest) (*McpAppsReadResourceResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["serverName"] = params.ServerName + req["uri"] = params.URI + } + raw, err := a.client.Request("session.mcp.apps.readResource", req) + if err != nil { + return nil, err + } + var result McpAppsReadResourceResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// SetHostContext replace the host context returned to MCP App guests on `ui/initialize`. +// Hosts use this to advertise theme, locale, or other metadata to the guest UI. +// +// RPC method: session.mcp.apps.setHostContext. +// +// Parameters: Host context to advertise to MCP App guests. +func (a *McpAppsApi) SetHostContext(ctx context.Context, params *McpAppsSetHostContextRequest) (*SessionMcpAppsSetHostContextResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["context"] = params.Context + } + raw, err := a.client.Request("session.mcp.apps.setHostContext", req) + if err != nil { + return nil, err + } + var result SessionMcpAppsSetHostContextResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// Experimental: Apps returns experimental APIs that may change or be removed. +func (s *McpApi) Apps() *McpAppsApi { + return (*McpAppsApi)(s) +} + // Experimental: McpOauthApi contains experimental APIs that may change or be removed. type McpOauthApi sessionApi diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index cc61228ab..155b53937 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -191,6 +191,12 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeMcpAppToolCallComplete: + var d McpAppToolCallCompleteData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeMcpOauthCompleted: var d McpOauthCompletedData if err := json.Unmarshal(raw.Data, &d); err != nil { @@ -904,9 +910,10 @@ func (r ToolExecutionCompleteContentText) MarshalJSON() ([]byte, error) { func (r *ToolExecutionCompleteResult) UnmarshalJSON(data []byte) error { type rawToolExecutionCompleteResult struct { - Content string `json:"content"` - Contents []json.RawMessage `json:"contents,omitempty"` - DetailedContent *string `json:"detailedContent,omitempty"` + Content string `json:"content"` + Contents []json.RawMessage `json:"contents,omitempty"` + DetailedContent *string `json:"detailedContent,omitempty"` + UIResource *ToolExecutionCompleteUIResource `json:"uiResource,omitempty"` } var raw rawToolExecutionCompleteResult if err := json.Unmarshal(data, &raw); err != nil { @@ -924,6 +931,7 @@ func (r *ToolExecutionCompleteResult) UnmarshalJSON(data []byte) error { } } r.DetailedContent = raw.DetailedContent + r.UIResource = raw.UIResource return nil } diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index 9a5636aeb..10d79c37f 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -79,6 +79,7 @@ const ( SessionEventTypeExternalToolRequested SessionEventType = "external_tool.requested" SessionEventTypeHookEnd SessionEventType = "hook.end" SessionEventTypeHookStart SessionEventType = "hook.start" + SessionEventTypeMcpAppToolCallComplete SessionEventType = "mcp_app.tool_call_complete" SessionEventTypeMcpOauthCompleted SessionEventType = "mcp.oauth_completed" SessionEventTypeMcpOauthRequired SessionEventType = "mcp.oauth_required" SessionEventTypeModelCallFailure SessionEventType = "model.call_failure" @@ -198,6 +199,8 @@ type AssistantMessageData struct { ReasoningText *string `json:"reasoningText,omitempty"` // GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs RequestID *string `json:"requestId,omitempty"` + // Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + ServiceRequestID *string `json:"serviceRequestId,omitempty"` // Tool invocations requested by the assistant in this message ToolRequests []AssistantMessageToolRequest `json:"toolRequests,omitempty"` // Identifier for the agent loop turn that produced this message, matching the corresponding assistant.turn_start event @@ -274,6 +277,8 @@ type SessionCompactionCompleteData struct { PreCompactionTokens *int64 `json:"preCompactionTokens,omitempty"` // GitHub request tracing ID (x-github-request-id header) for the compaction LLM call 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"` // Whether compaction completed successfully Success bool `json:"success"` // LLM-generated summary of the compacted conversation history @@ -410,6 +415,8 @@ type SessionErrorData struct { Message string `json:"message"` // GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs ProviderCallID *string `json:"providerCallId,omitempty"` + // Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + ServiceRequestID *string `json:"serviceRequestId,omitempty"` // Error stack trace, when available Stack *string `json:"stack,omitempty"` // HTTP status code from the upstream request, if applicable @@ -469,6 +476,8 @@ 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"` + // Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + ServiceRequestID *string `json:"serviceRequestId,omitempty"` // Where the failed model call originated Source ModelCallFailureSource `json:"source"` // HTTP status code from the failed request @@ -563,6 +572,8 @@ type AssistantUsageData struct { ReasoningEffort *string `json:"reasoningEffort,omitempty"` // Number of output tokens used for reasoning (e.g., chain-of-thought) ReasoningTokens *int64 `json:"reasoningTokens,omitempty"` + // Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + ServiceRequestID *string `json:"serviceRequestId,omitempty"` // Time to first token in milliseconds. Only available for streaming requests TimeToFirstTokenMs *int64 `json:"timeToFirstTokenMs,omitempty"` } @@ -570,6 +581,31 @@ type AssistantUsageData struct { func (*AssistantUsageData) sessionEventData() {} func (*AssistantUsageData) Type() SessionEventType { return SessionEventTypeAssistantUsage } +// MCP App view called a tool on a connected MCP server (SEP-1865) +type McpAppToolCallCompleteData struct { + // Arguments passed to the tool by the app view, if any + Arguments map[string]any `json:"arguments,omitempty"` + // Wall-clock duration of the underlying tools/call in milliseconds + DurationMs float64 `json:"durationMs"` + // Set when the underlying tools/call threw an error before returning a CallToolResult + Error *McpAppToolCallCompleteError `json:"error,omitempty"` + // Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. + Result map[string]any `json:"result,omitempty"` + // Name of the MCP server hosting the tool + ServerName string `json:"serverName"` + // True when the call completed without throwing AND the MCP CallToolResult did not set isError + Success bool `json:"success"` + // The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. + ToolMeta *McpAppToolCallCompleteToolMeta `json:"toolMeta,omitempty"` + // MCP tool name that was invoked + ToolName string `json:"toolName"` +} + +func (*McpAppToolCallCompleteData) sessionEventData() {} +func (*McpAppToolCallCompleteData) Type() SessionEventType { + return SessionEventTypeMcpAppToolCallComplete +} + // MCP OAuth request completion notification type McpOauthCompletedData struct { // Request ID of the resolved OAuth request @@ -583,6 +619,8 @@ func (*McpOauthCompletedData) Type() SessionEventType { return SessionEventTypeM type SessionModelChangeData struct { // Reason the change happened, when not user-initiated. Currently `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy. Cause *string `json:"cause,omitempty"` + // Context tier after the model change; null explicitly clears a previously selected tier + ContextTier *SessionModelChangeDataContextTier `json:"contextTier,omitempty"` // Newly selected model identifier NewModel string `json:"newModel"` // Model that was previously selected, if any @@ -862,6 +900,8 @@ func (*SessionExtensionsLoadedData) Type() SessionEventType { // Schema for the `McpServerStatusChangedData` type. type SessionMcpServerStatusChangedData struct { + // Error message if the server entered a failed state + Error *string `json:"error,omitempty"` // Name of the MCP server whose status changed ServerName string `json:"serverName"` // Connection status: connected, failed, needs-auth, pending, disabled, or not_configured @@ -1092,6 +1132,10 @@ type SkillInvokedData struct { PluginName *string `json:"pluginName,omitempty"` // Version of the plugin this skill originated from, when applicable PluginVersion *string `json:"pluginVersion,omitempty"` + // Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), personal-claude (~/.claude/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill) + Source *string `json:"source,omitempty"` + // What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) + Trigger *SkillInvokedTrigger `json:"trigger,omitempty"` } func (*SkillInvokedData) sessionEventData() {} @@ -1282,6 +1326,8 @@ type ToolExecutionCompleteData struct { Success bool `json:"success"` // Unique identifier for the completed tool call ToolCallID string `json:"toolCallId"` + // Tool definition metadata, present for MCP tools with MCP Apps support + ToolDescription *ToolExecutionCompleteToolDescription `json:"toolDescription,omitempty"` // Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts) ToolTelemetry map[string]any `json:"toolTelemetry,omitempty"` // Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event @@ -1525,6 +1571,8 @@ type AssistantUsageQuotaSnapshot struct { type CapabilitiesChangedUI struct { // Whether elicitation is now supported Elicitation *bool `json:"elicitation,omitempty"` + // Whether MCP Apps (SEP-1865) UI passthrough is now supported + McpApps *bool `json:"mcpApps,omitempty"` } // Schema for the `CommandsChangedCommand` type. @@ -1665,6 +1713,26 @@ type HookEndError struct { Stack *string `json:"stack,omitempty"` } +// Set when the underlying tools/call threw an error before returning a CallToolResult +type McpAppToolCallCompleteError struct { + // Human-readable error message + Message string `json:"message"` +} + +// The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. +type McpAppToolCallCompleteToolMeta struct { + // Schema for the `McpAppToolCallCompleteToolMetaUI` type. + UI *McpAppToolCallCompleteToolMetaUI `json:"ui,omitempty"` +} + +// Schema for the `McpAppToolCallCompleteToolMetaUI` type. +type McpAppToolCallCompleteToolMetaUI struct { + // `ui://` URI declared by the tool's `_meta.ui.resourceUri` + ResourceURI *string `json:"resourceUri,omitempty"` + // Tool visibility per SEP-1865 (typically a subset of `["model","app"]`) + Visibility []string `json:"visibility,omitempty"` +} + // Static OAuth client configuration, if the server specifies one type McpOauthRequiredStaticClientConfig struct { // OAuth client ID for the server @@ -1681,10 +1749,16 @@ type McpServersLoadedServer struct { Error *string `json:"error,omitempty"` // Server name (config key) Name string `json:"name"` + // Name of the plugin that supplied the effective MCP server config, only when source is plugin + PluginName *string `json:"pluginName,omitempty"` + // Version of the plugin that supplied the effective MCP server config, only when source is plugin + PluginVersion *string `json:"pluginVersion,omitempty"` // Configuration source: user, workspace, plugin, or builtin Source *McpServerSource `json:"source,omitempty"` // Connection status: connected, failed, needs-auth, pending, disabled, or not_configured Status McpServerStatus `json:"status"` + // Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) + Transport *McpServerTransport `json:"transport,omitempty"` } // Derived user-facing permission prompt details for UI consumers @@ -2562,6 +2636,98 @@ type ToolExecutionCompleteResult struct { Contents []ToolExecutionCompleteContent `json:"contents,omitempty"` // Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent. DetailedContent *string `json:"detailedContent,omitempty"` + // MCP Apps UI resource content for rendering in a sandboxed iframe + UIResource *ToolExecutionCompleteUIResource `json:"uiResource,omitempty"` +} + +// Tool definition metadata, present for MCP tools with MCP Apps support +type ToolExecutionCompleteToolDescription struct { + // Tool description + Description *string `json:"description,omitempty"` + // MCP Apps metadata for UI resource association + Meta *ToolExecutionCompleteToolDescriptionMeta `json:"_meta,omitempty"` + // Tool name + Name string `json:"name"` +} + +// MCP Apps metadata for UI resource association +type ToolExecutionCompleteToolDescriptionMeta struct { + // Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. + UI *ToolExecutionCompleteToolDescriptionMetaUI `json:"ui,omitempty"` +} + +// Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. +type ToolExecutionCompleteToolDescriptionMetaUI struct { + // URI of the UI resource + ResourceURI *string `json:"resourceUri,omitempty"` + // Who can access this tool + Visibility []ToolExecutionCompleteToolDescriptionMetaUIVisibility `json:"visibility,omitempty"` +} + +// MCP Apps UI resource content for rendering in a sandboxed iframe +type ToolExecutionCompleteUIResource struct { + // Base64-encoded HTML content + Blob *string `json:"blob,omitempty"` + // Resource-level UI metadata (CSP, permissions, visual preferences) + Meta *ToolExecutionCompleteUIResourceMeta `json:"_meta,omitempty"` + // MIME type of the content + MIMEType string `json:"mimeType"` + // HTML content as a string + Text *string `json:"text,omitempty"` + // The ui:// URI of the resource + URI string `json:"uri"` +} + +// Resource-level UI metadata (CSP, permissions, visual preferences) +type ToolExecutionCompleteUIResourceMeta struct { + // Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. + UI *ToolExecutionCompleteUIResourceMetaUI `json:"ui,omitempty"` +} + +// Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. +type ToolExecutionCompleteUIResourceMetaUI struct { + // Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. + Csp *ToolExecutionCompleteUIResourceMetaUICsp `json:"csp,omitempty"` + Domain *string `json:"domain,omitempty"` + // Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. + Permissions *ToolExecutionCompleteUIResourceMetaUIPermissions `json:"permissions,omitempty"` + PrefersBorder *bool `json:"prefersBorder,omitempty"` +} + +// Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. +type ToolExecutionCompleteUIResourceMetaUICsp struct { + BaseURIDomains []string `json:"baseUriDomains,omitempty"` + ConnectDomains []string `json:"connectDomains,omitempty"` + FrameDomains []string `json:"frameDomains,omitempty"` + ResourceDomains []string `json:"resourceDomains,omitempty"` +} + +// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. +type ToolExecutionCompleteUIResourceMetaUIPermissions struct { + // Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. + Camera *ToolExecutionCompleteUIResourceMetaUIPermissionsCamera `json:"camera,omitempty"` + // Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. + ClipboardWrite *ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite `json:"clipboardWrite,omitempty"` + // Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. + Geolocation *ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation `json:"geolocation,omitempty"` + // Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. + Microphone *ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone `json:"microphone,omitempty"` +} + +// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. +type ToolExecutionCompleteUIResourceMetaUIPermissionsCamera struct { +} + +// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. +type ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite struct { +} + +// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. +type ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation struct { +} + +// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. +type ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone struct { } // A user message attachment — a file, directory, code selection, blob, or GitHub reference @@ -2831,6 +2997,20 @@ const ( McpOauthRequiredStaticClientConfigGrantTypeClientCredentials McpOauthRequiredStaticClientConfigGrantType = "client_credentials" ) +// Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) +type McpServerTransport string + +const ( + // Server communicates over streamable HTTP. + McpServerTransportHTTP McpServerTransport = "http" + // Server is backed by an in-memory runtime implementation. + McpServerTransportMemory McpServerTransport = "memory" + // Server communicates over Server-Sent Events (deprecated). + McpServerTransportSse McpServerTransport = "sse" + // Server communicates over stdio with a local child process. + McpServerTransportStdio McpServerTransport = "stdio" +) + // Where the failed model call originated type ModelCallFailureSource string @@ -2935,6 +3115,27 @@ const ( PlanChangedOperationUpdate PlanChangedOperation = "update" ) +type SessionModelChangeDataContextTier string + +const ( + // Default context tier with standard context window size. + SessionModelChangeDataContextTierDefault SessionModelChangeDataContextTier = "default" + // Extended context tier with a larger context window. + SessionModelChangeDataContextTierLongContext SessionModelChangeDataContextTier = "long_context" +) + +// What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) +type SkillInvokedTrigger string + +const ( + // Skill invocation requested by the agent. + SkillInvokedTriggerAgentInvoked SkillInvokedTrigger = "agent-invoked" + // Skill content loaded as part of another context, such as a configured custom agent or subagent. + SkillInvokedTriggerContextLoad SkillInvokedTrigger = "context-load" + // Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. + SkillInvokedTriggerUserInvoked SkillInvokedTrigger = "user-invoked" +) + // Message role: "system" for system prompts, "developer" for developer-injected instructions type SystemMessageRole string @@ -2989,6 +3190,16 @@ const ( ToolExecutionCompleteContentTypeText ToolExecutionCompleteContentType = "text" ) +// Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration. +type ToolExecutionCompleteToolDescriptionMetaUIVisibility string + +const ( + // Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool + ToolExecutionCompleteToolDescriptionMetaUIVisibilityApp ToolExecutionCompleteToolDescriptionMetaUIVisibility = "app" + // Tool is callable by the model (LLM tool surface) + ToolExecutionCompleteToolDescriptionMetaUIVisibilityModel ToolExecutionCompleteToolDescriptionMetaUIVisibility = "model" +) + // The agent mode that was active when this message was sent type UserMessageAgentMode string diff --git a/go/zsession_events.go b/go/zsession_events.go index d3b246a86..25c002fcb 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -7,240 +7,260 @@ import "github.com/github/copilot-sdk/go/rpc" // Session-event types are generated in the rpc package and aliased here for source compatibility. type ( - AbortData = rpc.AbortData - AbortReason = rpc.AbortReason - AssistantIntentData = rpc.AssistantIntentData - AssistantMessageData = rpc.AssistantMessageData - AssistantMessageDeltaData = rpc.AssistantMessageDeltaData - AssistantMessageStartData = rpc.AssistantMessageStartData - AssistantMessageToolRequest = rpc.AssistantMessageToolRequest - AssistantMessageToolRequestType = rpc.AssistantMessageToolRequestType - AssistantReasoningData = rpc.AssistantReasoningData - AssistantReasoningDeltaData = rpc.AssistantReasoningDeltaData - AssistantStreamingDeltaData = rpc.AssistantStreamingDeltaData - AssistantTurnEndData = rpc.AssistantTurnEndData - AssistantTurnStartData = rpc.AssistantTurnStartData - AssistantUsageAPIEndpoint = rpc.AssistantUsageAPIEndpoint - AssistantUsageCopilotUsageTokenDetail = rpc.AssistantUsageCopilotUsageTokenDetail - AssistantUsageData = rpc.AssistantUsageData - Attachment = rpc.Attachment - AttachmentType = rpc.AttachmentType - AutoModeSwitchCompletedData = rpc.AutoModeSwitchCompletedData - AutoModeSwitchRequestedData = rpc.AutoModeSwitchRequestedData - AutoModeSwitchResponse = rpc.AutoModeSwitchResponse - CapabilitiesChangedData = rpc.CapabilitiesChangedData - CapabilitiesChangedUI = rpc.CapabilitiesChangedUI - CommandCompletedData = rpc.CommandCompletedData - CommandExecuteData = rpc.CommandExecuteData - CommandQueuedData = rpc.CommandQueuedData - CommandsChangedCommand = rpc.CommandsChangedCommand - CommandsChangedData = rpc.CommandsChangedData - CompactionCompleteCompactionTokensUsed = rpc.CompactionCompleteCompactionTokensUsed - CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail = rpc.CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail - CustomAgentsUpdatedAgent = rpc.CustomAgentsUpdatedAgent - CustomNotificationPayload = rpc.CustomNotificationPayload - ElicitationCompletedAction = rpc.ElicitationCompletedAction - ElicitationCompletedBooleanContent = rpc.ElicitationCompletedBooleanContent - ElicitationCompletedContent = rpc.ElicitationCompletedContent - ElicitationCompletedData = rpc.ElicitationCompletedData - ElicitationCompletedNumberContent = rpc.ElicitationCompletedNumberContent - ElicitationCompletedStringArrayContent = rpc.ElicitationCompletedStringArrayContent - ElicitationCompletedStringContent = rpc.ElicitationCompletedStringContent - ElicitationRequestedData = rpc.ElicitationRequestedData - ElicitationRequestedMode = rpc.ElicitationRequestedMode - ElicitationRequestedSchema = rpc.ElicitationRequestedSchema - ElicitationRequestedSchemaType = rpc.ElicitationRequestedSchemaType - EmbeddedBlobResourceContents = rpc.EmbeddedBlobResourceContents - EmbeddedTextResourceContents = rpc.EmbeddedTextResourceContents - ExitPlanModeAction = rpc.ExitPlanModeAction - ExitPlanModeCompletedData = rpc.ExitPlanModeCompletedData - ExitPlanModeRequestedData = rpc.ExitPlanModeRequestedData - ExtensionsLoadedExtension = rpc.ExtensionsLoadedExtension - ExtensionsLoadedExtensionSource = rpc.ExtensionsLoadedExtensionSource - ExtensionsLoadedExtensionStatus = rpc.ExtensionsLoadedExtensionStatus - ExternalToolCompletedData = rpc.ExternalToolCompletedData - ExternalToolRequestedData = rpc.ExternalToolRequestedData - HandoffRepository = rpc.HandoffRepository - HandoffSourceType = rpc.HandoffSourceType - HookEndData = rpc.HookEndData - HookEndError = rpc.HookEndError - HookStartData = rpc.HookStartData - McpOauthCompletedData = rpc.McpOauthCompletedData - McpOauthRequiredData = rpc.McpOauthRequiredData - McpOauthRequiredStaticClientConfig = rpc.McpOauthRequiredStaticClientConfig - McpOauthRequiredStaticClientConfigGrantType = rpc.McpOauthRequiredStaticClientConfigGrantType - McpServersLoadedServer = rpc.McpServersLoadedServer - McpServerSource = rpc.McpServerSource - McpServerStatus = rpc.McpServerStatus - ModelCallFailureData = rpc.ModelCallFailureData - ModelCallFailureSource = rpc.ModelCallFailureSource - PendingMessagesModifiedData = rpc.PendingMessagesModifiedData - PermissionApproved = rpc.PermissionApproved - PermissionApprovedForLocation = rpc.PermissionApprovedForLocation - PermissionApprovedForSession = rpc.PermissionApprovedForSession - PermissionCancelled = rpc.PermissionCancelled - PermissionCompletedData = rpc.PermissionCompletedData - PermissionDeniedByContentExclusionPolicy = rpc.PermissionDeniedByContentExclusionPolicy - PermissionDeniedByPermissionRequestHook = rpc.PermissionDeniedByPermissionRequestHook - PermissionDeniedByRules = rpc.PermissionDeniedByRules - PermissionDeniedInteractivelyByUser = rpc.PermissionDeniedInteractivelyByUser - PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser = rpc.PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser - PermissionPromptRequest = rpc.PermissionPromptRequest - PermissionPromptRequestCommands = rpc.PermissionPromptRequestCommands - PermissionPromptRequestCustomTool = rpc.PermissionPromptRequestCustomTool - PermissionPromptRequestExtensionManagement = rpc.PermissionPromptRequestExtensionManagement - PermissionPromptRequestExtensionPermissionAccess = rpc.PermissionPromptRequestExtensionPermissionAccess - PermissionPromptRequestHook = rpc.PermissionPromptRequestHook - PermissionPromptRequestKind = rpc.PermissionPromptRequestKind - PermissionPromptRequestMcp = rpc.PermissionPromptRequestMcp - PermissionPromptRequestMemory = rpc.PermissionPromptRequestMemory - PermissionPromptRequestPath = rpc.PermissionPromptRequestPath - PermissionPromptRequestPathAccessKind = rpc.PermissionPromptRequestPathAccessKind - PermissionPromptRequestRead = rpc.PermissionPromptRequestRead - PermissionPromptRequestURL = rpc.PermissionPromptRequestURL - PermissionPromptRequestWrite = rpc.PermissionPromptRequestWrite - PermissionRequest = rpc.PermissionRequest - PermissionRequestCommand = rpc.PermissionRequestCommand - PermissionRequestCustomTool = rpc.PermissionRequestCustomTool - PermissionRequestedData = rpc.PermissionRequestedData - PermissionRequestExtensionManagement = rpc.PermissionRequestExtensionManagement - PermissionRequestExtensionPermissionAccess = rpc.PermissionRequestExtensionPermissionAccess - PermissionRequestHook = rpc.PermissionRequestHook - PermissionRequestKind = rpc.PermissionRequestKind - PermissionRequestMcp = rpc.PermissionRequestMcp - PermissionRequestMemory = rpc.PermissionRequestMemory - PermissionRequestMemoryAction = rpc.PermissionRequestMemoryAction - PermissionRequestMemoryDirection = rpc.PermissionRequestMemoryDirection - PermissionRequestRead = rpc.PermissionRequestRead - PermissionRequestShell = rpc.PermissionRequestShell - PermissionRequestShellCommand = rpc.PermissionRequestShellCommand - PermissionRequestShellPossibleURL = rpc.PermissionRequestShellPossibleURL - PermissionRequestURL = rpc.PermissionRequestURL - PermissionRequestWrite = rpc.PermissionRequestWrite - PermissionResult = rpc.PermissionResult - PermissionResultKind = rpc.PermissionResultKind - PermissionRule = rpc.PermissionRule - PlanChangedOperation = rpc.PlanChangedOperation - PossibleURL = rpc.PossibleURL - RawPermissionPromptRequest = rpc.RawPermissionPromptRequest - RawPermissionRequest = rpc.RawPermissionRequest - RawPermissionResult = rpc.RawPermissionResult - RawSessionEventData = rpc.RawSessionEventData - RawSystemNotification = rpc.RawSystemNotification - RawToolExecutionCompleteContent = rpc.RawToolExecutionCompleteContent - RawUserMessageAttachment = rpc.RawUserMessageAttachment - ReasoningSummary = rpc.ReasoningSummary - SamplingCompletedData = rpc.SamplingCompletedData - SamplingRequestedData = rpc.SamplingRequestedData - SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData - SessionCompactionCompleteData = rpc.SessionCompactionCompleteData - SessionCompactionStartData = rpc.SessionCompactionStartData - SessionContextChangedData = rpc.SessionContextChangedData - SessionCustomAgentsUpdatedData = rpc.SessionCustomAgentsUpdatedData - SessionCustomNotificationData = rpc.SessionCustomNotificationData - SessionErrorData = rpc.SessionErrorData - SessionEvent = rpc.SessionEvent - SessionEventData = rpc.SessionEventData - SessionEventType = rpc.SessionEventType - SessionExtensionsLoadedData = rpc.SessionExtensionsLoadedData - SessionHandoffData = rpc.SessionHandoffData - SessionIdleData = rpc.SessionIdleData - SessionInfoData = rpc.SessionInfoData - SessionMcpServersLoadedData = rpc.SessionMcpServersLoadedData - SessionMcpServerStatusChangedData = rpc.SessionMcpServerStatusChangedData - SessionMode = rpc.SessionMode - SessionModeChangedData = rpc.SessionModeChangedData - SessionModelChangeData = rpc.SessionModelChangeData - SessionPlanChangedData = rpc.SessionPlanChangedData - SessionRemoteSteerableChangedData = rpc.SessionRemoteSteerableChangedData - SessionResumeData = rpc.SessionResumeData - SessionScheduleCancelledData = rpc.SessionScheduleCancelledData - SessionScheduleCreatedData = rpc.SessionScheduleCreatedData - SessionShutdownData = rpc.SessionShutdownData - SessionSkillsLoadedData = rpc.SessionSkillsLoadedData - SessionSnapshotRewindData = rpc.SessionSnapshotRewindData - SessionStartData = rpc.SessionStartData - SessionTaskCompleteData = rpc.SessionTaskCompleteData - SessionTitleChangedData = rpc.SessionTitleChangedData - SessionToolsUpdatedData = rpc.SessionToolsUpdatedData - SessionTruncationData = rpc.SessionTruncationData - SessionUsageInfoData = rpc.SessionUsageInfoData - SessionWarningData = rpc.SessionWarningData - SessionWorkspaceFileChangedData = rpc.SessionWorkspaceFileChangedData - ShutdownCodeChanges = rpc.ShutdownCodeChanges - ShutdownModelMetric = rpc.ShutdownModelMetric - ShutdownModelMetricRequests = rpc.ShutdownModelMetricRequests - ShutdownModelMetricTokenDetail = rpc.ShutdownModelMetricTokenDetail - ShutdownModelMetricUsage = rpc.ShutdownModelMetricUsage - ShutdownTokenDetail = rpc.ShutdownTokenDetail - ShutdownType = rpc.ShutdownType - SkillInvokedData = rpc.SkillInvokedData - SkillsLoadedSkill = rpc.SkillsLoadedSkill - SkillSource = rpc.SkillSource - SubagentCompletedData = rpc.SubagentCompletedData - SubagentDeselectedData = rpc.SubagentDeselectedData - SubagentFailedData = rpc.SubagentFailedData - SubagentSelectedData = rpc.SubagentSelectedData - SubagentStartedData = rpc.SubagentStartedData - SystemMessageData = rpc.SystemMessageData - SystemMessageMetadata = rpc.SystemMessageMetadata - SystemMessageRole = rpc.SystemMessageRole - SystemNotification = rpc.SystemNotification - SystemNotificationAgentCompleted = rpc.SystemNotificationAgentCompleted - SystemNotificationAgentCompletedStatus = rpc.SystemNotificationAgentCompletedStatus - SystemNotificationAgentIdle = rpc.SystemNotificationAgentIdle - SystemNotificationData = rpc.SystemNotificationData - SystemNotificationInstructionDiscovered = rpc.SystemNotificationInstructionDiscovered - SystemNotificationNewInboxMessage = rpc.SystemNotificationNewInboxMessage - SystemNotificationShellCompleted = rpc.SystemNotificationShellCompleted - SystemNotificationShellDetachedCompleted = rpc.SystemNotificationShellDetachedCompleted - SystemNotificationType = rpc.SystemNotificationType - ToolExecutionCompleteContent = rpc.ToolExecutionCompleteContent - ToolExecutionCompleteContentAudio = rpc.ToolExecutionCompleteContentAudio - ToolExecutionCompleteContentImage = rpc.ToolExecutionCompleteContentImage - ToolExecutionCompleteContentResource = rpc.ToolExecutionCompleteContentResource - ToolExecutionCompleteContentResourceDetails = rpc.ToolExecutionCompleteContentResourceDetails - ToolExecutionCompleteContentResourceLink = rpc.ToolExecutionCompleteContentResourceLink - ToolExecutionCompleteContentResourceLinkIcon = rpc.ToolExecutionCompleteContentResourceLinkIcon - ToolExecutionCompleteContentResourceLinkIconTheme = rpc.ToolExecutionCompleteContentResourceLinkIconTheme - ToolExecutionCompleteContentTerminal = rpc.ToolExecutionCompleteContentTerminal - ToolExecutionCompleteContentText = rpc.ToolExecutionCompleteContentText - ToolExecutionCompleteContentType = rpc.ToolExecutionCompleteContentType - ToolExecutionCompleteData = rpc.ToolExecutionCompleteData - ToolExecutionCompleteError = rpc.ToolExecutionCompleteError - ToolExecutionCompleteResult = rpc.ToolExecutionCompleteResult - ToolExecutionPartialResultData = rpc.ToolExecutionPartialResultData - ToolExecutionProgressData = rpc.ToolExecutionProgressData - ToolExecutionStartData = rpc.ToolExecutionStartData - ToolUserRequestedData = rpc.ToolUserRequestedData - UserInputCompletedData = rpc.UserInputCompletedData - UserInputRequestedData = rpc.UserInputRequestedData - UserMessageAgentMode = rpc.UserMessageAgentMode - UserMessageAttachment = rpc.UserMessageAttachment - UserMessageAttachmentBlob = rpc.UserMessageAttachmentBlob - UserMessageAttachmentDirectory = rpc.UserMessageAttachmentDirectory - UserMessageAttachmentFile = rpc.UserMessageAttachmentFile - UserMessageAttachmentFileLineRange = rpc.UserMessageAttachmentFileLineRange - UserMessageAttachmentGithubReference = rpc.UserMessageAttachmentGithubReference - UserMessageAttachmentGithubReferenceType = rpc.UserMessageAttachmentGithubReferenceType - UserMessageAttachmentSelection = rpc.UserMessageAttachmentSelection - UserMessageAttachmentSelectionDetails = rpc.UserMessageAttachmentSelectionDetails - UserMessageAttachmentSelectionDetailsEnd = rpc.UserMessageAttachmentSelectionDetailsEnd - UserMessageAttachmentSelectionDetailsStart = rpc.UserMessageAttachmentSelectionDetailsStart - UserMessageAttachmentType = rpc.UserMessageAttachmentType - UserMessageData = rpc.UserMessageData - UserToolSessionApproval = rpc.UserToolSessionApproval - UserToolSessionApprovalCommands = rpc.UserToolSessionApprovalCommands - UserToolSessionApprovalCustomTool = rpc.UserToolSessionApprovalCustomTool - UserToolSessionApprovalExtensionManagement = rpc.UserToolSessionApprovalExtensionManagement - UserToolSessionApprovalExtensionPermissionAccess = rpc.UserToolSessionApprovalExtensionPermissionAccess - UserToolSessionApprovalMcp = rpc.UserToolSessionApprovalMcp - UserToolSessionApprovalMemory = rpc.UserToolSessionApprovalMemory - UserToolSessionApprovalRead = rpc.UserToolSessionApprovalRead - UserToolSessionApprovalWrite = rpc.UserToolSessionApprovalWrite - WorkingDirectoryContext = rpc.WorkingDirectoryContext - WorkingDirectoryContextHostType = rpc.WorkingDirectoryContextHostType - WorkspaceFileChangedOperation = rpc.WorkspaceFileChangedOperation + AbortData = rpc.AbortData + AbortReason = rpc.AbortReason + AssistantIntentData = rpc.AssistantIntentData + AssistantMessageData = rpc.AssistantMessageData + AssistantMessageDeltaData = rpc.AssistantMessageDeltaData + AssistantMessageStartData = rpc.AssistantMessageStartData + AssistantMessageToolRequest = rpc.AssistantMessageToolRequest + AssistantMessageToolRequestType = rpc.AssistantMessageToolRequestType + AssistantReasoningData = rpc.AssistantReasoningData + AssistantReasoningDeltaData = rpc.AssistantReasoningDeltaData + AssistantStreamingDeltaData = rpc.AssistantStreamingDeltaData + AssistantTurnEndData = rpc.AssistantTurnEndData + AssistantTurnStartData = rpc.AssistantTurnStartData + AssistantUsageAPIEndpoint = rpc.AssistantUsageAPIEndpoint + AssistantUsageCopilotUsageTokenDetail = rpc.AssistantUsageCopilotUsageTokenDetail + AssistantUsageData = rpc.AssistantUsageData + Attachment = rpc.Attachment + AttachmentType = rpc.AttachmentType + AutoModeSwitchCompletedData = rpc.AutoModeSwitchCompletedData + AutoModeSwitchRequestedData = rpc.AutoModeSwitchRequestedData + AutoModeSwitchResponse = rpc.AutoModeSwitchResponse + CapabilitiesChangedData = rpc.CapabilitiesChangedData + CapabilitiesChangedUI = rpc.CapabilitiesChangedUI + CommandCompletedData = rpc.CommandCompletedData + CommandExecuteData = rpc.CommandExecuteData + CommandQueuedData = rpc.CommandQueuedData + CommandsChangedCommand = rpc.CommandsChangedCommand + CommandsChangedData = rpc.CommandsChangedData + CompactionCompleteCompactionTokensUsed = rpc.CompactionCompleteCompactionTokensUsed + CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail = rpc.CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail + CustomAgentsUpdatedAgent = rpc.CustomAgentsUpdatedAgent + CustomNotificationPayload = rpc.CustomNotificationPayload + ElicitationCompletedAction = rpc.ElicitationCompletedAction + ElicitationCompletedBooleanContent = rpc.ElicitationCompletedBooleanContent + ElicitationCompletedContent = rpc.ElicitationCompletedContent + ElicitationCompletedData = rpc.ElicitationCompletedData + ElicitationCompletedNumberContent = rpc.ElicitationCompletedNumberContent + ElicitationCompletedStringArrayContent = rpc.ElicitationCompletedStringArrayContent + ElicitationCompletedStringContent = rpc.ElicitationCompletedStringContent + ElicitationRequestedData = rpc.ElicitationRequestedData + ElicitationRequestedMode = rpc.ElicitationRequestedMode + ElicitationRequestedSchema = rpc.ElicitationRequestedSchema + ElicitationRequestedSchemaType = rpc.ElicitationRequestedSchemaType + EmbeddedBlobResourceContents = rpc.EmbeddedBlobResourceContents + EmbeddedTextResourceContents = rpc.EmbeddedTextResourceContents + ExitPlanModeAction = rpc.ExitPlanModeAction + ExitPlanModeCompletedData = rpc.ExitPlanModeCompletedData + ExitPlanModeRequestedData = rpc.ExitPlanModeRequestedData + ExtensionsLoadedExtension = rpc.ExtensionsLoadedExtension + ExtensionsLoadedExtensionSource = rpc.ExtensionsLoadedExtensionSource + ExtensionsLoadedExtensionStatus = rpc.ExtensionsLoadedExtensionStatus + ExternalToolCompletedData = rpc.ExternalToolCompletedData + ExternalToolRequestedData = rpc.ExternalToolRequestedData + HandoffRepository = rpc.HandoffRepository + HandoffSourceType = rpc.HandoffSourceType + HookEndData = rpc.HookEndData + HookEndError = rpc.HookEndError + HookStartData = rpc.HookStartData + McpAppToolCallCompleteData = rpc.McpAppToolCallCompleteData + McpAppToolCallCompleteError = rpc.McpAppToolCallCompleteError + McpAppToolCallCompleteToolMeta = rpc.McpAppToolCallCompleteToolMeta + McpAppToolCallCompleteToolMetaUI = rpc.McpAppToolCallCompleteToolMetaUI + McpOauthCompletedData = rpc.McpOauthCompletedData + McpOauthRequiredData = rpc.McpOauthRequiredData + McpOauthRequiredStaticClientConfig = rpc.McpOauthRequiredStaticClientConfig + McpOauthRequiredStaticClientConfigGrantType = rpc.McpOauthRequiredStaticClientConfigGrantType + McpServersLoadedServer = rpc.McpServersLoadedServer + McpServerSource = rpc.McpServerSource + McpServerStatus = rpc.McpServerStatus + McpServerTransport = rpc.McpServerTransport + ModelCallFailureData = rpc.ModelCallFailureData + ModelCallFailureSource = rpc.ModelCallFailureSource + PendingMessagesModifiedData = rpc.PendingMessagesModifiedData + PermissionApproved = rpc.PermissionApproved + PermissionApprovedForLocation = rpc.PermissionApprovedForLocation + PermissionApprovedForSession = rpc.PermissionApprovedForSession + PermissionCancelled = rpc.PermissionCancelled + PermissionCompletedData = rpc.PermissionCompletedData + PermissionDeniedByContentExclusionPolicy = rpc.PermissionDeniedByContentExclusionPolicy + PermissionDeniedByPermissionRequestHook = rpc.PermissionDeniedByPermissionRequestHook + PermissionDeniedByRules = rpc.PermissionDeniedByRules + PermissionDeniedInteractivelyByUser = rpc.PermissionDeniedInteractivelyByUser + PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser = rpc.PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser + PermissionPromptRequest = rpc.PermissionPromptRequest + PermissionPromptRequestCommands = rpc.PermissionPromptRequestCommands + PermissionPromptRequestCustomTool = rpc.PermissionPromptRequestCustomTool + PermissionPromptRequestExtensionManagement = rpc.PermissionPromptRequestExtensionManagement + PermissionPromptRequestExtensionPermissionAccess = rpc.PermissionPromptRequestExtensionPermissionAccess + PermissionPromptRequestHook = rpc.PermissionPromptRequestHook + PermissionPromptRequestKind = rpc.PermissionPromptRequestKind + PermissionPromptRequestMcp = rpc.PermissionPromptRequestMcp + PermissionPromptRequestMemory = rpc.PermissionPromptRequestMemory + PermissionPromptRequestPath = rpc.PermissionPromptRequestPath + PermissionPromptRequestPathAccessKind = rpc.PermissionPromptRequestPathAccessKind + PermissionPromptRequestRead = rpc.PermissionPromptRequestRead + PermissionPromptRequestURL = rpc.PermissionPromptRequestURL + PermissionPromptRequestWrite = rpc.PermissionPromptRequestWrite + PermissionRequest = rpc.PermissionRequest + PermissionRequestCommand = rpc.PermissionRequestCommand + PermissionRequestCustomTool = rpc.PermissionRequestCustomTool + PermissionRequestedData = rpc.PermissionRequestedData + PermissionRequestExtensionManagement = rpc.PermissionRequestExtensionManagement + PermissionRequestExtensionPermissionAccess = rpc.PermissionRequestExtensionPermissionAccess + PermissionRequestHook = rpc.PermissionRequestHook + PermissionRequestKind = rpc.PermissionRequestKind + PermissionRequestMcp = rpc.PermissionRequestMcp + PermissionRequestMemory = rpc.PermissionRequestMemory + PermissionRequestMemoryAction = rpc.PermissionRequestMemoryAction + PermissionRequestMemoryDirection = rpc.PermissionRequestMemoryDirection + PermissionRequestRead = rpc.PermissionRequestRead + PermissionRequestShell = rpc.PermissionRequestShell + PermissionRequestShellCommand = rpc.PermissionRequestShellCommand + PermissionRequestShellPossibleURL = rpc.PermissionRequestShellPossibleURL + PermissionRequestURL = rpc.PermissionRequestURL + PermissionRequestWrite = rpc.PermissionRequestWrite + PermissionResult = rpc.PermissionResult + PermissionResultKind = rpc.PermissionResultKind + PermissionRule = rpc.PermissionRule + PlanChangedOperation = rpc.PlanChangedOperation + PossibleURL = rpc.PossibleURL + RawPermissionPromptRequest = rpc.RawPermissionPromptRequest + RawPermissionRequest = rpc.RawPermissionRequest + RawPermissionResult = rpc.RawPermissionResult + RawSessionEventData = rpc.RawSessionEventData + RawSystemNotification = rpc.RawSystemNotification + RawToolExecutionCompleteContent = rpc.RawToolExecutionCompleteContent + RawUserMessageAttachment = rpc.RawUserMessageAttachment + ReasoningSummary = rpc.ReasoningSummary + SamplingCompletedData = rpc.SamplingCompletedData + SamplingRequestedData = rpc.SamplingRequestedData + SessionBackgroundTasksChangedData = rpc.SessionBackgroundTasksChangedData + SessionCompactionCompleteData = rpc.SessionCompactionCompleteData + SessionCompactionStartData = rpc.SessionCompactionStartData + SessionContextChangedData = rpc.SessionContextChangedData + SessionCustomAgentsUpdatedData = rpc.SessionCustomAgentsUpdatedData + SessionCustomNotificationData = rpc.SessionCustomNotificationData + SessionErrorData = rpc.SessionErrorData + SessionEvent = rpc.SessionEvent + SessionEventData = rpc.SessionEventData + SessionEventType = rpc.SessionEventType + SessionExtensionsLoadedData = rpc.SessionExtensionsLoadedData + SessionHandoffData = rpc.SessionHandoffData + SessionIdleData = rpc.SessionIdleData + SessionInfoData = rpc.SessionInfoData + SessionMcpServersLoadedData = rpc.SessionMcpServersLoadedData + SessionMcpServerStatusChangedData = rpc.SessionMcpServerStatusChangedData + SessionMode = rpc.SessionMode + SessionModeChangedData = rpc.SessionModeChangedData + SessionModelChangeData = rpc.SessionModelChangeData + SessionModelChangeDataContextTier = rpc.SessionModelChangeDataContextTier + SessionPlanChangedData = rpc.SessionPlanChangedData + SessionRemoteSteerableChangedData = rpc.SessionRemoteSteerableChangedData + SessionResumeData = rpc.SessionResumeData + SessionScheduleCancelledData = rpc.SessionScheduleCancelledData + SessionScheduleCreatedData = rpc.SessionScheduleCreatedData + SessionShutdownData = rpc.SessionShutdownData + SessionSkillsLoadedData = rpc.SessionSkillsLoadedData + SessionSnapshotRewindData = rpc.SessionSnapshotRewindData + SessionStartData = rpc.SessionStartData + SessionTaskCompleteData = rpc.SessionTaskCompleteData + SessionTitleChangedData = rpc.SessionTitleChangedData + SessionToolsUpdatedData = rpc.SessionToolsUpdatedData + SessionTruncationData = rpc.SessionTruncationData + SessionUsageInfoData = rpc.SessionUsageInfoData + SessionWarningData = rpc.SessionWarningData + SessionWorkspaceFileChangedData = rpc.SessionWorkspaceFileChangedData + ShutdownCodeChanges = rpc.ShutdownCodeChanges + ShutdownModelMetric = rpc.ShutdownModelMetric + ShutdownModelMetricRequests = rpc.ShutdownModelMetricRequests + ShutdownModelMetricTokenDetail = rpc.ShutdownModelMetricTokenDetail + ShutdownModelMetricUsage = rpc.ShutdownModelMetricUsage + ShutdownTokenDetail = rpc.ShutdownTokenDetail + ShutdownType = rpc.ShutdownType + SkillInvokedData = rpc.SkillInvokedData + SkillInvokedTrigger = rpc.SkillInvokedTrigger + SkillsLoadedSkill = rpc.SkillsLoadedSkill + SkillSource = rpc.SkillSource + SubagentCompletedData = rpc.SubagentCompletedData + SubagentDeselectedData = rpc.SubagentDeselectedData + SubagentFailedData = rpc.SubagentFailedData + SubagentSelectedData = rpc.SubagentSelectedData + SubagentStartedData = rpc.SubagentStartedData + SystemMessageData = rpc.SystemMessageData + SystemMessageMetadata = rpc.SystemMessageMetadata + SystemMessageRole = rpc.SystemMessageRole + SystemNotification = rpc.SystemNotification + SystemNotificationAgentCompleted = rpc.SystemNotificationAgentCompleted + SystemNotificationAgentCompletedStatus = rpc.SystemNotificationAgentCompletedStatus + SystemNotificationAgentIdle = rpc.SystemNotificationAgentIdle + SystemNotificationData = rpc.SystemNotificationData + SystemNotificationInstructionDiscovered = rpc.SystemNotificationInstructionDiscovered + SystemNotificationNewInboxMessage = rpc.SystemNotificationNewInboxMessage + SystemNotificationShellCompleted = rpc.SystemNotificationShellCompleted + SystemNotificationShellDetachedCompleted = rpc.SystemNotificationShellDetachedCompleted + SystemNotificationType = rpc.SystemNotificationType + ToolExecutionCompleteContent = rpc.ToolExecutionCompleteContent + ToolExecutionCompleteContentAudio = rpc.ToolExecutionCompleteContentAudio + ToolExecutionCompleteContentImage = rpc.ToolExecutionCompleteContentImage + ToolExecutionCompleteContentResource = rpc.ToolExecutionCompleteContentResource + ToolExecutionCompleteContentResourceDetails = rpc.ToolExecutionCompleteContentResourceDetails + ToolExecutionCompleteContentResourceLink = rpc.ToolExecutionCompleteContentResourceLink + ToolExecutionCompleteContentResourceLinkIcon = rpc.ToolExecutionCompleteContentResourceLinkIcon + ToolExecutionCompleteContentResourceLinkIconTheme = rpc.ToolExecutionCompleteContentResourceLinkIconTheme + ToolExecutionCompleteContentTerminal = rpc.ToolExecutionCompleteContentTerminal + ToolExecutionCompleteContentText = rpc.ToolExecutionCompleteContentText + ToolExecutionCompleteContentType = rpc.ToolExecutionCompleteContentType + ToolExecutionCompleteData = rpc.ToolExecutionCompleteData + ToolExecutionCompleteError = rpc.ToolExecutionCompleteError + ToolExecutionCompleteResult = rpc.ToolExecutionCompleteResult + ToolExecutionCompleteToolDescription = rpc.ToolExecutionCompleteToolDescription + ToolExecutionCompleteToolDescriptionMeta = rpc.ToolExecutionCompleteToolDescriptionMeta + ToolExecutionCompleteToolDescriptionMetaUI = rpc.ToolExecutionCompleteToolDescriptionMetaUI + ToolExecutionCompleteToolDescriptionMetaUIVisibility = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibility + ToolExecutionCompleteUIResource = rpc.ToolExecutionCompleteUIResource + ToolExecutionCompleteUIResourceMeta = rpc.ToolExecutionCompleteUIResourceMeta + ToolExecutionCompleteUIResourceMetaUI = rpc.ToolExecutionCompleteUIResourceMetaUI + ToolExecutionCompleteUIResourceMetaUICsp = rpc.ToolExecutionCompleteUIResourceMetaUICsp + ToolExecutionCompleteUIResourceMetaUIPermissions = rpc.ToolExecutionCompleteUIResourceMetaUIPermissions + ToolExecutionCompleteUIResourceMetaUIPermissionsCamera = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsCamera + ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite + ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation + ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone = rpc.ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone + ToolExecutionPartialResultData = rpc.ToolExecutionPartialResultData + ToolExecutionProgressData = rpc.ToolExecutionProgressData + ToolExecutionStartData = rpc.ToolExecutionStartData + ToolUserRequestedData = rpc.ToolUserRequestedData + UserInputCompletedData = rpc.UserInputCompletedData + UserInputRequestedData = rpc.UserInputRequestedData + UserMessageAgentMode = rpc.UserMessageAgentMode + UserMessageAttachment = rpc.UserMessageAttachment + UserMessageAttachmentBlob = rpc.UserMessageAttachmentBlob + UserMessageAttachmentDirectory = rpc.UserMessageAttachmentDirectory + UserMessageAttachmentFile = rpc.UserMessageAttachmentFile + UserMessageAttachmentFileLineRange = rpc.UserMessageAttachmentFileLineRange + UserMessageAttachmentGithubReference = rpc.UserMessageAttachmentGithubReference + UserMessageAttachmentGithubReferenceType = rpc.UserMessageAttachmentGithubReferenceType + UserMessageAttachmentSelection = rpc.UserMessageAttachmentSelection + UserMessageAttachmentSelectionDetails = rpc.UserMessageAttachmentSelectionDetails + UserMessageAttachmentSelectionDetailsEnd = rpc.UserMessageAttachmentSelectionDetailsEnd + UserMessageAttachmentSelectionDetailsStart = rpc.UserMessageAttachmentSelectionDetailsStart + UserMessageAttachmentType = rpc.UserMessageAttachmentType + UserMessageData = rpc.UserMessageData + UserToolSessionApproval = rpc.UserToolSessionApproval + UserToolSessionApprovalCommands = rpc.UserToolSessionApprovalCommands + UserToolSessionApprovalCustomTool = rpc.UserToolSessionApprovalCustomTool + UserToolSessionApprovalExtensionManagement = rpc.UserToolSessionApprovalExtensionManagement + UserToolSessionApprovalExtensionPermissionAccess = rpc.UserToolSessionApprovalExtensionPermissionAccess + UserToolSessionApprovalMcp = rpc.UserToolSessionApprovalMcp + UserToolSessionApprovalMemory = rpc.UserToolSessionApprovalMemory + UserToolSessionApprovalRead = rpc.UserToolSessionApprovalRead + UserToolSessionApprovalWrite = rpc.UserToolSessionApprovalWrite + WorkingDirectoryContext = rpc.WorkingDirectoryContext + WorkingDirectoryContextHostType = rpc.WorkingDirectoryContextHostType + WorkspaceFileChangedOperation = rpc.WorkspaceFileChangedOperation ) // Session-event constants are generated in the rpc package and re-exported here for source compatibility. @@ -291,6 +311,10 @@ const ( McpServerStatusNeedsAuth = rpc.McpServerStatusNeedsAuth McpServerStatusNotConfigured = rpc.McpServerStatusNotConfigured McpServerStatusPending = rpc.McpServerStatusPending + McpServerTransportHTTP = rpc.McpServerTransportHTTP + McpServerTransportMemory = rpc.McpServerTransportMemory + McpServerTransportSse = rpc.McpServerTransportSse + McpServerTransportStdio = rpc.McpServerTransportStdio ModelCallFailureSourceMcpSampling = rpc.ModelCallFailureSourceMcpSampling ModelCallFailureSourceSubagent = rpc.ModelCallFailureSourceSubagent ModelCallFailureSourceTopLevel = rpc.ModelCallFailureSourceTopLevel @@ -363,6 +387,7 @@ const ( SessionEventTypeExternalToolRequested = rpc.SessionEventTypeExternalToolRequested SessionEventTypeHookEnd = rpc.SessionEventTypeHookEnd SessionEventTypeHookStart = rpc.SessionEventTypeHookStart + SessionEventTypeMcpAppToolCallComplete = rpc.SessionEventTypeMcpAppToolCallComplete SessionEventTypeMcpOauthCompleted = rpc.SessionEventTypeMcpOauthCompleted SessionEventTypeMcpOauthRequired = rpc.SessionEventTypeMcpOauthRequired SessionEventTypeModelCallFailure = rpc.SessionEventTypeModelCallFailure @@ -420,9 +445,14 @@ const ( SessionEventTypeUserMessage = rpc.SessionEventTypeUserMessage SessionModeAutopilot = rpc.SessionModeAutopilot SessionModeInteractive = rpc.SessionModeInteractive + SessionModelChangeDataContextTierDefault = rpc.SessionModelChangeDataContextTierDefault + SessionModelChangeDataContextTierLongContext = rpc.SessionModelChangeDataContextTierLongContext SessionModePlan = rpc.SessionModePlan ShutdownTypeError = rpc.ShutdownTypeError ShutdownTypeRoutine = rpc.ShutdownTypeRoutine + SkillInvokedTriggerAgentInvoked = rpc.SkillInvokedTriggerAgentInvoked + SkillInvokedTriggerContextLoad = rpc.SkillInvokedTriggerContextLoad + SkillInvokedTriggerUserInvoked = rpc.SkillInvokedTriggerUserInvoked SkillSourceBuiltin = rpc.SkillSourceBuiltin SkillSourceCustom = rpc.SkillSourceCustom SkillSourceInherited = rpc.SkillSourceInherited @@ -448,6 +478,8 @@ const ( ToolExecutionCompleteContentTypeResourceLink = rpc.ToolExecutionCompleteContentTypeResourceLink ToolExecutionCompleteContentTypeTerminal = rpc.ToolExecutionCompleteContentTypeTerminal ToolExecutionCompleteContentTypeText = rpc.ToolExecutionCompleteContentTypeText + ToolExecutionCompleteToolDescriptionMetaUIVisibilityApp = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibilityApp + ToolExecutionCompleteToolDescriptionMetaUIVisibilityModel = rpc.ToolExecutionCompleteToolDescriptionMetaUIVisibilityModel UserMessageAgentModeAutopilot = rpc.UserMessageAgentModeAutopilot UserMessageAgentModeInteractive = rpc.UserMessageAgentModeInteractive UserMessageAgentModePlan = rpc.UserMessageAgentModePlan diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index e7ea0d419..ae62c3f9b 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.52-1", + "@github/copilot": "^1.0.52-4", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, @@ -663,9 +663,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.52-1.tgz", - "integrity": "sha512-oz6m/dOpTU+FaCWXqYZj5JkJmRT+/RYcrmtGal39V+gOxTA2Nc9wIeLH1SMwMoOXC9Q6DN6keiY0wqWcHirPVg==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.52-4.tgz", + "integrity": "sha512-XoVTkovJZgO2i4izgAvzElqKtTwEkenYJ6vpH1X7LCXrp0YWaiS9bhHDuSawhDE721C8CRXRfq8MZ8SKJWhnxw==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -674,20 +674,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.52-1", - "@github/copilot-darwin-x64": "1.0.52-1", - "@github/copilot-linux-arm64": "1.0.52-1", - "@github/copilot-linux-x64": "1.0.52-1", - "@github/copilot-linuxmusl-arm64": "1.0.52-1", - "@github/copilot-linuxmusl-x64": "1.0.52-1", - "@github/copilot-win32-arm64": "1.0.52-1", - "@github/copilot-win32-x64": "1.0.52-1" + "@github/copilot-darwin-arm64": "1.0.52-4", + "@github/copilot-darwin-x64": "1.0.52-4", + "@github/copilot-linux-arm64": "1.0.52-4", + "@github/copilot-linux-x64": "1.0.52-4", + "@github/copilot-linuxmusl-arm64": "1.0.52-4", + "@github/copilot-linuxmusl-x64": "1.0.52-4", + "@github/copilot-win32-arm64": "1.0.52-4", + "@github/copilot-win32-x64": "1.0.52-4" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.52-1.tgz", - "integrity": "sha512-DWXtC/yItZVtkSQhPyRMEkFwa2mcY2rg2cu/uwJ15L9ReiYvlKYEZQDe1TMqkT+U6+k9KjA2L2HQfXVm14/vTw==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.52-4.tgz", + "integrity": "sha512-SGu8mX69aZgbL1/EatAka/AJHOpfxdvh02euHmx0Q4VyvQS8dz++2gVprvaInaUO0i8sjsvniZyqBt1mfWJA/w==", "cpu": [ "arm64" ], @@ -701,9 +701,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.52-1.tgz", - "integrity": "sha512-NFTJkzzlTALMfbj9CDJ7N09PRPTVFq1+71hk+zoNx1uT/pi954liV6tKSaNAihPIXTMQKfJXGwEdjtvACpc8Vg==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.52-4.tgz", + "integrity": "sha512-nO1qy+/V6PJzLCPoOCDqeNiC6yAV25lVI813rw+kfTTvIIhY4GoJWVg8FlL/pjul2DR0S0Zw4JBZyHzyECgQ3Q==", "cpu": [ "x64" ], @@ -717,9 +717,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.52-1.tgz", - "integrity": "sha512-CZE29v+RPJClHgVE1rU+RpRWSG8lm48koRZ0taKVopqLRD6NWKjBOwFKYJojk08H8/K+BWr/paM5+R8hEZHxZw==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.52-4.tgz", + "integrity": "sha512-a+ukt+y9ZzxOft32i1AZZKTnCsvL9nwSRr2viURn0GPO74j6d4J29xGKBYAymmT1L431ToSWxrVo7wHi4TOxgw==", "cpu": [ "arm64" ], @@ -733,9 +733,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.52-1.tgz", - "integrity": "sha512-tJhLQV70TJLq3hPXg7P6pHPfE4vaT2nENIXZsHu6fBkOcsSAxX1APSv6Bkyfsiod8EfFHkcG2+n7VXiVg8WqFw==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.52-4.tgz", + "integrity": "sha512-em34O2QVZWnqAdionbNhkshzmHxxGUed3tp3IU4OSkJr3yVpDRtbsiOYIx+GT+bVY2P1nyRTcAyrvVrle6uf5A==", "cpu": [ "x64" ], @@ -749,9 +749,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.52-1.tgz", - "integrity": "sha512-u24wHsUumldUEPWX/5z5IEuJvixiQEYF82N04P1g65dvOknq+89dpj+GND4Rh3Vr5u13drgj5AJqkJbWB8N+EQ==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.52-4.tgz", + "integrity": "sha512-0oofPJD8brQ1EEexvoFpfkv0qTFTwnJs6M6vIp6GWmSDuI0HGsQGhA2GO0yDPlv8g3sLGM2esSeRYkc/iMXliA==", "cpu": [ "arm64" ], @@ -765,9 +765,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.52-1.tgz", - "integrity": "sha512-wM22FxcHL8NlnesKKQPPvtk4ojqefN7irU5tQcX+IunpD1izVQl7AOXhZyHoQ21zQnN0De8EapxOUc+WnvlxpA==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.52-4.tgz", + "integrity": "sha512-uoWj7Uxt8lth5/LpJgNK/oGuacnsZzZ25X2J4sGTNTMGR+xqCRavHoiUzwrs3w1mprnvO18b1TZKocSQNt/wlQ==", "cpu": [ "x64" ], @@ -781,9 +781,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.52-1.tgz", - "integrity": "sha512-ecvfl9N7DPSwpiT2ZNUSXR1ZrSKwpkByOU6VcNphh4RptPZ0iNfyRNLhFCwSfFz+FvB6z2LZi+F7jSzQ3SaT3w==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.52-4.tgz", + "integrity": "sha512-aNTWW+HhYjA0ultZywv2c+NDiN47ZVf9RS3vQThYKBF2kxUS/gT482wU9A7hqJYgEsF39s/EAYrZOc2AF9eo3Q==", "cpu": [ "arm64" ], @@ -797,9 +797,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.52-1.tgz", - "integrity": "sha512-a9Ct7krktP+/pfPdh/K57deYzzmL13e5Tb1pf5E152u4o/5xKzfgroNFUOzotFfFhs1jFhdzKCm3WHNLIvVEHA==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.52-4.tgz", + "integrity": "sha512-7hMKWcALIFuOlb5NJL6BXbCHrfrXS1ZOqcXg9IQji9yJu9IgsFHXno0tOmnOUUupikCNZLPQAZtMj0C18vabRw==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index 611e3f7d3..3058a74f3 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.52-1", + "@github/copilot": "^1.0.52-4", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index b50ed3477..47c73f3cf 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,7 +18,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.52-1", + "@github/copilot": "^1.0.52-4", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 8572d088e..89d595497 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -120,7 +120,7 @@ export type ContentFilterMode = /** Remove characters that can hide directives. */ | "hidden_characters"; /** - * Server transport type: stdio, http, sse, or memory + * Server transport type: stdio, http, sse (deprecated), or memory * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "DiscoveredMcpServerType". @@ -130,7 +130,7 @@ export type DiscoveredMcpServerType = | "stdio" /** Server communicates over streamable HTTP. */ | "http" - /** Server communicates over Server-Sent Events. */ + /** Server communicates over Server-Sent Events (deprecated). */ | "sse" /** Server is backed by an in-memory runtime implementation. */ | "memory"; @@ -325,6 +325,114 @@ export type SessionLogLevel = | "warning" /** Error message describing a failure. */ | "error"; +/** + * UI theme preference per SEP-1865 + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsHostContextDetailsTheme". + */ +/** @experimental */ +export type McpAppsHostContextDetailsTheme = + /** Light UI theme */ + | "light" + /** Dark UI theme */ + | "dark"; +/** + * Current display mode (SEP-1865) + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsHostContextDetailsDisplayMode". + */ +/** @experimental */ +export type McpAppsHostContextDetailsDisplayMode = + /** Rendered inline within the host conversation surface */ + | "inline" + /** Rendered as a fullscreen overlay */ + | "fullscreen" + /** Rendered as a picture-in-picture floating panel */ + | "pip"; +/** + * Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsHostContextDetailsAvailableDisplayMode". + */ +/** @experimental */ +export type McpAppsHostContextDetailsAvailableDisplayMode = + /** Rendered inline within the host conversation surface */ + | "inline" + /** Rendered as a fullscreen overlay */ + | "fullscreen" + /** Rendered as a picture-in-picture floating panel */ + | "pip"; +/** + * Platform type for responsive design + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsHostContextDetailsPlatform". + */ +/** @experimental */ +export type McpAppsHostContextDetailsPlatform = + /** Host runs in a web browser */ + | "web" + /** Host runs as a desktop application */ + | "desktop" + /** Host runs on a mobile device */ + | "mobile"; +/** + * UI theme preference per SEP-1865 + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsSetHostContextDetailsTheme". + */ +/** @experimental */ +export type McpAppsSetHostContextDetailsTheme = + /** Light UI theme */ + | "light" + /** Dark UI theme */ + | "dark"; +/** + * Current display mode (SEP-1865) + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsSetHostContextDetailsDisplayMode". + */ +/** @experimental */ +export type McpAppsSetHostContextDetailsDisplayMode = + /** Rendered inline within the host conversation surface */ + | "inline" + /** Rendered as a fullscreen overlay */ + | "fullscreen" + /** Rendered as a picture-in-picture floating panel */ + | "pip"; +/** + * Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsSetHostContextDetailsAvailableDisplayMode". + */ +/** @experimental */ +export type McpAppsSetHostContextDetailsAvailableDisplayMode = + /** Rendered inline within the host conversation surface */ + | "inline" + /** Rendered as a fullscreen overlay */ + | "fullscreen" + /** Rendered as a picture-in-picture floating panel */ + | "pip"; +/** + * Platform type for responsive design + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsSetHostContextDetailsPlatform". + */ +/** @experimental */ +export type McpAppsSetHostContextDetailsPlatform = + /** Host runs in a web browser */ + | "web" + /** Host runs as a desktop application */ + | "desktop" + /** Host runs on a mobile device */ + | "mobile"; /** * MCP server configuration (stdio process or remote HTTP/SSE) * @@ -2177,6 +2285,12 @@ export interface ExternalToolTextResultForLlmBinaryResultsForLlm { * Human-readable description of the binary data */ description?: string; + /** + * Optional metadata from the producing tool. + */ + metadata?: { + [k: string]: unknown | undefined; + }; } /** * Plain text content block @@ -2768,6 +2882,274 @@ export interface LspInitializeRequest { */ force?: boolean; } +/** + * MCP server, tool name, and arguments to invoke from an MCP App view. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsCallToolRequest". + */ +/** @experimental */ +export interface McpAppsCallToolRequest { + /** + * MCP server hosting the tool + */ + serverName: string; + /** + * MCP tool name + */ + toolName: string; + /** + * Tool arguments + */ + arguments?: { + [k: string]: unknown | undefined; + }; + /** + * **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + */ + originServerName: string; +} +/** + * Capability negotiation snapshot + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsDiagnoseCapability". + */ +/** @experimental */ +export interface McpAppsDiagnoseCapability { + /** + * Whether the session has the `mcp-apps` capability + */ + sessionHasMcpApps: boolean; + /** + * Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on + */ + featureFlagEnabled: boolean; + /** + * Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers + */ + advertised: boolean; +} +/** + * MCP server to diagnose MCP Apps wiring for. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsDiagnoseRequest". + */ +/** @experimental */ +export interface McpAppsDiagnoseRequest { + /** + * MCP server to probe + */ + serverName: string; +} +/** + * Diagnostic snapshot of MCP Apps wiring for the named server. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsDiagnoseResult". + */ +/** @experimental */ +export interface McpAppsDiagnoseResult { + capability: McpAppsDiagnoseCapability; + server: McpAppsDiagnoseServer; +} +/** + * What the server returned for this session + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsDiagnoseServer". + */ +/** @experimental */ +export interface McpAppsDiagnoseServer { + /** + * Whether the named server is currently connected + */ + connected: boolean; + /** + * Total tools returned by the server's tools/list + */ + toolCount: number; + /** + * Tools whose `_meta.ui` is populated (resourceUri and/or visibility set) + */ + toolsWithUiMeta: number; + /** + * Up to 5 tool names with `_meta.ui` for quick inspection + */ + sampleToolNames: string[]; +} +/** + * Current host context advertised to MCP App guests. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsHostContext". + */ +/** @experimental */ +export interface McpAppsHostContext { + context: McpAppsHostContextDetails; +} +/** + * Current host context + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsHostContextDetails". + */ +/** @experimental */ +export interface McpAppsHostContextDetails { + theme?: McpAppsHostContextDetailsTheme; + /** + * BCP-47 locale, e.g. 'en-US' + */ + locale?: string; + /** + * IANA timezone, e.g. 'America/New_York' + */ + timeZone?: string; + displayMode?: McpAppsHostContextDetailsDisplayMode; + /** + * Display modes the host supports + */ + availableDisplayModes?: McpAppsHostContextDetailsAvailableDisplayMode[]; + platform?: McpAppsHostContextDetailsPlatform; + /** + * Host application identifier + */ + userAgent?: string; + [k: string]: unknown | undefined; +} +/** + * MCP server to list app-callable tools for. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsListToolsRequest". + */ +/** @experimental */ +export interface McpAppsListToolsRequest { + /** + * MCP server hosting the app + */ + serverName: string; + /** + * **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + */ + originServerName: string; +} +/** + * App-callable tools from the named MCP server. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsListToolsResult". + */ +/** @experimental */ +export interface McpAppsListToolsResult { + /** + * App-callable tools from the server + */ + tools: { + [k: string]: unknown | undefined; + }[]; +} +/** + * MCP server and resource URI to fetch. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsReadResourceRequest". + */ +/** @experimental */ +export interface McpAppsReadResourceRequest { + /** + * Name of the MCP server hosting the resource + */ + serverName: string; + /** + * Resource URI (typically ui://...) + */ + uri: string; +} +/** + * Resource contents returned by the MCP server. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsReadResourceResult". + */ +/** @experimental */ +export interface McpAppsReadResourceResult { + /** + * Resource contents returned by the server + */ + contents: McpAppsResourceContent[]; +} +/** + * Schema for the `McpAppsResourceContent` type. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsResourceContent". + */ +/** @experimental */ +export interface McpAppsResourceContent { + /** + * The resource URI (typically ui://...) + */ + uri: string; + /** + * MIME type of the content + */ + mimeType?: string; + /** + * Text content (e.g. HTML) + */ + text?: string; + /** + * Base64-encoded binary content + */ + blob?: string; + /** + * Resource-level metadata (CSP, permissions, etc.) + */ + _meta?: { + [k: string]: unknown | undefined; + }; +} +/** + * Host context advertised to MCP App guests + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsSetHostContextDetails". + */ +/** @experimental */ +export interface McpAppsSetHostContextDetails { + theme?: McpAppsSetHostContextDetailsTheme; + /** + * BCP-47 locale, e.g. 'en-US' + */ + locale?: string; + /** + * IANA timezone, e.g. 'America/New_York' + */ + timeZone?: string; + displayMode?: McpAppsSetHostContextDetailsDisplayMode; + /** + * Display modes the host supports + */ + availableDisplayModes?: McpAppsSetHostContextDetailsAvailableDisplayMode[]; + platform?: McpAppsSetHostContextDetailsPlatform; + /** + * Host application identifier + */ + userAgent?: string; + [k: string]: unknown | undefined; +} +/** + * Host context to advertise to MCP App guests. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpAppsSetHostContextRequest". + */ +/** @experimental */ +export interface McpAppsSetHostContextRequest { + context: McpAppsSetHostContextDetails; +} /** * The requestId previously passed to executeSampling that should be cancelled. * @@ -3506,21 +3888,50 @@ export interface ModelBilling { */ export interface ModelBillingTokenPrices { /** - * Price per billing batch of input tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) + * AI Credits cost per billing batch of input tokens */ inputPrice?: number; /** - * Price per billing batch of output tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) + * AI Credits cost per billing batch of output tokens */ outputPrice?: number; /** - * Price per billing batch of cached tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) + * AI Credits cost per billing batch of cached tokens */ cachePrice?: number; /** * Number of tokens per standard billing batch */ batchSize?: number; + /** + * Maximum context window tokens for the default tier + */ + contextMax?: number; + longContext?: ModelBillingTokenPricesLongContext; +} +/** + * Long context tier pricing (available for models with extended context windows) + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelBillingTokenPricesLongContext". + */ +export interface ModelBillingTokenPricesLongContext { + /** + * AI Credits cost per billing batch of input tokens + */ + inputPrice?: number; + /** + * AI Credits cost per billing batch of output tokens + */ + outputPrice?: number; + /** + * AI Credits cost per billing batch of cached tokens + */ + cachePrice?: number; + /** + * Maximum context window tokens for the long context tier + */ + contextMax?: number; } /** * Override individual model capabilities resolved by the runtime @@ -8735,6 +9146,16 @@ export interface WorkspacesSaveLargePasteResult { sizeBytes: number; } | null; } +/** + * Standard MCP CallToolResult + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SessionMcpAppsCallToolResult". + */ +/** @experimental */ +export interface SessionMcpAppsCallToolResult { + [k: string]: unknown | undefined; +} /** * Identifies the target session. * @@ -9564,6 +9985,59 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin login: async (params: McpOauthLoginRequest): Promise => connection.sendRequest("session.mcp.oauth.login", { sessionId, ...params }), }, + /** @experimental */ + apps: { + /** + * Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability. + * + * @param params MCP server and resource URI to fetch. + * + * @returns Resource contents returned by the MCP server. + */ + readResource: async (params: McpAppsReadResourceRequest): Promise => + connection.sendRequest("session.mcp.apps.readResource", { sessionId, ...params }), + /** + * List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`. + * + * @param params MCP server to list app-callable tools for. + * + * @returns App-callable tools from the named MCP server. + */ + listTools: async (params: McpAppsListToolsRequest): Promise => + connection.sendRequest("session.mcp.apps.listTools", { sessionId, ...params }), + /** + * Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`. + * + * @param params MCP server, tool name, and arguments to invoke from an MCP App view. + * + * @returns Standard MCP CallToolResult + */ + callTool: async (params: McpAppsCallToolRequest): Promise => + connection.sendRequest("session.mcp.apps.callTool", { sessionId, ...params }), + /** + * Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI. + * + * @param params Host context to advertise to MCP App guests. + */ + setHostContext: async (params: McpAppsSetHostContextRequest): Promise => + connection.sendRequest("session.mcp.apps.setHostContext", { sessionId, ...params }), + /** + * Read the current host context advertised to MCP App guests. + * + * @returns Current host context advertised to MCP App guests. + */ + getHostContext: async (): Promise => + connection.sendRequest("session.mcp.apps.getHostContext", { sessionId }), + /** + * Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, feature-flag state, advertised extension, and how many tools have `_meta.ui` populated. + * + * @param params MCP server to diagnose MCP Apps wiring for. + * + * @returns Diagnostic snapshot of MCP Apps wiring for the named server. + */ + diagnose: async (params: McpAppsDiagnoseRequest): Promise => + connection.sendRequest("session.mcp.apps.diagnose", { sessionId, ...params }), + }, }, /** @experimental */ plugins: { diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 738c4451a..da4333e55 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -87,7 +87,8 @@ export type SessionEvent = | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent - | ExtensionsLoadedEvent; + | ExtensionsLoadedEvent + | McpAppToolCallCompleteEvent; /** * Hosting platform type of the repository (github or ado) */ @@ -243,6 +244,24 @@ export type ToolExecutionCompleteContentResourceLinkIconTheme = * The embedded resource contents, either text or base64-encoded binary */ export type ToolExecutionCompleteContentResourceDetails = EmbeddedTextResourceContents | EmbeddedBlobResourceContents; +/** + * Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration. + */ +export type ToolExecutionCompleteToolDescriptionMetaUIVisibility = + /** Tool is callable by the model (LLM tool surface) */ + | "model" + /** Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool */ + | "app"; +/** + * What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) + */ +export type SkillInvokedTrigger = + /** Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. */ + | "user-invoked" + /** Skill invocation requested by the agent. */ + | "agent-invoked" + /** Skill content loaded as part of another context, such as a configured custom agent or subagent. */ + | "context-load"; /** * Message role: "system" for system prompts, "developer" for developer-injected instructions */ @@ -451,6 +470,18 @@ export type McpServerStatus = | "disabled" /** The server is not configured for this session. */ | "not_configured"; +/** + * Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) + */ +export type McpServerTransport = + /** Server communicates over stdio with a local child process. */ + | "stdio" + /** Server communicates over streamable HTTP. */ + | "http" + /** Server communicates over Server-Sent Events (deprecated). */ + | "sse" + /** Server is backed by an in-memory runtime implementation. */ + | "memory"; /** * Discovery source */ @@ -745,6 +776,10 @@ export interface ErrorData { * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs */ providerCallId?: string; + /** + * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + */ + serviceRequestId?: string; /** * Error stack trace, when available */ @@ -1066,6 +1101,14 @@ export interface ModelChangeData { * Reason the change happened, when not user-initiated. Currently `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy. */ cause?: string; + /** + * Context tier after the model change; null explicitly clears a previously selected tier + */ + contextTier?: /** Default context tier with standard context window size. */ + | "default" + /** Extended context tier with a larger context window. */ + | "long_context" + | null; /** * Newly selected model identifier */ @@ -1786,6 +1829,10 @@ export interface CompactionCompleteData { * GitHub request tracing ID (x-github-request-id header) for the compaction LLM call */ requestId?: string; + /** + * Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call + */ + serviceRequestId?: string; /** * Whether compaction completed successfully */ @@ -2474,6 +2521,10 @@ export interface AssistantMessageData { * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs */ requestId?: string; + /** + * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + */ + serviceRequestId?: string; /** * Tool invocations requested by the assistant in this message */ @@ -2757,6 +2808,10 @@ export interface AssistantUsageData { * Number of output tokens used for reasoning (e.g., chain-of-thought) */ reasoningTokens?: number; + /** + * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + */ + serviceRequestId?: string; /** * Time to first token in milliseconds. Only available for streaming requests */ @@ -2909,6 +2964,10 @@ export interface ModelCallFailureData { * GitHub request tracing ID (x-github-request-id header) for server-side log correlation */ providerCallId?: string; + /** + * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + */ + serviceRequestId?: string; source: ModelCallFailureSource; /** * HTTP status code from the failed request @@ -3217,6 +3276,7 @@ export interface ToolExecutionCompleteData { * Unique identifier for the completed tool call */ toolCallId: string; + toolDescription?: ToolExecutionCompleteToolDescription; /** * Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts) */ @@ -3257,6 +3317,7 @@ export interface ToolExecutionCompleteResult { * Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent. */ detailedContent?: string; + uiResource?: ToolExecutionCompleteUIResource; } /** * Plain text content block @@ -3425,6 +3486,118 @@ export interface EmbeddedBlobResourceContents { */ uri: string; } +/** + * MCP Apps UI resource content for rendering in a sandboxed iframe + */ +export interface ToolExecutionCompleteUIResource { + _meta?: ToolExecutionCompleteUIResourceMeta; + /** + * Base64-encoded HTML content + */ + blob?: string; + /** + * MIME type of the content + */ + mimeType: string; + /** + * HTML content as a string + */ + text?: string; + /** + * The ui:// URI of the resource + */ + uri: string; +} +/** + * Resource-level UI metadata (CSP, permissions, visual preferences) + */ +export interface ToolExecutionCompleteUIResourceMeta { + ui?: ToolExecutionCompleteUIResourceMetaUI; +} +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. + */ +export interface ToolExecutionCompleteUIResourceMetaUI { + csp?: ToolExecutionCompleteUIResourceMetaUICsp; + domain?: string; + permissions?: ToolExecutionCompleteUIResourceMetaUIPermissions; + prefersBorder?: boolean; +} +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. + */ +export interface ToolExecutionCompleteUIResourceMetaUICsp { + baseUriDomains?: string[]; + connectDomains?: string[]; + frameDomains?: string[]; + resourceDomains?: string[]; +} +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. + */ +export interface ToolExecutionCompleteUIResourceMetaUIPermissions { + camera?: ToolExecutionCompleteUIResourceMetaUIPermissionsCamera; + clipboardWrite?: ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite; + geolocation?: ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation; + microphone?: ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone; +} +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. + */ +export interface ToolExecutionCompleteUIResourceMetaUIPermissionsCamera { + [k: string]: unknown | undefined; +} +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. + */ +export interface ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite { + [k: string]: unknown | undefined; +} +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. + */ +export interface ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation { + [k: string]: unknown | undefined; +} +/** + * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. + */ +export interface ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone { + [k: string]: unknown | undefined; +} +/** + * Tool definition metadata, present for MCP tools with MCP Apps support + */ +export interface ToolExecutionCompleteToolDescription { + _meta?: ToolExecutionCompleteToolDescriptionMeta; + /** + * Tool description + */ + description?: string; + /** + * Tool name + */ + name: string; +} +/** + * MCP Apps metadata for UI resource association + */ +export interface ToolExecutionCompleteToolDescriptionMeta { + ui?: ToolExecutionCompleteToolDescriptionMetaUI; +} +/** + * Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. + */ +export interface ToolExecutionCompleteToolDescriptionMetaUI { + /** + * URI of the UI resource + */ + resourceUri?: string; + /** + * Who can access this tool + */ + visibility?: ToolExecutionCompleteToolDescriptionMetaUIVisibility[]; +} /** * Session event "skill.invoked". Skill invocation details including content, allowed tools, and plugin metadata */ @@ -3487,6 +3660,11 @@ export interface SkillInvokedData { * Version of the plugin this skill originated from, when applicable */ pluginVersion?: string; + /** + * Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), personal-claude (~/.claude/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill) + */ + source?: string; + trigger?: SkillInvokedTrigger; } /** * Session event "subagent.started". Sub-agent startup details including parent tool call and agent information @@ -5896,6 +6074,10 @@ export interface CapabilitiesChangedUI { * Whether elicitation is now supported */ elicitation?: boolean; + /** + * Whether MCP Apps (SEP-1865) UI passthrough is now supported + */ + mcpApps?: boolean; } /** * Session event "exit_plan_mode.requested". Plan approval request with plan content and available user actions @@ -6274,8 +6456,17 @@ export interface McpServersLoadedServer { * Server name (config key) */ name: string; + /** + * Name of the plugin that supplied the effective MCP server config, only when source is plugin + */ + pluginName?: string; + /** + * Version of the plugin that supplied the effective MCP server config, only when source is plugin + */ + pluginVersion?: string; source?: McpServerSource; status: McpServerStatus; + transport?: McpServerTransport; } /** * Session event "session.mcp_server_status_changed". @@ -6311,6 +6502,10 @@ export interface McpServerStatusChangedEvent { * Schema for the `McpServerStatusChangedData` type. */ export interface McpServerStatusChangedData { + /** + * Error message if the server entered a failed state + */ + error?: string; /** * Name of the MCP server whose status changed */ @@ -6371,3 +6566,98 @@ export interface ExtensionsLoadedExtension { source: ExtensionsLoadedExtensionSource; status: ExtensionsLoadedExtensionStatus; } +/** + * Session event "mcp_app.tool_call_complete". MCP App view called a tool on a connected MCP server (SEP-1865) + */ +export interface McpAppToolCallCompleteEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpAppToolCallCompleteData; + /** + * 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 "mcp_app.tool_call_complete". + */ + type: "mcp_app.tool_call_complete"; +} +/** + * MCP App view called a tool on a connected MCP server (SEP-1865) + */ +export interface McpAppToolCallCompleteData { + /** + * Arguments passed to the tool by the app view, if any + */ + arguments?: { + [k: string]: unknown | undefined; + }; + /** + * Wall-clock duration of the underlying tools/call in milliseconds + */ + durationMs: number; + error?: McpAppToolCallCompleteError; + /** + * Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. + */ + result?: { + [k: string]: unknown | undefined; + }; + /** + * Name of the MCP server hosting the tool + */ + serverName: string; + /** + * True when the call completed without throwing AND the MCP CallToolResult did not set isError + */ + success: boolean; + toolMeta?: McpAppToolCallCompleteToolMeta; + /** + * MCP tool name that was invoked + */ + toolName: string; +} +/** + * Set when the underlying tools/call threw an error before returning a CallToolResult + */ +export interface McpAppToolCallCompleteError { + /** + * Human-readable error message + */ + message: string; +} +/** + * The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. + */ +export interface McpAppToolCallCompleteToolMeta { + ui?: McpAppToolCallCompleteToolMetaUI; + [k: string]: unknown | undefined; +} +/** + * Schema for the `McpAppToolCallCompleteToolMetaUI` type. + */ +export interface McpAppToolCallCompleteToolMetaUI { + /** + * `ui://` URI declared by the tool's `_meta.ui.resourceUri` + */ + resourceUri?: string; + /** + * Tool visibility per SEP-1865 (typically a subset of `["model","app"]`) + */ + visibility?: string[]; + [k: string]: unknown | undefined; +} diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index ab3d38eb4..6de758c09 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -769,7 +769,7 @@ def to_dict(self) -> dict: return result class DiscoveredMCPServerType(Enum): - """Server transport type: stdio, http, sse, or memory""" + """Server transport type: stdio, http, sse (deprecated), or memory""" HTTP = "http" MEMORY = "memory" @@ -998,9 +998,11 @@ class ExternalToolTextResultForLlmBinaryResultsForLlmType(Enum): RESOURCE = "resource" # Experimental: this type is part of an experimental API and may change or be removed. -class ExternalToolTextResultForLlmContentResourceLinkIconTheme(Enum): - """Theme variant this icon is intended for""" +class Theme(Enum): + """Theme variant this icon is intended for + UI theme preference per SEP-1865 + """ DARK = "dark" LIGHT = "light" @@ -1418,6 +1420,220 @@ def to_dict(self) -> dict: result["workingDirectory"] = from_union([from_str, from_none], self.working_directory) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsDiagnoseCapability: + """Capability negotiation snapshot""" + + advertised: bool + """Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers""" + + feature_flag_enabled: bool + """Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on""" + + session_has_mcp_apps: bool + """Whether the session has the `mcp-apps` capability""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsDiagnoseCapability': + assert isinstance(obj, dict) + advertised = from_bool(obj.get("advertised")) + feature_flag_enabled = from_bool(obj.get("featureFlagEnabled")) + session_has_mcp_apps = from_bool(obj.get("sessionHasMcpApps")) + return MCPAppsDiagnoseCapability(advertised, feature_flag_enabled, session_has_mcp_apps) + + def to_dict(self) -> dict: + result: dict = {} + result["advertised"] = from_bool(self.advertised) + result["featureFlagEnabled"] = from_bool(self.feature_flag_enabled) + result["sessionHasMcpApps"] = from_bool(self.session_has_mcp_apps) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsDiagnoseRequest: + """MCP server to diagnose MCP Apps wiring for.""" + + server_name: str + """MCP server to probe""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsDiagnoseRequest': + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + return MCPAppsDiagnoseRequest(server_name) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsDiagnoseServer: + """What the server returned for this session""" + + connected: bool + """Whether the named server is currently connected""" + + sample_tool_names: list[str] + """Up to 5 tool names with `_meta.ui` for quick inspection""" + + tool_count: float + """Total tools returned by the server's tools/list""" + + tools_with_ui_meta: float + """Tools whose `_meta.ui` is populated (resourceUri and/or visibility set)""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsDiagnoseServer': + assert isinstance(obj, dict) + connected = from_bool(obj.get("connected")) + sample_tool_names = from_list(from_str, obj.get("sampleToolNames")) + tool_count = from_float(obj.get("toolCount")) + tools_with_ui_meta = from_float(obj.get("toolsWithUiMeta")) + return MCPAppsDiagnoseServer(connected, sample_tool_names, tool_count, tools_with_ui_meta) + + def to_dict(self) -> dict: + result: dict = {} + result["connected"] = from_bool(self.connected) + result["sampleToolNames"] = from_list(from_str, self.sample_tool_names) + result["toolCount"] = to_float(self.tool_count) + result["toolsWithUiMeta"] = to_float(self.tools_with_ui_meta) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +class MCPAppsDisplayMode(Enum): + """Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. + + Current display mode (SEP-1865) + + Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. + """ + FULLSCREEN = "fullscreen" + INLINE = "inline" + PIP = "pip" + +# Experimental: this type is part of an experimental API and may change or be removed. +class MCPAppsHostContextDetailsPlatform(Enum): + """Platform type for responsive design""" + + DESKTOP = "desktop" + MOBILE = "mobile" + WEB = "web" + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsListToolsRequest: + """MCP server to list app-callable tools for.""" + + origin_server_name: str + """**Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the + app from this server only'), the call is rejected when this differs from `serverName`, + and rejected outright when missing. + """ + server_name: str + """MCP server hosting the app""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsListToolsRequest': + assert isinstance(obj, dict) + origin_server_name = from_str(obj.get("originServerName")) + server_name = from_str(obj.get("serverName")) + return MCPAppsListToolsRequest(origin_server_name, server_name) + + def to_dict(self) -> dict: + result: dict = {} + result["originServerName"] = from_str(self.origin_server_name) + result["serverName"] = from_str(self.server_name) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsListToolsResult: + """App-callable tools from the named MCP server.""" + + tools: list[dict[str, Any]] + """App-callable tools from the server""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsListToolsResult': + assert isinstance(obj, dict) + tools = from_list(lambda x: from_dict(lambda x: x, x), obj.get("tools")) + return MCPAppsListToolsResult(tools) + + def to_dict(self) -> dict: + result: dict = {} + result["tools"] = from_list(lambda x: from_dict(lambda x: x, x), self.tools) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsReadResourceRequest: + """MCP server and resource URI to fetch.""" + + server_name: str + """Name of the MCP server hosting the resource""" + + uri: str + """Resource URI (typically ui://...)""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsReadResourceRequest': + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + uri = from_str(obj.get("uri")) + return MCPAppsReadResourceRequest(server_name, uri) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + result["uri"] = from_str(self.uri) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsResourceContent: + """Schema for the `McpAppsResourceContent` type.""" + + uri: str + """The resource URI (typically ui://...)""" + + meta: dict[str, Any] | None = None + """Resource-level metadata (CSP, permissions, etc.)""" + + blob: str | None = None + """Base64-encoded binary content""" + + mime_type: str | None = None + """MIME type of the content""" + + text: str | None = None + """Text content (e.g. HTML)""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsResourceContent': + assert isinstance(obj, dict) + uri = from_str(obj.get("uri")) + meta = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("_meta")) + blob = from_union([from_str, from_none], obj.get("blob")) + mime_type = from_union([from_str, from_none], obj.get("mimeType")) + text = from_union([from_str, from_none], obj.get("text")) + return MCPAppsResourceContent(uri, meta, blob, mime_type, text) + + def to_dict(self) -> dict: + result: dict = {} + result["uri"] = from_str(self.uri) + if self.meta is not None: + result["_meta"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.meta) + if self.blob is not None: + result["blob"] = from_union([from_str, from_none], self.blob) + if self.mime_type is not None: + result["mimeType"] = from_union([from_str, from_none], self.mime_type) + if self.text is not None: + result["text"] = from_union([from_str, from_none], self.text) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPCancelSamplingExecutionParams: @@ -2022,44 +2238,40 @@ def to_dict(self) -> dict: return result @dataclass -class ModelBillingTokenPrices: - """Token-level pricing information for this model""" +class ModelBillingTokenPricesLongContext: + """Long context tier pricing (available for models with extended context windows)""" - batch_size: int | None = None - """Number of tokens per standard billing batch""" + cache_price: float | None = None + """AI Credits cost per billing batch of cached tokens""" - cache_price: int | None = None - """Price per billing batch of cached tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 - AIU = $0.01 USD) - """ - input_price: int | None = None - """Price per billing batch of input tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU - = $0.01 USD) - """ - output_price: int | None = None - """Price per billing batch of output tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 - AIU = $0.01 USD) - """ + context_max: int | None = None + """Maximum context window tokens for the long context tier""" + + input_price: float | None = None + """AI Credits cost per billing batch of input tokens""" + + output_price: float | None = None + """AI Credits cost per billing batch of output tokens""" @staticmethod - def from_dict(obj: Any) -> 'ModelBillingTokenPrices': + def from_dict(obj: Any) -> 'ModelBillingTokenPricesLongContext': assert isinstance(obj, dict) - batch_size = from_union([from_int, from_none], obj.get("batchSize")) - cache_price = from_union([from_int, from_none], obj.get("cachePrice")) - input_price = from_union([from_int, from_none], obj.get("inputPrice")) - output_price = from_union([from_int, from_none], obj.get("outputPrice")) - return ModelBillingTokenPrices(batch_size, cache_price, input_price, output_price) + cache_price = from_union([from_float, from_none], obj.get("cachePrice")) + context_max = from_union([from_int, from_none], obj.get("contextMax")) + input_price = from_union([from_float, from_none], obj.get("inputPrice")) + output_price = from_union([from_float, from_none], obj.get("outputPrice")) + return ModelBillingTokenPricesLongContext(cache_price, context_max, input_price, output_price) def to_dict(self) -> dict: result: dict = {} - if self.batch_size is not None: - result["batchSize"] = from_union([from_int, from_none], self.batch_size) if self.cache_price is not None: - result["cachePrice"] = from_union([from_int, from_none], self.cache_price) + result["cachePrice"] = from_union([to_float, from_none], self.cache_price) + if self.context_max is not None: + result["contextMax"] = from_union([from_int, from_none], self.context_max) if self.input_price is not None: - result["inputPrice"] = from_union([from_int, from_none], self.input_price) + result["inputPrice"] = from_union([to_float, from_none], self.input_price) if self.output_price is not None: - result["outputPrice"] = from_union([from_int, from_none], self.output_price) + result["outputPrice"] = from_union([to_float, from_none], self.output_price) return result @dataclass @@ -6686,7 +6898,7 @@ class DiscoveredMCPServer: """Configuration source: user, workspace, plugin, or builtin""" type: DiscoveredMCPServerType | None = None - """Server transport type: stdio, http, sse, or memory""" + """Server transport type: stdio, http, sse (deprecated), or memory""" @staticmethod def from_dict(obj: Any) -> 'DiscoveredMCPServer': @@ -6860,6 +7072,9 @@ class ExternalToolTextResultForLlmBinaryResultsForLlm: description: str | None = None """Human-readable description of the binary data""" + metadata: dict[str, Any] | None = None + """Optional metadata from the producing tool.""" + @staticmethod def from_dict(obj: Any) -> 'ExternalToolTextResultForLlmBinaryResultsForLlm': assert isinstance(obj, dict) @@ -6867,7 +7082,8 @@ def from_dict(obj: Any) -> 'ExternalToolTextResultForLlmBinaryResultsForLlm': mime_type = from_str(obj.get("mimeType")) type = ExternalToolTextResultForLlmBinaryResultsForLlmType(obj.get("type")) description = from_union([from_str, from_none], obj.get("description")) - return ExternalToolTextResultForLlmBinaryResultsForLlm(data, mime_type, type, description) + metadata = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("metadata")) + return ExternalToolTextResultForLlmBinaryResultsForLlm(data, mime_type, type, description, metadata) def to_dict(self) -> dict: result: dict = {} @@ -6876,6 +7092,8 @@ def to_dict(self) -> dict: result["type"] = to_enum(ExternalToolTextResultForLlmBinaryResultsForLlmType, self.type) if self.description is not None: result["description"] = from_union([from_str, from_none], self.description) + if self.metadata is not None: + result["metadata"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.metadata) return result # Experimental: this type is part of an experimental API and may change or be removed. @@ -6892,7 +7110,7 @@ class ExternalToolTextResultForLlmContentResourceLinkIcon: sizes: list[str] | None = None """Available icon sizes (e.g., ['16x16', '32x32'])""" - theme: ExternalToolTextResultForLlmContentResourceLinkIconTheme | None = None + theme: Theme | None = None """Theme variant this icon is intended for""" @staticmethod @@ -6901,7 +7119,7 @@ def from_dict(obj: Any) -> 'ExternalToolTextResultForLlmContentResourceLinkIcon' src = from_str(obj.get("src")) mime_type = from_union([from_str, from_none], obj.get("mimeType")) sizes = from_union([lambda x: from_list(from_str, x), from_none], obj.get("sizes")) - theme = from_union([ExternalToolTextResultForLlmContentResourceLinkIconTheme, from_none], obj.get("theme")) + theme = from_union([Theme, from_none], obj.get("theme")) return ExternalToolTextResultForLlmContentResourceLinkIcon(src, mime_type, sizes, theme) def to_dict(self) -> dict: @@ -6912,7 +7130,7 @@ def to_dict(self) -> dict: if self.sizes is not None: result["sizes"] = from_union([lambda x: from_list(from_str, x), from_none], self.sizes) if self.theme is not None: - result["theme"] = from_union([lambda x: to_enum(ExternalToolTextResultForLlmContentResourceLinkIconTheme, x), from_none], self.theme) + result["theme"] = from_union([lambda x: to_enum(Theme, x), from_none], self.theme) return result ExternalToolTextResultForLlmContentResourceDetails = EmbeddedTextResourceContents | EmbeddedBlobResourceContents @@ -7424,6 +7642,161 @@ 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 MCPAppsDiagnoseResult: + """Diagnostic snapshot of MCP Apps wiring for the named server.""" + + capability: MCPAppsDiagnoseCapability + """Capability negotiation snapshot""" + + server: MCPAppsDiagnoseServer + """What the server returned for this session""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsDiagnoseResult': + assert isinstance(obj, dict) + capability = MCPAppsDiagnoseCapability.from_dict(obj.get("capability")) + server = MCPAppsDiagnoseServer.from_dict(obj.get("server")) + return MCPAppsDiagnoseResult(capability, server) + + def to_dict(self) -> dict: + result: dict = {} + result["capability"] = to_class(MCPAppsDiagnoseCapability, self.capability) + result["server"] = to_class(MCPAppsDiagnoseServer, self.server) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsHostContextDetails: + """Current host context""" + + available_display_modes: list[MCPAppsDisplayMode] | None = None + """Display modes the host supports""" + + display_mode: MCPAppsDisplayMode | None = None + """Current display mode (SEP-1865)""" + + locale: str | None = None + """BCP-47 locale, e.g. 'en-US'""" + + platform: MCPAppsHostContextDetailsPlatform | None = None + """Platform type for responsive design""" + + theme: Theme | None = None + """UI theme preference per SEP-1865""" + + time_zone: str | None = None + """IANA timezone, e.g. 'America/New_York'""" + + user_agent: str | None = None + """Host application identifier""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsHostContextDetails': + assert isinstance(obj, dict) + available_display_modes = from_union([lambda x: from_list(MCPAppsDisplayMode, x), from_none], obj.get("availableDisplayModes")) + display_mode = from_union([MCPAppsDisplayMode, from_none], obj.get("displayMode")) + locale = from_union([from_str, from_none], obj.get("locale")) + platform = from_union([MCPAppsHostContextDetailsPlatform, from_none], obj.get("platform")) + theme = from_union([Theme, from_none], obj.get("theme")) + time_zone = from_union([from_str, from_none], obj.get("timeZone")) + user_agent = from_union([from_str, from_none], obj.get("userAgent")) + return MCPAppsHostContextDetails(available_display_modes, display_mode, locale, platform, theme, time_zone, user_agent) + + def to_dict(self) -> dict: + result: dict = {} + if self.available_display_modes is not None: + result["availableDisplayModes"] = from_union([lambda x: from_list(lambda x: to_enum(MCPAppsDisplayMode, x), x), from_none], self.available_display_modes) + if self.display_mode is not None: + result["displayMode"] = from_union([lambda x: to_enum(MCPAppsDisplayMode, x), from_none], self.display_mode) + if self.locale is not None: + result["locale"] = from_union([from_str, from_none], self.locale) + if self.platform is not None: + result["platform"] = from_union([lambda x: to_enum(MCPAppsHostContextDetailsPlatform, x), from_none], self.platform) + if self.theme is not None: + result["theme"] = from_union([lambda x: to_enum(Theme, x), from_none], self.theme) + if self.time_zone is not None: + result["timeZone"] = from_union([from_str, from_none], self.time_zone) + if self.user_agent is not None: + result["userAgent"] = from_union([from_str, from_none], self.user_agent) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsSetHostContextDetails: + """Host context advertised to MCP App guests""" + + available_display_modes: list[MCPAppsDisplayMode] | None = None + """Display modes the host supports""" + + display_mode: MCPAppsDisplayMode | None = None + """Current display mode (SEP-1865)""" + + locale: str | None = None + """BCP-47 locale, e.g. 'en-US'""" + + platform: MCPAppsHostContextDetailsPlatform | None = None + """Platform type for responsive design""" + + theme: Theme | None = None + """UI theme preference per SEP-1865""" + + time_zone: str | None = None + """IANA timezone, e.g. 'America/New_York'""" + + user_agent: str | None = None + """Host application identifier""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsSetHostContextDetails': + assert isinstance(obj, dict) + available_display_modes = from_union([lambda x: from_list(MCPAppsDisplayMode, x), from_none], obj.get("availableDisplayModes")) + display_mode = from_union([MCPAppsDisplayMode, from_none], obj.get("displayMode")) + locale = from_union([from_str, from_none], obj.get("locale")) + platform = from_union([MCPAppsHostContextDetailsPlatform, from_none], obj.get("platform")) + theme = from_union([Theme, from_none], obj.get("theme")) + time_zone = from_union([from_str, from_none], obj.get("timeZone")) + user_agent = from_union([from_str, from_none], obj.get("userAgent")) + return MCPAppsSetHostContextDetails(available_display_modes, display_mode, locale, platform, theme, time_zone, user_agent) + + def to_dict(self) -> dict: + result: dict = {} + if self.available_display_modes is not None: + result["availableDisplayModes"] = from_union([lambda x: from_list(lambda x: to_enum(MCPAppsDisplayMode, x), x), from_none], self.available_display_modes) + if self.display_mode is not None: + result["displayMode"] = from_union([lambda x: to_enum(MCPAppsDisplayMode, x), from_none], self.display_mode) + if self.locale is not None: + result["locale"] = from_union([from_str, from_none], self.locale) + if self.platform is not None: + result["platform"] = from_union([lambda x: to_enum(MCPAppsHostContextDetailsPlatform, x), from_none], self.platform) + if self.theme is not None: + result["theme"] = from_union([lambda x: to_enum(Theme, x), from_none], self.theme) + if self.time_zone is not None: + result["timeZone"] = from_union([from_str, from_none], self.time_zone) + if self.user_agent is not None: + result["userAgent"] = from_union([from_str, from_none], self.user_agent) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsReadResourceResult: + """Resource contents returned by the MCP server.""" + + contents: list[MCPAppsResourceContent] + """Resource contents returned by the server""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsReadResourceResult': + assert isinstance(obj, dict) + contents = from_list(MCPAppsResourceContent.from_dict, obj.get("contents")) + return MCPAppsReadResourceResult(contents) + + def to_dict(self) -> dict: + result: dict = {} + result["contents"] = from_list(lambda x: to_class(MCPAppsResourceContent, x), self.contents) + return result + @dataclass class MCPServerConfig: """MCP server configuration (stdio process or remote HTTP/SSE) @@ -7961,28 +8334,52 @@ def to_dict(self) -> dict: return result @dataclass -class ModelBilling: - """Billing information""" +class ModelBillingTokenPrices: + """Token-level pricing information for this model""" - multiplier: float | None = None - """Billing cost multiplier relative to the base rate""" + batch_size: int | None = None + """Number of tokens per standard billing batch""" - token_prices: ModelBillingTokenPrices | None = None - """Token-level pricing information for this model""" + cache_price: float | None = None + """AI Credits cost per billing batch of cached tokens""" + + context_max: int | None = None + """Maximum context window tokens for the default tier""" + + input_price: float | None = None + """AI Credits cost per billing batch of input tokens""" + + long_context: ModelBillingTokenPricesLongContext | None = None + """Long context tier pricing (available for models with extended context windows)""" + + output_price: float | None = None + """AI Credits cost per billing batch of output tokens""" @staticmethod - def from_dict(obj: Any) -> 'ModelBilling': + def from_dict(obj: Any) -> 'ModelBillingTokenPrices': assert isinstance(obj, dict) - multiplier = from_union([from_float, from_none], obj.get("multiplier")) - token_prices = from_union([ModelBillingTokenPrices.from_dict, from_none], obj.get("tokenPrices")) - return ModelBilling(multiplier, token_prices) + batch_size = from_union([from_int, from_none], obj.get("batchSize")) + cache_price = from_union([from_float, from_none], obj.get("cachePrice")) + context_max = from_union([from_int, from_none], obj.get("contextMax")) + input_price = from_union([from_float, from_none], obj.get("inputPrice")) + long_context = from_union([ModelBillingTokenPricesLongContext.from_dict, from_none], obj.get("longContext")) + output_price = from_union([from_float, from_none], obj.get("outputPrice")) + return ModelBillingTokenPrices(batch_size, cache_price, context_max, input_price, long_context, output_price) def to_dict(self) -> dict: result: dict = {} - if self.multiplier is not None: - result["multiplier"] = from_union([to_float, from_none], self.multiplier) - if self.token_prices is not None: - result["tokenPrices"] = from_union([lambda x: to_class(ModelBillingTokenPrices, x), from_none], self.token_prices) + if self.batch_size is not None: + result["batchSize"] = from_union([from_int, from_none], self.batch_size) + if self.cache_price is not None: + result["cachePrice"] = from_union([to_float, from_none], self.cache_price) + if self.context_max is not None: + result["contextMax"] = from_union([from_int, from_none], self.context_max) + if self.input_price is not None: + result["inputPrice"] = from_union([to_float, from_none], self.input_price) + if self.long_context is not None: + result["longContext"] = from_union([lambda x: to_class(ModelBillingTokenPricesLongContext, x), from_none], self.long_context) + if self.output_price is not None: + result["outputPrice"] = from_union([to_float, from_none], self.output_price) return result @dataclass @@ -10068,6 +10465,43 @@ def to_dict(self) -> dict: result["pid"] = from_union([from_int, from_none], self.pid) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsCallToolRequest: + """MCP server, tool name, and arguments to invoke from an MCP App view.""" + + origin_server_name: str + """**Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the + app from this server only'), the call is rejected when this differs from `serverName`, + and rejected outright when missing. + """ + server_name: str + """MCP server hosting the tool""" + + tool_name: str + """MCP tool name""" + + arguments: dict[str, Any] | None = None + """Tool arguments""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsCallToolRequest': + assert isinstance(obj, dict) + origin_server_name = from_str(obj.get("originServerName")) + server_name = from_str(obj.get("serverName")) + tool_name = from_str(obj.get("toolName")) + arguments = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("arguments")) + return MCPAppsCallToolRequest(origin_server_name, server_name, tool_name, arguments) + + def to_dict(self) -> dict: + result: dict = {} + result["originServerName"] = from_str(self.origin_server_name) + result["serverName"] = from_str(self.server_name) + result["toolName"] = from_str(self.tool_name) + if self.arguments is not None: + result["arguments"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.arguments) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class PermissionLocationAddToolApprovalParams: @@ -11105,6 +11539,44 @@ def to_dict(self) -> dict: result["sources"] = from_list(lambda x: to_class(InstructionsSources, x), self.sources) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsHostContext: + """Current host context advertised to MCP App guests.""" + + context: MCPAppsHostContextDetails + """Current host context""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsHostContext': + assert isinstance(obj, dict) + context = MCPAppsHostContextDetails.from_dict(obj.get("context")) + return MCPAppsHostContext(context) + + def to_dict(self) -> dict: + result: dict = {} + result["context"] = to_class(MCPAppsHostContextDetails, self.context) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPAppsSetHostContextRequest: + """Host context to advertise to MCP App guests.""" + + context: MCPAppsSetHostContextDetails + """Host context advertised to MCP App guests""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPAppsSetHostContextRequest': + assert isinstance(obj, dict) + context = MCPAppsSetHostContextDetails.from_dict(obj.get("context")) + return MCPAppsSetHostContextRequest(context) + + def to_dict(self) -> dict: + result: dict = {} + result["context"] = to_class(MCPAppsSetHostContextDetails, self.context) + return result + @dataclass class MCPConfigAddRequest: """MCP server name and configuration to add to user configuration.""" @@ -11431,6 +11903,31 @@ def to_dict(self) -> dict: result["checkpoints"] = from_list(lambda x: to_class(WorkspacesCheckpoints, x), self.checkpoints) return result +@dataclass +class ModelBilling: + """Billing information""" + + multiplier: float | None = None + """Billing cost multiplier relative to the base rate""" + + token_prices: ModelBillingTokenPrices | None = None + """Token-level pricing information for this model""" + + @staticmethod + def from_dict(obj: Any) -> 'ModelBilling': + assert isinstance(obj, dict) + multiplier = from_union([from_float, from_none], obj.get("multiplier")) + token_prices = from_union([ModelBillingTokenPrices.from_dict, from_none], obj.get("tokenPrices")) + return ModelBilling(multiplier, token_prices) + + def to_dict(self) -> dict: + result: dict = {} + if self.multiplier is not None: + result["multiplier"] = from_union([to_float, from_none], self.multiplier) + if self.token_prices is not None: + result["tokenPrices"] = from_union([lambda x: to_class(ModelBillingTokenPrices, x), from_none], self.token_prices) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ModelCapabilitiesOverride: @@ -13749,7 +14246,7 @@ class RPC: external_tool_text_result_for_llm_content_resource_details: ExternalToolTextResultForLlmContentResourceDetails external_tool_text_result_for_llm_content_resource_link: ExternalToolTextResultForLlmContentResourceLink external_tool_text_result_for_llm_content_resource_link_icon: ExternalToolTextResultForLlmContentResourceLinkIcon - external_tool_text_result_for_llm_content_resource_link_icon_theme: ExternalToolTextResultForLlmContentResourceLinkIconTheme + external_tool_text_result_for_llm_content_resource_link_icon_theme: Theme external_tool_text_result_for_llm_content_terminal: ExternalToolTextResultForLlmContentTerminal external_tool_text_result_for_llm_content_text: ExternalToolTextResultForLlmContentText filter_mapping: dict[str, ContentFilterMode] | ContentFilterMode @@ -13782,6 +14279,28 @@ class RPC: log_request: LogRequest log_result: LogResult lsp_initialize_request: LspInitializeRequest + mcp_apps_call_tool_request: MCPAppsCallToolRequest + mcp_apps_diagnose_capability: MCPAppsDiagnoseCapability + mcp_apps_diagnose_request: MCPAppsDiagnoseRequest + mcp_apps_diagnose_result: MCPAppsDiagnoseResult + mcp_apps_diagnose_server: MCPAppsDiagnoseServer + mcp_apps_host_context: MCPAppsHostContext + mcp_apps_host_context_details: MCPAppsHostContextDetails + mcp_apps_host_context_details_available_display_mode: MCPAppsDisplayMode + mcp_apps_host_context_details_display_mode: MCPAppsDisplayMode + mcp_apps_host_context_details_platform: MCPAppsHostContextDetailsPlatform + mcp_apps_host_context_details_theme: Theme + mcp_apps_list_tools_request: MCPAppsListToolsRequest + mcp_apps_list_tools_result: MCPAppsListToolsResult + mcp_apps_read_resource_request: MCPAppsReadResourceRequest + mcp_apps_read_resource_result: MCPAppsReadResourceResult + mcp_apps_resource_content: MCPAppsResourceContent + mcp_apps_set_host_context_details: MCPAppsSetHostContextDetails + mcp_apps_set_host_context_details_available_display_mode: MCPAppsDisplayMode + mcp_apps_set_host_context_details_display_mode: MCPAppsDisplayMode + mcp_apps_set_host_context_details_platform: MCPAppsHostContextDetailsPlatform + mcp_apps_set_host_context_details_theme: Theme + mcp_apps_set_host_context_request: MCPAppsSetHostContextRequest mcp_cancel_sampling_execution_params: MCPCancelSamplingExecutionParams mcp_cancel_sampling_execution_result: MCPCancelSamplingExecutionResult mcp_config_add_request: MCPConfigAddRequest @@ -13829,6 +14348,7 @@ class RPC: model: Model model_billing: ModelBilling model_billing_token_prices: ModelBillingTokenPrices + model_billing_token_prices_long_context: ModelBillingTokenPricesLongContext model_capabilities: ModelCapabilities model_capabilities_limits: ModelCapabilitiesLimits model_capabilities_limits_vision: ModelCapabilitiesLimitsVision @@ -14032,6 +14552,7 @@ class RPC: session_list_filter: SessionListFilter session_load_deferred_repo_hooks_result: SessionLoadDeferredRepoHooksResult session_log_level: SessionLogLevel + session_mcp_apps_call_tool_result: dict[str, Any] session_metadata: SessionMetadata session_metadata_snapshot: SessionMetadataSnapshot session_mode: SessionMode @@ -14260,7 +14781,7 @@ def from_dict(obj: Any) -> 'RPC': external_tool_text_result_for_llm_content_resource_details = (lambda x: from_union([EmbeddedTextResourceContents.from_dict, EmbeddedBlobResourceContents.from_dict], x))(obj.get("ExternalToolTextResultForLlmContentResourceDetails")) external_tool_text_result_for_llm_content_resource_link = ExternalToolTextResultForLlmContentResourceLink.from_dict(obj.get("ExternalToolTextResultForLlmContentResourceLink")) external_tool_text_result_for_llm_content_resource_link_icon = ExternalToolTextResultForLlmContentResourceLinkIcon.from_dict(obj.get("ExternalToolTextResultForLlmContentResourceLinkIcon")) - external_tool_text_result_for_llm_content_resource_link_icon_theme = ExternalToolTextResultForLlmContentResourceLinkIconTheme(obj.get("ExternalToolTextResultForLlmContentResourceLinkIconTheme")) + external_tool_text_result_for_llm_content_resource_link_icon_theme = Theme(obj.get("ExternalToolTextResultForLlmContentResourceLinkIconTheme")) external_tool_text_result_for_llm_content_terminal = ExternalToolTextResultForLlmContentTerminal.from_dict(obj.get("ExternalToolTextResultForLlmContentTerminal")) external_tool_text_result_for_llm_content_text = ExternalToolTextResultForLlmContentText.from_dict(obj.get("ExternalToolTextResultForLlmContentText")) filter_mapping = from_union([lambda x: from_dict(ContentFilterMode, x), ContentFilterMode], obj.get("FilterMapping")) @@ -14293,6 +14814,28 @@ def from_dict(obj: Any) -> 'RPC': log_request = LogRequest.from_dict(obj.get("LogRequest")) log_result = LogResult.from_dict(obj.get("LogResult")) lsp_initialize_request = LspInitializeRequest.from_dict(obj.get("LspInitializeRequest")) + mcp_apps_call_tool_request = MCPAppsCallToolRequest.from_dict(obj.get("McpAppsCallToolRequest")) + mcp_apps_diagnose_capability = MCPAppsDiagnoseCapability.from_dict(obj.get("McpAppsDiagnoseCapability")) + mcp_apps_diagnose_request = MCPAppsDiagnoseRequest.from_dict(obj.get("McpAppsDiagnoseRequest")) + mcp_apps_diagnose_result = MCPAppsDiagnoseResult.from_dict(obj.get("McpAppsDiagnoseResult")) + mcp_apps_diagnose_server = MCPAppsDiagnoseServer.from_dict(obj.get("McpAppsDiagnoseServer")) + mcp_apps_host_context = MCPAppsHostContext.from_dict(obj.get("McpAppsHostContext")) + mcp_apps_host_context_details = MCPAppsHostContextDetails.from_dict(obj.get("McpAppsHostContextDetails")) + mcp_apps_host_context_details_available_display_mode = MCPAppsDisplayMode(obj.get("McpAppsHostContextDetailsAvailableDisplayMode")) + mcp_apps_host_context_details_display_mode = MCPAppsDisplayMode(obj.get("McpAppsHostContextDetailsDisplayMode")) + mcp_apps_host_context_details_platform = MCPAppsHostContextDetailsPlatform(obj.get("McpAppsHostContextDetailsPlatform")) + mcp_apps_host_context_details_theme = Theme(obj.get("McpAppsHostContextDetailsTheme")) + mcp_apps_list_tools_request = MCPAppsListToolsRequest.from_dict(obj.get("McpAppsListToolsRequest")) + mcp_apps_list_tools_result = MCPAppsListToolsResult.from_dict(obj.get("McpAppsListToolsResult")) + mcp_apps_read_resource_request = MCPAppsReadResourceRequest.from_dict(obj.get("McpAppsReadResourceRequest")) + mcp_apps_read_resource_result = MCPAppsReadResourceResult.from_dict(obj.get("McpAppsReadResourceResult")) + mcp_apps_resource_content = MCPAppsResourceContent.from_dict(obj.get("McpAppsResourceContent")) + mcp_apps_set_host_context_details = MCPAppsSetHostContextDetails.from_dict(obj.get("McpAppsSetHostContextDetails")) + mcp_apps_set_host_context_details_available_display_mode = MCPAppsDisplayMode(obj.get("McpAppsSetHostContextDetailsAvailableDisplayMode")) + mcp_apps_set_host_context_details_display_mode = MCPAppsDisplayMode(obj.get("McpAppsSetHostContextDetailsDisplayMode")) + mcp_apps_set_host_context_details_platform = MCPAppsHostContextDetailsPlatform(obj.get("McpAppsSetHostContextDetailsPlatform")) + mcp_apps_set_host_context_details_theme = Theme(obj.get("McpAppsSetHostContextDetailsTheme")) + mcp_apps_set_host_context_request = MCPAppsSetHostContextRequest.from_dict(obj.get("McpAppsSetHostContextRequest")) mcp_cancel_sampling_execution_params = MCPCancelSamplingExecutionParams.from_dict(obj.get("McpCancelSamplingExecutionParams")) mcp_cancel_sampling_execution_result = MCPCancelSamplingExecutionResult.from_dict(obj.get("McpCancelSamplingExecutionResult")) mcp_config_add_request = MCPConfigAddRequest.from_dict(obj.get("McpConfigAddRequest")) @@ -14340,6 +14883,7 @@ def from_dict(obj: Any) -> 'RPC': model = Model.from_dict(obj.get("Model")) model_billing = ModelBilling.from_dict(obj.get("ModelBilling")) model_billing_token_prices = ModelBillingTokenPrices.from_dict(obj.get("ModelBillingTokenPrices")) + model_billing_token_prices_long_context = ModelBillingTokenPricesLongContext.from_dict(obj.get("ModelBillingTokenPricesLongContext")) model_capabilities = ModelCapabilities.from_dict(obj.get("ModelCapabilities")) model_capabilities_limits = ModelCapabilitiesLimits.from_dict(obj.get("ModelCapabilitiesLimits")) model_capabilities_limits_vision = ModelCapabilitiesLimitsVision.from_dict(obj.get("ModelCapabilitiesLimitsVision")) @@ -14543,6 +15087,7 @@ def from_dict(obj: Any) -> 'RPC': session_list_filter = SessionListFilter.from_dict(obj.get("SessionListFilter")) session_load_deferred_repo_hooks_result = SessionLoadDeferredRepoHooksResult.from_dict(obj.get("SessionLoadDeferredRepoHooksResult")) session_log_level = SessionLogLevel(obj.get("SessionLogLevel")) + session_mcp_apps_call_tool_result = from_dict(lambda x: x, obj.get("SessionMcpAppsCallToolResult")) session_metadata = SessionMetadata.from_dict(obj.get("SessionMetadata")) session_metadata_snapshot = SessionMetadataSnapshot.from_dict(obj.get("SessionMetadataSnapshot")) session_mode = SessionMode(obj.get("SessionMode")) @@ -14699,7 +15244,7 @@ def from_dict(obj: Any) -> 'RPC': session_context_info = from_union([SessionContextInfo.from_dict, from_none], obj.get("SessionContextInfo")) 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_get_quota_request, account_get_quota_result, account_quota_snapshot, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_reload_result, agent_select_request, agent_select_result, api_key_auth_info, auth_info, auth_info_type, 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, 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, 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_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_source, installed_plugin_source_github, installed_plugin_source_local, installed_plugin_source_url, instructions_get_sources_result, instructions_sources, instructions_sources_location, instructions_sources_type, log_request, log_result, lsp_initialize_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_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_oauth_login_request, mcp_oauth_login_result, mcp_remove_git_hub_result, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_config, mcp_server_config_http, mcp_server_config_http_auth, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_list, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, 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_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_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, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, options_update_env_value_mode, 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_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_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_update_request, plugin, plugin_list, 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, release_event_interest_params, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_mode, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachment, send_attachment_blob, send_attachment_directory, send_attachment_file, send_attachment_file_line_range, send_attachment_github_reference, send_attachment_github_reference_type, send_attachment_selection, send_attachment_selection_details, send_attachment_selection_details_end, send_attachment_selection_details_start, send_mode, send_request, send_result, server_skill, server_skill_list, session_auth_status, session_bulk_delete_result, 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_github, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_metadata, session_metadata_snapshot, session_mode, 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_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_prune_old_request, 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, session_update_options_params, session_update_options_result, session_working_directory_context, session_working_directory_context_host_type, shell_exec_request, shell_exec_result, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_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, 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_initialize_and_validate_result, tools_list_request, 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_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, 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, workspaces_checkpoints, workspaces_create_file_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, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_get_quota_request, account_get_quota_result, account_quota_snapshot, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_reload_result, agent_select_request, agent_select_result, api_key_auth_info, auth_info, auth_info_type, 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, 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, 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_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_source, installed_plugin_source_github, installed_plugin_source_local, installed_plugin_source_url, instructions_get_sources_result, instructions_sources, instructions_sources_location, instructions_sources_type, log_request, log_result, lsp_initialize_request, 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_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_oauth_login_request, mcp_oauth_login_result, mcp_remove_git_hub_result, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_config, mcp_server_config_http, mcp_server_config_http_auth, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_list, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, 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_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, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, options_update_env_value_mode, 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_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_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_update_request, plugin, plugin_list, 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, release_event_interest_params, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_mode, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachment, send_attachment_blob, send_attachment_directory, send_attachment_file, send_attachment_file_line_range, send_attachment_github_reference, send_attachment_github_reference_type, send_attachment_selection, send_attachment_selection_details, send_attachment_selection_details_end, send_attachment_selection_details_start, send_mode, send_request, send_result, server_skill, server_skill_list, session_auth_status, session_bulk_delete_result, 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_github, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata, session_metadata_snapshot, session_mode, 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_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_prune_old_request, 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, session_update_options_params, session_update_options_result, session_working_directory_context, session_working_directory_context_host_type, shell_exec_request, shell_exec_result, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_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, 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_initialize_and_validate_result, tools_list_request, 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_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, 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, workspaces_checkpoints, workspaces_create_file_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, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -14771,7 +15316,7 @@ def to_dict(self) -> dict: result["ExternalToolTextResultForLlmContentResourceDetails"] = from_union([lambda x: to_class(EmbeddedTextResourceContents, x), lambda x: to_class(EmbeddedBlobResourceContents, x)], self.external_tool_text_result_for_llm_content_resource_details) result["ExternalToolTextResultForLlmContentResourceLink"] = to_class(ExternalToolTextResultForLlmContentResourceLink, self.external_tool_text_result_for_llm_content_resource_link) result["ExternalToolTextResultForLlmContentResourceLinkIcon"] = to_class(ExternalToolTextResultForLlmContentResourceLinkIcon, self.external_tool_text_result_for_llm_content_resource_link_icon) - result["ExternalToolTextResultForLlmContentResourceLinkIconTheme"] = to_enum(ExternalToolTextResultForLlmContentResourceLinkIconTheme, self.external_tool_text_result_for_llm_content_resource_link_icon_theme) + result["ExternalToolTextResultForLlmContentResourceLinkIconTheme"] = to_enum(Theme, self.external_tool_text_result_for_llm_content_resource_link_icon_theme) result["ExternalToolTextResultForLlmContentTerminal"] = to_class(ExternalToolTextResultForLlmContentTerminal, self.external_tool_text_result_for_llm_content_terminal) result["ExternalToolTextResultForLlmContentText"] = to_class(ExternalToolTextResultForLlmContentText, self.external_tool_text_result_for_llm_content_text) result["FilterMapping"] = from_union([lambda x: from_dict(lambda x: to_enum(ContentFilterMode, x), x), lambda x: to_enum(ContentFilterMode, x)], self.filter_mapping) @@ -14804,6 +15349,28 @@ def to_dict(self) -> dict: result["LogRequest"] = to_class(LogRequest, self.log_request) result["LogResult"] = to_class(LogResult, self.log_result) result["LspInitializeRequest"] = to_class(LspInitializeRequest, self.lsp_initialize_request) + result["McpAppsCallToolRequest"] = to_class(MCPAppsCallToolRequest, self.mcp_apps_call_tool_request) + result["McpAppsDiagnoseCapability"] = to_class(MCPAppsDiagnoseCapability, self.mcp_apps_diagnose_capability) + result["McpAppsDiagnoseRequest"] = to_class(MCPAppsDiagnoseRequest, self.mcp_apps_diagnose_request) + result["McpAppsDiagnoseResult"] = to_class(MCPAppsDiagnoseResult, self.mcp_apps_diagnose_result) + result["McpAppsDiagnoseServer"] = to_class(MCPAppsDiagnoseServer, self.mcp_apps_diagnose_server) + result["McpAppsHostContext"] = to_class(MCPAppsHostContext, self.mcp_apps_host_context) + result["McpAppsHostContextDetails"] = to_class(MCPAppsHostContextDetails, self.mcp_apps_host_context_details) + result["McpAppsHostContextDetailsAvailableDisplayMode"] = to_enum(MCPAppsDisplayMode, self.mcp_apps_host_context_details_available_display_mode) + result["McpAppsHostContextDetailsDisplayMode"] = to_enum(MCPAppsDisplayMode, self.mcp_apps_host_context_details_display_mode) + result["McpAppsHostContextDetailsPlatform"] = to_enum(MCPAppsHostContextDetailsPlatform, self.mcp_apps_host_context_details_platform) + result["McpAppsHostContextDetailsTheme"] = to_enum(Theme, self.mcp_apps_host_context_details_theme) + result["McpAppsListToolsRequest"] = to_class(MCPAppsListToolsRequest, self.mcp_apps_list_tools_request) + result["McpAppsListToolsResult"] = to_class(MCPAppsListToolsResult, self.mcp_apps_list_tools_result) + result["McpAppsReadResourceRequest"] = to_class(MCPAppsReadResourceRequest, self.mcp_apps_read_resource_request) + result["McpAppsReadResourceResult"] = to_class(MCPAppsReadResourceResult, self.mcp_apps_read_resource_result) + result["McpAppsResourceContent"] = to_class(MCPAppsResourceContent, self.mcp_apps_resource_content) + result["McpAppsSetHostContextDetails"] = to_class(MCPAppsSetHostContextDetails, self.mcp_apps_set_host_context_details) + result["McpAppsSetHostContextDetailsAvailableDisplayMode"] = to_enum(MCPAppsDisplayMode, self.mcp_apps_set_host_context_details_available_display_mode) + result["McpAppsSetHostContextDetailsDisplayMode"] = to_enum(MCPAppsDisplayMode, self.mcp_apps_set_host_context_details_display_mode) + result["McpAppsSetHostContextDetailsPlatform"] = to_enum(MCPAppsHostContextDetailsPlatform, self.mcp_apps_set_host_context_details_platform) + result["McpAppsSetHostContextDetailsTheme"] = to_enum(Theme, self.mcp_apps_set_host_context_details_theme) + result["McpAppsSetHostContextRequest"] = to_class(MCPAppsSetHostContextRequest, self.mcp_apps_set_host_context_request) result["McpCancelSamplingExecutionParams"] = to_class(MCPCancelSamplingExecutionParams, self.mcp_cancel_sampling_execution_params) result["McpCancelSamplingExecutionResult"] = to_class(MCPCancelSamplingExecutionResult, self.mcp_cancel_sampling_execution_result) result["McpConfigAddRequest"] = to_class(MCPConfigAddRequest, self.mcp_config_add_request) @@ -14851,6 +15418,7 @@ def to_dict(self) -> dict: result["Model"] = to_class(Model, self.model) result["ModelBilling"] = to_class(ModelBilling, self.model_billing) result["ModelBillingTokenPrices"] = to_class(ModelBillingTokenPrices, self.model_billing_token_prices) + result["ModelBillingTokenPricesLongContext"] = to_class(ModelBillingTokenPricesLongContext, self.model_billing_token_prices_long_context) result["ModelCapabilities"] = to_class(ModelCapabilities, self.model_capabilities) result["ModelCapabilitiesLimits"] = to_class(ModelCapabilitiesLimits, self.model_capabilities_limits) result["ModelCapabilitiesLimitsVision"] = to_class(ModelCapabilitiesLimitsVision, self.model_capabilities_limits_vision) @@ -15054,6 +15622,7 @@ def to_dict(self) -> dict: result["SessionListFilter"] = to_class(SessionListFilter, self.session_list_filter) result["SessionLoadDeferredRepoHooksResult"] = to_class(SessionLoadDeferredRepoHooksResult, self.session_load_deferred_repo_hooks_result) result["SessionLogLevel"] = to_enum(SessionLogLevel, self.session_log_level) + result["SessionMcpAppsCallToolResult"] = from_dict(lambda x: x, self.session_mcp_apps_call_tool_result) result["SessionMetadata"] = to_class(SessionMetadata, self.session_metadata) result["SessionMetadataSnapshot"] = to_class(SessionMetadataSnapshot, self.session_metadata_snapshot) result["SessionMode"] = to_enum(SessionMode, self.session_mode) @@ -15378,11 +15947,20 @@ def _load_TaskInfo(obj: Any) -> "TaskInfo": ExternalToolResult = ExternalToolTextResultForLlm +ExternalToolTextResultForLlmContentResourceLinkIconTheme = Theme FilterMapping = dict +McpAppsHostContextDetailsAvailableDisplayMode = MCPAppsDisplayMode +McpAppsHostContextDetailsDisplayMode = MCPAppsDisplayMode +McpAppsHostContextDetailsTheme = Theme +McpAppsSetHostContextDetailsAvailableDisplayMode = MCPAppsDisplayMode +McpAppsSetHostContextDetailsDisplayMode = MCPAppsDisplayMode +McpAppsSetHostContextDetailsPlatform = MCPAppsHostContextDetailsPlatform +McpAppsSetHostContextDetailsTheme = Theme McpExecuteSamplingRequest = dict McpExecuteSamplingResult = dict OptionsUpdateEnvValueMode = MCPSetEnvValueModeDetails SessionContextHostType = HostType +SessionMcpAppsCallToolResult = dict SessionWorkingDirectoryContextHostType = HostType TaskInfoExecutionMode = TaskExecutionMode TaskInfoStatus = TaskStatus @@ -15971,12 +16549,54 @@ async def login(self, params: MCPOauthLoginRequest, *, timeout: float | None = N return MCPOauthLoginResult.from_dict(await self._client.request("session.mcp.oauth.login", params_dict, **_timeout_kwargs(timeout))) +# Experimental: this API group is experimental and may change or be removed. +class McpAppsApi: + def __init__(self, client: "JsonRpcClient", session_id: str): + self._client = client + self._session_id = session_id + + async def read_resource(self, params: MCPAppsReadResourceRequest, *, timeout: float | None = None) -> MCPAppsReadResourceResult: + "Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability.\n\nArgs:\n params: MCP server and resource URI to fetch.\n\nReturns:\n Resource contents returned by the MCP 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 MCPAppsReadResourceResult.from_dict(await self._client.request("session.mcp.apps.readResource", params_dict, **_timeout_kwargs(timeout))) + + async def list_tools(self, params: MCPAppsListToolsRequest, *, timeout: float | None = None) -> MCPAppsListToolsResult: + "List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `[\"model\",\"app\"]`) or includes `\"app\"`.\n\nArgs:\n params: MCP server to list app-callable tools for.\n\nReturns:\n App-callable tools from the named MCP 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 MCPAppsListToolsResult.from_dict(await self._client.request("session.mcp.apps.listTools", params_dict, **_timeout_kwargs(timeout))) + + async def call_tool(self, params: MCPAppsCallToolRequest, *, timeout: float | None = None) -> dict: + "Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`.\n\nArgs:\n params: MCP server, tool name, and arguments to invoke from an MCP App view.\n\nReturns:\n Standard MCP CallToolResult" + 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 dict(await self._client.request("session.mcp.apps.callTool", params_dict, **_timeout_kwargs(timeout))) + + async def set_host_context(self, params: MCPAppsSetHostContextRequest, *, timeout: float | None = None) -> None: + "Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI.\n\nArgs:\n params: Host context to advertise to MCP App guests." + 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 + await self._client.request("session.mcp.apps.setHostContext", params_dict, **_timeout_kwargs(timeout)) + + async def get_host_context(self, *, timeout: float | None = None) -> MCPAppsHostContext: + "Read the current host context advertised to MCP App guests.\n\nReturns:\n Current host context advertised to MCP App guests." + return MCPAppsHostContext.from_dict(await self._client.request("session.mcp.apps.getHostContext", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + + async def diagnose(self, params: MCPAppsDiagnoseRequest, *, timeout: float | None = None) -> MCPAppsDiagnoseResult: + "Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, feature-flag state, advertised extension, and how many tools have `_meta.ui` populated.\n\nArgs:\n params: MCP server to diagnose MCP Apps wiring for.\n\nReturns:\n Diagnostic snapshot of MCP Apps wiring for the named 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 MCPAppsDiagnoseResult.from_dict(await self._client.request("session.mcp.apps.diagnose", params_dict, **_timeout_kwargs(timeout))) + + # Experimental: this API group is experimental and may change or be removed. class McpApi: def __init__(self, client: "JsonRpcClient", session_id: str): self._client = client self._session_id = session_id self.oauth = McpOauthApi(client, session_id) + self.apps = McpAppsApi(client, session_id) async def list(self, *, timeout: float | None = None) -> MCPServerList: "Lists MCP servers configured for the session and their connection status.\n\nReturns:\n MCP servers configured for the session, with their connection status." diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index b504fff90..5839c34db 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -202,6 +202,7 @@ 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" + MCP_APP_TOOL_CALL_COMPLETE = "mcp_app.tool_call_complete" UNKNOWN = "unknown" @classmethod @@ -334,6 +335,7 @@ class AssistantMessageData: reasoning_opaque: str | None = None reasoning_text: str | None = None request_id: str | None = None + service_request_id: str | None = None tool_requests: list[AssistantMessageToolRequest] | None = None turn_id: str | None = None @@ -353,6 +355,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": reasoning_opaque = from_union([from_none, from_str], obj.get("reasoningOpaque")) reasoning_text = from_union([from_none, from_str], obj.get("reasoningText")) request_id = from_union([from_none, from_str], obj.get("requestId")) + service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) tool_requests = from_union([from_none, lambda x: from_list(AssistantMessageToolRequest.from_dict, x)], obj.get("toolRequests")) turn_id = from_union([from_none, from_str], obj.get("turnId")) return AssistantMessageData( @@ -369,6 +372,7 @@ def from_dict(obj: Any) -> "AssistantMessageData": reasoning_opaque=reasoning_opaque, reasoning_text=reasoning_text, request_id=request_id, + service_request_id=service_request_id, tool_requests=tool_requests, turn_id=turn_id, ) @@ -399,6 +403,8 @@ def to_dict(self) -> dict: result["reasoningText"] = from_union([from_none, from_str], self.reasoning_text) if self.request_id is not None: 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.tool_requests is not None: result["toolRequests"] = from_union([from_none, lambda x: from_list(lambda x: to_class(AssistantMessageToolRequest, x), x)], self.tool_requests) if self.turn_id is not None: @@ -698,6 +704,7 @@ class AssistantUsageData: _quota_snapshots: dict[str, _AssistantUsageQuotaSnapshot] | None = None reasoning_effort: str | None = None reasoning_tokens: int | None = None + service_request_id: str | None = None time_to_first_token: timedelta | None = None @staticmethod @@ -720,6 +727,7 @@ def from_dict(obj: Any) -> "AssistantUsageData": _quota_snapshots = from_union([from_none, lambda x: from_dict(_AssistantUsageQuotaSnapshot.from_dict, x)], obj.get("quotaSnapshots")) reasoning_effort = from_union([from_none, from_str], obj.get("reasoningEffort")) reasoning_tokens = from_union([from_none, from_int], obj.get("reasoningTokens")) + service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) time_to_first_token = from_union([from_none, from_timedelta], obj.get("timeToFirstTokenMs")) return AssistantUsageData( model=model, @@ -739,6 +747,7 @@ def from_dict(obj: Any) -> "AssistantUsageData": _quota_snapshots=_quota_snapshots, reasoning_effort=reasoning_effort, reasoning_tokens=reasoning_tokens, + service_request_id=service_request_id, time_to_first_token=time_to_first_token, ) @@ -777,6 +786,8 @@ def to_dict(self) -> dict: result["reasoningEffort"] = from_union([from_none, from_str], self.reasoning_effort) if self.reasoning_tokens is not None: result["reasoningTokens"] = from_union([from_none, to_int], self.reasoning_tokens) + if self.service_request_id is not None: + result["serviceRequestId"] = from_union([from_none, from_str], self.service_request_id) if self.time_to_first_token is not None: result["timeToFirstTokenMs"] = from_union([from_none, to_timedelta_int], self.time_to_first_token) return result @@ -914,19 +925,24 @@ def to_dict(self) -> dict: class CapabilitiesChangedUI: "UI capability changes" elicitation: bool | None = None + mcp_apps: bool | None = None @staticmethod def from_dict(obj: Any) -> "CapabilitiesChangedUI": assert isinstance(obj, dict) elicitation = from_union([from_none, from_bool], obj.get("elicitation")) + mcp_apps = from_union([from_none, from_bool], obj.get("mcpApps")) return CapabilitiesChangedUI( elicitation=elicitation, + mcp_apps=mcp_apps, ) def to_dict(self) -> dict: result: dict = {} if self.elicitation is not None: result["elicitation"] = from_union([from_none, from_bool], self.elicitation) + if self.mcp_apps is not None: + result["mcpApps"] = from_union([from_none, from_bool], self.mcp_apps) return result @@ -1647,6 +1663,121 @@ def to_dict(self) -> dict: return result +@dataclass +class McpAppToolCallCompleteData: + "MCP App view called a tool on a connected MCP server (SEP-1865)" + duration_ms: float + server_name: str + success: bool + tool_name: str + arguments: dict[str, Any] | None = None + error: McpAppToolCallCompleteError | None = None + result: dict[str, Any] | None = None + tool_meta: McpAppToolCallCompleteToolMeta | None = None + + @staticmethod + def from_dict(obj: Any) -> "McpAppToolCallCompleteData": + assert isinstance(obj, dict) + duration_ms = from_float(obj.get("durationMs")) + server_name = from_str(obj.get("serverName")) + success = from_bool(obj.get("success")) + tool_name = from_str(obj.get("toolName")) + arguments = from_union([from_none, lambda x: from_dict(lambda x: x, x)], obj.get("arguments")) + error = from_union([from_none, McpAppToolCallCompleteError.from_dict], obj.get("error")) + result = from_union([from_none, lambda x: from_dict(lambda x: x, x)], obj.get("result")) + tool_meta = from_union([from_none, McpAppToolCallCompleteToolMeta.from_dict], obj.get("toolMeta")) + return McpAppToolCallCompleteData( + duration_ms=duration_ms, + server_name=server_name, + success=success, + tool_name=tool_name, + arguments=arguments, + error=error, + result=result, + tool_meta=tool_meta, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["durationMs"] = to_float(self.duration_ms) + result["serverName"] = from_str(self.server_name) + result["success"] = from_bool(self.success) + result["toolName"] = from_str(self.tool_name) + if self.arguments is not None: + result["arguments"] = from_union([from_none, lambda x: from_dict(lambda x: x, x)], self.arguments) + if self.error is not None: + result["error"] = from_union([from_none, lambda x: to_class(McpAppToolCallCompleteError, x)], self.error) + if self.result is not None: + result["result"] = from_union([from_none, lambda x: from_dict(lambda x: x, x)], self.result) + if self.tool_meta is not None: + result["toolMeta"] = from_union([from_none, lambda x: to_class(McpAppToolCallCompleteToolMeta, x)], self.tool_meta) + return result + + +@dataclass +class McpAppToolCallCompleteError: + "Set when the underlying tools/call threw an error before returning a CallToolResult" + message: str + + @staticmethod + def from_dict(obj: Any) -> "McpAppToolCallCompleteError": + assert isinstance(obj, dict) + message = from_str(obj.get("message")) + return McpAppToolCallCompleteError( + message=message, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["message"] = from_str(self.message) + return result + + +@dataclass +class McpAppToolCallCompleteToolMeta: + "The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools." + ui: McpAppToolCallCompleteToolMetaUI | None = None + + @staticmethod + def from_dict(obj: Any) -> "McpAppToolCallCompleteToolMeta": + assert isinstance(obj, dict) + ui = from_union([from_none, McpAppToolCallCompleteToolMetaUI.from_dict], obj.get("ui")) + return McpAppToolCallCompleteToolMeta( + ui=ui, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.ui is not None: + result["ui"] = from_union([from_none, lambda x: to_class(McpAppToolCallCompleteToolMetaUI, x)], self.ui) + return result + + +@dataclass +class McpAppToolCallCompleteToolMetaUI: + "Schema for the `McpAppToolCallCompleteToolMetaUI` type." + resource_uri: str | None = None + visibility: list[str] | None = None + + @staticmethod + def from_dict(obj: Any) -> "McpAppToolCallCompleteToolMetaUI": + assert isinstance(obj, dict) + resource_uri = from_union([from_none, from_str], obj.get("resourceUri")) + visibility = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("visibility")) + return McpAppToolCallCompleteToolMetaUI( + resource_uri=resource_uri, + visibility=visibility, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.resource_uri is not None: + result["resourceUri"] = from_union([from_none, from_str], self.resource_uri) + if self.visibility is not None: + result["visibility"] = from_union([from_none, lambda x: from_list(from_str, x)], self.visibility) + return result + + @dataclass class McpOauthCompletedData: "MCP OAuth request completion notification" @@ -1733,7 +1864,10 @@ class McpServersLoadedServer: name: str status: McpServerStatus error: str | None = None + plugin_name: str | None = None + plugin_version: str | None = None source: McpServerSource | None = None + transport: McpServerTransport | None = None @staticmethod def from_dict(obj: Any) -> "McpServersLoadedServer": @@ -1741,12 +1875,18 @@ def from_dict(obj: Any) -> "McpServersLoadedServer": name = from_str(obj.get("name")) status = parse_enum(McpServerStatus, obj.get("status")) error = from_union([from_none, from_str], obj.get("error")) + plugin_name = from_union([from_none, from_str], obj.get("pluginName")) + plugin_version = from_union([from_none, from_str], obj.get("pluginVersion")) source = from_union([from_none, lambda x: parse_enum(McpServerSource, x)], obj.get("source")) + transport = from_union([from_none, lambda x: parse_enum(McpServerTransport, x)], obj.get("transport")) return McpServersLoadedServer( name=name, status=status, error=error, + plugin_name=plugin_name, + plugin_version=plugin_version, source=source, + transport=transport, ) def to_dict(self) -> dict: @@ -1755,8 +1895,14 @@ def to_dict(self) -> dict: result["status"] = to_enum(McpServerStatus, self.status) if self.error is not None: result["error"] = from_union([from_none, from_str], self.error) + if self.plugin_name is not None: + result["pluginName"] = from_union([from_none, from_str], self.plugin_name) + if self.plugin_version is not None: + result["pluginVersion"] = from_union([from_none, from_str], self.plugin_version) if self.source is not None: result["source"] = from_union([from_none, lambda x: to_enum(McpServerSource, x)], self.source) + if self.transport is not None: + result["transport"] = from_union([from_none, lambda x: to_enum(McpServerTransport, x)], self.transport) return result @@ -1770,6 +1916,7 @@ class ModelCallFailureData: initiator: str | None = None model: str | None = None provider_call_id: str | None = None + service_request_id: str | None = None status_code: int | None = None @staticmethod @@ -1782,6 +1929,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")) + service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) status_code = from_union([from_none, from_int], obj.get("statusCode")) return ModelCallFailureData( source=source, @@ -1791,6 +1939,7 @@ def from_dict(obj: Any) -> "ModelCallFailureData": initiator=initiator, model=model, provider_call_id=provider_call_id, + service_request_id=service_request_id, status_code=status_code, ) @@ -1809,6 +1958,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.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) return result @@ -3009,6 +3160,7 @@ class SessionCompactionCompleteData: pre_compaction_messages_length: int | None = None pre_compaction_tokens: int | None = None request_id: str | None = None + service_request_id: str | None = None summary_content: str | None = None system_tokens: int | None = None tokens_removed: int | None = None @@ -3029,6 +3181,7 @@ def from_dict(obj: Any) -> "SessionCompactionCompleteData": pre_compaction_messages_length = from_union([from_none, from_int], obj.get("preCompactionMessagesLength")) 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")) 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")) @@ -3046,6 +3199,7 @@ def from_dict(obj: Any) -> "SessionCompactionCompleteData": pre_compaction_messages_length=pre_compaction_messages_length, pre_compaction_tokens=pre_compaction_tokens, request_id=request_id, + service_request_id=service_request_id, summary_content=summary_content, system_tokens=system_tokens, tokens_removed=tokens_removed, @@ -3077,6 +3231,8 @@ def to_dict(self) -> dict: result["preCompactionTokens"] = from_union([from_none, to_int], self.pre_compaction_tokens) if self.request_id is not None: 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.summary_content is not None: result["summaryContent"] = from_union([from_none, from_str], self.summary_content) if self.system_tokens is not None: @@ -3244,6 +3400,7 @@ class SessionErrorData: eligible_for_auto_switch: bool | None = None error_code: str | None = None provider_call_id: str | None = None + service_request_id: str | None = None stack: str | None = None status_code: int | None = None url: str | None = None @@ -3256,6 +3413,7 @@ def from_dict(obj: Any) -> "SessionErrorData": eligible_for_auto_switch = from_union([from_none, from_bool], obj.get("eligibleForAutoSwitch")) error_code = from_union([from_none, from_str], obj.get("errorCode")) provider_call_id = from_union([from_none, from_str], obj.get("providerCallId")) + service_request_id = from_union([from_none, from_str], obj.get("serviceRequestId")) stack = from_union([from_none, from_str], obj.get("stack")) status_code = from_union([from_none, from_int], obj.get("statusCode")) url = from_union([from_none, from_str], obj.get("url")) @@ -3265,6 +3423,7 @@ def from_dict(obj: Any) -> "SessionErrorData": eligible_for_auto_switch=eligible_for_auto_switch, error_code=error_code, provider_call_id=provider_call_id, + service_request_id=service_request_id, stack=stack, status_code=status_code, url=url, @@ -3280,6 +3439,8 @@ def to_dict(self) -> dict: result["errorCode"] = from_union([from_none, from_str], self.error_code) if self.provider_call_id is not None: result["providerCallId"] = from_union([from_none, from_str], self.provider_call_id) + if self.service_request_id is not None: + result["serviceRequestId"] = from_union([from_none, from_str], self.service_request_id) if self.stack is not None: result["stack"] = from_union([from_none, from_str], self.stack) if self.status_code is not None: @@ -3414,21 +3575,26 @@ class SessionMcpServerStatusChangedData: "Schema for the `McpServerStatusChangedData` type." server_name: str status: McpServerStatus + error: str | None = None @staticmethod def from_dict(obj: Any) -> "SessionMcpServerStatusChangedData": assert isinstance(obj, dict) server_name = from_str(obj.get("serverName")) status = parse_enum(McpServerStatus, obj.get("status")) + error = from_union([from_none, from_str], obj.get("error")) return SessionMcpServerStatusChangedData( server_name=server_name, status=status, + error=error, ) def to_dict(self) -> dict: result: dict = {} result["serverName"] = from_str(self.server_name) result["status"] = to_enum(McpServerStatus, self.status) + if self.error is not None: + result["error"] = from_union([from_none, from_str], self.error) return result @@ -3479,6 +3645,7 @@ class SessionModelChangeData: "Model change details including previous and new model identifiers" new_model: str cause: str | None = None + context_tier: SessionModelChangeDataContextTier | None = None previous_model: str | None = None previous_reasoning_effort: str | None = None previous_reasoning_summary: ReasoningSummary | None = None @@ -3490,6 +3657,7 @@ def from_dict(obj: Any) -> "SessionModelChangeData": assert isinstance(obj, dict) new_model = from_str(obj.get("newModel")) cause = from_union([from_none, from_str], obj.get("cause")) + context_tier = from_union([from_none, lambda x: parse_enum(SessionModelChangeDataContextTier, x)], obj.get("contextTier")) previous_model = from_union([from_none, from_str], obj.get("previousModel")) previous_reasoning_effort = from_union([from_none, from_str], obj.get("previousReasoningEffort")) previous_reasoning_summary = from_union([from_none, lambda x: parse_enum(ReasoningSummary, x)], obj.get("previousReasoningSummary")) @@ -3498,6 +3666,7 @@ def from_dict(obj: Any) -> "SessionModelChangeData": return SessionModelChangeData( new_model=new_model, cause=cause, + context_tier=context_tier, previous_model=previous_model, previous_reasoning_effort=previous_reasoning_effort, previous_reasoning_summary=previous_reasoning_summary, @@ -3510,6 +3679,8 @@ def to_dict(self) -> dict: result["newModel"] = from_str(self.new_model) if self.cause is not None: result["cause"] = from_union([from_none, from_str], self.cause) + if self.context_tier is not None: + result["contextTier"] = from_union([from_none, lambda x: to_enum(SessionModelChangeDataContextTier, x)], self.context_tier) if self.previous_model is not None: result["previousModel"] = from_union([from_none, from_str], self.previous_model) if self.previous_reasoning_effort is not None: @@ -4254,6 +4425,8 @@ class SkillInvokedData: description: str | None = None plugin_name: str | None = None plugin_version: str | None = None + source: str | None = None + trigger: SkillInvokedTrigger | None = None @staticmethod def from_dict(obj: Any) -> "SkillInvokedData": @@ -4265,6 +4438,8 @@ def from_dict(obj: Any) -> "SkillInvokedData": description = from_union([from_none, from_str], obj.get("description")) plugin_name = from_union([from_none, from_str], obj.get("pluginName")) plugin_version = from_union([from_none, from_str], obj.get("pluginVersion")) + source = from_union([from_none, from_str], obj.get("source")) + trigger = from_union([from_none, lambda x: parse_enum(SkillInvokedTrigger, x)], obj.get("trigger")) return SkillInvokedData( content=content, name=name, @@ -4273,6 +4448,8 @@ def from_dict(obj: Any) -> "SkillInvokedData": description=description, plugin_name=plugin_name, plugin_version=plugin_version, + source=source, + trigger=trigger, ) def to_dict(self) -> dict: @@ -4288,6 +4465,10 @@ def to_dict(self) -> dict: result["pluginName"] = from_union([from_none, from_str], self.plugin_name) if self.plugin_version is not None: result["pluginVersion"] = from_union([from_none, from_str], self.plugin_version) + if self.source is not None: + result["source"] = from_union([from_none, from_str], self.source) + if self.trigger is not None: + result["trigger"] = from_union([from_none, lambda x: to_enum(SkillInvokedTrigger, x)], self.trigger) return result @@ -4998,6 +5179,7 @@ class ToolExecutionCompleteData: parent_tool_call_id: str | None = None result: ToolExecutionCompleteResult | None = None sandboxed: bool | None = None + tool_description: ToolExecutionCompleteToolDescription | None = None tool_telemetry: dict[str, Any] | None = None turn_id: str | None = None @@ -5013,6 +5195,7 @@ def from_dict(obj: Any) -> "ToolExecutionCompleteData": parent_tool_call_id = from_union([from_none, from_str], obj.get("parentToolCallId")) result = from_union([from_none, ToolExecutionCompleteResult.from_dict], obj.get("result")) sandboxed = from_union([from_none, from_bool], obj.get("sandboxed")) + tool_description = from_union([from_none, ToolExecutionCompleteToolDescription.from_dict], obj.get("toolDescription")) tool_telemetry = from_union([from_none, lambda x: from_dict(lambda x: x, x)], obj.get("toolTelemetry")) turn_id = from_union([from_none, from_str], obj.get("turnId")) return ToolExecutionCompleteData( @@ -5025,6 +5208,7 @@ def from_dict(obj: Any) -> "ToolExecutionCompleteData": parent_tool_call_id=parent_tool_call_id, result=result, sandboxed=sandboxed, + tool_description=tool_description, tool_telemetry=tool_telemetry, turn_id=turn_id, ) @@ -5047,6 +5231,8 @@ def to_dict(self) -> dict: result["result"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteResult, x)], self.result) if self.sandboxed is not None: result["sandboxed"] = from_union([from_none, from_bool], self.sandboxed) + if self.tool_description is not None: + result["toolDescription"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteToolDescription, x)], self.tool_description) if self.tool_telemetry is not None: result["toolTelemetry"] = from_union([from_none, lambda x: from_dict(lambda x: x, x)], self.tool_telemetry) if self.turn_id is not None: @@ -5084,6 +5270,7 @@ class ToolExecutionCompleteResult: content: str contents: list[ToolExecutionCompleteContent] | None = None detailed_content: str | None = None + ui_resource: ToolExecutionCompleteUIResource | None = None @staticmethod def from_dict(obj: Any) -> "ToolExecutionCompleteResult": @@ -5091,10 +5278,12 @@ def from_dict(obj: Any) -> "ToolExecutionCompleteResult": content = from_str(obj.get("content")) contents = from_union([from_none, lambda x: from_list(_load_ToolExecutionCompleteContent, x)], obj.get("contents")) detailed_content = from_union([from_none, from_str], obj.get("detailedContent")) + ui_resource = from_union([from_none, ToolExecutionCompleteUIResource.from_dict], obj.get("uiResource")) return ToolExecutionCompleteResult( content=content, contents=contents, detailed_content=detailed_content, + ui_resource=ui_resource, ) def to_dict(self) -> dict: @@ -5104,9 +5293,296 @@ def to_dict(self) -> dict: result["contents"] = from_union([from_none, lambda x: from_list(lambda x: x.to_dict(), x)], self.contents) if self.detailed_content is not None: result["detailedContent"] = from_union([from_none, from_str], self.detailed_content) + if self.ui_resource is not None: + result["uiResource"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResource, x)], self.ui_resource) + return result + + +@dataclass +class ToolExecutionCompleteToolDescription: + "Tool definition metadata, present for MCP tools with MCP Apps support" + name: str + _meta: ToolExecutionCompleteToolDescriptionMeta | None = None + description: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteToolDescription": + assert isinstance(obj, dict) + name = from_str(obj.get("name")) + _meta = from_union([from_none, ToolExecutionCompleteToolDescriptionMeta.from_dict], obj.get("_meta")) + description = from_union([from_none, from_str], obj.get("description")) + return ToolExecutionCompleteToolDescription( + name=name, + _meta=_meta, + description=description, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["name"] = from_str(self.name) + if self._meta is not None: + result["_meta"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteToolDescriptionMeta, x)], self._meta) + if self.description is not None: + result["description"] = from_union([from_none, from_str], self.description) + return result + + +@dataclass +class ToolExecutionCompleteToolDescriptionMeta: + "MCP Apps metadata for UI resource association" + ui: ToolExecutionCompleteToolDescriptionMetaUI | None = None + + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteToolDescriptionMeta": + assert isinstance(obj, dict) + ui = from_union([from_none, ToolExecutionCompleteToolDescriptionMetaUI.from_dict], obj.get("ui")) + return ToolExecutionCompleteToolDescriptionMeta( + ui=ui, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.ui is not None: + result["ui"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteToolDescriptionMetaUI, x)], self.ui) + return result + + +@dataclass +class ToolExecutionCompleteToolDescriptionMetaUI: + "Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type." + resource_uri: str | None = None + visibility: list[ToolExecutionCompleteToolDescriptionMetaUIVisibility] | None = None + + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteToolDescriptionMetaUI": + assert isinstance(obj, dict) + resource_uri = from_union([from_none, from_str], obj.get("resourceUri")) + visibility = from_union([from_none, lambda x: from_list(lambda x: parse_enum(ToolExecutionCompleteToolDescriptionMetaUIVisibility, x), x)], obj.get("visibility")) + return ToolExecutionCompleteToolDescriptionMetaUI( + resource_uri=resource_uri, + visibility=visibility, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.resource_uri is not None: + result["resourceUri"] = from_union([from_none, from_str], self.resource_uri) + if self.visibility is not None: + result["visibility"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ToolExecutionCompleteToolDescriptionMetaUIVisibility, x), x)], self.visibility) + return result + + +@dataclass +class ToolExecutionCompleteUIResource: + "MCP Apps UI resource content for rendering in a sandboxed iframe" + mime_type: str + uri: str + _meta: ToolExecutionCompleteUIResourceMeta | None = None + blob: str | None = None + text: str | None = None + + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResource": + assert isinstance(obj, dict) + mime_type = from_str(obj.get("mimeType")) + uri = from_str(obj.get("uri")) + _meta = from_union([from_none, ToolExecutionCompleteUIResourceMeta.from_dict], obj.get("_meta")) + blob = from_union([from_none, from_str], obj.get("blob")) + text = from_union([from_none, from_str], obj.get("text")) + return ToolExecutionCompleteUIResource( + mime_type=mime_type, + uri=uri, + _meta=_meta, + blob=blob, + text=text, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["mimeType"] = from_str(self.mime_type) + result["uri"] = from_str(self.uri) + if self._meta is not None: + result["_meta"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResourceMeta, x)], self._meta) + if self.blob is not None: + result["blob"] = from_union([from_none, from_str], self.blob) + if self.text is not None: + result["text"] = from_union([from_none, from_str], self.text) + return result + + +@dataclass +class ToolExecutionCompleteUIResourceMeta: + "Resource-level UI metadata (CSP, permissions, visual preferences)" + ui: ToolExecutionCompleteUIResourceMetaUI | None = None + + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResourceMeta": + assert isinstance(obj, dict) + ui = from_union([from_none, ToolExecutionCompleteUIResourceMetaUI.from_dict], obj.get("ui")) + return ToolExecutionCompleteUIResourceMeta( + ui=ui, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.ui is not None: + result["ui"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResourceMetaUI, x)], self.ui) + return result + + +@dataclass +class ToolExecutionCompleteUIResourceMetaUI: + "Schema for the `ToolExecutionCompleteUIResourceMetaUI` type." + csp: ToolExecutionCompleteUIResourceMetaUICsp | None = None + domain: str | None = None + permissions: ToolExecutionCompleteUIResourceMetaUIPermissions | None = None + prefers_border: bool | None = None + + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResourceMetaUI": + assert isinstance(obj, dict) + csp = from_union([from_none, ToolExecutionCompleteUIResourceMetaUICsp.from_dict], obj.get("csp")) + domain = from_union([from_none, from_str], obj.get("domain")) + permissions = from_union([from_none, ToolExecutionCompleteUIResourceMetaUIPermissions.from_dict], obj.get("permissions")) + prefers_border = from_union([from_none, from_bool], obj.get("prefersBorder")) + return ToolExecutionCompleteUIResourceMetaUI( + csp=csp, + domain=domain, + permissions=permissions, + prefers_border=prefers_border, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.csp is not None: + result["csp"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResourceMetaUICsp, x)], self.csp) + if self.domain is not None: + result["domain"] = from_union([from_none, from_str], self.domain) + if self.permissions is not None: + result["permissions"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResourceMetaUIPermissions, x)], self.permissions) + if self.prefers_border is not None: + result["prefersBorder"] = from_union([from_none, from_bool], self.prefers_border) + return result + + +@dataclass +class ToolExecutionCompleteUIResourceMetaUICsp: + "Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type." + base_uri_domains: list[str] | None = None + connect_domains: list[str] | None = None + frame_domains: list[str] | None = None + resource_domains: list[str] | None = None + + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResourceMetaUICsp": + assert isinstance(obj, dict) + base_uri_domains = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("baseUriDomains")) + connect_domains = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("connectDomains")) + frame_domains = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("frameDomains")) + resource_domains = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("resourceDomains")) + return ToolExecutionCompleteUIResourceMetaUICsp( + base_uri_domains=base_uri_domains, + connect_domains=connect_domains, + frame_domains=frame_domains, + resource_domains=resource_domains, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.base_uri_domains is not None: + result["baseUriDomains"] = from_union([from_none, lambda x: from_list(from_str, x)], self.base_uri_domains) + if self.connect_domains is not None: + result["connectDomains"] = from_union([from_none, lambda x: from_list(from_str, x)], self.connect_domains) + if self.frame_domains is not None: + result["frameDomains"] = from_union([from_none, lambda x: from_list(from_str, x)], self.frame_domains) + if self.resource_domains is not None: + result["resourceDomains"] = from_union([from_none, lambda x: from_list(from_str, x)], self.resource_domains) + return result + + +@dataclass +class ToolExecutionCompleteUIResourceMetaUIPermissions: + "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type." + camera: ToolExecutionCompleteUIResourceMetaUIPermissionsCamera | None = None + clipboard_write: ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite | None = None + geolocation: ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation | None = None + microphone: ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone | None = None + + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResourceMetaUIPermissions": + assert isinstance(obj, dict) + camera = from_union([from_none, ToolExecutionCompleteUIResourceMetaUIPermissionsCamera.from_dict], obj.get("camera")) + clipboard_write = from_union([from_none, ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite.from_dict], obj.get("clipboardWrite")) + geolocation = from_union([from_none, ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation.from_dict], obj.get("geolocation")) + microphone = from_union([from_none, ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone.from_dict], obj.get("microphone")) + return ToolExecutionCompleteUIResourceMetaUIPermissions( + camera=camera, + clipboard_write=clipboard_write, + geolocation=geolocation, + microphone=microphone, + ) + + def to_dict(self) -> dict: + result: dict = {} + if self.camera is not None: + result["camera"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResourceMetaUIPermissionsCamera, x)], self.camera) + if self.clipboard_write is not None: + result["clipboardWrite"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite, x)], self.clipboard_write) + if self.geolocation is not None: + result["geolocation"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation, x)], self.geolocation) + if self.microphone is not None: + result["microphone"] = from_union([from_none, lambda x: to_class(ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone, x)], self.microphone) return result +@dataclass +class ToolExecutionCompleteUIResourceMetaUIPermissionsCamera: + "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type." + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResourceMetaUIPermissionsCamera": + assert isinstance(obj, dict) + return ToolExecutionCompleteUIResourceMetaUIPermissionsCamera() + + def to_dict(self) -> dict: + return {} + + +@dataclass +class ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite: + "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type." + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite": + assert isinstance(obj, dict) + return ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite() + + def to_dict(self) -> dict: + return {} + + +@dataclass +class ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation: + "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type." + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation": + assert isinstance(obj, dict) + return ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation() + + def to_dict(self) -> dict: + return {} + + +@dataclass +class ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone: + "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type." + @staticmethod + def from_dict(obj: Any) -> "ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone": + assert isinstance(obj, dict) + return ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone() + + def to_dict(self) -> dict: + return {} + + @dataclass class ToolExecutionPartialResultData: "Streaming tool execution output for incremental result display" @@ -6085,6 +6561,18 @@ class McpServerStatus(Enum): NOT_CONFIGURED = "not_configured" +class McpServerTransport(Enum): + "Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)" + # Server communicates over stdio with a local child process. + STDIO = "stdio" + # Server communicates over streamable HTTP. + HTTP = "http" + # Server communicates over Server-Sent Events (deprecated). + SSE = "sse" + # Server is backed by an in-memory runtime implementation. + MEMORY = "memory" + + class ModelCallFailureSource(Enum): "Where the failed model call originated" # Model call from the top-level agent. @@ -6151,6 +6639,13 @@ class SessionMode(Enum): AUTOPILOT = "autopilot" +class SessionModelChangeDataContextTier(Enum): + # Default context tier with standard context window size. + DEFAULT = "default" + # Extended context tier with a larger context window. + LONG_CONTEXT = "long_context" + + class ShutdownType(Enum): "Whether the session ended normally (\"routine\") or due to a crash/fatal error (\"error\")" # The session ended normally. @@ -6159,6 +6654,16 @@ class ShutdownType(Enum): ERROR = "error" +class SkillInvokedTrigger(Enum): + "What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent)" + # Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. + USER_INVOKED = "user-invoked" + # Skill invocation requested by the agent. + AGENT_INVOKED = "agent-invoked" + # Skill content loaded as part of another context, such as a configured custom agent or subagent. + CONTEXT_LOAD = "context-load" + + class SkillSource(Enum): "Source location type (e.g., project, personal-copilot, plugin, builtin)" # Skill defined in the current project's skill directories. @@ -6201,6 +6706,14 @@ class ToolExecutionCompleteContentResourceLinkIconTheme(Enum): DARK = "dark" +class ToolExecutionCompleteToolDescriptionMetaUIVisibility(Enum): + "Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration." + # Tool is callable by the model (LLM tool surface) + MODEL = "model" + # Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool + APP = "app" + + class UserMessageAgentMode(Enum): "The agent mode that was active when this message was sent" # The agent is responding interactively to the user. @@ -6239,7 +6752,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionPlanChangedData | 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 | 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 | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionPlanChangedData | 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 | 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 | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -6346,6 +6859,7 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_MCP_SERVERS_LOADED: data = SessionMcpServersLoadedData.from_dict(data_obj) case SessionEventType.SESSION_MCP_SERVER_STATUS_CHANGED: data = SessionMcpServerStatusChangedData.from_dict(data_obj) case SessionEventType.SESSION_EXTENSIONS_LOADED: data = SessionExtensionsLoadedData.from_dict(data_obj) + case SessionEventType.MCP_APP_TOOL_CALL_COMPLETE: data = McpAppToolCallCompleteData.from_dict(data_obj) case _: data = RawSessionEventData.from_dict(data_obj) return SessionEvent( data=data, diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 1f141bd0d..606ca4780 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -199,6 +199,18 @@ pub mod rpc_methods { pub const SESSION_MCP_REMOVEGITHUB: &str = "session.mcp.removeGitHub"; /// `session.mcp.oauth.login` pub const SESSION_MCP_OAUTH_LOGIN: &str = "session.mcp.oauth.login"; + /// `session.mcp.apps.readResource` + pub const SESSION_MCP_APPS_READRESOURCE: &str = "session.mcp.apps.readResource"; + /// `session.mcp.apps.listTools` + pub const SESSION_MCP_APPS_LISTTOOLS: &str = "session.mcp.apps.listTools"; + /// `session.mcp.apps.callTool` + pub const SESSION_MCP_APPS_CALLTOOL: &str = "session.mcp.apps.callTool"; + /// `session.mcp.apps.setHostContext` + pub const SESSION_MCP_APPS_SETHOSTCONTEXT: &str = "session.mcp.apps.setHostContext"; + /// `session.mcp.apps.getHostContext` + pub const SESSION_MCP_APPS_GETHOSTCONTEXT: &str = "session.mcp.apps.getHostContext"; + /// `session.mcp.apps.diagnose` + pub const SESSION_MCP_APPS_DIAGNOSE: &str = "session.mcp.apps.diagnose"; /// `session.plugins.list` pub const SESSION_PLUGINS_LIST: &str = "session.plugins.list"; /// `session.options.update` @@ -1176,7 +1188,7 @@ pub struct DiscoveredMcpServer { pub name: String, /// Configuration source: user, workspace, plugin, or builtin pub source: McpServerSource, - /// Server transport type: stdio, http, sse, or memory + /// Server transport type: stdio, http, sse (deprecated), or memory #[serde(skip_serializing_if = "Option::is_none")] pub r#type: Option, } @@ -1435,6 +1447,9 @@ pub struct ExternalToolTextResultForLlmBinaryResultsForLlm { /// Human-readable description of the binary data #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, + /// Optional metadata from the producing tool. + #[serde(default)] + pub metadata: HashMap, /// MIME type of the binary data pub mime_type: String, /// Binary result type discriminator. Use "image" for images and "resource" for other binary data. @@ -2132,6 +2147,289 @@ pub struct LspInitializeRequest { pub working_directory: Option, } +/// MCP server, tool name, and arguments to invoke from an MCP App view. +/// +///
+/// +/// **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 McpAppsCallToolRequest { + /// Tool arguments + #[serde(default)] + pub arguments: HashMap, + /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + pub origin_server_name: String, + /// MCP server hosting the tool + pub server_name: String, + /// MCP tool name + pub tool_name: String, +} + +/// Capability negotiation snapshot +/// +///
+/// +/// **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 McpAppsDiagnoseCapability { + /// Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers + pub advertised: bool, + /// Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on + pub feature_flag_enabled: bool, + /// Whether the session has the `mcp-apps` capability + pub session_has_mcp_apps: bool, +} + +/// MCP server to diagnose MCP Apps wiring for. +/// +///
+/// +/// **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 McpAppsDiagnoseRequest { + /// MCP server to probe + pub server_name: String, +} + +/// What the server returned for this session +/// +///
+/// +/// **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 McpAppsDiagnoseServer { + /// Whether the named server is currently connected + pub connected: bool, + /// Up to 5 tool names with `_meta.ui` for quick inspection + pub sample_tool_names: Vec, + /// Total tools returned by the server's tools/list + pub tool_count: f64, + /// Tools whose `_meta.ui` is populated (resourceUri and/or visibility set) + pub tools_with_ui_meta: f64, +} + +/// Diagnostic snapshot of MCP Apps wiring for the named server. +/// +///
+/// +/// **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 McpAppsDiagnoseResult { + /// Capability negotiation snapshot + pub capability: McpAppsDiagnoseCapability, + /// What the server returned for this session + pub server: McpAppsDiagnoseServer, +} + +/// Current host context +/// +///
+/// +/// **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 McpAppsHostContextDetails { + /// Display modes the host supports + #[serde(default)] + pub available_display_modes: Vec, + /// Current display mode (SEP-1865) + #[serde(skip_serializing_if = "Option::is_none")] + pub display_mode: Option, + /// BCP-47 locale, e.g. 'en-US' + #[serde(skip_serializing_if = "Option::is_none")] + pub locale: Option, + /// Platform type for responsive design + #[serde(skip_serializing_if = "Option::is_none")] + pub platform: Option, + /// UI theme preference per SEP-1865 + #[serde(skip_serializing_if = "Option::is_none")] + pub theme: Option, + /// IANA timezone, e.g. 'America/New_York' + #[serde(skip_serializing_if = "Option::is_none")] + pub time_zone: Option, + /// Host application identifier + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} + +/// Current host context advertised to MCP App guests. +/// +///
+/// +/// **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 McpAppsHostContext { + /// Current host context + pub context: McpAppsHostContextDetails, +} + +/// MCP server to list app-callable tools for. +/// +///
+/// +/// **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 McpAppsListToolsRequest { + /// **Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing. + pub origin_server_name: String, + /// MCP server hosting the app + pub server_name: String, +} + +/// App-callable tools from the named MCP server. +/// +///
+/// +/// **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 McpAppsListToolsResult { + /// App-callable tools from the server + pub tools: Vec>, +} + +/// MCP server and resource URI to fetch. +/// +///
+/// +/// **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 McpAppsReadResourceRequest { + /// Name of the MCP server hosting the resource + pub server_name: String, + /// Resource URI (typically ui://...) + pub uri: String, +} + +/// Schema for the `McpAppsResourceContent` 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 McpAppsResourceContent { + /// Resource-level metadata (CSP, permissions, etc.) + #[serde(rename = "_meta", default)] + pub meta: HashMap, + /// Base64-encoded binary content + #[serde(skip_serializing_if = "Option::is_none")] + pub blob: Option, + /// MIME type of the content + #[serde(skip_serializing_if = "Option::is_none")] + pub mime_type: Option, + /// Text content (e.g. HTML) + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The resource URI (typically ui://...) + pub uri: String, +} + +/// Resource contents returned by the MCP server. +/// +///
+/// +/// **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 McpAppsReadResourceResult { + /// Resource contents returned by the server + pub contents: Vec, +} + +/// Host context advertised to MCP App guests +/// +///
+/// +/// **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 McpAppsSetHostContextDetails { + /// Display modes the host supports + #[serde(default)] + pub available_display_modes: Vec, + /// Current display mode (SEP-1865) + #[serde(skip_serializing_if = "Option::is_none")] + pub display_mode: Option, + /// BCP-47 locale, e.g. 'en-US' + #[serde(skip_serializing_if = "Option::is_none")] + pub locale: Option, + /// Platform type for responsive design + #[serde(skip_serializing_if = "Option::is_none")] + pub platform: Option, + /// UI theme preference per SEP-1865 + #[serde(skip_serializing_if = "Option::is_none")] + pub theme: Option, + /// IANA timezone, e.g. 'America/New_York' + #[serde(skip_serializing_if = "Option::is_none")] + pub time_zone: Option, + /// Host application identifier + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} + +/// Host context to advertise to MCP App guests. +/// +///
+/// +/// **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 McpAppsSetHostContextRequest { + /// Host context advertised to MCP App guests + pub context: McpAppsSetHostContextDetails, +} + /// The requestId previously passed to executeSampling that should be cancelled. /// ///
@@ -2294,18 +2592,6 @@ pub struct McpExecuteSamplingParams { pub server_name: String, } -/// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape. -/// -///
-/// -/// **Experimental.** 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 McpExecuteSamplingResult {} - /// Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, and the callback success-page copy. /// ///
@@ -2770,6 +3056,24 @@ pub struct MetadataSnapshotRemoteMetadata { pub task_type: Option, } +/// Long context tier pricing (available for models with extended context windows) +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelBillingTokenPricesLongContext { + /// AI Credits cost per billing batch of cached tokens + #[serde(skip_serializing_if = "Option::is_none")] + pub cache_price: Option, + /// Maximum context window tokens for the long context tier + #[serde(skip_serializing_if = "Option::is_none")] + pub context_max: Option, + /// AI Credits cost per billing batch of input tokens + #[serde(skip_serializing_if = "Option::is_none")] + pub input_price: Option, + /// AI Credits cost per billing batch of output tokens + #[serde(skip_serializing_if = "Option::is_none")] + pub output_price: Option, +} + /// Token-level pricing information for this model #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -2777,15 +3081,21 @@ pub struct ModelBillingTokenPrices { /// Number of tokens per standard billing batch #[serde(skip_serializing_if = "Option::is_none")] pub batch_size: Option, - /// Price per billing batch of cached tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) + /// AI Credits cost per billing batch of cached tokens #[serde(skip_serializing_if = "Option::is_none")] - pub cache_price: Option, - /// Price per billing batch of input tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) + pub cache_price: Option, + /// Maximum context window tokens for the default tier #[serde(skip_serializing_if = "Option::is_none")] - pub input_price: Option, - /// Price per billing batch of output tokens in nano-AIUs (1 nano-AIU = 0.000000001 AIU, 1 AIU = $0.01 USD) + pub context_max: Option, + /// AI Credits cost per billing batch of input tokens #[serde(skip_serializing_if = "Option::is_none")] - pub output_price: Option, + pub input_price: Option, + /// Long context tier pricing (available for models with extended context windows) + #[serde(skip_serializing_if = "Option::is_none")] + pub long_context: Option, + /// AI Credits cost per billing batch of output tokens + #[serde(skip_serializing_if = "Option::is_none")] + pub output_price: Option, } /// Billing information @@ -9685,6 +9995,83 @@ pub struct SessionMcpOauthLoginResult { pub authorization_url: Option, } +/// Resource contents returned by the MCP server. +/// +///
+/// +/// **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 SessionMcpAppsReadResourceResult { + /// Resource contents returned by the server + pub contents: Vec, +} + +/// App-callable tools from the named MCP server. +/// +///
+/// +/// **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 SessionMcpAppsListToolsResult { + /// App-callable tools from the server + pub tools: Vec>, +} + +/// Identifies the target session. +/// +///
+/// +/// **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 SessionMcpAppsGetHostContextParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Current host context advertised to MCP App guests. +/// +///
+/// +/// **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 SessionMcpAppsGetHostContextResult { + /// Current host context + pub context: McpAppsHostContextDetails, +} + +/// Diagnostic snapshot of MCP Apps wiring for the named server. +/// +///
+/// +/// **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 SessionMcpAppsDiagnoseResult { + /// Capability negotiation snapshot + pub capability: McpAppsDiagnoseCapability, + /// What the server returned for this session + pub server: McpAppsDiagnoseServer, +} + /// Identifies the target session. /// ///
@@ -11020,6 +11407,36 @@ pub struct SessionFsSqliteExistsParams { pub session_id: SessionId, } +/// MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+pub type McpExecuteSamplingResult = HashMap; + +/// The form values submitted by the user (present when action is 'accept') +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+pub type UIElicitationResponseContent = HashMap; + +/// Standard MCP CallToolResult +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+pub type SessionMcpAppsCallToolResult = HashMap; + /// Where the agent definition was loaded from /// ///
@@ -11199,7 +11616,7 @@ pub enum CopilotApiTokenAuthInfoType { CopilotApiToken, } -/// Server transport type: stdio, http, sse, or memory +/// Server transport type: stdio, http, sse (deprecated), or memory #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum DiscoveredMcpServerType { /// Server communicates over stdio with a local child process. @@ -11208,7 +11625,7 @@ pub enum DiscoveredMcpServerType { /// Server communicates over streamable HTTP. #[serde(rename = "http")] Http, - /// Server communicates over Server-Sent Events. + /// Server communicates over Server-Sent Events (deprecated). #[serde(rename = "sse")] Sse, /// Server is backed by an in-memory runtime implementation. @@ -11552,6 +11969,200 @@ pub enum SessionLogLevel { Unknown, } +/// Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration. +/// +///
+/// +/// **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 McpAppsHostContextDetailsAvailableDisplayMode { + /// Rendered inline within the host conversation surface + #[serde(rename = "inline")] + Inline, + /// Rendered as a fullscreen overlay + #[serde(rename = "fullscreen")] + Fullscreen, + /// Rendered as a picture-in-picture floating panel + #[serde(rename = "pip")] + Pip, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Current display mode (SEP-1865) +/// +///
+/// +/// **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 McpAppsHostContextDetailsDisplayMode { + /// Rendered inline within the host conversation surface + #[serde(rename = "inline")] + Inline, + /// Rendered as a fullscreen overlay + #[serde(rename = "fullscreen")] + Fullscreen, + /// Rendered as a picture-in-picture floating panel + #[serde(rename = "pip")] + Pip, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Platform type for responsive design +/// +///
+/// +/// **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 McpAppsHostContextDetailsPlatform { + /// Host runs in a web browser + #[serde(rename = "web")] + Web, + /// Host runs as a desktop application + #[serde(rename = "desktop")] + Desktop, + /// Host runs on a mobile device + #[serde(rename = "mobile")] + Mobile, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// UI theme preference per SEP-1865 +/// +///
+/// +/// **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 McpAppsHostContextDetailsTheme { + /// Light UI theme + #[serde(rename = "light")] + Light, + /// Dark UI theme + #[serde(rename = "dark")] + Dark, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration. +/// +///
+/// +/// **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 McpAppsSetHostContextDetailsAvailableDisplayMode { + /// Rendered inline within the host conversation surface + #[serde(rename = "inline")] + Inline, + /// Rendered as a fullscreen overlay + #[serde(rename = "fullscreen")] + Fullscreen, + /// Rendered as a picture-in-picture floating panel + #[serde(rename = "pip")] + Pip, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Current display mode (SEP-1865) +/// +///
+/// +/// **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 McpAppsSetHostContextDetailsDisplayMode { + /// Rendered inline within the host conversation surface + #[serde(rename = "inline")] + Inline, + /// Rendered as a fullscreen overlay + #[serde(rename = "fullscreen")] + Fullscreen, + /// Rendered as a picture-in-picture floating panel + #[serde(rename = "pip")] + Pip, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// Platform type for responsive design +/// +///
+/// +/// **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 McpAppsSetHostContextDetailsPlatform { + /// Host runs in a web browser + #[serde(rename = "web")] + Web, + /// Host runs as a desktop application + #[serde(rename = "desktop")] + Desktop, + /// Host runs on a mobile device + #[serde(rename = "mobile")] + Mobile, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// UI theme preference per SEP-1865 +/// +///
+/// +/// **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 McpAppsSetHostContextDetailsTheme { + /// Light UI theme + #[serde(rename = "light")] + Light, + /// Dark UI theme + #[serde(rename = "dark")] + Dark, + /// 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. /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index f8d2ecb30..20dc48e80 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -2444,6 +2444,13 @@ pub struct SessionRpcMcp<'a> { } impl<'a> SessionRpcMcp<'a> { + /// `session.mcp.apps.*` sub-namespace. + pub fn apps(&self) -> SessionRpcMcpApps<'a> { + SessionRpcMcpApps { + session: self.session, + } + } + /// `session.mcp.oauth.*` sub-namespace. pub fn oauth(&self) -> SessionRpcMcpOauth<'a> { SessionRpcMcpOauth { @@ -2677,6 +2684,209 @@ impl<'a> SessionRpcMcp<'a> { } } +/// `session.mcp.apps.*` RPCs. +#[derive(Clone, Copy)] +pub struct SessionRpcMcpApps<'a> { + pub(crate) session: &'a Session, +} + +impl<'a> SessionRpcMcpApps<'a> { + /// Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability. + /// + /// Wire method: `session.mcp.apps.readResource`. + /// + /// # Parameters + /// + /// * `params` - MCP server and resource URI to fetch. + /// + /// # Returns + /// + /// Resource contents returned by the MCP server. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn read_resource( + &self, + params: McpAppsReadResourceRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_MCP_APPS_READRESOURCE, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`. + /// + /// Wire method: `session.mcp.apps.listTools`. + /// + /// # Parameters + /// + /// * `params` - MCP server to list app-callable tools for. + /// + /// # Returns + /// + /// App-callable tools from the named MCP server. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn list_tools( + &self, + params: McpAppsListToolsRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_MCP_APPS_LISTTOOLS, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`. + /// + /// Wire method: `session.mcp.apps.callTool`. + /// + /// # Parameters + /// + /// * `params` - MCP server, tool name, and arguments to invoke from an MCP App view. + /// + /// # Returns + /// + /// Standard MCP CallToolResult + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn call_tool( + &self, + params: McpAppsCallToolRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_MCP_APPS_CALLTOOL, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI. + /// + /// Wire method: `session.mcp.apps.setHostContext`. + /// + /// # Parameters + /// + /// * `params` - Host context to advertise to MCP App guests. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn set_host_context( + &self, + params: McpAppsSetHostContextRequest, + ) -> Result<(), Error> { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_MCP_APPS_SETHOSTCONTEXT, + Some(wire_params), + ) + .await?; + Ok(()) + } + + /// Read the current host context advertised to MCP App guests. + /// + /// Wire method: `session.mcp.apps.getHostContext`. + /// + /// # Returns + /// + /// Current host context advertised to MCP App guests. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn get_host_context(&self) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_MCP_APPS_GETHOSTCONTEXT, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, feature-flag state, advertised extension, and how many tools have `_meta.ui` populated. + /// + /// Wire method: `session.mcp.apps.diagnose`. + /// + /// # Parameters + /// + /// * `params` - MCP server to diagnose MCP Apps wiring for. + /// + /// # Returns + /// + /// Diagnostic snapshot of MCP Apps wiring for the named server. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn diagnose( + &self, + params: McpAppsDiagnoseRequest, + ) -> Result { + let mut wire_params = serde_json::to_value(params)?; + wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string()); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_MCP_APPS_DIAGNOSE, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } +} + /// `session.mcp.oauth.*` RPCs. #[derive(Clone, Copy)] pub struct SessionRpcMcpOauth<'a> { diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 20a123cd1..5e78c6932 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -171,6 +171,8 @@ pub enum SessionEventType { SessionMcpServerStatusChanged, #[serde(rename = "session.extensions_loaded")] SessionExtensionsLoaded, + #[serde(rename = "mcp_app.tool_call_complete")] + McpAppToolCallComplete, /// Unknown event type for forward compatibility. #[default] #[serde(other)] @@ -345,6 +347,8 @@ pub enum SessionEventData { SessionMcpServerStatusChanged(SessionMcpServerStatusChangedData), #[serde(rename = "session.extensions_loaded")] SessionExtensionsLoaded(SessionExtensionsLoadedData), + #[serde(rename = "mcp_app.tool_call_complete")] + McpAppToolCallComplete(McpAppToolCallCompleteData), } /// A session event with typed data payload. @@ -499,6 +503,9 @@ pub struct SessionErrorData { /// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs #[serde(skip_serializing_if = "Option::is_none")] pub provider_call_id: Option, + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + #[serde(skip_serializing_if = "Option::is_none")] + pub service_request_id: Option, /// Error stack trace, when available #[serde(skip_serializing_if = "Option::is_none")] pub stack: Option, @@ -589,6 +596,9 @@ pub struct SessionModelChangeData { /// Reason the change happened, when not user-initiated. Currently `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy. #[serde(skip_serializing_if = "Option::is_none")] pub cause: Option, + /// Context tier after the model change; null explicitly clears a previously selected tier + #[serde(skip_serializing_if = "Option::is_none")] + pub context_tier: Option, /// Newly selected model identifier pub new_model: String, /// Model that was previously selected, if any @@ -1008,6 +1018,9 @@ pub struct SessionCompactionCompleteData { /// GitHub request tracing ID (x-github-request-id header) for the compaction LLM call #[serde(skip_serializing_if = "Option::is_none")] pub request_id: Option, + /// 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, /// Whether compaction completed successfully pub success: bool, /// LLM-generated summary of the compacted conversation history @@ -1208,6 +1221,9 @@ pub struct AssistantMessageData { /// GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs #[serde(skip_serializing_if = "Option::is_none")] pub request_id: Option, + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + #[serde(skip_serializing_if = "Option::is_none")] + pub service_request_id: Option, /// Tool invocations requested by the assistant in this message #[serde(default)] pub tool_requests: Vec, @@ -1370,6 +1386,9 @@ pub struct AssistantUsageData { /// Number of output tokens used for reasoning (e.g., chain-of-thought) #[serde(skip_serializing_if = "Option::is_none")] pub reasoning_tokens: Option, + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + #[serde(skip_serializing_if = "Option::is_none")] + pub service_request_id: Option, /// Time to first token in milliseconds. Only available for streaming requests #[serde(skip_serializing_if = "Option::is_none")] pub time_to_first_token_ms: Option, @@ -1397,6 +1416,9 @@ 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, + /// Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation + #[serde(skip_serializing_if = "Option::is_none")] + pub service_request_id: Option, /// Where the failed model call originated pub source: ModelCallFailureSource, /// HTTP status code from the failed request @@ -1613,6 +1635,102 @@ pub struct ToolExecutionCompleteContentResource { pub r#type: ToolExecutionCompleteContentResourceType, } +/// Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResourceMetaUICsp { + #[serde(default)] + pub base_uri_domains: Vec, + #[serde(default)] + pub connect_domains: Vec, + #[serde(default)] + pub frame_domains: Vec, + #[serde(default)] + pub resource_domains: Vec, +} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResourceMetaUIPermissionsCamera {} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite {} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation {} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone {} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResourceMetaUIPermissions { + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub camera: Option, + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub clipboard_write: Option, + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub geolocation: Option, + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub microphone: Option, +} + +/// Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResourceMetaUI { + /// Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub csp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub domain: Option, + /// Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub prefers_border: Option, +} + +/// Resource-level UI metadata (CSP, permissions, visual preferences) +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResourceMeta { + /// Schema for the `ToolExecutionCompleteUIResourceMetaUI` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub ui: Option, +} + +/// MCP Apps UI resource content for rendering in a sandboxed iframe +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteUIResource { + /// Resource-level UI metadata (CSP, permissions, visual preferences) + #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] + pub meta: Option, + /// Base64-encoded HTML content + #[serde(skip_serializing_if = "Option::is_none")] + pub blob: Option, + /// MIME type of the content + pub mime_type: String, + /// HTML content as a string + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The ui:// URI of the resource + pub uri: String, +} + /// Tool execution result on success #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -1625,6 +1743,44 @@ pub struct ToolExecutionCompleteResult { /// Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent. #[serde(skip_serializing_if = "Option::is_none")] pub detailed_content: Option, + /// MCP Apps UI resource content for rendering in a sandboxed iframe + #[serde(skip_serializing_if = "Option::is_none")] + pub ui_resource: Option, +} + +/// Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteToolDescriptionMetaUI { + /// URI of the UI resource + #[serde(skip_serializing_if = "Option::is_none")] + pub resource_uri: Option, + /// Who can access this tool + #[serde(default)] + pub visibility: Vec, +} + +/// MCP Apps metadata for UI resource association +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteToolDescriptionMeta { + /// Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub ui: Option, +} + +/// Tool definition metadata, present for MCP tools with MCP Apps support +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolExecutionCompleteToolDescription { + /// MCP Apps metadata for UI resource association + #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] + pub meta: Option, + /// Tool description + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Tool name + pub name: String, } /// Session event "tool.execution_complete". Tool execution completion results including success status, detailed output, and error information @@ -1658,6 +1814,9 @@ pub struct ToolExecutionCompleteData { pub success: bool, /// Unique identifier for the completed tool call pub tool_call_id: String, + /// Tool definition metadata, present for MCP tools with MCP Apps support + #[serde(skip_serializing_if = "Option::is_none")] + pub tool_description: Option, /// Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts) #[serde(default)] pub tool_telemetry: HashMap, @@ -1688,6 +1847,12 @@ pub struct SkillInvokedData { /// Version of the plugin this skill originated from, when applicable #[serde(skip_serializing_if = "Option::is_none")] pub plugin_version: Option, + /// Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), personal-claude (~/.claude/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill) + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, + /// What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) + #[serde(skip_serializing_if = "Option::is_none")] + pub trigger: Option, } /// Session event "subagent.started". Sub-agent startup details including parent tool call and agent information @@ -2763,6 +2928,9 @@ pub struct CapabilitiesChangedUI { /// Whether elicitation is now supported #[serde(skip_serializing_if = "Option::is_none")] pub elicitation: Option, + /// Whether MCP Apps (SEP-1865) UI passthrough is now supported + #[serde(skip_serializing_if = "Option::is_none")] + pub mcp_apps: Option, } /// Session event "capabilities.changed". Session capability change notification @@ -2894,11 +3062,20 @@ pub struct McpServersLoadedServer { pub error: Option, /// Server name (config key) pub name: String, + /// Name of the plugin that supplied the effective MCP server config, only when source is plugin + #[serde(skip_serializing_if = "Option::is_none")] + pub plugin_name: Option, + /// Version of the plugin that supplied the effective MCP server config, only when source is plugin + #[serde(skip_serializing_if = "Option::is_none")] + pub plugin_version: Option, /// Configuration source: user, workspace, plugin, or builtin #[serde(skip_serializing_if = "Option::is_none")] pub source: Option, /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured pub status: McpServerStatus, + /// Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) + #[serde(skip_serializing_if = "Option::is_none")] + pub transport: Option, } /// Session event "session.mcp_servers_loaded". @@ -2913,6 +3090,9 @@ pub struct SessionMcpServersLoadedData { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionMcpServerStatusChangedData { + /// Error message if the server entered a failed state + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, /// Name of the MCP server whose status changed pub server_name: String, /// Connection status: connected, failed, needs-auth, pending, disabled, or not_configured @@ -2941,6 +3121,61 @@ pub struct SessionExtensionsLoadedData { pub extensions: Vec, } +/// Set when the underlying tools/call threw an error before returning a CallToolResult +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpAppToolCallCompleteError { + /// Human-readable error message + pub message: String, +} + +/// Schema for the `McpAppToolCallCompleteToolMetaUI` type. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpAppToolCallCompleteToolMetaUI { + /// `ui://` URI declared by the tool's `_meta.ui.resourceUri` + #[serde(skip_serializing_if = "Option::is_none")] + pub resource_uri: Option, + /// Tool visibility per SEP-1865 (typically a subset of `["model","app"]`) + #[serde(default)] + pub visibility: Vec, +} + +/// The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpAppToolCallCompleteToolMeta { + /// Schema for the `McpAppToolCallCompleteToolMetaUI` type. + #[serde(skip_serializing_if = "Option::is_none")] + pub ui: Option, +} + +/// Session event "mcp_app.tool_call_complete". MCP App view called a tool on a connected MCP server (SEP-1865) +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpAppToolCallCompleteData { + /// Arguments passed to the tool by the app view, if any + #[serde(default)] + pub arguments: HashMap, + /// Wall-clock duration of the underlying tools/call in milliseconds + pub duration_ms: f64, + /// Set when the underlying tools/call threw an error before returning a CallToolResult + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Standard MCP CallToolResult returned by the server. Present whether or not the call set isError. + #[serde(default)] + pub result: HashMap, + /// Name of the MCP server hosting the tool + pub server_name: String, + /// True when the call completed without throwing AND the MCP CallToolResult did not set isError + pub success: bool, + /// The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools. + #[serde(skip_serializing_if = "Option::is_none")] + pub tool_meta: Option, + /// MCP tool name that was invoked + pub tool_name: String, +} + /// Hosting platform type of the repository (github or ado) #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum WorkingDirectoryContextHostType { @@ -2974,6 +3209,20 @@ pub enum ReasoningSummary { Unknown, } +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum SessionModelChangeDataContextTier { + /// Default context tier with standard context window size. + #[serde(rename = "default")] + Default, + /// Extended context tier with a larger context window. + #[serde(rename = "long_context")] + LongContext, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// The session mode the agent is operating in #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum SessionMode { @@ -3231,6 +3480,39 @@ pub enum ToolExecutionCompleteContent { Resource(ToolExecutionCompleteContentResource), } +/// Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration. +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ToolExecutionCompleteToolDescriptionMetaUIVisibility { + /// Tool is callable by the model (LLM tool surface) + #[serde(rename = "model")] + Model, + /// Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool + #[serde(rename = "app")] + App, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent) +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum SkillInvokedTrigger { + /// Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. + #[serde(rename = "user-invoked")] + UserInvoked, + /// Skill invocation requested by the agent. + #[serde(rename = "agent-invoked")] + AgentInvoked, + /// Skill content loaded as part of another context, such as a configured custom agent or subagent. + #[serde(rename = "context-load")] + ContextLoad, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Message role: "system" for system prompts, "developer" for developer-injected instructions #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum SystemMessageRole { @@ -3828,6 +4110,27 @@ pub enum McpServerStatus { Unknown, } +/// Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server) +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum McpServerTransport { + /// Server communicates over stdio with a local child process. + #[serde(rename = "stdio")] + Stdio, + /// Server communicates over streamable HTTP. + #[serde(rename = "http")] + Http, + /// Server communicates over Server-Sent Events (deprecated). + #[serde(rename = "sse")] + Sse, + /// Server is backed by an in-memory runtime implementation. + #[serde(rename = "memory")] + Memory, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Discovery source #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum ExtensionsLoadedExtensionSource { diff --git a/scripts/codegen/rust.ts b/scripts/codegen/rust.ts index db3c7792c..e23ff4385 100644 --- a/scripts/codegen/rust.ts +++ b/scripts/codegen/rust.ts @@ -195,6 +195,8 @@ function safeRustFieldName(name: string): string { interface RustCodegenCtx { /** Accumulated struct definitions. */ structs: string[]; + /** Accumulated type alias definitions. */ + typeAliases: string[]; /** Accumulated enum definitions. */ enums: string[]; /** Track generated type names to avoid duplicates. */ @@ -411,6 +413,7 @@ function makeCtx( ): RustCodegenCtx { return { structs: [], + typeAliases: [], enums: [], generatedNames: new Set(), nonDefaultableTypes: new Set(options.nonDefaultableTypes ?? []), @@ -456,6 +459,87 @@ function pushRustDoc(lines: string[], text: string | undefined, indent = ""): vo } } +function isRustMapSchema(schema: JSONSchema7): boolean { + const hasProperties = + !!schema.properties && Object.keys(schema.properties).length > 0; + return ( + (schema.type === "object" || schema.additionalProperties !== undefined) && + !hasProperties && + schema.additionalProperties !== undefined && + schema.additionalProperties !== false + ); +} + +function rustMapValueType( + schema: JSONSchema7, + parentTypeName: string, + ctx: RustCodegenCtx, +): string { + const additionalProperties = schema.additionalProperties; + if ( + additionalProperties && + typeof additionalProperties === "object" && + Object.keys(additionalProperties as Record).length > 0 + ) { + const valueSchema = additionalProperties as JSONSchema7; + if (valueSchema.type === "object" && valueSchema.properties) { + const valueName = (valueSchema.title as string) || `${parentTypeName}Value`; + emitRustStruct(valueName, valueSchema, ctx); + return valueName; + } + return resolveRustType(valueSchema, parentTypeName, "value", true, ctx); + } + return "serde_json::Value"; +} + +function rustMapType( + schema: JSONSchema7, + parentTypeName: string, + ctx: RustCodegenCtx, +): string { + return `HashMap`; +} + +function emitRustTypeAlias( + typeName: string, + schema: JSONSchema7, + aliasType: string, + ctx: RustCodegenCtx, + description?: string, +): void { + if (ctx.generatedNames.has(typeName)) return; + ctx.generatedNames.add(typeName); + + const lines: string[] = []; + pushRustDoc(lines, description || schema.description); + pushRustExperimentalDocs( + lines, + isSchemaExperimental(schema) || ctx.experimentalTypeNames.has(typeName), + ); + if (isSchemaDeprecated(schema)) { + lines.push(...rustDeprecatedAttributes()); + } + const aliasVis = isSchemaInternal(schema) ? "pub(crate)" : "pub"; + lines.push(`${aliasVis} type ${typeName} = ${aliasType};`); + ctx.typeAliases.push(lines.join("\n")); +} + +function emitRustMapAlias( + typeName: string, + schema: JSONSchema7, + ctx: RustCodegenCtx, + description?: string, +): void { + if (ctx.generatedNames.has(typeName)) return; + emitRustTypeAlias( + typeName, + schema, + rustMapType(schema, typeName, ctx), + ctx, + description, + ); +} + function rustRpcResultDescription( method: RpcMethod, resultSchema: JSONSchema7 | undefined, @@ -712,28 +796,8 @@ function resolveRustType( emitRustStruct(structName, propSchema, ctx); return wrapOption(structName, isRequired); } - if (propSchema.additionalProperties) { - if ( - typeof propSchema.additionalProperties === "object" && - Object.keys(propSchema.additionalProperties as Record) - .length > 0 - ) { - const ap = propSchema.additionalProperties as JSONSchema7; - if (ap.type === "object" && ap.properties) { - const valueName = (ap.title as string) || `${nestedName}Value`; - emitRustStruct(valueName, ap, ctx); - return wrapOption(`HashMap`, isRequired); - } - const valueType = resolveRustType( - ap, - parentTypeName, - `${jsonPropName}Value`, - true, - ctx, - ); - return wrapOption(`HashMap`, isRequired); - } - return wrapOption("HashMap", isRequired); + if (isRustMapSchema(propSchema)) { + return wrapOption(rustMapType(propSchema, nestedName, ctx), isRequired); } return wrapOption("serde_json::Value", isRequired); } @@ -1153,6 +1217,12 @@ export function generateSessionEventsCode(schema: JSONSchema7): string { out.push(""); } + // Supporting type aliases + for (const block of ctx.typeAliases) { + out.push(block); + out.push(""); + } + // Supporting enums for (const block of ctx.enums) { out.push(block); @@ -1393,6 +1463,8 @@ function generateApiTypesCode( getEnumValueDescriptions(schema), isSchemaExperimental(schema), ); + } else if (isRustMapSchema(schema)) { + emitRustMapAlias(name, schema, ctx, schema.description); } else if (asGeneratedObjectSchema(schema, defCollections)) { emitRustStruct( name, @@ -1453,6 +1525,8 @@ function generateApiTypesCode( if (resolved) { if (resolved.enum && Array.isArray(resolved.enum)) { // Already generated from definitions + } else if (isRustMapSchema(resolved)) { + emitRustMapAlias(resultName, resolved, ctx, resolved.description); } else if (isObjectSchema(resolved)) { emitRustStruct(resultName, resolved, ctx, resolved.description); } @@ -1503,6 +1577,11 @@ function generateApiTypesCode( out.push(""); } + for (const block of ctx.typeAliases) { + out.push(block); + out.push(""); + } + for (const block of ctx.enums) { out.push(block); out.push(""); diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 3e29965e5..b3692694a 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.52-1", + "@github/copilot": "^1.0.52-4", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", @@ -464,9 +464,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.52-1.tgz", - "integrity": "sha512-oz6m/dOpTU+FaCWXqYZj5JkJmRT+/RYcrmtGal39V+gOxTA2Nc9wIeLH1SMwMoOXC9Q6DN6keiY0wqWcHirPVg==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.52-4.tgz", + "integrity": "sha512-XoVTkovJZgO2i4izgAvzElqKtTwEkenYJ6vpH1X7LCXrp0YWaiS9bhHDuSawhDE721C8CRXRfq8MZ8SKJWhnxw==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -476,20 +476,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.52-1", - "@github/copilot-darwin-x64": "1.0.52-1", - "@github/copilot-linux-arm64": "1.0.52-1", - "@github/copilot-linux-x64": "1.0.52-1", - "@github/copilot-linuxmusl-arm64": "1.0.52-1", - "@github/copilot-linuxmusl-x64": "1.0.52-1", - "@github/copilot-win32-arm64": "1.0.52-1", - "@github/copilot-win32-x64": "1.0.52-1" + "@github/copilot-darwin-arm64": "1.0.52-4", + "@github/copilot-darwin-x64": "1.0.52-4", + "@github/copilot-linux-arm64": "1.0.52-4", + "@github/copilot-linux-x64": "1.0.52-4", + "@github/copilot-linuxmusl-arm64": "1.0.52-4", + "@github/copilot-linuxmusl-x64": "1.0.52-4", + "@github/copilot-win32-arm64": "1.0.52-4", + "@github/copilot-win32-x64": "1.0.52-4" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.52-1.tgz", - "integrity": "sha512-DWXtC/yItZVtkSQhPyRMEkFwa2mcY2rg2cu/uwJ15L9ReiYvlKYEZQDe1TMqkT+U6+k9KjA2L2HQfXVm14/vTw==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.52-4.tgz", + "integrity": "sha512-SGu8mX69aZgbL1/EatAka/AJHOpfxdvh02euHmx0Q4VyvQS8dz++2gVprvaInaUO0i8sjsvniZyqBt1mfWJA/w==", "cpu": [ "arm64" ], @@ -504,9 +504,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.52-1.tgz", - "integrity": "sha512-NFTJkzzlTALMfbj9CDJ7N09PRPTVFq1+71hk+zoNx1uT/pi954liV6tKSaNAihPIXTMQKfJXGwEdjtvACpc8Vg==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.52-4.tgz", + "integrity": "sha512-nO1qy+/V6PJzLCPoOCDqeNiC6yAV25lVI813rw+kfTTvIIhY4GoJWVg8FlL/pjul2DR0S0Zw4JBZyHzyECgQ3Q==", "cpu": [ "x64" ], @@ -521,9 +521,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.52-1.tgz", - "integrity": "sha512-CZE29v+RPJClHgVE1rU+RpRWSG8lm48koRZ0taKVopqLRD6NWKjBOwFKYJojk08H8/K+BWr/paM5+R8hEZHxZw==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.52-4.tgz", + "integrity": "sha512-a+ukt+y9ZzxOft32i1AZZKTnCsvL9nwSRr2viURn0GPO74j6d4J29xGKBYAymmT1L431ToSWxrVo7wHi4TOxgw==", "cpu": [ "arm64" ], @@ -538,9 +538,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.52-1.tgz", - "integrity": "sha512-tJhLQV70TJLq3hPXg7P6pHPfE4vaT2nENIXZsHu6fBkOcsSAxX1APSv6Bkyfsiod8EfFHkcG2+n7VXiVg8WqFw==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.52-4.tgz", + "integrity": "sha512-em34O2QVZWnqAdionbNhkshzmHxxGUed3tp3IU4OSkJr3yVpDRtbsiOYIx+GT+bVY2P1nyRTcAyrvVrle6uf5A==", "cpu": [ "x64" ], @@ -555,9 +555,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.52-1.tgz", - "integrity": "sha512-u24wHsUumldUEPWX/5z5IEuJvixiQEYF82N04P1g65dvOknq+89dpj+GND4Rh3Vr5u13drgj5AJqkJbWB8N+EQ==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.52-4.tgz", + "integrity": "sha512-0oofPJD8brQ1EEexvoFpfkv0qTFTwnJs6M6vIp6GWmSDuI0HGsQGhA2GO0yDPlv8g3sLGM2esSeRYkc/iMXliA==", "cpu": [ "arm64" ], @@ -572,9 +572,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.52-1.tgz", - "integrity": "sha512-wM22FxcHL8NlnesKKQPPvtk4ojqefN7irU5tQcX+IunpD1izVQl7AOXhZyHoQ21zQnN0De8EapxOUc+WnvlxpA==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.52-4.tgz", + "integrity": "sha512-uoWj7Uxt8lth5/LpJgNK/oGuacnsZzZ25X2J4sGTNTMGR+xqCRavHoiUzwrs3w1mprnvO18b1TZKocSQNt/wlQ==", "cpu": [ "x64" ], @@ -589,9 +589,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.52-1.tgz", - "integrity": "sha512-ecvfl9N7DPSwpiT2ZNUSXR1ZrSKwpkByOU6VcNphh4RptPZ0iNfyRNLhFCwSfFz+FvB6z2LZi+F7jSzQ3SaT3w==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.52-4.tgz", + "integrity": "sha512-aNTWW+HhYjA0ultZywv2c+NDiN47ZVf9RS3vQThYKBF2kxUS/gT482wU9A7hqJYgEsF39s/EAYrZOc2AF9eo3Q==", "cpu": [ "arm64" ], @@ -606,9 +606,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.52-1", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.52-1.tgz", - "integrity": "sha512-a9Ct7krktP+/pfPdh/K57deYzzmL13e5Tb1pf5E152u4o/5xKzfgroNFUOzotFfFhs1jFhdzKCm3WHNLIvVEHA==", + "version": "1.0.52-4", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.52-4.tgz", + "integrity": "sha512-7hMKWcALIFuOlb5NJL6BXbCHrfrXS1ZOqcXg9IQji9yJu9IgsFHXno0tOmnOUUupikCNZLPQAZtMj0C18vabRw==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index dddf8fa5f..ecad54d89 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -11,7 +11,7 @@ "test": "vitest run" }, "devDependencies": { - "@github/copilot": "^1.0.52-1", + "@github/copilot": "^1.0.52-4", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14",