diff --git a/dotnet/src/Generated/Rpc.cs b/dotnet/src/Generated/Rpc.cs index bb14aaf2f..2f8d898bf 100644 --- a/dotnet/src/Generated/Rpc.cs +++ b/dotnet/src/Generated/Rpc.cs @@ -2580,10 +2580,14 @@ public sealed class ModelCapabilitiesOverride public ModelCapabilitiesOverrideSupports? Supports { get; set; } } -/// Target model identifier and optional reasoning effort, summary, and capability overrides. +/// Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. [Experimental(Diagnostics.Experimental)] internal sealed class ModelSwitchToRequest { + /// Explicit context tier for the selected model. `"default"` / `"long_context"` pin the tier; `null` clears any previous explicit choice; `undefined` leaves the existing tier untouched. + [JsonPropertyName("contextTier")] + public ModelSwitchToRequestContextTier? ContextTier { get; set; } + /// Override individual model capabilities resolved by the runtime. [JsonPropertyName("modelCapabilities")] public ModelCapabilitiesOverride? ModelCapabilities { get; set; } @@ -2627,6 +2631,41 @@ internal sealed class ModelSetReasoningEffortRequest public string SessionId { get; set; } = string.Empty; } +/// The list of models available to this session. +[Experimental(Diagnostics.Experimental)] +public sealed class SessionModelList +{ + /// Available models, ordered with the most preferred default first. + [JsonPropertyName("list")] + public IList List { get => field ??= []; set; } + + /// Per-quota snapshots returned alongside the model list, keyed by quota type. + [JsonPropertyName("quotaSnapshots")] + public IDictionary? QuotaSnapshots { get; set; } +} + +/// Optional listing options. +[Experimental(Diagnostics.Experimental)] +public sealed class ModelListRequest +{ + /// If true, bypasses the per-session model list cache and re-fetches from CAPI. + [JsonPropertyName("skipCache")] + public bool? SkipCache { get; set; } +} + +/// Optional listing options. +[Experimental(Diagnostics.Experimental)] +internal sealed class ModelListRequestWithSession +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; + + /// If true, bypasses the per-session model list cache and re-fetches from CAPI. + [JsonPropertyName("skipCache")] + public bool? SkipCache { get; set; } +} + /// Identifies the target session. [Experimental(Diagnostics.Experimental)] internal sealed class SessionModeGetRequest @@ -4806,6 +4845,57 @@ internal sealed class SessionToolsInitializeAndValidateRequest public string SessionId { get; set; } = string.Empty; } +/// Lightweight metadata for a currently initialized session tool. +[Experimental(Diagnostics.Experimental)] +public sealed class CurrentToolMetadata +{ + /// Whether the tool is loaded on demand via tool search. + [JsonPropertyName("deferLoading")] + public bool? DeferLoading { get; set; } + + /// Tool description. + [JsonPropertyName("description")] + public string Description { get; set; } = string.Empty; + + /// JSON Schema for tool input. + [JsonPropertyName("input_schema")] + public IDictionary? InputSchema { get; set; } + + /// MCP server name for MCP-backed tools. + [JsonPropertyName("mcpServerName")] + public string? McpServerName { get; set; } + + /// Raw MCP tool name for MCP-backed tools. + [JsonPropertyName("mcpToolName")] + public string? McpToolName { get; set; } + + /// Model-facing tool name. + [JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// Optional MCP/config namespaced tool name. + [JsonPropertyName("namespacedName")] + public string? NamespacedName { get; set; } +} + +/// Current lightweight tool metadata snapshot for the session. +[Experimental(Diagnostics.Experimental)] +public sealed class ToolsGetCurrentMetadataResult +{ + /// Current tool metadata, or null when tools have not been initialized yet. + [JsonPropertyName("tools")] + public IList? Tools { get; set; } +} + +/// Identifies the target session. +[Experimental(Diagnostics.Experimental)] +internal sealed class SessionToolsGetCurrentMetadataRequest +{ + /// Target session identifier. + [JsonPropertyName("sessionId")] + public string SessionId { get; set; } = string.Empty; +} + /// Optional unstructured input hint. [Experimental(Diagnostics.Experimental)] public sealed class SlashCommandInput @@ -6922,6 +7012,10 @@ public sealed class MetadataContextInfoResultContextInfo [JsonPropertyName("limit")] public long Limit { get; set; } + /// Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools). + [JsonPropertyName("mcpToolsTokens")] + public long McpToolsTokens { get; set; } + /// The model used for token counting. [JsonPropertyName("modelName")] public string ModelName { get; set; } = string.Empty; @@ -9615,6 +9709,68 @@ public override void Write(Utf8JsonWriter writer, CanvasInstanceAvailability val } +/// Defines the allowed values. +[JsonConverter(typeof(Converter))] +[DebuggerDisplay("{Value,nq}")] +public readonly struct ModelSwitchToRequestContextTier : IEquatable +{ + private readonly string? _value; + + /// Initializes a new instance of the struct. + /// The value to associate with this . + [JsonConstructor] + public ModelSwitchToRequestContextTier(string value) + { + ArgumentException.ThrowIfNullOrWhiteSpace(value); + _value = value; + } + + /// Gets the value associated with this . + public string Value => _value ?? string.Empty; + + /// Use the model's default context window. + public static ModelSwitchToRequestContextTier Default { get; } = new("default"); + + /// Pin the session to the long-context tier when supported. + public static ModelSwitchToRequestContextTier LongContext { get; } = new("long_context"); + + /// Returns a value indicating whether two instances are equivalent. + public static bool operator ==(ModelSwitchToRequestContextTier left, ModelSwitchToRequestContextTier right) => left.Equals(right); + + /// Returns a value indicating whether two instances are not equivalent. + public static bool operator !=(ModelSwitchToRequestContextTier left, ModelSwitchToRequestContextTier right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is ModelSwitchToRequestContextTier other && Equals(other); + + /// + public bool Equals(ModelSwitchToRequestContextTier other) => string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); + + /// + public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); + + /// + public override string ToString() => Value; + + /// Provides a for serializing instances. + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class Converter : JsonConverter + { + /// + public override ModelSwitchToRequestContextTier Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + return new(GeneratedStringEnumJson.ReadValue(ref reader, typeToConvert)); + } + + /// + public override void Write(Utf8JsonWriter writer, ModelSwitchToRequestContextTier value, JsonSerializerOptions options) + { + GeneratedStringEnumJson.WriteValue(writer, value.Value, typeof(ModelSwitchToRequestContextTier)); + } + } +} + + /// Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration. [Experimental(Diagnostics.Experimental)] [JsonConverter(typeof(Converter))] @@ -12558,6 +12714,12 @@ internal async Task ConnectAsync(string? token = null, Cancellati Interlocked.CompareExchange(ref field, new(_rpc), null) ?? field; + /// User APIs. + public ServerUserApi User => + field ?? + Interlocked.CompareExchange(ref field, new(_rpc), null) ?? + field; + /// SessionFs APIs. public ServerSessionFsApi SessionFs => field ?? @@ -12766,6 +12928,13 @@ public async Task DisableAsync(IList names, CancellationToken cancellati var request = new McpConfigDisableRequest { Names = names }; await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.disable", [request], cancellationToken); } + + /// Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk. + /// The to monitor for cancellation requests. The default is . + public async Task ReloadAsync(CancellationToken cancellationToken = default) + { + await CopilotClient.InvokeRpcAsync(_rpc, "mcp.config.reload", [], cancellationToken); + } } /// Provides server-scoped Skills APIs. @@ -12818,6 +12987,41 @@ public async Task SetDisabledSkillsAsync(IList disabledSkills, Cancellat } } +/// Provides server-scoped User APIs. +public sealed class ServerUserApi +{ + private readonly JsonRpc _rpc; + + internal ServerUserApi(JsonRpc rpc) + { + _rpc = rpc; + } + + /// Settings APIs. + public ServerUserSettingsApi Settings => + field ?? + Interlocked.CompareExchange(ref field, new(_rpc), null) ?? + field; +} + +/// Provides server-scoped UserSettings APIs. +public sealed class ServerUserSettingsApi +{ + private readonly JsonRpc _rpc; + + internal ServerUserSettingsApi(JsonRpc rpc) + { + _rpc = rpc; + } + + /// Drops this runtime process's in-memory user settings cache so the next settings read observes disk. + /// The to monitor for cancellation requests. The default is . + public async Task ReloadAsync(CancellationToken cancellationToken = default) + { + await CopilotClient.InvokeRpcAsync(_rpc, "user.settings.reload", [], cancellationToken); + } +} + /// Provides server-scoped SessionFs APIs. public sealed class ServerSessionFsApi { @@ -13546,14 +13750,15 @@ public async Task GetCurrentAsync(CancellationToken cancellationTo /// Reasoning effort level to use for the model. "none" disables reasoning. /// Reasoning summary mode to request for supported model clients. /// Override individual model capabilities resolved by the runtime. + /// Explicit context tier for the selected model. `"default"` / `"long_context"` pin the tier; `null` clears any previous explicit choice; `undefined` leaves the existing tier untouched. /// The to monitor for cancellation requests. The default is . /// The model identifier active on the session after the switch. - public async Task SwitchToAsync(string modelId, string? reasoningEffort = null, ReasoningSummary? reasoningSummary = null, ModelCapabilitiesOverride? modelCapabilities = null, CancellationToken cancellationToken = default) + public async Task SwitchToAsync(string modelId, string? reasoningEffort = null, ReasoningSummary? reasoningSummary = null, ModelCapabilitiesOverride? modelCapabilities = null, ModelSwitchToRequestContextTier? contextTier = null, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(modelId); _session.ThrowIfDisposed(); - var request = new ModelSwitchToRequest { SessionId = _session.SessionId, ModelId = modelId, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, ModelCapabilities = modelCapabilities }; + var request = new ModelSwitchToRequest { SessionId = _session.SessionId, ModelId = modelId, ReasoningEffort = reasoningEffort, ReasoningSummary = reasoningSummary, ModelCapabilities = modelCapabilities, ContextTier = contextTier }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.switchTo", [request], cancellationToken); } @@ -13569,6 +13774,18 @@ public async Task SetReasoningEffortAsync(string var request = new ModelSetReasoningEffortRequest { SessionId = _session.SessionId, ReasoningEffort = reasoningEffort }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.setReasoningEffort", [request], cancellationToken); } + + /// Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's. + /// Optional listing options. + /// The to monitor for cancellation requests. The default is . + /// The list of models available to this session. + public async Task ListAsync(ModelListRequest? request = null, CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var rpcRequest = new ModelListRequestWithSession { SessionId = _session.SessionId, SkipCache = request?.SkipCache }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.model.list", [rpcRequest], cancellationToken); + } } /// Provides session-scoped Mode APIs. @@ -14604,6 +14821,17 @@ public async Task InitializeAndValidateAsync(C var request = new SessionToolsInitializeAndValidateRequest { SessionId = _session.SessionId }; return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tools.initializeAndValidate", [request], cancellationToken); } + + /// Returns lightweight metadata for the session's currently initialized tools. + /// The to monitor for cancellation requests. The default is . + /// Current lightweight tool metadata snapshot for the session. + public async Task GetCurrentMetadataAsync(CancellationToken cancellationToken = default) + { + _session.ThrowIfDisposed(); + + var request = new SessionToolsGetCurrentMetadataRequest { SessionId = _session.SessionId }; + return await CopilotClient.InvokeRpcAsync(_session.Rpc, "session.tools.getCurrentMetadata", [request], cancellationToken); + } } /// Provides session-scoped Commands APIs. @@ -16120,6 +16348,7 @@ public static void RegisterClientSessionApiHandlers(JsonRpc rpc, Func 0 { + requestParams = params[0] + } + req := map[string]any{"sessionId": a.sessionID} + if requestParams != nil { + if requestParams.SkipCache != nil { + req["skipCache"] = *requestParams.SkipCache + } + } + raw, err := a.client.Request("session.model.list", req) + if err != nil { + return nil, err + } + var result SessionModelList + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // SetReasoningEffort updates the session's reasoning effort without changing the selected // model. // @@ -10171,13 +10313,16 @@ func (a *ModelApi) SetReasoningEffort(ctx context.Context, params *ModelSetReaso // // RPC method: session.model.switchTo. // -// Parameters: Target model identifier and optional reasoning effort, summary, and -// capability overrides. +// Parameters: Target model identifier and optional reasoning effort, summary, capability +// overrides, and context tier. // // Returns: The model identifier active on the session after the switch. func (a *ModelApi) SwitchTo(ctx context.Context, params *ModelSwitchToRequest) (*ModelSwitchToResult, error) { req := map[string]any{"sessionId": a.sessionID} if params != nil { + if params.ContextTier != nil { + req["contextTier"] = *params.ContextTier + } if params.ModelCapabilities != nil { req["modelCapabilities"] = *params.ModelCapabilities } @@ -11675,6 +11820,25 @@ func (a *TelemetryApi) SetFeatureOverrides(ctx context.Context, params *Telemetr // Experimental: ToolsApi contains experimental APIs that may change or be removed. type ToolsApi sessionApi +// GetCurrentMetadata returns lightweight metadata for the session's currently initialized +// tools. +// +// RPC method: session.tools.getCurrentMetadata. +// +// Returns: Current lightweight tool metadata snapshot for the session. +func (a *ToolsApi) GetCurrentMetadata(ctx context.Context) (*ToolsGetCurrentMetadataResult, error) { + req := map[string]any{"sessionId": a.sessionID} + raw, err := a.client.Request("session.tools.getCurrentMetadata", req) + if err != nil { + return nil, err + } + var result ToolsGetCurrentMetadataResult + if err := json.Unmarshal(raw, &result); err != nil { + return nil, err + } + return &result, nil +} + // HandlePendingToolCall provides the result for a pending external tool call. // // RPC method: session.tools.handlePendingToolCall. diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index c9ea8ab17..9ddda4949 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.55-7", + "@github/copilot": "^1.0.55", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, @@ -663,9 +663,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.55-7.tgz", - "integrity": "sha512-TczFrIaHH2sel6FM007H4FzT+Ipkj++I5u8Vx2ECWz9u24H7WOx/RpWcp6ExnSY1KSK1MtXaGcniAuqVi8Khaw==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.55.tgz", + "integrity": "sha512-wqzI0L7krORW6jDAQPx7VnInka5BYN5yVgu+dpUK4w8xP5RgnOBa6kRoXpydj/9O1ufs0k6RKRtQjsVLp52TRw==", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "detect-libc": "^2.1.2" @@ -674,20 +674,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.55-7", - "@github/copilot-darwin-x64": "1.0.55-7", - "@github/copilot-linux-arm64": "1.0.55-7", - "@github/copilot-linux-x64": "1.0.55-7", - "@github/copilot-linuxmusl-arm64": "1.0.55-7", - "@github/copilot-linuxmusl-x64": "1.0.55-7", - "@github/copilot-win32-arm64": "1.0.55-7", - "@github/copilot-win32-x64": "1.0.55-7" + "@github/copilot-darwin-arm64": "1.0.55", + "@github/copilot-darwin-x64": "1.0.55", + "@github/copilot-linux-arm64": "1.0.55", + "@github/copilot-linux-x64": "1.0.55", + "@github/copilot-linuxmusl-arm64": "1.0.55", + "@github/copilot-linuxmusl-x64": "1.0.55", + "@github/copilot-win32-arm64": "1.0.55", + "@github/copilot-win32-x64": "1.0.55" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.55-7.tgz", - "integrity": "sha512-QReU4F5+W0x/Nuc6qO+xYPeNnRjuHIIAeMBc1S+RFQ0T+YWynxRzNHGs9ZkUiIcLJ1F/y8GDq6sq7760Cn+onQ==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.55.tgz", + "integrity": "sha512-v59pOpA7YO8j/lpDU/1E8l1Ag0hd26hIiEzTNbzqKd7tJpvhN0XTDWDCink50wXL656XIXt8lD8i8sGeD6yPfA==", "cpu": [ "arm64" ], @@ -701,9 +701,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.55-7.tgz", - "integrity": "sha512-qQ0d+XyvIPbNiaIydHBSCTQfWK5s0x1XnlrUKSzadgOnsFobGeldLSKtB159zJEiz0F/in5ythiUGJjWoAQVrA==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.55.tgz", + "integrity": "sha512-XrJ9ent/9ogLk8yNp3TMsNVW0qTRDlkw/b34VnTgbAkJCaI3UVqaqpFn60Laa6J5mOPW0/JeKIkkva+7IJdqpQ==", "cpu": [ "x64" ], @@ -717,9 +717,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.55-7.tgz", - "integrity": "sha512-+2zlHahK3fUfkrnlHqbdQsZMPZwRfchoTxDZd9UHbEhQF7eNLzYN+7frWs6AZujU+h/1i92+mcLT18AQXI3KxQ==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.55.tgz", + "integrity": "sha512-5Q46Q72/l/U8KQRcBwYjzFPNXBCPG177FTmjEVOAH0qk7w58fMUDBEpnf9n1IpxYJDWQJ5BFGtLdfYgVVtkevw==", "cpu": [ "arm64" ], @@ -733,9 +733,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.55-7.tgz", - "integrity": "sha512-SGmvWcJHIKDIsjYZdFQloGw3Re6r2N1Zv1VuB1yV1ClVqfG5i5pTvai6vzX8d3WgGgRzrkLksDrzZKR27zJZ7A==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.55.tgz", + "integrity": "sha512-KWmMCDmKJivvOyDAAe5K8r7uSlVq8aZCh20VfrVXsc4bckO6KjXY/TOagrdBNqkk5rh8v63ghBbxFdWIOvEJRA==", "cpu": [ "x64" ], @@ -749,9 +749,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.55-7.tgz", - "integrity": "sha512-rJkZLvz4KeGoLgyX6gcONgTNfFxeoQvN4jaAXlbD1nFP3hJbLTuY0CB4fBHmZWktrPkRL/j5aDGxrcIcl+Xg3A==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.55.tgz", + "integrity": "sha512-Jb5ug9Ic1pzxB2ZT1xoR8b3Ea1xnvCa4h8cBque51+TevXe6QF98vAfSUIwLe4xu+K6JKhiKEA0SD3w29Z74eA==", "cpu": [ "arm64" ], @@ -765,9 +765,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.55-7.tgz", - "integrity": "sha512-uPb08qgJHY1QW2YhA1OBJ9PB0CDwCvtuttWbeZ+AW+qfFVsvBpARU1cdEl/xT4IXMhBFoJiePv3BnLGjVZtoWA==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.55.tgz", + "integrity": "sha512-qMGIjHxKmW9q26EpoaNKWpmEVGyL/IM8ThVkh7yolDzv9lECFudPzT5yLX7f+VIiF6qWQlrQyzmamp7/fNQ2Zg==", "cpu": [ "x64" ], @@ -781,9 +781,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.55-7.tgz", - "integrity": "sha512-mb4Sg2sJjmK9Rq8XCRuhoIOjUScB5p2Ct9ZtTbC3ipvONWMOMjYPbLvC8K9GAHcYcHLdv98hvzv3+qjBhb5tZQ==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.55.tgz", + "integrity": "sha512-TO4EJ8it6Qki7wMKYHqGUEDYmB0EAToy+pE5++OpydB6FijyQ31+/XwjvdnEFkuB4ZgPqu/6Y8hxMKucl2+FYg==", "cpu": [ "arm64" ], @@ -797,9 +797,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.55-7.tgz", - "integrity": "sha512-GL9jAtkn2Kx4IO9ZfTiMC3LFd539KuuOx3uOIKciWKMuCvcfct0rdVkXlDr+EnrmPzu1A4PavcJ0RScpI39jUQ==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.55.tgz", + "integrity": "sha512-TBMiSZMz8Dhx79JeSEM+7ONGxR5NmxfiDUdySo6thVbRmjS9D8msyAP8ucTsbLBJcTFeb7vsaeObD/ujYQgDtA==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index 16b0a3a6a..78a906c39 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.55-7", + "@github/copilot": "^1.0.55", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index f38b8c7ab..92b616ddb 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,7 +18,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.55-7", + "@github/copilot": "^1.0.55", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 55dd5ba70..9d3431201 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -665,6 +665,10 @@ export type SessionContextInfo = { * Tokens consumed by tool definitions sent to the model (excludes deferred tools) */ toolDefinitionsTokens: number; + /** + * Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools) + */ + mcpToolsTokens: number; /** * Sum of system, conversation and tool-definition tokens */ @@ -2810,6 +2814,45 @@ export interface CurrentModel { */ reasoningEffort?: string; } +/** + * Lightweight metadata for a currently initialized session tool + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "CurrentToolMetadata". + */ +/** @experimental */ +export interface CurrentToolMetadata { + /** + * Model-facing tool name + */ + name: string; + /** + * Optional MCP/config namespaced tool name + */ + namespacedName?: string; + /** + * MCP server name for MCP-backed tools + */ + mcpServerName?: string; + /** + * Raw MCP tool name for MCP-backed tools + */ + mcpToolName?: string; + /** + * Tool description + */ + description: string; + /** + * JSON Schema for tool input + */ + input_schema?: { + [k: string]: unknown | undefined; + }; + /** + * Whether the tool is loaded on demand via tool search + */ + deferLoading?: boolean; +} /** * Schema for the `DiscoveredMcpServer` type. * @@ -4813,6 +4856,19 @@ export interface ModelList { */ models: Model[]; } +/** + * Optional listing options. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelListRequest". + */ +/** @experimental */ +export interface ModelListRequest { + /** + * If true, bypasses the per-session model list cache and re-fetches from CAPI. + */ + skipCache?: boolean; +} /** * Reasoning effort level to apply to the currently selected model. * @@ -4847,7 +4903,7 @@ export interface ModelsListRequest { gitHubToken?: string; } /** - * Target model identifier and optional reasoning effort, summary, and capability overrides. + * Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. * * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema * via the `definition` "ModelSwitchToRequest". @@ -4864,6 +4920,14 @@ export interface ModelSwitchToRequest { reasoningEffort?: string; reasoningSummary?: ReasoningSummary; modelCapabilities?: ModelCapabilitiesOverride; + /** + * Explicit context tier for the selected model. `"default"` / `"long_context"` pin the tier; `null` clears any previous explicit choice; `undefined` leaves the existing tier untouched. + */ + contextTier?: /** Use the model's default context window. */ + | "default" + /** Pin the session to the long-context tier when supported. */ + | "long_context" + | null; } /** * The model identifier active on the session after the switch. @@ -7636,6 +7700,25 @@ export interface SessionMetadataSnapshot { */ workspace?: WorkspaceSummary | null; } +/** + * The list of models available to this session. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "SessionModelList". + */ +/** @experimental */ +export interface SessionModelList { + /** + * Available models, ordered with the most preferred default first. + */ + list: unknown[]; + /** + * Per-quota snapshots returned alongside the model list, keyed by quota type. + */ + quotaSnapshots?: { + [k: string]: unknown | undefined; + }; +} /** * Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag. * @@ -9094,6 +9177,19 @@ export interface ToolList { */ tools: Tool[]; } +/** + * Current lightweight tool metadata snapshot for the session. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ToolsGetCurrentMetadataResult". + */ +/** @experimental */ +export interface ToolsGetCurrentMetadataResult { + /** + * Current tool metadata, or null when tools have not been initialized yet + */ + tools: CurrentToolMetadata[] | null; +} /** * Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation. * @@ -10184,6 +10280,11 @@ export function createServerRpc(connection: MessageConnection) { */ disable: async (params: McpConfigDisableRequest): Promise => connection.sendRequest("mcp.config.disable", params), + /** + * Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk. + */ + reload: async (): Promise => + connection.sendRequest("mcp.config.reload", {}), }, /** * Discovers MCP servers from user, workspace, plugin, and builtin sources. @@ -10215,6 +10316,15 @@ export function createServerRpc(connection: MessageConnection) { discover: async (params: SkillsDiscoverRequest): Promise => connection.sendRequest("skills.discover", params), }, + user: { + settings: { + /** + * Drops this runtime process's in-memory user settings cache so the next settings read observes disk. + */ + reload: async (): Promise => + connection.sendRequest("user.settings.reload", {}), + }, + }, sessionFs: { /** * Registers an SDK client as the session filesystem provider. @@ -10549,7 +10659,7 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin /** * Switches the session to a model and optional reasoning configuration. * - * @param params Target model identifier and optional reasoning effort, summary, and capability overrides. + * @param params Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. * * @returns The model identifier active on the session after the switch. */ @@ -10564,6 +10674,15 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ setReasoningEffort: async (params: ModelSetReasoningEffortRequest): Promise => connection.sendRequest("session.model.setReasoningEffort", { sessionId, ...params }), + /** + * Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's. + * + * @param params Optional listing options. + * + * @returns The list of models available to this session. + */ + list: async (params?: ModelListRequest): Promise => + connection.sendRequest("session.model.list", { sessionId, ...params }), }, /** @experimental */ mode: { @@ -11099,6 +11218,13 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin */ initializeAndValidate: async (): Promise => connection.sendRequest("session.tools.initializeAndValidate", { sessionId }), + /** + * Returns lightweight metadata for the session's currently initialized tools. + * + * @returns Current lightweight tool metadata snapshot for the session. + */ + getCurrentMetadata: async (): Promise => + connection.sendRequest("session.tools.getCurrentMetadata", { sessionId }), }, /** @experimental */ commands: { diff --git a/python/copilot/generated/rpc.py b/python/copilot/generated/rpc.py index 566601286..ddf62ae18 100644 --- a/python/copilot/generated/rpc.py +++ b/python/copilot/generated/rpc.py @@ -2311,6 +2311,10 @@ class SessionContextInfo: """Total context limit for /context display. promptTokenLimit + min(32k or 64k, outputTokenLimit) depending on model. """ + mcp_tools_tokens: int + """Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes + deferred tools) + """ model_name: str """The model used for token counting""" @@ -2333,12 +2337,13 @@ def from_dict(obj: Any) -> 'SessionContextInfo': compaction_threshold = from_int(obj.get("compactionThreshold")) conversation_tokens = from_int(obj.get("conversationTokens")) limit = from_int(obj.get("limit")) + mcp_tools_tokens = from_int(obj.get("mcpToolsTokens")) model_name = from_str(obj.get("modelName")) prompt_token_limit = from_int(obj.get("promptTokenLimit")) system_tokens = from_int(obj.get("systemTokens")) tool_definitions_tokens = from_int(obj.get("toolDefinitionsTokens")) total_tokens = from_int(obj.get("totalTokens")) - return SessionContextInfo(buffer_tokens, compaction_threshold, conversation_tokens, limit, model_name, prompt_token_limit, system_tokens, tool_definitions_tokens, total_tokens) + return SessionContextInfo(buffer_tokens, compaction_threshold, conversation_tokens, limit, mcp_tools_tokens, model_name, prompt_token_limit, system_tokens, tool_definitions_tokens, total_tokens) def to_dict(self) -> dict: result: dict = {} @@ -2346,6 +2351,7 @@ def to_dict(self) -> dict: result["compactionThreshold"] = from_int(self.compaction_threshold) result["conversationTokens"] = from_int(self.conversation_tokens) result["limit"] = from_int(self.limit) + result["mcpToolsTokens"] = from_int(self.mcp_tools_tokens) result["modelName"] = from_str(self.model_name) result["promptTokenLimit"] = from_int(self.prompt_token_limit) result["systemTokens"] = from_int(self.system_tokens) @@ -2711,6 +2717,26 @@ def to_dict(self) -> dict: result["vision"] = from_union([from_bool, from_none], self.vision) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ModelListRequest: + """Optional listing options.""" + + skip_cache: bool | None = None + """If true, bypasses the per-session model list cache and re-fetches from CAPI.""" + + @staticmethod + def from_dict(obj: Any) -> 'ModelListRequest': + assert isinstance(obj, dict) + skip_cache = from_union([from_bool, from_none], obj.get("skipCache")) + return ModelListRequest(skip_cache) + + def to_dict(self) -> dict: + result: dict = {} + if self.skip_cache is not None: + result["skipCache"] = from_union([from_bool, from_none], self.skip_cache) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ModelSetReasoningEffortRequest: @@ -2753,6 +2779,10 @@ def to_dict(self) -> dict: result["reasoningEffort"] = from_str(self.reasoning_effort) return result +class ContextTier(Enum): + DEFAULT = "default" + LONG_CONTEXT = "long_context" + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ModelSwitchToResult: @@ -4824,6 +4854,31 @@ def to_dict(self) -> dict: result["startupPrompts"] = from_list(from_str, self.startup_prompts) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class SessionModelList: + """The list of models available to this session.""" + + list: list[Any] + """Available models, ordered with the most preferred default first.""" + + quota_snapshots: dict[str, Any] | None = None + """Per-quota snapshots returned alongside the model list, keyed by quota type.""" + + @staticmethod + def from_dict(obj: Any) -> 'SessionModelList': + assert isinstance(obj, dict) + list = from_list(lambda x: x, obj.get("list")) + quota_snapshots = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("quotaSnapshots")) + return SessionModelList(list, quota_snapshots) + + def to_dict(self) -> dict: + result: dict = {} + result["list"] = from_list(lambda x: x, self.list) + if self.quota_snapshots is not None: + result["quotaSnapshots"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.quota_snapshots) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class SessionPruneResult: @@ -15045,6 +15100,60 @@ def to_dict(self) -> dict: result["logCapture"] = from_union([lambda x: to_class(AgentRegistryLogCapture, x), from_none], self.log_capture) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class CurrentToolMetadata: + """Lightweight metadata for a currently initialized session tool""" + + description: str + """Tool description""" + + name: str + """Model-facing tool name""" + + defer_loading: bool | None = None + """Whether the tool is loaded on demand via tool search""" + + input_schema: dict[str, Any] | None = None + """JSON Schema for tool input""" + + mcp_server_name: str | None = None + """MCP server name for MCP-backed tools""" + + mcp_tool_name: str | None = None + """Raw MCP tool name for MCP-backed tools""" + + namespaced_name: str | None = None + """Optional MCP/config namespaced tool name""" + + @staticmethod + def from_dict(obj: Any) -> 'CurrentToolMetadata': + assert isinstance(obj, dict) + description = from_str(obj.get("description")) + name = from_str(obj.get("name")) + defer_loading = from_union([from_bool, from_none], obj.get("deferLoading")) + input_schema = from_union([lambda x: from_dict(lambda x: x, x), from_none], obj.get("input_schema")) + mcp_server_name = from_union([from_str, from_none], obj.get("mcpServerName")) + mcp_tool_name = from_union([from_str, from_none], obj.get("mcpToolName")) + namespaced_name = from_union([from_str, from_none], obj.get("namespacedName")) + return CurrentToolMetadata(description, name, defer_loading, input_schema, mcp_server_name, mcp_tool_name, namespaced_name) + + def to_dict(self) -> dict: + result: dict = {} + result["description"] = from_str(self.description) + result["name"] = from_str(self.name) + if self.defer_loading is not None: + result["deferLoading"] = from_union([from_bool, from_none], self.defer_loading) + if self.input_schema is not None: + result["input_schema"] = from_union([lambda x: from_dict(lambda x: x, x), from_none], self.input_schema) + if self.mcp_server_name is not None: + result["mcpServerName"] = from_union([from_str, from_none], self.mcp_server_name) + if self.mcp_tool_name is not None: + result["mcpToolName"] = from_union([from_str, from_none], self.mcp_tool_name) + if self.namespaced_name is not None: + result["namespacedName"] = from_union([from_str, from_none], self.namespaced_name) + return result + # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class MCPExecuteSamplingParams: @@ -15256,11 +15365,17 @@ def to_dict(self) -> dict: # Experimental: this type is part of an experimental API and may change or be removed. @dataclass class ModelSwitchToRequest: - """Target model identifier and optional reasoning effort, summary, and capability overrides.""" - + """Target model identifier and optional reasoning effort, summary, capability overrides, and + context tier. + """ model_id: str """Model identifier to switch to""" + context_tier: ContextTier | None = None + """Explicit context tier for the selected model. `"default"` / `"long_context"` pin the + tier; `null` clears any previous explicit choice; `undefined` leaves the existing tier + untouched. + """ model_capabilities: ModelCapabilitiesOverride | None = None """Override individual model capabilities resolved by the runtime""" @@ -15274,14 +15389,17 @@ class ModelSwitchToRequest: def from_dict(obj: Any) -> 'ModelSwitchToRequest': assert isinstance(obj, dict) model_id = from_str(obj.get("modelId")) + context_tier = from_union([from_none, ContextTier], obj.get("contextTier")) model_capabilities = from_union([ModelCapabilitiesOverride.from_dict, from_none], obj.get("modelCapabilities")) reasoning_effort = from_union([from_str, from_none], obj.get("reasoningEffort")) reasoning_summary = from_union([ReasoningSummary, from_none], obj.get("reasoningSummary")) - return ModelSwitchToRequest(model_id, model_capabilities, reasoning_effort, reasoning_summary) + return ModelSwitchToRequest(model_id, context_tier, model_capabilities, reasoning_effort, reasoning_summary) def to_dict(self) -> dict: result: dict = {} result["modelId"] = from_str(self.model_id) + if self.context_tier is not None: + result["contextTier"] = from_union([from_none, lambda x: to_enum(ContextTier, x)], self.context_tier) if self.model_capabilities is not None: result["modelCapabilities"] = from_union([lambda x: to_class(ModelCapabilitiesOverride, x), from_none], self.model_capabilities) if self.reasoning_effort is not None: @@ -15439,6 +15557,25 @@ def to_dict(self) -> dict: result["result"] = from_union([from_str, from_none], self.result) return result +# Experimental: this type is part of an experimental API and may change or be removed. +@dataclass +class ToolsGetCurrentMetadataResult: + """Current lightweight tool metadata snapshot for the session.""" + + tools: list[CurrentToolMetadata] | None = None + """Current tool metadata, or null when tools have not been initialized yet""" + + @staticmethod + def from_dict(obj: Any) -> 'ToolsGetCurrentMetadataResult': + assert isinstance(obj, dict) + tools = from_union([lambda x: from_list(CurrentToolMetadata.from_dict, x), from_none], obj.get("tools")) + return ToolsGetCurrentMetadataResult(tools) + + def to_dict(self) -> dict: + result: dict = {} + result["tools"] = from_union([lambda x: from_list(lambda x: to_class(CurrentToolMetadata, x), x), from_none], self.tools) + return result + @dataclass class RPC: abort_request: AbortRequest @@ -15512,6 +15649,7 @@ class RPC: copilot_user_response_quota_snapshots_completions: CopilotUserResponseQuotaSnapshotsCompletions copilot_user_response_quota_snapshots_premium_interactions: CopilotUserResponseQuotaSnapshotsPremiumInteractions current_model: CurrentModel + current_tool_metadata: CurrentToolMetadata discovered_canvas: DiscoveredCanvas discovered_mcp_server: DiscoveredMCPServer discovered_mcp_server_type: DiscoveredMCPServerType @@ -15657,6 +15795,7 @@ class RPC: model_capabilities_override_supports: ModelCapabilitiesOverrideSupports model_capabilities_supports: ModelCapabilitiesSupports model_list: ModelList + model_list_request: ModelListRequest model_picker_category: ModelPickerCategory model_picker_price_category: ModelPickerPriceCategory model_policy: ModelPolicy @@ -15859,6 +15998,7 @@ class RPC: session_metadata: SessionMetadata session_metadata_snapshot: SessionMetadataSnapshot session_mode: SessionMode + session_model_list: SessionModelList session_prune_result: SessionPruneResult sessions_bulk_delete_request: SessionsBulkDeleteRequest sessions_check_in_use_request: SessionsCheckInUseRequest @@ -15951,6 +16091,7 @@ class RPC: token_auth_info: TokenAuthInfo tool: Tool tool_list: ToolList + tools_get_current_metadata_result: ToolsGetCurrentMetadataResult tools_initialize_and_validate_result: ToolsInitializeAndValidateResult tools_list_request: ToolsListRequest ui_auto_mode_switch_response: UIAutoModeSwitchResponse @@ -16092,6 +16233,7 @@ def from_dict(obj: Any) -> 'RPC': copilot_user_response_quota_snapshots_completions = CopilotUserResponseQuotaSnapshotsCompletions.from_dict(obj.get("CopilotUserResponseQuotaSnapshotsCompletions")) copilot_user_response_quota_snapshots_premium_interactions = CopilotUserResponseQuotaSnapshotsPremiumInteractions.from_dict(obj.get("CopilotUserResponseQuotaSnapshotsPremiumInteractions")) current_model = CurrentModel.from_dict(obj.get("CurrentModel")) + current_tool_metadata = CurrentToolMetadata.from_dict(obj.get("CurrentToolMetadata")) discovered_canvas = DiscoveredCanvas.from_dict(obj.get("DiscoveredCanvas")) discovered_mcp_server = DiscoveredMCPServer.from_dict(obj.get("DiscoveredMcpServer")) discovered_mcp_server_type = DiscoveredMCPServerType(obj.get("DiscoveredMcpServerType")) @@ -16237,6 +16379,7 @@ def from_dict(obj: Any) -> 'RPC': model_capabilities_override_supports = ModelCapabilitiesOverrideSupports.from_dict(obj.get("ModelCapabilitiesOverrideSupports")) model_capabilities_supports = ModelCapabilitiesSupports.from_dict(obj.get("ModelCapabilitiesSupports")) model_list = ModelList.from_dict(obj.get("ModelList")) + model_list_request = ModelListRequest.from_dict(obj.get("ModelListRequest")) model_picker_category = ModelPickerCategory(obj.get("ModelPickerCategory")) model_picker_price_category = ModelPickerPriceCategory(obj.get("ModelPickerPriceCategory")) model_policy = ModelPolicy.from_dict(obj.get("ModelPolicy")) @@ -16439,6 +16582,7 @@ def from_dict(obj: Any) -> 'RPC': session_metadata = SessionMetadata.from_dict(obj.get("SessionMetadata")) session_metadata_snapshot = SessionMetadataSnapshot.from_dict(obj.get("SessionMetadataSnapshot")) session_mode = SessionMode(obj.get("SessionMode")) + session_model_list = SessionModelList.from_dict(obj.get("SessionModelList")) session_prune_result = SessionPruneResult.from_dict(obj.get("SessionPruneResult")) sessions_bulk_delete_request = SessionsBulkDeleteRequest.from_dict(obj.get("SessionsBulkDeleteRequest")) sessions_check_in_use_request = SessionsCheckInUseRequest.from_dict(obj.get("SessionsCheckInUseRequest")) @@ -16531,6 +16675,7 @@ def from_dict(obj: Any) -> 'RPC': token_auth_info = TokenAuthInfo.from_dict(obj.get("TokenAuthInfo")) tool = Tool.from_dict(obj.get("Tool")) tool_list = ToolList.from_dict(obj.get("ToolList")) + tools_get_current_metadata_result = ToolsGetCurrentMetadataResult.from_dict(obj.get("ToolsGetCurrentMetadataResult")) tools_initialize_and_validate_result = ToolsInitializeAndValidateResult.from_dict(obj.get("ToolsInitializeAndValidateResult")) tools_list_request = ToolsListRequest.from_dict(obj.get("ToolsListRequest")) ui_auto_mode_switch_response = UIAutoModeSwitchResponse(obj.get("UIAutoModeSwitchResponse")) @@ -16597,7 +16742,7 @@ def from_dict(obj: Any) -> 'RPC': session_context_info = from_union([SessionContextInfo.from_dict, from_none], obj.get("SessionContextInfo")) task_progress = from_union([TaskProgress.from_dict, from_none], obj.get("TaskProgress")) workspace_summary = from_union([WorkspaceSummary.from_dict, from_none], obj.get("WorkspaceSummary")) - return RPC(abort_request, abort_result, account_get_quota_request, account_get_quota_result, account_quota_snapshot, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_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, agent_select_request, agent_select_result, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_instance_availability, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, discovered_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_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, installed_plugin, installed_plugin_source, installed_plugin_source_github, installed_plugin_source_local, installed_plugin_source_url, instructions_get_sources_result, instructions_sources, instructions_sources_location, instructions_sources_type, log_request, log_result, lsp_initialize_request, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_oauth_login_request, mcp_oauth_login_result, mcp_remove_git_hub_result, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_list, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_picker_category, model_picker_price_category, model_policy, model_policy_state, model_set_reasoning_effort_request, model_set_reasoning_effort_result, models_list_request, model_switch_to_request, model_switch_to_result, mode_set_request, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_env_value_mode, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_update_request, plugin, plugin_list, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, release_event_interest_params, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_mode, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachment, send_attachment_blob, send_attachment_directory, send_attachment_file, send_attachment_file_line_range, send_attachment_github_reference, send_attachment_github_reference_type, send_attachment_selection, send_attachment_selection_details, send_attachment_selection_details_end, send_attachment_selection_details_start, send_mode, send_request, send_result, server_skill, server_skill_list, session_auth_status, session_bulk_delete_result, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_github, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata, session_metadata_snapshot, session_mode, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_prune_old_request, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, session_update_options_params, session_update_options_result, session_working_directory_context, session_working_directory_context_host_type, shell_exec_request, shell_exec_result, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_initialize_and_validate_result, tools_list_request, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_info, task_progress, workspace_summary) + return RPC(abort_request, abort_result, account_get_quota_request, account_get_quota_result, account_quota_snapshot, agent_get_current_result, agent_info, agent_info_source, agent_list, agent_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, agent_select_request, agent_select_result, allow_all_permission_set_result, allow_all_permission_state, api_key_auth_info, auth_info, auth_info_type, canvas_action, canvas_action_invoke_request, canvas_action_invoke_result, canvas_close_request, canvas_host_context, canvas_host_context_capabilities, canvas_instance_availability, canvas_json_schema, canvas_list, canvas_list_open_result, canvas_open_request, canvas_provider_close_request, canvas_provider_invoke_action_request, canvas_provider_open_request, canvas_provider_open_result, canvas_session_context, command_list, commands_handle_pending_command_request, commands_handle_pending_command_result, commands_invoke_request, commands_list_request, commands_respond_to_queued_command_request, commands_respond_to_queued_command_result, connected_remote_session_metadata, connected_remote_session_metadata_kind, connected_remote_session_metadata_repository, connect_remote_session_params, connect_request, connect_result, content_filter_mode, copilot_api_token_auth_info, copilot_user_response, copilot_user_response_endpoints, copilot_user_response_quota_snapshots, copilot_user_response_quota_snapshots_chat, copilot_user_response_quota_snapshots_completions, copilot_user_response_quota_snapshots_premium_interactions, current_model, current_tool_metadata, discovered_canvas, discovered_mcp_server, discovered_mcp_server_type, enqueue_command_params, enqueue_command_result, env_auth_info, event_log_read_request, event_log_release_interest_result, event_log_tail_result, event_log_types, events_agent_scope, events_cursor_status, events_read_result, execute_command_params, execute_command_result, extension, extension_list, extensions_disable_request, extensions_enable_request, extension_source, extension_status, external_tool_result, external_tool_text_result_for_llm, external_tool_text_result_for_llm_binary_results_for_llm, external_tool_text_result_for_llm_binary_results_for_llm_type, external_tool_text_result_for_llm_content, external_tool_text_result_for_llm_content_audio, external_tool_text_result_for_llm_content_image, external_tool_text_result_for_llm_content_resource, external_tool_text_result_for_llm_content_resource_details, external_tool_text_result_for_llm_content_resource_link, external_tool_text_result_for_llm_content_resource_link_icon, external_tool_text_result_for_llm_content_resource_link_icon_theme, external_tool_text_result_for_llm_content_terminal, external_tool_text_result_for_llm_content_text, filter_mapping, fleet_start_request, fleet_start_result, folder_trust_add_params, folder_trust_check_params, folder_trust_check_result, gh_cli_auth_info, handle_pending_tool_call_request, handle_pending_tool_call_result, history_abort_manual_compaction_result, history_cancel_background_compaction_result, history_compact_context_window, history_compact_request, history_compact_result, history_summarize_for_handoff_result, history_truncate_request, history_truncate_result, hmac_auth_info, installed_plugin, installed_plugin_source, installed_plugin_source_github, installed_plugin_source_local, installed_plugin_source_url, instructions_get_sources_result, instructions_sources, instructions_sources_location, instructions_sources_type, log_request, log_result, lsp_initialize_request, mcp_apps_call_tool_request, mcp_apps_diagnose_capability, mcp_apps_diagnose_request, mcp_apps_diagnose_result, mcp_apps_diagnose_server, mcp_apps_host_context, mcp_apps_host_context_details, mcp_apps_host_context_details_available_display_mode, mcp_apps_host_context_details_display_mode, mcp_apps_host_context_details_platform, mcp_apps_host_context_details_theme, mcp_apps_list_tools_request, mcp_apps_list_tools_result, mcp_apps_read_resource_request, mcp_apps_read_resource_result, mcp_apps_resource_content, mcp_apps_set_host_context_details, mcp_apps_set_host_context_details_available_display_mode, mcp_apps_set_host_context_details_display_mode, mcp_apps_set_host_context_details_platform, mcp_apps_set_host_context_details_theme, mcp_apps_set_host_context_request, mcp_cancel_sampling_execution_params, mcp_cancel_sampling_execution_result, mcp_config_add_request, mcp_config_disable_request, mcp_config_enable_request, mcp_config_list, mcp_config_remove_request, mcp_config_update_request, mcp_disable_request, mcp_discover_request, mcp_discover_result, mcp_enable_request, mcp_execute_sampling_params, mcp_execute_sampling_request, mcp_execute_sampling_result, mcp_oauth_login_request, mcp_oauth_login_result, mcp_remove_git_hub_result, mcp_sampling_execution_action, mcp_sampling_execution_result, mcp_server, mcp_server_auth_config, mcp_server_auth_config_redirect_port, mcp_server_config, mcp_server_config_http, mcp_server_config_http_oauth_grant_type, mcp_server_config_http_type, mcp_server_config_stdio, mcp_server_list, mcp_set_env_value_mode_details, mcp_set_env_value_mode_params, mcp_set_env_value_mode_result, metadata_context_info_request, metadata_context_info_result, metadata_is_processing_result, metadata_recompute_context_tokens_request, metadata_recompute_context_tokens_result, metadata_record_context_change_request, metadata_record_context_change_result, metadata_set_working_directory_request, metadata_set_working_directory_result, metadata_snapshot_current_mode, metadata_snapshot_remote_metadata, metadata_snapshot_remote_metadata_repository, metadata_snapshot_remote_metadata_task_type, model, model_billing, model_billing_token_prices, model_billing_token_prices_long_context, model_capabilities, model_capabilities_limits, model_capabilities_limits_vision, model_capabilities_override, model_capabilities_override_limits, model_capabilities_override_limits_vision, model_capabilities_override_supports, model_capabilities_supports, model_list, model_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, name_get_result, name_set_auto_request, name_set_auto_result, name_set_request, open_canvas_instance, options_update_env_value_mode, options_update_tool_filter_precedence, pending_permission_request, pending_permission_request_list, permission_decision, permission_decision_approved, permission_decision_approved_for_location, permission_decision_approved_for_session, permission_decision_approve_for_location, permission_decision_approve_for_location_approval, permission_decision_approve_for_location_approval_commands, permission_decision_approve_for_location_approval_custom_tool, permission_decision_approve_for_location_approval_extension_management, permission_decision_approve_for_location_approval_extension_permission_access, permission_decision_approve_for_location_approval_mcp, permission_decision_approve_for_location_approval_mcp_sampling, permission_decision_approve_for_location_approval_memory, permission_decision_approve_for_location_approval_read, permission_decision_approve_for_location_approval_write, permission_decision_approve_for_session, permission_decision_approve_for_session_approval, permission_decision_approve_for_session_approval_commands, permission_decision_approve_for_session_approval_custom_tool, permission_decision_approve_for_session_approval_extension_management, permission_decision_approve_for_session_approval_extension_permission_access, permission_decision_approve_for_session_approval_mcp, permission_decision_approve_for_session_approval_mcp_sampling, permission_decision_approve_for_session_approval_memory, permission_decision_approve_for_session_approval_read, permission_decision_approve_for_session_approval_write, permission_decision_approve_once, permission_decision_approve_permanently, permission_decision_cancelled, permission_decision_denied_by_content_exclusion_policy, permission_decision_denied_by_permission_request_hook, permission_decision_denied_by_rules, permission_decision_denied_interactively_by_user, permission_decision_denied_no_approval_rule_and_could_not_request_from_user, permission_decision_reject, permission_decision_request, permission_decision_user_not_available, permission_location_add_tool_approval_params, permission_location_apply_params, permission_location_apply_result, permission_location_resolve_params, permission_location_resolve_result, permission_location_type, permission_paths_add_params, permission_paths_allowed_check_params, permission_paths_allowed_check_result, permission_paths_config, permission_paths_list, permission_paths_update_primary_params, permission_paths_workspace_check_params, permission_paths_workspace_check_result, permission_prompt_shown_notification, permission_request_result, permission_rules_set, permissions_configure_additional_content_exclusion_policy, permissions_configure_additional_content_exclusion_policy_rule, permissions_configure_additional_content_exclusion_policy_rule_source, permissions_configure_additional_content_exclusion_policy_scope, permissions_configure_params, permissions_configure_result, permissions_folder_trust_add_trusted_result, permissions_get_allow_all_request, permissions_locations_add_tool_approval_details, permissions_locations_add_tool_approval_details_commands, permissions_locations_add_tool_approval_details_custom_tool, permissions_locations_add_tool_approval_details_extension_management, permissions_locations_add_tool_approval_details_extension_permission_access, permissions_locations_add_tool_approval_details_mcp, permissions_locations_add_tool_approval_details_mcp_sampling, permissions_locations_add_tool_approval_details_memory, permissions_locations_add_tool_approval_details_read, permissions_locations_add_tool_approval_details_write, permissions_locations_add_tool_approval_result, permissions_modify_rules_params, permissions_modify_rules_result, permissions_modify_rules_scope, permissions_notify_prompt_shown_result, permissions_paths_add_result, permissions_paths_list_request, permissions_paths_update_primary_result, permissions_pending_requests_request, permissions_reset_session_approvals_request, permissions_reset_session_approvals_result, permissions_set_allow_all_request, permissions_set_approve_all_request, permissions_set_approve_all_result, permissions_set_approve_all_source, permissions_set_required_request, permissions_set_required_result, permissions_urls_set_unrestricted_mode_result, permission_urls_config, permission_urls_set_unrestricted_mode_params, ping_request, ping_result, plan_read_result, plan_update_request, plugin, plugin_list, queued_command_handled, queued_command_not_handled, queued_command_result, queue_pending_items, queue_pending_items_kind, queue_pending_items_result, queue_remove_most_recent_result, register_event_interest_params, register_event_interest_result, release_event_interest_params, remote_enable_request, remote_enable_result, remote_notify_steerable_changed_request, remote_notify_steerable_changed_result, remote_session_connection_result, remote_session_mode, schedule_entry, schedule_list, schedule_stop_request, schedule_stop_result, secrets_add_filter_values_request, secrets_add_filter_values_result, send_agent_mode, send_attachment, send_attachment_blob, send_attachment_directory, send_attachment_file, send_attachment_file_line_range, send_attachment_github_reference, send_attachment_github_reference_type, send_attachment_selection, send_attachment_selection_details, send_attachment_selection_details_end, send_attachment_selection_details_start, send_mode, send_request, send_result, server_skill, server_skill_list, session_auth_status, session_bulk_delete_result, session_context, session_context_host_type, session_enrich_metadata_result, session_fs_append_file_request, session_fs_error, session_fs_error_code, session_fs_exists_request, session_fs_exists_result, session_fs_mkdir_request, session_fs_readdir_request, session_fs_readdir_result, session_fs_readdir_with_types_entry, session_fs_readdir_with_types_entry_type, session_fs_readdir_with_types_request, session_fs_readdir_with_types_result, session_fs_read_file_request, session_fs_read_file_result, session_fs_rename_request, session_fs_rm_request, session_fs_set_provider_capabilities, session_fs_set_provider_conventions, session_fs_set_provider_request, session_fs_set_provider_result, session_fs_sqlite_exists_request, session_fs_sqlite_exists_result, session_fs_sqlite_query_request, session_fs_sqlite_query_result, session_fs_sqlite_query_type, session_fs_stat_request, session_fs_stat_result, session_fs_write_file_request, session_installed_plugin, session_installed_plugin_source, session_installed_plugin_source_github, session_installed_plugin_source_local, session_installed_plugin_source_url, session_list, session_list_filter, session_load_deferred_repo_hooks_result, session_log_level, session_mcp_apps_call_tool_result, session_metadata, session_metadata_snapshot, session_mode, session_model_list, session_prune_result, sessions_bulk_delete_request, sessions_check_in_use_request, sessions_check_in_use_result, sessions_close_request, sessions_close_result, sessions_enrich_metadata_request, session_set_credentials_params, session_set_credentials_result, sessions_find_by_prefix_request, sessions_find_by_prefix_result, sessions_find_by_task_id_request, sessions_find_by_task_id_result, sessions_fork_request, sessions_fork_result, sessions_get_event_file_path_request, sessions_get_event_file_path_result, sessions_get_last_for_context_request, sessions_get_last_for_context_result, sessions_get_persisted_remote_steerable_request, sessions_get_persisted_remote_steerable_result, session_sizes, sessions_list_request, sessions_load_deferred_repo_hooks_request, sessions_prune_old_request, sessions_release_lock_request, sessions_release_lock_result, sessions_reload_plugin_hooks_request, sessions_reload_plugin_hooks_result, sessions_save_request, sessions_save_result, sessions_set_additional_plugins_request, sessions_set_additional_plugins_result, session_update_options_params, session_update_options_result, session_working_directory_context, session_working_directory_context_host_type, shell_exec_request, shell_exec_result, shell_kill_request, shell_kill_result, shell_kill_signal, shutdown_request, skill, skill_list, skills_config_set_disabled_skills_request, skills_disable_request, skills_discover_request, skills_enable_request, skills_get_invoked_result, skills_invoked_skill, skills_load_diagnostics, slash_command_agent_prompt_result, slash_command_completed_result, slash_command_info, slash_command_input, slash_command_input_completion, slash_command_invocation_result, slash_command_kind, slash_command_select_subcommand_option, slash_command_select_subcommand_result, slash_command_text_result, task_agent_info, task_agent_progress, task_execution_mode, task_info, task_list, task_progress_line, tasks_cancel_request, tasks_cancel_result, tasks_get_current_promotable_result, tasks_get_progress_request, tasks_get_progress_result, task_shell_info, task_shell_info_attachment_mode, task_shell_progress, tasks_promote_current_to_background_result, tasks_promote_to_background_request, tasks_promote_to_background_result, tasks_refresh_result, tasks_remove_request, tasks_remove_result, tasks_send_message_request, tasks_send_message_result, tasks_start_agent_request, tasks_start_agent_result, task_status, tasks_wait_for_pending_result, telemetry_set_feature_overrides_request, token_auth_info, tool, tool_list, tools_get_current_metadata_result, tools_initialize_and_validate_result, tools_list_request, ui_auto_mode_switch_response, ui_elicitation_array_any_of_field, ui_elicitation_array_any_of_field_items, ui_elicitation_array_any_of_field_items_any_of, ui_elicitation_array_enum_field, ui_elicitation_array_enum_field_items, ui_elicitation_field_value, ui_elicitation_request, ui_elicitation_response, ui_elicitation_response_action, ui_elicitation_response_content, ui_elicitation_result, ui_elicitation_schema, ui_elicitation_schema_property, ui_elicitation_schema_property_boolean, ui_elicitation_schema_property_number, ui_elicitation_schema_property_number_type, ui_elicitation_schema_property_string, ui_elicitation_schema_property_string_format, ui_elicitation_string_enum_field, ui_elicitation_string_one_of_field, ui_elicitation_string_one_of_field_one_of, ui_exit_plan_mode_action, ui_exit_plan_mode_response, ui_handle_pending_auto_mode_switch_request, ui_handle_pending_elicitation_request, ui_handle_pending_exit_plan_mode_request, ui_handle_pending_result, ui_handle_pending_sampling_request, ui_handle_pending_sampling_response, ui_handle_pending_user_input_request, ui_register_direct_auto_mode_switch_handler_result, ui_unregister_direct_auto_mode_switch_handler_request, ui_unregister_direct_auto_mode_switch_handler_result, ui_user_input_response, usage_get_metrics_result, usage_metrics_code_changes, usage_metrics_model_metric, usage_metrics_model_metric_requests, usage_metrics_model_metric_token_detail, usage_metrics_model_metric_usage, usage_metrics_token_detail, user_auth_info, workspace_diff_file_change, workspace_diff_file_change_type, workspace_diff_mode, workspace_diff_result, workspaces_checkpoints, workspaces_create_file_request, workspaces_diff_request, workspaces_get_workspace_result, workspaces_list_checkpoints_result, workspaces_list_files_result, workspaces_read_checkpoint_request, workspaces_read_checkpoint_result, workspaces_read_file_request, workspaces_read_file_result, workspaces_save_large_paste_request, workspaces_save_large_paste_result, workspace_summary_host_type, workspaces_workspace_details_host_type, session_context_info, task_progress, workspace_summary) def to_dict(self) -> dict: result: dict = {} @@ -16672,6 +16817,7 @@ def to_dict(self) -> dict: result["CopilotUserResponseQuotaSnapshotsCompletions"] = to_class(CopilotUserResponseQuotaSnapshotsCompletions, self.copilot_user_response_quota_snapshots_completions) result["CopilotUserResponseQuotaSnapshotsPremiumInteractions"] = to_class(CopilotUserResponseQuotaSnapshotsPremiumInteractions, self.copilot_user_response_quota_snapshots_premium_interactions) result["CurrentModel"] = to_class(CurrentModel, self.current_model) + result["CurrentToolMetadata"] = to_class(CurrentToolMetadata, self.current_tool_metadata) result["DiscoveredCanvas"] = to_class(DiscoveredCanvas, self.discovered_canvas) result["DiscoveredMcpServer"] = to_class(DiscoveredMCPServer, self.discovered_mcp_server) result["DiscoveredMcpServerType"] = to_enum(DiscoveredMCPServerType, self.discovered_mcp_server_type) @@ -16817,6 +16963,7 @@ def to_dict(self) -> dict: result["ModelCapabilitiesOverrideSupports"] = to_class(ModelCapabilitiesOverrideSupports, self.model_capabilities_override_supports) result["ModelCapabilitiesSupports"] = to_class(ModelCapabilitiesSupports, self.model_capabilities_supports) result["ModelList"] = to_class(ModelList, self.model_list) + result["ModelListRequest"] = to_class(ModelListRequest, self.model_list_request) result["ModelPickerCategory"] = to_enum(ModelPickerCategory, self.model_picker_category) result["ModelPickerPriceCategory"] = to_enum(ModelPickerPriceCategory, self.model_picker_price_category) result["ModelPolicy"] = to_class(ModelPolicy, self.model_policy) @@ -17019,6 +17166,7 @@ def to_dict(self) -> dict: result["SessionMetadata"] = to_class(SessionMetadata, self.session_metadata) result["SessionMetadataSnapshot"] = to_class(SessionMetadataSnapshot, self.session_metadata_snapshot) result["SessionMode"] = to_enum(SessionMode, self.session_mode) + result["SessionModelList"] = to_class(SessionModelList, self.session_model_list) result["SessionPruneResult"] = to_class(SessionPruneResult, self.session_prune_result) result["SessionsBulkDeleteRequest"] = to_class(SessionsBulkDeleteRequest, self.sessions_bulk_delete_request) result["SessionsCheckInUseRequest"] = to_class(SessionsCheckInUseRequest, self.sessions_check_in_use_request) @@ -17111,6 +17259,7 @@ def to_dict(self) -> dict: result["TokenAuthInfo"] = to_class(TokenAuthInfo, self.token_auth_info) result["Tool"] = to_class(Tool, self.tool) result["ToolList"] = to_class(ToolList, self.tool_list) + result["ToolsGetCurrentMetadataResult"] = to_class(ToolsGetCurrentMetadataResult, self.tools_get_current_metadata_result) result["ToolsInitializeAndValidateResult"] = to_class(ToolsInitializeAndValidateResult, self.tools_initialize_and_validate_result) result["ToolsListRequest"] = to_class(ToolsListRequest, self.tools_list_request) result["UIAutoModeSwitchResponse"] = to_enum(UIAutoModeSwitchResponse, self.ui_auto_mode_switch_response) @@ -17482,6 +17631,10 @@ async def disable(self, params: MCPConfigDisableRequest, *, timeout: float | Non params_dict = {k: v for k, v in params.to_dict().items() if v is not None} await self._client.request("mcp.config.disable", params_dict, **_timeout_kwargs(timeout)) + async def reload(self, *, timeout: float | None = None) -> None: + "Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk." + await self._client.request("mcp.config.reload", {}, **_timeout_kwargs(timeout)) + class ServerMcpApi: def __init__(self, client: "JsonRpcClient"): @@ -17515,6 +17668,21 @@ async def discover(self, params: SkillsDiscoverRequest, *, timeout: float | None return ServerSkillList.from_dict(await self._client.request("skills.discover", params_dict, **_timeout_kwargs(timeout))) +class ServerUserSettingsApi: + def __init__(self, client: "JsonRpcClient"): + self._client = client + + async def reload(self, *, timeout: float | None = None) -> None: + "Drops this runtime process's in-memory user settings cache so the next settings read observes disk." + await self._client.request("user.settings.reload", {}, **_timeout_kwargs(timeout)) + + +class ServerUserApi: + def __init__(self, client: "JsonRpcClient"): + self._client = client + self.settings = ServerUserSettingsApi(client) + + class ServerSessionFsApi: def __init__(self, client: "JsonRpcClient"): self._client = client @@ -17646,6 +17814,7 @@ def __init__(self, client: "JsonRpcClient"): self.secrets = ServerSecretsApi(client) self.mcp = ServerMcpApi(client) self.skills = ServerSkillsApi(client) + self.user = ServerUserApi(client) self.session_fs = ServerSessionFsApi(client) self.sessions = ServerSessionsApi(client) self.agent_registry = ServerAgentRegistryApi(client) @@ -17736,7 +17905,7 @@ async def get_current(self, *, timeout: float | None = None) -> CurrentModel: return CurrentModel.from_dict(await self._client.request("session.model.getCurrent", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) async def switch_to(self, params: ModelSwitchToRequest, *, timeout: float | None = None) -> ModelSwitchToResult: - "Switches the session to a model and optional reasoning configuration.\n\nArgs:\n params: Target model identifier and optional reasoning effort, summary, and capability overrides.\n\nReturns:\n The model identifier active on the session after the switch." + "Switches the session to a model and optional reasoning configuration.\n\nArgs:\n params: Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.\n\nReturns:\n The model identifier active on the session after the switch." 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 ModelSwitchToResult.from_dict(await self._client.request("session.model.switchTo", params_dict, **_timeout_kwargs(timeout))) @@ -17747,6 +17916,12 @@ async def set_reasoning_effort(self, params: ModelSetReasoningEffortRequest, *, params_dict["sessionId"] = self._session_id return ModelSetReasoningEffortResult.from_dict(await self._client.request("session.model.setReasoningEffort", params_dict, **_timeout_kwargs(timeout))) + async def list(self, params: ModelListRequest | None = None, *, timeout: float | None = None) -> SessionModelList: + "Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.\n\nArgs:\n params: Optional listing options.\n\nReturns:\n The list of models available to this session." + params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} if params is not None else {} + params_dict["sessionId"] = self._session_id + return SessionModelList.from_dict(await self._client.request("session.model.list", params_dict, **_timeout_kwargs(timeout))) + # Experimental: this API group is experimental and may change or be removed. class ModeApi: @@ -18194,6 +18369,10 @@ async def initialize_and_validate(self, *, timeout: float | None = None) -> Tool "Resolves, builds, and validates the runtime tool list for the session.\n\nReturns:\n Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation." return ToolsInitializeAndValidateResult.from_dict(await self._client.request("session.tools.initializeAndValidate", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + async def get_current_metadata(self, *, timeout: float | None = None) -> ToolsGetCurrentMetadataResult: + "Returns lightweight metadata for the session's currently initialized tools.\n\nReturns:\n Current lightweight tool metadata snapshot for the session." + return ToolsGetCurrentMetadataResult.from_dict(await self._client.request("session.tools.getCurrentMetadata", {"sessionId": self._session_id}, **_timeout_kwargs(timeout))) + # Experimental: this API group is experimental and may change or be removed. class CommandsApi: diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index d354f8732..aee77847d 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -38,12 +38,16 @@ pub mod rpc_methods { pub const MCP_CONFIG_ENABLE: &str = "mcp.config.enable"; /// `mcp.config.disable` pub const MCP_CONFIG_DISABLE: &str = "mcp.config.disable"; + /// `mcp.config.reload` + pub const MCP_CONFIG_RELOAD: &str = "mcp.config.reload"; /// `mcp.discover` pub const MCP_DISCOVER: &str = "mcp.discover"; /// `skills.config.setDisabledSkills` pub const SKILLS_CONFIG_SETDISABLEDSKILLS: &str = "skills.config.setDisabledSkills"; /// `skills.discover` pub const SKILLS_DISCOVER: &str = "skills.discover"; + /// `user.settings.reload` + pub const USER_SETTINGS_RELOAD: &str = "user.settings.reload"; /// `sessionFs.setProvider` pub const SESSIONFS_SETPROVIDER: &str = "sessionFs.setProvider"; /// `sessions.fork` @@ -114,6 +118,8 @@ pub mod rpc_methods { pub const SESSION_MODEL_SWITCHTO: &str = "session.model.switchTo"; /// `session.model.setReasoningEffort` pub const SESSION_MODEL_SETREASONINGEFFORT: &str = "session.model.setReasoningEffort"; + /// `session.model.list` + pub const SESSION_MODEL_LIST: &str = "session.model.list"; /// `session.mode.get` pub const SESSION_MODE_GET: &str = "session.mode.get"; /// `session.mode.set` @@ -243,6 +249,8 @@ pub mod rpc_methods { pub const SESSION_TOOLS_HANDLEPENDINGTOOLCALL: &str = "session.tools.handlePendingToolCall"; /// `session.tools.initializeAndValidate` pub const SESSION_TOOLS_INITIALIZEANDVALIDATE: &str = "session.tools.initializeAndValidate"; + /// `session.tools.getCurrentMetadata` + pub const SESSION_TOOLS_GETCURRENTMETADATA: &str = "session.tools.getCurrentMetadata"; /// `session.commands.list` pub const SESSION_COMMANDS_LIST: &str = "session.commands.list"; /// `session.commands.invoke` @@ -1794,6 +1802,38 @@ pub struct CurrentModel { pub reasoning_effort: Option, } +/// Lightweight metadata for a currently initialized session tool +/// +///
+/// +/// **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 CurrentToolMetadata { + /// Whether the tool is loaded on demand via tool search + #[serde(skip_serializing_if = "Option::is_none")] + pub defer_loading: Option, + /// Tool description + pub description: String, + /// JSON Schema for tool input + #[serde(rename = "input_schema", skip_serializing_if = "Option::is_none")] + pub input_schema: Option>, + /// MCP server name for MCP-backed tools + #[serde(skip_serializing_if = "Option::is_none")] + pub mcp_server_name: Option, + /// Raw MCP tool name for MCP-backed tools + #[serde(skip_serializing_if = "Option::is_none")] + pub mcp_tool_name: Option, + /// Model-facing tool name + pub name: String, + /// Optional MCP/config namespaced tool name + #[serde(skip_serializing_if = "Option::is_none")] + pub namespaced_name: Option, +} + /// Schema for the `DiscoveredMcpServer` type. #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -3469,6 +3509,8 @@ pub struct MetadataContextInfoResultContextInfo { pub conversation_tokens: i64, /// Total context limit for /context display. promptTokenLimit + min(32k or 64k, outputTokenLimit) depending on model. pub limit: i64, + /// Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools) + pub mcp_tools_tokens: i64, /// The model used for token counting pub model_name: String, /// Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified) @@ -3938,6 +3980,22 @@ pub struct ModelList { pub models: Vec, } +/// Optional listing options. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelListRequest { + /// If true, bypasses the per-session model list cache and re-fetches from CAPI. + #[serde(skip_serializing_if = "Option::is_none")] + pub skip_cache: Option, +} + /// Reasoning effort level to apply to the currently selected model. /// ///
@@ -3977,7 +4035,7 @@ pub struct ModelsListRequest { pub git_hub_token: Option, } -/// Target model identifier and optional reasoning effort, summary, and capability overrides. +/// Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. /// ///
/// @@ -3988,6 +4046,9 @@ pub struct ModelsListRequest { #[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ModelSwitchToRequest { + /// Explicit context tier for the selected model. `"default"` / `"long_context"` pin the tier; `null` clears any previous explicit choice; `undefined` leaves the existing tier untouched. + #[serde(skip_serializing_if = "Option::is_none")] + pub context_tier: Option, /// Override individual model capabilities resolved by the runtime #[serde(skip_serializing_if = "Option::is_none")] pub model_capabilities: Option, @@ -6282,6 +6343,8 @@ pub struct SessionContextInfo { pub conversation_tokens: i64, /// Total context limit for /context display. promptTokenLimit + min(32k or 64k, outputTokenLimit) depending on model. pub limit: i64, + /// Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools) + pub mcp_tools_tokens: i64, /// The model used for token counting pub model_name: String, /// Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified) @@ -6988,6 +7051,24 @@ pub struct SessionMetadataSnapshot { pub workspace_path: Option, } +/// The list of models available to this session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionModelList { + /// Available models, ordered with the most preferred default first. + pub list: Vec, + /// Per-quota snapshots returned alongside the model list, keyed by quota type. + #[serde(skip_serializing_if = "Option::is_none")] + pub quota_snapshots: Option>, +} + /// Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag. /// ///
@@ -8515,6 +8596,21 @@ pub struct ToolList { pub tools: Vec, } +/// Current lightweight tool metadata snapshot for the session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ToolsGetCurrentMetadataResult { + /// Current tool metadata, or null when tools have not been initialized yet + pub tools: Option>, +} + /// Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation. /// ///
@@ -10034,6 +10130,24 @@ pub struct SessionModelSetReasoningEffortResult { pub reasoning_effort: String, } +/// The list of models available to this session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionModelListResult { + /// Available models, ordered with the most preferred default first. + pub list: Vec, + /// Per-quota snapshots returned alongside the model list, keyed by quota type. + #[serde(skip_serializing_if = "Option::is_none")] + pub quota_snapshots: Option>, +} + /// Identifies the target session. /// ///
@@ -11220,6 +11334,36 @@ pub struct SessionToolsInitializeAndValidateParams { #[serde(rename_all = "camelCase")] pub struct SessionToolsInitializeAndValidateResult {} +/// Identifies the target session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionToolsGetCurrentMetadataParams { + /// Target session identifier + pub session_id: SessionId, +} + +/// Current lightweight tool metadata snapshot for the session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SessionToolsGetCurrentMetadataResult { + /// Current tool metadata, or null when tools have not been initialized yet + pub tools: Option>, +} + /// Slash commands available in the session, after applying any include/exclude filters. /// ///
@@ -11915,6 +12059,8 @@ pub struct SessionMetadataContextInfoResultContextInfo { pub conversation_tokens: i64, /// Total context limit for /context display. promptTokenLimit + min(32k or 64k, outputTokenLimit) depending on model. pub limit: i64, + /// Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools) + pub mcp_tools_tokens: i64, /// The model used for token counting pub model_name: String, /// Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified) @@ -13732,6 +13878,20 @@ pub enum ModelPolicyState { Unknown, } +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ModelSwitchToRequestContextTier { + /// Use the model's default context window. + #[serde(rename = "default")] + Default, + /// Pin the session to the long-context tier when supported. + #[serde(rename = "long_context")] + LongContext, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch). /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 34dcc8ae7..25726978e 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -83,6 +83,13 @@ impl<'a> ClientRpc<'a> { } } + /// `user.*` sub-namespace. + pub fn user(&self) -> ClientRpcUser<'a> { + ClientRpcUser { + client: self.client, + } + } + /// Checks server responsiveness and returns protocol information. /// /// Wire method: `ping`. @@ -347,6 +354,18 @@ impl<'a> ClientRpcMcpConfig<'a> { .await?; Ok(()) } + + /// Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk. + /// + /// Wire method: `mcp.config.reload`. + pub async fn reload(&self) -> Result<(), Error> { + let wire_params = serde_json::json!({}); + let _value = self + .client + .call(rpc_methods::MCP_CONFIG_RELOAD, Some(wire_params)) + .await?; + Ok(()) + } } /// `models.*` RPCs. @@ -1162,6 +1181,41 @@ impl<'a> ClientRpcTools<'a> { } } +/// `user.*` RPCs. +#[derive(Clone, Copy)] +pub struct ClientRpcUser<'a> { + pub(crate) client: &'a Client, +} + +impl<'a> ClientRpcUser<'a> { + /// `user.settings.*` sub-namespace. + pub fn settings(&self) -> ClientRpcUserSettings<'a> { + ClientRpcUserSettings { + client: self.client, + } + } +} + +/// `user.settings.*` RPCs. +#[derive(Clone, Copy)] +pub struct ClientRpcUserSettings<'a> { + pub(crate) client: &'a Client, +} + +impl<'a> ClientRpcUserSettings<'a> { + /// Drops this runtime process's in-memory user settings cache so the next settings read observes disk. + /// + /// Wire method: `user.settings.reload`. + pub async fn reload(&self) -> Result<(), Error> { + let wire_params = serde_json::json!({}); + let _value = self + .client + .call(rpc_methods::USER_SETTINGS_RELOAD, Some(wire_params)) + .await?; + Ok(()) + } +} + /// Typed view over a [`Session`]'s RPC namespace. #[derive(Clone, Copy)] pub struct SessionRpc<'a> { @@ -3439,7 +3493,7 @@ impl<'a> SessionRpcModel<'a> { /// /// # Parameters /// - /// * `params` - Target model identifier and optional reasoning effort, summary, and capability overrides. + /// * `params` - Target model identifier and optional reasoning effort, summary, capability overrides, and context tier. /// /// # Returns /// @@ -3501,6 +3555,64 @@ impl<'a> SessionRpcModel<'a> { .await?; Ok(serde_json::from_value(_value)?) } + + /// Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's. + /// + /// Wire method: `session.model.list`. + /// + /// # Returns + /// + /// The list of models available to this session. + /// + ///
+ /// + /// **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) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call(rpc_methods::SESSION_MODEL_LIST, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's. + /// + /// Wire method: `session.model.list`. + /// + /// # Parameters + /// + /// * `params` - Optional listing options. + /// + /// # Returns + /// + /// The list of models available to this session. + /// + ///
+ /// + /// **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_with_params( + &self, + params: ModelListRequest, + ) -> 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_MODEL_LIST, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } } /// `session.name.*` RPCs. @@ -5450,6 +5562,34 @@ impl<'a> SessionRpcTools<'a> { .await?; Ok(serde_json::from_value(_value)?) } + + /// Returns lightweight metadata for the session's currently initialized tools. + /// + /// Wire method: `session.tools.getCurrentMetadata`. + /// + /// # Returns + /// + /// Current lightweight tool metadata snapshot for the session. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn get_current_metadata(&self) -> Result { + let wire_params = serde_json::json!({ "sessionId": self.session.id() }); + let _value = self + .session + .client() + .call( + rpc_methods::SESSION_TOOLS_GETCURRENTMETADATA, + Some(wire_params), + ) + .await?; + Ok(serde_json::from_value(_value)?) + } } /// `session.ui.*` RPCs. diff --git a/rust/src/session.rs b/rust/src/session.rs index 1fcf433a5..58570ab6b 100644 --- a/rust/src/session.rs +++ b/rust/src/session.rs @@ -525,6 +525,7 @@ impl Session { reasoning_effort: opts.reasoning_effort, reasoning_summary: opts.reasoning_summary, model_capabilities: opts.model_capabilities, + ..ModelSwitchToRequest::default() }; self.rpc().model().switch_to(request).await?; Ok(()) diff --git a/rust/tests/e2e/rpc_session_state.rs b/rust/tests/e2e/rpc_session_state.rs index 80b6d1bfb..956a8c90e 100644 --- a/rust/tests/e2e/rpc_session_state.rs +++ b/rust/tests/e2e/rpc_session_state.rs @@ -75,6 +75,7 @@ async fn should_call_session_rpc_model_switchto() { reasoning_effort: Some("none".to_string()), model_capabilities: None, reasoning_summary: None, + ..Default::default() }) .await .expect("switch model"); diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 66987acd5..37f3b1a88 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.55-7", + "@github/copilot": "^1.0.55", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14", @@ -464,9 +464,9 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.55-7.tgz", - "integrity": "sha512-TczFrIaHH2sel6FM007H4FzT+Ipkj++I5u8Vx2ECWz9u24H7WOx/RpWcp6ExnSY1KSK1MtXaGcniAuqVi8Khaw==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.55.tgz", + "integrity": "sha512-wqzI0L7krORW6jDAQPx7VnInka5BYN5yVgu+dpUK4w8xP5RgnOBa6kRoXpydj/9O1ufs0k6RKRtQjsVLp52TRw==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { @@ -476,20 +476,20 @@ "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.55-7", - "@github/copilot-darwin-x64": "1.0.55-7", - "@github/copilot-linux-arm64": "1.0.55-7", - "@github/copilot-linux-x64": "1.0.55-7", - "@github/copilot-linuxmusl-arm64": "1.0.55-7", - "@github/copilot-linuxmusl-x64": "1.0.55-7", - "@github/copilot-win32-arm64": "1.0.55-7", - "@github/copilot-win32-x64": "1.0.55-7" + "@github/copilot-darwin-arm64": "1.0.55", + "@github/copilot-darwin-x64": "1.0.55", + "@github/copilot-linux-arm64": "1.0.55", + "@github/copilot-linux-x64": "1.0.55", + "@github/copilot-linuxmusl-arm64": "1.0.55", + "@github/copilot-linuxmusl-x64": "1.0.55", + "@github/copilot-win32-arm64": "1.0.55", + "@github/copilot-win32-x64": "1.0.55" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.55-7.tgz", - "integrity": "sha512-QReU4F5+W0x/Nuc6qO+xYPeNnRjuHIIAeMBc1S+RFQ0T+YWynxRzNHGs9ZkUiIcLJ1F/y8GDq6sq7760Cn+onQ==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.55.tgz", + "integrity": "sha512-v59pOpA7YO8j/lpDU/1E8l1Ag0hd26hIiEzTNbzqKd7tJpvhN0XTDWDCink50wXL656XIXt8lD8i8sGeD6yPfA==", "cpu": [ "arm64" ], @@ -504,9 +504,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.55-7.tgz", - "integrity": "sha512-qQ0d+XyvIPbNiaIydHBSCTQfWK5s0x1XnlrUKSzadgOnsFobGeldLSKtB159zJEiz0F/in5ythiUGJjWoAQVrA==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.55.tgz", + "integrity": "sha512-XrJ9ent/9ogLk8yNp3TMsNVW0qTRDlkw/b34VnTgbAkJCaI3UVqaqpFn60Laa6J5mOPW0/JeKIkkva+7IJdqpQ==", "cpu": [ "x64" ], @@ -521,9 +521,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.55-7.tgz", - "integrity": "sha512-+2zlHahK3fUfkrnlHqbdQsZMPZwRfchoTxDZd9UHbEhQF7eNLzYN+7frWs6AZujU+h/1i92+mcLT18AQXI3KxQ==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.55.tgz", + "integrity": "sha512-5Q46Q72/l/U8KQRcBwYjzFPNXBCPG177FTmjEVOAH0qk7w58fMUDBEpnf9n1IpxYJDWQJ5BFGtLdfYgVVtkevw==", "cpu": [ "arm64" ], @@ -538,9 +538,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.55-7.tgz", - "integrity": "sha512-SGmvWcJHIKDIsjYZdFQloGw3Re6r2N1Zv1VuB1yV1ClVqfG5i5pTvai6vzX8d3WgGgRzrkLksDrzZKR27zJZ7A==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.55.tgz", + "integrity": "sha512-KWmMCDmKJivvOyDAAe5K8r7uSlVq8aZCh20VfrVXsc4bckO6KjXY/TOagrdBNqkk5rh8v63ghBbxFdWIOvEJRA==", "cpu": [ "x64" ], @@ -555,9 +555,9 @@ } }, "node_modules/@github/copilot-linuxmusl-arm64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.55-7.tgz", - "integrity": "sha512-rJkZLvz4KeGoLgyX6gcONgTNfFxeoQvN4jaAXlbD1nFP3hJbLTuY0CB4fBHmZWktrPkRL/j5aDGxrcIcl+Xg3A==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.55.tgz", + "integrity": "sha512-Jb5ug9Ic1pzxB2ZT1xoR8b3Ea1xnvCa4h8cBque51+TevXe6QF98vAfSUIwLe4xu+K6JKhiKEA0SD3w29Z74eA==", "cpu": [ "arm64" ], @@ -572,9 +572,9 @@ } }, "node_modules/@github/copilot-linuxmusl-x64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.55-7.tgz", - "integrity": "sha512-uPb08qgJHY1QW2YhA1OBJ9PB0CDwCvtuttWbeZ+AW+qfFVsvBpARU1cdEl/xT4IXMhBFoJiePv3BnLGjVZtoWA==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.55.tgz", + "integrity": "sha512-qMGIjHxKmW9q26EpoaNKWpmEVGyL/IM8ThVkh7yolDzv9lECFudPzT5yLX7f+VIiF6qWQlrQyzmamp7/fNQ2Zg==", "cpu": [ "x64" ], @@ -589,9 +589,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.55-7.tgz", - "integrity": "sha512-mb4Sg2sJjmK9Rq8XCRuhoIOjUScB5p2Ct9ZtTbC3ipvONWMOMjYPbLvC8K9GAHcYcHLdv98hvzv3+qjBhb5tZQ==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.55.tgz", + "integrity": "sha512-TO4EJ8it6Qki7wMKYHqGUEDYmB0EAToy+pE5++OpydB6FijyQ31+/XwjvdnEFkuB4ZgPqu/6Y8hxMKucl2+FYg==", "cpu": [ "arm64" ], @@ -606,9 +606,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.55-7", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.55-7.tgz", - "integrity": "sha512-GL9jAtkn2Kx4IO9ZfTiMC3LFd539KuuOx3uOIKciWKMuCvcfct0rdVkXlDr+EnrmPzu1A4PavcJ0RScpI39jUQ==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.55.tgz", + "integrity": "sha512-TBMiSZMz8Dhx79JeSEM+7ONGxR5NmxfiDUdySo6thVbRmjS9D8msyAP8ucTsbLBJcTFeb7vsaeObD/ujYQgDtA==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index 987137af3..fc2043356 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -11,7 +11,7 @@ "test": "vitest run" }, "devDependencies": { - "@github/copilot": "^1.0.55-7", + "@github/copilot": "^1.0.55", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "@types/node-forge": "^1.3.14",