diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index 7c33a0ac3..7347f1017 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -6270,13 +6270,17 @@ internal sealed class McpHeadersHandlePendingHeadersRefreshRequestRequest public string SessionId { get; set; } = string.Empty; } -/// MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata. +/// Deprecated/obsolete MCP Apps alias for `McpResourceContent`; use `session.mcp.resources.read` instead. [Experimental(Diagnostics.Experimental)] +[EditorBrowsable(EditorBrowsableState.Never)] +#if NET5_0_OR_GREATER +[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] +#endif public sealed class McpAppsResourceContent { - /// Resource-level metadata (CSP, permissions, etc.). + /// Resource-level metadata. [JsonPropertyName("_meta")] - public IDictionary? _meta { get; set; } + public IDictionary? Meta { get; set; } /// Base64-encoded binary content. [JsonPropertyName("blob")] @@ -6290,13 +6294,17 @@ public sealed class McpAppsResourceContent [JsonPropertyName("text")] public string? Text { get; set; } - /// The resource URI (typically ui://...). + /// The resource URI. [JsonPropertyName("uri")] public string Uri { get; set; } = string.Empty; } -/// Resource contents returned by the MCP server. +/// Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead. [Experimental(Diagnostics.Experimental)] +[EditorBrowsable(EditorBrowsableState.Never)] +#if NET5_0_OR_GREATER +[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] +#endif public sealed class McpAppsReadResourceResult { /// Resource contents returned by the server. @@ -6304,8 +6312,12 @@ public sealed class McpAppsReadResourceResult public IList Contents { get => field ??= []; set; } } -/// MCP server and resource URI to fetch. +/// Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use `session.mcp.resources.read` instead. [Experimental(Diagnostics.Experimental)] +[EditorBrowsable(EditorBrowsableState.Never)] +#if NET5_0_OR_GREATER +[Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] +#endif internal sealed class McpAppsReadResourceRequest { /// Name of the MCP server hosting the resource. @@ -6319,7 +6331,7 @@ internal sealed class McpAppsReadResourceRequest [JsonPropertyName("sessionId")] public string SessionId { get; set; } = string.Empty; - /// Resource URI (typically ui://...). + /// Resource URI. [JsonPropertyName("uri")] public string Uri { get; set; } = string.Empty; } @@ -6551,6 +6563,258 @@ internal sealed class McpAppsDiagnoseRequest public string SessionId { get; set; } = string.Empty; } +/// MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResourceContent +{ + /// 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. + [JsonPropertyName("uri")] + public string Uri { get; set; } = string.Empty; +} + +/// Resource contents returned by the MCP server. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResourcesReadResult +{ + /// 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 McpResourcesReadRequest +{ + /// 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. + [JsonPropertyName("uri")] + public string Uri { get; set; } = string.Empty; +} + +/// Standard MCP resource annotations plus preserved non-standard annotation fields. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResourceAnnotations +{ + /// Server-provided non-standard annotation fields preserved from the MCP response. + [JsonPropertyName("additionalProperties")] + public IDictionary? AdditionalProperties { get; set; } + + /// Intended audience roles for this resource. + [JsonPropertyName("audience")] + public IList? Audience { get; set; } + + /// Last-modified timestamp hint. + [JsonPropertyName("lastModified")] + public string? LastModified { get; set; } + + /// Priority hint for model/client use. + [JsonPropertyName("priority")] + public double? Priority { get; set; } +} + +/// A resource icon descriptor plus preserved non-standard icon fields. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResourceIcon +{ + /// Server-provided non-standard icon fields preserved from the MCP response. + [JsonPropertyName("additionalProperties")] + public IDictionary? AdditionalProperties { get; set; } + + /// Icon MIME type, when known. + [JsonPropertyName("mimeType")] + public string? MimeType { get; set; } + + /// Icon sizes hint. + [JsonPropertyName("sizes")] + public string? Sizes { get; set; } + + /// Icon URI. + [JsonPropertyName("src")] + public string Src { get; set; } = string.Empty; + + /// Theme hint for this icon. + [JsonPropertyName("theme")] + public string? Theme { get; set; } +} + +/// An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResource +{ + /// Resource-level metadata. + [JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// Server-provided non-standard descriptor fields preserved from the MCP response. + [JsonPropertyName("additionalProperties")] + public IDictionary? AdditionalProperties { get; set; } + + /// Model/client annotations associated with this resource. + [JsonPropertyName("annotations")] + public McpResourceAnnotations? Annotations { get; set; } + + /// Optional description of what this resource represents. + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// Icons associated with this resource. + [JsonPropertyName("icons")] + public IList? Icons { get; set; } + + /// MIME type of the resource, if known. + [JsonPropertyName("mimeType")] + public string? MimeType { get; set; } + + /// The programmatic name of the resource. + [JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// Resource size in bytes, when known. + [JsonPropertyName("size")] + public long? Size { get; set; } + + /// Optional human-readable display title. + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// The resource URI (e.g. ui://... or file:///...). + [JsonPropertyName("uri")] + public string Uri { get; set; } = string.Empty; +} + +/// One page of resources advertised by the named MCP server. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResourcesListResult +{ + /// Opaque cursor for the next page, if the server has more resources. + [JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + /// Resources advertised by the server (proxied MCP `resources/list`). + [JsonPropertyName("resources")] + public IList Resources { get => field ??= []; set; } +} + +/// MCP server whose resources to enumerate. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpResourcesListRequest +{ + /// Opaque MCP pagination cursor from a prior `nextCursor` value. + [JsonPropertyName("cursor")] + public string? Cursor { get; set; } + + /// Name of the MCP server whose resources to enumerate. + [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; +} + +/// An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResourceTemplate +{ + /// Resource-template-level metadata. + [JsonPropertyName("_meta")] + public IDictionary? Meta { get; set; } + + /// Server-provided non-standard descriptor fields preserved from the MCP response. + [JsonPropertyName("additionalProperties")] + public IDictionary? AdditionalProperties { get; set; } + + /// Model/client annotations associated with this template. + [JsonPropertyName("annotations")] + public McpResourceAnnotations? Annotations { get; set; } + + /// Optional description of what this template is for. + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// Icons associated with resources matching this template. + [JsonPropertyName("icons")] + public IList? Icons { get; set; } + + /// MIME type for resources matching this template, if uniform. + [JsonPropertyName("mimeType")] + public string? MimeType { get; set; } + + /// The programmatic name of the resource template. + [JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// Optional human-readable display title. + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// An RFC 6570 URI template for constructing resource URIs. + [JsonPropertyName("uriTemplate")] + public string UriTemplate { get; set; } = string.Empty; +} + +/// One page of resource templates advertised by the named MCP server. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResourcesListTemplatesResult +{ + /// Opaque cursor for the next page, if the server has more resource templates. + [JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + /// Resource templates advertised by the server (proxied MCP `resources/templates/list`). + [JsonPropertyName("resourceTemplates")] + public IList ResourceTemplates { get => field ??= []; set; } +} + +/// MCP server whose resource templates to enumerate. +[Experimental(Diagnostics.Experimental)] +internal sealed class McpResourcesListTemplatesRequest +{ + /// Opaque MCP pagination cursor from a prior `nextCursor` value. + [JsonPropertyName("cursor")] + public string? Cursor { get; set; } + + /// Name of the MCP server whose resource templates to enumerate. + [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; +} + /// Session plugin metadata, with name, marketplace, optional version, and enabled state. [Experimental(Diagnostics.Experimental)] public sealed class Plugin @@ -21356,6 +21620,12 @@ public async Task IsServerRunningAsync(string serverNa field ?? Interlocked.CompareExchange(ref field, new(_session), null) ?? field; + + /// Resources APIs. + public McpResourcesApi Resources => + field ?? + Interlocked.CompareExchange(ref field, new(_session), null) ?? + field; } /// Provides session-scoped McpOauth APIs. @@ -21443,11 +21713,15 @@ 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. + /// Deprecated/obsolete alias for `session.mcp.resources.read`; retained for backwards compatibility with earlier MCP Apps host integrations. /// Name of the MCP server hosting the resource. - /// Resource URI (typically ui://...). + /// Resource URI. /// The to monitor for cancellation requests. The default is . - /// Resource contents returned by the MCP server. + /// Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead. + [EditorBrowsable(EditorBrowsableState.Never)] +#if NET5_0_OR_GREATER + [Obsolete("This member is deprecated and will be removed in a future version.", DiagnosticId = "GHCP001")] +#endif public async Task ReadResourceAsync(string serverName, string uri, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(serverName); @@ -21528,6 +21802,61 @@ public async Task DiagnoseAsync(string serverName, Cancel } } +/// Provides session-scoped McpResources APIs. +[Experimental(Diagnostics.Experimental)] +public sealed class McpResourcesApi +{ + private readonly CopilotSession _session; + + internal McpResourcesApi(CopilotSession session) + { + _session = session; + } + + /// Fetch an MCP resource from a connected server by URI (proxies MCP `resources/read`). + /// Name of the MCP server hosting the resource. + /// Resource URI. + /// The to monitor for cancellation requests. The default is . + /// Resource contents returned by the MCP server. + public async Task ReadAsync(string serverName, string uri, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(serverName); + ArgumentNullException.ThrowIfNull(uri); + _session.ThrowIfDisposed(); + + var request = new McpResourcesReadRequest { SessionId = _session.SessionId, ServerName = serverName, Uri = uri }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.resources.read", [request], cancellationToken); + } + + /// Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`. + /// Name of the MCP server whose resources to enumerate. + /// Opaque MCP pagination cursor from a prior `nextCursor` value. + /// The to monitor for cancellation requests. The default is . + /// One page of resources advertised by the named MCP server. + public async Task ListAsync(string serverName, string? cursor = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(serverName); + _session.ThrowIfDisposed(); + + var request = new McpResourcesListRequest { SessionId = _session.SessionId, ServerName = serverName, Cursor = cursor }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.resources.list", [request], cancellationToken); + } + + /// Enumerate one page of resource templates a connected MCP server exposes (proxies MCP `resources/templates/list`). Pass `cursor` to continue from a prior result's `nextCursor`. + /// Name of the MCP server whose resource templates to enumerate. + /// Opaque MCP pagination cursor from a prior `nextCursor` value. + /// The to monitor for cancellation requests. The default is . + /// One page of resource templates advertised by the named MCP server. + public async Task ListTemplatesAsync(string serverName, string? cursor = null, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(serverName); + _session.ThrowIfDisposed(); + + var request = new McpResourcesListTemplatesRequest { SessionId = _session.SessionId, ServerName = serverName, Cursor = cursor }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.mcp.resources.listTemplates", [request], cancellationToken); + } +} + /// Provides session-scoped Plugins APIs. [Experimental(Diagnostics.Experimental)] public sealed class PluginsApi @@ -23458,10 +23787,13 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(GitHub.Copilot.McpOauthRequiredEvent), TypeInfoPropertyName = "SessionEventsMcpOauthRequiredEvent")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthRequiredStaticClientConfig), TypeInfoPropertyName = "SessionEventsMcpOauthRequiredStaticClientConfig")] [JsonSerializable(typeof(GitHub.Copilot.McpOauthWWWAuthenticateParams), TypeInfoPropertyName = "SessionEventsMcpOauthWWWAuthenticateParams")] +[JsonSerializable(typeof(GitHub.Copilot.McpPromptsListChangedEvent), TypeInfoPropertyName = "SessionEventsMcpPromptsListChangedEvent")] +[JsonSerializable(typeof(GitHub.Copilot.McpResourcesListChangedEvent), TypeInfoPropertyName = "SessionEventsMcpResourcesListChangedEvent")] [JsonSerializable(typeof(GitHub.Copilot.McpServerSource), TypeInfoPropertyName = "SessionEventsMcpServerSource")] [JsonSerializable(typeof(GitHub.Copilot.McpServerStatus), TypeInfoPropertyName = "SessionEventsMcpServerStatus")] [JsonSerializable(typeof(GitHub.Copilot.McpServerTransport), TypeInfoPropertyName = "SessionEventsMcpServerTransport")] [JsonSerializable(typeof(GitHub.Copilot.McpServersLoadedServer), TypeInfoPropertyName = "SessionEventsMcpServersLoadedServer")] +[JsonSerializable(typeof(GitHub.Copilot.McpToolsListChangedEvent), TypeInfoPropertyName = "SessionEventsMcpToolsListChangedEvent")] [JsonSerializable(typeof(GitHub.Copilot.ModelCallFailureBadRequestKind), TypeInfoPropertyName = "SessionEventsModelCallFailureBadRequestKind")] [JsonSerializable(typeof(GitHub.Copilot.ModelCallFailureData), TypeInfoPropertyName = "SessionEventsModelCallFailureData")] [JsonSerializable(typeof(GitHub.Copilot.ModelCallFailureEvent), TypeInfoPropertyName = "SessionEventsModelCallFailureEvent")] @@ -23815,6 +24147,17 @@ public static void RegisterClientGlobalApiHandlers(JsonRpc rpc, ClientGlobalApiH [JsonSerializable(typeof(McpRegisterExternalClientRequest))] [JsonSerializable(typeof(McpReloadWithConfigRequest))] [JsonSerializable(typeof(McpRemoveGitHubResult))] +[JsonSerializable(typeof(McpResource))] +[JsonSerializable(typeof(McpResourceAnnotations))] +[JsonSerializable(typeof(McpResourceContent))] +[JsonSerializable(typeof(McpResourceIcon))] +[JsonSerializable(typeof(McpResourceTemplate))] +[JsonSerializable(typeof(McpResourcesListRequest))] +[JsonSerializable(typeof(McpResourcesListResult))] +[JsonSerializable(typeof(McpResourcesListTemplatesRequest))] +[JsonSerializable(typeof(McpResourcesListTemplatesResult))] +[JsonSerializable(typeof(McpResourcesReadRequest))] +[JsonSerializable(typeof(McpResourcesReadResult))] [JsonSerializable(typeof(McpRestartServerRequest))] [JsonSerializable(typeof(McpSamplingExecutionResult))] [JsonSerializable(typeof(McpServer))] diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index f18bc7114..566c037a8 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -58,6 +58,9 @@ namespace GitHub.Copilot; [JsonDerivedType(typeof(McpHeadersRefreshRequiredEvent), "mcp.headers_refresh_required")] [JsonDerivedType(typeof(McpOauthCompletedEvent), "mcp.oauth_completed")] [JsonDerivedType(typeof(McpOauthRequiredEvent), "mcp.oauth_required")] +[JsonDerivedType(typeof(McpPromptsListChangedEvent), "mcp.prompts.list_changed")] +[JsonDerivedType(typeof(McpResourcesListChangedEvent), "mcp.resources.list_changed")] +[JsonDerivedType(typeof(McpToolsListChangedEvent), "mcp.tools.list_changed")] [JsonDerivedType(typeof(ModelCallFailureEvent), "model.call_failure")] [JsonDerivedType(typeof(PendingMessagesModifiedEvent), "pending_messages.modified")] [JsonDerivedType(typeof(PermissionCompletedEvent), "permission.completed")] @@ -1407,6 +1410,45 @@ public sealed partial class SessionMcpServerStatusChangedEvent : SessionEvent public required SessionMcpServerStatusChangedData Data { get; set; } } +/// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +/// Represents the mcp.tools.list_changed event. +public sealed partial class McpToolsListChangedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "mcp.tools.list_changed"; + + /// The mcp.tools.list_changed event payload. + [JsonPropertyName("data")] + public required McpToolsListChangedData Data { get; set; } +} + +/// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +/// Represents the mcp.resources.list_changed event. +public sealed partial class McpResourcesListChangedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "mcp.resources.list_changed"; + + /// The mcp.resources.list_changed event payload. + [JsonPropertyName("data")] + public required McpResourcesListChangedData Data { get; set; } +} + +/// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +/// Represents the mcp.prompts.list_changed event. +public sealed partial class McpPromptsListChangedEvent : SessionEvent +{ + /// + [JsonIgnore] + public override string Type => "mcp.prompts.list_changed"; + + /// The mcp.prompts.list_changed event payload. + [JsonPropertyName("data")] + public required McpPromptsListChangedData Data { get; set; } +} + /// Payload of `session.extensions_loaded` listing discovered extensions and their statuses. /// Represents the session.extensions_loaded event. public sealed partial class SessionExtensionsLoadedEvent : SessionEvent @@ -3933,6 +3975,30 @@ public sealed partial class SessionMcpServerStatusChangedData public required McpServerStatus Status { get; set; } } +/// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +public sealed partial class McpToolsListChangedData +{ + /// Name of the MCP server whose list changed. + [JsonPropertyName("serverName")] + public required string ServerName { get; set; } +} + +/// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +public sealed partial class McpResourcesListChangedData +{ + /// Name of the MCP server whose list changed. + [JsonPropertyName("serverName")] + public required string ServerName { get; set; } +} + +/// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +public sealed partial class McpPromptsListChangedData +{ + /// Name of the MCP server whose list changed. + [JsonPropertyName("serverName")] + public required string ServerName { get; set; } +} + /// Payload of `session.extensions_loaded` listing discovered extensions and their statuses. public sealed partial class SessionExtensionsLoadedData { @@ -5337,7 +5403,7 @@ public sealed partial class ToolExecutionStartToolDescription /// MCP Apps metadata for UI resource association. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("_meta")] - public ToolExecutionStartToolDescriptionMeta? _meta { get; set; } + public ToolExecutionStartToolDescriptionMeta? Meta { get; set; } /// Tool description. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -6023,7 +6089,7 @@ public sealed partial class ToolExecutionCompleteUIResource /// Resource-level UI metadata (CSP, permissions, visual preferences). [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("_meta")] - public ToolExecutionCompleteUIResourceMeta? _meta { get; set; } + public ToolExecutionCompleteUIResourceMeta? Meta { get; set; } /// Base64-encoded HTML content. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -6117,7 +6183,7 @@ public sealed partial class ToolExecutionCompleteToolDescription /// MCP Apps metadata for UI resource association. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonPropertyName("_meta")] - public ToolExecutionCompleteToolDescriptionMeta? _meta { get; set; } + public ToolExecutionCompleteToolDescriptionMeta? Meta { get; set; } /// Tool description. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -11216,7 +11282,13 @@ public override void Write(Utf8JsonWriter writer, ExtensionsLoadedExtensionStatu [JsonSerializable(typeof(McpOauthRequiredEvent))] [JsonSerializable(typeof(McpOauthRequiredStaticClientConfig))] [JsonSerializable(typeof(McpOauthWWWAuthenticateParams))] +[JsonSerializable(typeof(McpPromptsListChangedData))] +[JsonSerializable(typeof(McpPromptsListChangedEvent))] +[JsonSerializable(typeof(McpResourcesListChangedData))] +[JsonSerializable(typeof(McpResourcesListChangedEvent))] [JsonSerializable(typeof(McpServersLoadedServer))] +[JsonSerializable(typeof(McpToolsListChangedData))] +[JsonSerializable(typeof(McpToolsListChangedEvent))] [JsonSerializable(typeof(ModelCallFailureData))] [JsonSerializable(typeof(ModelCallFailureEvent))] [JsonSerializable(typeof(ModelCallFailureRequestFingerprint))] diff --git a/go/rpc/zrpc.go b/go/rpc/zrpc.go index b4b77f758..59232ac3e 100644 --- a/go/rpc/zrpc.go +++ b/go/rpc/zrpc.go @@ -3063,17 +3063,23 @@ type MCPAppsListToolsResult struct { Tools []map[string]any `json:"tools"` } -// MCP server and resource URI to fetch. +// Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use +// `session.mcp.resources.read` instead. // Experimental: MCPAppsReadResourceRequest is part of an experimental API and may change or // be removed. +// Deprecated: MCPAppsReadResourceRequest is deprecated and will be removed in a future +// version. type MCPAppsReadResourceRequest struct { // Name of the MCP server hosting the resource ServerName string `json:"serverName"` - // Resource URI (typically ui://...) + // Resource URI URI string `json:"uri"` } -// Resource contents returned by the MCP server. +// Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use +// `session.mcp.resources.read` instead. +// Deprecated: MCPAppsReadResourceResult is deprecated and will be removed in a future +// version. // Experimental: MCPAppsReadResourceResult is part of an experimental API and may change or // be removed. type MCPAppsReadResourceResult struct { @@ -3081,20 +3087,21 @@ type MCPAppsReadResourceResult struct { Contents []MCPAppsResourceContent `json:"contents"` } -// MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource -// metadata. +// Deprecated/obsolete MCP Apps alias for `McpResourceContent`; use +// `session.mcp.resources.read` instead. +// Deprecated: MCPAppsResourceContent is deprecated and will be removed in a future version. // 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.) + // Resource-level metadata Meta map[string]any `json:"_meta,omitzero"` // 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://...) + // The resource URI URI string `json:"uri"` } @@ -3595,6 +3602,164 @@ type MCPRemoveGitHubResult struct { Removed bool `json:"removed"` } +// An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, +// MIME type, size, icons, annotations, and metadata. Server-provided fields outside the +// standard descriptor shape are exposed under `additionalProperties`. +// Experimental: MCPResource is part of an experimental API and may change or be removed. +type MCPResource struct { + // Server-provided non-standard descriptor fields preserved from the MCP response + AdditionalProperties map[string]any `json:"additionalProperties,omitzero"` + // Model/client annotations associated with this resource + Annotations *MCPResourceAnnotations `json:"annotations,omitempty"` + // Optional description of what this resource represents + Description *string `json:"description,omitempty"` + // Icons associated with this resource + Icons []MCPResourceIcon `json:"icons,omitzero"` + // Resource-level metadata + Meta map[string]any `json:"_meta,omitzero"` + // MIME type of the resource, if known + MIMEType *string `json:"mimeType,omitempty"` + // The programmatic name of the resource + Name string `json:"name"` + // Resource size in bytes, when known + Size *int64 `json:"size,omitempty"` + // Optional human-readable display title + Title *string `json:"title,omitempty"` + // The resource URI (e.g. ui://... or file:///...) + URI string `json:"uri"` +} + +// Standard MCP resource annotations plus preserved non-standard annotation fields. +// Experimental: MCPResourceAnnotations is part of an experimental API and may change or be +// removed. +type MCPResourceAnnotations struct { + // Server-provided non-standard annotation fields preserved from the MCP response + AdditionalProperties map[string]any `json:"additionalProperties,omitzero"` + // Intended audience roles for this resource + Audience []string `json:"audience,omitzero"` + // Last-modified timestamp hint + LastModified *string `json:"lastModified,omitempty"` + // Priority hint for model/client use + Priority *float64 `json:"priority,omitempty"` +} + +// MCP resource content with URI, optional MIME type, text or base64 blob, and resource +// metadata. +// Experimental: MCPResourceContent is part of an experimental API and may change or be +// removed. +type MCPResourceContent struct { + // Base64-encoded binary content + Blob *string `json:"blob,omitempty"` + // Resource-level metadata (CSP, permissions, etc.) + Meta map[string]any `json:"_meta,omitzero"` + // MIME type of the content + MIMEType *string `json:"mimeType,omitempty"` + // Text content (e.g. HTML) + Text *string `json:"text,omitempty"` + // The resource URI + URI string `json:"uri"` +} + +// A resource icon descriptor plus preserved non-standard icon fields. +// Experimental: MCPResourceIcon is part of an experimental API and may change or be removed. +type MCPResourceIcon struct { + // Server-provided non-standard icon fields preserved from the MCP response + AdditionalProperties map[string]any `json:"additionalProperties,omitzero"` + // Icon MIME type, when known + MIMEType *string `json:"mimeType,omitempty"` + // Icon sizes hint + Sizes *string `json:"sizes,omitempty"` + // Icon URI + Src string `json:"src"` + // Theme hint for this icon + Theme *string `json:"theme,omitempty"` +} + +// MCP server whose resources to enumerate. +// Experimental: MCPResourcesListRequest is part of an experimental API and may change or be +// removed. +type MCPResourcesListRequest struct { + // Opaque MCP pagination cursor from a prior `nextCursor` value + Cursor *string `json:"cursor,omitempty"` + // Name of the MCP server whose resources to enumerate + ServerName string `json:"serverName"` +} + +// One page of resources advertised by the named MCP server. +// Experimental: MCPResourcesListResult is part of an experimental API and may change or be +// removed. +type MCPResourcesListResult struct { + // Opaque cursor for the next page, if the server has more resources + NextCursor *string `json:"nextCursor,omitempty"` + // Resources advertised by the server (proxied MCP `resources/list`) + Resources []MCPResource `json:"resources"` +} + +// MCP server whose resource templates to enumerate. +// Experimental: MCPResourcesListTemplatesRequest is part of an experimental API and may +// change or be removed. +type MCPResourcesListTemplatesRequest struct { + // Opaque MCP pagination cursor from a prior `nextCursor` value + Cursor *string `json:"cursor,omitempty"` + // Name of the MCP server whose resource templates to enumerate + ServerName string `json:"serverName"` +} + +// One page of resource templates advertised by the named MCP server. +// Experimental: MCPResourcesListTemplatesResult is part of an experimental API and may +// change or be removed. +type MCPResourcesListTemplatesResult struct { + // Opaque cursor for the next page, if the server has more resource templates + NextCursor *string `json:"nextCursor,omitempty"` + // Resource templates advertised by the server (proxied MCP `resources/templates/list`) + ResourceTemplates []MCPResourceTemplate `json:"resourceTemplates"` +} + +// MCP server and resource URI to fetch. +// Experimental: MCPResourcesReadRequest is part of an experimental API and may change or be +// removed. +type MCPResourcesReadRequest struct { + // Name of the MCP server hosting the resource + ServerName string `json:"serverName"` + // Resource URI + URI string `json:"uri"` +} + +// Resource contents returned by the MCP server. +// Experimental: MCPResourcesReadResult is part of an experimental API and may change or be +// removed. +type MCPResourcesReadResult struct { + // Resource contents returned by the server + Contents []MCPResourceContent `json:"contents"` +} + +// An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, +// name, and optional title, description, MIME type, icons, annotations, and metadata. +// Server-provided fields outside the standard descriptor shape are exposed under +// `additionalProperties`. +// Experimental: MCPResourceTemplate is part of an experimental API and may change or be +// removed. +type MCPResourceTemplate struct { + // Server-provided non-standard descriptor fields preserved from the MCP response + AdditionalProperties map[string]any `json:"additionalProperties,omitzero"` + // Model/client annotations associated with this template + Annotations *MCPResourceAnnotations `json:"annotations,omitempty"` + // Optional description of what this template is for + Description *string `json:"description,omitempty"` + // Icons associated with resources matching this template + Icons []MCPResourceIcon `json:"icons,omitzero"` + // Resource-template-level metadata + Meta map[string]any `json:"_meta,omitzero"` + // MIME type for resources matching this template, if uniform + MIMEType *string `json:"mimeType,omitempty"` + // The programmatic name of the resource template + Name string `json:"name"` + // Optional human-readable display title + Title *string `json:"title,omitempty"` + // An RFC 6570 URI template for constructing resource URIs + URITemplate string `json:"uriTemplate"` +} + // Server name and optional replacement configuration for an individual MCP server restart. // Omit `config` for a config-free restart-by-name of an already-configured server. // Experimental: MCPRestartServerRequest is part of an experimental API and may change or be @@ -15721,14 +15886,17 @@ func (a *MCPAppsAPI) ListTools(ctx context.Context, params *MCPAppsListToolsRequ 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. +// ReadResource deprecated/obsolete alias for `session.mcp.resources.read`; retained for +// backwards compatibility with earlier MCP Apps host integrations. // // RPC method: session.mcp.apps.readResource. // -// Parameters: MCP server and resource URI to fetch. +// Parameters: Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use +// `session.mcp.resources.read` instead. // -// Returns: Resource contents returned by the MCP server. +// Returns: Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use +// `session.mcp.resources.read` instead. +// Deprecated: ReadResource is deprecated and will be removed in a future version. func (a *MCPAppsAPI) ReadResource(ctx context.Context, params *MCPAppsReadResourceRequest) (*MCPAppsReadResourceResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { @@ -15888,6 +16056,93 @@ func (s *MCPAPI) Oauth() *MCPOauthAPI { return (*MCPOauthAPI)(s) } +// Experimental: MCPResourcesAPI contains experimental APIs that may change or be removed. +type MCPResourcesAPI sessionAPI + +// List enumerate one page of resources a connected MCP server exposes (proxies MCP +// `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`. +// +// RPC method: session.mcp.resources.list. +// +// Parameters: MCP server whose resources to enumerate. +// +// Returns: One page of resources advertised by the named MCP server. +func (a *MCPResourcesAPI) List(ctx context.Context, params *MCPResourcesListRequest) (*MCPResourcesListResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + if params.Cursor != nil { + req["cursor"] = *params.Cursor + } + req["serverName"] = params.ServerName + } + raw, err := a.client.Request(ctx, "session.mcp.resources.list", req) + if err != nil { + return nil, err + } + var result MCPResourcesListResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// ListTemplates enumerate one page of resource templates a connected MCP server exposes +// (proxies MCP `resources/templates/list`). Pass `cursor` to continue from a prior result's +// `nextCursor`. +// +// RPC method: session.mcp.resources.listTemplates. +// +// Parameters: MCP server whose resource templates to enumerate. +// +// Returns: One page of resource templates advertised by the named MCP server. +func (a *MCPResourcesAPI) ListTemplates(ctx context.Context, params *MCPResourcesListTemplatesRequest) (*MCPResourcesListTemplatesResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + if params.Cursor != nil { + req["cursor"] = *params.Cursor + } + req["serverName"] = params.ServerName + } + raw, err := a.client.Request(ctx, "session.mcp.resources.listTemplates", req) + if err != nil { + return nil, err + } + var result MCPResourcesListTemplatesResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// Read fetch an MCP resource from a connected server by URI (proxies MCP `resources/read`). +// +// RPC method: session.mcp.resources.read. +// +// Parameters: MCP server and resource URI to fetch. +// +// Returns: Resource contents returned by the MCP server. +func (a *MCPResourcesAPI) Read(ctx context.Context, params *MCPResourcesReadRequest) (*MCPResourcesReadResult, error) { + req := map[string]any{"sessionId": a.sessionID} + if params != nil { + req["serverName"] = params.ServerName + req["uri"] = params.URI + } + raw, err := a.client.Request(ctx, "session.mcp.resources.read", req) + if err != nil { + return nil, err + } + var result MCPResourcesReadResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + +// Experimental: Resources returns experimental APIs that may change or be removed. +func (s *MCPAPI) Resources() *MCPResourcesAPI { + return (*MCPResourcesAPI)(s) +} + // Experimental: MetadataAPI contains experimental APIs that may change or be removed. type MetadataAPI sessionAPI diff --git a/go/rpc/zsession_encoding.go b/go/rpc/zsession_encoding.go index 150dfecae..83e5508a5 100644 --- a/go/rpc/zsession_encoding.go +++ b/go/rpc/zsession_encoding.go @@ -239,6 +239,24 @@ func (e *SessionEvent) UnmarshalJSON(data []byte) error { return err } e.Data = &d + case SessionEventTypeMCPPromptsListChanged: + var d MCPPromptsListChangedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeMCPResourcesListChanged: + var d MCPResourcesListChangedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d + case SessionEventTypeMCPToolsListChanged: + var d MCPToolsListChangedData + if err := json.Unmarshal(raw.Data, &d); err != nil { + return err + } + e.Data = &d case SessionEventTypeModelCallFailure: var d ModelCallFailureData if err := json.Unmarshal(raw.Data, &d); err != nil { diff --git a/go/rpc/zsession_events.go b/go/rpc/zsession_events.go index eeb2663f9..5a4756aeb 100644 --- a/go/rpc/zsession_events.go +++ b/go/rpc/zsession_events.go @@ -87,6 +87,9 @@ const ( SessionEventTypeMCPHeadersRefreshRequired SessionEventType = "mcp.headers_refresh_required" SessionEventTypeMCPOauthCompleted SessionEventType = "mcp.oauth_completed" SessionEventTypeMCPOauthRequired SessionEventType = "mcp.oauth_required" + SessionEventTypeMCPPromptsListChanged SessionEventType = "mcp.prompts.list_changed" + SessionEventTypeMCPResourcesListChanged SessionEventType = "mcp.resources.list_changed" + SessionEventTypeMCPToolsListChanged SessionEventType = "mcp.tools.list_changed" SessionEventTypeModelCallFailure SessionEventType = "model.call_failure" SessionEventTypePendingMessagesModified SessionEventType = "pending_messages.modified" SessionEventTypePermissionCompleted SessionEventType = "permission.completed" @@ -932,6 +935,37 @@ type SessionIdleData struct { func (*SessionIdleData) sessionEventData() {} func (*SessionIdleData) Type() SessionEventType { return SessionEventTypeSessionIdle } +// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +type MCPPromptsListChangedData struct { + // Name of the MCP server whose list changed + ServerName string `json:"serverName"` +} + +func (*MCPPromptsListChangedData) sessionEventData() {} +func (*MCPPromptsListChangedData) Type() SessionEventType { + return SessionEventTypeMCPPromptsListChanged +} + +// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +type MCPResourcesListChangedData struct { + // Name of the MCP server whose list changed + ServerName string `json:"serverName"` +} + +func (*MCPResourcesListChangedData) sessionEventData() {} +func (*MCPResourcesListChangedData) Type() SessionEventType { + return SessionEventTypeMCPResourcesListChanged +} + +// Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +type MCPToolsListChangedData struct { + // Name of the MCP server whose list changed + ServerName string `json:"serverName"` +} + +func (*MCPToolsListChangedData) sessionEventData() {} +func (*MCPToolsListChangedData) Type() SessionEventType { return SessionEventTypeMCPToolsListChanged } + // Payload of `session.canvas.closed` with the closed canvas instance ID, provider ID, and canvas ID. // Experimental: SessionCanvasClosedData is part of an experimental API and may change or be removed. type SessionCanvasClosedData struct { diff --git a/go/zsession_events.go b/go/zsession_events.go index 1c056960c..605236459 100644 --- a/go/zsession_events.go +++ b/go/zsession_events.go @@ -123,10 +123,13 @@ type ( MCPOauthRequiredStaticClientConfig = rpc.MCPOauthRequiredStaticClientConfig MCPOauthRequiredStaticClientConfigGrantType = rpc.MCPOauthRequiredStaticClientConfigGrantType MCPOauthWwwAuthenticateParams = rpc.MCPOauthWwwAuthenticateParams + MCPPromptsListChangedData = rpc.MCPPromptsListChangedData + MCPResourcesListChangedData = rpc.MCPResourcesListChangedData MCPServersLoadedServer = rpc.MCPServersLoadedServer MCPServerSource = rpc.MCPServerSource MCPServerStatus = rpc.MCPServerStatus MCPServerTransport = rpc.MCPServerTransport + MCPToolsListChangedData = rpc.MCPToolsListChangedData ModelCallFailureBadRequestKind = rpc.ModelCallFailureBadRequestKind ModelCallFailureData = rpc.ModelCallFailureData ModelCallFailureRequestFingerprint = rpc.ModelCallFailureRequestFingerprint @@ -539,6 +542,9 @@ const ( SessionEventTypeMCPHeadersRefreshRequired = rpc.SessionEventTypeMCPHeadersRefreshRequired SessionEventTypeMCPOauthCompleted = rpc.SessionEventTypeMCPOauthCompleted SessionEventTypeMCPOauthRequired = rpc.SessionEventTypeMCPOauthRequired + SessionEventTypeMCPPromptsListChanged = rpc.SessionEventTypeMCPPromptsListChanged + SessionEventTypeMCPResourcesListChanged = rpc.SessionEventTypeMCPResourcesListChanged + SessionEventTypeMCPToolsListChanged = rpc.SessionEventTypeMCPToolsListChanged SessionEventTypeModelCallFailure = rpc.SessionEventTypeModelCallFailure SessionEventTypePendingMessagesModified = rpc.SessionEventTypePendingMessagesModified SessionEventTypePermissionCompleted = rpc.SessionEventTypePermissionCompleted diff --git a/java/pom.xml b/java/pom.xml index af3c58816..ddc16e358 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -86,7 +86,7 @@ DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency workflow. --> - ^1.0.70-0 + ^1.0.70 diff --git a/java/scripts/codegen/package-lock.json b/java/scripts/codegen/package-lock.json index 64884a8ec..12a63ef4d 100644 --- a/java/scripts/codegen/package-lock.json +++ b/java/scripts/codegen/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "copilot-sdk-java-codegen", "dependencies": { - "@github/copilot": "^1.0.70-0", + "@github/copilot": "^1.0.70", "json-schema": "^0.4.0", "tsx": "^4.22.4" } @@ -428,9 +428,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.70-0.tgz", - "integrity": "sha512-GPLiKXpwFR11ZISSmTVmVoXj+dwKpQq1foz1rLvSjtzbO/IHQLMJ11CN+o5lkDiERAFtYd70mZf3P/xM05/nQg==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.70.tgz", + "integrity": "sha512-onEwx5tod9t31Lc2rT5ns6s/fY6jtdwVWS3Fzs8hKUjCv7LFIMGf71MLcikl4GBXn6cq44+HVdNzCMWnLjYl3g==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -439,20 +439,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.70-0", - "@github/copilot-darwin-x64": "1.0.70-0", - "@github/copilot-linux-arm64": "1.0.70-0", - "@github/copilot-linux-x64": "1.0.70-0", - "@github/copilot-linuxmusl-arm64": "1.0.70-0", - "@github/copilot-linuxmusl-x64": "1.0.70-0", - "@github/copilot-win32-arm64": "1.0.70-0", - "@github/copilot-win32-x64": "1.0.70-0" + "@github/copilot-darwin-arm64": "1.0.70", + "@github/copilot-darwin-x64": "1.0.70", + "@github/copilot-linux-arm64": "1.0.70", + "@github/copilot-linux-x64": "1.0.70", + "@github/copilot-linuxmusl-arm64": "1.0.70", + "@github/copilot-linuxmusl-x64": "1.0.70", + "@github/copilot-win32-arm64": "1.0.70", + "@github/copilot-win32-x64": "1.0.70" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.70-0.tgz", - "integrity": "sha512-63jLqlVNsX7XMKgEMH4J+lY1zwHCnqapzK1BFEMXgplqvQAJ9q29B83Kskl+i8AGXFpVx+uHRNJIImlkuK3a/g==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.70.tgz", + "integrity": "sha512-NewReqBmTxtAzApZNmUsY4Xqy8N086MiQm7k35i9i+WrGyRiHxdZ/n/lMLCkqWoelr7pZhcZ7gQ7fHbEq1KdoQ==", "cpu": [ "arm64" ], @@ -466,9 +466,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.70-0.tgz", - "integrity": "sha512-uIWb54gh64p0sdaCOv8HZlKjAlrNLiQO3jE6VqbxatZniJ5y3bkWkba/ULuBKgwSLRnZKLSHBhP597JwXsamoQ==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.70.tgz", + "integrity": "sha512-ydUEYI3udNAjdMsLPFQLH/JG9YFKcxuAUxYIyOK+F/m/Of9nODKdYa2hw2mlLanP4cNyuxGLflu+rtIqIb+cPw==", "cpu": [ "x64" ], @@ -482,9 +482,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.70-0.tgz", - "integrity": "sha512-+wa9MDl1a3j1/sTAI1I5UHw9PXwwao0SNczml8pCV78gYqmv6YNaCg2ZKvaajv9vinXkFOH+20VDT5HQk1zhlQ==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.70.tgz", + "integrity": "sha512-EpR3VEEqMy5M9t3cs+6FtjX/AhyfoefzmcMAjBls+RGv1fILjaAby+rhKHzX5YVSxOu9OyQDlQVHK3kxznTU5Q==", "cpu": [ "arm64" ], @@ -498,9 +498,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.70-0.tgz", - "integrity": "sha512-oUy+q4ZgH4lrs0Jsnkf8sQDWEwOPxLNRTGqw3RJ+Cf0hHVxVm4F5mIvO+plmJxe3N70rNDrhxQFQXhboRKqf7w==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.70.tgz", + "integrity": "sha512-4pyNKunm7GEzQZ+09Dwr4BwixJVNcQGBeqiZPKWBGxcSipwj90t8tidLYdNjgmXJoLerANhXZcY52wJW/HubEA==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.70-0.tgz", - "integrity": "sha512-YLtR5MQoORGy82QjrYvtNPDt9FH4XkoVYbMQ2HMYvQrbVghQ+k5FZU3Mx4rnIJR+8qDnE3AGH7JMEgeK87dkQA==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.70.tgz", + "integrity": "sha512-Xy3tDjIMmMkZZzJjCrK5aDCLLV5+pyOfIcT1lWLmqVWJG0erpHXL6KU82nGW+0nc0TPqGZFHvOyQeLuXl+s3ZA==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.70-0.tgz", - "integrity": "sha512-faqw21lOIPmqyLwfYRUeCZ4+TvuvUPsOEb0qh0LI2NL98AtQX123RxBbFMDDC9bnRZ7S/5lZXnpPpn19v+5Vvw==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.70.tgz", + "integrity": "sha512-AHWayI1lVTzxYkNkKrCBOo3XPG+Fb67zcqFivRjGaXG5tr9Bt870LIjIAWoJqQ1Clc3K2PsxyYZ1d8T6vjpWnA==", "cpu": [ "x64" ], @@ -546,9 +546,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.70-0.tgz", - "integrity": "sha512-/Wk+jrK/ogAXs/AIjW60f3pIRj3UHEFRXgbrIoc1R0wIDbVas9/GGrpgrRFf5ldyvvVljedxuuvqvaEe2aFtsA==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.70.tgz", + "integrity": "sha512-oWsWCTlUyIv4S3FdYoBNCscndLrUv+C3qgbfJ9mf+5igPqbIYL8alkc8FBHWPB/cornDNj65yd4s8dZrSkFPpg==", "cpu": [ "arm64" ], @@ -562,9 +562,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.70-0.tgz", - "integrity": "sha512-3fgEEDeswN9Db4qu4NsGe3BAtHHylfFh+jcwlBscSbI4KGEI3cvXcDFoxPcXWi/cajcvt0Tec5/jAJskJI0SNg==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.70.tgz", + "integrity": "sha512-KFDZ750CwhjKF6uATQ1pv1XrYHI+/qTQta954gYZaa+YJEXRstGd284uJ6NI3YXfshZwhTs64JdjN4xLodYwrA==", "cpu": [ "x64" ], diff --git a/java/scripts/codegen/package.json b/java/scripts/codegen/package.json index 55b7bf488..7bb209f52 100644 --- a/java/scripts/codegen/package.json +++ b/java/scripts/codegen/package.json @@ -7,7 +7,7 @@ "generate:java": "tsx java.ts" }, "dependencies": { - "@github/copilot": "^1.0.70-0", + "@github/copilot": "^1.0.70", "json-schema": "^0.4.0", "tsx": "^4.22.4" } diff --git a/java/src/generated/java/com/github/copilot/generated/McpPromptsListChangedEvent.java b/java/src/generated/java/com/github/copilot/generated/McpPromptsListChangedEvent.java new file mode 100644 index 000000000..3f572f087 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/McpPromptsListChangedEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "mcp.prompts.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class McpPromptsListChangedEvent extends SessionEvent { + + @Override + public String getType() { return "mcp.prompts.list_changed"; } + + @JsonProperty("data") + private McpPromptsListChangedEventData data; + + public McpPromptsListChangedEventData getData() { return data; } + public void setData(McpPromptsListChangedEventData data) { this.data = data; } + + /** Data payload for {@link McpPromptsListChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record McpPromptsListChangedEventData( + /** Name of the MCP server whose list changed */ + @JsonProperty("serverName") String serverName + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/McpResourcesListChangedEvent.java b/java/src/generated/java/com/github/copilot/generated/McpResourcesListChangedEvent.java new file mode 100644 index 000000000..5e23be776 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/McpResourcesListChangedEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "mcp.resources.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class McpResourcesListChangedEvent extends SessionEvent { + + @Override + public String getType() { return "mcp.resources.list_changed"; } + + @JsonProperty("data") + private McpResourcesListChangedEventData data; + + public McpResourcesListChangedEventData getData() { return data; } + public void setData(McpResourcesListChangedEventData data) { this.data = data; } + + /** Data payload for {@link McpResourcesListChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record McpResourcesListChangedEventData( + /** Name of the MCP server whose list changed */ + @JsonProperty("serverName") String serverName + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/McpToolsListChangedEvent.java b/java/src/generated/java/com/github/copilot/generated/McpToolsListChangedEvent.java new file mode 100644 index 000000000..ae096303c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/McpToolsListChangedEvent.java @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: session-events.schema.json + +package com.github.copilot.generated; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import javax.annotation.processing.Generated; + +/** + * Session event "mcp.tools.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. + * @since 1.0.0 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class McpToolsListChangedEvent extends SessionEvent { + + @Override + public String getType() { return "mcp.tools.list_changed"; } + + @JsonProperty("data") + private McpToolsListChangedEventData data; + + public McpToolsListChangedEventData getData() { return data; } + public void setData(McpToolsListChangedEventData data) { this.data = data; } + + /** Data payload for {@link McpToolsListChangedEvent}. */ + @JsonIgnoreProperties(ignoreUnknown = true) + @JsonInclude(JsonInclude.Include.NON_NULL) + public record McpToolsListChangedEventData( + /** Name of the MCP server whose list changed */ + @JsonProperty("serverName") String serverName + ) { + } +} diff --git a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java index 49d726344..b6fdc56e9 100644 --- a/java/src/generated/java/com/github/copilot/generated/SessionEvent.java +++ b/java/src/generated/java/com/github/copilot/generated/SessionEvent.java @@ -120,6 +120,9 @@ @JsonSubTypes.Type(value = SessionCustomAgentsUpdatedEvent.class, name = "session.custom_agents_updated"), @JsonSubTypes.Type(value = SessionMcpServersLoadedEvent.class, name = "session.mcp_servers_loaded"), @JsonSubTypes.Type(value = SessionMcpServerStatusChangedEvent.class, name = "session.mcp_server_status_changed"), + @JsonSubTypes.Type(value = McpToolsListChangedEvent.class, name = "mcp.tools.list_changed"), + @JsonSubTypes.Type(value = McpResourcesListChangedEvent.class, name = "mcp.resources.list_changed"), + @JsonSubTypes.Type(value = McpPromptsListChangedEvent.class, name = "mcp.prompts.list_changed"), @JsonSubTypes.Type(value = SessionExtensionsLoadedEvent.class, name = "session.extensions_loaded"), @JsonSubTypes.Type(value = SessionCanvasOpenedEvent.class, name = "session.canvas.opened"), @JsonSubTypes.Type(value = SessionCanvasRegistryChangedEvent.class, name = "session.canvas.registry_changed"), @@ -227,6 +230,9 @@ public abstract sealed class SessionEvent permits SessionCustomAgentsUpdatedEvent, SessionMcpServersLoadedEvent, SessionMcpServerStatusChangedEvent, + McpToolsListChangedEvent, + McpResourcesListChangedEvent, + McpPromptsListChangedEvent, SessionExtensionsLoadedEvent, SessionCanvasOpenedEvent, SessionCanvasRegistryChangedEvent, diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/McpAppsResourceContent.java b/java/src/generated/java/com/github/copilot/generated/rpc/McpAppsResourceContent.java index 0a0f977ff..bf52a9b0e 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/McpAppsResourceContent.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/McpAppsResourceContent.java @@ -14,7 +14,7 @@ import javax.annotation.processing.Generated; /** - * MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata. + * Deprecated/obsolete MCP Apps alias for `McpResourceContent`; use `session.mcp.resources.read` instead. * * @since 1.0.0 */ @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public record McpAppsResourceContent( - /** The resource URI (typically ui://...) */ + /** The resource URI */ @JsonProperty("uri") String uri, /** MIME type of the content */ @JsonProperty("mimeType") String mimeType, @@ -30,7 +30,7 @@ public record McpAppsResourceContent( @JsonProperty("text") String text, /** Base64-encoded binary content */ @JsonProperty("blob") String blob, - /** Resource-level metadata (CSP, permissions, etc.) */ + /** Resource-level metadata */ @JsonProperty("_meta") Map meta ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/McpResource.java b/java/src/generated/java/com/github/copilot/generated/rpc/McpResource.java new file mode 100644 index 000000000..92302772c --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/McpResource.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpResource( + /** The resource URI (e.g. ui://... or file:///...) */ + @JsonProperty("uri") String uri, + /** The programmatic name of the resource */ + @JsonProperty("name") String name, + /** Optional human-readable display title */ + @JsonProperty("title") String title, + /** Optional description of what this resource represents */ + @JsonProperty("description") String description, + /** MIME type of the resource, if known */ + @JsonProperty("mimeType") String mimeType, + /** Resource size in bytes, when known */ + @JsonProperty("size") Long size, + /** Icons associated with this resource */ + @JsonProperty("icons") List icons, + /** Model/client annotations associated with this resource */ + @JsonProperty("annotations") McpResourceAnnotations annotations, + /** Resource-level metadata */ + @JsonProperty("_meta") Map meta, + /** Server-provided non-standard descriptor fields preserved from the MCP response */ + @JsonProperty("additionalProperties") Map additionalProperties +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceAnnotations.java b/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceAnnotations.java new file mode 100644 index 000000000..6cae65957 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceAnnotations.java @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * Standard MCP resource annotations plus preserved non-standard annotation fields. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpResourceAnnotations( + /** Intended audience roles for this resource */ + @JsonProperty("audience") List audience, + /** Priority hint for model/client use */ + @JsonProperty("priority") Double priority, + /** Last-modified timestamp hint */ + @JsonProperty("lastModified") String lastModified, + /** Server-provided non-standard annotation fields preserved from the MCP response */ + @JsonProperty("additionalProperties") Map additionalProperties +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceContent.java b/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceContent.java new file mode 100644 index 000000000..4967286f1 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceContent.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpResourceContent( + /** The resource URI */ + @JsonProperty("uri") String uri, + /** MIME type of the content */ + @JsonProperty("mimeType") String mimeType, + /** Text content (e.g. HTML) */ + @JsonProperty("text") String text, + /** Base64-encoded binary content */ + @JsonProperty("blob") String blob, + /** Resource-level metadata (CSP, permissions, etc.) */ + @JsonProperty("_meta") Map meta +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceIcon.java b/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceIcon.java new file mode 100644 index 000000000..f5a8c68d3 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceIcon.java @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * A resource icon descriptor plus preserved non-standard icon fields. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpResourceIcon( + /** Icon URI */ + @JsonProperty("src") String src, + /** Icon MIME type, when known */ + @JsonProperty("mimeType") String mimeType, + /** Icon sizes hint */ + @JsonProperty("sizes") String sizes, + /** Theme hint for this icon */ + @JsonProperty("theme") String theme, + /** Server-provided non-standard icon fields preserved from the MCP response */ + @JsonProperty("additionalProperties") Map additionalProperties +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceTemplate.java b/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceTemplate.java new file mode 100644 index 000000000..14ffca372 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/McpResourceTemplate.java @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import javax.annotation.processing.Generated; + +/** + * An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record McpResourceTemplate( + /** An RFC 6570 URI template for constructing resource URIs */ + @JsonProperty("uriTemplate") String uriTemplate, + /** The programmatic name of the resource template */ + @JsonProperty("name") String name, + /** Optional human-readable display title */ + @JsonProperty("title") String title, + /** Optional description of what this template is for */ + @JsonProperty("description") String description, + /** MIME type for resources matching this template, if uniform */ + @JsonProperty("mimeType") String mimeType, + /** Icons associated with resources matching this template */ + @JsonProperty("icons") List icons, + /** Model/client annotations associated with this template */ + @JsonProperty("annotations") McpResourceAnnotations annotations, + /** Resource-template-level metadata */ + @JsonProperty("_meta") Map meta, + /** Server-provided non-standard descriptor fields preserved from the MCP response */ + @JsonProperty("additionalProperties") Map additionalProperties +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java index 52b10adb9..172f6e507 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpApi.java @@ -30,6 +30,8 @@ public final class SessionMcpApi { public final SessionMcpHeadersApi headers; /** API methods for the {@code mcp.apps} sub-namespace. */ public final SessionMcpAppsApi apps; + /** API methods for the {@code mcp.resources} sub-namespace. */ + public final SessionMcpResourcesApi resources; /** @param caller the RPC transport function */ SessionMcpApi(RpcCaller caller, String sessionId) { @@ -38,6 +40,7 @@ public final class SessionMcpApi { this.oauth = new SessionMcpOauthApi(caller, sessionId); this.headers = new SessionMcpHeadersApi(caller, sessionId); this.apps = new SessionMcpAppsApi(caller, sessionId); + this.resources = new SessionMcpResourcesApi(caller, sessionId); } /** diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsApi.java index 6b932855b..729c695be 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsApi.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsApi.java @@ -32,7 +32,7 @@ public final class SessionMcpAppsApi { } /** - * MCP server and resource URI to fetch. + * Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use `session.mcp.resources.read` instead. *

* Note: the {@code sessionId} field in the params record is overridden * by the session-scoped wrapper; any value provided is ignored. @@ -40,6 +40,7 @@ public final class SessionMcpAppsApi { * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ + @Deprecated @CopilotExperimental public CompletableFuture readResource(SessionMcpAppsReadResourceParams params) { com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceParams.java index 34e5828aa..35c89e3e8 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceParams.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceParams.java @@ -14,11 +14,12 @@ import javax.annotation.processing.Generated; /** - * MCP server and resource URI to fetch. + * Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use `session.mcp.resources.read` instead. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ +@Deprecated @CopilotExperimental @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) @@ -28,7 +29,7 @@ public record SessionMcpAppsReadResourceParams( @JsonProperty("sessionId") String sessionId, /** Name of the MCP server hosting the resource */ @JsonProperty("serverName") String serverName, - /** Resource URI (typically ui://...) */ + /** Resource URI */ @JsonProperty("uri") String uri ) { } diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceResult.java index 31da3f2be..3009608ff 100644 --- a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceResult.java +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpAppsReadResourceResult.java @@ -15,11 +15,12 @@ import javax.annotation.processing.Generated; /** - * Resource contents returned by the MCP server. + * Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead. * * @apiNote This method is experimental and may change in a future version. * @since 1.0.0 */ +@Deprecated @CopilotExperimental @javax.annotation.processing.Generated("copilot-sdk-codegen") @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesApi.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesApi.java new file mode 100644 index 000000000..c1a30e135 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesApi.java @@ -0,0 +1,81 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.github.copilot.CopilotExperimental; +import java.util.concurrent.CompletableFuture; +import javax.annotation.processing.Generated; + +/** + * API methods for the {@code mcp.resources} namespace. + * + * @since 1.0.0 + */ +@javax.annotation.processing.Generated("copilot-sdk-codegen") +public final class SessionMcpResourcesApi { + + private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER = RpcMapper.INSTANCE; + + private final RpcCaller caller; + private final String sessionId; + + /** @param caller the RPC transport function */ + SessionMcpResourcesApi(RpcCaller caller, String sessionId) { + this.caller = caller; + this.sessionId = sessionId; + } + + /** + * MCP server and resource URI to fetch. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture read(SessionMcpResourcesReadParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.resources.read", _p, SessionMcpResourcesReadResult.class); + } + + /** + * MCP server whose resources to enumerate. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture list(SessionMcpResourcesListParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.resources.list", _p, SessionMcpResourcesListResult.class); + } + + /** + * MCP server whose resource templates to enumerate. + *

+ * Note: the {@code sessionId} field in the params record is overridden + * by the session-scoped wrapper; any value provided is ignored. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ + @CopilotExperimental + public CompletableFuture listTemplates(SessionMcpResourcesListTemplatesParams params) { + com.fasterxml.jackson.databind.node.ObjectNode _p = MAPPER.valueToTree(params); + _p.put("sessionId", this.sessionId); + return caller.invoke("session.mcp.resources.listTemplates", _p, SessionMcpResourcesListTemplatesResult.class); + } + +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListParams.java new file mode 100644 index 000000000..bd8a9de64 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * MCP server whose resources to enumerate. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpResourcesListParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the MCP server whose resources to enumerate */ + @JsonProperty("serverName") String serverName, + /** Opaque MCP pagination cursor from a prior `nextCursor` value */ + @JsonProperty("cursor") String cursor +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListResult.java new file mode 100644 index 000000000..b7e1042cf --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListResult.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * One page of resources advertised by the named MCP server. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpResourcesListResult( + /** Resources advertised by the server (proxied MCP `resources/list`) */ + @JsonProperty("resources") List resources, + /** Opaque cursor for the next page, if the server has more resources */ + @JsonProperty("nextCursor") String nextCursor +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListTemplatesParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListTemplatesParams.java new file mode 100644 index 000000000..a58252c76 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListTemplatesParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * MCP server whose resource templates to enumerate. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpResourcesListTemplatesParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the MCP server whose resource templates to enumerate */ + @JsonProperty("serverName") String serverName, + /** Opaque MCP pagination cursor from a prior `nextCursor` value */ + @JsonProperty("cursor") String cursor +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListTemplatesResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListTemplatesResult.java new file mode 100644 index 000000000..9cb3ff056 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesListTemplatesResult.java @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * One page of resource templates advertised by the named MCP server. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpResourcesListTemplatesResult( + /** Resource templates advertised by the server (proxied MCP `resources/templates/list`) */ + @JsonProperty("resourceTemplates") List resourceTemplates, + /** Opaque cursor for the next page, if the server has more resource templates */ + @JsonProperty("nextCursor") String nextCursor +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesReadParams.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesReadParams.java new file mode 100644 index 000000000..5c7b9d803 --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesReadParams.java @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import javax.annotation.processing.Generated; + +/** + * MCP server and resource URI to fetch. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpResourcesReadParams( + /** Target session identifier */ + @JsonProperty("sessionId") String sessionId, + /** Name of the MCP server hosting the resource */ + @JsonProperty("serverName") String serverName, + /** Resource URI */ + @JsonProperty("uri") String uri +) { +} diff --git a/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesReadResult.java b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesReadResult.java new file mode 100644 index 000000000..7e85574ee --- /dev/null +++ b/java/src/generated/java/com/github/copilot/generated/rpc/SessionMcpResourcesReadResult.java @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------------------------------------------*/ + +// AUTO-GENERATED FILE - DO NOT EDIT +// Generated from: api.schema.json + +package com.github.copilot.generated.rpc; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.copilot.CopilotExperimental; +import java.util.List; +import javax.annotation.processing.Generated; + +/** + * Resource contents returned by the MCP server. + * + * @apiNote This method is experimental and may change in a future version. + * @since 1.0.0 + */ +@CopilotExperimental +@javax.annotation.processing.Generated("copilot-sdk-codegen") +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public record SessionMcpResourcesReadResult( + /** Resource contents returned by the server */ + @JsonProperty("contents") List contents +) { +} diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 351b6e8c7..ba0ad5288 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.70-0", + "@github/copilot": "^1.0.70", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" @@ -700,9 +700,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.70-0.tgz", - "integrity": "sha512-GPLiKXpwFR11ZISSmTVmVoXj+dwKpQq1foz1rLvSjtzbO/IHQLMJ11CN+o5lkDiERAFtYd70mZf3P/xM05/nQg==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.70.tgz", + "integrity": "sha512-onEwx5tod9t31Lc2rT5ns6s/fY6jtdwVWS3Fzs8hKUjCv7LFIMGf71MLcikl4GBXn6cq44+HVdNzCMWnLjYl3g==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -711,20 +711,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.70-0", - "@github/copilot-darwin-x64": "1.0.70-0", - "@github/copilot-linux-arm64": "1.0.70-0", - "@github/copilot-linux-x64": "1.0.70-0", - "@github/copilot-linuxmusl-arm64": "1.0.70-0", - "@github/copilot-linuxmusl-x64": "1.0.70-0", - "@github/copilot-win32-arm64": "1.0.70-0", - "@github/copilot-win32-x64": "1.0.70-0" + "@github/copilot-darwin-arm64": "1.0.70", + "@github/copilot-darwin-x64": "1.0.70", + "@github/copilot-linux-arm64": "1.0.70", + "@github/copilot-linux-x64": "1.0.70", + "@github/copilot-linuxmusl-arm64": "1.0.70", + "@github/copilot-linuxmusl-x64": "1.0.70", + "@github/copilot-win32-arm64": "1.0.70", + "@github/copilot-win32-x64": "1.0.70" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.70-0.tgz", - "integrity": "sha512-63jLqlVNsX7XMKgEMH4J+lY1zwHCnqapzK1BFEMXgplqvQAJ9q29B83Kskl+i8AGXFpVx+uHRNJIImlkuK3a/g==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.70.tgz", + "integrity": "sha512-NewReqBmTxtAzApZNmUsY4Xqy8N086MiQm7k35i9i+WrGyRiHxdZ/n/lMLCkqWoelr7pZhcZ7gQ7fHbEq1KdoQ==", "cpu": [ "arm64" ], @@ -738,9 +738,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.70-0.tgz", - "integrity": "sha512-uIWb54gh64p0sdaCOv8HZlKjAlrNLiQO3jE6VqbxatZniJ5y3bkWkba/ULuBKgwSLRnZKLSHBhP597JwXsamoQ==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.70.tgz", + "integrity": "sha512-ydUEYI3udNAjdMsLPFQLH/JG9YFKcxuAUxYIyOK+F/m/Of9nODKdYa2hw2mlLanP4cNyuxGLflu+rtIqIb+cPw==", "cpu": [ "x64" ], @@ -754,9 +754,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.70-0.tgz", - "integrity": "sha512-+wa9MDl1a3j1/sTAI1I5UHw9PXwwao0SNczml8pCV78gYqmv6YNaCg2ZKvaajv9vinXkFOH+20VDT5HQk1zhlQ==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.70.tgz", + "integrity": "sha512-EpR3VEEqMy5M9t3cs+6FtjX/AhyfoefzmcMAjBls+RGv1fILjaAby+rhKHzX5YVSxOu9OyQDlQVHK3kxznTU5Q==", "cpu": [ "arm64" ], @@ -770,9 +770,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.70-0.tgz", - "integrity": "sha512-oUy+q4ZgH4lrs0Jsnkf8sQDWEwOPxLNRTGqw3RJ+Cf0hHVxVm4F5mIvO+plmJxe3N70rNDrhxQFQXhboRKqf7w==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.70.tgz", + "integrity": "sha512-4pyNKunm7GEzQZ+09Dwr4BwixJVNcQGBeqiZPKWBGxcSipwj90t8tidLYdNjgmXJoLerANhXZcY52wJW/HubEA==", "cpu": [ "x64" ], @@ -786,9 +786,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.70-0.tgz", - "integrity": "sha512-YLtR5MQoORGy82QjrYvtNPDt9FH4XkoVYbMQ2HMYvQrbVghQ+k5FZU3Mx4rnIJR+8qDnE3AGH7JMEgeK87dkQA==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.70.tgz", + "integrity": "sha512-Xy3tDjIMmMkZZzJjCrK5aDCLLV5+pyOfIcT1lWLmqVWJG0erpHXL6KU82nGW+0nc0TPqGZFHvOyQeLuXl+s3ZA==", "cpu": [ "arm64" ], @@ -802,9 +802,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.70-0.tgz", - "integrity": "sha512-faqw21lOIPmqyLwfYRUeCZ4+TvuvUPsOEb0qh0LI2NL98AtQX123RxBbFMDDC9bnRZ7S/5lZXnpPpn19v+5Vvw==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.70.tgz", + "integrity": "sha512-AHWayI1lVTzxYkNkKrCBOo3XPG+Fb67zcqFivRjGaXG5tr9Bt870LIjIAWoJqQ1Clc3K2PsxyYZ1d8T6vjpWnA==", "cpu": [ "x64" ], @@ -818,9 +818,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.70-0.tgz", - "integrity": "sha512-/Wk+jrK/ogAXs/AIjW60f3pIRj3UHEFRXgbrIoc1R0wIDbVas9/GGrpgrRFf5ldyvvVljedxuuvqvaEe2aFtsA==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.70.tgz", + "integrity": "sha512-oWsWCTlUyIv4S3FdYoBNCscndLrUv+C3qgbfJ9mf+5igPqbIYL8alkc8FBHWPB/cornDNj65yd4s8dZrSkFPpg==", "cpu": [ "arm64" ], @@ -834,9 +834,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.70-0.tgz", - "integrity": "sha512-3fgEEDeswN9Db4qu4NsGe3BAtHHylfFh+jcwlBscSbI4KGEI3cvXcDFoxPcXWi/cajcvt0Tec5/jAJskJI0SNg==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.70.tgz", + "integrity": "sha512-KFDZ750CwhjKF6uATQ1pv1XrYHI+/qTQta954gYZaa+YJEXRstGd284uJ6NI3YXfshZwhTs64JdjN4xLodYwrA==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index d622c2bc0..327f7d309 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.70-0", + "@github/copilot": "^1.0.70", "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index 85ec7487c..6c76fa8ea 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,7 +18,8 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.70-0", + "@github/copilot": "^1.0.70", + "koffi": "^3.1.0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 936e47046..c4580d923 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -6009,24 +6009,27 @@ export interface McpAppsListToolsResult { }[]; } /** - * MCP server and resource URI to fetch. + * @deprecated + * Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use `session.mcp.resources.read` instead. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "McpAppsReadResourceRequest". */ /** @experimental */ +/** @deprecated */ export interface McpAppsReadResourceRequest { /** * Name of the MCP server hosting the resource */ serverName: string; /** - * Resource URI (typically ui://...) + * Resource URI */ uri: string; } /** - * Resource contents returned by the MCP server. + * @deprecated + * Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "McpAppsReadResourceResult". @@ -6039,7 +6042,8 @@ export interface McpAppsReadResourceResult { contents: McpAppsResourceContent[]; } /** - * MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata. + * @deprecated + * Deprecated/obsolete MCP Apps alias for `McpResourceContent`; use `session.mcp.resources.read` instead. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "McpAppsResourceContent". @@ -6047,7 +6051,7 @@ export interface McpAppsReadResourceResult { /** @experimental */ export interface McpAppsResourceContent { /** - * The resource URI (typically ui://...) + * The resource URI */ uri: string; /** @@ -6063,7 +6067,7 @@ export interface McpAppsResourceContent { */ blob?: string; /** - * Resource-level metadata (CSP, permissions, etc.) + * Resource-level metadata */ _meta?: { [k: string]: unknown | undefined; @@ -6783,6 +6787,289 @@ export interface McpRemoveGitHubResult { */ removed: boolean; } +/** + * An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResource". + */ +/** @experimental */ +export interface McpResource { + /** + * The resource URI (e.g. ui://... or file:///...) + */ + uri: string; + /** + * The programmatic name of the resource + */ + name: string; + /** + * Optional human-readable display title + */ + title?: string; + /** + * Optional description of what this resource represents + */ + description?: string; + /** + * MIME type of the resource, if known + */ + mimeType?: string; + /** + * Resource size in bytes, when known + */ + size?: number; + /** + * Icons associated with this resource + */ + icons?: McpResourceIcon[]; + annotations?: McpResourceAnnotations; + /** + * Resource-level metadata + */ + _meta?: { + [k: string]: unknown | undefined; + }; + /** + * Server-provided non-standard descriptor fields preserved from the MCP response + */ + additionalProperties?: { + [k: string]: unknown | undefined; + }; +} +/** + * A resource icon descriptor plus preserved non-standard icon fields. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourceIcon". + */ +/** @experimental */ +export interface McpResourceIcon { + /** + * Icon URI + */ + src: string; + /** + * Icon MIME type, when known + */ + mimeType?: string; + /** + * Icon sizes hint + */ + sizes?: string; + /** + * Theme hint for this icon + */ + theme?: string; + /** + * Server-provided non-standard icon fields preserved from the MCP response + */ + additionalProperties?: { + [k: string]: unknown | undefined; + }; +} +/** + * Standard MCP resource annotations plus preserved non-standard annotation fields. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourceAnnotations". + */ +/** @experimental */ +export interface McpResourceAnnotations { + /** + * Intended audience roles for this resource + */ + audience?: string[]; + /** + * Priority hint for model/client use + */ + priority?: number; + /** + * Last-modified timestamp hint + */ + lastModified?: string; + /** + * Server-provided non-standard annotation fields preserved from the MCP response + */ + additionalProperties?: { + [k: string]: unknown | undefined; + }; +} +/** + * MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourceContent". + */ +/** @experimental */ +export interface McpResourceContent { + /** + * The resource URI + */ + 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; + }; +} +/** + * MCP server whose resources to enumerate. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourcesListRequest". + */ +/** @experimental */ +export interface McpResourcesListRequest { + /** + * Name of the MCP server whose resources to enumerate + */ + serverName: string; + /** + * Opaque MCP pagination cursor from a prior `nextCursor` value + */ + cursor?: string; +} +/** + * One page of resources advertised by the named MCP server. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourcesListResult". + */ +/** @experimental */ +export interface McpResourcesListResult { + /** + * Resources advertised by the server (proxied MCP `resources/list`) + */ + resources: McpResource[]; + /** + * Opaque cursor for the next page, if the server has more resources + */ + nextCursor?: string; +} +/** + * MCP server whose resource templates to enumerate. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourcesListTemplatesRequest". + */ +/** @experimental */ +export interface McpResourcesListTemplatesRequest { + /** + * Name of the MCP server whose resource templates to enumerate + */ + serverName: string; + /** + * Opaque MCP pagination cursor from a prior `nextCursor` value + */ + cursor?: string; +} +/** + * One page of resource templates advertised by the named MCP server. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourcesListTemplatesResult". + */ +/** @experimental */ +export interface McpResourcesListTemplatesResult { + /** + * Resource templates advertised by the server (proxied MCP `resources/templates/list`) + */ + resourceTemplates: McpResourceTemplate[]; + /** + * Opaque cursor for the next page, if the server has more resource templates + */ + nextCursor?: string; +} +/** + * An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourceTemplate". + */ +/** @experimental */ +export interface McpResourceTemplate { + /** + * An RFC 6570 URI template for constructing resource URIs + */ + uriTemplate: string; + /** + * The programmatic name of the resource template + */ + name: string; + /** + * Optional human-readable display title + */ + title?: string; + /** + * Optional description of what this template is for + */ + description?: string; + /** + * MIME type for resources matching this template, if uniform + */ + mimeType?: string; + /** + * Icons associated with resources matching this template + */ + icons?: McpResourceIcon[]; + annotations?: McpResourceAnnotations; + /** + * Resource-template-level metadata + */ + _meta?: { + [k: string]: unknown | undefined; + }; + /** + * Server-provided non-standard descriptor fields preserved from the MCP response + */ + additionalProperties?: { + [k: string]: unknown | undefined; + }; +} +/** + * MCP server and resource URI to fetch. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourcesReadRequest". + */ +/** @experimental */ +export interface McpResourcesReadRequest { + /** + * Name of the MCP server hosting the resource + */ + serverName: string; + /** + * Resource URI + */ + uri: string; +} +/** + * Resource contents returned by the MCP server. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "McpResourcesReadResult". + */ +/** @experimental */ +export interface McpResourcesReadResult { + /** + * Resource contents returned by the server + */ + contents: McpResourceContent[]; +} /** * Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server. * @@ -16755,11 +17042,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** @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. + * Deprecated/obsolete alias for `session.mcp.resources.read`; retained for backwards compatibility with earlier MCP Apps host integrations. * - * @param params MCP server and resource URI to fetch. + * @param params Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use `session.mcp.resources.read` instead. * - * @returns Resource contents returned by the MCP server. + * @returns Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead. + * + * @deprecated */ readResource: async (params: McpAppsReadResourceRequest): Promise => connection.sendRequest("session.mcp.apps.readResource", { sessionId, ...params }), @@ -16805,6 +17094,36 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin diagnose: async (params: McpAppsDiagnoseRequest): Promise => connection.sendRequest("session.mcp.apps.diagnose", { sessionId, ...params }), }, + /** @experimental */ + resources: { + /** + * Fetch an MCP resource from a connected server by URI (proxies MCP `resources/read`). + * + * @param params MCP server and resource URI to fetch. + * + * @returns Resource contents returned by the MCP server. + */ + read: async (params: McpResourcesReadRequest): Promise => + connection.sendRequest("session.mcp.resources.read", { sessionId, ...params }), + /** + * Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`. + * + * @param params MCP server whose resources to enumerate. + * + * @returns One page of resources advertised by the named MCP server. + */ + list: async (params: McpResourcesListRequest): Promise => + connection.sendRequest("session.mcp.resources.list", { sessionId, ...params }), + /** + * Enumerate one page of resource templates a connected MCP server exposes (proxies MCP `resources/templates/list`). Pass `cursor` to continue from a prior result's `nextCursor`. + * + * @param params MCP server whose resource templates to enumerate. + * + * @returns One page of resource templates advertised by the named MCP server. + */ + listTemplates: async (params: McpResourcesListTemplatesRequest): Promise => + connection.sendRequest("session.mcp.resources.listTemplates", { sessionId, ...params }), + }, }, /** @experimental */ plugins: { diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 401687b47..f555a8f9a 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -102,6 +102,9 @@ export type SessionEvent = | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent + | McpToolsListChangedEvent + | McpResourcesListChangedEvent + | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent @@ -8406,6 +8409,105 @@ export interface McpServerStatusChangedData { serverName: string; status: McpServerStatus; } +/** + * Session event "mcp.tools.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. + */ +export interface McpToolsListChangedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpListChangedData; + /** + * 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.tools.list_changed". + */ + type: "mcp.tools.list_changed"; +} +/** + * Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. + */ +export interface McpListChangedData { + /** + * Name of the MCP server whose list changed + */ + serverName: string; +} +/** + * Session event "mcp.resources.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. + */ +export interface McpResourcesListChangedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpListChangedData; + /** + * 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.resources.list_changed". + */ + type: "mcp.resources.list_changed"; +} +/** + * Session event "mcp.prompts.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. + */ +export interface McpPromptsListChangedEvent { + /** + * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. + */ + agentId?: string; + data: McpListChangedData; + /** + * 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.prompts.list_changed". + */ + type: "mcp.prompts.list_changed"; +} /** * Session event "session.extensions_loaded". Payload of `session.extensions_loaded` listing discovered extensions and their statuses. */ diff --git a/nodejs/test/session-event-codegen.test.ts b/nodejs/test/session-event-codegen.test.ts index 86c76f71b..14340292b 100644 --- a/nodejs/test/session-event-codegen.test.ts +++ b/nodejs/test/session-event-codegen.test.ts @@ -209,6 +209,38 @@ describe("session event codegen", () => { ); }); + it("drops leading underscores from C# member names while preserving JSON names", () => { + const schema: JSONSchema7 = { + definitions: { + SessionEvent: { + anyOf: [ + { + type: "object", + required: ["type", "data"], + properties: { + type: { const: "session.synthetic" }, + data: { + type: "object", + required: ["_meta"], + properties: { + _meta: { type: "string" }, + }, + }, + }, + }, + ], + }, + }, + }; + + const csharpCode = generateCSharpSessionEventsCode(schema); + + expect(csharpCode).toContain( + '[JsonPropertyName("_meta")]\n public required string Meta { get; set; }' + ); + expect(csharpCode).not.toContain("public required string _meta"); + }); + it("collapses redundant callable wrapper lambdas", () => { const schema: JSONSchema7 = { definitions: { diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 5352b25d1..aeeb00db1 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -3166,15 +3166,17 @@ def to_dict(self) -> dict: return result # Experimental: this type is part of an experimental API and may change or be removed. +# Deprecated: this type is part of a deprecated API and will be removed in a future version. @dataclass class MCPAppsReadResourceRequest: - """MCP server and resource URI to fetch.""" - + """Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use + `session.mcp.resources.read` instead. + """ server_name: str """Name of the MCP server hosting the resource""" uri: str - """Resource URI (typically ui://...)""" + """Resource URI""" @staticmethod def from_dict(obj: Any) -> 'MCPAppsReadResourceRequest': @@ -3192,14 +3194,14 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPAppsResourceContent: - """MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource - metadata. + """Deprecated/obsolete MCP Apps alias for `McpResourceContent`; use + `session.mcp.resources.read` instead. """ uri: str - """The resource URI (typically ui://...)""" + """The resource URI""" meta: dict[str, Any] | None = None - """Resource-level metadata (CSP, permissions, etc.)""" + """Resource-level metadata""" blob: str | None = None """Base64-encoded binary content""" @@ -3741,6 +3743,124 @@ def to_dict(self) -> dict: result["removed"] = from_bool(self.removed) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourceContent: + """MCP resource content with URI, optional MIME type, text or base64 blob, and resource + metadata. + """ + uri: str + """The resource URI""" + + 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) -> 'MCPResourceContent': + 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 MCPResourceContent(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 MCPResourcesListRequest: + """MCP server whose resources to enumerate.""" + + server_name: str + """Name of the MCP server whose resources to enumerate""" + + cursor: str | None = None + """Opaque MCP pagination cursor from a prior `nextCursor` value""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourcesListRequest': + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + cursor = from_union([from_str, from_none], obj.get("cursor")) + return MCPResourcesListRequest(server_name, cursor) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + if self.cursor is not None: + result["cursor"] = from_union([from_str, from_none], self.cursor) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourcesListTemplatesRequest: + """MCP server whose resource templates to enumerate.""" + + server_name: str + """Name of the MCP server whose resource templates to enumerate""" + + cursor: str | None = None + """Opaque MCP pagination cursor from a prior `nextCursor` value""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourcesListTemplatesRequest': + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + cursor = from_union([from_str, from_none], obj.get("cursor")) + return MCPResourcesListTemplatesRequest(server_name, cursor) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + if self.cursor is not None: + result["cursor"] = from_union([from_str, from_none], self.cursor) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourcesReadRequest: + """MCP server and resource URI to fetch.""" + + server_name: str + """Name of the MCP server hosting the resource""" + + uri: str + """Resource URI""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourcesReadRequest': + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + uri = from_str(obj.get("uri")) + return MCPResourcesReadRequest(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. class MCPSamplingExecutionAction(Enum): """Outcome of the sampling inference. 'success' produced a response; 'failure' encountered @@ -11136,6 +11256,49 @@ def to_dict(self) -> dict: ExternalToolTextResultForLlmContentResourceDetails = EmbeddedTextResourceContents | EmbeddedBlobResourceContents +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourceIcon: + """A resource icon descriptor plus preserved non-standard icon fields.""" + + src: str + """Icon URI""" + + additional_properties: dict[str, Any] | None = None + """Server-provided non-standard icon fields preserved from the MCP response""" + + mime_type: str | None = None + """Icon MIME type, when known""" + + sizes: str | None = None + """Icon sizes hint""" + + theme: str | None = None + """Theme hint for this icon""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourceIcon': + assert isinstance(obj, dict) + src = from_str(obj.get("src")) + additional_properties = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("additionalProperties")) + mime_type = from_union([from_str, from_none], obj.get("mimeType")) + sizes = from_union([from_str, from_none], obj.get("sizes")) + theme = from_union([from_str, from_none], obj.get("theme")) + return MCPResourceIcon(src, additional_properties, mime_type, sizes, theme) + + def to_dict(self) -> dict: + result: dict = {} + result["src"] = from_str(self.src) + if self.additional_properties is not None: + result["additionalProperties"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.additional_properties) + if self.mime_type is not None: + result["mimeType"] = from_union([from_str, from_none], self.mime_type) + if self.sizes is not None: + result["sizes"] = from_union([from_str, from_none], self.sizes) + if self.theme is not None: + result["theme"] = from_union([from_str, from_none], self.theme) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ExternalToolTextResultForLlmContentAudio: @@ -12307,8 +12470,9 @@ def to_dict(self) -> dict: # 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.""" - + """Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use + `session.mcp.resources.read` instead. + """ contents: list[MCPAppsResourceContent] """Resource contents returned by the server""" @@ -12836,6 +13000,25 @@ def to_dict(self) -> dict: result["tokenType"] = from_union([from_str, from_none], self.token_type) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourcesReadResult: + """Resource contents returned by the MCP server.""" + + contents: list[MCPResourceContent] + """Resource contents returned by the server""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourcesReadResult': + assert isinstance(obj, dict) + contents = from_list(MCPResourceContent.from_dict, obj.get("contents")) + return MCPResourcesReadResult(contents) + + def to_dict(self) -> dict: + result: dict = {} + result["contents"] = from_list(lambda x: to_class(MCPResourceContent, x), self.contents) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPSamplingExecutionResult: @@ -23008,6 +23191,241 @@ def to_dict(self) -> dict: result["transport"] = self.transport return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourceAnnotations: + """Model/client annotations associated with this resource + + Standard MCP resource annotations plus preserved non-standard annotation fields. + + Model/client annotations associated with this template + """ + additional_properties: dict[str, Any] | None = None + """Server-provided non-standard annotation fields preserved from the MCP response""" + + audience: list[str] | None = None + """Intended audience roles for this resource""" + + last_modified: str | None = None + """Last-modified timestamp hint""" + + priority: float | None = None + """Priority hint for model/client use""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourceAnnotations': + assert isinstance(obj, dict) + additional_properties = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("additionalProperties")) + audience = from_union([lambda x: from_list(from_str, x), from_none], obj.get("audience")) + last_modified = from_union([from_str, from_none], obj.get("lastModified")) + priority = from_union([from_float, from_none], obj.get("priority")) + return MCPResourceAnnotations(additional_properties, audience, last_modified, priority) + + def to_dict(self) -> dict: + result: dict = {} + if self.additional_properties is not None: + result["additionalProperties"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.additional_properties) + if self.audience is not None: + result["audience"] = from_union([lambda x: from_list(from_str, x), from_none], self.audience) + if self.last_modified is not None: + result["lastModified"] = from_union([from_str, from_none], self.last_modified) + if self.priority is not None: + result["priority"] = from_union([to_float, from_none], self.priority) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResource: + """An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, + MIME type, size, icons, annotations, and metadata. Server-provided fields outside the + standard descriptor shape are exposed under `additionalProperties`. + """ + name: str + """The programmatic name of the resource""" + + uri: str + """The resource URI (e.g. ui://... or file:///...)""" + + meta: dict[str, Any] | None = None + """Resource-level metadata""" + + additional_properties: dict[str, Any] | None = None + """Server-provided non-standard descriptor fields preserved from the MCP response""" + + annotations: MCPResourceAnnotations | None = None + """Model/client annotations associated with this resource""" + + description: str | None = None + """Optional description of what this resource represents""" + + icons: list[MCPResourceIcon] | None = None + """Icons associated with this resource""" + + mime_type: str | None = None + """MIME type of the resource, if known""" + + size: int | None = None + """Resource size in bytes, when known""" + + title: str | None = None + """Optional human-readable display title""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResource': + assert isinstance(obj, dict) + name = from_str(obj.get("name")) + uri = from_str(obj.get("uri")) + meta = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("_meta")) + additional_properties = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("additionalProperties")) + annotations = from_union([MCPResourceAnnotations.from_dict, from_none], obj.get("annotations")) + description = from_union([from_str, from_none], obj.get("description")) + icons = from_union([lambda x: from_list(MCPResourceIcon.from_dict, x), from_none], obj.get("icons")) + mime_type = from_union([from_str, from_none], obj.get("mimeType")) + size = from_union([from_int, from_none], obj.get("size")) + title = from_union([from_str, from_none], obj.get("title")) + return MCPResource(name, uri, meta, additional_properties, annotations, description, icons, mime_type, size, title) + + def to_dict(self) -> dict: + result: dict = {} + result["name"] = from_str(self.name) + 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.additional_properties is not None: + result["additionalProperties"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.additional_properties) + if self.annotations is not None: + result["annotations"] = from_union([lambda x: to_class(MCPResourceAnnotations, x), from_none], self.annotations) + if self.description is not None: + result["description"] = from_union([from_str, from_none], self.description) + if self.icons is not None: + result["icons"] = from_union([lambda x: from_list(lambda x: to_class(MCPResourceIcon, x), x), from_none], self.icons) + if self.mime_type is not None: + result["mimeType"] = from_union([from_str, from_none], self.mime_type) + if self.size is not None: + result["size"] = from_union([from_int, from_none], self.size) + if self.title is not None: + result["title"] = from_union([from_str, from_none], self.title) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourceTemplate: + """An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, + name, and optional title, description, MIME type, icons, annotations, and metadata. + Server-provided fields outside the standard descriptor shape are exposed under + `additionalProperties`. + """ + name: str + """The programmatic name of the resource template""" + + uri_template: str + """An RFC 6570 URI template for constructing resource URIs""" + + meta: dict[str, Any] | None = None + """Resource-template-level metadata""" + + additional_properties: dict[str, Any] | None = None + """Server-provided non-standard descriptor fields preserved from the MCP response""" + + annotations: MCPResourceAnnotations | None = None + """Model/client annotations associated with this template""" + + description: str | None = None + """Optional description of what this template is for""" + + icons: list[MCPResourceIcon] | None = None + """Icons associated with resources matching this template""" + + mime_type: str | None = None + """MIME type for resources matching this template, if uniform""" + + title: str | None = None + """Optional human-readable display title""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourceTemplate': + assert isinstance(obj, dict) + name = from_str(obj.get("name")) + uri_template = from_str(obj.get("uriTemplate")) + meta = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("_meta")) + additional_properties = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("additionalProperties")) + annotations = from_union([MCPResourceAnnotations.from_dict, from_none], obj.get("annotations")) + description = from_union([from_str, from_none], obj.get("description")) + icons = from_union([lambda x: from_list(MCPResourceIcon.from_dict, x), from_none], obj.get("icons")) + mime_type = from_union([from_str, from_none], obj.get("mimeType")) + title = from_union([from_str, from_none], obj.get("title")) + return MCPResourceTemplate(name, uri_template, meta, additional_properties, annotations, description, icons, mime_type, title) + + def to_dict(self) -> dict: + result: dict = {} + result["name"] = from_str(self.name) + result["uriTemplate"] = from_str(self.uri_template) + if self.meta is not None: + result["_meta"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.meta) + if self.additional_properties is not None: + result["additionalProperties"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.additional_properties) + if self.annotations is not None: + result["annotations"] = from_union([lambda x: to_class(MCPResourceAnnotations, x), from_none], self.annotations) + if self.description is not None: + result["description"] = from_union([from_str, from_none], self.description) + if self.icons is not None: + result["icons"] = from_union([lambda x: from_list(lambda x: to_class(MCPResourceIcon, x), x), from_none], self.icons) + if self.mime_type is not None: + result["mimeType"] = from_union([from_str, from_none], self.mime_type) + if self.title is not None: + result["title"] = from_union([from_str, from_none], self.title) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourcesListResult: + """One page of resources advertised by the named MCP server.""" + + resources: list[MCPResource] + """Resources advertised by the server (proxied MCP `resources/list`)""" + + next_cursor: str | None = None + """Opaque cursor for the next page, if the server has more resources""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourcesListResult': + assert isinstance(obj, dict) + resources = from_list(MCPResource.from_dict, obj.get("resources")) + next_cursor = from_union([from_str, from_none], obj.get("nextCursor")) + return MCPResourcesListResult(resources, next_cursor) + + def to_dict(self) -> dict: + result: dict = {} + result["resources"] = from_list(lambda x: to_class(MCPResource, x), self.resources) + if self.next_cursor is not None: + result["nextCursor"] = from_union([from_str, from_none], self.next_cursor) + return result + +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class MCPResourcesListTemplatesResult: + """One page of resource templates advertised by the named MCP server.""" + + resource_templates: list[MCPResourceTemplate] + """Resource templates advertised by the server (proxied MCP `resources/templates/list`)""" + + next_cursor: str | None = None + """Opaque cursor for the next page, if the server has more resource templates""" + + @staticmethod + def from_dict(obj: Any) -> 'MCPResourcesListTemplatesResult': + assert isinstance(obj, dict) + resource_templates = from_list(MCPResourceTemplate.from_dict, obj.get("resourceTemplates")) + next_cursor = from_union([from_str, from_none], obj.get("nextCursor")) + return MCPResourcesListTemplatesResult(resource_templates, next_cursor) + + def to_dict(self) -> dict: + result: dict = {} + result["resourceTemplates"] = from_list(lambda x: to_class(MCPResourceTemplate, x), self.resource_templates) + if self.next_cursor is not None: + result["nextCursor"] = from_union([from_str, from_none], self.next_cursor) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MetadataContextInfoRequest: @@ -23948,6 +24366,17 @@ class RPC: mcp_register_external_client_request: MCPRegisterExternalClientRequest mcp_reload_with_config_request: MCPReloadWithConfigRequest mcp_remove_git_hub_result: MCPRemoveGitHubResult + mcp_resource: MCPResource + mcp_resource_annotations: MCPResourceAnnotations + mcp_resource_content: MCPResourceContent + mcp_resource_icon: MCPResourceIcon + mcp_resources_list_request: MCPResourcesListRequest + mcp_resources_list_result: MCPResourcesListResult + mcp_resources_list_templates_request: MCPResourcesListTemplatesRequest + mcp_resources_list_templates_result: MCPResourcesListTemplatesResult + mcp_resources_read_request: MCPResourcesReadRequest + mcp_resources_read_result: MCPResourcesReadResult + mcp_resource_template: MCPResourceTemplate mcp_restart_server_request: MCPRestartServerRequest mcp_sampling_execution_action: MCPSamplingExecutionAction mcp_sampling_execution_result: MCPSamplingExecutionResult @@ -24781,6 +25210,17 @@ def from_dict(obj: Any) -> 'RPC': mcp_register_external_client_request = MCPRegisterExternalClientRequest.from_dict(obj.get("McpRegisterExternalClientRequest")) mcp_reload_with_config_request = MCPReloadWithConfigRequest.from_dict(obj.get("McpReloadWithConfigRequest")) mcp_remove_git_hub_result = MCPRemoveGitHubResult.from_dict(obj.get("McpRemoveGitHubResult")) + mcp_resource = MCPResource.from_dict(obj.get("McpResource")) + mcp_resource_annotations = MCPResourceAnnotations.from_dict(obj.get("McpResourceAnnotations")) + mcp_resource_content = MCPResourceContent.from_dict(obj.get("McpResourceContent")) + mcp_resource_icon = MCPResourceIcon.from_dict(obj.get("McpResourceIcon")) + mcp_resources_list_request = MCPResourcesListRequest.from_dict(obj.get("McpResourcesListRequest")) + mcp_resources_list_result = MCPResourcesListResult.from_dict(obj.get("McpResourcesListResult")) + mcp_resources_list_templates_request = MCPResourcesListTemplatesRequest.from_dict(obj.get("McpResourcesListTemplatesRequest")) + mcp_resources_list_templates_result = MCPResourcesListTemplatesResult.from_dict(obj.get("McpResourcesListTemplatesResult")) + mcp_resources_read_request = MCPResourcesReadRequest.from_dict(obj.get("McpResourcesReadRequest")) + mcp_resources_read_result = MCPResourcesReadResult.from_dict(obj.get("McpResourcesReadResult")) + mcp_resource_template = MCPResourceTemplate.from_dict(obj.get("McpResourceTemplate")) mcp_restart_server_request = MCPRestartServerRequest.from_dict(obj.get("McpRestartServerRequest")) mcp_sampling_execution_action = MCPSamplingExecutionAction(obj.get("McpSamplingExecutionAction")) mcp_sampling_execution_result = MCPSamplingExecutionResult.from_dict(obj.get("McpSamplingExecutionResult")) @@ -25352,7 +25792,7 @@ def from_dict(obj: Any) -> 'RPC': subagent_settings = from_union([SubagentSettings.from_dict, from_none], obj.get("SubagentSettings")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, capi_session_options, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, 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, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_register_external_client_request, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_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_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_allow_all_mode, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, sandbox_config, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_seatbelt, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_auth_status, session_bulk_delete_result, session_capability, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_all_users, account_get_all_users_result, account_get_current_auth_result, account_get_quota_request, account_get_quota_result, account_login_request, account_login_result, account_logout_request, account_logout_result, account_quota_snapshot, adaptive_thinking_support, agent_discovery_path, agent_discovery_path_list, agent_discovery_path_scope, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_registry_live_target_entry, agent_registry_live_target_entry_attention_kind, agent_registry_live_target_entry_kind, agent_registry_live_target_entry_last_terminal_event, agent_registry_live_target_entry_status, agent_registry_log_capture, agent_registry_log_capture_open_error_reason, agent_registry_spawn_error, agent_registry_spawn_permission_mode, agent_registry_spawn_registry_timeout, agent_registry_spawn_request, agent_registry_spawn_result, agent_registry_spawn_spawned, agent_registry_spawn_validation_error, agent_registry_spawn_validation_error_field, agent_registry_spawn_validation_error_reason, agent_reload_result, agents_discover_request, agent_select_request, agent_select_result, agents_get_discovery_paths_request, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, cancel_user_requested_shell_command_result, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, capi_session_options, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, completions_get_trigger_characters_result, completions_request_request, completions_request_result, configure_session_extensions_params, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, context_heaviest_message, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, debug_collect_logs_collected_entry, debug_collect_logs_destination, debug_collect_logs_entry, debug_collect_logs_entry_kind, debug_collect_logs_include, debug_collect_logs_redaction, debug_collect_logs_request, debug_collect_logs_result, debug_collect_logs_result_kind, debug_collect_logs_skipped_entry, debug_collect_logs_source, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_context_push_input, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_shell_exit, 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, git_hub_telemetry_client_info, git_hub_telemetry_event, git_hub_telemetry_notification, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, installed_plugin, installed_plugin_info, installed_plugin_source, installed_plugin_source_git_hub, installed_plugin_source_local, installed_plugin_source_url, instruction_discovery_path, instruction_discovery_path_kind, instruction_discovery_path_list, instruction_discovery_path_location, instructions_discover_request, instructions_get_discovery_paths_request, instructions_get_sources_result, instruction_source, instruction_source_location, instruction_source_type, llm_inference_headers, llm_inference_http_request_chunk_request, llm_inference_http_request_chunk_result, llm_inference_http_request_start_request, llm_inference_http_request_start_result, llm_inference_http_request_start_transport, llm_inference_http_response_chunk_error, llm_inference_http_response_chunk_request, llm_inference_http_response_chunk_result, llm_inference_http_response_start_request, llm_inference_http_response_start_result, llm_inference_set_provider_result, local_session_metadata_value, log_request, log_result, lsp_initialize_request, marketplace_add_result, marketplace_browse_result, marketplace_info, marketplace_list_result, marketplace_plugin_info, marketplace_refresh_entry, marketplace_refresh_result, marketplace_remove_result, mcp_allowed_server, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_configure_git_hub_request, mcp_configure_git_hub_result, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_filtered_server, mcp_headers_handle_pending_headers_refresh_request, mcp_headers_handle_pending_headers_refresh_request_request, mcp_headers_handle_pending_headers_refresh_request_result, mcp_host_state, mcp_is_server_running_request, mcp_is_server_running_result, mcp_list_tools_request, mcp_list_tools_result, mcp_oauth_handle_pending_request, mcp_oauth_handle_pending_result, mcp_oauth_login_grant_type, mcp_oauth_login_request, mcp_oauth_login_result, mcp_oauth_pending_request_response, mcp_register_external_client_request, mcp_reload_with_config_request, mcp_remove_git_hub_result, mcp_resource, mcp_resource_annotations, mcp_resource_content, mcp_resource_icon, mcp_resources_list_request, mcp_resources_list_result, mcp_resources_list_templates_request, mcp_resources_list_templates_result, mcp_resources_read_request, mcp_resources_read_result, mcp_resource_template, mcp_restart_server_request, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_defer_tools, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_failure_info, mcp_server_list, mcp_server_needs_auth_info, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, mcp_start_server_request, mcp_start_servers_result, mcp_stop_server_request, mcp_tools, mcp_unregister_external_client_request, memory_configuration, metadata_context_attribution_result, metadata_context_heaviest_messages_request, metadata_context_heaviest_messages_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_list_request, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, named_provider_config, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_additional_content_exclusion_policy, options_update_additional_content_exclusion_policy_rule, options_update_additional_content_exclusion_policy_rule_source, options_update_additional_content_exclusion_policy_scope, options_update_context_tier, options_update_env_value_mode, options_update_reasoning_summary, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_allow_all_mode, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_allow_all_source, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_read_sql_todos_result, plan_read_sql_todos_with_dependencies_result, plan_sql_todo_dependency, plan_sql_todos_row, plan_update_request, plugin, plugin_install_result, plugin_list, plugin_list_result, plugins_disable_request, plugins_enable_request, plugins_install_request, plugins_marketplaces_add_request, plugins_marketplaces_browse_request, plugins_marketplaces_refresh_request, plugins_marketplaces_remove_request, plugins_reload_request, plugins_uninstall_request, plugins_update_request, plugin_update_all_entry, plugin_update_all_result, plugin_update_result, provider_add_request, provider_add_result, provider_config, provider_config_azure, provider_config_transport, provider_config_type, provider_config_wire_api, provider_endpoint, provider_endpoint_transport, provider_endpoint_type, provider_endpoint_wire_api, provider_get_endpoint_request, provider_model_config, provider_session_token, provider_token_acquire_request, provider_token_acquire_result, push_attachment, push_attachment_blob, push_attachment_directory, push_attachment_file, push_attachment_file_line_range, push_attachment_git_hub_actions_job, push_attachment_git_hub_commit, push_attachment_git_hub_file, push_attachment_git_hub_file_diff, push_attachment_git_hub_file_diff_side, push_attachment_git_hub_reference, push_attachment_git_hub_reference_type, push_attachment_git_hub_release, push_attachment_git_hub_repository, push_attachment_git_hub_snippet, push_attachment_git_hub_tree_comparison, push_attachment_git_hub_tree_comparison_side, push_attachment_git_hub_url, push_attachment_selection, push_attachment_selection_details, push_attachment_selection_details_end, push_attachment_selection_details_start, push_git_hub_repo_ref, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, register_extension_tools_params, register_extension_tools_result, release_event_interest_params, remote_control_config, remote_control_config_existing_mc_session, remote_control_status, remote_control_status_active, remote_control_status_connecting, remote_control_status_error, remote_control_status_off, remote_control_status_result, remote_control_stop_result, remote_control_transfer_result, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_metadata_repository, remote_session_metadata_task_type, remote_session_metadata_value, remote_session_mode, remote_session_repository, sandbox_config, sandbox_config_user_policy, sandbox_config_user_policy_experimental, sandbox_config_user_policy_experimental_seatbelt, sandbox_config_user_policy_filesystem, sandbox_config_user_policy_network, sandbox_config_user_policy_seatbelt, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachments_to_message_params, send_message_item, send_messages_request, send_messages_result, send_mode, send_request, send_result, server_agent_list, server_instruction_source_list, server_skill, server_skill_list, session_activity, session_auth_status, session_bulk_delete_result, session_capability, session_completion_item, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_git_hub, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_entry, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata_snapshot, session_mode, session_model_list, session_open_options, session_open_options_additional_content_exclusion_policy, session_open_options_additional_content_exclusion_policy_rule, session_open_options_additional_content_exclusion_policy_rule_source, session_open_options_additional_content_exclusion_policy_scope, session_open_options_env_value_mode, session_open_options_reasoning_summary, session_open_params, session_open_result, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, session_settings_built_in_tool_availability_snapshot, session_settings_evaluate_predicate_request, session_settings_evaluate_predicate_result, session_settings_job_snapshot, session_settings_model_snapshot, session_settings_online_evaluation_snapshot, session_settings_predicate_name, session_settings_repo_snapshot, session_settings_snapshot, session_settings_validation_snapshot, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_board_entry_count_request, sessions_get_board_entry_count_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_open_attach, sessions_open_cloud, sessions_open_create, sessions_open_handoff, sessions_open_handoff_task_type, sessions_open_progress, sessions_open_progress_status, sessions_open_progress_step, sessions_open_remote, sessions_open_resume, sessions_open_resume_last, sessions_open_status, session_source, sessions_prune_old_request, sessions_register_extension_tools_on_session_options, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, sessions_set_remote_control_steering_request, sessions_start_remote_control_request, sessions_stop_remote_control_request, sessions_transfer_remote_control_request, session_telemetry_engagement, session_update_options_params, session_update_options_result, session_visibility_status, session_working_directory_context, session_working_directory_context_host_type, shell_cancel_user_requested_request, shell_exec_request, shell_exec_result, shell_execute_user_requested_request, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_discovery_path, skill_discovery_path_list, skill_discovery_scope, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_discovery_paths_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_choice, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, subagent_settings_entry, subagent_settings_entry_context_tier, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, tools_update_subagent_settings_result, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_ephemeral_query_request, ui_ephemeral_query_result, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_session_limits_exhausted_request, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_session_limits_exhausted_response, ui_session_limits_exhausted_response_action, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, update_subagent_settings_request, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, user_requested_shell_command_result, user_setting_metadata, user_settings_get_result, user_settings_set_request, user_settings_set_result, visibility_get_result, visibility_set_request, visibility_set_result, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_attribution, session_context_info, subagent_settings, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -25614,6 +26054,17 @@ def to_dict(self) -> dict: result["McpRegisterExternalClientRequest"] = to_class(MCPRegisterExternalClientRequest, self.mcp_register_external_client_request) result["McpReloadWithConfigRequest"] = to_class(MCPReloadWithConfigRequest, self.mcp_reload_with_config_request) result["McpRemoveGitHubResult"] = to_class(MCPRemoveGitHubResult, self.mcp_remove_git_hub_result) + result["McpResource"] = to_class(MCPResource, self.mcp_resource) + result["McpResourceAnnotations"] = to_class(MCPResourceAnnotations, self.mcp_resource_annotations) + result["McpResourceContent"] = to_class(MCPResourceContent, self.mcp_resource_content) + result["McpResourceIcon"] = to_class(MCPResourceIcon, self.mcp_resource_icon) + result["McpResourcesListRequest"] = to_class(MCPResourcesListRequest, self.mcp_resources_list_request) + result["McpResourcesListResult"] = to_class(MCPResourcesListResult, self.mcp_resources_list_result) + result["McpResourcesListTemplatesRequest"] = to_class(MCPResourcesListTemplatesRequest, self.mcp_resources_list_templates_request) + result["McpResourcesListTemplatesResult"] = to_class(MCPResourcesListTemplatesResult, self.mcp_resources_list_templates_result) + result["McpResourcesReadRequest"] = to_class(MCPResourcesReadRequest, self.mcp_resources_read_request) + result["McpResourcesReadResult"] = to_class(MCPResourcesReadResult, self.mcp_resources_read_result) + result["McpResourceTemplate"] = to_class(MCPResourceTemplate, self.mcp_resource_template) result["McpRestartServerRequest"] = to_class(MCPRestartServerRequest, self.mcp_restart_server_request) result["McpSamplingExecutionAction"] = to_enum(MCPSamplingExecutionAction, self.mcp_sampling_execution_action) result["McpSamplingExecutionResult"] = to_class(MCPSamplingExecutionResult, self.mcp_sampling_execution_result) @@ -27438,7 +27889,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): 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." + "Deprecated/obsolete alias for `session.mcp.resources.read`; retained for backwards compatibility with earlier MCP Apps host integrations.\n\nArgs:\n params: Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use `session.mcp.resources.read` instead.\n\nReturns:\n Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead.\n\n.. deprecated:: This API is deprecated and will be removed in a future version." 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))) @@ -27472,6 +27923,31 @@ async def diagnose(self, params: MCPAppsDiagnoseRequest, *, timeout: float | Non 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 McpResourcesApi: + def __init__(self, client: "JsonRpcClient", session_id: str): + self._client = client + self._session_id = session_id + + async def read(self, params: MCPResourcesReadRequest, *, timeout: float | None = None) -> MCPResourcesReadResult: + "Fetch an MCP resource from a connected server by URI (proxies MCP `resources/read`).\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 MCPResourcesReadResult.from_dict(await self._client.request("session.mcp.resources.read", params_dict, **_timeout_kwargs(timeout))) + + async def list(self, params: MCPResourcesListRequest, *, timeout: float | None = None) -> MCPResourcesListResult: + "Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`.\n\nArgs:\n params: MCP server whose resources to enumerate.\n\nReturns:\n One page of resources advertised by 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 MCPResourcesListResult.from_dict(await self._client.request("session.mcp.resources.list", params_dict, **_timeout_kwargs(timeout))) + + async def list_templates(self, params: MCPResourcesListTemplatesRequest, *, timeout: float | None = None) -> MCPResourcesListTemplatesResult: + "Enumerate one page of resource templates a connected MCP server exposes (proxies MCP `resources/templates/list`). Pass `cursor` to continue from a prior result's `nextCursor`.\n\nArgs:\n params: MCP server whose resource templates to enumerate.\n\nReturns:\n One page of resource templates advertised by 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 MCPResourcesListTemplatesResult.from_dict(await self._client.request("session.mcp.resources.listTemplates", 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): @@ -27480,6 +27956,7 @@ def __init__(self, client: "JsonRpcClient", session_id: str): self.oauth = McpOauthApi(client, session_id) self.headers = McpHeadersApi(client, session_id) self.apps = McpAppsApi(client, session_id) + self.resources = McpResourcesApi(client, session_id) async def list(self, *, timeout: float | None = None) -> MCPServerList: "Lists MCP servers configured for the session, their connection status, and host-level state. The host-level state (disabled/filtered servers, failed/needs-auth/pending connections, mcp3p policy, full config) is empty/zero when no MCP host has been initialized for the session.\n\nReturns:\n MCP servers configured for the session, with their connection status and host-level state." @@ -28841,6 +29318,17 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "MCPRegisterExternalClientRequest", "MCPReloadWithConfigRequest", "MCPRemoveGitHubResult", + "MCPResource", + "MCPResourceAnnotations", + "MCPResourceContent", + "MCPResourceIcon", + "MCPResourceTemplate", + "MCPResourcesListRequest", + "MCPResourcesListResult", + "MCPResourcesListTemplatesRequest", + "MCPResourcesListTemplatesResult", + "MCPResourcesReadRequest", + "MCPResourcesReadResult", "MCPRestartServerRequest", "MCPSamplingExecutionAction", "MCPSamplingExecutionResult", @@ -28884,6 +29372,7 @@ async def handle_git_hub_telemetry_event(params: dict) -> None: "McpHeadersApi", "McpOauthApi", "McpOauthLoginGrantType", + "McpResourcesApi", "McpServerAuthConfig", "McpServerConfigHttpOauthGrantType", "MemoryConfiguration", diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 8cc27c9a5..fcfc619ba 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -219,6 +219,9 @@ class SessionEventType(Enum): SESSION_CUSTOM_AGENTS_UPDATED = "session.custom_agents_updated" SESSION_MCP_SERVERS_LOADED = "session.mcp_servers_loaded" SESSION_MCP_SERVER_STATUS_CHANGED = "session.mcp_server_status_changed" + MCP_TOOLS_LIST_CHANGED = "mcp.tools.list_changed" + MCP_RESOURCES_LIST_CHANGED = "mcp.resources.list_changed" + MCP_PROMPTS_LIST_CHANGED = "mcp.prompts.list_changed" SESSION_EXTENSIONS_LOADED = "session.extensions_loaded" # Experimental: this event is part of an experimental API and may change or be removed. SESSION_CANVAS_OPENED = "session.canvas.opened" @@ -3608,6 +3611,44 @@ def to_dict(self) -> dict: return result +@dataclass +class McpPromptsListChangedData: + "Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed." + server_name: str + + @staticmethod + def from_dict(obj: Any) -> "McpPromptsListChangedData": + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + return McpPromptsListChangedData( + server_name=server_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + return result + + +@dataclass +class McpResourcesListChangedData: + "Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed." + server_name: str + + @staticmethod + def from_dict(obj: Any) -> "McpResourcesListChangedData": + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + return McpResourcesListChangedData( + server_name=server_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + return result + + @dataclass class McpServersLoadedServer: "A single MCP server status summary in `session.mcp_servers_loaded`, including name, status, source, transport, and plugin metadata." @@ -3656,6 +3697,25 @@ def to_dict(self) -> dict: return result +@dataclass +class McpToolsListChangedData: + "Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed." + server_name: str + + @staticmethod + def from_dict(obj: Any) -> "McpToolsListChangedData": + assert isinstance(obj, dict) + server_name = from_str(obj.get("serverName")) + return McpToolsListChangedData( + server_name=server_name, + ) + + def to_dict(self) -> dict: + result: dict = {} + result["serverName"] = from_str(self.server_name) + return result + + @dataclass class ModelCallFailureData: "Failed LLM API call metadata for telemetry" @@ -9252,7 +9312,7 @@ class WorkspaceFileChangedOperation(Enum): UPDATE = "update" -SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantIntentData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | ModelCallFailureData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | SkillInvokedData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data +SessionEventData = SessionStartData | SessionResumeData | SessionRemoteSteerableChangedData | SessionErrorData | SessionIdleData | SessionTitleChangedData | SessionScheduleCreatedData | SessionScheduleCancelledData | SessionScheduleRearmedData | SessionAutopilotObjectiveChangedData | SessionInfoData | SessionWarningData | SessionModelChangeData | SessionModeChangedData | SessionSessionLimitsChangedData | SessionPermissionsChangedData | SessionPlanChangedData | SessionTodosChangedData | SessionWorkspaceFileChangedData | SessionHandoffData | SessionTruncationData | SessionSnapshotRewindData | SessionShutdownData | SessionUsageCheckpointData | SessionContextChangedData | SessionUsageInfoData | SessionCompactionStartData | SessionCompactionCompleteData | SessionTaskCompleteData | UserMessageData | PendingMessagesModifiedData | AssistantTurnStartData | AssistantIntentData | AssistantReasoningData | AssistantReasoningDeltaData | AssistantToolCallDeltaData | AssistantStreamingDeltaData | AssistantMessageData | AssistantMessageStartData | AssistantMessageDeltaData | AssistantTurnEndData | AssistantIdleData | AssistantUsageData | ModelCallFailureData | AbortData | ToolUserRequestedData | ToolExecutionStartData | ToolExecutionPartialResultData | ToolExecutionProgressData | ToolExecutionCompleteData | SkillInvokedData | SubagentStartedData | SubagentCompletedData | SubagentFailedData | SubagentSelectedData | SubagentDeselectedData | HookStartData | HookEndData | HookProgressData | SessionBinaryAssetData | SystemMessageData | SystemNotificationData | PermissionRequestedData | PermissionCompletedData | UserInputRequestedData | UserInputCompletedData | ElicitationRequestedData | ElicitationCompletedData | SamplingRequestedData | SamplingCompletedData | McpOauthRequiredData | McpOauthCompletedData | McpHeadersRefreshRequiredData | McpHeadersRefreshCompletedData | SessionCustomNotificationData | ExternalToolRequestedData | ExternalToolCompletedData | CommandQueuedData | CommandExecuteData | CommandCompletedData | AutoModeSwitchRequestedData | AutoModeSwitchCompletedData | SessionLimitsExhaustedRequestedData | SessionLimitsExhaustedCompletedData | SessionAutoModeResolvedData | CommandsChangedData | CapabilitiesChangedData | ExitPlanModeRequestedData | ExitPlanModeCompletedData | SessionToolsUpdatedData | SessionBackgroundTasksChangedData | SessionSkillsLoadedData | SessionCustomAgentsUpdatedData | SessionMcpServersLoadedData | SessionMcpServerStatusChangedData | McpToolsListChangedData | McpResourcesListChangedData | McpPromptsListChangedData | SessionExtensionsLoadedData | SessionCanvasOpenedData | SessionCanvasRegistryChangedData | SessionCanvasClosedData | SessionCanvasUnavailableData | SessionCanvasRecordedData | SessionCanvasRemovedData | SessionExtensionsAttachmentsPushedData | McpAppToolCallCompleteData | RawSessionEventData | Data @dataclass @@ -9373,6 +9433,9 @@ def from_dict(obj: Any) -> "SessionEvent": case SessionEventType.SESSION_CUSTOM_AGENTS_UPDATED: data = SessionCustomAgentsUpdatedData.from_dict(data_obj) 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.MCP_TOOLS_LIST_CHANGED: data = McpToolsListChangedData.from_dict(data_obj) + case SessionEventType.MCP_RESOURCES_LIST_CHANGED: data = McpResourcesListChangedData.from_dict(data_obj) + case SessionEventType.MCP_PROMPTS_LIST_CHANGED: data = McpPromptsListChangedData.from_dict(data_obj) case SessionEventType.SESSION_EXTENSIONS_LOADED: data = SessionExtensionsLoadedData.from_dict(data_obj) case SessionEventType.SESSION_CANVAS_OPENED: data = SessionCanvasOpenedData.from_dict(data_obj) case SessionEventType.SESSION_CANVAS_REGISTRY_CHANGED: data = SessionCanvasRegistryChangedData.from_dict(data_obj) @@ -9529,10 +9592,13 @@ def session_event_to_dict(x: SessionEvent) -> Any: "McpOauthRequiredData", "McpOauthRequiredStaticClientConfig", "McpOauthWWWAuthenticateParams", + "McpPromptsListChangedData", + "McpResourcesListChangedData", "McpServerSource", "McpServerStatus", "McpServerTransport", "McpServersLoadedServer", + "McpToolsListChangedData", "ModelCallFailureBadRequestKind", "ModelCallFailureData", "ModelCallFailureRequestFingerprint", diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index fc70a3010..2e340d4a8 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -348,6 +348,12 @@ pub mod rpc_methods { 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.mcp.resources.read` + pub const SESSION_MCP_RESOURCES_READ: &str = "session.mcp.resources.read"; + /// `session.mcp.resources.list` + pub const SESSION_MCP_RESOURCES_LIST: &str = "session.mcp.resources.list"; + /// `session.mcp.resources.listTemplates` + pub const SESSION_MCP_RESOURCES_LISTTEMPLATES: &str = "session.mcp.resources.listTemplates"; /// `session.plugins.list` pub const SESSION_PLUGINS_LIST: &str = "session.plugins.list"; /// `session.plugins.reload` @@ -4916,7 +4922,7 @@ pub struct McpAppsListToolsResult { pub tools: Vec>, } -/// MCP server and resource URI to fetch. +/// Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use `session.mcp.resources.read` instead. /// ///

/// @@ -4924,16 +4930,18 @@ pub struct McpAppsListToolsResult { /// and may change or be removed in future SDK or CLI releases. /// ///
+#[doc(hidden)] +#[deprecated] #[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://...) + /// Resource URI pub uri: String, } -/// MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata. +/// Deprecated/obsolete MCP Apps alias for `McpResourceContent`; use `session.mcp.resources.read` instead. /// ///
/// @@ -4941,10 +4949,12 @@ pub struct McpAppsReadResourceRequest { /// and may change or be removed in future SDK or CLI releases. /// ///
+#[doc(hidden)] +#[deprecated] #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct McpAppsResourceContent { - /// Resource-level metadata (CSP, permissions, etc.) + /// Resource-level metadata #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] pub meta: Option>, /// Base64-encoded binary content @@ -4956,11 +4966,11 @@ pub struct McpAppsResourceContent { /// Text content (e.g. HTML) #[serde(skip_serializing_if = "Option::is_none")] pub text: Option, - /// The resource URI (typically ui://...) + /// The resource URI pub uri: String, } -/// Resource contents returned by the MCP server. +/// Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead. /// ///
/// @@ -4968,6 +4978,8 @@ pub struct McpAppsResourceContent { /// and may change or be removed in future SDK or CLI releases. /// ///
+#[doc(hidden)] +#[deprecated] #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct McpAppsReadResourceResult { @@ -5638,6 +5650,268 @@ pub struct McpRemoveGitHubResult { pub removed: bool, } +/// Standard MCP resource annotations plus preserved non-standard annotation fields. +/// +///
+/// +/// **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 McpResourceAnnotations { + /// Server-provided non-standard annotation fields preserved from the MCP response + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_properties: Option>, + /// Intended audience roles for this resource + #[serde(skip_serializing_if = "Option::is_none")] + pub audience: Option>, + /// Last-modified timestamp hint + #[serde(skip_serializing_if = "Option::is_none")] + pub last_modified: Option, + /// Priority hint for model/client use + #[serde(skip_serializing_if = "Option::is_none")] + pub priority: Option, +} + +/// A resource icon descriptor plus preserved non-standard icon fields. +/// +///
+/// +/// **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 McpResourceIcon { + /// Server-provided non-standard icon fields preserved from the MCP response + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_properties: Option>, + /// Icon MIME type, when known + #[serde(skip_serializing_if = "Option::is_none")] + pub mime_type: Option, + /// Icon sizes hint + #[serde(skip_serializing_if = "Option::is_none")] + pub sizes: Option, + /// Icon URI + pub src: String, + /// Theme hint for this icon + #[serde(skip_serializing_if = "Option::is_none")] + pub theme: Option, +} + +/// An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. +/// +///
+/// +/// **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 McpResource { + /// Resource-level metadata + #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] + pub meta: Option>, + /// Server-provided non-standard descriptor fields preserved from the MCP response + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_properties: Option>, + /// Model/client annotations associated with this resource + #[serde(skip_serializing_if = "Option::is_none")] + pub annotations: Option, + /// Optional description of what this resource represents + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Icons associated with this resource + #[serde(skip_serializing_if = "Option::is_none")] + pub icons: Option>, + /// MIME type of the resource, if known + #[serde(skip_serializing_if = "Option::is_none")] + pub mime_type: Option, + /// The programmatic name of the resource + pub name: String, + /// Resource size in bytes, when known + #[serde(skip_serializing_if = "Option::is_none")] + pub size: Option, + /// Optional human-readable display title + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + /// The resource URI (e.g. ui://... or file:///...) + pub uri: String, +} + +/// MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata. +/// +///
+/// +/// **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 McpResourceContent { + /// Resource-level metadata (CSP, permissions, etc.) + #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] + pub meta: Option>, + /// 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 + pub uri: String, +} + +/// MCP server whose resources to enumerate. +/// +///
+/// +/// **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 McpResourcesListRequest { + /// Opaque MCP pagination cursor from a prior `nextCursor` value + #[serde(skip_serializing_if = "Option::is_none")] + pub cursor: Option, + /// Name of the MCP server whose resources to enumerate + pub server_name: String, +} + +/// One page of resources advertised by 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 McpResourcesListResult { + /// Opaque cursor for the next page, if the server has more resources + #[serde(skip_serializing_if = "Option::is_none")] + pub next_cursor: Option, + /// Resources advertised by the server (proxied MCP `resources/list`) + pub resources: Vec, +} + +/// MCP server whose resource templates to enumerate. +/// +///
+/// +/// **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 McpResourcesListTemplatesRequest { + /// Opaque MCP pagination cursor from a prior `nextCursor` value + #[serde(skip_serializing_if = "Option::is_none")] + pub cursor: Option, + /// Name of the MCP server whose resource templates to enumerate + pub server_name: String, +} + +/// An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`. +/// +///
+/// +/// **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 McpResourceTemplate { + /// Resource-template-level metadata + #[serde(rename = "_meta", skip_serializing_if = "Option::is_none")] + pub meta: Option>, + /// Server-provided non-standard descriptor fields preserved from the MCP response + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_properties: Option>, + /// Model/client annotations associated with this template + #[serde(skip_serializing_if = "Option::is_none")] + pub annotations: Option, + /// Optional description of what this template is for + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Icons associated with resources matching this template + #[serde(skip_serializing_if = "Option::is_none")] + pub icons: Option>, + /// MIME type for resources matching this template, if uniform + #[serde(skip_serializing_if = "Option::is_none")] + pub mime_type: Option, + /// The programmatic name of the resource template + pub name: String, + /// Optional human-readable display title + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + /// An RFC 6570 URI template for constructing resource URIs + pub uri_template: String, +} + +/// One page of resource templates advertised by 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 McpResourcesListTemplatesResult { + /// Opaque cursor for the next page, if the server has more resource templates + #[serde(skip_serializing_if = "Option::is_none")] + pub next_cursor: Option, + /// Resource templates advertised by the server (proxied MCP `resources/templates/list`) + pub resource_templates: 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 McpResourcesReadRequest { + /// Name of the MCP server hosting the resource + pub server_name: String, + /// Resource URI + 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 McpResourcesReadResult { + /// Resource contents returned by the server + pub contents: Vec, +} + /// Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server. /// ///
@@ -17383,7 +17657,7 @@ pub struct SessionMcpHeadersHandlePendingHeadersRefreshRequestResult { pub success: bool, } -/// Resource contents returned by the MCP server. +/// Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead. /// ///
/// @@ -17391,6 +17665,8 @@ pub struct SessionMcpHeadersHandlePendingHeadersRefreshRequestResult { /// and may change or be removed in future SDK or CLI releases. /// ///
+#[doc(hidden)] +#[deprecated] #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SessionMcpAppsReadResourceResult { @@ -17460,6 +17736,57 @@ pub struct SessionMcpAppsDiagnoseResult { pub server: McpAppsDiagnoseServer, } +/// 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 SessionMcpResourcesReadResult { + /// Resource contents returned by the server + pub contents: Vec, +} + +/// One page of resources advertised by 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 SessionMcpResourcesListResult { + /// Opaque cursor for the next page, if the server has more resources + #[serde(skip_serializing_if = "Option::is_none")] + pub next_cursor: Option, + /// Resources advertised by the server (proxied MCP `resources/list`) + pub resources: Vec, +} + +/// One page of resource templates advertised by 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 SessionMcpResourcesListTemplatesResult { + /// Opaque cursor for the next page, if the server has more resource templates + #[serde(skip_serializing_if = "Option::is_none")] + pub next_cursor: Option, + /// Resource templates advertised by the server (proxied MCP `resources/templates/list`) + pub resource_templates: Vec, +} + /// Identifies the target session. /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 3ef82b2c1..a683d0201 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -4317,6 +4317,13 @@ impl<'a> SessionRpcMcp<'a> { } } + /// `session.mcp.resources.*` sub-namespace. + pub fn resources(&self) -> SessionRpcMcpResources<'a> { + SessionRpcMcpResources { + session: self.session, + } + } + /// Lists MCP servers configured for the session, their connection status, and host-level state. The host-level state (disabled/filtered servers, failed/needs-auth/pending connections, mcp3p policy, full config) is empty/zero when no MCP host has been initialized for the session. /// /// Wire method: `session.mcp.list`. @@ -4824,17 +4831,19 @@ pub struct SessionRpcMcpApps<'a> { } 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. + /// Deprecated/obsolete alias for `session.mcp.resources.read`; retained for backwards compatibility with earlier MCP Apps host integrations. /// /// Wire method: `session.mcp.apps.readResource`. /// /// # Parameters /// - /// * `params` - MCP server and resource URI to fetch. + /// * `params` - Deprecated/obsolete MCP Apps alias for `McpResourcesReadRequest`; use `session.mcp.resources.read` instead. /// /// # Returns /// - /// Resource contents returned by the MCP server. + /// Deprecated/obsolete MCP Apps alias for `McpResourcesReadResult`; use `session.mcp.resources.read` instead. + #[doc(hidden)] + #[deprecated] /// ///
/// @@ -5138,6 +5147,116 @@ impl<'a> SessionRpcMcpOauth<'a> { } } +/// `session.mcp.resources.*` RPCs. +#[derive(Clone, Copy)] +pub struct SessionRpcMcpResources<'a> { + pub(crate) session: &'a Session, +} + +impl<'a> SessionRpcMcpResources<'a> { + /// Fetch an MCP resource from a connected server by URI (proxies MCP `resources/read`). + /// + /// Wire method: `session.mcp.resources.read`. + /// + /// # 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( + &self, + params: McpResourcesReadRequest, + ) -> 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_RESOURCES_READ, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`. + /// + /// Wire method: `session.mcp.resources.list`. + /// + /// # Parameters + /// + /// * `params` - MCP server whose resources to enumerate. + /// + /// # Returns + /// + /// One page of resources advertised by 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( + &self, + params: McpResourcesListRequest, + ) -> 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_RESOURCES_LIST, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Enumerate one page of resource templates a connected MCP server exposes (proxies MCP `resources/templates/list`). Pass `cursor` to continue from a prior result's `nextCursor`. + /// + /// Wire method: `session.mcp.resources.listTemplates`. + /// + /// # Parameters + /// + /// * `params` - MCP server whose resource templates to enumerate. + /// + /// # Returns + /// + /// One page of resource templates advertised by 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_templates( + &self, + params: McpResourcesListTemplatesRequest, + ) -> 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_RESOURCES_LISTTEMPLATES, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } +} + /// `session.metadata.*` RPCs. #[derive(Clone, Copy)] pub struct SessionRpcMetadata<'a> { diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs index 8fcdb2cf5..c2c84070d 100644 --- a/rust/src/generated/session_events.rs +++ b/rust/src/generated/session_events.rs @@ -215,6 +215,12 @@ pub enum SessionEventType { SessionMcpServersLoaded, #[serde(rename = "session.mcp_server_status_changed")] SessionMcpServerStatusChanged, + #[serde(rename = "mcp.tools.list_changed")] + McpToolsListChanged, + #[serde(rename = "mcp.resources.list_changed")] + McpResourcesListChanged, + #[serde(rename = "mcp.prompts.list_changed")] + McpPromptsListChanged, #[serde(rename = "session.extensions_loaded")] SessionExtensionsLoaded, /// @@ -484,6 +490,12 @@ pub enum SessionEventData { SessionMcpServersLoaded(SessionMcpServersLoadedData), #[serde(rename = "session.mcp_server_status_changed")] SessionMcpServerStatusChanged(SessionMcpServerStatusChangedData), + #[serde(rename = "mcp.tools.list_changed")] + McpToolsListChanged(McpToolsListChangedData), + #[serde(rename = "mcp.resources.list_changed")] + McpResourcesListChanged(McpResourcesListChangedData), + #[serde(rename = "mcp.prompts.list_changed")] + McpPromptsListChanged(McpPromptsListChangedData), #[serde(rename = "session.extensions_loaded")] SessionExtensionsLoaded(SessionExtensionsLoadedData), /// @@ -4087,6 +4099,30 @@ pub struct SessionMcpServerStatusChangedData { pub status: McpServerStatus, } +/// Session event "mcp.tools.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpToolsListChangedData { + /// Name of the MCP server whose list changed + pub server_name: String, +} + +/// Session event "mcp.resources.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpResourcesListChangedData { + /// Name of the MCP server whose list changed + pub server_name: String, +} + +/// Session event "mcp.prompts.list_changed". Payload of MCP `list_changed` notification events, emitted when an MCP server announces at runtime that one of its advertised lists changed. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct McpPromptsListChangedData { + /// Name of the MCP server whose list changed + pub server_name: String, +} + /// A single extension discovered by `session.extensions_loaded`, including qualified ID, source, and current status. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] diff --git a/rust/tests/e2e/rpc_mcp_and_skills.rs b/rust/tests/e2e/rpc_mcp_and_skills.rs index 523808cd0..bd6298974 100644 --- a/rust/tests/e2e/rpc_mcp_and_skills.rs +++ b/rust/tests/e2e/rpc_mcp_and_skills.rs @@ -3,14 +3,13 @@ use std::path::Path; use github_copilot_sdk::rpc::{ ExtensionsDisableRequest, ExtensionsEnableRequest, McpAppsCallToolRequest, - McpAppsDiagnoseRequest, McpAppsListToolsRequest, McpAppsReadResourceRequest, - McpAppsSetHostContextDetails, McpAppsSetHostContextDetailsAvailableDisplayMode, - McpAppsSetHostContextDetailsDisplayMode, McpAppsSetHostContextDetailsPlatform, - McpAppsSetHostContextDetailsTheme, McpAppsSetHostContextRequest, - McpCancelSamplingExecutionParams, McpDisableRequest, McpEnableRequest, - McpExecuteSamplingParams, McpExecuteSamplingRequest, McpOauthLoginRequest, - McpSamplingExecutionAction, McpSetEnvValueModeDetails, McpSetEnvValueModeParams, - SkillsDisableRequest, SkillsEnableRequest, + McpAppsDiagnoseRequest, McpAppsListToolsRequest, McpAppsSetHostContextDetails, + McpAppsSetHostContextDetailsAvailableDisplayMode, McpAppsSetHostContextDetailsDisplayMode, + McpAppsSetHostContextDetailsPlatform, McpAppsSetHostContextDetailsTheme, + McpAppsSetHostContextRequest, McpCancelSamplingExecutionParams, McpDisableRequest, + McpEnableRequest, McpExecuteSamplingParams, McpExecuteSamplingRequest, McpOauthLoginRequest, + McpResourcesReadRequest, McpSamplingExecutionAction, McpSetEnvValueModeDetails, + McpSetEnvValueModeParams, SkillsDisableRequest, SkillsEnableRequest, }; use github_copilot_sdk::{IndexMap, McpServerConfig, McpStdioServerConfig}; @@ -510,8 +509,8 @@ async fn should_report_error_when_mcp_app_resource_is_not_available() { let err = session .rpc() .mcp() - .apps() - .read_resource(McpAppsReadResourceRequest { + .resources() + .read(McpResourcesReadRequest { server_name: "missing-app-server".to_string(), uri: "ui://missing/resource.html".to_string(), }) diff --git a/scripts/codegen/csharp.ts b/scripts/codegen/csharp.ts index c9a5f8237..a5b806e8b 100644 --- a/scripts/codegen/csharp.ts +++ b/scripts/codegen/csharp.ts @@ -230,7 +230,8 @@ function stripDurationMillisecondsSuffix(name: string): string { } function toCSharpPropertyName(propName: string, schema: JSONSchema7): string { - return toPascalCase(isDurationProperty(schema) ? stripDurationMillisecondsSuffix(propName) : propName); + const normalizedName = propName.replace(/^_+/, "") || propName; + return toPascalCase(isDurationProperty(schema) ? stripDurationMillisecondsSuffix(normalizedName) : normalizedName); } function isSecondsDurationPropertyName(propName: string | undefined): boolean { diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index c54364432..6e3d2e4ed 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.70-0", + "@github/copilot": "^1.0.70", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", @@ -501,9 +501,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.70-0.tgz", - "integrity": "sha512-GPLiKXpwFR11ZISSmTVmVoXj+dwKpQq1foz1rLvSjtzbO/IHQLMJ11CN+o5lkDiERAFtYd70mZf3P/xM05/nQg==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.70.tgz", + "integrity": "sha512-onEwx5tod9t31Lc2rT5ns6s/fY6jtdwVWS3Fzs8hKUjCv7LFIMGf71MLcikl4GBXn6cq44+HVdNzCMWnLjYl3g==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -513,20 +513,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.70-0", - "@github/copilot-darwin-x64": "1.0.70-0", - "@github/copilot-linux-arm64": "1.0.70-0", - "@github/copilot-linux-x64": "1.0.70-0", - "@github/copilot-linuxmusl-arm64": "1.0.70-0", - "@github/copilot-linuxmusl-x64": "1.0.70-0", - "@github/copilot-win32-arm64": "1.0.70-0", - "@github/copilot-win32-x64": "1.0.70-0" + "@github/copilot-darwin-arm64": "1.0.70", + "@github/copilot-darwin-x64": "1.0.70", + "@github/copilot-linux-arm64": "1.0.70", + "@github/copilot-linux-x64": "1.0.70", + "@github/copilot-linuxmusl-arm64": "1.0.70", + "@github/copilot-linuxmusl-x64": "1.0.70", + "@github/copilot-win32-arm64": "1.0.70", + "@github/copilot-win32-x64": "1.0.70" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.70-0.tgz", - "integrity": "sha512-63jLqlVNsX7XMKgEMH4J+lY1zwHCnqapzK1BFEMXgplqvQAJ9q29B83Kskl+i8AGXFpVx+uHRNJIImlkuK3a/g==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.70.tgz", + "integrity": "sha512-NewReqBmTxtAzApZNmUsY4Xqy8N086MiQm7k35i9i+WrGyRiHxdZ/n/lMLCkqWoelr7pZhcZ7gQ7fHbEq1KdoQ==", "cpu": [ "arm64" ], @@ -541,9 +541,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.70-0.tgz", - "integrity": "sha512-uIWb54gh64p0sdaCOv8HZlKjAlrNLiQO3jE6VqbxatZniJ5y3bkWkba/ULuBKgwSLRnZKLSHBhP597JwXsamoQ==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.70.tgz", + "integrity": "sha512-ydUEYI3udNAjdMsLPFQLH/JG9YFKcxuAUxYIyOK+F/m/Of9nODKdYa2hw2mlLanP4cNyuxGLflu+rtIqIb+cPw==", "cpu": [ "x64" ], @@ -558,9 +558,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.70-0.tgz", - "integrity": "sha512-+wa9MDl1a3j1/sTAI1I5UHw9PXwwao0SNczml8pCV78gYqmv6YNaCg2ZKvaajv9vinXkFOH+20VDT5HQk1zhlQ==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.70.tgz", + "integrity": "sha512-EpR3VEEqMy5M9t3cs+6FtjX/AhyfoefzmcMAjBls+RGv1fILjaAby+rhKHzX5YVSxOu9OyQDlQVHK3kxznTU5Q==", "cpu": [ "arm64" ], @@ -575,9 +575,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.70-0.tgz", - "integrity": "sha512-oUy+q4ZgH4lrs0Jsnkf8sQDWEwOPxLNRTGqw3RJ+Cf0hHVxVm4F5mIvO+plmJxe3N70rNDrhxQFQXhboRKqf7w==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.70.tgz", + "integrity": "sha512-4pyNKunm7GEzQZ+09Dwr4BwixJVNcQGBeqiZPKWBGxcSipwj90t8tidLYdNjgmXJoLerANhXZcY52wJW/HubEA==", "cpu": [ "x64" ], @@ -592,9 +592,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.70-0.tgz", - "integrity": "sha512-YLtR5MQoORGy82QjrYvtNPDt9FH4XkoVYbMQ2HMYvQrbVghQ+k5FZU3Mx4rnIJR+8qDnE3AGH7JMEgeK87dkQA==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.70.tgz", + "integrity": "sha512-Xy3tDjIMmMkZZzJjCrK5aDCLLV5+pyOfIcT1lWLmqVWJG0erpHXL6KU82nGW+0nc0TPqGZFHvOyQeLuXl+s3ZA==", "cpu": [ "arm64" ], @@ -609,9 +609,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.70-0.tgz", - "integrity": "sha512-faqw21lOIPmqyLwfYRUeCZ4+TvuvUPsOEb0qh0LI2NL98AtQX123RxBbFMDDC9bnRZ7S/5lZXnpPpn19v+5Vvw==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.70.tgz", + "integrity": "sha512-AHWayI1lVTzxYkNkKrCBOo3XPG+Fb67zcqFivRjGaXG5tr9Bt870LIjIAWoJqQ1Clc3K2PsxyYZ1d8T6vjpWnA==", "cpu": [ "x64" ], @@ -626,9 +626,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.70-0.tgz", - "integrity": "sha512-/Wk+jrK/ogAXs/AIjW60f3pIRj3UHEFRXgbrIoc1R0wIDbVas9/GGrpgrRFf5ldyvvVljedxuuvqvaEe2aFtsA==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.70.tgz", + "integrity": "sha512-oWsWCTlUyIv4S3FdYoBNCscndLrUv+C3qgbfJ9mf+5igPqbIYL8alkc8FBHWPB/cornDNj65yd4s8dZrSkFPpg==", "cpu": [ "arm64" ], @@ -643,9 +643,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.70-0", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.70-0.tgz", - "integrity": "sha512-3fgEEDeswN9Db4qu4NsGe3BAtHHylfFh+jcwlBscSbI4KGEI3cvXcDFoxPcXWi/cajcvt0Tec5/jAJskJI0SNg==", + "version": "1.0.70", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.70.tgz", + "integrity": "sha512-KFDZ750CwhjKF6uATQ1pv1XrYHI+/qTQta954gYZaa+YJEXRstGd284uJ6NI3YXfshZwhTs64JdjN4xLodYwrA==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index 045b35f64..40e0b1360 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -14,7 +14,7 @@ "node": "^20.19.0 || >=22.12.0" }, "devDependencies": { - "@github/copilot": "^1.0.70-0", + "@github/copilot": "^1.0.70", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14",